浏览代码

修改判断

lex 2 年之前
父节点
当前提交
f40fffb5f7
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/views/order-detail/use-coupons/choice-coupon.tsx

+ 2 - 3
src/views/order-detail/use-coupons/choice-coupon.tsx

@@ -55,6 +55,7 @@ export default defineComponent({
 
         // 处理可用优惠券是否支付使用
         this.list.forEach((item: any) => {
+          item.checked = false
           // 如果使用金额大于订单金额则优惠券不可用
           if (item.useLimit > this.orderAmount) {
             item.disabled = true
@@ -64,10 +65,8 @@ export default defineComponent({
 
           // 处理显示已选择的优惠券
           this.useCoupon.forEach((coupon: any) => {
-            if (item.id === coupon.id) {
+            if (item.couponIssueId === coupon.couponIssueId) {
               item.checked = true
-            } else {
-              item.checked = false
             }
           })
         })