Bladeren bron

fix(SCRM-5548): 取消纸质优惠券之后,如果回空,重新触发计算整体优惠接口

john 1 jaar geleden
bovenliggende
commit
37ca496f81
2 gewijzigde bestanden met toevoegingen van 13 en 2 verwijderingen
  1. 2 2
      src/pages/parkingFeeV2/mixins/parkingFeePaperCoupon.js
  2. 11 0
      src/store/order/paperCoupon.js

+ 2 - 2
src/pages/parkingFeeV2/mixins/parkingFeePaperCoupon.js

@@ -83,7 +83,7 @@ export default {
   },
   methods: {
     pageInit() {
-      this.paperCouponList = [...this.paperCoupons]
+            this.paperCouponList = [...this.paperCoupons]
     },
     showToast( text ) {
       let options = {};
@@ -243,7 +243,7 @@ export default {
     // 确认
     confirm() {
       // 如果用户没有选择纸质优惠券,则返回上一级页面
-      if(!this.paperCoupons.length) {
+      if(!this.paperCoupons.length && !this.orderDetail?.discountInfo?.paperCoupons) {
         this.$router.back();
         return
       }

+ 11 - 0
src/store/order/paperCoupon.js

@@ -33,6 +33,17 @@ export default {
       newOldDiscountSwitch = true
       method = getPaperCouponDescription
     }
+    if(checkOutResponse?.discountInfo?.paperCoupons?.length) {
+      const paperCouponsList = []
+      checkOutResponse.discountInfo.paperCoupons.forEach(elm => {
+        if(elm.couponCode && elm.discountFee) {
+          paperCouponsList.push(elm)
+        }
+      })
+      if(paperCouponsList.length) {
+        commit('setPaperCoupons', paperCouponsList)
+      }
+    }
     const res = await method({
       groupId: groupId,
       mallId: mallId,