Browse Source

Merge pull request #127 from John-Hong/John/release-2.9.0/SCRM-3890

fix(SCRM-3890): [DE][C端]停车缴费-前海每日抵扣额度未使用情况下选择停车券页面提示“每日最高可抵扣60元”
John-Hong 2 years ago
parent
commit
8c005b29eb

+ 107 - 0
src/api/mockData/checkout.qh14.response.json

@@ -0,0 +1,107 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "闽A33331",
+    "enterTime": "2021-12-02 15:00:11",
+    "serviceMin": 767715,
+    "totalFee": 17000,
+    "actualPayFee": 55,
+    "thirdPartyId": "SOznevF5CVb0eEnm2Dwud",
+    "thirdParkOrderNo": "DJwIfoAEROaJx3Vy0LvEWQ",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 170
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 115,
+    "memberLevelDiscount": false,
+    "points": [
+      {
+        "available": 19,
+        "maxDiscountFee": 20,
+        "pointsPerUnit": 50,
+        "unitAmount": 5,
+        "totalAvailable": 1169,
+        "newMember": false,
+        "label": "已选择兑换115元",
+        "discountFee": 115
+      }
+    ],
+    "coupons": [
+      {
+        "code": "g0nqcru5kgv_t",
+        "couponId": "b506a796ca4c4c12802dfb6ba55c4eb9",
+        "status": "available",
+        "name": "20元停车券",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 20,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 0
+      },
+      {
+        "code": "aa6jihjm685_t",
+        "couponId": "a8a1bbb3f9eb40c4b8810132d5046292",
+        "status": "available",
+        "name": "40元电子券",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 40,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 0
+      },
+      {
+        "code": "n51miyk90j6_t",
+        "couponId": "a8a1bbb3f9eb40c4b8810132d5046292",
+        "status": "available",
+        "name": "40元电子券",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 40,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 0
+      },
+      {
+        "code": "a9t0dq5vodo_t",
+        "couponId": "a8a1bbb3f9eb40c4b8810132d5046292",
+        "status": "available",
+        "name": "40元电子券",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 40,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 0
+      },
+      {
+        "code": "zy2dx9ilqvj_t",
+        "couponId": "a8a1bbb3f9eb40c4b8810132d5046292",
+        "status": "available",
+        "name": "40元电子券",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 40,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 0
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneDayDiscountFee": 60,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": true,
+    "enableCoupon": true,
+    "enablePaperCoupons": false,
+    "maxPointsTime": 23,
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "availableDiscountFee": 60,
+    "hourPrice": 5,
+    "oneDayLimitation": true,
+    "oneTimeLimitation": false
+  },
+  "parkInfo": {
+    "parkName": "深圳前海湾停车场",
+    "description": "基础计费规则:\n15分钟内免费,首小时15元,其后每小时5元,全天封顶60元。\n嘉湾汇会员停车礼遇:\n银卡:每月可免费领取2张首2小时停车券\n金卡:每月可免费领取5张首2小时停车券\n铂金卡:每月可免费领取10张首2小时停车券\n*数量有限,领完即止\n仅限开具一个月内的停车费电子发票 ",
+    "parkMallCode": 5,
+    "buildingId": "QHKC-P1"
+  }
+}

+ 1 - 1
src/api/request.js

@@ -188,7 +188,7 @@ export const createAxiosByinterceptors = (config) => {
       }
       // 错误信息提示
       const { code, langMessage, message,status } = error.response.data;
-      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCAL_PARK_ERROR", "LOCK_OCCUPIED", "REMOTE_CALL_FAIL", 'PLEASE_SCAN_QRCODE', 'SUBIN_CAR_IN_DEVICE_EXCEPTION', 'COUPON_UNAVAILABLE', 'COUPON_SELECTION_FAILED']; // 默认处理的错误code
+      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCAL_PARK_ERROR", "LOCK_OCCUPIED", "REMOTE_CALL_FAIL", 'PLEASE_SCAN_QRCODE', 'SUBIN_CAR_IN_DEVICE_EXCEPTION', 'COUPON_UNAVAILABLE', 'COUPON_SELECTION_FAILED' ]; // 默认处理的错误code
       if (codeList.indexOf(code) > -1) {
         uni.showToast({ title: langMessage || message, duration: 3000, icon: 'fail' });
       }

+ 8 - 1
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -32,6 +32,7 @@ export default {
       usingTotalDiscount: (state) => state.order.usingTotalDiscount, // 当前已使用优惠
       availableDiscountFee: (state) => state.order.availableDiscountFee, // 当前已使用优惠
       paperDiscountFee: (state) => state.order.paperDiscountFee, // 当前已使用优惠
+      unLimitWeekendPoints: (state) => state.order.unLimitWeekendPoints, // 新的积分上限, 默认为false(不开启), unLimitWeekendPoints: true # 开启无上限功能;   unLimitWeekendPoints: false # 关闭无上限功能;
       lbsId: (state) => state.lbsId, // 楼栋ID
       groupId: (state) => state.groupId, // 楼盘ID
     }),
@@ -62,6 +63,8 @@ export default {
   },
   methods: {
     pageInit() {
+      const {parkInfo} = this.orderDetail
+      const { parkMallCode } = parkInfo;
       /*
        * 电子优惠券初始化逻辑(后端处理)
        *
@@ -70,6 +73,10 @@ export default {
        * */
       this.couponList = [...this.coupons];
       this.remainPrice = this.usingTotalDiscount;
+      // 如果前海开启无积分上限的话,则
+      if ( parkMallCode === 5 && this.unLimitWeekendPoints && this.orderDetail.discountInfo?.points[0]?.discountFee) {
+        this.remainPrice = this.remainPrice - this.orderDetail?.discountInfo?.points[0]?.discountFee
+      }
       this.newAvailableDiscountFee = this.availableDiscountFee
       if (this.couponList.length) {
         this.couponList = this.couponList.map((elm, index) => {
@@ -140,7 +147,7 @@ export default {
       const { parkMallCode } = parkInfo;
       const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
       // 设置深圳的达到优惠金额的上限,置灰剩下未选择的金额
-      if ( parkMallCode === 5 && this.remainPrice - this.paperDiscountFee >= this.newAvailableDiscountFee ) {
+      if ( parkMallCode === 5 && this.remainPrice - this.paperDiscountFee >= this.newAvailableDiscountFee) {
         this.couponList = this.couponList.map((elm,iemi) => {
           if ( !elm.disabled && this.checkedCouponList.indexOf(`coupon${iemi}`) < 0) {
             elm.disabled = true

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

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

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

@@ -17,6 +17,7 @@ export default {
       maxPointsTime = 0, // 最大积分
       enablePoints,
       availableDiscountFee,
+      unLimitWeekendPoints = false,
       maxOneDayDiscountFee, // 每日最大优惠金额(深圳车场)
       remainConsumeTime, // 当前订单剩余可使用的优惠
     } = parkingRule;
@@ -28,7 +29,6 @@ export default {
         maxDiscountFee, // 单次上限(元)
         unitAmount, // 兑换值(元)
         unlimitUsePoints= "LIMIT", // 前海积分最大上限
-        unLimitWeekendPoints = false,
         unitHour, // 兑换值(小时)
         pointsPerUnit = 0, // 500积分对应的价值
         discountFee,