Эх сурвалжийг харах

Merge pull request #559 from tron/lock/release-3.11.0/KIP-17239

feat(KIP-17073): Temp Parking Service | 福州临停规则修改为QHKC模式
John-Hong 1 жил өмнө
parent
commit
701ff1ac18

+ 14 - 14
src/pages/parkingFeeV2/mixins/parkingFeeCoupon.js

@@ -85,7 +85,7 @@ export default {
         this.remainPrice = this.remainPrice - this.orderDetail.discountInfo.points[0].discountFee
       }   
       // 前海积分不参与当前电子券优惠上限
-      if ( [ 5, 10 ].indexOf(parkMallCode) > -1 && 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
       }
       this.newAvailableDiscountFee = this.availableDiscountFee
@@ -113,7 +113,7 @@ export default {
           // 验证剩余优惠券是否可勾选(无需验证:后端已计算可勾选的优惠券)
           this.newGroupedCouponData()
           this.setAllDisabled()
-          if (this.parkMallCode === 4 || this.parkMallCode === 6  || this.parkMallCode === 5) {
+          if (this.parkMallCode === 4 || this.parkMallCode === 6  || this.parkMallCode === 5 || this.parkMallCode === 8) {
             this.isDisabledByRule(this.couponList[0], 0, 'showMsg');
           }          
         })
