Forráskód Böngészése

feat(KIP-9697): KIP | Temporary Parking H5 |浦东嘉里有牌车临停功能联调

john 2 éve
szülő
commit
7966ab3179

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "temporay-parking",
-  "version": "2.8.0",
+  "version": "2.9.0",
   "private": true,
   "scripts": {
     "serve": "cross-env NODE_ENV=dev vue-cli-service serve",

+ 101 - 0
src/api/mockData/checkout.pd10.response.json

@@ -0,0 +1,101 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪K10007",
+    "enterTime": "2023-04-27 13:02:00",
+    "serviceMin": 27289,
+    "totalFee": 1100,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970710",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 11
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 20,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": false,
+        "selected": true,
+        "memberGradeText": "银卡",
+        "discountTime": 2,
+        "discountFee": 10
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "selected": false,
+        "defaultDiscountTime": 2,
+        "discountFee": 20,
+        "redeemSalesAmount": 600
+      }
+    ],
+    "points": [
+      {
+        "available": 852,
+        "selected": true,
+        "pointsPerUnit": 1200,
+        "unitAmount": 10,
+        "totalAvailable": 2052,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "2052积分可减免",
+        "discountFee": 10
+      }
+    ],
+    "coupons": [
+      {
+        "code": "5hj0f0kxnz9_t",
+        "couponId": "fb824bf210f449aab90783187482435e",
+        "selected": false,
+        "status": "available",
+        "name": "Allison测试券",
+        "expirationDate": "2023-05-19 23:59:59",
+        "discountFee": 10,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1000
+      },
+      {
+        "code": "o2lz6b9vsb5_t",
+        "couponId": "fb824bf210f449aab90783187482435e",
+        "selected": false,
+        "status": "available",
+        "name": "Allison测试券",
+        "expirationDate": "2023-05-19 23:59:59",
+        "discountFee": 10,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1000
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。",
+        "selected": false
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 2,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 2,
+    "remainConsumeTime": 2,
+    "hourPrice": 10,
+    "oneDayLimitation": false,
+    "oneTimeLimitation": true
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里城",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 1,
+    "buildingId": "184-100035"
+  }
+}

+ 93 - 0
src/api/mockData/checkout.pd8.response.json

@@ -0,0 +1,93 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪K10007",
+    "enterTime": "2023-04-27 13:02:00",
+    "serviceMin": 27289,
+    "totalFee": 1100,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970710",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 11
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 20,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": false,
+        "memberGradeText": "银卡卡",
+        "discountTime": 2,
+        "discountFee": 10
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "defaultDiscountTime": 2,
+        "redeemSalesAmount": 600
+      }
+    ],
+    "points": [
+      {
+        "available": 2052,
+        "pointsPerUnit": 1200,
+        "unitAmount": 10,
+        "totalAvailable": 2052,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "2052积分可减免"
+      }
+    ],
+    "coupons": [
+      {
+        "code": "5hj0f0kxnz9_t",
+        "couponId": "fb824bf210f449aab90783187482435e",
+        "status": "available",
+        "name": "Allison测试券",
+        "expirationDate": "2023-05-19 23:59:59",
+        "discountFee": 10,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1000
+      },
+      {
+        "code": "o2lz6b9vsb5_t",
+        "couponId": "fb824bf210f449aab90783187482435e",
+        "status": "available",
+        "name": "Allison测试券",
+        "expirationDate": "2023-05-19 23:59:59",
+        "discountFee": 10,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1000
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 2,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 2,
+    "remainConsumeTime": 2,
+    "hourPrice": 10,
+    "oneDayLimitation": false,
+    "oneTimeLimitation": true
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里城",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 1,
+    "buildingId": "184-100035"
+  }
+}

+ 98 - 0
src/api/mockData/checkout.pd9.response.json

@@ -0,0 +1,98 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪K10007",
+    "enterTime": "2023-04-27 13:02:00",
+    "serviceMin": 27289,
+    "totalFee": 1100,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970710",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 11
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 20,
+    "memberLevelDiscount": false,
+    "memberGrade": [
+      {
+        "selected": false,
+        "discountFee": 0
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "selected": true,
+        "defaultDiscountTime": 2,
+        "discountFee": 10,
+        "redeemSalesAmount": 600
+      }
+    ],
+    "points": [
+      {
+        "available": 852,
+        "selected": true,
+        "pointsPerUnit": 1200,
+        "unitAmount": 10,
+        "totalAvailable": 2052,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "2052积分可减免",
+        "discountFee": 10
+      }
+    ],
+    "coupons": [
+      {
+        "code": "5hj0f0kxnz9_t",
+        "couponId": "fb824bf210f449aab90783187482435e",
+        "selected": false,
+        "status": "available",
+        "name": "Allison测试券",
+        "expirationDate": "2023-05-19 23:59:59",
+        "discountFee": 10,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1000
+      },
+      {
+        "code": "o2lz6b9vsb5_t",
+        "couponId": "fb824bf210f449aab90783187482435e",
+        "selected": false,
+        "status": "available",
+        "name": "Allison测试券",
+        "expirationDate": "2023-05-19 23:59:59",
+        "discountFee": 10,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1000
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。",
+        "selected": false
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 2,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 2,
+    "remainConsumeTime": 2,
+    "hourPrice": 10,
+    "oneDayLimitation": false,
+    "oneTimeLimitation": true
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里城",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 1,
+    "buildingId": "184-100035"
+  }
+}

