Explorar o código

fix(KIP-10830): 【DE】【C端】【天津】临时停车,当用户的抵扣金额达到应缴金额后,用户无法操作积分的增加和减少

john %!s(int64=2) %!d(string=hai) anos
pai
achega
a8d2e18297
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      src/store/order/points.js

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

@@ -138,26 +138,27 @@ export default {
       }
     }
     // 单日上限限制
-    if ( oneDayLimitation && !msg && parkMallCode !== 5 && parkMallCode !== 4 && parkMallCode !== 2) {
+    if ( oneDayLimitation && !msg && parkMallCode !== 5 && parkMallCode !== 4 && parkMallCode !== 2 && && type === 'add') {
       // const maxOneTimeDiscountFee = maxOneDayDiscountFee
       // const remainConsumeTimeFee = remainConsumeTime * hourPrice
       // 计算单日剩余 remainConsumeTime
       // 当前使用优惠 state.usingTotalDiscount
       // 判断符合上限
       // 浦东积分上限判断
-      if ( (parkMallCode === 1 || parkMallCode === 6) && type === 'add' && state.usingTotalDiscount >= maxOneDayDiscountFee ) {
+      if ( (parkMallCode === 1 && state.usingTotalDiscount >= maxOneDayDiscountFee) 
+      || (parkMallCode === 6 && state.usingTotalDiscount >= state.availableDiscountFee ) ) {
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneDayDiscountFee }元`
       }
     }
     // 单次上限限制
-    if ( oneTimeLimitation && !msg && parkMallCode !== 5 && parkMallCode !== 4 && parkMallCode !== 2) {
+    if ( oneTimeLimitation && !msg && parkMallCode !== 5 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
       const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice // 计算时间对应的金额
       // const remainConsumeTimeFee = remainConsumeTime * hourPrice
       // 计算单日剩余 remainConsumeTime
       // 当前使用优惠 state.usingTotalDiscount
       // 判断符合上限
       // 浦东积分上限判断: 减去纸质优惠券的金额
-      if ( (parkMallCode === 1 || parkMallCode === 6) && type === 'add' && state.usingTotalDiscount >= maxOneTimeDiscountFee ) {
+      if ( (parkMallCode === 1 && state.usingTotalDiscount >= maxOneTimeDiscountFee) || (parkMallCode === 6 && state.usingTotalDiscount >= state.availableDiscountFee) ) {
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
       }
     }