Browse Source

fix(SCRM-5682):
1、积分不存在时依旧记录availableDiscountFee;
2、调整 当前无需追加优惠 的逻辑;
3、恢复3.1版本的每日限制逻辑;

john 1 năm trước cách đây
mục cha
commit
769e70c7cf

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

@@ -41,6 +41,9 @@ export default {
       maxOneDayCoupons: ( state ) => state.order.maxOneDayCoupons,// 仅限杭州当日电子券可选上限
       paperDiscountFee: ( state ) => state.order.paperDiscountFee,// 纸质券的优惠金额
     }),
+    totalFeeInYuan() {
+      return this?.orderDetail?.parkingRecord?.totalFee / 100
+    }
   },
 
   mounted() {
@@ -122,7 +125,7 @@ export default {
     checkboxItemChange(name, index) {
       const coupon  = this.couponList[index];
       if ( coupon.disabled ) {
-        if(!this.actualPayFee) {
+        if (this.totalFeeInYuan - this.paperDiscountFee - this.remainPrice < 1) {
           Toast('当前无需追加优惠')
           return;
         }
@@ -144,7 +147,8 @@ export default {
         return;
       }
       // 如果有选中项
-      if(!this.actualPayFee) {
+      // 还需支付金额 = 总金额 - 优惠金额
+      if (this.totalFeeInYuan - this.paperDiscountFee - this.remainPrice < 1) {
         Toast('当前无需追加优惠')
         return;
       }
@@ -334,7 +338,7 @@ export default {
         }
       }
       // 深圳超限处理
-      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.newAvailableDiscountFee) {
+      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.availableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: `优惠券已达当日使用上限,不可再用`,
@@ -344,7 +348,7 @@ export default {
       }
 
       // 单日上限
-      if (oneDayLimitation && this.remainPrice >= this.newAvailableDiscountFee) {
+      if (oneDayLimitation && this.remainPrice >= this.availableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: [5, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,

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

@@ -41,6 +41,9 @@ export default {
       maxOneDayCoupons: ( state ) => state.order.maxOneDayCoupons,// 仅限杭州当日电子券可选上限
       paperDiscountFee: ( state ) => state.order.paperDiscountFee,// 纸质券的优惠金额
     }),
+    totalFeeInYuan() {
+      return this?.orderDetail?.parkingRecord?.totalFee / 100
+    }
   },
 
   mounted() {
@@ -122,7 +125,7 @@ export default {
     checkboxItemChange(name, index) {
       const coupon  = this.couponList[index];
       if ( coupon.disabled ) {
-        if(!this.actualPayFee) {
+        if (this.totalFeeInYuan - this.paperDiscountFee - this.remainPrice < 1) {
           Toast('当前无需追加优惠')
           return;
         }
@@ -145,7 +148,8 @@ export default {
         return;
       }
       // 如果有选中项
-      if(!this.actualPayFee) {
+      // 还需支付金额 = 总金额 - 优惠金额
+      if (this.totalFeeInYuan - this.paperDiscountFee - this.remainPrice < 1) {
         Toast('当前无需追加优惠')
         return;
       }
@@ -335,7 +339,7 @@ export default {
         }
       }
       // 深圳超限处理
-      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.newAvailableDiscountFee) {
+      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.availableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: `优惠券已达当日使用上限,不可再用`,
@@ -345,7 +349,7 @@ export default {
       }
 
       // 单日上限
-      if (oneDayLimitation && this.remainPrice >= this.newAvailableDiscountFee) {
+      if (oneDayLimitation && this.remainPrice >= this.availableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: [5, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,

+ 2 - 1
src/store/order/points.js

@@ -24,6 +24,7 @@ export default {
       remainConsumeTime, // 当前订单剩余可使用的优惠
     } = parkingRule;
     commit('setEnablePoints',enablePoints);
+    commit('setAvailableDiscountFee',availableDiscountFee);
     if ( !points ) return commit('setIntegralDesc','暂无可用积分'); // 积分优惠处的描述
     const [
       {
@@ -38,7 +39,7 @@ export default {
         label,
       },
     ] = points;
-    commit('setAvailableDiscountFee',availableDiscountFee);
+    
     dispatch('maxPointsTimeMath',checkOutResponse) // 剩余积分可兑换上限
     
     commit('setAvailable',available);