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

Merge pull request #288 from John-Hong/John/release-2.19.0/SCRM-4776

fix(SCRM-4776): [DE][C端]临时停车,PD,用户只有一个小时消费减免,还有电子券或者积分的情况,当用户取消掉积分或者电子券优惠,再点击停车优惠,用户的消费减免就会变成2小时
Tron 1 жил өмнө
parent
commit
c1770ff580

+ 3 - 2
src/pages/parkingFeeV2/mixins/parkingFeeDiscounts.js

@@ -300,7 +300,9 @@ export default {
         const isSelected = this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected;
         const isCheckedListSelected = this.checkedList.indexOf('consume') > -1;
         if(maxOneTimeDiscountTimeFee > this.remainPrice) {
-          this.maxReduceDiscount = (maxOneTimeDiscountTimeFee - this.remainPrice) / hourPrice + (isSelected ? this.reduceHours : 0)
+          // 优惠计算公式: 剩余可用优惠 + 已经选择的优惠 = 总的消费减免的优惠(小时)
+          const maxReduceDiscount = (maxOneTimeDiscountTimeFee - this.remainPrice) / hourPrice + (isSelected ? this.reduceHours : 0) 
+          this.maxReduceDiscount = maxReduceDiscount > maxOneTimeDiscountTime ? maxOneTimeDiscountTime: maxReduceDiscount
           !isSelected && (this.reduceHours = this.maxReduceDiscount)
           return
         }
@@ -372,7 +374,6 @@ export default {
       }
     },
     memberClick() {
-      // debugger
       const { maxConsumeTime, remainConsumeTime, availableDiscountFee, hourPrice } = this.orderDetail.parkingRule;
       if (this.checkedList.indexOf('member') > -1) {
         /* 浦东 */