fix: 问题修复
This commit is contained in:
@@ -1707,12 +1707,17 @@ export function calculateOrderCostSummary(
|
||||
}
|
||||
|
||||
// 5. 最终实付金额计算(整合所有费用)
|
||||
const finalPayAmount = new BigNumber(goodsOriginalAmount) // 商品原价总和
|
||||
// 先计算减去所有折扣后的金额,并确保最小值为0
|
||||
const discountedAmount = new BigNumber(goodsOriginalAmount) // 商品原价总和
|
||||
.minus(goodsDiscountAmount) // 减去商品折扣
|
||||
.minus(couponDeductionAmount) // 减去优惠券抵扣
|
||||
.minus(newUserDiscount) // 新客立减
|
||||
.minus(pointDeductionAmount) // 减去积分抵扣
|
||||
.minus(merchantReductionActualAmount) // 减去商家实际减免金额
|
||||
.minus(merchantReductionActualAmount); // 减去商家实际减免金额
|
||||
|
||||
// 确保折扣后金额不小于0,再加上后续费用
|
||||
const nonNegativeAmount = discountedAmount.gt(0) ? discountedAmount : new BigNumber(0);
|
||||
const finalPayAmount = nonNegativeAmount
|
||||
.plus(seatFee) // 加上餐位费(不参与减免)
|
||||
.plus(packFee) // 加上打包费(不参与减免)
|
||||
.plus(additionalFee); // 加上附加费
|
||||
|
||||
Reference in New Issue
Block a user