@@ -169,7 +169,7 @@ export default {
     // 获取还需支付金额
     getAmountToBePaid() {
       let amountToBePaid = this.totalFee - this.paperDiscountFee - this.remainPrice;
-      if([ 5, 10 ].indexOf(this.parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
+      if([ 5, 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) {
@@ -182,8 +182,8 @@ export default {
       const {parkInfo,parkingRule} = this.orderDetail
       const { parkMallCode } = parkInfo;
       const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
-      // 设置深圳的达到优惠金额的上限,置灰剩下未选择的金额
-      if ( [5, 10].indexOf(parkMallCode) > -1 && this.remainPrice >= this.newAvailableDiscountFee) {
+      // 设置深圳、福州的达到优惠金额的上限,置灰剩下未选择的金额
+      if ( [5, 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
@@ -193,7 +193,7 @@ export default {
         return true
       }
       // 单日上限限制
-      if ( oneDayLimitation  && [5, 10].indexOf(parkMallCode) < 0) {
+      if ( oneDayLimitation  && [5, 8, 10].indexOf(parkMallCode) < 0) {
         const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
         const remainConsumeTimeFee = remainConsumeTime * hourPrice
         
@@ -210,7 +210,7 @@ export default {
         }
       }
       // 单次上限限制
-      if ( oneTimeLimitation && [5,10].indexOf(parkMallCode) < 0 ) {
+      if ( oneTimeLimitation && [5, 8, 10].indexOf(parkMallCode) < 0 ) {
         const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
         // const remainConsumeTimeFee = remainConsumeTime * hourPrice
         // 计算单日剩余 remainConsumeTime
@@ -226,7 +226,7 @@ export default {
         }
       }
       // 杭州、福州、深圳前海 电子券选择上限判断
-      if ( (parkMallCode === 2 || parkMallCode === 8 || parkMallCode === 7 || parkMallCode === 9  || parkMallCode === 5) && this.checkedCouponList.length >= this.remainCoupons ) {
+      if ( (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
@@ -302,7 +302,7 @@ export default {
         });
       }
       // 电子券上限判断(杭州、福州)
-      if ( this.checkedCouponList.length >= this.remainCoupons && (this.parkMallCode === 2 || this.parkMallCode === 8 || this.parkMallCode === 7 || this.parkMallCode === 9 || this.parkMallCode === 5) ) {
+      if ( this.checkedCouponList.length >= this.remainCoupons && (this.parkMallCode === 2 || this.parkMallCode === 8 || this.parkMallCode === 7 || this.parkMallCode === 9 || this.parkMallCode === 5 || this.parkMallCode === 8) ) {
         if ( showMsg ) return true
         return Toast({
           message: `电子券每天最多可使用${ this.maxOneDayCoupons }张`,
@@ -312,7 +312,7 @@ export default {
       }
 
       // 浦东每次缴费超限控制、沈阳每日超限控制
-      if ([1,4,5,999,6,10].indexOf(parkMallCode) > -1 && this.crossMessage(showMsg)) {
+      if ([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;
@@ -344,13 +344,13 @@ export default {
       } = this.orderDetail.parkingRecord;
       // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
       let remainPrice = remainConsumeTime * hourPrice;
-      if (parkMallCode === 5 || parkMallCode === 10) {
+      if (parkMallCode === 5 || parkMallCode === 8 || parkMallCode === 10) {
         if (remainPrice - this.paperDiscountFee > actualPayFee) {
           remainPrice = actualPayFee;
         }
       }
       // 深圳超限处理
-      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.availableDiscountFee) {
+      if ([5, 8, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.availableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: `优惠券已达当日使用上限,不可再用`,
@@ -363,14 +363,14 @@ export default {
       if (oneDayLimitation && this.remainPrice >= this.availableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
-          message: [5, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,
+          message: [5, 8, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,
           className: "white-space",
           icon: 'none',
         });
       }
       const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
       // 单次上限限制
-      if ( oneTimeLimitation && [5, 10].indexOf(parkMallCode) < 0 && this.remainPrice >= maxOneTimeDiscountFee) {
+      if ( oneTimeLimitation && [5, 8, 10].indexOf(parkMallCode) < 0 && this.remainPrice >= maxOneTimeDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,

+ 3 - 3
src/pages/parkingFeeV2/parkingFeeDetail.vue

@@ -133,14 +133,14 @@
         <div class="popue_box_index1">积分减免</div>
         <div class="popue_box_index">
           <div>减免规则</div>
-          <div style="color: #989898">{{ pointsPerHour }}积分抵扣{{ [ 5, 10 ].indexOf(orderDetail.parkInfo.parkMallCode) > -1 ? unitAmount + '元' : '1小时' }}</div>
+          <div style="color: #989898">{{ pointsPerHour }}积分抵扣{{ [ 5, 8, 10 ].indexOf(orderDetail.parkInfo.parkMallCode) > -1 ? unitAmount + '元' : '1小时' }}</div>
         </div>
         <div class="popue_box_index">
           <div>可用积分</div>
           <div style="color: #999999">{{ available }}分</div>
         </div>
         <div class="popue_box_index">
-          <div>抵扣{{ [ 5,10 ].indexOf(orderDetail.parkInfo.parkMallCode) > -1 ? '金额' : '时长' }}</div>
+          <div>抵扣{{ [ 5, 8, 10 ].indexOf(orderDetail.parkInfo.parkMallCode) > -1 ? '金额' : '时长' }}</div>
           <div class="popue_box_index" style="width: 335px">
             <div class="popue_box_index4_xs van-hairline--surround">
               <div class="popue_box_index4_xs_index1" @click="$store.dispatch('order/pointsMath',{type: 'minus', callback: pointsMathCallback})">
@@ -152,7 +152,7 @@
               </div>
             </div>
             <div style="color: #808080">
-              {{ [ 5,10 ].indexOf(orderDetail.parkInfo.parkMallCode) > -1 ? '元' : '小时' }}
+              {{ [ 5, 8, 10 ].indexOf(orderDetail.parkInfo.parkMallCode) > -1 ? '元' : '小时' }}
             </div>
           </div>
         </div>

+ 11 - 11
src/store/order/points.js

@@ -50,7 +50,7 @@ export default {
     commit('setMaxDiscountFee',maxDiscountFee);
     let pointsTime = 0
     // 深圳
-    if ( parkMallCode === 5 || parkMallCode === 10) {
+    if ( parkMallCode === 5 || parkMallCode === 8 || parkMallCode === 10) {
       pointsTime = discountFee || 0
     } else  {
       pointsTime = discountFee ?  discountFee / unitAmount: 0
@@ -140,7 +140,7 @@ export default {
       maxPointsTime = state.availableDiscountFee
     }
     // if ( parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT' ) {
-    if ( [ 5, 10 ].indexOf(parkMallCode) > -1 && !state.unLimitWeekendPoints ) {
+    if ( [ 5, 8, 10 ].indexOf(parkMallCode) > -1 && !state.unLimitWeekendPoints ) {
       if ( type === 'add' && (state.pointsTime >= maxPointsTime || state.usingTotalDiscount - state.paperDiscountFee >= state.availableDiscountFee) ) {
         // 以下是深圳积分上限规则
         // 超出抵扣上限,每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元 '优惠金额' >= '每日最高可抵扣'
@@ -151,7 +151,7 @@ export default {
         // console.log(4444, points.remainDiscountFeePerDay, state.maxDiscountFee)
         if ( state.pointsTime >= state.maxDiscountFee && !msg ) {
           // 当前当日积分抵扣上限总额 小于单次积分抵扣金额,加积分抵扣提示 “已达当日积分抵扣上限”
-          if ([ 5 ].indexOf(parkMallCode) > -1 && points.remainDiscountFeePerDay === state.maxDiscountFee) {
+          if ([ 5, 8 ].indexOf(parkMallCode) > -1 && points.remainDiscountFeePerDay === state.maxDiscountFee) {
             msg = `已达当日积分抵扣上限`
             
           } else { // 当前当日积分抵扣上限总额 大于或者等于单次积分抵扣金额,加积分抵扣提示 “超出抵扣上限,每次最高可抵扣 *** 元”
@@ -162,7 +162,7 @@ export default {
       }
     }
     // 单日上限限制
-    if ( oneDayLimitation && !msg && [5,4,2, 10].indexOf(parkMallCode) < 0 && type === 'add') {
+    if ( oneDayLimitation && !msg && [5,4,2, 8, 10].indexOf(parkMallCode) < 0 && type === 'add') {
       // const maxOneTimeDiscountFee = maxOneDayDiscountFee
       // const remainConsumeTimeFee = remainConsumeTime * hourPrice
       // 计算单日剩余 remainConsumeTime
@@ -174,7 +174,7 @@ export default {
       }
     }
     // 单次上限限制
-    if ( oneTimeLimitation && !msg && [5, 10].indexOf(parkMallCode) < 0 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
+    if ( oneTimeLimitation && !msg && [5, 8, 10].indexOf(parkMallCode) < 0 && parkMallCode !== 4 && parkMallCode !== 2 && type === 'add') {
       const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice // 计算时间对应的金额
       // const remainConsumeTimeFee = remainConsumeTime * hourPrice
       // 计算单日剩余 remainConsumeTime
@@ -220,7 +220,7 @@ export default {
       //   return
       // }
       let pointsTime = 0;
-      pointsTime = state.pointsTime + ([5,10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
+      pointsTime = state.pointsTime + ([5, 8, 10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
       const available = state.available - state.pointsPerUnit;
       const usingTotalDiscount = state.usingTotalDiscount + (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
       if ( available > -1 ) {
@@ -231,7 +231,7 @@ export default {
       }
     }
     if ( type === 'minus' && state.pointsTime > 0 ) {
-      const pointsTime = state.pointsTime - ([5,10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
+      const pointsTime = state.pointsTime - ([5, 8, 10].indexOf(parkMallCode) > -1 ? state.unitAmount : state.unitHour);
       const usingTotalDiscount = state.usingTotalDiscount - (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
       // 如果是深圳车场
       commit('setAvailable',state.available + state.pointsPerUnit);
@@ -253,7 +253,7 @@ export default {
     }
     let pointsTime = 0
     // 深圳
-    if ( parkMallCode === 5 || parkMallCode === 10) {
+    if ( parkMallCode === 5 || parkMallCode === 8 || parkMallCode === 10) {
       pointsTime = discountFee || 0
     } else  {
       pointsTime = discountFee ?  discountFee / unitAmount : 0
@@ -277,7 +277,7 @@ export default {
       setSelected(['memberGrade','consume','paperCoupons','coupons','newMemberPoints'],orderDetail)
       // 计算积分修改之后的金额,返回给后端
       // orderDetail.discountInfo.points[0].discountFee = state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
-      orderDetail.discountInfo.points[0].discountFee = [5,10].indexOf(parkMallCode) > -1 ? state.pointsTime : state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
+      orderDetail.discountInfo.points[0].discountFee = [5, 8, 10].indexOf(parkMallCode) > -1 ? state.pointsTime : state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
       orderDetail.discountInfo.points[0].available = state.available;
       orderDetail.discountInfo.points[0].selected = true;
       /* 其他优惠统计 */
@@ -344,7 +344,7 @@ export default {
   integralDescTule({commit,dispatch,state},{pointsTime, parkMallCode, available, pointsPerUnit, enableNewMemberPoints, newMemberPoints,unitAmount, checkOutResponse} ) {
     //  commit('setIntegralDesc',pointsTime ? `已选择兑换${ pointsTime }${parkMallCode === 5 || parkMallCode === 10 ? '元' : '小时'}` : available > pointsPerUnit ? `${ available }积分可减免` : `${ pointsPerUnit }积分可停车1小时`); // 积分优惠处的描述
     if(pointsTime) {
-      commit('setIntegralDesc', `已选择兑换${ pointsTime }${[5, 10].indexOf(parkMallCode)> -1 ? '元' : '小时'}`)
+      commit('setIntegralDesc', `已选择兑换${ pointsTime }${[5, 8, 10].indexOf(parkMallCode)> -1 ? '元' : '小时'}`)
       return
     }
     if(available > pointsPerUnit) {
@@ -357,7 +357,7 @@ export default {
       commit('setIntegralDesc', `${ available }积分可减免`)
       return
     }
-    commit('setIntegralDesc', `${ pointsPerUnit }积分可停车${[5, 10].indexOf(parkMallCode)> -1 ? unitAmount + '元' : '1小时'}`)
+    commit('setIntegralDesc', `${ pointsPerUnit }积分可停车${[5, 8, 10].indexOf(parkMallCode)> -1 ? unitAmount + '元' : '1小时'}`)
   }
 }