Просмотр исходного кода

feat(KIP-18408): Temp parking frontend |SKC\JAKC\KP\BKC\|电子券上限

lock.qiu 10 месяцев назад
Родитель
Сommit
c11f809f56
2 измененных файлов с 29 добавлено и 19 удалено
  1. 27 17
      src/pages/parkingFeeV2/mixins/parkingFeeCoupon.js
  2. 2 2
      src/store/order/coupon.js

+ 27 - 17
src/pages/parkingFeeV2/mixins/parkingFeeCoupon.js

@@ -89,7 +89,7 @@ export default {
       if ((this.parkMallCode === 4 || this.parkMallCode === 6) && this.orderDetail?.discountInfo?.points?.[0]?.discountFee) {
         this.remainPrice = this.remainPrice - this.orderDetail.discountInfo.points[0].discountFee
       }
-      // 前海积分不参与当前电子券优惠上限
+      // 前海积分不参与当前电子券优惠上限 (福州、深圳建设广场)
       if ( [ 5, 8, 10 ].indexOf(parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
         this.remainPrice = this.remainPrice - this.orderDetail?.discountInfo?.points[0]?.discountFee
       }
@@ -115,10 +115,11 @@ export default {
           });
         }
         this.$nextTick(() => {
-          // 验证剩余优惠券是否可勾选(无需验证:后端已计算可勾选的优惠券)
+          // 验证剩余优惠券是否可勾选(无需验证:后端已计算可勾选的优惠券) 4, 0, 1, 3, 10,
           this.newGroupedCouponData()
           this.setAllDisabled()
-          if (this.parkMallCode === 4 || this.parkMallCode === 6  || this.parkMallCode === 5 || this.parkMallCode === 8) {
+          if ([0, 1, 3, 10, 4, 5, 6, 8].indexOf(parkMallCode) > -1) {
+          // if (this.parkMallCode === 4 || this.parkMallCode === 6  || this.parkMallCode === 5 || this.parkMallCode === 8) {
             this.isDisabledByRule(this.couponList[0], 0, 'showMsg');
           }
         })
@@ -171,12 +172,12 @@ export default {
     // 获取还需支付金额
     getAmountToBePaid() {
       let amountToBePaid = this.totalFee - this.paperDiscountFee - this.remainPrice;
-      if([ 5, 6, 8, 10 ].indexOf(this.parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
-        amountToBePaid = amountToBePaid - this.orderDetail.discountInfo?.points?.[0]?.discountFee
-      }
-      if ([4, 6].indexOf(this.parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
+      if([ 0, 1, 3, 4, 5, 6, 8, 10 ].indexOf(this.parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
         amountToBePaid = amountToBePaid - this.orderDetail.discountInfo?.points?.[0]?.discountFee
       }
+      // if ([4, 6].indexOf(this.parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
+      //   amountToBePaid = amountToBePaid - this.orderDetail.discountInfo?.points?.[0]?.discountFee
+      // }
       return amountToBePaid
     },
     // 针对达到优惠的上限制
@@ -185,7 +186,7 @@ export default {
       const { parkMallCode } = parkInfo;
       const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
       // 设置深圳、福州的达到优惠金额的上限,置灰剩下未选择的金额
-      if ( [5, 6, 8, 10].indexOf(parkMallCode) > -1 && this.remainPrice >= this.newAvailableDiscountFee) {
+      if ( [0, 1, 3, 4, 5, 6, 8, 10].indexOf(parkMallCode) > -1 && this.remainPrice >= this.newAvailableDiscountFee) {
         this.couponList = this.couponList.map((elm,iemi) => {
           if ( !elm.disabled && this.checkedCouponList.indexOf(`coupon${iemi}`) < 0) {
             elm.disabled = true
@@ -195,7 +196,7 @@ export default {
         return true
       }
       // 单日上限限制
-      if ( oneDayLimitation  && [5, 6, 8, 10].indexOf(parkMallCode) < 0) {
+      if ( oneDayLimitation  && [0, 1, 3, 4, 5, 6, 8, 10].indexOf(parkMallCode) < 0) {
         const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
         const remainConsumeTimeFee = remainConsumeTime * hourPrice
         
@@ -228,7 +229,9 @@ export default {
         }
       }
       // 杭州、福州、深圳前海 电子券选择上限判断 +天津 20240911
-      if ( (parkMallCode === 6  || parkMallCode === 2 || parkMallCode === 8 || parkMallCode === 7 || parkMallCode === 9  || parkMallCode === 5 || parkMallCode === 8) && this.checkedCouponList.length >= this.remainCoupons ) {
+      if ( ([0, 1, 3, 10, 4, 2, 5, 6, 7, 8, 9, 10].indexOf(parkMallCode) > -1) && this.checkedCouponList.length >= this.remainCoupons ) {
+
+      // if ( (parkMallCode === 6  || parkMallCode === 2 || parkMallCode === 8 || parkMallCode === 7 || parkMallCode === 9  || parkMallCode === 5 || parkMallCode === 8) && this.checkedCouponList.length >= this.remainCoupons ) {
         this.couponList = this.couponList.map(( elm,iemi ) => {
           if ( !elm.disabled && this.checkedCouponList.indexOf(`coupon${ iemi }`) < 0 ) {
             elm.disabled = true
@@ -249,7 +252,10 @@ export default {
         return
       }
       // 如果杭州、福州的使用券打到上限则不自动计算其余券是否可选 +天津 20240911
-      if (this.checkedCouponList.length >= this.remainCoupons && (this.parkMallCode === 6 || this.parkMallCode === 2 || this.parkMallCode === 8 || this.parkMallCode === 7 || this.parkMallCode === 9 || this.parkMallCode === 5)) {
+      
+      if (this.checkedCouponList.length >= this.remainCoupons && ([0, 1, 3, 10, 4, 2, 5, 6, 7, 8, 9, 10].indexOf(parkMallCode) > -1)) {
+
+      // if (this.checkedCouponList.length >= this.remainCoupons && (this.parkMallCode === 6 || this.parkMallCode === 2 || this.parkMallCode === 8 || this.parkMallCode === 7 || this.parkMallCode === 9 || this.parkMallCode === 5)) {
         return
       }
       const index = this.item2Number(this.checkedCouponList[0])
@@ -303,7 +309,9 @@ export default {
         });
       }
       // 电子券上限判断(杭州、福州)+天津 20240911
-      if ( this.checkedCouponList.length >= this.remainCoupons && (this.parkMallCode === 2 || this.parkMallCode === 6 || this.parkMallCode === 7 || this.parkMallCode === 9 || this.parkMallCode === 5 || this.parkMallCode === 8) ) {
+      if ( this.checkedCouponList.length >= this.remainCoupons && ([0, 1, 3, 10, 4, 2, 5, 6, 7, 8, 9, 10].indexOf(parkMallCode) > -1) ) {
+
+      // if ( this.checkedCouponList.length >= this.remainCoupons && (this.parkMallCode === 2 || this.parkMallCode === 6 || this.parkMallCode === 7 || this.parkMallCode === 9 || this.parkMallCode === 5 || this.parkMallCode === 8) ) {
         if ( showMsg ) return true
         return Toast({
           message: `电子券每天最多可使用${this.maxOneDayCoupons}张`,
@@ -312,8 +320,8 @@ export default {
         });
       }
       
-      // 浦东每次缴费超限控制、沈阳每日超限控制
-      if ([1,4,5,999, 8, 6,10].indexOf(parkMallCode) > -1 && this.crossMessage(showMsg)) {
+      // 浦东每次缴费超限控制、沈阳每日超限控制 
+      if ([0, 3, 1,4,5,999, 8, 6,10].indexOf(parkMallCode) > -1 && this.crossMessage(showMsg)) {
         this.couponList = this.couponList.map((e, i) => {
           if (this.checkedCouponList.findIndex((c) => c === `coupon${i}`) === -1) {
             e.disabled = true;
@@ -346,13 +354,15 @@ export default {
       } = this.orderDetail.parkingRecord;
       // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
       let remainPrice = remainConsumeTime * hourPrice;
-      if (parkMallCode === 5 || parkMallCode === 6 || parkMallCode === 8 || parkMallCode === 10) {
+      if ([0, 1, 3, 4, 5, 6, 8, 10].indexOf(parkMallCode) > -1) {
+
+      // if (parkMallCode === 5 || parkMallCode === 6 || parkMallCode === 8 || parkMallCode === 10) {
         if (remainPrice - this.paperDiscountFee > actualPayFee) {
           remainPrice = actualPayFee;
         }
       }
       // 深圳超限处理 +天津 20240911
-      if ([5, 6, 8, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.availableDiscountFee) {
+      if ([0, 1, 3, 4, 5, 6, 8, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.availableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: `优惠券已达当日使用上限,不可再用`,
@@ -365,7 +375,7 @@ export default {
       if (oneDayLimitation && this.remainPrice >= this.availableDiscountFee) {
         if (showMsg) return true
         return Toast({
-          message: [5, 6, 8, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,
+          message: [0, 1, 3, 4, 5, 6, 8, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,
           className: "white-space",
           icon: 'none',
         });

+ 2 - 2
src/store/order/coupon.js

@@ -20,8 +20,8 @@ export default {
       if([5].indexOf(checkOutResponse.parkInfo.parkMallCode) > -1 && !checkOutResponse.parkingRule.availableDiscountFee) {
         return commit('setCouponDesc', '当日优惠已达上限,不可用');
       }
-      // 电子券使用数量上限提示逻辑补充: 杭州, 合集, 深圳前海湾、福州、+天津 20240911
-      if([2, 5, 6, 7, 8, 9].indexOf(checkOutResponse.parkInfo.parkMallCode) > -1 && !checkOutResponse.parkingRule.remainCoupons) {
+      // 电子券使用数量上限提示逻辑补充: 杭州, 合集, 深圳前海湾、福州、+天津 20240911 +SKC\JAKC\KP\BKC\TKC\SZKP
+      if([4, 0, 1, 3, 10, 2, 5, 6, 7, 8, 9].indexOf(checkOutResponse.parkInfo.parkMallCode) > -1 && !checkOutResponse.parkingRule.remainCoupons) {
         return commit('setCouponDesc', '优惠券已达当日使用上限,不可用');
       }
       if ( checkOutResponse?.discountInfo?.coupons?.length ) {