租期天数改为向上取整到整天

不足一天按一天计(如 1.3/1.7 均计 2 天),前后端展示与预计时长计算保持一致。
This commit is contained in:
yml2213
2026-07-20 22:14:03 +08:00
parent 4f979e1e29
commit 0ef6a481f5
3 changed files with 46 additions and 12 deletions
+2 -1
View File
@@ -307,7 +307,8 @@ export function getEstimatedRentalDays(item: Listing) {
export function formatEstimatedRentalDuration(item: Listing) {
const days = getEstimatedRentalDays(item)
if (days <= 0) return '--'
return `${Math.max(1, Math.round(days))}`
// 不足整天按整天向上取整,与后端 estimateOrderDurationHours 一致
return `${Math.max(1, Math.ceil(days))}`
}
export function readAssetString(item: Listing, key: string) {