功能:完善评论测试与优惠券最优选择

This commit is contained in:
xiaowang
2026-05-16 14:28:42 +08:00
parent 1f05e0ab44
commit 4563dd2538
31 changed files with 1130 additions and 581 deletions
+3 -4
View File
@@ -242,11 +242,10 @@ Page({
}
if (selectedCouponKey === NO_COUPON_KEY) {
const vipCoupons = list
.filter(item => item.sourceType === 'SYSTEM_VIP')
const bestCoupons = list
.sort((left, right) => calculateCouponDiscount(right, subtotalAmount) - calculateCouponDiscount(left, subtotalAmount))
if (vipCoupons.length) {
selectedCouponKey = vipCoupons[0].key
if (bestCoupons.length) {
selectedCouponKey = bestCoupons[0].key
}
}