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

Merge pull request #145 from John-Hong/John/release-2.10.0/KIP-10514

fix(KIP-10514): 【DE】【C端】【静安】。消费减免的”+“号在用户没有5小时减免时,仍可以增加到5小时减免。
Tron 2 жил өмнө
parent
commit
d6f8721247

+ 62 - 0
src/api/mockData/checkout.pd13.response.json

@@ -0,0 +1,62 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪D10001",
+    "enterTime": "2023-05-17 15:53:00",
+    "serviceMin": 23165,
+    "totalFee": 4000,
+    "actualPayFee": 16,
+    "thirdParkOrderNo": "4970728",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 40
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 24,
+    "memberLevelDiscount": false,
+    "consume": [
+      {
+        "defaultSelected": true,
+        "defaultDiscountTime": 10,
+        "discountFee": 24,
+        "redeemSalesAmount": 600,
+        "couponCodes": "0jv2pvambb3_t#8vr1b9wdbli_t#q2q9tqk9fjn_t#b5mkwsc4yag_t#8wl0qimifpi_t#ltvnf11f91l_t#01wn30uhezy_t#ljw41t7natw_t#x2rvzaj44e1_t#p62cmqrlhtk_t"
+      }
+    ],
+    "points": [
+      {
+        "available": 8800,
+        "pointsPerUnit": 1200,
+        "unitAmount": 12,
+        "totalAvailable": 8800,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "8800积分可减免"
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 2,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 10,
+    "remainConsumeTime": 10,
+    "hourPrice": 12,
+    "oneTimeLimitation": true,
+    "oneDayLimitation": false
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里城",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,",
+    "parkMallCode": 1,
+    "buildingId": "184-100035"
+  }
+}

+ 8 - 8
src/pages/parkingFee/mixins/parkingFeeDiscounts.js

@@ -129,7 +129,7 @@ export default {
       }
       this.checkedList = [];
       const { memberGrade = [], consume = [], memberLevelDiscount } = this.orderDetail.discountInfo;
-      const { maxConsumeTime } = this.orderDetail.parkingRule;
+      const { maxConsumeTime,remainConsumeTime } = this.orderDetail.parkingRule;
       this.memberGrade = { ...memberGrade[0] };
       this.consume = { ...consume[0] };
       if (JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected) {
@@ -148,8 +148,8 @@ export default {
       }
       this.isReduces = this.consume.hasOwnProperty('selected') || this.consume.hasOwnProperty('defaultSelected') ? false : true;
       this.reduceHours = this.consume.hasOwnProperty('discountFee') ? this.consume.discountFee / this.orderDetail.parkingRule.hourPrice : this.consume.defaultDiscountTime;
-      if (maxConsumeTime) {
-        this.maxReduceDiscount = maxConsumeTime;
+      if (remainConsumeTime) {
+        this.maxReduceDiscount = remainConsumeTime;
       }
       this.oldCheckedList = [...this.checkedList];
     },
@@ -183,12 +183,12 @@ export default {
       }
     },
     memberClick() {
-      const { maxConsumeTime } = this.orderDetail.parkingRule;
+      const { maxConsumeTime, remainConsumeTime } = this.orderDetail.parkingRule;
       if (this.checkedList.indexOf('member') > -1) {
         this.remainPrice = this.memberGrade.discountFee + this.remainPrice;
       } else if (!this.isMember) {
         this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
-        this.maxReduceDiscount = maxConsumeTime;
+        this.maxReduceDiscount = remainConsumeTime;
       }
       const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
       if (isCrossMessage) {
@@ -198,7 +198,7 @@ export default {
       }
     },
     reducesClick() {
-      const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, maxConsumeTime, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
+      const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, maxConsumeTime,remainConsumeTime, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
       const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
       /*if ( oneTimeLimitation && this.remainPrice >= maxOneTimeDiscountFee ) {
         this.checkedList = this.checkedList.filter(elm => elm !== 'reduces')
@@ -212,10 +212,10 @@ export default {
       if (this.checkedList.indexOf('reduces') > -1) {
         this.remainPrice = hourPrice + this.remainPrice;
         // 计算最大上限
-        this.maxReduceDiscount = maxConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : maxConsumeTime;
+        this.maxReduceDiscount = remainConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : remainConsumeTime;
       } else {
         this.remainPrice = this.remainPrice - hourPrice;
-        this.maxReduceDiscount = maxConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : maxConsumeTime;
+        this.maxReduceDiscount = remainConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : remainConsumeTime;
         // this.reduceHours = maxConsumeTime;
       }
       const [isCrossMessage = false, maxReduceDiscount = 0] = this.crossMessage();