Jelajahi Sumber

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

john 1 tahun lalu
induk
melakukan
60f5466dc9

+ 86 - 0
src/api/mockData/checkout.pd17.response.json

@@ -0,0 +1,86 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪A00001",
+    "enterTime": "2023-10-11 10:54:00",
+    "serviceMin": 12942,
+    "totalFee": 82200,
+    "actualPayFee": 798,
+    "thirdParkOrderNo": "s20231020103910951c42a795",
+    "createdByQrCode": false,
+    "getTime": "2023-10-20 10:39:10",
+    "totalFeeInYuan": 822
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 24,
+    "memberLevelDiscount": false,
+    "consume": [
+      {
+        "defaultSelected": true,
+        "defaultDiscountTime": 2,
+        "discountFee": 24,
+        "redeemSalesAmount": 600,
+        "couponCodes": "l55nmr898ee_t#jlc9epqlc1s_t#vj2vsdjihve_t#xmzzanteeui_t"
+      }
+    ],
+    "points": [
+      {
+        "available": 5120,
+        "pointsPerUnit": 1000,
+        "unitAmount": 12,
+        "totalAvailable": 5120,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "5120积分可减免"
+      }
+    ],
+    "coupons": [
+      {
+        "code": "wtxr3y5e8wo_t",
+        "couponId": "01e3321b0acb41079b9d654c3c376d75",
+        "status": "available",
+        "name": "停车优惠券",
+        "expirationDate": "2023-10-23 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 2
+      },
+      {
+        "code": "lqzparjeo7t_t",
+        "couponId": "01e3321b0acb41079b9d654c3c376d75",
+        "status": "available",
+        "name": "停车优惠券",
+        "expirationDate": "2023-10-23 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 2
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 2,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "enableConsume": true,
+    "enableConsumeNonSplit": false,
+    "remainConsumeTime": 4,
+    "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"
+  }
+}

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

@@ -0,0 +1,97 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪A00001",
+    "enterTime": "2023-10-11 10:54:00",
+    "serviceMin": 12942,
+    "totalFee": 82200,
+    "actualPayFee": 822.0,
+    "thirdParkOrderNo": "s20231020103910951c42a795",
+    "createdByQrCode": false,
+    "getTime": "2023-10-20 10:39:10",
+    "totalFeeInYuan": 822.00
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 0,
+    "memberLevelDiscount": false,
+    "memberGrade": [
+      {
+        "selected": false
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "selected": false,
+        "defaultDiscountTime": 2,
+        "discountFee": 12,
+        "redeemSalesAmount": 600,
+        "couponCodes": "l55nmr898ee_t#jlc9epqlc1s_t#vj2vsdjihve_t#xmzzanteeui_t"
+      }
+    ],
+    "points": [
+      {
+        "available": 5120,
+        "selected": true,
+        "pointsPerUnit": 1000,
+        "unitAmount": 12,
+        "totalAvailable": 5120,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "5120积分可减免",
+        "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": 4,
+    "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"
+  }
+}

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

@@ -0,0 +1,97 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪A00001",
+    "enterTime": "2023-10-11 10:54:00",
+    "serviceMin": 12942,
+    "totalFee": 82200,
+    "actualPayFee": 822.0,
+    "thirdParkOrderNo": "s20231020103910951c42a795",
+    "createdByQrCode": false,
+    "getTime": "2023-10-20 10:39:10",
+    "totalFeeInYuan": 822.00
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 0,
+    "memberLevelDiscount": false,
+    "memberGrade": [
+      {
+        "selected": false
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "selected": false,
+        "defaultDiscountTime": 2,
+        "discountFee": 24,
+        "redeemSalesAmount": 600,
+        "couponCodes": "l55nmr898ee_t#jlc9epqlc1s_t#vj2vsdjihve_t#xmzzanteeui_t"
+      }
+    ],
+    "points": [
+      {
+        "available": 5120,
+        "selected": true,
+        "pointsPerUnit": 1000,
+        "unitAmount": 12,
+        "totalAvailable": 5120,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "5120积分可减免",
+        "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": 4,
+    "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"
+  }
+}

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

@@ -286,7 +286,7 @@ export default {
       }
     },
     maxReduceDiscountInit() {
-      const {maxDiscountTime, couponCodes} = this.consume
+      const {maxDiscountTime, couponCodes, defaultDiscountTime} = this.consume
       if(JSON.stringify(this.consume) === '{}' || !this.consume.hasOwnProperty('redeemSalesAmount')) {
         return
       }
@@ -316,7 +316,7 @@ export default {
         // this.maxReduceDiscount = remainConsumeTime - this.reduceHours <= couponCodesLength - this.reduceHours 
         // 转化公式之后
         // this.maxReduceDiscount = remainConsumeTime > couponCodesLength ? couponCodesLength : remainConsumeTime
-        this.maxReduceDiscount = otherFee > couponCodesLength ? couponCodesLength : otherFee
+        this.maxReduceDiscount = couponCodesLength > defaultDiscountTime ? defaultDiscountTime : couponCodesLength; 
         // this.reduceHours = this.maxReduceDiscount
         !isSelected && (this.reduceHours = this.maxReduceDiscount)
         return

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

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