Эх сурвалжийг харах

Merge pull request #83 from John-Hong/John/release-2.8.0/KIP-9697

积分上限和查询缴费部分ui改造
Tron 2 жил өмнө
parent
commit
2b78014d84
44 өөрчлөгдсөн 1910 нэмэгдсэн , 1120 устгасан
  1. 1 1
      src/App.vue
  2. 60 0
      src/api/mockData/checkout.pd1.response.json
  3. 70 0
      src/api/mockData/checkout.pd2.response.json
  4. 62 0
      src/api/mockData/checkout.pd3.response.json
  5. 62 0
      src/api/mockData/checkout.pd4.response.json
  6. 62 0
      src/api/mockData/checkout.pd5.response.json
  7. 96 0
      src/api/mockData/checkout.pd6.response.json
  8. 102 0
      src/api/mockData/checkout.qh8.response.json
  9. 6 0
      src/api/parking/index.js
  10. 2 2
      src/api/request.js
  11. 75 0
      src/common/js/BaseDictionary.js
  12. 4 0
      src/components/uni-number-box/uni-number-box.vue
  13. 1 1
      src/main.js
  14. 1 1
      src/pages/parkingFee/components/base/parkingFeeCoupon.vue
  15. 1 1
      src/pages/parkingFee/components/base/parkingReceipt/parkingOrderDetail.vue
  16. 1 1
      src/pages/parkingFee/components/officeBlue/parkingReceipt/parkingInvoiceImage.vue
  17. 1 1
      src/pages/parkingFee/components/purple/parkingFee.vue
  18. 1 1
      src/pages/parkingFee/components/purple/vehicleAddOrEdit.vue
  19. 1 1
      src/pages/parkingFee/mixins/base.js
  20. 28 16
      src/pages/parkingFee/mixins/parkingFeeCoupon.js
  21. 34 3
      src/pages/parkingFee/mixins/parkingFeeDetail.js
  22. 102 20
      src/pages/parkingFee/mixins/parkingFeeDiscounts.js
  23. 112 321
      src/pages/parkingFee/mixins/parkingFeePaperCoupon.js
  24. 1 1
      src/pages/parkingFee/mixins/parkingReceipt/parkingChangeHeader.js
  25. 14 11
      src/pages/parkingFee/parkingFeeDetail.vue
  26. 110 48
      src/pages/parkingFee/parkingFeeDiscounts.vue
  27. 30 52
      src/pages/parkingFee/parkingFeePaperCoupon.vue
  28. 1 1
      src/pages/parkingFee/parkingFeePayment.vue
  29. 11 10
      src/store/index.js
  30. 0 616
      src/store/order.js
  31. 3 0
      src/store/order/consume.js
  32. 56 0
      src/store/order/coupon.js
  33. 111 0
      src/store/order/index.js
  34. 59 0
      src/store/order/memberLevel.js
  35. 158 0
      src/store/order/mutations.js
  36. 42 0
      src/store/order/paperCoupon.js
  37. 260 0
      src/store/order/points.js
  38. 44 0
      src/store/order/state.js
  39. 27 0
      src/store/order/unlicensed.js
  40. 77 0
      src/store/order/utils.js
  41. 5 0
      src/utils/api-kip.js
  42. 10 7
      src/utils/index.js
  43. 2 2
      src/utils/request-kip.js
  44. 4 2
      vue.config.js

+ 1 - 1
src/App.vue

@@ -84,7 +84,7 @@ export default {
         if (carList) {
           uni.setStorageSync('carList', JSON.parse(carList));
         }
-        this.$store.commit('SET_IS_INIT', false);
+        this.$store.commit('SET_IS_INIT', true);
         window.token = `${window.location.href}`.replace(/.*wx\/(.*)\/.*/g, '$1');
         try {
           const options = await wssInit();

+ 60 - 0
src/api/mockData/checkout.pd1.response.json

@@ -0,0 +1,60 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪D00020",
+    "enterTime": "2023-04-25 08:46:00",
+    "serviceMin": 378,
+    "totalFee": 700,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970693",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 7
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 10,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGrade": "01",
+        "memberGradeText": "嘉友卡",
+        "discountTime": 1,
+        "discountFee": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 10000,
+        "pointsPerUnit": 1200,
+        "unitAmount": 0,
+        "newMember": false,
+        "label": "10000积分可减免"
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 10,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": false,
+    "maxOneDayCoupons": 5,
+    "remainCoupons": 5,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 0,
+    "remainConsumeTime": 0,
+    "hourPrice": 10
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 1,
+    "buildingId": "PKC-P1"
+  }
+}

+ 70 - 0
src/api/mockData/checkout.pd2.response.json

@@ -0,0 +1,70 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪D00020",
+    "enterTime": "2023-04-25 08:46:00",
+    "serviceMin": 378,
+    "totalFee": 700,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970693",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 7
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 10,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGrade": "01",
+        "memberGradeText": "嘉友卡",
+        "discountTime": 1,
+        "discountFee": 10
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "maxDiscountTime": 10,
+        "defaultDiscountTime": 3,
+        "redeemSalesAmount": 1000
+      }
+    ],
+    "points": [
+      {
+        "available": 10000,
+        "pointsPerUnit": 1200,
+        "unitAmount": 0,
+        "newMember": false,
+        "label": "10000积分可减免"
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 10,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": false,
+    "maxOneDayCoupons": 5,
+    "remainCoupons": 5,
+    "oneDayLimitation": true,
+    "oneTimeLimitation": true,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": true,
+    "enableConsumeSplit": true,
+    "maxConsumeTime": 0,
+    "remainConsumeTime": 0,
+    "hourPrice": 10
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 1,
+    "buildingId": "PKC-P1"
+  }
+}

+ 62 - 0
src/api/mockData/checkout.pd3.response.json

@@ -0,0 +1,62 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪D00020",
+    "enterTime": "2023-04-25 08:46:00",
+    "serviceMin": 378,
+    "totalFee": 700,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970693",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 7
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 10,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGrade": "01",
+        "memberGradeText": "嘉友卡",
+        "discountTime": 1,
+        "discountFee": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 10000,
+        "pointsPerUnit": 1200,
+        "unitAmount": 0,
+        "newMember": false,
+        "label": "10000积分可减免"
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 10, 单次最多
+    "enableNewMemberPoints": false, 
+    "enablePoints": true,
+    "oneDayLimitation": true,
+    "oneTimeLimitation": true,
+    "enableCoupon": false,
+    "maxOneDayCoupons": 5,
+    "remainCoupons": 5, 保留优惠券
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": false, 启用消费
+    "enableConsumeSplit": false, 启用消费拆分
+    "maxConsumeTime": 0, 最大消耗时间
+    "remainConsumeTime": 0,  剩余消费时间
+    "hourPrice": 10 每小时单价
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 1,
+    "buildingId": "PKC-P1"
+  }
+}

+ 62 - 0
src/api/mockData/checkout.pd4.response.json

@@ -0,0 +1,62 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪D00020",
+    "enterTime": "2023-04-25 08:46:00",
+    "serviceMin": 1975,
+    "totalFee": 3300,
+    "actualPayFee": 23,
+    "thirdParkOrderNo": "4970693",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 33
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 10,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGrade": "01",
+        "memberGradeText": "嘉友卡",
+        "discountTime": 1,
+        "discountFee": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 10000,
+        "pointsPerUnit": 1200,
+        "unitAmount": 0,
+        "newMember": false,
+        "label": "10000积分可减免"
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 10,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": false,
+    "maxOneDayCoupons": 5,
+    "remainCoupons": 5,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 0,
+    "remainConsumeTime": 0,
+    "hourPrice": 10,
+    "oneDayLimitation": false,
+    "oneTimeLimitation": true
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 6,
+    "buildingId": "PKC-P1"
+  }
+}

+ 62 - 0
src/api/mockData/checkout.pd5.response.json

@@ -0,0 +1,62 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪K10000",
+    "enterTime": "2023-04-27 12:57:00",
+    "serviceMin": 103,
+    "totalFee": 200,
+    "actualPayFee": 0.0,
+    "thirdParkOrderNo": "4970704",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 2.00
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 10,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGrade": "01",
+        "memberGradeText": "嘉友卡",
+        "discountTime": 1,
+        "discountFee": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 10000,
+        "pointsPerUnit": 1200,
+        "unitAmount": 0,
+        "newMember": false,
+        "label": "10000积分可减免"
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 10,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": false,
+    "maxOneDayCoupons": 5,
+    "remainCoupons": 5,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 0,
+    "remainConsumeTime": 0,
+    "hourPrice": 10,
+    "oneTimeLimitation": true,
+    "oneDayLimitation": false
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 1,
+    "buildingId": "PKC-P1"
+  }
+}

+ 96 - 0
src/api/mockData/checkout.pd6.response.json

@@ -0,0 +1,96 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪K10003",
+    "enterTime": "2023-04-27 12:59:00",
+    "serviceMin": 1696,
+    "totalFee": 2500,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970706",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 25
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 36,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGradeText": "嘉礼卡",
+        "discountTime": 1,
+        "discountFee": 12
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "defaultDiscountTime": 1,
+        "discountFee": 12,
+        "redeemSalesAmount": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 1234,
+        "pointsPerUnit": 1000,
+        "unitAmount": 1,
+        "newMember": false,
+        "label": "1234积分可减免"
+      }
+    ],
+    "coupons": [
+      {
+        "code": "fvqwcec9tnx_t",
+        "name": "积分商城兑换券",
+        "expirationDate": "2023-03-29 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": true,
+        "superposition": "2",
+        "limitCountPerOrder": 5
+      },
+      {
+        "code": "pua6du6eqjm_t",
+        "name": "积分商城兑换券",
+        "expirationDate": "2023-03-30 23:59:59",
+        "discountFee": 36,
+        "defaultSelected": false,
+        "superposition": "1",
+        "limitCountPerOrder": 0
+      },
+      {
+        "code": "xyzr0yyxca0_t",
+        "name": "积分商城兑换券",
+        "expirationDate": "2023-03-31 23:59:59",
+        "discountFee": 24,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 5
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "paper coupon 描述"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 5,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "paper coupon 描述",
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 5,
+    "remainConsumeTime": 5,
+    "hourPrice": 12,
+    "oneTimeLimitation": true,
+    "oneDayLimitation": false
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "深圳停车场最新描述涨价到10块一小时",
+    "parkMallCode": 1,
+    "buildingId": "PKC-P1"
+  }
+}

+ 102 - 0
src/api/mockData/checkout.qh8.response.json

@@ -0,0 +1,102 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "赣A45678",
+    "enterTime": "2023-04-17 18:14:19",
+    "serviceMin": 24268,
+    "totalFee": 12000,
+    "actualPayFee": 80,
+    "thirdPartyId": "6a61bf47dc324ccd9d9ae8e3c0b914ab",
+    "thirdParkOrderNo": "Mh1p3CphEE7GbGv7Wzehs",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 120
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 40,
+    "memberLevelDiscount": false,
+    "points": [
+      {
+        "available": 4060,
+        "maxDiscountFee": 20,
+        "pointsPerUnit": 50,
+        "unitAmount": 5,
+        "newMember": false,
+        "label": "已选择兑换20元",
+        "discountFee": 20
+      }
+    ],
+    "coupons": [
+      {
+        "code": "sggsxqg614f_t",
+        "name": "首2小时停车券(测试)",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 20,
+        "defaultSelected": true,
+        "superposition": "2",
+        "limitCountPerOrder": 1
+      },
+      {
+        "code": "jvfmu4ept17_t",
+        "name": "5元停车券(周末及法定节假日)",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 5,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1000
+      },
+      {
+        "code": "r43iz9fgt5i_t",
+        "name": "5元停车券(周末及法定节假日)",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 5,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1000
+      },
+      {
+        "code": "h4rosxr74om_t",
+        "name": "周末首2小时满赠停车券--001--001",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 20,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 1
+      },
+      {
+        "code": "0wtk9cbu9g2_t",
+        "name": "首2小时免费停车优惠券",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 20,
+        "defaultSelected": false,
+        "superposition": "1",
+        "limitCountPerOrder": 1
+      },
+      {
+        "code": "g2viqqia3hs_t",
+        "name": "停车电子券(金额券)",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 5,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 0
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneDayDiscountFee": 60,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": true,
+    "enablePaperCoupons": false,
+    "maxPointsTime": 101,
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "availableDiscountFee": 60,
+    "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"
+  }
+}

+ 6 - 0
src/api/parking/index.js

@@ -163,3 +163,9 @@ export function qrCodes(codeId) {
 }
 
 
+// 1.3 纸质优惠劵金额接口
+export function paperCoupon(couponCode, vehicleNo) {
+  return window.requestms.get(`parking-lots/paper-coupon?couponCode=${couponCode}&vehicleNo=${vehicleNo}`, { loading: true });
+}
+
+

+ 2 - 2
src/api/request.js

@@ -98,8 +98,8 @@ function XUser(config) {
     // lbsId: '8aaa82ea804d07cd0180516ff03b0008',
     lbsId: store.state?.lbsId || '',
   };
-  // params = {"userId":"8aaa809d835ba76d018377d482ac0004","sourceType":"WECHAT","phoneNumber":"15090631337","projectId":"","brandId":"8aaa81947c6e1ca0017c73c13cc30006","cid":"oudWQ5ccsJLSlUGt0s_RQysoHqgg","vipCode":"KERRY100213432","lbsId":"8aaa82ea804d07cd0180516ff03b0008"}
-  if (/orders-and-prepay|calculate-discount|unlicensed-car-check-in|unlicensed-car-checkout/g.test(config.url)) {
+  // params = {"userId": "8aaa809d835ba76d018378bc57180006","sourceType": "WECHAT","phoneNumber": "18521563898","projectId": "paroject1","buildingId": "QHKC-P1","brandId":"8a84853b7c91ac5b017c962dab55030e","cid": "oIUfO5XAVleJ88z13i1_08DCKIhQ","vipCode":"KERRY100200040","lbsId":"8aaa81cb7c836c6b017c83e46b110001"}
+  if (/orders-and-prepay|calculate-discount|unlicensed-car-check-in|unlicensed-car-checkout|paper-coupon/g.test(config.url)) {
     params.buildingId = window.localStorage.getItem('buildingId');
   }
   const newParams = {}

+ 75 - 0
src/common/js/BaseDictionary.js

@@ -36,7 +36,14 @@ const HKC = {
   },
 };
 
