Pārlūkot izejas kodu

修改优惠展示逻辑

john.hong 2 gadi atpakaļ
vecāks
revīzija
9e5e4b01a0

+ 2 - 1
src/api/mockData/checkout.qh5.response.json

@@ -4,11 +4,12 @@
     "enterTime": "2023-01-06 19:24:50", 
     "serviceMin": 84, 
     "totalFee": 1, 
+    "thirdPartyId": "B1vrk1fRLoLuNEnKaUVrN", 
     "totalFeeInYuan": 0.01
   }, 
   "parkInfo": {
     "parkName": "VLhpfQGTMDYpsBZxvfBoeygjb", 
-    "description": "深圳停车费用说明", 
+    "description": "计费基础规则:15分钟内免费,首小时15元,其后每小时5元,全天封顶60元。\n嘉湾汇会员停车礼遇:\n银卡:每月可免费领取2张首2小时停车券\n金卡:每月可免费领取5张首2小时停车券\n铂金卡:每月可免费领取10张首2小时停车券\n*数量有限,领完即止\n仅限开具一个月内的停车费电子发票 ", 
     "parkMallCode": 5, 
     "buildingId": "QHKC-P1"
   }

+ 232 - 0
src/api/mockData/checkout.qh6.response.json

@@ -0,0 +1,232 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "粤BDF1412", 
+    "enterTime": "2023-01-06 19:24:50", 
+    "serviceMin": 84, 
+    "totalFee": 1, 
+    "actualPayFee": 0, 
+    "thirdPartyId": "B1vrk1fRLoLuNEnKaUVrN", 
+    "totalFeeInYuan": 0.01
+  }, 
+  "discountInfo": {
+    "usingTotalDiscount": 5, 
+    "memberLevelDiscount": false, 
+    "points": [
+      {
+        "available": 5450, 
+        "maxDiscountFee": 20, 
+        "pointsPerUnit": 1500, 
+        "unitAmount": 5, 
+        "newMember": false, 
+        "label": "5450积分可减免"
+      }
+    ], 
+    "coupons": [
+      {
+        "code": "0uwn32xo2of_t", 
+        "name": "积分商城兑换券", 
+        "expirationDate": "2023-03-31 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "1", 
+        "limitCountPerOrder": 0
+      }, 
+      {
+        "code": "hbnptz3kau5_t", 
+        "name": "积分商城兑换券", 
+        "expirationDate": "2023-03-31 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "1", 
+        "limitCountPerOrder": 0
+      }, 
+      {
+        "code": "vic3iqevsxg_t", 
+        "name": "积分商城兑换券", 
+        "expirationDate": "2023-03-31 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "1", 
+        "limitCountPerOrder": 0
+      }, 
+      {
+        "code": "e7magsgvvmp_t", 
+        "name": "积分商城兑换券", 
+        "expirationDate": "2023-03-31 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "1", 
+        "limitCountPerOrder": 0
+      }, 
+      {
+        "code": "xtifg1r1q2t_t", 
+        "name": "积分商城兑换券", 
+        "expirationDate": "2023-03-31 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "1", 
+        "limitCountPerOrder": 0
+      }, 
+      {
+        "code": "gwpohn04hxs_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "defaultSelected": true, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "2ryj2z6xyb7_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "dv97sa11phj_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "rxoyldb7k40_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "dcjja5kg6u1_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "u0ybm5n8txq_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "qk4wvrk9s04_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "gf4cwhgkq8n_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "5utf424l8f3_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "06yq5t60xaa_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "hplv3n26pck_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "1q938eflsbc_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "pspiwou65fl_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "3htmstjwway_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "ote7fpbvl9z_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "mpjtd2bj4y7_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "n09uhdzgu1z_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }, 
+      {
+        "code": "wzjfo0idpvo_t", 
+        "name": "可叠加电子券2(上限3)", 
+        "expirationDate": "2023-03-10 23:59:59", 
+        "discountFee": 5, 
+        "superposition": "2", 
+        "limitCountPerOrder": 3
+      }
+    ]
+  }, 
+  "parkingRule": {
+    "maxOneDayDiscountFee": 60, 
+    "enableNewMemberPoints": false, 
+    "enablePoints": true, 
+    "enableCoupon": true, 
+    "maxOneDayCoupons": 5, 
+    "remainCoupons": 5, 
+    "enablePaperCoupons": false, 
+    "maxPointsTime": 3, 
+    "enableConsume": false, 
+    "enableConsumeSplit": false, 
+    "availableDiscountFee": 50, 
+    "hourPrice": 5
+  }, 
+  "parkInfo": {
+    "parkName": "VLhpfQGTMDYpsBZxvfBoeygjb", 
+    "description": "计费基础规则:15分钟内免费,首小时15元,其后每小时5元,全天封顶60元。\n嘉湾汇会员停车礼遇:\n银卡:每月可免费领取2张首2小时停车券\n金卡:每月可免费领取5张首2小时停车券\n铂金卡:每月可免费领取10张首2小时停车券\n*数量有限,领完即止\n仅限开具一个月内的停车费电子发票 ", 
+    "parkMallCode": 5, 
+    "buildingId": "QHKC-P1"
+  }
+}

+ 5 - 2
src/store/order.js

@@ -2,7 +2,7 @@ import { checkOut, calculateDiscount, ordersAndPrepay, currentUnlicensedPlate, u
 
 // import checkOutQHResponse from '@/api/mockData/checkout.qh3.response.json'
 // import checkOutQHResponse from '@/api/mockData/checkout.hz.response.json';
-// import checkOutQHResponse from '@/api/mockData/checkout.qh5  .response.json'
+// import checkOutQHResponse from '@/api/mockData/checkout.qh6.response.json'
 // import unlicensedCarCheckInResponse from '@/api/mockData/unlicensedCarCheckIn.qh.response.json';
 
 // 大于等于停车费
@@ -173,7 +173,7 @@ const actions = {
     const isShowDiscounts = checkOutResponse?.parkingRule?.enableCoupon || false;
     // 是否展示优惠
     commit('setIsShowDiscounts', isShowDiscounts);
-    if(isShowDiscounts) {
+    if(checkOutResponse.parkingRule) {
       // 会员等级减免
       // 停车优惠(首停、会员减免、消费减免)
       dispatch('getCheckedTotal', checkOutResponse);
@@ -189,6 +189,9 @@ const actions = {
       commit('setEnablePaperCoupons', checkOutResponse?.parkingRule?.enablePaperCoupons || false);
       // 其他数据收集
       commit('setUsingTotalDiscount', checkOutResponse?.discountInfo?.usingTotalDiscount || 0);
+      console.log(191, checkOutResponse?.parkingRecord.hasOwnProperty(actualPayFee));
+    }
+    if (checkOutResponse?.parkingRecord?.hasOwnProperty('actualPayFee')) {
       commit('setActualPayFee', checkOutResponse.parkingRecord?.actualPayFee);
     } else {
       commit('setActualPayFee', checkOutResponse.parkingRecord?.totalFeeInYuan);