Browse Source

fix(SCRM-4969): 浦东默认减免上限直接读取defaultDiscountTime

john 1 year ago
parent
commit
011a634b03

+ 97 - 0
src/api/mockData/checkout.pd20.response.json

@@ -0,0 +1,97 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪A00001",
+    "enterTime": "2023-10-11 10:54:00",
+    "serviceMin": 13302,
+    "totalFee": 6600,
+    "actualPayFee": 66.0,
+    "thirdParkOrderNo": "s2023102016383185e0a29af8",
+    "createdByQrCode": false,
+    "getTime": "2023-10-20 16:38:32",
+    "totalFeeInYuan": 66.00
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 0,
+    "memberLevelDiscount": false,
+    "memberGrade": [
+      {
+        "selected": false
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "selected": false,
+        "defaultDiscountTime": 1,
+        "discountFee": 12,
+        "redeemSalesAmount": 300,
+        "couponCodes": "sbyqi4igrxd_t"
+      }
+    ],
+    "points": [
+      {
+        "available": 14800,
+        "selected": true,
+        "pointsPerUnit": 1000,
+        "unitAmount": 12,
+        "totalAvailable": 14800,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "14800积分可减免",
+        "discountFee": 0
+      }
+    ],
+    "coupons": [
+      {
+        "code": "wtxr3y5e8wo_t",
+        "couponId": "01e3321b0acb41079b9d654c3c376d75",
+        "selected": false,
+        "status": "available",
+        "name": "停车优惠券",
+        "expirationDate": "2023-10-23 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 2
+      },
+      {
+        "code": "lqzparjeo7t_t",
+        "couponId": "01e3321b0acb41079b9d654c3c376d75",
+        "selected": false,
+        "status": "available",
+        "name": "停车优惠券",
+        "expirationDate": "2023-10-23 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 2
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。",
+        "selected": false
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 2,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "enableConsume": true,
+    "enableConsumeNonSplit": false,
+    "remainConsumeTime": 3,
+    "hourPrice": 12,
+    "oneTimeLimitation": true,
+    "oneDayLimitation": false
+  },
+  "parkInfo": {
+    "parkName": "PD",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,",
+    "parkMallCode": 1,
+    "buildingId": "184-100035"
+  }
+}

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

@@ -318,9 +318,14 @@ export default {
         // 转化公式之后
         // this.maxReduceDiscount = remainConsumeTime > couponCodesLength ? couponCodesLength : remainConsumeTime
         // console.log(319, this.remainPrice >= maxOneTimeDiscountFee)
-        this.maxReduceDiscount = couponCodesLength > defaultDiscountTime ? defaultDiscountTime> remainHour > defaultDiscountTime ? defaultDiscountTime : remainHour : remainHour > couponCodesLength?couponCodesLength:remainHour; 
+        // this.maxReduceDiscount = couponCodesLength > defaultDiscountTime ? defaultDiscountTime> remainHour > defaultDiscountTime ? defaultDiscountTime : remainHour : remainHour > couponCodesLength?couponCodesLength:remainHour;
+        this.maxReduceDiscount = defaultDiscountTime;
+        // 323323323 3 2 2 2
+        // 323323323 3 1 2 1
+        // console.log('323323323', couponCodesLength, remainHour, defaultDiscountTime, this.reduceHours )
+        
         // this.reduceHours = this.maxReduceDiscount
-        !isSelected && (this.reduceHours = this.maxReduceDiscount)
+        !isSelected && remainHour - defaultDiscountTime > 0 && (this.reduceHours = 1)
         return
         // 如果超过限制就置灰
         // const maxOneTimeDiscountTimeFee = (couponCodes.split('#').length) * hourPrice
@@ -464,6 +469,7 @@ export default {
             // this.isReduces = false;
             return
           }
+          return;
         }
          if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
            // 如果不是沈阳,重新计算计算最大上限

+ 1 - 1
src/store/order/index.js

@@ -1,4 +1,4 @@
-import checkOutQHResponse from "@/api/mockData/checkout.bj2.response.json";
+import checkOutQHResponse from "@/api/mockData/checkout.pd17.response.json";
 import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
 import state from "@/store/order/state";
 import mutations from "@/store/order/mutations";