+// 前海
 const QHKC = {
+  dev: {
+    ...testAppIdInfo,
+    groupId: '8aaa81947c6e1ca0017c73c13cc30006',
+    mallId: '8aaa82ea804d07cd0180516ff03b0008',
+    projectId: 'HKC',
+  },
   qa: {
     ...testAppIdInfo,
     groupId: '8a84819f7c6e260e017c72669bbe01c2',
@@ -52,7 +59,53 @@ const QHKC = {
   },
 }
 
+// 浦东
+const PKC = {
+  dev: {
+    ...testAppIdInfo,
+    groupId: '8aaa82ea804d07cd01805174dd3b000c',
+    mallId: '8aaa81cb7c836c6b017c83e46b110001',
+    projectId: 'PKC',
+  },
+  qa: {
+    ...testAppIdInfo,
+    groupId: '8a8480487c96d58f017c9b7bab7d0020',
+    mallId: '8a8481f57cca9442017ce02875b8004a',
+    projectId: '184',
+  },
+  prod: {
+    // TODO: 等待对应公众号上线
+    ...testAppIdInfo,
+    groupId: '8a8884e77cc9e70a017cca14d07e0002',
+    mallId: '8a88835c7cd96d31017cda3f77e80003',
+    projectId: '184',
+  },
+}
+// 静安
+const JAKC = {
+  dev: {
+    ...testAppIdInfo,
+    groupId: '8aaa82ea804d07cd01805174dd3b000c',
+    mallId: '8aaa81cb7c836c6b017c83e2c76f0000',
+    projectId: 'JAKC',
+  },
+  qa: {
+    ...testAppIdInfo,
+    groupId: '8a8480487c96d58f017c9b7bab7d0020',
+    mallId: '8a8481f57cca9442017ce026ddd40049',
+    projectId: 'JAKC',
+  },
+  prod: {
+    // TODO: 等待对应公众号上线
+    ...testAppIdInfo,
+    groupId: '8a8884e77cc9e70a017cca14d07e0002',
+    mallId: '8a88835c7cd96d31017cda2fd9910000',
+    projectId: '189',
+  },
+}
+
 export const lbsDictionary = {
+  // 沈阳
   '8aaa87bc7ce98224017ce995fd8a0002': {
     ...SKC,
   },
@@ -65,6 +118,7 @@ export const lbsDictionary = {
   "8a8883607d029a46017d02a2be880000": {
     ...SKC,
   },
+  // 杭州
   '4028e3817bf860f3017bf86279b50001': {
     ...HKC,
   },
@@ -74,6 +128,7 @@ export const lbsDictionary = {
   '8a8883557cca9463017ccaedb04f0000': {
     ...HKC,
   },
+  // 前海
   '8aaa83397bf7310e017bf7c8fb740009': {
     ...QHKC,
   },
@@ -82,6 +137,26 @@ export const lbsDictionary = {
   },
   '8a8884e77cc9e70a017cca3ad6170006': {
     ...QHKC,
+  },
+  // 静安
+  "8aaa80ae7c741565017c74ea1efe004d":{
+    ...JAKC
+  },
+  "8a8481f57cca9442017ce3f4aebc0099":{
+    ...JAKC
+  },
+  "8a88835c7cd96d31017cda3c148a0002":{
+    ...JAKC
+  },
+  // 浦东
+  "8aaa80ae7c741565017c74dbedd0004c":{
+    ...PKC
+  },
+  "8a8481f57cca9442017ce3f5e0b0009a":{
+    ...PKC
+  },
+  "8a88835c7cd96d31017cda47d11b0004":{
+    ...PKC
   }
 };
 

+ 4 - 0
src/components/uni-number-box/uni-number-box.vue

@@ -88,14 +88,17 @@ export default {
       if (this.disabled) {
         return;
       }
+      console.log(type, 91)
       const scale = this._getDecimalScale();
       let value = this.inputValue * scale;
       let step = this.step * scale;
       if (type === 'minus') {
         value -= step;
+        console.log(97, value , this.min * scale)
         if (value < this.min * scale) {
           return;
         }
+        console.log(101, value, this.max, scale)
         if (value > this.max * scale) {
           value = this.max * scale;
         }
@@ -108,6 +111,7 @@ export default {
           value = this.min * scale;
         }
       }
+      console.log(113, value, scale)
 
       this.inputValue = String(value / scale);
     },

+ 1 - 1
src/main.js

@@ -6,7 +6,7 @@ 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) {
+if (debug && false) {
   window.vConsole = new VConsole(
     // { theme: 'dark' }
   );

+ 1 - 1
src/pages/parkingFee/components/base/parkingFeeCoupon.vue

@@ -34,7 +34,7 @@
       <div class="flewx-content">
         应付<span style="color: red; font-size: 32px; padding-left: 20px">{{ actualPayFee | currency }}</span>
-        <span style="color: #8d8d8d; padding-left: 30px; font-size: 28px">已优惠{{ usingTotalDiscount | currency }}元</span>
+        <span style="color: #8d8d8d; padding-left: 30px; font-size: 28px">已优惠{{ remainPrice | currency }}元</span>
       </div>
       <div
         :class="{

+ 1 - 1
src/pages/parkingFee/components/base/parkingReceipt/parkingOrderDetail.vue

@@ -14,7 +14,7 @@
           <template>
             <div class="item-header">
               <div>{{ item.orderNo }}-{{ item.vehicleNo }}</div>
-              <div class="red">¥{{ getOrderItemPrice(item) }}</div>
+              <div class="red">¥{{ item.totalPaidAmount }}</div>
             </div>
             <div class="item-bottom">
               <div>{{ item.parkName }}</div>

+ 1 - 1
src/pages/parkingFee/components/officeBlue/parkingReceipt/parkingInvoiceImage.vue

@@ -3,7 +3,7 @@
     <div class="part">
       <div class="part-item lines">
         <span class="part-item-key">电子邮箱</span>
-        <span class="part-item-value">{{ res.email }}</span>
+        <span class="part-item-value">{{ order.email }}</span>
       </div>
       <div class="invoice-img" v-if="order.invoiceUrl">
       </div>

+ 1 - 1
src/pages/parkingFee/components/purple/parkingFee.vue

@@ -138,7 +138,7 @@
           <div class="top_down" @click="top_display" v-else><van-icon name="arrow-up" /></div>
         </div>
       </div>
-      <plate-number ref="plateKeyboard" :noDisBtn="[36, 37]" :carType="carType" :active="active" :ind="ind" :numArr="numArr" @carnoArr="updateCarno"></plate-number>
+      <plate-number ref="plateKeyboard" :noDisBtn="[32, 33, 34,35, 36, 37]" :carType="carType" :active="active" :ind="ind" :numArr="numArr" @carnoArr="updateCarno"></plate-number>
     </div>
   </scroll-view>
 </template>

+ 1 - 1
src/pages/parkingFee/components/purple/vehicleAddOrEdit.vue

@@ -47,7 +47,7 @@
       <div class="reminder-content">·用户可以添加多个"燃油车牌号"或"新能源车牌号"</div>
       <div class="reminder-content">·用户可以更改或删除已经绑定车牌</div>
     </div>
-    <plate-number ref="plateKeyboard" :disBtn="[38]" :carType="carType" :active="active" :ind="ind" :numArr="numArr" @carnoArr="updateCarno"></plate-number>
+    <plate-number ref="plateKeyboard" :noDisBtn="[32, 33, 34,35,36,37 ]"  :disBtn="[38]" :carType="carType" :active="active" :ind="ind" :numArr="numArr" @carnoArr="updateCarno"></plate-number>
   </div>
 </template>
 

+ 1 - 1
src/pages/parkingFee/mixins/base.js

@@ -26,7 +26,7 @@ export default {
       this.theme = 'theme-office'
     }
     // TODO: 根据lbsId动态切换
-    this.theme = 'theme-pudong'
+    // this.theme = 'theme-pudong'
     // this.theme = 'theme-jingan'
   },
 }

+ 28 - 16
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -30,6 +30,7 @@ export default {
       maxOneDayDiscountFee: (state) => state.order.maxOneDayDiscountFee, // 深圳单日单次使用上限
       usingTotalDiscount: (state) => state.order.usingTotalDiscount, // 当前已使用优惠
       availableDiscountFee: (state) => state.order.availableDiscountFee, // 当前已使用优惠
+      paperDiscountFee: (state) => state.order.paperDiscountFee, // 当前已使用优惠
       lbsId: (state) => state.lbsId, // 楼栋ID
       groupId: (state) => state.groupId, // 楼盘ID
     }),
@@ -57,7 +58,7 @@ export default {
        * 2、superposition  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加);
        * */
       this.couponList = [...this.coupons];
-      this.remainPrice = this.availableDiscountFee * 1;
+      this.remainPrice = this.usingTotalDiscount;
       if (this.couponList.length) {
         this.couponList = this.couponList.map((elm, index) => {
           elm.disabled = true;
@@ -108,7 +109,7 @@ export default {
       }
     },
     // 对不同类型的优惠券进行汇总统计
-    groupedCouponData() {
+    /*groupedCouponData() {
       const groupedData = {}; // 所有的电子券按照批次分组;
       let couponList = [...this.couponList]; // 获取目前用户的电子券
       couponList.forEach((elm, index) => {
@@ -143,21 +144,21 @@ export default {
               if (item?.superposition === '1') {
                 if (selectedList.length) {// 如果存在已选择项,设置未选中的为不可选择
                   item.disabled = this.checkedCouponList.indexOf(elmName) < 0;
-                  /* 
+                  /!* 
                   TODO: 如果不可叠加电子券的选择规则改变为,选中某一项不可叠加券,其他券不可选择,则打开此处注释
                   if (item.superposition === '2') {
                     item.disabled = selectedList.length > 0
-                  } */
+                  } *!/
                 } else {
                   item.disabled = this.checkedCouponList.length > 0;
                 }
               }
-              /* 
+              /!* 
               // TODO: 如果不可叠加电子券的选择规则改变为,选中某一项不可叠加券,其他券不可选择,则打开此处注释
               // 如果存在已选的电子优惠券,将其他类型的优惠券设置为不可选中
               if ( item.superposition === '2' && selectedList.length) {
                 item.disabled = true
-              } */
+              } *!/
               return item
             })
             break
@@ -178,7 +179,7 @@ export default {
         }
       })
       this.couponList = [...couponList];