+ 61 - 0
src/api/mockData/checkout.qh13.response.json

@@ -0,0 +1,61 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "粤Q55568",
+    "enterTime": "2023-05-12 13:30:43",
+    "serviceMin": 180,
+    "totalFee": 10000,
+    "actualPayFee": 80,
+    "thirdPartyId": "c8c9429453e2417cbf84dbfb3c6b1c7f",
+    "thirdParkOrderNo": "1fbf9138746045ddad876dccc727fdf1",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 100
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 20,
+    "memberLevelDiscount": false,
+    "points": [
+      {
+        "available": 859,
+        "maxDiscountFee": 20,
+        "pointsPerUnit": 50,
+        "unitAmount": 5,
+        "totalAvailable": 1059,
+        "newMember": false,
+        "label": "已选择兑换20元",
+        "discountFee": 20
+      }
+    ],
+    "coupons": [
+      {
+        "code": "1q33nwhu242_t",
+        "couponId": "60b9e286414b41ec9c32596bf6f2d0c5",
+        "status": "unavailable",
+        "availableDays": "星期六",
+        "name": "5元停车券(周末及法定节假日)",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 5,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 2
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneDayDiscountFee": 60,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": true,
+    "enablePaperCoupons": false,
+    "maxPointsTime": 21,
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "availableDiscountFee": 15,
+    "hourPrice": 5
+  },
+  "parkInfo": {
+    "parkName": "深圳前海湾停车场",
+    "description": "基础计费规则:\n15分钟内免费,首小时15元,其后每小时5元,全天封顶60元。\n嘉湾汇会员停车礼遇:\n银卡:每月可免费领取2张首2小时停车券\n金卡:每月可免费领取5张首2小时停车券\n铂金卡:每月可免费领取10张首2小时停车券\n*数量有限,领完即止\n仅限开具一个月内的停车费电子发票 ",
+    "parkMallCode": 5,
+    "buildingId": "QHKC-P1"
+  }
+}

+ 2 - 2
src/api/request.js

@@ -124,7 +124,7 @@ function getSign(config) {
 }
 export const createAxiosByinterceptors = (config) => {
   const instance = axios.create({
-    timeout: 100000, //超时配置
+    timeout: 1000000, //超时配置
     baseURL: `${window.profileApi}/temporary-parking-service`,
     // baseURL: `https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service`,
     withCredentials: false, //跨域携带cookie
@@ -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']; // 默认处理的错误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' });
       }

+ 6 - 4
src/main.js

@@ -5,8 +5,8 @@ import VConsole from 'vconsole';
 
 // 或者使用配置参数来初始化,详情见文档
 // 开发环境和qa环境 打开debug
