优惠券限制

This commit is contained in:
@fawn-nine
2024-10-21 16:52:04 +08:00
parent 4f8b4bba11
commit a94c9d2c21
2 changed files with 7 additions and 2 deletions

View File

@@ -26,7 +26,7 @@
</view> </view>
<view style="width: 7%;"> <view style="width: 7%;">
<view class="" style="background-color: #d9d9d9; border-radius: 10rpx; 0 0 10rpx; text-align: center;" v-if="sumMeony < item.couponEntity.useLevel"> <view class="" style="background-color: #d9d9d9; border-radius: 10rpx; 0 0 10rpx; text-align: center;" v-if="item.canUse == 0">
<text <text
style="color: #999; " style="color: #999; "
>不可用</text> >不可用</text>
@@ -130,7 +130,7 @@
}, },
// 选择优惠券 // 选择优惠券
choseYouhui(e) { choseYouhui(e) {
if(this.list[e].couponEntity.useLevel > this.sumMeony ){ if(this.list[e].canUse == 0 ){
return return
} }
console.log('选中优惠券e', e); console.log('选中优惠券e', e);

View File

@@ -714,6 +714,11 @@
} }
if (res.code == 0) { if (res.code == 0) {
console.log("可用优惠券列表", res); console.log("可用优惠券列表", res);
res.couponHistoryList.forEach( item =>{
if(item.couponEntity.useLevel > this.totalPrice){
item.canUse = 0
}
})
this.couponHistoryList = res.couponHistoryList this.couponHistoryList = res.couponHistoryList
} }
this.$forceUpdate(); this.$forceUpdate();