fix(pricing): 统一将计价计算从向下取整改为四舍五入

统一修复所有计价相关模块的取整逻辑:将Lua计价函数中的直接返回改为四舍五入取整,同时将前后端代码中的Math.floor替换为Math.round,确保全链路的票价计算采用标准四舍五入规则,避免出现不合理的定价偏差。
This commit is contained in:
2026-07-09 23:40:08 +08:00
parent e07536e8c0
commit b3fdf36f84
6 changed files with 27 additions and 8 deletions
+1 -1
View File
@@ -567,7 +567,7 @@
const discountedRaw = (type==='Express')
? (fare?.discounted_express_fare ?? fare?.['优惠后特快票价'])
: (fare?.discounted_regular_fare ?? fare?.['优惠后常规票价']);
const discountedSingle = Number(discountedRaw ?? Math.floor(base * disc) ?? 0);
const discountedSingle = Number(discountedRaw ?? Math.round(base * disc) ?? 0);
const price = discountedSingle * trips;
const routeKey = (type === 'Express') ? 'express_path' : 'regular_path';