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
@@ -215,7 +215,7 @@ const LogicService = {
const baseExp = Number(baseBoth?.express ?? 0) || 0;
const discount = Number(cfg?.promotion?.discount ?? 1);
const base = (trainType === 'Express') ? baseExp : baseReg;
return Math.floor(base * (discount > 0 ? discount : 1));
return Math.round(base * (discount > 0 ? discount : 1));
} catch (_) { return 0; }
},