修复判断是否有可用优惠券

This commit is contained in:
2025-10-10 11:30:29 +08:00
parent f0fee9085d
commit 87babdda60
3 changed files with 37 additions and 30 deletions

View File

@@ -18,7 +18,8 @@ export async function returnHasCouponCanUse(args) {
if(!res||res.length<=0){
return false
}
console.log('returnHasCouponCanUse:goodsOrderPrice',goodsOrderPrice);
console.log('returnHasCouponCanUse:allGoods',allGoods);
const canDikouGoodsArr = UTILS.returnCanDikouGoods(allGoods, [], user);
for (let i = 0; i < res.length; i++) {
const coupon = res[i]

View File

@@ -126,12 +126,11 @@ export function returnCouponCanUse(args) {
selCoupon,
shopInfo
} = args;
// 优惠券未启用
if (!coupon.use) {
return {
canUse: false,
reason: "优惠券未启用"
reason:coupon.noUseRestrictions|| "不在可用时间段内"
};
}