Parcourir la source

feat(KIP-11804): 功能优化 | 车辆优惠叠加逻辑

john il y a 1 an
Parent
commit
d23c5cc574

+ 8 - 0
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -120,6 +120,10 @@ export default {
     checkboxItemChange(name, index) {
       const coupon  = this.couponList[index];
       if ( coupon.disabled ) {
+        if(!this.actualPayFee) {
+          Toast('当前无需追加优惠')
+          return;
+        }
         setTimeout(() => {
           // 根据电子券规则判断是否可选
           this.isDisabledByRule(coupon, index);
@@ -138,6 +142,10 @@ export default {
         return;
       }
       // 如果有选中项
+      if(!this.actualPayFee) {
+        Toast('当前无需追加优惠')
+        return;
+      }
       const item = this.couponList[index];
       this.remainPrice = this.remainPrice + this.couponList[index].discountFee
       this.newAvailableDiscountFee = this.newAvailableDiscountFee - this.couponList[index].discountFee

+ 4 - 0
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -640,6 +640,10 @@ export default {
       });
     },
     paperCoupon() {
+      if(!this.actualPayFee) {
+        Toast('当前无需追加优惠')
+        return;
+      }
       // totalFee 为零的时候不做跳转
       if (this.orderDetail.parkingRecord.totalFeeInYuan === 0) return;
       this.$router.push({

+ 8 - 0
src/pages/parkingFeeV2/mixins/parkingFeeCoupon.js

@@ -120,6 +120,10 @@ export default {
     checkboxItemChange(name, index) {
       const coupon  = this.couponList[index];
       if ( coupon.disabled ) {
+        if(!this.actualPayFee) {
+          Toast('当前无需追加优惠')
+          return;
+        }
         setTimeout(() => {
           // 根据电子券规则判断是否可选
           this.isDisabledByRule(coupon, index);
@@ -138,6 +142,10 @@ export default {
         return;
       }
       // 如果有选中项
+      if(!this.actualPayFee) {
+        Toast('当前无需追加优惠')
+        return;
+      }
       const item = this.couponList[index];
       this.remainPrice = this.remainPrice + this.couponList[index].discountFee
       this.newAvailableDiscountFee = this.newAvailableDiscountFee - this.couponList[index].discountFee

+ 4 - 0
src/pages/parkingFeeV2/mixins/parkingFeeDetail.js

@@ -731,6 +731,10 @@ export default {
       });
     },
     paperCoupon() {
+      if(!this.actualPayFee) {
+        Toast('当前无需追加优惠')
+        return;
+      }
       // totalFee 为零的时候不做跳转
       if (this.orderDetail.parkingRecord.totalFeeInYuan === 0) return;
       this.$router.push({

+ 5 - 0
src/store/order/points.js

@@ -1,5 +1,6 @@
 import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
 import { setSelected } from './utils'
+import {Toast} from "vant";
 
 export default {
 
@@ -177,6 +178,10 @@ export default {
     //   return
     // }
     if ( type === 'add' ) {
+      if(!state.actualPayFee) {
+        Toast('当前无需追加优惠')
+        return;
+      }
       // 如果天津的积分参与的抵扣金额大于等于当前车辆的总的停车费用,则阻止用户继续使用积分
       // if(parkMallCode === 6 && state?.usingTotalDiscount>= parkingRecord?.totalFeeInYuan) {
       //   return