-const debug = /dev-t?-?|qa-t?-?|sl-t?-?/.test(window.location.href) || window.location.href.indexOf('8080') > -1;
-if (debug) {
+const debug = /dev-t?-?|qa-t?-?|sl-t?-?|808[0-9]/.test(window.location.href);
+if (debug && process.env.NODE_ENV !== 'dev') {
   window.vConsole = new VConsole(
     // { theme: 'dark' }
   );
@@ -29,7 +29,8 @@ import {
   Skeleton,
   Dialog,
   NumberKeyboard,
-  Divider
+  Divider,
+  Stepper
 } from 'vant';
 
 import router from './routes/index.js'; // 注册页面路由
@@ -66,7 +67,8 @@ Vue.use(Icon)
   .use(Switch)
   .use(Dialog)
   .use(NumberKeyboard)
-  .use(Divider);
+  .use(Divider)
+  .use(Stepper);
   
 
 Vue.config.ignoredElements = ['wx-open-launch-weapp'];

+ 59 - 4
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -136,7 +136,9 @@ export default {
     },
     // 针对达到优惠的上限制
     setAllDisabled() {
-      const { parkMallCode } = this.orderDetail.parkInfo;
+      const {parkInfo,parkingRule} = this.orderDetail
+      const { parkMallCode } = parkInfo;
+      const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
       // 设置深圳的达到优惠金额的上限,置灰剩下未选择的金额
       if ( parkMallCode === 5 && this.remainPrice - this.paperDiscountFee >= this.newAvailableDiscountFee ) {
         this.couponList = this.couponList.map((elm,iemi) => {
@@ -147,6 +149,41 @@ export default {
         })
         return true
       }
+      // 单日上限限制
+      if ( oneDayLimitation  && parkMallCode !== 5) {
+        const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+        const remainConsumeTimeFee = remainConsumeTime * hourPrice
+        console.log(156, remainConsumeTimeFee)
+        // 计算单日剩余 remainConsumeTime
+        // 当前使用优惠 state.usingTotalDiscount
+        // 判断符合上限
+        if ( this.remainPrice >= maxOneTimeDiscountFee ) {
+          this.couponList = this.couponList.map((elm,iemi) => {
+            if ( !elm.disabled && this.checkedCouponList.indexOf(`coupon${iemi}`) < 0) {
+              elm.disabled = true
+            }
+            return elm
+          })
+        }
+      }
+      // 单次上限限制
+      if ( oneTimeLimitation && parkMallCode !== 5) {
+        console.log(170)
+        const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+        const remainConsumeTimeFee = remainConsumeTime * hourPrice
+        // 计算单日剩余 remainConsumeTime
+        // 当前使用优惠 state.usingTotalDiscount
+        // 判断符合上限
+        console.log(177, remainConsumeTimeFee)
+        if ( this.remainPrice >= maxOneTimeDiscountFee ) {
+          this.couponList = this.couponList.map((elm,iemi) => {
+            if ( !elm.disabled && this.checkedCouponList.indexOf(`coupon${iemi}`) < 0) {
+              elm.disabled = true
+            }
+            return elm
+          })
+        }
+      }
       return false
     },
     // 对不同类型的优惠券进行汇总统计
@@ -327,7 +364,7 @@ export default {
     // 超限提示
     crossMessage(showMsg = '') {
       const { parkMallCode } = this.orderDetail.parkInfo;
-      const { maxOneDayCoupons, maxonedaydiscountFee, remainConsumeTime, hourPrice, availableDiscountFee, maxOneTimeDiscountTime } = this.orderDetail.parkingRule;
+      const { maxOneDayCoupons, maxonedaydiscountFee, maxOneTimeDiscountTime, remainConsumeTime, hourPrice, availableDiscountFee, oneTimeLimitation,oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
       const {
         usingTotalDiscount, // 使用总抵扣
         coupons,
@@ -385,14 +422,32 @@ export default {
           icon: 'none',
         });
       }
-      // 浦东,单次上限提示, 后续 usingTotalDiscount 再减去 纸质优惠券的金额
-      if (parkMallCode === 1 && this.remainPrice - this.paperDiscountFee >= this.availableDiscountFee) {
+      
+      // 单日上限
+      if ( oneDayLimitation && parkMallCode !== 5 && this.remainPrice >= maxOneDayDiscountFee) {
+        if ( showMsg ) return true
+        return Toast({
+          message: `每日最高可抵扣${maxOneDayDiscountFee}元`,
+          icon: 'none',
+        });
+      }
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      // 单次上限限制
+      if ( oneTimeLimitation && parkMallCode !== 5 && this.remainPrice >= maxOneTimeDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
           icon: 'none',
         });
       }
+      // 浦东,单次上限提示, 后续 usingTotalDiscount 再减去 纸质优惠券的金额
+      /*if (parkMallCode === 1 && this.remainPrice - this.paperDiscountFee >= this.availableDiscountFee) {
+        if ( showMsg ) return true
+        return Toast({
+          message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
+          icon: 'none',
+        });
+      }*/
       return false
     },
     // 确认

+ 26 - 2
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -122,7 +122,7 @@ export default {
     // 前往支付
     async toPay() {
       const { parkingRecord, discountInfo = {}, parkingRule = {}} = this.orderDetail;
-      const { coupons, points, memberGrade = [], paperCoupons = [] } = discountInfo
+      const { coupons, points, memberGrade = [], paperCoupons = [], consume = [] } = discountInfo
       const { hourPrice } = parkingRule
       try {
         const params = {
@@ -143,13 +143,37 @@ export default {
         };
         // 会员等级减免
         if ( memberGrade?.length && memberGrade[0].discountFee > 0 && memberGrade[0].hasOwnProperty('selected')? memberGrade[0]?.selected : memberGrade[0]?.defaultSelected) {
-          const {discountFee, discountTime} = memberGrade[0]
+          const selected = memberGrade[0].hasOwnProperty('selected') ? memberGrade[0].selected : memberGrade[0].defaultSelected;
+          let discountTime = 0
+          let discountFee = 0
+          if(selected) {
+            discountTime = memberGrade[0].hasOwnProperty('discountTime') ? memberGrade[0].discountTime : memberGrade[0].defaultDiscountTime;
+            discountFee = memberGrade[0].hasOwnProperty('discountFee') ? memberGrade[0].discountFee : discountTime * hourPrice;
+          }
           params.discountInfo.memberLevel = {
             "discountTime": discountTime,
             "discountFee": discountFee,
             "memberGrade": memberGrade[0].memberGrade
           }
         }
+        // 消费减免
+        if ( consume?.length && consume[0].discountFee > 0 && consume[0].hasOwnProperty('selected')? consume[0]?.selected : consume[0]?.defaultSelected) {
+          const { redeemSalesAmount} = consume[0]
+          const selected = consume[0].hasOwnProperty('selected') ? consume[0].selected : consume[0].defaultSelected;
+          let discountTime = 0
+          let discountFee = 0
+          if(selected) {
+            discountTime = consume[0].hasOwnProperty('discountTime') ? consume[0].discountTime : consume[0].defaultDiscountTime; 
+            discountFee = consume[0].hasOwnProperty('discountFee') ? consume[0].discountFee : discountTime * hourPrice;
+          }
+          params.discountInfo.consume = {
+            ...consume[0],
+            "defaultSelected": selected,
+            "discountTime": discountTime,
+            "discountFee": discountFee,
+            "redeemSalesAmount": redeemSalesAmount
+          }
+        }
         
         // 积分
         if (points?.length && points[0].discountFee > 0) {

+ 188 - 46
src/pages/parkingFee/mixins/parkingFeeDiscounts.js

@@ -1,3 +1,4 @@
+import { Toast } from "vant";
 import { mapState } from 'vuex';
 import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
 import { cloneDeep } from 'lodash'
@@ -7,7 +8,7 @@ export default {
   components: {uniNumberBox},
   created() {
     // 超限提示
-    this.crossMessage();
+    // this.crossMessage();
   },
   // beforeRouteLeave(to, from, next) {
   //   console.log(251251251251251251, to, from,);
@@ -30,6 +31,7 @@ export default {
       enableConsumeSplit: false,
       maxReduceDiscount: 0,
       reduceHours: 0,
+      remainPrice: 0
     };
   },
   computed: {
@@ -46,6 +48,32 @@ export default {
       paperDiscountTime: state => state.order.paperDiscountTime,
       paperDiscountFee: state => state.order.paperDiscountTime,
     }),
+    // maxReduceDiscount() {
+    //   const {maxOneDayCoupons,maxConsumeTime,maxonedaydiscountFee,maxOneTimeDiscountTime,remainConsumeTime,hourPrice,availableDiscountFee,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
+    //   let newMaxConsumeTime = maxConsumeTime
+    //   const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+    //   console.log(52, this.remainPrice)
+    //   if ( this.remainPrice + (newMaxConsumeTime * hourPrice) > maxOneTimeDiscountFee ) {
+    //     newMaxConsumeTime = (maxOneTimeDiscountFee - this.remainPrice) / hourPrice
+    //   }
+    //   return maxConsumeTime
+    // },
+    // remainPrice() {
+    //   let remainPrice = this.usingTotalDiscount
+    //   const {maxOneDayCoupons,maxConsumeTime,maxonedaydiscountFee,maxOneTimeDiscountTime,remainConsumeTime,hourPrice,availableDiscountFee,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
+    //   let newMaxConsumeTime = maxConsumeTime
+    //   if ( this.checkedList.indexOf('member') > -1) {
+    //     remainPrice = remainPrice + this.memberGrade.discountFee
+    //   }
+    //   if ( this.checkedList.indexOf('reduces') > -1) {
+    //    
+    //   }
+    //  
+    //  
+    //  
+    //  
+    //   return remainPrice
+    // }
   },
   mounted() {
     try {
@@ -57,41 +85,191 @@ export default {
       this.$router.back();
     }
   },
+  watch: {
+    remainPrice() {
+      const {maxOneDayCoupons,maxonedaydiscountFee,maxOneTimeDiscountTime,remainConsumeTime,hourPrice,availableDiscountFee,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      // console.log('hourPrice + this.remainPrice',this.remainPrice)
+      // 单日上限
+      // if ( oneDayLimitation && this.remainPrice >= maxOneDayDiscountFee ) {
+      //   return Toast({
+      //     message: `每日最高可抵扣${ maxOneDayDiscountFee }元`,
+      //     icon: 'none',
+      //   });
+      //
+      // }
+      // 单次上限限制
+      if ( oneTimeLimitation ) {
+        if( this.remainPrice <= maxOneTimeDiscountFee ) {
+          if ( this.isMember ) {
+            this.isMember = !this.isMember
+          }
+          if ( this.isReduces ) {
+            this.isReduces = false
+          }  
+        } else {
+          this.isMember = this.checkedList.indexOf('member') < 0
+          this.isReduces = this.checkedList.indexOf('reduces') < 0
+        }
+      } 
+    },
+    checkedList() {
+      // const {hourPrice} = this.orderDetail.parkingRule;
+      // if ( this.checkedList.indexOf('reduces') > -1 ) {
+      //   this.remainPrice = this.reduceHours * hourPrice + this.remainPrice
+      // } else {
+      //   this.remainPrice = this.remainPrice - this.reduceHours * hourPrice
+      // }
+    }
+  },
   methods: {
     pageInit() {
+      this.remainPrice = this.usingTotalDiscount
       if ( this.orderDetail?.parkingRule?.enableConsumeSplit ) {
         this.enableConsumeSplit = this.orderDetail.parkingRule.enableConsumeSplit
       }
-
       this.checkedList = []
       const {memberGrade = [],consume = [],memberLevelDiscount} = this.orderDetail.discountInfo;
+      const {maxConsumeTime} = this.orderDetail.parkingRule
       this.memberGrade = {...memberGrade[0]}
       this.consume = {...consume[0]}
-      if ( JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected) {
+      if ( JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected ) {
         this.checkedList.push('member')
         this.isMember = false
       }
-      if ( JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected) {
+      if ( JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected ) {
         this.checkedList.push('reduces')
         this.isReduces = false
         // 如果存在拆分逻辑的话
         // this.consume.
       }
-      if ( this?.consume?.defaultDiscountTime ) {
-        this.reduceHours = this.consume.hasOwnProperty('discountTime') ? this.consume.discountTime : this.consume.defaultDiscountTime
-      }
-      if ( this?.consume?.maxDiscountTime ) {
-        this.maxReduceDiscount = this.consume.maxDiscountTime
+      this.reduceHours = this.consume.hasOwnProperty('discountFee') ? this.consume.discountFee / this.orderDetail.parkingRule.hourPrice : this.consume.defaultDiscountTime
+      if ( maxConsumeTime ) {
+        this.maxReduceDiscount = maxConsumeTime
       }
       this.oldCheckedList = [...this.checkedList]
     },
     setIsMemberDiscountDisabled() {
       this.todayReduceDiscountMessage = '当日'
     },
+    checkboxChange() {},
+    onReduceHoursChange( type ) {
+      if ( this.checkedList.indexOf('reduces') < 0 ) {
+        return;
+      }
+      const {maxOneDayCoupons,maxonedaydiscountFee,maxOneTimeDiscountTime,remainConsumeTime,hourPrice,availableDiscountFee,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
+      // console.log(133,this.reduceHours)
+      if ( type === 'plus') {
+        this.remainPrice = this.remainPrice + hourPrice
+        this.reduceHours = this.reduceHours + 1
+        const [isCrossMessage = false,maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage()
+        if ( isCrossMessage ) {
+          this.remainPrice = this.remainPrice - hourPrice
+          this.reduceHours = this.reduceHours - 1
+        }
+        return
+      }
+      if ( type === 'minus' ) {
+        this.reduceHours = this.reduceHours - 1
+        this.remainPrice = this.remainPrice - hourPrice
+        return
+      }
+    },
+    memberClick() {
+      const {maxConsumeTime} = 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
+      }
+      const [isCrossMessage = false,maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage()
+      if ( isCrossMessage ) {
+        this.checkedList = this.checkedList.filter(elm => elm !== 'member')
+        this.remainPrice = this.remainPrice - this.memberGrade.discountFee
+        this.isMember = false
+      }
+    },
+    reducesClick() {
+      const {maxOneTimeDiscountTime,hourPrice,oneTimeLimitation,maxConsumeTime,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      /*if ( oneTimeLimitation && this.remainPrice >= maxOneTimeDiscountFee ) {
+        this.checkedList = this.checkedList.filter(elm => elm !== 'reduces')
+        Toast({
+          message: `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`,
+          icon: 'none',
+        });
+        return false
+      }*/
+      const reduceHours = ( maxOneTimeDiscountFee - this.remainPrice ) / hourPrice
+      if ( this.checkedList.indexOf('reduces') > -1 ) {
+        this.remainPrice =  hourPrice + this.remainPrice
+        this.maxReduceDiscount = maxConsumeTime
+      } else {
+        this.remainPrice = this.remainPrice - hourPrice
+        this.maxReduceDiscount = maxConsumeTime
+        this.reduceHours = maxConsumeTime
+      }
+      const [isCrossMessage = false,maxReduceDiscount = 0] = this.crossMessage()
+      if ( isCrossMessage ) {
+        // console.log(215, maxReduceDiscount)
+        // console.log(207, this.reduceHours)
+        // this.maxReduceDiscount = maxReduceDiscount ? 0 : maxReduceDiscount * -1
+        // console.log(217, this.maxReduceDiscount)
+        this.remainPrice = this.remainPrice - maxReduceDiscount * hourPrice
+        //
+        // this.reduceHours = this.maxReduceDiscount
+      }
+    },
+    // 超限提示
+    crossMessage() {
+      const {maxOneTimeDiscountTime,hourPrice,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      // 单日上限
+      if ( oneDayLimitation && this.remainPrice >= maxOneDayDiscountFee ) {
+        Toast({
+          message: `每日最高可抵扣${ maxOneDayDiscountFee }元`,
+          icon: 'none',
+        });
+        return [true,( maxOneDayDiscountFee - (this.reduceHours - 1) * hourPrice ) / hourPrice]
+      }
+      // 单次上限限制
+      console.log(234, this.remainPrice, maxOneTimeDiscountFee,);
+      if ( oneTimeLimitation && this.remainPrice >= maxOneTimeDiscountFee ) {
+        Toast({
+          message: `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`,
+          icon: 'none',
+        });
+        // return [true,( maxOneTimeDiscountFee - (this.reduceHours - 1) * hourPrice ) / hourPrice]
+        return [true,  ( this.remainPrice - maxOneTimeDiscountFee) / hourPrice]
+      }
+      return [false,0]
+    },
+    // 验证当前的选项是否可选择
+    isCheck( callback ) {
+      if ( !this?.orderDetail?.parkingRule ) {
+        return
+      }
+      // const {parkInfo,parkingRule,discountInfo} = this.orderDetail
+      const {maxOneTimeDiscountTime,maxOneDayDiscountFee,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = this.orderDetail.parkingRule
+      // 浦东
+      if ( this.parkMallCode === 1 ) {
+        const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+        const remainConsumeTimeFee = remainConsumeTime * hourPrice
+
+        // TODO: 统计纸质优惠券的总金额, usingTotalDiscount - 纸质优惠券的总金额,才是用户当前订单使用的优惠总数 
+        this.isMember = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.memberLevelDiscount )
+        this.isReduces = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.enableConsume )
+      }
+      if ( callback ) callback()
+    },
+    reducesChange( value ) {
+      // console.log(149,value)
+    },
     async confirm() {
       let orderDetail = cloneDeep(this.orderDetail)
       // 如果初次进来操作的跟原来的不一样则重新计算优惠
-      if ( this.checkedList.length !== this.checkedTotal ) {
+      if ( this.checkedList.length !== this.checkedTotal || true ) {
         ['member','reduces'].forEach(key => {
           if ( key === 'member' ) {
             this.memberGrade = {
@@ -115,42 +293,6 @@ export default {
         this.$router.back();
       }
     },
-    checkboxChange() {},
-    // todayReduceDiscountMessage() {},
-    // 验证当前的选项是否可选择
-    isCheck( callback ) {
-      const {parkInfo,parkingRule,discountInfo} = this.orderDetail
-      const {maxOneTimeDiscountTime,maxOneDayDiscountFee,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
-      console.log(129,this.parkMallCode)
-      // 浦东
-      if ( this.parkMallCode === 1 ) {
-        const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
-        const remainConsumeTimeFee = remainConsumeTime * hourPrice
-        console.log(133,this.usingTotalDiscount,remainConsumeTimeFee,maxOneTimeDiscountFee)
-        console.log('this.isMember',{
-          usingTotalDiscount: this.usingTotalDiscount,remainConsumeTimeFee,maxOneTimeDiscountFee,memberLevelDiscount: this.memberLevelDiscount
-        })
-
-        // TODO: 统计纸质优惠券的总金额, usingTotalDiscount - 纸质优惠券的总金额,才是用户当前订单使用的优惠总数 
-        this.isMember = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.memberLevelDiscount )
-        this.isReduces = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.enableConsume )
-      }
-      // if ( this.checkedTotal === 2 ) {
-      //   if ( this.checkedList.indexOf(type) > -1 ) {
-      //
-      //   } else {
-      //     // 未选中
-      //
-      //   }
-      // }
-      if ( callback ) callback()
-    },
-    reducesChange( value ) {
-      console.log(value)
-    },
-    crossMessage() {
-
-    }
   },
 
 };

+ 1 - 0
src/pages/parkingFee/parkingFeeDetail.vue

@@ -100,6 +100,7 @@
             <van-count-down
               v-if="orderDetail.parkingRecord.vehicleNo"
               format="mm:ss"
+              ref="countDown"
               :time="refreshTime * 1000"
               @finish="resetCountDown()"
             >

+ 39 - 6
src/pages/parkingFee/parkingFeeDiscounts.vue

@@ -7,7 +7,7 @@
             <div class="title">会员等级减免</div>
             <div class="content">{{ memberGrade.memberGradeText || '' }}减免{{ memberGrade.discountTime || 0 }}小时。可优惠{{ memberGrade.discountFee || 0 }}元</div>
           </div>
-          <van-checkbox color="#fff" name="member" checked-color="var(--k-color-primary)" :disabled="isMember" />
+          <van-checkbox color="#fff" name="member" checked-color="var(--k-color-primary)" :disabled="isMember" @click="memberClick"/>
           <!-- :checked="isCheck('member')" -->
           <div class="member-discount-info" v-if="isMemberDiscountDisabled">当日已使用</div>
         </div>
@@ -18,15 +18,27 @@
             <div class="content" v-if="orderDetail.parkInfo.parkMallCode !== 1">
               {{ todayReduceDiscountMessage }}
             </div>
-            <uni-number-box
-              v-if="enableConsumeSplit"
+            <van-stepper 
+              v-if="enableConsumeSplit || true" 
+              :min="0"
+              name="reduces"
+              :disabled="isReduces"
+              :max="maxReduceDiscount"
+              :value="reduceHours" 
+              @plus="onReduceHoursChange('plus')"
+              @minus="onReduceHoursChange('minus')"
+              async-change 
+            />
+<!--            reduceHours: {{ reduceHours }}; maxReduceDiscount:{{ maxReduceDiscount }}-->
+<!--            <uni-number-box
+              v-if="enableConsumeSplit || true"
               :min="1"
               :max="maxReduceDiscount"
               v-model="reduceHours"
               @input="reducesChange"
-            ></uni-number-box>
+            ></uni-number-box>-->
           </div>
-          <van-checkbox name="reduces" color="#fff" checked-color="var(--k-color-primary)" :disabled="isReduces" />
+          <van-checkbox name="reduces" color="#fff" checked-color="var(--k-color-primary)" :disabled="isReduces" @click="reducesClick" />
         </div>
       </van-checkbox-group>
     </div>
@@ -40,7 +52,7 @@
               }}
             </div>
             <div :class="['van-hairline--surround','usingTotalDiscount', usingTotalDiscount > 0 && 'usingTotalDiscount-red']"
-            >已优惠{{ usingTotalDiscount | currency }}元
+            >已优惠{{ remainPrice | currency }}元
             </div
             >
             <!-- <van-count-down :time="3 * 60 * 1000" /> -->
@@ -224,4 +236,25 @@ export default {
 /deep/ checkbox .wx-checkbox-input {
   border-radius: 50% !important;
 }
+
+/deep/ .van-stepper__input {
+  background-color: #ffffff;
+  font-size: 34px;
+  border: 1px solid #e5e5e5;
+  border-left: 0;
+  border-right: 0;
+  margin-left: 0;
+  margin-right: 0;
+}
+
+
+/deep/ .van-stepper__minus {
+  border: 1px solid #e5e5e5;
+  border-right: 0;
+}
+
+/deep/ .van-stepper__plus {
+  border: 1px solid #e5e5e5;
+  border-left: 0;
+}
 </style>

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

@@ -1,4 +1,4 @@
-import checkOutQHResponse from "@/api/mockData/checkout.qh10.response.json";
+import checkOutQHResponse from "@/api/mockData/checkout.pd10.response.json";
 import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
 import state from "@/store/order/state";
 import mutations from "@/store/order/mutations";
@@ -36,8 +36,8 @@ export default {
         // console.log('无牌车扫码出场', endlessLoop);
         // 场内缴费,调 check-out 接口,
         const method = unlicensed && endlessLoop || !vehicleNo ? unlicensedCarCheckout : checkOut
-        const res = await method(vehicleNo, unlicensed, gateId);
-        // const res = checkOutQHResponse
+        // const res = await method(vehicleNo, unlicensed, gateId);
+        const res = checkOutQHResponse
         if ( res?.parkingRecord?.totalFee <= 0 ) {
           callback && callback({
             unlicensed,

+ 4 - 0
src/store/order/mutations.js

@@ -83,6 +83,9 @@ export default {
   setUnlimitUsePoints(state, payload) {
     state.unlimitUsePoints = payload;
   },
+  setUnLimitWeekendPoints(state, payload) {
+    state.unLimitWeekendPoints = payload;
+  },
   setUnitHour( state,payload ) {
     state.unitHour = payload || 1;
   },
@@ -138,6 +141,7 @@ export default {
     state.pointsTime = ''; // 已兑换的积分时间
     state.unitAmount = 1;
     state.unlimitUsePoints = 'LIMIT';
+    state.unLimitWeekendPoints = false;
     state.unitHour = 1;
     // 停车优惠:会员等级和消费减免
     state.memberLevelDiscount = false; // 是否开启会员等级

+ 14 - 10
src/store/order/points.js

@@ -28,6 +28,7 @@ export default {
         maxDiscountFee, // 单次上限(元)
         unitAmount, // 兑换值(元)
         unlimitUsePoints= "LIMIT", // 前海积分最大上限
+        unLimitWeekendPoints = false,
         unitHour, // 兑换值(小时)
         pointsPerUnit = 0, // 500积分对应的价值
         discountFee,
@@ -53,6 +54,7 @@ export default {
     commit('setPointsPerHour',pointsPerUnit);
     commit('setUnitAmount',unitAmount);
     commit('setUnlimitUsePoints', unlimitUsePoints);
+    commit('setUnLimitWeekendPoints', unLimitWeekendPoints);
     commit('setUnitHour', unitHour);
     commit('setIntegralDesc',pointsTime ? `已选择兑换${ pointsTime }${parkMallCode === 5 ? '元' : '小时'}` : available > pointsPerUnit ? `${ available }积分可减免` : `${ pointsPerUnit }积分可停车1小时`); // 积分优惠处的描述
   },
@@ -102,7 +104,7 @@ export default {
   // 积分减免
   pointsMath( {commit,dispatch,state},{type,callback} ) {
     const {parkInfo,parkingRule} = state.orderDetail
-    const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
+    const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime, maxOneDayDiscountFee} = parkingRule
     const {parkMallCode} = parkInfo
     console.log(376,maxOneTimeDiscountTime,state.availableDiscountFee)
     /**
@@ -120,7 +122,8 @@ export default {
     if ( maxPointsTime > state.availableDiscountFee ) {
       maxPointsTime = state.availableDiscountFee
     }
-    if ( parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT' ) {
+    // if ( parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT' ) {
+    if ( parkMallCode === 5 && !state.unLimitWeekendPoints ) {
       if ( type === 'add' && (state.pointsTime >= maxPointsTime || state.usingTotalDiscount >= state.availableDiscountFee) ) {
         // 以下是深圳积分上限规则
         // 超出抵扣上限,每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元 '优惠金额' >= '每日最高可抵扣'
@@ -135,25 +138,25 @@ export default {
     }
     // 单日上限限制
     if ( oneDayLimitation && !msg && parkMallCode !== 5) {
-      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
-      const remainConsumeTimeFee = remainConsumeTime * hourPrice
+      // const maxOneTimeDiscountFee = maxOneDayDiscountFee
+      // const remainConsumeTimeFee = remainConsumeTime * hourPrice
       // 计算单日剩余 remainConsumeTime
       // 当前使用优惠 state.usingTotalDiscount
       // 判断符合上限
       // 浦东积分上限判断
-      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount >= maxOneTimeDiscountFee ) {
-        msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
+      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount >= maxOneDayDiscountFee ) {
+        msg = `超出抵扣上限,每次最高可抵扣${ maxOneDayDiscountFee }元`
       }
     }
     // 单次上限限制
     if ( oneTimeLimitation && !msg && parkMallCode !== 5) {
-      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
-      const remainConsumeTimeFee = remainConsumeTime * hourPrice
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice // 计算时间对应的金额
+      // const remainConsumeTimeFee = remainConsumeTime * hourPrice
       // 计算单日剩余 remainConsumeTime
       // 当前使用优惠 state.usingTotalDiscount
       // 判断符合上限
       // 浦东积分上限判断: 减去纸质优惠券的金额
-      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount - state.paperDiscountFee >= maxOneTimeDiscountFee * hourPrice ) {
+      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount >= maxOneTimeDiscountFee ) {
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
       }
     }
@@ -164,7 +167,8 @@ export default {
       return
     }
     // 计算浦东的上限
-    if ( type === 'add' && state.usingTotalDiscount >= state.availableDiscountFee && parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT') {
+    // if ( type === 'add' && state.usingTotalDiscount >= state.availableDiscountFee && parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT') {
+    if ( type === 'add' && state.usingTotalDiscount >= state.availableDiscountFee && parkMallCode === 5 && !state.unLimitWeekendPoints) {
       return;
     }
     if ( type === 'add' ) {

+ 2 - 1
src/store/order/state.js

@@ -23,7 +23,8 @@ export default  {
   available: 0, // 用户可用积分
   maxPointsTime: '', // 积分最大兑换时长
   pointsTime: '', // 已兑换的积分时间
-  unlimitUsePoints: 'LIMIT',
+  unlimitUsePoints: 'LIMIT', // 旧的积分上限
+  unLimitWeekendPoints: false, // 新的积分上限, 默认为false(不开启), unLimitWeekendPoints: true # 开启无上限功能;   unLimitWeekendPoints: false # 关闭无上限功能;
   unitAmount: 1, // 金额
   unitHour: 1,  // 小时
   // 停车优惠:会员等级和消费减免

+ 1 - 3
src/store/order/utils.js

@@ -20,9 +20,7 @@ export function setSelected( types,orderDetail ) {
         // 如果是消费减免
         if ( orderDetail.discountInfo?.consume?.length ) {
           const [consume] = orderDetail.discountInfo?.consume;
-          if ( !consume?.discountFee ) {
-            consume.discountFee = (consume.hasOwnProperty('defaultDiscountTime')? consume.defaultDiscountTime : consume.discountTime ) * orderDetail.parkingRule.hourPrice || 0
-          }
+          consume.discountFee = consume.hasOwnProperty('discountFee') ? consume.discountFee : consume.defaultDiscountTime * orderDetail.parkingRule.hourPrice || 0
           orderDetail.discountInfo.consume = [{
             ...consume,
             selected: consume.hasOwnProperty('selected') ? consume.selected : consume?.defaultSelected || false

+ 3 - 1
src/styles/common.less

@@ -112,7 +112,6 @@ button {
 .van-toast{
   border-radius: 10px;
   padding: 25px 42px;
-  width: 65%;
   min-height: inherit;
   background-color: @toast-background-color;
   .van-toast__text {
@@ -124,6 +123,9 @@ button {
     color: #FFFFFF;
   }
   top: 300PX;
+  &.width65{
+    width: 65%;
+  }
   &.top300{
     top: 300PX;
   }