-    },
+    },*/
     // 对不同类型的优惠券进行汇总统计
     newGroupedCouponData() {
       let couponList = [...this.couponList]; // 获取目前用户的电子券
@@ -204,10 +205,12 @@ export default {
             elm.disabled = false; // 默认可选
             const elmName = `coupon${i}`;
             if (elm.superposition === superposition) {
-              if (limitCountPerOrder) { // 是否存在上限
+              if (elm.limitCountPerOrder > 1) { // 是否存在上限
                 if (this.checkedCouponList.length >= limitCountPerOrder) {
                   elm.disabled = this.checkedCouponList.indexOf(elmName) < 0
                 }
+              } else {
+                elm.disabled = this.checkedCouponList.indexOf(elmName) < 0 // 同类型可选的券,如果可选上限是1,就设为不可选择
               }
             } else {
               elm.disabled = true; // 非同批次的优惠券设置为不可选择
@@ -216,7 +219,7 @@ export default {
           })
           break;
       }
-      console.log(282, couponList);
+      console.log(220, couponList)
       this.couponList = [...couponList];
     },
     // 根据电子券规则判断是否可选
@@ -270,7 +273,7 @@ export default {
     // 超限提示
     crossMessage() {
       const { parkMallCode } = this.orderDetail.parkInfo;
-      const { maxOneDayCoupons, maxonedaydiscountFee, remainConsumeTime, hourPrice, availableDiscountFee } = this.orderDetail.parkingRule;
+      const { maxOneDayCoupons, maxonedaydiscountFee, remainConsumeTime, hourPrice, availableDiscountFee, maxOneTimeDiscountTime } = this.orderDetail.parkingRule;
       const {
         usingTotalDiscount, // 使用总抵扣
         coupons,
@@ -281,9 +284,12 @@ export default {
       } = this.orderDetail.parkingRecord;
       // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
       let remainPrice = remainConsumeTime * hourPrice;
-      if (remainPrice > actualPayFee) {
-        remainPrice = actualPayFee;
+      if (parkMallCode === 5) {
+        if (remainPrice > actualPayFee) {
+          remainPrice = actualPayFee;
+        }  
       }
+      
       // let totalFee = this.parkDiscountTotal.feeCopy;
       // totalFee += this.totalFee;
       // 电子券优惠金额总计
@@ -318,16 +324,23 @@ export default {
        // });
        }*/
       // 深圳超限处理
-      if (parkMallCode === 5 && this.remainPrice  <= actualPayFee) {
+      if (parkMallCode === 5 && this.remainPrice  >= this.actualPayFee) {
+        return Toast({
+          message: `每日最高可抵扣${this.actualPayFee}元`,
+          icon: 'none',
+        });
+      }
+      // 浦东,单次上限提示, 后续 usingTotalDiscount 再减去 纸质优惠券的金额
+      if (parkMallCode === 1 && usingTotalDiscount- this.paperDiscountFee >= maxOneTimeDiscountTime) {
         return Toast({
-          message: `每日最高可抵扣${this.remainPrice}元`,
+          message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
           icon: 'none',
         });
       }
+      return false
     },
     // 确认
     confirm() {
-      console.log(336, this.checkedCouponList);
       // 重新计算兑换券优惠
       const checkedCouponList = this.checkedCouponList.map((i) => this.item2Number(i));
       console.log(checkedCouponList);
@@ -339,7 +352,6 @@ export default {
         }
         return elm;
       });
-      console.log(348, couponList);
       this.$store.dispatch('order/saveCouponMath', {
         couponList: couponList,
         callback: () => {

+ 34 - 3
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -62,6 +62,7 @@ export default {
       usePoints: (state) => state.order.usePoints,
       usePointsTime: (state) => state.order.usePointsTime,
       enableConsume: (state) => state.order.enableConsume,
+      memberLevelDiscount: (state) => state.order.memberLevelDiscount,
       unitAmount: (state) => state.order.unitAmount,
       unlicensedInfo: state => state.unlicensedInfo,
       endlessLoop: (state) => state.endlessLoop,
@@ -108,7 +109,7 @@ export default {
     // 前往支付
     async toPay() {
       const { parkingRecord, discountInfo = {}, parkingRule = {}} = this.orderDetail;
-      const { coupons, points } = discountInfo
+      const { coupons, points, memberGrade = [], paperCoupons = [] } = discountInfo
       const { hourPrice } = parkingRule
       try {
         const params = {
@@ -127,6 +128,16 @@ export default {
             actualUsedDiscount: discountInfo?.usingTotalDiscount || 0, //实际优惠金额
           },
         };
+        // 会员等级减免
+        if ( memberGrade?.length && memberGrade[0].discountFee > 0 && memberGrade[0].hasOwnProperty('selected')? memberGrade[0].selected : memberGrade[0].defaultSelected) {
+          const {discountFee, discountTime} = memberGrade[0]
+          params.discountInfo.memberLevel = {
+            "discountTime": discountTime,
+            "discountFee": discountFee,
+            "memberGrade": memberGrade[0].memberGrade
+          }
+        }
+        
         // 积分
         if (points?.length && points[0].discountFee > 0) {
           // 15 兑换 5元
@@ -150,6 +161,19 @@ export default {
             params.discountInfo.coupons = selectedCoupons
           }
         }
+        // 纸质优惠券
+        if ( paperCoupons?.length ) {
+            params.discountInfo.paperCoupons = paperCoupons.filter(elm => {
+              if ( !elm.discountCode ) {
+                return false
+              }
+              return {
+                ...elm,
+                "discountFee": elm.discountFee,
+                discountTime: elm.discountFee / hourPrice * 60
+              }
+            })
+         }
         console.log('下单时的参数', params);
         const res = await ordersAndPrepay(params);
         // console.log('orderDetail', res);
@@ -386,7 +410,7 @@ export default {
     },
     // 停车优惠
     discounts() {
-      if (!this.enableConsume && orderDetail.parkInfo.parkMallCode !== 2) {
+      if (!this.enableConsume && !this.memberLevelDiscount && this.orderDetail.parkInfo.parkMallCode !== 2) {
         return Toast({
           message: '暂无可用优惠',
         });
@@ -434,7 +458,14 @@ export default {
         path: 'parkingFeeCoupon',
       });
     },
-    paperCoupon() { },
+    paperCoupon() {
+      this.$router.push({
+        path: 'parkingFeePaperCoupon',
+        query:{
+          vehicleNo: this.$route.query.vehicleNo
+        }
+      });
+    },
     duration() { },
     couponCount() { },
     // 重置倒计时

+ 102 - 20
src/pages/parkingFee/mixins/parkingFeeDiscounts.js

@@ -1,9 +1,10 @@
 import { mapState } from 'vuex';
 import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
+import { cloneDeep } from 'lodash'
 import uni from '@/utils/uniHooks';
 // const app = getApp()
 export default {
-  components: { uniNumberBox },
+  components: {uniNumberBox},
   created() {
     // 超限提示
     this.crossMessage();
@@ -17,61 +18,142 @@ export default {
   data() {
     return {
       checkedList: [], // 已选优惠列表
-      memberLevelReduce:[],
+      oldCheckedList: [], // 已选优惠列表备份
+      isMember: true, // member
+      isReduces: true, // reduces
+      memberLevelReduce: [],
       memberGrade: {},
       consume: {},
       todayReduceDiscountMessage: '',
       isMemberDiscountDisabled: false,
+      maxDiscountTime: 0,
+      enableConsumeSplit: false,
+      maxReduceDiscount: 0,
+      reduceHours: 0,
     };
   },
   computed: {
     ...mapState({
       orderDetail: state => state.order.orderDetail,
-      custTypeId: (state) => state.custTypeId,
-      groupId: (state) => state.groupId,
+      custTypeId: ( state ) => state.custTypeId,
+      groupId: ( state ) => state.groupId,
       enableConsume: state => state.order.enableConsume,
       actualPayFee: state => state.order.actualPayFee,
       usingTotalDiscount: state => state.order.usingTotalDiscount,
       memberLevelDiscount: state => state.order.memberLevelDiscount,
+      checkedTotal: state => state.order.checkedTotal,
+      parkMallCode: state => state.order.parkMallCode,
+      paperDiscountTime: state => state.order.paperDiscountTime,
+      paperDiscountFee: state => state.order.paperDiscountTime,
     }),
   },
   mounted() {
-    this.pageInit();
+    try {
+      this.isCheck(
+        () => this.pageInit()
+      ); // 验证是否可选  
+    } catch ( err ) {
+      console.log(err)
+      this.$router.back();
+    }
   },
   methods: {
     pageInit() {
-      this.checkedList = []
-      const {memberGrade, consume, memberLevelDiscount} = this.orderDetail.discountInfo;
-      if (!memberLevelDiscount) {
-
+      if ( this.orderDetail?.parkingRule?.enableConsumeSplit ) {
+        this.enableConsumeSplit = this.orderDetail.parkingRule.enableConsumeSplit
       }
+
+      this.checkedList = []
+      const {memberGrade = [],consume = [],memberLevelDiscount} = this.orderDetail.discountInfo;
       this.memberGrade = {...memberGrade[0]}
       this.consume = {...consume[0]}
-      if (memberGrade.length && memberGrade[0].defaultSelected) {
+      if ( JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected) {
         this.checkedList.push('member')
+        this.isMember = false
       }
-      if (memberGrade.length && consume[0].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
       }
-      console.log(44444, this.checkedList);
+      if ( this?.consume?.maxDiscountTime ) {
+        this.maxReduceDiscount = this.consume.maxDiscountTime
+      }
+      this.oldCheckedList = [...this.checkedList]
     },
     setIsMemberDiscountDisabled() {
       this.todayReduceDiscountMessage = '当日'
     },
-    actualFee() {},
-    discountFee() {},
-    confirm() {},
-    crossMessage() {},
+    async confirm() {
+      let orderDetail = cloneDeep(this.orderDetail)
+      // 如果初次进来操作的跟原来的不一样则重新计算优惠
+      if ( this.checkedList.length !== this.checkedTotal ) {
+        ['member','reduces'].forEach(key => {
+          if ( key === 'member' ) {
+            this.memberGrade = {
+              ...this.memberGrade,
+              selected: this.checkedList.indexOf(key) > -1
+            }
+            orderDetail.discountInfo.memberGrade = [this.memberGrade]
+          }
+          if ( key === 'reduces' ) {
+            this.consume = {
+              ...this.consume,
+              discountTime: this.reduceHours,
+              selected: this.checkedList.indexOf(key) > -1
+            }
+            if ( this.consume.selected ) {
+              this.consume.discountFee = this.reduceHours * this.orderDetail.parkingRule.hourPrice
+            }
+            orderDetail.discountInfo.consume = [this.consume]
+          }
+        })
+        console.log(orderDetail.discountInfo.consume);
+        await this.$store.dispatch('order/saveDiscounts',{orderDetail,callback: () => this.$router.back()})
+      } else {
+        this.$router.back();
+      }
+    },
     checkboxChange() {},
-    parkInfoEntity() {},
-    isShowReduceDiscount() {},
     // todayReduceDiscountMessage() {},
     // 验证当前的选项是否可选择
-    isCheck(type) {
+    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() {
 
+    }
   },
 
 };

+ 112 - 321
src/pages/parkingFee/mixins/parkingFeePaperCoupon.js

@@ -5,74 +5,30 @@ const app = {};
 import { mapState } from 'vuex';
 import fuiToast from '@/components/fui-toast/fui-toast.vue';
 import { initWxJsSdkConfig } from '@/utils/login';
-import { getPlatform } from '@/utils/index';
+import { getPlatform } from '@/utils';
+import { paperCoupon } from '@/api/parking'
 
 export default {
   components: {
     fuiToast,
   },
   created() {
-    this.servicefee = uni.getStorageSync('servicefee'); // 应缴金额
-    this.parkDiscountTotal = uni.getStorageSync('parkingTotal'); // 总停车优惠
 
-    if (uni.getStorageSync('parkFee')) {
-      this.parkFee = JSON.parse(uni.getStorageSync('parkFee')); // discount接口返回的数据
-      this.parkMallCode = this.parkFee.parkInfoEntity.parkMallCode;
-      // 上限金额
-      this.maxonetimediscountFee =
-        this.parkFee.parkInfoEntity.maxonetimediscount *
-        this.parkFee.parkInfoEntity.needmoney;
-      this.maxonedaydiscountFee =
-        (this.parkFee.parkInfoEntity.maxOneDayHour -
-          this.parkFee.parkInfoEntity.ticketandMemeberGradeAndConsumeUseHour) *
-          this.parkFee.parkInfoEntity.needmoney || 0;
-      if (this.maxonedaydiscountFee < 0) {
-        this.maxonedaydiscountFee = 0;
-      }
-
-      // 纸质优惠券说明
-      if (
-        this.parkFee.parkPaperCouponsEntities &&
-        this.parkFee.parkPaperCouponsEntities[0]
-      ) {
-        this.parkPaperCouponRemark =
-          this.parkFee.parkPaperCouponsEntities[0].remark;
-      }
-    } else {
-      this.$router.replace({path: 'home'})
-      return
-    }
-
-    // 本页面数据缓存
-    this.paperCouponInfo = uni.getStorageSync('paperCouponInfo');
-    if (this.paperCouponInfo && this.paperCouponInfo.paperCouponList) {
-      // this.paperCouponList = this.paperCouponInfo.paperCouponList;
-
-      this.paperDiscountFee = this.paperCouponInfo.paperDiscountFee;
-      this.paperDiscountTime = this.paperCouponInfo.paperDiscountTime;
-      this.parkDiscountTotal.feeCopy -= this.paperCouponInfo.paperDiscountFee;
-    }
-    // this.paperCouponList = [
-    //   {
-    //     discountCode: '123456',
-    //     discountValueMoney: 10
-    //   }
-    // ];
   },
   data() {
     return {
-      parkFee: {}, // 停车规则相关信息
-      parkPaperCouponRemark: '', // 纸质优惠券说明
-      servicefee: 0, // 应缴金额
-      paperDiscountFee: 0, // 纸质优惠券减免金额
-      paperDiscountTime: 0, // 纸质优惠券减免时长
-      parkDiscountTotal: {}, // 总停车优惠
+      // parkFee: {}, // 停车规则相关信息
+      // // parkPaperCouponRemark: '', // 纸质优惠券说明
+      // servicefee: 0, // 应缴金额
+      // paperDiscountFee: 0, // 纸质优惠券减免金额
+      // paperDiscountTime: 0, // 纸质优惠券减免时长
+      // parkDiscountTotal: {}, // 总停车优惠
       paperCouponList: [], // 纸质券list
-      paperCouponInfo: {}, // 页面缓存
-      maxonetimediscountFee: 0, // 每次优惠上限金额
-      maxonedaydiscountFee: 0, // 每天优惠上限金额
-      parkMallCode: 1, // 0静安 1浦东 2杭州 3北京 4沈阳 5深圳
-      parkInfo: {},
+      // paperCouponInfo: {}, // 页面缓存
+      // maxonetimediscountFee: 0, // 每次优惠上限金额
+      // maxonedaydiscountFee: 0, // 每天优惠上限金额
+      // parkMallCode: 1, // 0静安 1浦东 2杭州 3北京 4沈阳 5深圳
+      // parkInfo: {},
     };
   },
   async mounted() {
@@ -80,74 +36,58 @@ export default {
       uni.setNavigationBarTitle({
         title: '纸质优惠券减免',
       });
-    }, 300);
+    },300);
     const platform = getPlatform();
-    if (platform === 'micromessenger') {
+    if ( platform === 'micromessenger' ) {
       // this.getTicket();
-      await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
+      await initWxJsSdkConfig(['checkJsApi','scanQRCode']);
       // await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
       // if (window.wxJsSdkConfigInitPromise) {
       //   await window.wxJsSdkConfigInitPromise;
       // }
     }
+    this.pageInit()
     setTimeout(() => {
       uni.setNavigationBarTitle({
         title: '优惠券',
       });
-    }, 300);
+    },300);
   },
   computed: {
     ...mapState({
-      custTypeId: (state) => state.custTypeId,
-      mallid: (state) => state.mallId,
-      openId: (state) => state.openid,
-      member: (state) => state.member,
-      groupId: (state) => state.groupId,
+      custTypeId: ( state ) => state.custTypeId,
+      mallid: ( state ) => state.mallId,
+      openId: ( state ) => state.openid,
+      member: ( state ) => state.member,
+      groupId: ( state ) => state.groupId,
+      orderDetail: ( state ) => state.order.orderDetail,
+      paperCoupons: ( state ) => state.order.paperCoupons,
+      paperDiscountFee: ( state ) => state.order.paperDiscountFee,
+      paperDiscountTime: ( state ) => state.order.paperDiscountTime,
     }),
-    // 实际支付金额
-    actualFee() {
-      const fee = this.servicefee - this.discountFee;
-      return fee > 0 ? fee : 0;
-    },
-    // 已优惠金额
-    discountFee() {
-      // 超出上限按上限计算
-      if (this.parkMallCode === 1) {
-        if (this.parkDiscountTotal.feeCopy > this.maxonetimediscountFee) {
-          this.parkDiscountTotal.feeCopy = this.maxonetimediscountFee;
-        }
-      }
-      if (this.parkMallCode === 4) {
-        if (
-          this.parkDiscountTotal.feeCopy - this.parkDiscountTotal.bonusfee >
-          this.maxonedaydiscountFee
-        ) {
-          this.parkDiscountTotal.feeCopy =
-            this.maxonedaydiscountFee + this.parkDiscountTotal.bonusfee;
-        }
-      }
-      return this.parkDiscountTotal.feeCopy + this.paperDiscountFee;
-    },
   },
   methods: {
-    showToast(text) {
+    pageInit() {
+      this.paperCouponList = [...this.paperCoupons]
+    },
+    showToast( text ) {
       let options = {};
       options.text = text;
       this.$refs.toast.show(options);
     },
     // 扫码
     scanCode() {
-      const runScanFn = (res) => {
-        if (res.scanType == 'QR_CODE' && res.scanType) {
+      const runScanFn = ( res ) => {
+        if ( res.scanType == 'QR_CODE' && res.scanType ) {
           console.log(res.result);
           const url = res.result;
-          if (url.indexOf('auth/') === -1) {
+          if ( url.indexOf('auth/') === -1 ) {
             this.getPaperCouponInfo(res.result);
           } else {
             const start = url.indexOf('auth/');
             const end = url.indexOf('?');
-            const params = url.slice(start, end).split('/');
-            if (params && params.length) {
+            const params = url.slice(start,end).split('/');
+            if ( params && params.length ) {
               const couponCode = params[1];
               this.getPaperCouponInfo(couponCode);
             }
@@ -156,12 +96,12 @@ export default {
       };
       // 微信小程序
       const platform = getPlatform();
-      if (platform === 'miniprogram') {
+      if ( platform === 'miniprogram' ) {
         window.toWXSendMsg({
           type: 'scanQRCode',
         });
-        window.subscribe('scanQRCodeOver', (options) => {
-          console.log('微信扫码结束之后的返回参数', options);
+        window.subscribe('scanQRCodeOver',( options ) => {
+          console.log('微信扫码结束之后的返回参数',options);
           runScanFn(options);
         });
       } else {
@@ -169,248 +109,99 @@ export default {
           desc: 'scanQRCode desc',
           needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
           // scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
-          success: (res) => {
-            console.log(237, res);
+          success: ( res ) => {
+            console.log(237,res);
             runScanFn(res);
             // this.formMsg.deviceCode = res.resultStr;
           },
-          error: (res) => {
-            console.log(242, res);
+          error: ( res ) => {
+            console.log(242,res);
           },
         });
       }
-
-      /* uni.scanCode({
-       onlyFromCamera: false,
-       scanType: ['qrCode'],
-       success: (res) => {
-       console.log('扫码', res);
-       if (res.scanType == 'QR_CODE' && res.scanType) {
-       console.log(res.result);
-       const url = res.result;
-       if (url.indexOf('auth/') === -1) {
-       this.getPaperCouponInfo(res.result);
-       } else {
-       const start = url.indexOf('auth/');
-       const end = url.indexOf('?');
-       const params = url.slice(start, end).split('/');
-       if (params && params.length) {
-       const couponCode = params[1];
-       this.getPaperCouponInfo(couponCode);
-       }
-       }
-       }
-       },
-       }); */
     },
 
     // 根据卡券ID查询卡券信息
-    getPaperCouponInfo(couponCode) {
+    async getPaperCouponInfo( couponCode ) {
       uni.showLoading({
         title: '加载中',
       });
-      const params = {
-        groupId: this.groupId,
-        mallid: this.mallid,
-        couponcode: couponCode,
-        orderno: uni.getStorageSync('orderno'),
-      };
-      this.$md(params);
-      uni.request({
-        url: this.$baseURL + 'api/1.0/park/queryTicketCount',
-        data: params,
-        method: 'POST',
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          uni.hideLoading();
-          console.log(res);
-          if (res.data.code !== 0) {
-            // return uni.showToast({
-            // 	title: res.data.msg,
-            // 	duration: 2000,
-            // 	icon: 'none'
-            // })
-            return Toast({
-              message: res.data.msg,
-            });
-            // return this.showToast(res.data.msg);
-          }
-          if (res.data.data.type === 2) {
-            if (res.data.data.discountType == '0') {
-              return Toast({
-                message: '该纸质优惠券未激活',
-              });
-              // return uni.showToast({
-              //   title: '该纸质优惠券未激活',
-              //   duration: 2000,
-              //   icon: 'none',
-              // });
-            }
-            if (res.data.data.discountRuleId == '1') {
-              return Toast({
-                message: '该纸质优惠券已领取',
-              });
-              // return uni.showToast({
-              //   title: '该纸质优惠券已领取',
-              //   duration: 2000,
-              //   icon: 'none',
-              // });
-            }
-            if (res.data.data.discountRuleId == '2') {
-              return Toast({
-                message: '该纸质优惠券已使用',
-              });
-              // return uni.showToast({
-              //   title: '该纸质优惠券已使用',
-              //   duration: 2000,
-              //   icon: 'none',
-              // });
-            }
-            if (res.data.data.discountRuleId == '3') {
-              return Toast({
-                message: '该纸质优惠券已核销',
-              });
-              // return uni.showToast({
-              //   title: '该纸质优惠券已核销',
-              //   duration: 2000,
-              //   icon: 'none',
-              // });
-            }
-          }
-          if (this.paperCouponList.length) {
-            const index = this.paperCouponList.findIndex(
-              (e) => e.discountCode === couponCode
-            );
-            if (index === -1) {
-              this.paperCouponList.push(res.data.data);
-              this.paperDiscountFee += Number(res.data.data.discountValueMoney);
-              this.paperDiscountTime =
-                this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
-            }
-          } else {
-            this.paperCouponList.push(res.data.data);
-            this.paperDiscountFee += Number(res.data.data.discountValueMoney);
-            this.paperDiscountTime =
-              this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
+      const res = await paperCoupon(couponCode, this.$route.query.vehicleNo);
+      /*const res = {
+        "status": "1",
+        "discountCode": "91354260",
+        "discountFee": 1,
+        "used": "0",
+        "content": "嘉里卡券测试"
+      }*/
+      if ( /0/.test(res.status)) {
+        return Toast({
+          message: '该纸质优惠券未激活',
+        });
+      }
+      if (/1/.test(res.used)) {
+        return Toast({
+          message: '该纸质优惠券已领取',
+        });
+      }
+      if (/2/.test(res.used)) {
+        return Toast({
+          message: '该纸质优惠券已使用',
+        });
+      }
+      if (/3/.test(res.used)) {
+        return Toast({
+          message: '该纸质优惠券已核销',
+        });
+      }
+      console.log(157, res)
+      console.log(158, this.paperCoupons)
+      console.log(158, this.paperCoupons.findIndex(item => {
+        console.log(160, item.discountCode, couponCode)
+        return item.discountCode === couponCode
+      }))
+      // 如果纸质优惠券不存在的话,则往 paperCoupons 添加
+      if ( this.paperCoupons.findIndex(item => item.discountCode === couponCode) < 0 ) {
+        const {hourPrice} = this.orderDetail.parkingRule
+        const discountTime = Number(res.discountFee) / hourPrice
+        const paperCoupons =  [
+          ...this.paperCoupons,
+          {
+            ...res,
+            discountTime: res.discountFee / hourPrice
           }
-
-          // this.crossMessage();
-        },
-        fail: (err) => {
-          uni.hideLoading();
-          console.log(err);
-        },
-      });
+        ]
+        this.paperCouponList = paperCoupons
+        this.$store.commit('order/setPaperCoupons',paperCoupons)
+        // 金额
+        this.$store.commit('order/setPaperDiscountFee',this.paperDiscountFee + Number(res.discountFee))
+        // 时间
+        this.$store.commit('order/setPaperDiscountTime',this.paperDiscountTime + discountTime)
+      }
     },
-
     // 删除
-    deleteCoupon(i) {
-      this.paperDiscountFee -= Number(
-        this.paperCouponList[i].discountValueMoney
-      );
-      this.paperDiscountTime =
-        this.paperDiscountFee / this.parkFee.parkInfoEntity.needmoney;
-      this.paperCouponList.splice(i, 1);
+    deleteCoupon( i ) {
+      const item = this.paperCoupons[i]
+      const paperCoupons = this.paperCoupons.filter(elm => elm.discountCode !== item.discountCode)
+      const {hourPrice} = this.orderDetail.parkingRule
+      const discountTime = Number(item.discountFee) / hourPrice
+      this.$store.commit('order/setPaperCoupons',paperCoupons)
+      // 金额
+      this.$store.commit('order/setPaperDiscountFee',this.paperDiscountFee - Number(item.discountFee))
+      // 时间
+      this.$store.commit('order/setPaperDiscountTime',this.paperDiscountTime + discountTime)
     },
 
-    /**
-     * 2021-12-24 微信小群确定取消纸质券限制
-     */
-    // 超限提示
-    // crossMessage() {
-    // 	let totalFee = this.parkDiscountTotal.feeCopy;
-    // 	if (this.paperCouponInfo && this.paperCouponInfo.paperDiscountFee !== 0) {
-    // 		totalFee += this.paperDiscountFee - this.paperCouponInfo.paperDiscountFee;
-    // 	} else {
-    // 		totalFee += this.paperDiscountFee;
-    // 	}
-    // 	// 是否受每次最大优惠限制(浦东)
-    // 	if (this.parkFee.parkPaperCouponsEntities[0].isMaxLimit !== 1) {
-    // 		if (totalFee > this.maxonetimediscountFee) {
-    // 			return uni.showToast({
-    // 				title: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
-    // 				icon: 'none'
-    // 			});
-    // 		}
-    // 	}
-    // 	// 浦东总优惠不包含纸质券
-    // 	if (this.parkMallCode !== 1) {
-    // 		if (totalFee > this.maxonedaydiscountFee) {
-    // 			return uni.showToast({
-    // 				title: `超出抵扣上限,每天最高可抵扣${this.parkFee.parkInfoEntity.maxonedaydiscount}小时`,
-    // 				icon: 'none'
-    // 			});
-    // 		}
-    // 	}
-    // },
-
     // 确认
     confirm() {
-      let paperCouponcode = '';
-      this.paperCouponList.forEach((e, i) => {
-        if (i === this.paperCouponList.length - 1) {
-          paperCouponcode += e.discountCode;
-        } else {
-          paperCouponcode += e.discountCode + '#';
-        }
-      });
-      uni.setStorageSync('paperCouponInfo', {
-        paperDiscountFee: this.paperDiscountFee,
-        paperDiscountTime: this.paperDiscountTime,
-        paperCouponcode: paperCouponcode,
-        paperCouponList: this.paperCouponList,
+      console.log(310,this.orderDetail);
+      
+      this.$store.dispatch('order/savePaperCoupon', {
+        couponList: this.paperCoupons,
+        callback: () => {
+          this.$router.back();
+        },
       });
-      this.$router.back();
     },
-    /*
-     // h5获取配置---公众号支付
-     getTicket() {
-     let self = this;
-     var datas = {
-     groupId: this.$store.state.groupId,
-     mallid: this.$store.state.mallid,
-     url: window.location.href.split('#')[0],
-     };
-     self.$md(datas);
-     uni.request({
-     url: self.$baseURL + 'api/1.0/login/getTicket',
-     method: 'POST',
-     data: datas,
-     header: JSON.parse(uni.getStorageSync('handleUser')),
-     success: (res) => {
-     if (res.data.code == 0) {
-     self.$wx.config({
-     debug: false, // 开启调试模式
-     appId: res.data.data.appId, // 必填,公众号的唯一标识
-     timestamp: res.data.data.timestamp, // 必填,生成签名的时间戳
-     nonceStr: res.data.data.nonceStr, // 必填,生成签名的随机串
-     signature: res.data.data.signature, // 必填,签名
-     jsApiList: ['chooseWXPay', 'scanQRCode', 'checkJsApi'], // 必填,需要使用的JS接口列表
-     });
-     self.$wx.ready(function () {
-     self.$wx.checkJsApi({
-     jsApiList: ['chooseWXPay'],
-     success: (res) => {
-     console.log('checked api:', res);
-     },
-     fail: (err) => {
-     console.log('check api fail:', err);
-     },
-     });
-     });
-     self.$wx.error(function (res) {
-     console.log('err', res);
-     });
-     } else {
-     uni.showToast({
-     title: res.data.msg,
-     duration: 2000,
-     icon: 'none',
-     });
-     }
-     },
-     });
-     },
-     */
   },
 };

+ 1 - 1
src/pages/parkingFee/mixins/parkingReceipt/parkingChangeHeader.js

@@ -78,7 +78,7 @@ export default {
         title: '发票抬头',
       });
     }, 300);
-    console.log(this.isCompany)
+    
   },
   methods: {
     radioChange: function (value) {

+ 14 - 11
src/pages/parkingFee/parkingFeeDetail.vue

@@ -29,7 +29,7 @@
         </div>
       </div>
       <div class="info-box mb--30">
-        <div class="info-item-box" v-if="enableConsume">
+        <div class="info-item-box" v-if="enableConsume || memberLevelDiscount">
           <div class="label">停车优惠</div>
           <div @click="discounts" :class="['value',discountDesc === '暂无可用优惠' ?  '' : 'text-red']">{{ discountDesc }}
             <van-icon name="arrow"/>
@@ -49,7 +49,7 @@
         </div>
         <div class="info-item-box" v-if="enablePaperCoupons">
           <div class="label">纸质优惠劵</div>
-          <div :class="['value', 'text-red']">扫描纸质优惠劵二维码
+          <div :class="['value', 'text-red']" @click="paperCoupon">扫描纸质优惠劵二维码
             <van-icon name="arrow"/>
           </div>
         </div>
@@ -58,7 +58,7 @@
           <div :class="['value']">-{{ usingTotalDiscount | currency }}</div>
         </div>
         <div class="van-hairline--bottom hr"></div>
-        <div class="info-item-box">
+        <div class="info-item-box npb">
           <div class="label pb--27">应付金额</div>
           <div class="value bold-fz">
             {{ actualPayFee | currency }}
@@ -130,7 +130,7 @@
         </div>
         <div class="popue_box_index">
           <div>抵扣{{ orderDetail.parkInfo.parkMallCode === 5 ? '金额' : '时长' }}</div>
-          <div class="popue_box_index" style="width: 325px">
+          <div class="popue_box_index" style="width: 335px">
             <div class="popue_box_index4_xs van-hairline--surround">
               <div class="popue_box_index4_xs_index1" @click="$store.dispatch('order/pointsMath',{type: 'minus', callback: pointsMathCallback})">
                 -
@@ -229,10 +229,13 @@ export default {
   .info-item-box {
     display: flex;
     justify-content: space-between;
-
+    padding-bottom: 39px;
+    &.npb{
+      padding-bottom: 0;
+    }
     .label {
       padding-left: 36px;
-      padding-bottom: 39px;
+      //padding-bottom: 39px;
       text-align: left;
 
       font-family: 'PingFang SC';
@@ -383,9 +386,9 @@ export default {
     color: #fff;
     border-radius: 60px;
     text-align: center;
-    color: #064c8a;
+    color: var(--k-color-primary-01, #064c8a);
     font-weight: 700;
-    border: 1px solid #064c8a;
+    border: 1px solid var(--k-color-primary-01, #064c8a);
   }
 
   .blue_popue_box_index4_by {
@@ -410,8 +413,8 @@ export default {
     border-radius: 60px;
     text-align: center;
     // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-    background-color: #064c8a;
-    border: 1px solid #064c8a;
+    background-color: var(--k-color-primary-01, #064c8a);
+    border: 1px solid var(--k-color-primary-01, #064c8a);
   }
 }
 
@@ -514,7 +517,7 @@ export default {
     line-height: 70px;
     color: #fff;
     // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-    background: #064c8a;
+    background: var(--k-color-primary-01, #064c8a);
     box-shadow: 2px 3px 5px #888888;
     //position: absolute;
     //right: 16px;

+ 110 - 48
src/pages/parkingFee/parkingFeeDiscounts.vue

@@ -1,13 +1,13 @@
 <template>
-  <div>
-    <div scroll-y="true" :class="['scroll-Y', theme]">
+  <div :class="theme">
+    <div scroll-y="true" :class="['scroll-Y']">
       <van-checkbox-group v-model="checkedList" @change="checkboxChange" checked-color="#064C8A">
         <div class="container" v-if="memberLevelDiscount">
           <div class="item">
             <div class="title">会员等级减免</div>
             <div class="content">{{ memberGrade.memberGradeText || '' }}减免{{ memberGrade.discountTime || 0 }}小时。可优惠{{ memberGrade.discountFee || 0 }}元</div>
           </div>
-          <van-checkbox color="#fff" name="member" :disabled="isCheck('member')" />
+          <van-checkbox color="#fff" name="member" checked-color="var(--k-color-primary)" :disabled="isMember" />
           <!-- :checked="isCheck('member')" -->
           <div class="member-discount-info" v-if="isMemberDiscountDisabled">当日已使用</div>
         </div>
@@ -19,26 +19,42 @@
               {{ todayReduceDiscountMessage }}
             </div>
             <uni-number-box
-              v-if="parkInfoEntity.isSplit === 0 && maxReduceDiscount > 0"
+              v-if="enableConsumeSplit"
               :min="1"
               :max="maxReduceDiscount"
               v-model="reduceHours"
               @input="reducesChange"
             ></uni-number-box>
           </div>
-          <van-checkbox name="reduces" color="#fff" :disabled="isCheck('reduces')" />
-          <!-- :checked="isCheck('reduces')" -->
+          <van-checkbox name="reduces" color="#fff" checked-color="var(--k-color-primary)" :disabled="isReduces" />
         </div>
       </van-checkbox-group>
     </div>
     <div class="flewx">
-      <div class="flewx-content">
-        合计<span style="color: #333; font-weight: 600; font-size: 36px; padding-left: 0px">{{ actualPayFee | currency }}</span>
-        元
-        <span style="color: #999; padding-left: 0px; font-size: 28px">已优惠{{ usingTotalDiscount | currency }}元</span>
+      <div class="control-box">
+        <div class="flewx-content">
+          <div class="fee-box">
+            <div>合计:</div>
+            <div class="actualPayFee">{{
+                actualPayFee | currency
+              }}
+            </div>
+            <div :class="['van-hairline--surround','usingTotalDiscount', usingTotalDiscount > 0 && 'usingTotalDiscount-red']"
+            >已优惠{{ usingTotalDiscount | currency }}元
+            </div
+            >
+            <!-- <van-count-down :time="3 * 60 * 1000" /> -->
+          </div>
+        </div>
+        <div class="btn-box">
+          <k-button style="width: 100%;max-width: 240px" title="确定" disabledColor="#D1D2D9" @click="confirm"/>
+        </div>
+
       </div>
-      <div class="flewx_index3" @click="confirm">确定</div>
+      <!-- 开启底部安全区适配 -->
+      <van-number-keyboard safe-area-inset-bottom />
     </div>
+    
   </div>
 </template>
 
@@ -110,46 +126,92 @@ export default {
   }
 }
 
+/*页面底部操作区*/
 .flewx {
-  width: 100%;
-  height: 130px;
-  background-color: #fff;
   position: fixed;
   bottom: 0;
-  font-size: 30px;
-  display: flex;
-  align-items: center;
-  justify-content: space-around;
-  // padding-bottom: constant(safe-area-inset-bottom);
-  // padding-bottom: env(safe-area-inset-bottom);
-  padding-bottom: 20px;
-
-  .flewx-content {
-    position: absolute;
-    left: 16px;
-  }
-
-  .flewx_index3 {
-    width: 150px;
-    height: 70px;
-    border-radius: 45px;
-    text-align: center;
-    font-size: 30px;
-    line-height: 70px;
-    color: #fff;
-    // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-    background: #064c8a;
-    box-shadow: 2px 3px 5px #888888;
-    position: absolute;
-    right: 16px;
-  }
-
-  .blue_flewx_index3 {
-    .color-background-color('blue');
-  }
-
-  .green_flewx_index3 {
-    .color-background-color('green');
+  right: 0;
+  left: 0;
+  background-color: #fff;
+  .control-box {
+    width: 100%;
+    box-sizing: border-box;
+
+    display: flex;
+    align-content: flex-start;
+    align-items: center;
+    //padding-bottom: constant(safe-area-inset-bottom);
+    //padding-bottom: env(safe-area-inset-bottom);
+    padding: 30px 24px 30px 30px;
+    justify-content: space-between;
+    .flewx-content {
+      font-size: 28px;
+      .fee-box {
+        display: flex;
+        align-items: center;
+        justify-content: flex-start;
+      }
+
+      .actualPayFee {
+        color: #333;
+        font-size: 40px;
+      }
+
+      .usingTotalDiscount {
+        font-family: 'PingFang SC';
+        font-style: normal;
+        font-weight: 400;
+        font-size: 22px;
+        //height: 22px;
+        //line-height: 22px;
+        margin-left: 7px;
+        //border: 1px solid var(--k-color-red-01);
+        background-color: #F4F7FF;
+        border-radius: 2px;
+        &::after {
+          border-color: #999999;
+        }
+
+        color: #999999;
+        padding: 1px 3px;
+
+        &.usingTotalDiscount-red {
+          color: var(--k-color-red-01);
+          background-color: var(--k-color-red-06);
+          &::after {
+            border-color: var(--k-color-red-01);
+          }
+        }
+      }
+
+      .count-down-box {
+        display: flex;
+        font-weight: 400;
+        align-items: center;
+        color: var(--k-color-red-01);
+        font-family: 'PingFang SC';
+        font-style: normal;
+        font-weight: 400;
+        font-size: 26px;
+        margin-top: 5px;
+        .van-count-down {
+          font-size: 30px;
+          color: var(--k-color-red-01);
+        }
+
+        .desc {
+          font-size: 30px;
+
+        }
+      }
+    }
+    .btn-box {
+      display: flex;
+      justify-content: flex-end;
+      margin-left: 35px;
+      flex: 1;
+      max-width: 240px;
+    }
   }
 }
 

+ 30 - 52
src/pages/parkingFee/parkingFeePaperCoupon.vue

@@ -3,7 +3,7 @@
     <div class="worp">
       <div class="title">纸质优惠劵减免说明</div>
       <div style="font-size: 28px; color: #808080; padding-top: 12px">
-        {{ parkPaperCouponRemark }}
+        {{ orderDetail && orderDetail.parkingRule && orderDetail.parkingRule.paperCouponsDescription || '' }}
       </div>
     </div>
     <template v-if="paperCouponList.length">
@@ -25,7 +25,7 @@
           "
         >
           优惠劵金额 :<span style="color: #064c8a">{{
-            item.discountValueMoney | currency
+            item.discountFee | currency
           }}</span>
         </div>
       </div>
@@ -33,8 +33,6 @@
     <div
       :class="{
         worp_button: true,
-        blue_flewx_index3: custTypeId === 1,
-        green_flewx_index3: custTypeId === 2,
       }"
       @click="scanCode"
     >
@@ -45,27 +43,23 @@
       <div>扫码用劵</div>
     </div>
     <div class="flewx">
-      <!-- <div class="flewx-content">应付<span style="color: red;font-size: 32px;padding-left: 20px;">{{actualFee |
+      <div style="display: flex; width: 100%;align-items: center">
+        <!-- <div class="flewx-content">应付<span style="color: red;font-size: 32px;padding-left: 20px;">{{actualFee |
       currency}}</span> 元 <span style="color: #8d8d8d;padding-left: 30px;font-size: 28px;">已优惠{{discountFee |
           currency}}元</span>
       </div> -->
-      <div class="flewx-content">
-        已选<span class="num">{{ paperCouponList.length }}张</span>
-        <span class="discountFee"
-        >优惠券可优惠{{ discountFee | currency }}</span
-        >
-      </div>
-      <div
-        :class="{
-          flewx_index3: true,
-          blue_flewx_index3: custTypeId === 1,
-          green_flewx_index3: custTypeId === 2,
-          'btn-disabled': !parkInfo.servicefee,
-        }"
-        @click="confirm"
-      >
-        确定
+        <div class="flewx-content">
+          已选<span class="num">{{ paperCouponList.length }}张</span>
+          <span class="discountFee"
+          >优惠券可优惠{{ paperDiscountFee | currency }}</span
+          >
+        </div>
+        <div class="btn-box">
+          <k-button style="width: 100%;max-width: 240px" title="确定" disabledColor="#D1D2D9" @click="confirm"/>
+        </div>
       </div>
+      <!-- 开启底部安全区适配 -->
+      <van-number-keyboard safe-area-inset-bottom />
     </div>
     <!-- 新的toast -->
     <fui-toast ref="toast"></fui-toast>
@@ -139,7 +133,7 @@ export default {
   color: #fff;
   margin-top: 45px;
   // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-  background: #064c8a;
+  background: var(--k-color-primary);
   margin-left: 30px;
   display: flex;
   align-items: center;
@@ -157,47 +151,31 @@ export default {
   // padding-bottom: constant(safe-area-inset-bottom);
   // padding-bottom: env(safe-area-inset-bottom);
   padding-bottom: 20px;
+  padding-top: 33px;
 
   .flewx-content {
     font-weight: 400;
-    position: absolute;
-    left: 16px;
+    padding-left: 30px;
     font-size: 28px;
+    flex: 1;
+    color: #999999;
     .num {
-      color: #064c8a;
+      color: var(--k-color-primary);
     }
     .discountFee {
       color: #ee4d3f;
+      margin-left: 20px;
     }
   }
 
-  .flewx_index3 {
-    width: 150px;
-    height: 70px;
-    border-radius: 45px;
-    text-align: center;
-    font-size: 28px;
-    line-height: 70px;
-    color: #fff;
-    // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-    background: #064c8a;
-    box-shadow: 2px 3px 5px #888888;
-    position: absolute;
-    right: 16px;
+  .btn-box {
+    display: flex;
+    justify-content: flex-end;
+    margin-left: 35px;
+    margin-right: 24px;
+    //flex: 1;
+    width: 240px;
+    max-width: 240px;
   }
 }
-
-.blue_flewx_index3 {
-  .color_flewx_index3('blue');
-}
-
-.green_flewx_index3 {
-  .color_flewx_index3('green');
-}
-
-.color_flewx_index3(@value) {
-  @color: 'color-@{value}';
-  background-image: none !important;
-  background-color: @@color !important;
-}
 </style>

+ 1 - 1
src/pages/parkingFee/parkingFeePayment.vue

@@ -60,7 +60,7 @@ export default {
     // font-size: 17px;
     // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
 
-    background-color: var(--k-color-primary-01);
+    background-color: var(--k-color-primary);
     border-radius: 45px;
     font-size: 34px;
     font-weight: 400;

+ 11 - 10
src/store/index.js

@@ -3,9 +3,9 @@ import Vuex from 'vuex';
 import { Encrypt,Decrypt } from '@/utils/crypto';
 import { crmQueryMemberInfo } from '@/utils/api-crm-member';
 import uni from '@/utils/uniHooks';
-import { kipAllCities,kipGetUserDetail } from '@/utils/api-kip';
+import { kipAllCities,kipGetUserDetail,getVIPIntegral } from '@/utils/api-kip';
 import cachedViews from './cachedViews';
-import order from './order';
+import order from './order/index';
 import invoice from './invoice';
 import { lbsDictionary } from '@/common/js/BaseDictionary';
 import { getGroupIdAndMallIdByLsbId } from '@/utils';
@@ -254,21 +254,22 @@ const store = new Vuex.Store({
           commit('SET_ACCESS_TOKEN',accessToken);
           commit('SET_KIP_USER_ID',kipUserId);
           commit('SET_MOBILE',mobile);
-          const memberRes = await crmQueryMemberInfo({
-            groupId,
-            kipUserId,
-            mallId,
-          });
-          // console.log(130, memberRes);
+          dispatch('getUserDetail');
+          const memberRes = await getVIPIntegral()
+          // const memberRes = await crmQueryMemberInfo({
+          //   groupId,
+          //   kipUserId,
+          //   mallId,
+          // });
           // 请求 projectId
           window.toWXSendMsg({
             type: 'getProjectId',
             options: {},
           });
           const marketListRes = await kipAllCities();
-          if ( memberRes.code === 0 ) {
+          if ( memberRes) {
             dispatch('getUserDetail');
-            commit('SET_MEMBER',memberRes.data);
+            commit('SET_MEMBER',memberRes);
           }
           // console.log(929292, marketListRes);
         }

+ 0 - 616
src/store/order.js

@@ -1,616 +0,0 @@
-import { checkOut, calculateDiscount, ordersAndPrepay, currentUnlicensedPlate, unlicensedCarCheckIn, unlicensedCarCheckout } from '@/api/parking';
-
-// import checkOutQHResponse from '@/api/mockData/checkout.qh3.response.json'
-// import checkOutQHResponse from '@/api/mockData/checkout.hz.response.json';
-import checkOutQHResponse from '@/api/mockData/checkout.qh7.response.json'
-// import unlicensedCarCheckInResponse from '@/api/mockData/unlicensedCarCheckIn.qh.response.json';
-
-/* 
-([a-z]*):(.*),
-state.$1 =$2;
- */
-// 大于等于停车费
-// 微服务接口字段
-const state = {
-  // 微服务接口字段
-  orderDetail: {}, // 订单原始数据
-  isShowDiscounts: false, // 是否展示会员登记优惠
-  discountDesc: '', // 停车优惠(首停、会员减免、消费减免)
-  checkedTotal: 0, // 选中count数
-  enableNewMemberPoints: false, // 是否开启新会员积分
-  enablePoints: false, // 是否开启积分减免
-  usePoints: 0, // 用户已选择的积分
-  isFirst: 0, // 判断用户是否首次进入
-  integralDesc: '', // 积分减免说明文案
-  pointsPerHour: 0, // 每小时兑换积分
-  enableCoupon: false, // 电子优惠券是否启用
-  maxOneDayCoupons: 0, // 单日可选优惠券上限
-  coupons: [], // 可选优惠券数量
-  couponCount: 0, // 已选择优惠券
-  couponDesc: '', // 优惠券说明文案
-  enablePaperCoupons: false, // 启动纸质优惠券
-  usingTotalDiscount: 0, // 优惠金额
-  actualPayFee: 0, // 应付金额
-  availableDiscountFee: 0, // 当日剩余可使用优惠金额
-  // 积分相关
-  available: 0, // 用户可用积分
-  maxPointsTime: '', // 积分最大兑换时长
-  pointsTime: '', // 已兑换的积分时间
-  unitAmount: 0,
-  // 停车优惠:会员等级和消费减免
-  memberLevelDiscount: false, // 是否开启会员等级
-  enableConsume: false, // 是否开启消费减免
-  pointsPerUnit: 0, //
-  // unlicensed: false // true: 临时车牌;false:普通车牌
-  // 无牌车逻辑
-  unlicensedCar: '',
-};
-
-const mutations = {
-  setOrderDetail(state, payload) {
-    state.orderDetail = payload;
-  },
-  setIsShowDiscounts(state, payload) {
-    state.isShowDiscounts = payload;
-  },
-  setCheckedTotal(state, payload) {
-    state.checkedTotal = payload;
-  },
-  setDiscountDesc(state, payload) {
-    state.discountDesc = payload;
-  },
-  setEnableNewMemberPoints(state, payload) {
-    state.enableNewMemberPoints = payload;
-  },
-  setEnablePoints(state, payload) {
-    state.enablePoints = payload;
-  },
-  setIsFirst(state, payload) {
-    state.isFirst = payload;
-  },
-  setIntegralDesc(state, payload) {
-    state.integralDesc = payload;
-  },
-  setUsePoints(state, payload) {
-    state.usePoints = payload;
-  },
-  setEnableCoupon(state, payload) {
-    state.enableCoupon = payload;
-  },
-  setMaxOneDayCoupons(state, payload) {
-    state.maxOneDayCoupons = payload;
-  },
-  setCoupons(state, payload) {
-    state.coupons = payload;
-  },
-  setCouponCount(state, payload) {
-    state.couponCount = payload;
-  },
-  setCouponDesc(state, payload) {
-    state.couponDesc = payload;
-  },
-  setEnablePaperCoupons(state, payload) {
-    state.enablePaperCoupons = payload;
-  },
-  setUsingTotalDiscount(state, payload) {
-    state.usingTotalDiscount = payload;
-  },
-  setActualPayFee(state, payload) {
-    state.actualPayFee = payload;
-  },
-  setAvailableDiscountFee(state, payload) {
-    state.availableDiscountFee = payload;
-  },
-  setPointsPerHour(state, payload) {
-    state.pointsPerHour = payload;
-  },
-  setAvailable(state, payload) {
-    state.available = payload;
-  },
-  setMaxPointsTime(state, payload) {
-    state.maxPointsTime = payload;
-  },
-  setPointsTime(state, payload) {
-    state.pointsTime = payload;
-  },
-  setEnableConsume(state, payload) {
-    state.enableConsume = payload;
-  },
-  setMemberLevelDiscount(state, payload) {
-    state.memberLevelDiscount = payload;
-  },
-  setPointsPerUnit(state, payload) {
-    state.pointsPerUnit = payload;
-  },
-  setMaxOneDayDiscountFee(state, payload) {
-    state.maxOneDayDiscountFee = payload;
-  },
-  setUnitAmount(state, payload) {
-    state.unitAmount = payload;
-  },
-  setMaxDiscountFee(state, payload) {
-    state.maxDiscountFee = payload;
-  },
-  setUnlicensedCar(state, payload) {
-    state.unlicensedCar = payload;
-  },
-  // 订单初始化
-  clearOrderInfo(state) {
-    state.orderDetail = {}; // 订单原始数据
-    state.isShowDiscounts = false; // 是否展示会员登记优惠
-    state.discountDesc = ''; // 停车优惠(首停、会员减免、消费减免)
-    state.checkedTotal = 0; // 选中count数
-    state.enableNewMemberPoints = false; // 是否开启新会员积分
-    state.enablePoints = false; // 是否开启积分减免
-    state.usePoints = 0; // 用户已选择的积分
-    state.isFirst = 0; // 判断用户是否首次进入
-    state.integralDesc = ''; // 积分减免说明文案
-    state.pointsPerHour = 0; // 每小时兑换积分
-    state.enableCoupon = false; // 电子优惠券是否启用
-    state.maxOneDayCoupons = 0; // 单日可选优惠券上限
-    state.coupons = []; // 可选优惠券数量
-    state.couponCount = 0; // 已选择优惠券
-    state.couponDesc = ''; // 优惠券说明文案
-    state.enablePaperCoupons = false; // 启动纸质优惠券
-    state.usingTotalDiscount = 0; // 优惠金额
-    state.actualPayFee = 0; // 应付金额
-    state.availableDiscountFee = 0; // 当日剩余可使用优惠金额
-    // 积分相关
-    state.available = 0; // 用户可用积分
-    state.maxPointsTime = ''; // 积分最大兑换时长
-    state.pointsTime = ''; // 已兑换的积分时间
-    state.unitAmount = 0;
-    // 停车优惠:会员等级和消费减免
-    state.memberLevelDiscount = false; // 是否开启会员等级
-    state.enableConsume = false; // 是否开启消费减免
-    state.pointsPerUnit = 0; //
-    // unlicensed: false // true: 临时车牌;false:普通车牌
-    // 无牌车逻辑
-    state.unlicensedCar = '';
-  }
-};
-
-const actions = {
-  /**
-   * 车辆订单的缴费信息初始化
-   * @param {*} param0
-   * @param {*} param1.gateId  车场闸机口ID
-   * @param {*} param1.vehicleNo  车牌号(包含临牌)
-   * @param {*} param1.callback  回调函数,用于接口报错时,展示对应的信息
-   * @param {*} param1.endlessLoop 用于判断当前用户是否扫码进入 
-   */
-  async orderInit({ commit, dispatch, state }, { gateId = '124p3LK1', vehicleNo = '浙A616A1', callback, endlessLoop }) {
-    try {
-      commit('clearOrderInfo');
-      const unlicensed = vehicleNo.indexOf('临') > -1 || !vehicleNo; // true: 临时车牌;false:普通车牌
-      // const res = await checkOut('浙A616A1');
-      // const res = await checkOut('闽AAQ5519', unlicensed);
-      // const res = await checkOut('粤A51113');
-      // const res = await checkOut('沪DCJ986');
-      // console.log('无牌车扫码出场', endlessLoop);
-      // 场内缴费,调 check-out 接口,
-      const method = unlicensed && endlessLoop || !vehicleNo ? unlicensedCarCheckout : checkOut
-      const res = await method(vehicleNo, unlicensed, gateId);
-      // const res = checkOutQHResponse
-      if (res?.parkingRecord?.totalFee <= 0) {
-        callback && callback({
-          unlicensed,
-          endlessLoop,
-          code: endlessLoop,
-          orderDetail: res,
-        }); // 统一处理错误原因
-        return
-      }
-      // console.log(vehicleNo, res);
-      // 所有的优惠时间长转为金额
-      console.log(112, '所有的优惠时间长转为金额');
-      // dispatch('orderInitRule', checkOutQHResponse);
-      dispatch('orderInitRule', res);
-    } catch (error) {
-      console.log('151151151151151', error);
-      /* if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(error.code)) {
-        callback && callback(error)
-      } */
-      callback && callback(error); // 统一处理错误原因
-    }
-  },
-  orderInitRule({ commit, dispatch, state }, checkOutResponse) {
-    console.log(119, checkOutResponse);
-    // 记录buildingId
-    if (checkOutResponse?.parkInfo?.buildingId) {
-      window.localStorage.setItem('buildingId', checkOutResponse.parkInfo.buildingId);
-    }
-    commit('setOrderDetail', checkOutResponse);
-    const isShowDiscounts = checkOutResponse?.parkingRule?.enableCoupon || false;
-    // 是否展示优惠
-    commit('setIsShowDiscounts', isShowDiscounts);
-    if (checkOutResponse.parkingRule) {
-      // 会员等级减免
-      // 停车优惠(首停、会员减免、消费减免)
-      dispatch('getCheckedTotal', checkOutResponse);
-      // 是否开启新会员积分(hold)
-      commit('setEnableNewMemberPoints', checkOutResponse.parkingRule.enableNewMemberPoints);
-      // 积分减免
-      dispatch('pointsRule', checkOutResponse);
-      // dispatch('getIntegralDesc', checkOutResponse.parkingRule.enablePoints);
-      // 电子优惠券:是否启用
-      // 处理电子优惠券相关逻辑
-      dispatch('couponRule', checkOutResponse);
-      // 纸质优惠券(hold)
-      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);
-    }
-  },
-  // 停车优惠(首停、会员减免、消费减免)
-  getCheckedTotal({ commit, dispatch }, orderDetail) {
-    let checkedTotal = 0;
-    console.log(orderDetail);
-    if (orderDetail?.discountInfo?.memberLevelDiscount && orderDetail?.discountInfo?.memberGrade.length) {
-      orderDetail.discountInfo.memberGrade.forEach((elm) => {
-        if (elm.defaultSelected) {
-          checkedTotal++;
-        }
-      });
-    }
-    if (orderDetail?.discountInfo?.consume?.length) {
-      orderDetail.discountInfo.consume.forEach((elm) => {
-        if (elm.defaultSelected) {
-          checkedTotal++;
-        }
-      });
-    }
-    commit('setMemberLevelDiscount', orderDetail.discountInfo.memberLevelDiscount);
-    commit('setCheckedTotal', checkedTotal);
-    dispatch('getDiscountDesc', {
-      orderDetail,
-      checkedTotal,
-    });
-  },
-  getDiscountDesc({ commit, dispatch }, { orderDetail, checkedTotal }) {
-    if (orderDetail.parkingRule.enableConsume) {
-      commit('setEnableConsume', orderDetail.parkingRule.enableConsume);
-      if (checkedTotal > 0) {
-        return commit('setDiscountDesc', `已选择${checkedTotal}项优惠`);
-      }
-      return commit('setDiscountDesc', `立即使用`);
-    } else {
-      return commit('setDiscountDesc', `暂无可用优惠`);
-    }
-  },
-  // 积分相关计算(仅计算用户可使用的积分)
-  pointsRule({ commit, dispatch, state }, checkOutResponse) {
-    const { discountInfo, parkingRule, parkInfo } = checkOutResponse
-    const {
-      points,
-      usingTotalDiscount, // 当前车辆的已使用优惠的总上限
-    } = discountInfo;
-    const {
-      maxPointsTime = 0, // 最大积分
-      enablePoints,
-      availableDiscountFee,
-      maxOneDayDiscountFee, // 每日最大优惠金额(深圳车场)
-      remainConsumeTime, // 当前订单剩余可使用的优惠
-    } = parkingRule;
-    if ( !points ) return commit('setIntegralDesc', '暂无可用积分'); // 积分优惠处的描述
-    const [
-      {
-        pointsPerHour,
-        available, // 用户可用的积分(当前车辆在) available是用户选择抵扣N小时后剩余的可用积分
-        maxDiscountFee, // 单次上限(元)
-        unitAmount, // 兑换值(元)
-        pointsPerUnit = 0, // 500积分对应的价值
-        discountFee,
-        label,
-      },
-    ] = points;
-    commit('setAvailableDiscountFee', availableDiscountFee);
-    dispatch('maxPointsTimeMath', checkOutResponse) // 剩余积分可兑换上限
-    commit('setEnablePoints', enablePoints);
-    commit('setAvailable', available);
-    commit('setMaxPointsTime', maxPointsTime);
-    commit('setMaxDiscountFee', maxDiscountFee);
-    commit('setPointsTime', discountFee || 0);
-    commit('setPointsPerUnit', pointsPerUnit);
-    commit('setMaxOneDayDiscountFee', maxOneDayDiscountFee);
-    commit('setPointsPerHour', pointsPerUnit);
-    commit('setUnitAmount', unitAmount);
-    commit('setIntegralDesc', discountFee ? `已选择兑换${discountFee}元` : available > pointsPerUnit ? `${available}积分可减免` : `${pointsPerUnit}积分可停车1小时`); // 积分优惠处的描述
-  },
-  // 当前最大可选优惠时间
-  /*
-   * 当前最大可选优惠时间
-   * 1、不能超过积分上限
-   * 2、
-   * */
-  maxPointsTimeMath({ commit, dispatch, state }, checkOutResponse) {
-    const { discountInfo, parkingRule, parkInfo } = checkOutResponse
-    const { points: [{
-      available, // 用户可用的积分(当前车辆在) available是用户选择抵扣N小时后剩余的可用积分
-      unitAmount, // 兑换值(元)
-      pointsPerUnit = 0, // 500 积分对应的价值
-      discountFee,
-      maxDiscountFee,
-    }] } = discountInfo
-    // 总积分
-    const max = available / pointsPerUnit * unitAmount;
-    const timeNum = maxDiscountFee / unitAmount;
-    console.log(';999988888;', timeNum);
-
-    /**
-     * maxDiscountFee 单次最大可使用金额 
-     * availableDiscountFee 当日剩余可使用优惠金额
-     * available 当前用户的剩余积分,也可以说是可以抵扣的积分,如果有积分抵扣自动勾选,那么这个值=这个值-已勾选积分
-     *
-     */
-
-    // if ( !state.maxPointsTime ) {
-    //   commit('setMaxPointsTime', discountFee || max)
-    // }
-    // if (
-    //   parkInfo.parkMallCode === 3 &&
-    //   enablePoints && !maxPointsTime
-    // ) {
-    //   return commit('setIntegralDesc', `今日已达上限`);
-    // }
-    // return commit('setIntegralDesc', `${available}积分可减免`);
-  },
-
-  // 积分减免
-  pointsMath({ commit, dispatch, state }, { type, callback }) {
-    /**
-     * maxDiscountFee 单次最大可使用金额 
-     * availableDiscountFee 当日剩余可使用优惠金额
-     * available 当前用户的剩余积分,也可以说是可以抵扣的积分,如果有积分抵扣自动勾选,那么这个值=这个值-已勾选积分
-     */
-    // 计算用户当前的最大可使用积分的总数(单位:元)
-    let maxPointsTime = state.available / (state.pointsPerUnit / state.unitAmount) + state.pointsTime;
-    if (maxPointsTime > state.maxDiscountFee) {
-      maxPointsTime = state.maxDiscountFee
-    }
-    let msg = ''
-    // 验证最大积分的总数(单位:元)
-    if (maxPointsTime > state.availableDiscountFee) {
-      maxPointsTime = state.availableDiscountFee
-    }
-    if (type === 'add' && state.pointsTime >= maxPointsTime) {
-      // 以下是深圳积分上限规则
-      // 超出抵扣上限,每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元 '优惠金额' >= '每日最高可抵扣'
-      if (state.usingTotalDiscount >= state.maxOneDayDiscountFee && !msg) {
-          msg = `超出抵扣上限,每日最高可抵扣${state.maxOneDayDiscountFee}元`
-      }
-      // 超出抵扣上限,每次最高可抵扣${this.integralMaxMoney}元 '积分兑换时长' >= '深圳前海停车积分上限'q
-      if (state.pointsTime >= maxPointsTime && !msg) {
-        msg = `超出抵扣上限,每次最高可抵扣${state.maxDiscountFee}元`
-      }
-      callback({
-        message: msg
-      });
-      return
-    }
-    if (type === 'add' && state.pointsTime < maxPointsTime) {
-      const pointsTime = state.pointsTime + state.unitAmount;
-      const available = state.available - state.pointsPerUnit;
-      const usingTotalDiscount = state.usingTotalDiscount + state.unitAmount; // 重新计算已经使用的优惠逻辑
-      if (available > -1) {
-        // 如果是深圳车场
-        commit('setAvailable', available);
-        commit('setPointsTime', pointsTime);
-        commit('setUsingTotalDiscount', usingTotalDiscount);
-      }
-    }
-    if (type === 'minus' && state.pointsTime > 0) {
-      const pointsTime = state.pointsTime - state.unitAmount;
-      // 如果是深圳车场
-      commit('setAvailable', state.available + state.pointsPerUnit);
-      commit('setPointsTime', pointsTime);
-    }
-  },
-  cancelPointsMath({ commit, dispatch, state }, callback) {
-    const {
-      discountInfo: { points },
-      parkingRule,
-    } = state.orderDetail;
-    if(!points) {
-      callback && callback();
-      return
-    }
-    const [{ pointsPerHour, available, discountFee }] = points;
-    const { maxPointsTime, enablePoints } = parkingRule;
-    commit('setAvailable', available);
-    commit('setPointsTime', discountFee || 0);
-    callback && callback();
-  },
-  async savePointsMath({ commit, dispatch, state }, callback) {
-    try {
-      const orderDetail = { ...state.orderDetail };
-      // 如果是重复提交,则不做重新计算
-      if (orderDetail.discountInfo.points[0].available === state.available) {
-        callback && callback();
-        return
-      }
-      // 计算积分修改之后的金额,返回给后端
-      // orderDetail.discountInfo.points[0].discountFee = state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
-      orderDetail.discountInfo.points[0].discountFee = state.pointsTime;
-      orderDetail.discountInfo.points[0].available = state.available;
-      orderDetail.discountInfo.points[0].selected = true;
-      /* 其他优惠统计 */
-      // 优惠券: 如果没有添加 selected 字段,则增加 selected; 默认取 defaultSelected;
-      if (orderDetail?.discountInfo?.hasOwnProperty('coupons') && !orderDetail?.discountInfo?.coupons[0]?.hasOwnProperty('selected')) {
-        orderDetail.discountInfo.coupons = orderDetail.discountInfo.coupons.map(elm => {
-          elm.selected = elm.defaultSelected || false;
-          return elm;
-        })
-      }
-      const res = await calculateDiscount({
-        ...orderDetail,
-      });
-      console.log('积分修改失败', { res });
-      dispatch('orderInitRule', res);
-      callback && callback();
-    } catch (err) {
-      console.log('积分修改失败!', err);
-      callback && callback();
-    }
-    //
-  },
-  async saveCouponMath({ commit, dispatch, state }, { couponList, callback }) {
-    const orderDetail = { ...state.orderDetail };
-    orderDetail.discountInfo.coupons = couponList;
-    if (orderDetail?.discountInfo?.points[0]?.discountFee) {
-      orderDetail.discountInfo.points[0].selected = true;
-    } else {
-      orderDetail.discountInfo.points[0].selected = false;
-    }
-    try {
-      const res = await calculateDiscount({
-        ...orderDetail,
-      });
-      dispatch('orderInitRule', res);
-      callback && callback();
-    } catch (err) {
-      console.log('积分修改失败!', err);
-      callback && callback();
-    }
-    // commit('setCoupons', checkOutResponse.discountInfo.coupons);
-  },
-  getIntegralDesc() {
-    // 自动勾选积分优惠
-    // 深圳是最大抵扣金额
-    // available
-    /*
-    if (this.duration > 0) {
-        // 深圳特殊处理(单位:金额)
-        if (this.parkMallCode === 5) {
-          return `已选择兑换${this.duration}元`;
-        }
-        return `已选择兑换${this.duration}小时`;
-      }
-      if (this.bonusCopy < this.integral) {
-        return `${this.integral}积分可停车1小时`;
-      }
-      if (
-        this.parkMallCode === 3 &&
-        this.member?.currnentintegral >= this.integral &&
-        !this.bonus
-      ) {
-        return `今日已达上限`;
-      }
-      return `${this.bonus}积分可减免`;
-    */
-  },
-  // 电子优惠券
-  couponRule({ commit, dispatch, state }, checkOutResponse) {
-    commit('setEnableCoupon', checkOutResponse.parkingRule.enableCoupon);
-    if (checkOutResponse.parkingRule.enableCoupon) {
-      // const {maxOneDayCoupons, remainConsumeTime, hourPrice} = checkOutResponse.parkingRule;
-      // const {
-      //   usingTotalDiscount, // 使用总抵扣
-      //   coupons
-      // } = checkOutResponse.discountInfo;
-      // const {
-      //   totalFee, // 应缴
-      //   actualPayFee // 应付金额
-      // } = checkOutResponse.parkingRecord;
-      // // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
-      // let remainPrice = remainConsumeTime * hourPrice;
-      // if ( remainPrice > actualPayFee ) {
-      //   remainPrice = actualPayFee;
-      // }
-      // let couponPrice = 0
-      // // 确认优惠券是否可选择
-      // let couponsList = coupons.sort((itema,itemb) => itema.discountFee - itemb.discountFee)
-      // couponsList = couponsList.map(elm => {
-      //   if ( !elm.defaultSelected ) {
-      //     if ( elm.discountFee <=  remainPrice && couponPrice <= remainPrice) {
-      //       elm.disabled = false
-      //     } else {
-      //       elm.disabled = true
-      //     }
-      //   }
-      // })
-      // console.log(343, {couponsList});
-      // commit('setCoupons', couponsList);
-      commit('setMaxOneDayCoupons', checkOutResponse.parkingRule.maxOneDayCoupons); // 仅在杭州使用
-      // 根据时间排序电子兑换券
-      const couponSort = (a,b) => {
-        let aTime = new Date(`${a.expirationDate}`.replace(/-/g, '/'));
-        let bTime = new Date(`${b.expirationDate}`.replace(/-/g, '/'));
-        let aN = aTime.getTime(aTime) // 方法1
-        let bN = bTime.getTime(bTime) // 方法2
-        return aN - bN;
-      }
-      const coupons = checkOutResponse.discountInfo.coupons.sort(couponSort)
-      commit('setCoupons', coupons);
-      // 统计已选择优惠券
-      let couponCount = 0;
-      checkOutResponse.discountInfo.coupons.forEach((elm) => {
-        const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
-        if (selected) {
-          couponCount++;
-        }
-      });
-      commit('setCouponCount', couponCount);
-      console.log(479, couponCount);
-      if (couponCount > 0) {
-        return commit('setCouponDesc', `已选择${couponCount}张优惠劵`);
-      } else {
-        if (checkOutResponse.discountInfo.coupons.length) {
-          return commit('setCouponDesc', `您有${checkOutResponse.discountInfo.coupons.length}张可用优惠劵`);
-        }
-        return commit('setCouponDesc', `暂无可用优惠券`);
-      }
-    } else {
-      commit('setCouponDesc', `暂无可用优惠券`);
-    }
-  },
-
-  // 无牌车逻辑
-  async unlicensedRule({ commit, dispatch, state }, callback) {
-    try {
-      // const res = await currentUnlicensedPlate(); // 无牌车查询
-      // const res = await unlicensedCarCheckIn({gateId: 1}); // 无牌车入场
-      /**
-       * CAR_NOT_FOUND 车场扫描道闸入口,发现无车
-       * CAR_HAS_PLATE 车场扫描道闸入口,发现有牌车
-       */
-      // const res = unlicensedCarCheckInResponse;
-      const res = await currentUnlicensedPlate();
-      console.log('无牌车的查询记录', res);
-      commit('setUnlicensedCar', res.vehicleNo);
-      // 如果是扫码进入的用户,在出场时需要重新扫码,这时会在此处传入的一个回调函数,在获取到临牌时,返回给 qrCodesRule 函数
-      if (res.vehicleNo && callback) {
-        callback(res.vehicleNo);
-      } else {
-        callback('error');
-      }
-    } catch (err) {
-      console.log(err);
-    }
-  },
-
-  // 是否展示优惠
-  // getIsShowDiscounts({commit, dispatch}, orderDetail) {
-  //   params?.parkingRule?.enableCoupon
-  // }
-  // calculateDiscount
-
-  /*
-   如果积分发生变化
-   */
-
-};
-
-export default {
-  //开启命名模块
-  namespaced: true,
-  state: state,
-  mutations,
-  actions,
-};

+ 3 - 0
src/store/order/consume.js

@@ -0,0 +1,3 @@
+export default {
+  
+}

+ 56 - 0
src/store/order/coupon.js

@@ -0,0 +1,56 @@
+import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
+import { setSelected } from "@/store/order/utils";
+
+export default {
+  // 电子优惠券
+  couponRule( {commit,dispatch,state},checkOutResponse ) {
+    commit('setEnableCoupon',checkOutResponse.parkingRule.enableCoupon);
+    if ( checkOutResponse.parkingRule.enableCoupon ) {
+      commit('setMaxOneDayCoupons',checkOutResponse.parkingRule.maxOneDayCoupons); // 仅在杭州使用
+      // 根据时间排序电子兑换券
+      const couponSort = ( a,b ) => {
+        let aTime = new Date(`${ a.expirationDate }`.replace(/-/g,'/'));
+        let bTime = new Date(`${ b.expirationDate }`.replace(/-/g,'/'));
+        let aN = aTime.getTime(aTime) // 方法1
+        let bN = bTime.getTime(bTime) // 方法2
+        return aN - bN;
+      }
+      const coupons = checkOutResponse.discountInfo.coupons.sort(couponSort)
+      commit('setCoupons',coupons);
+      // 统计已选择优惠券
+      let couponCount = 0;
+      checkOutResponse.discountInfo.coupons.forEach(( elm ) => {
+        const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
+        if ( selected ) {
+          couponCount++;
+        }
+      });
+      commit('setCouponCount',couponCount);
+      if ( couponCount > 0 ) {
+        return commit('setCouponDesc',`已选择${ couponCount }张优惠劵`);
+      } else {
+        if ( checkOutResponse.discountInfo.coupons.length ) {
+          return commit('setCouponDesc',`您有${ checkOutResponse.discountInfo.coupons.length }张可用优惠劵`);
+        }
+        return commit('setCouponDesc',`暂无可用优惠券`);
+      }
+    } else {
+      commit('setCouponDesc',`暂无可用优惠券`);
+    }
+  },
+  async saveCouponMath( {commit,dispatch,state},{couponList,callback} ) {
+    const orderDetail = {...state.orderDetail};
+    orderDetail.discountInfo.coupons = couponList;
+    setSelected(['paperCoupons','consume','points','memberGrade'],orderDetail)
+    try {
+      const res = await calculateDiscount({
+        ...orderDetail,
+      });
+      dispatch('orderInitRule',res);
+      callback && callback();
+    } catch ( err ) {
+      console.log('积分修改失败!',err);
+      callback && callback();
+    }
+  },
+}

+ 111 - 0
src/store/order/index.js

@@ -0,0 +1,111 @@
+import checkOutQHResponse from "@/api/mockData/checkout.qh8.response.json";
+import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
+import state from "@/store/order/state";
+import mutations from "@/store/order/mutations";
+import memberLevel from "@/store/order/memberLevel";
+import points from "@/store/order/points";
+import coupon from "@/store/order/coupon";
+import consume from "@/store/order/consume";
+import unlicensed from "@/store/order/unlicensed";
+import paperCoupon from "@/store/order/paperCoupon";
+
+export default {
+  //开启命名模块
+  namespaced: true,
+  state: state,
+  mutations,
+  actions: {
+    /**
+     * 车辆订单的缴费信息初始化
+     * @param commit
+     * @param dispatch
+     * @param state
+     * @param gateId      车场闸机口ID
+     * @param vehicleNo   车牌号(包含临牌)
+     * @param callback    回调函数,用于接口报错时,展示对应的信息
+     * @param endlessLoop 用于判断当前用户是否扫码进入
+     */
+    async orderInit( {commit,dispatch,state},{gateId = '124p3LK1',vehicleNo = '浙A616A1',callback,endlessLoop} ) {
+      try {
+        commit('clearOrderInfo');
+        const unlicensed = vehicleNo.indexOf('临') > -1 || !vehicleNo; // true: 临时车牌;false:普通车牌
+        // const res = await checkOut('浙A616A1');
+        // const res = await checkOut('闽AAQ5519', unlicensed);
+        // const res = await checkOut('粤A51113');
+        // const res = await checkOut('沪DCJ986');
+        // console.log('无牌车扫码出场', endlessLoop);
+        // 场内缴费,调 check-out 接口,
+        const method = unlicensed && endlessLoop || !vehicleNo ? unlicensedCarCheckout : checkOut
+        const res = await method(vehicleNo, unlicensed, gateId);
+        // const res = checkOutQHResponse
+        if ( res?.parkingRecord?.totalFee <= 0 ) {
+          callback && callback({
+            unlicensed,
+            endlessLoop,
+            code: endlessLoop,
+            orderDetail: res,
+          }); // 统一处理错误原因
+          return
+        }
+        // console.log(vehicleNo, res);
+        // 所有的优惠时间长转为金额
+        console.log(112,'所有的优惠时间长转为金额');
+        // dispatch('orderInitRule', checkOutQHResponse);
+        dispatch('orderInitRule',res);
+      } catch ( error ) {
+        console.log('151151151151151',error);
+        /* if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(error.code)) {
+         callback && callback(error)
+         } */
+        callback && callback(error); // 统一处理错误原因
+      }
+    },
+    orderInitRule( {commit,dispatch,state},checkOutResponse ) {
+      console.log(119,checkOutResponse);
+      // 记录buildingId
+      if ( checkOutResponse?.parkInfo?.buildingId ) {
+        window.localStorage.setItem('buildingId',checkOutResponse.parkInfo.buildingId);
+      }
+      commit('setParkMallCode', checkOutResponse.parkInfo.parkMallCode)
+      commit('setOrderDetail',checkOutResponse);
+      const isShowDiscounts = checkOutResponse?.parkingRule?.enableCoupon || false;
+      // 是否展示优惠
+      commit('setIsShowDiscounts',isShowDiscounts);
+      if ( checkOutResponse.parkingRule ) {
+        // 会员等级减免
+        // 停车优惠(首停、会员减免、消费减免)
+        dispatch('getCheckedTotal',checkOutResponse);
+        // 是否开启新会员积分(hold)
+        commit('setEnableNewMemberPoints',checkOutResponse.parkingRule.enableNewMemberPoints);
+        // 积分减免
+        dispatch('pointsRule',checkOutResponse);
+        // dispatch('getIntegralDesc', checkOutResponse.parkingRule.enablePoints);
+        // 电子优惠券:是否启用
+        // 处理电子优惠券相关逻辑
+        dispatch('couponRule',checkOutResponse);
+        // 纸质优惠券(hold)
+        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);
+      }
+    },
+    // 会员等级
+    ...memberLevel,
+    // 消费减免
+    ...consume,
+    // 积分
+    ...points,
+    // 电子券
+    ...coupon,
+    // 无牌车
+    ...unlicensed,
+    // 纸质优惠券
+    ...paperCoupon
+  },
+};

+ 59 - 0
src/store/order/memberLevel.js

@@ -0,0 +1,59 @@
+import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
+import { setSelected } from "@/store/order/utils";
+
+export default {
+  // 停车优惠(首停、会员减免、消费减免)
+  getCheckedTotal( {commit,dispatch},orderDetail ) {
+    let checkedTotal = 0;
+    console.log(254,orderDetail);
+    if ( orderDetail?.discountInfo?.memberLevelDiscount && orderDetail?.discountInfo?.memberGrade.length ) {
+
+      orderDetail.discountInfo.memberGrade.forEach(( elm ) => {
+        if ( elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected ) {
+          checkedTotal++;
+        }
+      });
+    }
+    if ( orderDetail?.discountInfo?.consume?.length ) {
+      orderDetail.discountInfo.consume.forEach(( elm ) => {
+        if ( elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected ) {
+          checkedTotal++;
+        }
+      });
+    }
+    console.log(22,checkedTotal)
+    commit('setMemberLevelDiscount',orderDetail.discountInfo.memberLevelDiscount);
+    commit('setCheckedTotal',checkedTotal);
+    dispatch('getDiscountDesc',{
+      orderDetail,
+      checkedTotal,
+    });
+  },
+  getDiscountDesc( {commit,dispatch},{orderDetail,checkedTotal} ) {
+    console.log(278,orderDetail.parkingRule.enableConsume)
+    console.log(278,orderDetail.parkingRule.enableConsume)
+    if ( orderDetail.parkingRule.enableConsume || orderDetail.discountInfo.memberLevelDiscount ) {
+      commit('setEnableConsume',orderDetail.parkingRule.enableConsume);
+      if ( checkedTotal > 0 ) {
+        return commit('setDiscountDesc',`已选择${ checkedTotal }项优惠`);
+      }
+      return commit('setDiscountDesc',`立即使用`);
+    } else {
+      return commit('setDiscountDesc',`暂无可用优惠`);
+    }
+  },
+  async saveDiscounts( {commit,dispatch},{orderDetail,callback} ) {
+    try {
+      setSelected(['paperCoupons','coupons','points',],orderDetail)
+      const res = await calculateDiscount({
+        ...orderDetail,
+      });
+      console.log(48,res)
+      dispatch('orderInitRule',res);
+      callback && callback();
+    } catch ( err ) {
+      console.log('优惠修改失败!',err);
+      callback && callback();
+    }
+  }
+}

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

@@ -0,0 +1,158 @@
+export default {
+  setOrderDetail( state,payload ) {
+    state.orderDetail = payload;
+  },
+  setIsShowDiscounts( state,payload ) {
+    state.isShowDiscounts = payload;
+  },
+  setCheckedTotal( state,payload ) {
+    state.checkedTotal = payload;
+  },
+  setDiscountDesc( state,payload ) {
+    state.discountDesc = payload;
+  },
+  setEnableNewMemberPoints( state,payload ) {
+    state.enableNewMemberPoints = payload;
+  },
+  setEnablePoints( state,payload ) {
+    state.enablePoints = payload;
+  },
+  setIsFirst( state,payload ) {
+    state.isFirst = payload;
+  },
+  setIntegralDesc( state,payload ) {
+    state.integralDesc = payload;
+  },
+  setUsePoints( state,payload ) {
+    state.usePoints = payload;
+  },
+  setEnableCoupon( state,payload ) {
+    state.enableCoupon = payload;
+  },
+  setMaxOneDayCoupons( state,payload ) {
+    state.maxOneDayCoupons = payload;
+  },
+  setCoupons( state,payload ) {
+    state.coupons = payload;
+  },
+  setCouponCount( state,payload ) {
+    state.couponCount = payload;
+  },
+  setCouponDesc( state,payload ) {
+    state.couponDesc = payload;
+  },
+  setEnablePaperCoupons( state,payload ) {
+    state.enablePaperCoupons = payload;
+  },
+  setUsingTotalDiscount( state,payload ) {
+    state.usingTotalDiscount = payload;
+  },
+  setActualPayFee( state,payload ) {
+    state.actualPayFee = payload;
+  },
+  setAvailableDiscountFee( state,payload ) {
+    state.availableDiscountFee = payload;
+  },
+  setPointsPerHour( state,payload ) {
+    state.pointsPerHour = payload;
+  },
+  setAvailable( state,payload ) {
+    state.available = payload;
+  },
+  setMaxPointsTime( state,payload ) {
+    state.maxPointsTime = payload;
+  },
+  setPointsTime( state,payload ) {
+    state.pointsTime = payload;
+  },
+  setEnableConsume( state,payload ) {
+    state.enableConsume = payload;
+  },
+  setMemberLevelDiscount( state,payload ) {
+    state.memberLevelDiscount = payload;
+  },
+  setPointsPerUnit( state,payload ) {
+    state.pointsPerUnit = payload;
+  },
+  setMaxOneDayDiscountFee( state,payload ) {
+    state.maxOneDayDiscountFee = payload;
+  },
+  setUnitAmount( state,payload ) {
+    state.unitAmount = payload || 1;
+  },
+  setUnlimitUsePoints(state, payload) {
+    state.unlimitUsePoints = payload;
+  },
+  setUnitHour( state,payload ) {
+    state.unitHour = payload || 1;
+  },
+  setMaxDiscountFee( state,payload ) {
+    state.maxDiscountFee = payload;
+  },
+  setUnlicensedCar( state,payload ) {
+    state.unlicensedCar = payload;
+  },
+  setParkMallCode( state,payload ) {
+    state.parkMallCode = payload;
+  },
+  /* 纸质优惠券相关 */
+  setPaperCoupons( state,payload ) {
+    state.paperCoupons = payload;
+  },
+  setPaperCouponCount( state,payload ) {
+    state.paperCouponCount = payload;
+  },
+  setPaperCouponDesc( state,payload ) {
+    state.paperCouponDesc = payload;
+  },
+  setPaperDiscountFee( state,payload ) {
+    state.paperDiscountFee = payload;
+  },
+  setPaperDiscountTime( state,payload ) {
+    state.paperDiscountTime = payload;
+  },
+  // 订单初始化
+  clearOrderInfo( state ) {
+    state.orderDetail = {}; // 订单原始数据
+    state.isShowDiscounts = false; // 是否展示会员登记优惠
+    state.discountDesc = ''; // 停车优惠(首停、会员减免、消费减免)
+    state.checkedTotal = 0; // 选中count数
+    state.enableNewMemberPoints = false; // 是否开启新会员积分
+    state.enablePoints = false; // 是否开启积分减免
+    state.usePoints = 0; // 用户已选择的积分
+    state.isFirst = 0; // 判断用户是否首次进入
+    state.integralDesc = ''; // 积分减免说明文案
+    state.pointsPerHour = 0; // 每小时兑换积分
+    state.enableCoupon = false; // 电子优惠券是否启用
+    state.maxOneDayCoupons = 0; // 单日可选优惠券上限
+    state.coupons = []; // 可选优惠券数量
+    state.couponCount = 0; // 已选择优惠券
+    state.couponDesc = ''; // 优惠券说明文案
+    state.enablePaperCoupons = false; // 启动纸质优惠券
+    state.usingTotalDiscount = 0; // 优惠金额
+    state.actualPayFee = 0; // 应付金额
+    state.availableDiscountFee = 0; // 当日剩余可使用优惠金额
+    // 积分相关
+    state.available = 0; // 用户可用积分
+    state.maxPointsTime = ''; // 积分最大兑换时长
+    state.pointsTime = ''; // 已兑换的积分时间
+    state.unitAmount = 1;
+    state.unlimitUsePoints = 'LIMIT';
+    state.unitHour = 1;
+    // 停车优惠:会员等级和消费减免
+    state.memberLevelDiscount = false; // 是否开启会员等级
+    state.enableConsume = false; // 是否开启消费减免
+    state.pointsPerUnit = 0; //
+    // unlicensed: false // true: 临时车牌;false:普通车牌
+    // 无牌车逻辑
+    state.unlicensedCar = '';
+    // 车场相关
+    state.parkMallCode = '' // 车场唯一编号
+    /* 纸质优惠券相关 */
+    state.paperCoupons = [] // 可选纸质优惠券数量
+    state.paperCouponCount = 0 // 已选纸质择优惠券
+    state.paperCouponDesc = '' // 纸质优惠券说明文案
+    state.paperDiscountFee = 0 // 纸质优惠券总金额
+    state.paperDiscountTime = 0 // 纸质优惠券总时间
+  }
+};

+ 42 - 0
src/store/order/paperCoupon.js

@@ -0,0 +1,42 @@
+import { calculateDiscount } from "@/api/parking";
+import { setSelected } from "@/store/order/utils";
+
+export default {
+  /*
+   *   setPaperCoupons( state,payload ) {
+   state.paperCoupons = payload;
+   },
+   setPaperCouponCount( state,payload ) {
+   state.paperCouponCount = payload;
+   },
+   setPaperCouponDesc( state,payload ) {
+   state.paperCouponDesc = payload;
+   },
+   * 
+   * */
+  paperCouponRule( {commit,dispatch,state},checkOutResponse ) {
+    if ( checkOutResponse.parkingRule.enablePaperCoupons ) {
+
+    }
+  },
+  async savePaperCoupon( {commit,dispatch,state},{paperCoupons,callback} ) {
+    try {
+      const orderDetail = {...state.orderDetail};
+      setSelected(['coupons','consume','points','memberGrade'], orderDetail)
+      orderDetail.discountInfo.paperCoupons = state.paperCoupons.map(elm => {
+        return {
+          ...elm,
+          selected: true,
+        }
+      })
+      const res = await calculateDiscount({
+        ...orderDetail,
+      });
+      dispatch('orderInitRule',res);
+      callback && callback();
+    } catch ( err ) {
+      console.log('积分修改失败!',err);
+      callback && callback();
+    }
+  }
+}

+ 260 - 0
src/store/order/points.js

@@ -0,0 +1,260 @@
+import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
+import { setSelected } from './utils'
+
+export default {
+
+  // 积分相关计算(仅计算用户可使用的积分)
+  pointsRule( {commit,dispatch,state},checkOutResponse ) {
+    const {discountInfo,parkingRule,parkInfo} = checkOutResponse
+    const {
+      points,
+      usingTotalDiscount, // 当前车辆的已使用优惠的总上限
+    } = discountInfo;
+    const {
+      parkMallCode
+    } = parkInfo
+    const {
+      maxPointsTime = 0, // 最大积分
+      enablePoints,
+      availableDiscountFee,
+      maxOneDayDiscountFee, // 每日最大优惠金额(深圳车场)
+      remainConsumeTime, // 当前订单剩余可使用的优惠
+    } = parkingRule;
+    if ( !points ) return commit('setIntegralDesc','暂无可用积分'); // 积分优惠处的描述
+    const [
+      {
+        pointsPerHour,
+        available, // 用户可用的积分(当前车辆在) available是用户选择抵扣N小时后剩余的可用积分
+        maxDiscountFee, // 单次上限(元)
+        unitAmount, // 兑换值(元)
+        unlimitUsePoints, // 前海积分最大上限
+        unitHour, // 兑换值(小时)
+        pointsPerUnit = 0, // 500积分对应的价值
+        discountFee,
+        label,
+      },
+    ] = points;
+    commit('setAvailableDiscountFee',availableDiscountFee);
+    dispatch('maxPointsTimeMath',checkOutResponse) // 剩余积分可兑换上限
+    commit('setEnablePoints',enablePoints);
+    commit('setAvailable',available);
+    commit('setMaxPointsTime',maxPointsTime);
+    commit('setMaxDiscountFee',maxDiscountFee);
+    commit('setPointsTime',discountFee || 0);
+    commit('setPointsPerUnit',pointsPerUnit);
+    commit('setMaxOneDayDiscountFee',maxOneDayDiscountFee);
+    commit('setPointsPerHour',pointsPerUnit);
+    commit('setUnitAmount',unitAmount);
+    commit('setUnlimitUsePoints', unlimitUsePoints);
+    commit('setUnitHour', unitHour);
+    commit('setIntegralDesc',discountFee ? `已选择兑换${ discountFee }元` : available > pointsPerUnit ? `${ available }积分可减免` : `${ pointsPerUnit }积分可停车1小时`); // 积分优惠处的描述
+  },
+  // 当前最大可选优惠时间
+  /*
+   * 当前最大可选优惠时间
+   * 1、不能超过积分上限
+   * 2、
+   * */
+  maxPointsTimeMath( {commit,dispatch,state},checkOutResponse ) {
+    const {discountInfo,parkingRule,parkInfo} = checkOutResponse
+    const {
+      points: [{
+        available, // 用户可用的积分(当前车辆在) available是用户选择抵扣N小时后剩余的可用积分
+        unitAmount, // 兑换值(元)
+        pointsPerUnit = 0, // 500 积分对应的价值
+        discountFee,
+        maxDiscountFee,
+      }]
+    } = discountInfo
+    const {
+      parkMallCode
+    } = parkInfo
+    // 总积分
+    const max = available / pointsPerUnit * unitAmount;
+    const timeNum = maxDiscountFee / unitAmount;
+    console.log(';999988888;',timeNum);
+
+    /**
+     * maxDiscountFee 单次最大可使用金额
+     * availableDiscountFee 当日剩余可使用优惠金额
+     * available 当前用户的剩余积分,也可以说是可以抵扣的积分,如果有积分抵扣自动勾选,那么这个值=这个值-已勾选积分
+     *
+     */
+
+    // if ( !state.maxPointsTime ) {
+    //   commit('setMaxPointsTime', discountFee || max)
+    // }
+    // if (
+    //   parkInfo.parkMallCode === 3 &&
+    //   enablePoints && !maxPointsTime
+    // ) {
+    //   return commit('setIntegralDesc', `今日已达上限`);
+    // }
+    // return commit('setIntegralDesc', `${available}积分可减免`);
+  },
+  // 积分减免
+  pointsMath( {commit,dispatch,state},{type,callback} ) {
+    const {parkInfo,parkingRule} = state.orderDetail
+    const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
+    const {parkMallCode} = parkInfo
+    console.log(376,maxOneTimeDiscountTime,state.availableDiscountFee)
+    /**
+     * maxDiscountFee 单次最大可使用金额
+     * availableDiscountFee 当日剩余可使用优惠金额
+     * available 当前用户的剩余积分,也可以说是可以抵扣的积分,如果有积分抵扣自动勾选,那么这个值=这个值-已勾选积分
+     */
+      // 计算用户当前的最大可使用积分的总数(单位:元)
+    let maxPointsTime = state.available / ( state.pointsPerUnit / state.unitAmount ) + state.pointsTime;
+    if ( maxPointsTime > state.maxDiscountFee ) {
+      maxPointsTime = state.maxDiscountFee
+    }
+    let msg = ''
+    // 验证最大积分的总数(单位:元)
+    if ( maxPointsTime > state.availableDiscountFee ) {
+      maxPointsTime = state.availableDiscountFee
+    }
+    console.log(392,state.pointsTime,maxPointsTime,parkMallCode);
+    if ( parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT' ) {
+      if ( type === 'add' && state.pointsTime >= maxPointsTime ) {
+        // 以下是深圳积分上限规则
+        // 超出抵扣上限,每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元 '优惠金额' >= '每日最高可抵扣'
+        if ( state.usingTotalDiscount - state.paperDiscountFee >= state.maxOneDayDiscountFee && !msg ) {
+          msg = `超出抵扣上限,每日最高可抵扣${ state.maxOneDayDiscountFee }元`
+        }
+        // 超出抵扣上限,每次最高可抵扣${this.integralMaxMoney}元 '积分兑换时长' >= '深圳前海停车积分上限'q
+        if ( state.pointsTime >= state.maxDiscountFee && !msg ) {
+          msg = `超出抵扣上限,每次最高可抵扣${ state.maxDiscountFee }元`
+        }
+      }
+    }
+    // 单日上限限制
+    if ( oneDayLimitation && !msg ) {
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      const remainConsumeTimeFee = remainConsumeTime * hourPrice
+      // 计算单日剩余 remainConsumeTime
+      // 当前使用优惠 state.usingTotalDiscount
+      // 判断符合上限 
+
+      // 浦东积分上限判断
+      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount <= maxOneTimeDiscountFee ) {
+        msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
+      }
+    }
+    // 单次上限限制
+    if ( oneTimeLimitation && !msg ) {
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      const remainConsumeTimeFee = remainConsumeTime * hourPrice
+      // 计算单日剩余 remainConsumeTime
+      // 当前使用优惠 state.usingTotalDiscount
+      // 判断符合上限
+      // 浦东积分上限判断: 减去纸质优惠券的金额
+      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount - state.paperDiscountFee <= maxOneTimeDiscountFee ) {
+        msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
+      }
+    }
+    if ( msg ) {
+      callback({
+        message: msg
+      });
+      return
+    }
+    // 计算浦东的上限
+    if ( type === 'add' && state.usingTotalDiscount < state.maxOneDayDiscountFee && parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT') {
+      return;
+    }
+    if ( type === 'add' ) {
+      let pointsTime = 0;
+      pointsTime = state.pointsTime + (parkMallCode === 1 ? state.unitAmount : state.unitHour);
+      const available = state.available - state.pointsPerUnit;
+      const usingTotalDiscount = state.usingTotalDiscount + state.unitAmount; // 重新计算已经使用的优惠逻辑
+      if ( available > -1 ) {
+        // 如果是深圳车场
+        commit('setAvailable',available);
+        commit('setPointsTime',pointsTime);
+        commit('setUsingTotalDiscount',usingTotalDiscount);
+      }
+    }
+    if ( type === 'minus' && state.pointsTime > 0 ) {
+      const pointsTime = state.pointsTime - (parkMallCode === 1 ? state.unitAmount : state.unitHour);
+      // 如果是深圳车场
+      commit('setAvailable',state.available + state.pointsPerUnit);
+      commit('setPointsTime',pointsTime);
+    }
+  },
+  cancelPointsMath( {commit,dispatch,state},callback ) {
+    const {
+      discountInfo: {points},
+      parkingRule,
+    } = state.orderDetail;
+    if ( !points ) {
+      callback && callback();
+      return
+    }
+    const [{pointsPerHour,available,discountFee}] = points;
+    const {maxPointsTime,enablePoints} = parkingRule;
+    commit('setAvailable',available);
+    commit('setPointsTime',discountFee || 0);
+    callback && callback();
+  },
+  async savePointsMath( {commit,dispatch,state},callback ) {
+    try {
+      let orderDetail = {...state.orderDetail};
+      // 如果是重复提交,则不做重新计算
+      if ( orderDetail.discountInfo.points[0].available === state.available ) {
+        callback && callback();
+        return
+      }
+      // 如果是会员等级减免\如果是消费减免\如果是纸质优惠券\电子券的话
+      setSelected(['memberGrade','consume','paperCoupons','coupons'],orderDetail)
+      // 计算积分修改之后的金额,返回给后端
+      // orderDetail.discountInfo.points[0].discountFee = state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
+      orderDetail.discountInfo.points[0].discountFee = state.pointsTime;
+      orderDetail.discountInfo.points[0].available = state.available;
+      orderDetail.discountInfo.points[0].selected = true;
+      /* 其他优惠统计 */
+      // 优惠券: 如果没有添加 selected 字段,则增加 selected; 默认取 defaultSelected;
+      if ( orderDetail?.discountInfo?.hasOwnProperty('coupons') && !orderDetail?.discountInfo?.coupons[0]?.hasOwnProperty('selected') ) {
+        orderDetail.discountInfo.coupons = orderDetail.discountInfo.coupons.map(elm => {
+          elm.selected = elm.defaultSelected || false;
+          return elm;
+        })
+      }
+      const res = await calculateDiscount({
+        ...orderDetail,
+      });
+      console.log('积分修改失败',{res});
+      dispatch('orderInitRule',res);
+      callback && callback();
+    } catch ( err ) {
+      console.log('积分修改失败!',err);
+      callback && callback();
+    }
+    //
+  },
+
+  getIntegralDesc() {
+    // 自动勾选积分优惠
+    // 深圳是最大抵扣金额
+    // available
+    /*
+     if (this.duration > 0) {
+     // 深圳特殊处理(单位:金额)
+     if (this.parkMallCode === 5) {
+     return `已选择兑换${this.duration}元`;
+     }
+     return `已选择兑换${this.duration}小时`;
+     }
+     if (this.bonusCopy < this.integral) {
+     return `${this.integral}积分可停车1小时`;
+     }
+     if (
+     this.parkMallCode === 3 &&
+     this.member?.currnentintegral >= this.integral &&
+     !this.bonus
+     ) {
+     return `今日已达上限`;
+     }
+     return `${this.bonus}积分可减免`;
+     */
+  },
+}

+ 44 - 0
src/store/order/state.js

@@ -0,0 +1,44 @@
+export default  {
+  // 微服务接口字段
+  orderDetail: {}, // 订单原始数据
+  isShowDiscounts: false, // 是否展示会员登记优惠
+  discountDesc: '', // 停车优惠(首停、会员减免、消费减免)
+  checkedTotal: 0, // 选中count数
+  enableNewMemberPoints: false, // 是否开启新会员积分
+  enablePoints: false, // 是否开启积分减免
+  usePoints: 0, // 用户已选择的积分
+  isFirst: 0, // 判断用户是否首次进入
+  integralDesc: '', // 积分减免说明文案
+  pointsPerHour: 0, // 每小时兑换积分
+  enableCoupon: false, // 电子优惠券是否启用
+  maxOneDayCoupons: 0, // 单日可选优惠券上限
+  coupons: [], // 可选优惠券数量
+  couponCount: 0, // 已选择优惠券
+  couponDesc: '', // 优惠券说明文案
+  enablePaperCoupons: false, // 启动纸质优惠券
+  usingTotalDiscount: 0, // 优惠金额
+  actualPayFee: 0, // 应付金额
+  availableDiscountFee: 0, // 当日剩余可使用优惠金额
+  // 积分相关
+  available: 0, // 用户可用积分
+  maxPointsTime: '', // 积分最大兑换时长
+  pointsTime: '', // 已兑换的积分时间
+  unlimitUsePoints: 'LIMIT',
+  unitAmount: 1, // 金额
+  unitHour: 1,  // 小时
+  // 停车优惠:会员等级和消费减免
+  memberLevelDiscount: false, // 是否开启会员等级
+  enableConsume: false, // 是否开启消费减免
+  pointsPerUnit: 0, //
+  // unlicensed: false // true: 临时车牌;false:普通车牌
+  // 无牌车逻辑
+  unlicensedCar: '',
+  // 车场相关
+  parkMallCode: '', // 车场唯一编号
+  /* 纸质优惠券相关 */
+  paperCoupons: [], // 可选纸质优惠券数量
+  paperCouponCount: 0, // 已选纸质择优惠券
+  paperDiscountFee: 0, // 纸质优惠券的总金额
+  paperDiscountTime: 0, // 纸质优惠券的总时间
+  paperCouponDesc: '', // 纸质优惠券说明文案
+}

+ 27 - 0
src/store/order/unlicensed.js

@@ -0,0 +1,27 @@
+import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
+
+export default {
+  // 无牌车逻辑
+  async unlicensedRule( {commit,dispatch,state},callback ) {
+    try {
+      // const res = await currentUnlicensedPlate(); // 无牌车查询
+      // const res = await unlicensedCarCheckIn({gateId: 1}); // 无牌车入场
+      /**
+       * CAR_NOT_FOUND 车场扫描道闸入口,发现无车
+       * CAR_HAS_PLATE 车场扫描道闸入口,发现有牌车
+       */
+        // const res = unlicensedCarCheckInResponse;
+      const res = await currentUnlicensedPlate();
+      console.log('无牌车的查询记录',res);
+      commit('setUnlicensedCar',res.vehicleNo);
+      // 如果是扫码进入的用户,在出场时需要重新扫码,这时会在此处传入的一个回调函数,在获取到临牌时,返回给 qrCodesRule 函数
+      if ( res.vehicleNo && callback ) {
+        callback(res.vehicleNo);
+      } else {
+        callback('error');
+      }
+    } catch ( err ) {
+      console.log(err);
+    }
+  },
+}

+ 77 - 0
src/store/order/utils.js

@@ -0,0 +1,77 @@
+import { isArray } from "lodash";
+
+export function setSelected( types,orderDetail ) {
+  function run( name ) {
+    switch ( name ) {
+      case 'memberGrade':
+        // 如果是会员等级减免
+        if ( orderDetail.discountInfo?.memberGrade?.length ) {
+          const [memberGrade] = orderDetail.discountInfo?.memberGrade;
+          if ( !memberGrade?.discountFee ) {
+            memberGrade.discountFee = (memberGrade.hasOwnProperty('defaultDiscountTime')? memberGrade.defaultDiscountTime : memberGrade.discountTime ) * orderDetail.parkingRule.hourPrice
+          }
+          orderDetail.discountInfo.memberGrade = [{
+            ...memberGrade,
+            selected: memberGrade.hasOwnProperty('selected') ? memberGrade.selected : memberGrade?.defaultSelected || false
+          }]
+        }
+        break
+      case 'consume':
+        // 如果是消费减免
+        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
+          }
+          orderDetail.discountInfo.consume = [{
+            ...consume,
+            selected: consume.hasOwnProperty('selected') ? consume.selected : consume?.defaultSelected || false
+          }]
+        }
+        break
+      case 'points':
+        // 如果是积分减免
+        if ( orderDetail.discountInfo?.points?.length ) {
+          const [points] = orderDetail.discountInfo?.points;
+          if ( !points?.discountFee ) {
+            points.discountFee = (points.hasOwnProperty('defaultDiscountTime')? points.defaultDiscountTime : points.discountTime ) * orderDetail.parkingRule.hourPrice
+          }
+          orderDetail.discountInfo.points = [{
+            ...points,
+            selected: points.hasOwnProperty('selected') ? points.selected : points?.defaultSelected || false
+          }]
+        }
+        break
+      case 'paperCoupons':
+        // 如果是纸质优惠券的话
+        if ( orderDetail.discountInfo?.paperCoupons?.length ) {
+          const [paperCoupons] = orderDetail.discountInfo?.paperCoupons;
+          orderDetail.discountInfo.paperCoupons = [{
+            ...paperCoupons,
+            selected: paperCoupons.hasOwnProperty('selected') ? paperCoupons.selected : paperCoupons?.defaultSelected || false
+          }]
+        }
+        break
+      case 'coupons':
+        // 如果是电子优惠券的话
+        if ( orderDetail.discountInfo?.coupons?.length ) {
+          orderDetail.discountInfo.coupons = orderDetail.discountInfo.coupons.map(elm => {
+            return {
+              ...elm,
+              selected: elm.hasOwnProperty('selected') ? elm.selected : elm?.defaultSelected || false
+            }
+          })
+        }
+        break
+    }
+  }
+
+  if ( typeof types === 'string' ) {
+    run(types)
+  }
+  if ( isArray(types) ) {
+    types.forEach(key => {
+      run(key)
+    })
+  }
+}

+ 5 - 0
src/utils/api-kip.js

@@ -3,6 +3,7 @@ const DEFAULT_CONFIG = {
 	refreshTokenUrl: `/oauth/v1/oauth/renewToken?refreshToken=`,
 }
 
+const POINTS_PREFIX = '/points/v1';
 // 微信授权手机号登录,注册
 export function kipPhoneLogin(params) {
 	const url = `/oauth/v1/auth/phone-login`;
@@ -216,4 +217,8 @@ export function kipAgreementCheck (params) {
 export function wxEasyPointsCommitStatus(params) {
 	const url = `/points/v1/auto/points/commit-status`;
 	return request.get(url, params);
+}
+
+export function getVIPIntegral(){
+  return request.get(`/points/v1/member/current`);
 }

+ 10 - 7
src/utils/index.js

@@ -132,6 +132,9 @@ export function getGroupIdAndMallIdByLsbId( lbsId ) {
   if ( window.env === 'prod' ) {
     return lbsObj['prod'];
   }
+  if ( window.env === 'dev' ) {
+    return lbsObj['dev'];
+  }
   return lbsObj['qa'];
 }
 
@@ -170,12 +173,12 @@ export function initEnv() {
   const href = window.location.href;
   console.log('当前页面的url地址  ',href);
   if ( /dev-|8080/.test(href) ) {
-    window.env = 'qa';
+    /*window.env = 'qa';
     window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
-    window.api = 'qaApi';
-    /*window.env = 'dev';
+    window.api = 'qaApi';*/
+    window.env = 'dev';
     window.profileApi = 'https://dev-gateway-kip.kerryonvip.com/api';
-    window.api = 'devApi';*/
+    window.api = 'devApi';
     // window.env = 'prod';
     // window.profileApi = 'https://sl-apim.kerryplus.com/c/api';
     // window.api = 'api';
@@ -200,9 +203,9 @@ export function initEnv() {
 
 export function requestInit() {
   let baseURL = window.profileApi + '/temporary-parking/v1';
-  // if (window.location.href.indexOf('parking.') < 0) {
-  //   baseURL = '/msApi';
-  // }
+  if (window.location.href.indexOf('parking.') < 0) {
+    baseURL = '/msApi';
+  }
   window.requestms = createAxiosByinterceptors({
     // baseURL: `https://dev-kip-service-internal.kerryonvip.com/`,
     // baseURL: `http://tp.hht.test/`,

+ 2 - 2
src/utils/request-kip.js

@@ -13,7 +13,7 @@ function getHeaders(config = {}) {
   const { contentType = 'json' } = config;
   const ct = CONTENT_TYPE_ARRAY[contentType];
   let header = {
-    appId: uni.getStorageSync('appid'),
+    appId: uni.getStorageSync('appId'),
     'Content-Type': ct,
   };
   const token = getToken();
@@ -22,7 +22,7 @@ function getHeaders(config = {}) {
   }
 
   const groupId = uni.getStorageSync('groupId');
-  const mallId = uni.getStorageSync('mallid');
+  const mallId = uni.getStorageSync('mallId');
   if (groupId) {
     header['brandId'] = groupId;
   }

+ 4 - 2
vue.config.js

@@ -122,9 +122,11 @@ module.exports = {
         },
       },
       '/msApi': {
-        // target: 'http://172.21.201.149:8080',
+        // target: 'http://172.21.201.251:8080',
+        // target: 'http://172.21.203.156:8080',
+        target: 'http://172.21.202.63:8080',
         // target: 'http://172.21.202.133:8080',
-        target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
+        // target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
         // target: 'http://172.21.203.140:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL   2023-2-9
         // target: 'http://172.21.203.20:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL
         // target: 'http://172.21.200.89:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL