Explorar o código

feat: 微服务接入改造25%(创建订单页面:优惠券选择逻辑优化; 无牌车UI)

John-Hong %!s(int64=2) %!d(string=hai) anos
pai
achega
8bd3a9d984

+ 99 - 0
src/api/mockData/checkout.hz2.response.json

@@ -0,0 +1,99 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "粤BZ11R2",
+    "enterTime": "2022-11-11 16:11:11",
+    "serviceMin": 1731,
+    "totalFee": 12000,
+    "actualPayFee": 58,
+    "totalFeeInYuan": 120
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 62,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": false,
+        "memberGradeText": "银卡卡",
+        "discountTime": 2,
+        "discountFee": 10
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "maxDiscountTime": 1,
+        "discountTime": 1,
+        "defaultDiscountTime": 3,
+        "redeemSalesAmount": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 3000,
+        "pointsPerUnit": 500,
+        "pointsPerHour": 100,
+        "unitAmount": 5,
+        "newMember": false,
+        "label": "已选择兑换2小时",
+        "memberGradeText": "银卡",
+        "discountFee": 10
+      }
+    ],
+    "coupons": [
+      {
+        "code": "couponCode1",
+        "name": "6元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 6,
+        "defaultSelected": true
+      },
+      {
+        "code": "couponCode2",
+        "name": "6元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 6,
+        "defaultSelected": true
+      },
+      {
+        "code": "couponCode3",
+        "name": "5元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 5,
+        "defaultSelected": false
+      },
+      {
+        "code": "couponCode4",
+        "name": "5元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 5,
+        "defaultSelected": false
+      },
+      {
+        "code": "couponCode5",
+        "name": "5元券",
+        "expirationDate": "2023-01-08 13:15:11",
+        "discountFee": 5,
+        "defaultSelected": false
+      }
+    ]
+  },
+  "parkingRule": {
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": true,
+    "maxOneDayCoupons": 2,
+    "remainCoupons": 2,
+    "enablePaperCoupons": false,
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 6,
+    "maxPointsTime": 3,
+    "remainConsumeTime": 5,
+    "maxDiscountTime": 33
+  },
+  "parkInfo": {
+    "parkName": "杭州嘉里城",
+    "description": "杭州收费描述",
+    "parkMallCode": 2
+  }
+}

+ 2 - 2
src/api/mockData/checkout.qh.response

@@ -14,7 +14,7 @@
       {
         "available": 1000, // 用户可用的积分
         "maxDiscountFee": 20,// 单次上限(元)
-        "pointsPerUnit": 500, // 
+        "pointsPerUnit": 500, //
         "unitAmount": 5, // 兑换值(元)
         "newMember": false,
         "label": "1000积分可减免"
@@ -29,7 +29,7 @@
     "enablePaperCoupons": false,
     "enableConsume": false,
     "enableConsumeSplit": false,
-    "remainConsumeTime": 60
+    "remainConsumeTime": 60 //
   },
   "parkInfo": {
     "parkName": "VLhpfQGTMDYpsBZxvfBoeygjb",

+ 1 - 1
src/api/mockData/checkout.qh.response.json

@@ -85,6 +85,6 @@
   "parkInfo": {
     "parkName": "VLhpfQGTMDYpsBZxvfBoeygjb",
     "description": "eOMtThyhVNLWUZNRcBaQKxI",
-    "parkMallCode": 999
+    "parkMallCode": 5
   }
 }

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

@@ -0,0 +1,61 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "闽AAQ5518",
+    "enterTime": "2023-01-16 09:55:37",
+    "serviceMin": 43537,
+    "totalFee": 31,
+    "actualPayFee": 0.0,
+    "buildingId": "QHKC-P1",
+    "totalFeeInYuan": 0.31
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 5,
+    "memberLevelDiscount": false,
+    "points": [
+      {
+        "available": 10000,
+        "maxDiscountFee": 999999999,
+        "pointsPerUnit": 15,
+        "unitAmount": 1,
+        "newMember": false,
+        "label": "10000积分可减免"
+      }
+    ],
+    "coupons": [
+      {
+        "code": "ctdhlegs287_t",
+        "name": "停车券",
+        "expirationDate": "2023-02-28 23:59:59",
+        "discountFee": 5,
+        "defaultSelected": true,
+        "superposition": "1"
+      },
+      {
+        "code": "ydgk07bvb88_t",
+        "name": "停车券",
+        "expirationDate": "2023-02-28 23:59:59",
+        "discountFee": 5,
+        "superposition": "1"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneDayDiscountFee": 60,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": true,
+    "maxOneDayCoupons": 5,
+    "remainCoupons": 5,
+    "enablePaperCoupons": false,
+    "maxPointsTime": 666,
+    "enableConsume": false,
+    "enableConsumeSplit": false,
+    "remainConsumeTime": 60,
+    "hourPrice": 5
+  },
+  "parkInfo": {
+    "parkName": "深圳嘉湾汇停车场",
+    "description": "计费基础规则:15分钟内免费,首小时15元,其后每小时5元,全天封顶60元。\r\n嘉湾汇会员停车礼遇:\r\n银卡:每月可免费领取2张首2小时停车券\r\n金卡:每月可免费领取5张首2小时停车券\r\n铂金卡:每月可免费领取10张首2小时停车券\r\n*数量有限,领完即止\r\n仅限开具一个月内的停车费电子发票 ",
+    "parkMallCode": 5
+  }
+}

+ 10 - 3
src/api/parking/index.js

@@ -9,8 +9,9 @@
 //   baseURL: `${window.profileApi}/temporary-parking-service`,
 // });
 
-export function parkingLots(buildingsId) {
-  return window.requestms.get(`/parking-lots/buildings/${buildingsId}`, {
+export function parkingLots(lbsId) {
+  // return window.requestms.get(`/parking-lots/buildings/${buildingsId}`, {
+  return window.requestms.get(`/parking-lots/lbs/${lbsId}`, {
     loading: true,
   });
   // return window.requestms.get(`/`, { params, loading: true });
@@ -23,6 +24,9 @@ export function checkOut(vehicleNo) {
   // 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service/parking/check-out?vehicleNo=浙
   return window.requestms.get(`/parking/check-out?vehicleNo=${vehicleNo}`, {
     loading: true,
+    headers: {
+      buildingId: window.localStorage.getItem('buildingId'),
+    },
   });
 }
 
@@ -41,10 +45,13 @@ export function orders(params) {
 export function calculateDiscount(params) {
   return window.requestms.post(`/parking/calculate-discount`, params, {
     loading: true,
+    header: {
+      buildingId: window.localStorage.getItem('buildingId'),
+    },
   });
 }
 
 // 1.13 下单并发起支付
 export function ordersAndPrepay(params) {
-  return window.requestms.post(`/orders-and-prepay`, params, { loading: true });
+  return window.requestms.post(`/parking/orders-and-prepay`, params, { loading: true });
 }

+ 80 - 38
src/api/request.js

@@ -1,5 +1,5 @@
-import uni from "@/utils/uniHooks";
-import { getUTMSource } from "@/utils/utils";
+import uni from '@/utils/uniHooks';
+import { getUTMSource } from '@/utils/utils';
 import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
 // import { Message } from 'element-ui';
 // import { jumpLogin } from '@/utils';
@@ -8,7 +8,7 @@ import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
 // import vm from "@/main";
 import { Toast } from 'vant';
 import vue from 'vue';
-import store from '@/store'
+import store from '@/store';
 import { v4 as uuidv4 } from 'uuid';
 
 let loadingInstance = null;
@@ -79,6 +79,64 @@ const cancelLoading = () => {
   if (requestNum === 0) loadingInstance?.clear();
 };
 
+function XUser(config) {
+  /*'X-User': JSON.stringify({"userId": "5106534569910475","sourceType": "WECHAT","nickName": "yedUsFwdkelQbxeTeQOvaScfqIOOmaa","mobile": "18521563898","projectId": "paroject1","buildingId": "shenzhen01","cid": "8aaa809d835ba76d018378bc57180006","vipCode":"KERRY100213505"})*/
+  /*'X-User': JSON.stringify({
+   // userId: store.state.member.id, // K+用户ID
+   userId: '36cec68f3a9a4f4b9e04a59268ba20f2', // K+用户ID
+   sourceType: 'WECHAT', // 登录来源: WECHAT/ALIPAY/H5/APP
+   cId: store.state.openid, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+   // projectId: store.state.member.groupId, // 楼盘id
+   projectId: store.state.projectId || '4028e3817c2b3f79017c2b48c54c0000', // 楼盘id
+   // buildingId: store.state.member.mallid, // 楼栋id
+   // buildingId: '8aaa80b47c784020017c78b00d060022', // 楼栋id
+   // buildingId: store.state.buildingId || 'shenzhen01', // 楼栋id
+   buildingId: store.state.buildingId || 'QHKC-P1', // 楼栋id
+   phoneNumber: store.state.mobile, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+   // vipCode: store.state.member.vipcode, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+   // vipCode: 'KERRY100213815', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+   vipCode: 'KERRY100213505', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+   lbsId: '8aaa87bc7ce98224017ce995fd8a0002', // 楼盘ID
+   })*/
+  // console.log('101101101101',  store.state.member);
+  const params = {
+    // userId: '8aaa828583bbbc030183cf34b536000a',
+    userId: store.state.kipUserId, // K+用户ID
+    sourceType: 'WECHAT',
+    // phoneNumber: '18521563898',
+    phoneNumber: store.state.mobile, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+    // projectId: 'paroject1',
+    projectId: store.state.projectId || '4028e3817c2b3f79017c2b48c54c0000', // 楼盘id
+    // buildingId: 'shenyang01',
+    // buildingId: window.localStorage.getItem('buildingId'),
+    // brandId: store.state.mallId,
+    // brandId: '8aaa81947c6e1ca0017c73c13cc30006',
+    brandId: store.state.brandId,
+    // cid: '8aaa809d835ba76d018378bc57180006',
+    cId: store.state.openid, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+    // vipCode: 'KERRY100213505',
+    vipCode: store.state.member.vipcode, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+    // vipCode: 'KERRY100213853', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+    lbsId: '8aaa82ea804d07cd0180516ff03b0008',
+    // lbsId: store.state.lbsId,
+  };
+  /*const params = {
+   userId: '5106534569910475',
+   sourceType: 'WECHAT',
+   nickName: 'yedUsFwdkelQbxeTeQOvaScfqIOOmaa',
+   mobile: '18521563898',
+   projectId: 'paroject1',
+   buildingId: 'shenyang01',
+   cid: '8aaa809d835ba76d018378bc57180006',
+   vipCode: 'KERRY100213853',
+   lbsId: '8aaa82ea804d07cd0180516ff03b0008',
+   };*/
+  if (/orders-and-prepay|calculate-discount/.test(config.url)) {
+    params.buildingId = window.localStorage.getItem('buildingId');
+  }
+  return JSON.stringify(params);
+}
+
 export const createAxiosByinterceptors = (config) => {
   const instance = axios.create({
     timeout: 100000, //超时配置
@@ -92,31 +150,15 @@ export const createAxiosByinterceptors = (config) => {
     function (config) {
       // 在发送请求之前做些什么
       const { loading = true } = config;
-      console.log('config:', config);
+      console.log('configconfig:', config);
       if (loading) addLoading();
       // 设置 headers
       config.headers = {
         ...config.headers,
         ...handleConfig().header,
-        'X-Conversation-Id': uuidv4(),
-        /*'X-User': JSON.stringify({"userId": "5106534569910475","sourceType": "WECHAT","nickName": "yedUsFwdkelQbxeTeQOvaScfqIOOmaa","mobile": "18521563898","projectId": "paroject1","buildingId": "shenzhen01","cid": "8aaa809d835ba76d018378bc57180006","vipCode":"KERRY100213505"})*/
-        'X-User': JSON.stringify({
-          // userId: store.state.member.id, // K+用户ID
-          userId: '36cec68f3a9a4f4b9e04a59268ba20f2', // K+用户ID
-          sourceType: 'WECHAT', // 登录来源: WECHAT/ALIPAY/H5/APP
-          cId: store.state.openid, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
-          // projectId: store.state.member.groupId, // 楼盘id
-          projectId: store.state.projectId || '4028e3817c2b3f79017c2b48c54c0000', // 楼盘id
-          // buildingId: store.state.member.mallid, // 楼栋id
-          // buildingId: '8aaa80b47c784020017c78b00d060022', // 楼栋id
-          // buildingId: store.state.buildingId || 'shenzhen01', // 楼栋id
-          buildingId: store.state.buildingId || 'QHKC-P1', // 楼栋id
-          phoneNumber: store.state.mobile, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
-          // vipCode: store.state.member.vipcode, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
-          // vipCode: 'KERRY100213815', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
-          vipCode: 'KERRY100213505', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
-        })
-      }
+        'XConversationId': uuidv4(),
+        'X-User': XUser(config),
+      };
       // console.log(111111, config.headers, handleConfig().header)
       // console.log(111111, handleConfig().header)
       // console.log(123, config);
@@ -139,19 +181,19 @@ export const createAxiosByinterceptors = (config) => {
       console.log('62response', response);
       // TODO: 临时注释
       // Promise.reject(response.data)
-      return response.data
+      return response.data;
       /*if (code === 200) return data;
-      else if (code === 401) {
-        // 跳转到登陆
-        // jumpLogin();
-      } else {
-        // 错误信息提示
-        // Message.error(message);
-        Toast({
-          message: message,
-        });
-        return Promise.reject(response.data);
-      }*/
+       else if (code === 401) {
+       // 跳转到登陆
+       // jumpLogin();
+       } else {
+       // 错误信息提示
+       // Message.error(message);
+       Toast({
+       message: message,
+       });
+       return Promise.reject(response.data);
+       }*/
     },
     function (error) {
       // console.log(158, error.response.data)
@@ -170,9 +212,9 @@ export const createAxiosByinterceptors = (config) => {
         }
       }
       // 错误信息提示
-      const {code, langMessage } = error.response.data
-      if ( code === 'INTERNAL_SERVER_ERROR') {
-        uni.showToast({title:langMessage, duration: 3000,icon: 'fail'})
+      const { code, langMessage } = error.response.data;
+      if (code === 'INTERNAL_SERVER_ERROR') {
+        uni.showToast({ title: langMessage, duration: 3000, icon: 'fail' });
       }
       // Message.error(error?.response?.data?.message || '服务端异常');
       return Promise.reject(error.response.data);

+ 5 - 5
src/pages/parkingFee/components/base/parkingFeeDetail.vue

@@ -1,5 +1,5 @@
 <template>
-  <scroll-view class="scroll-Y">
+  <scroll-view class="scroll-Y" v-if="orderDetail && orderDetail.parkingRecord && orderDetail.parkingRecord.vehicleNo">
     <div>
       <!--    <wx-points-commit ref="wxPointsCommit"></wx-points-commit>-->
 
@@ -16,15 +16,15 @@
         </div>
         <div class="warp_index">
           <div>停车场</div>
-          <div class="warp_index_color">{{ orderDetail.parkInfo.parkname }}</div>
+          <div class="warp_index_color">{{ orderDetail.parkInfo.parkName }}</div>
         </div>
         <div class="warp_index">
           <div>入场时间</div>
-          <div class="warp_index_color">{{ orderDetail.parkInfo.entertime }}</div>
+          <div class="warp_index_color">{{ orderDetail.parkingRecord.enterTime }}</div>
         </div>
         <div class="warp_index">
           <div>已停车时长</div>
-          <div class="warp_index_color">{{ orderDetail.parkingRecord.serviceMin }}</div>
+          <div class="warp_index_color">{{ orderDetail.parkingRecord.serviceMin | parkingTime}}</div>
         </div>
         <div class="warp_index">
           <div>应缴</div>
@@ -134,7 +134,7 @@
         <div class="popue_box_index1">积分减免</div>
         <div class="popue_box_index">
           <div>减免规则</div>
-          <div style="color: #989898">{{ pointsPerHour }}积分抵扣{{ orderDetail.parkInfo.parkMallCode === 5 ? integralToValue + '元' : '1小时' }}</div>
+          <div style="color: #989898">{{ pointsPerHour }}积分抵扣{{ orderDetail.parkInfo.parkMallCode === 5 ? unitAmount + '元' : '1小时' }}</div>
         </div>
         <div class="popue_box_index">
           <div style="font-weight: 700">可用积分</div>

+ 2 - 2
src/pages/parkingFee/components/base/parkingFeeList.vue

@@ -18,14 +18,14 @@
         class="choice_card"
         v-for="(item, index) in list"
         :key="index"
-        @click="toDetail(item.orderNo)"
+        @click="toDetail(item.id)"
       >
         <div
           class="choice_card_index choice_card_index1"
           style="font-size: 30px; margin: 0 12px"
         >
           <div style="margin-left: 6px">
-            {{ item.orderNo + '-' + item.vehicleNo }}
+            {{ item.id + '-' + item.vehicleNo }}
           </div>
           <div style="color: red; margin-right: 6px">
             {{ (item.actualPayFee / 100) | currency }}

+ 14 - 48
src/pages/parkingFee/components/officeBlue/parkingFeeDiscounts.vue

@@ -1,39 +1,21 @@
 <template>
   <div>
     <scroll-view scroll-y="true" class="scroll-Y">
-      <van-checkbox-group
-        v-model="checkedList"
-        @change="checkboxChange"
-        checked-color="#064C8A"
-      >
-        <div class="container" v-if="parkInfoEntity.memberLevelReduce">
+      <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">
-              {{ memberDiscount.memberOrderdesc || '' }}减免{{
-                memberDiscount.reduceContent || 0
-              }}小时。可优惠{{ memberDiscountFee || 0 }}元
-            </div>
+            <div class="content">{{ memberGrade.memberGradeText || '' }}减免{{ memberGrade.discountTime || 0 }}小时。可优惠{{ memberGrade.discountFee || 0 }}元</div>
           </div>
-          <van-checkbox
-            color="#fff"
-            name="member"
-            :disabled="
-              (!isCheck('member') && isDiscountDisabled) ||
-              isMemberDiscountDisabled ||
-              memberDiscount.reduceContent <= 0
-            "
-          />
+          <van-checkbox color="#fff" name="member" :disabled="isCheck('member')" />
           <!-- :checked="isCheck('member')" -->
-          <div class="member-discount-info" v-if="isMemberDiscountDisabled">
-            当日已使用
-          </div>
+          <div class="member-discount-info" v-if="isMemberDiscountDisabled">当日已使用</div>
         </div>
-        <div class="container" v-if="isShowReduceDiscount">
+        <div class="container" v-if="enableConsume">
           <div class="item">
             <div class="title">消费减免</div>
             <!-- <uni-view class="content" v-if="parkInfoEntity.parkMallCode === 1 && parkInfoEntity.expirationDate">{{reduceDiscountMessage}}</uni-view> -->
-            <div class="content" v-if="parkInfoEntity.parkMallCode !== 1">
+            <div class="content" v-if="orderDetail.parkInfo.parkMallCode !== 1">
               {{ todayReduceDiscountMessage }}
             </div>
             <uni-number-box
@@ -44,33 +26,16 @@
               @input="reducesChange"
             ></uni-number-box>
           </div>
-          <van-checkbox
-            name="reduces"
-            color="#fff"
-            :disabled="
-              (!isCheck('reduces') && isDiscountDisabled) ||
-              !reducesDiscount.recuceContent
-            "
-          />
+          <van-checkbox name="reduces" color="#fff" :disabled="isCheck('reduces')" />
           <!-- :checked="isCheck('reduces')" -->
         </div>
       </van-checkbox-group>
     </scroll-view>
     <div class="flewx">
       <div class="flewx-content">
-        合计<span
-          style="
-            color: #333;
-            font-weight: 600;
-            font-size: 36px;
-            padding-left: 0px;
-          "
-          >{{ actualFee | currency }}</span
-        >
+        合计<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"
-          >已优惠{{ discountFee | currency }}元</span
-        >
+        <span style="color: #999; padding-left: 0px; font-size: 28px">已优惠{{ usingTotalDiscount | currency }}元</span>
       </div>
       <div class="flewx_index3" @click="confirm">确定</div>
     </div>
@@ -78,10 +43,11 @@
 </template>
 
 <script>
-import parkingFeeDiscountsJs from '../../mixins/parkingFeeDiscounts'
+import parkingFeeDiscountsJs from '../../mixins/parkingFeeDiscounts';
+
 export default {
-  mixins:[parkingFeeDiscountsJs]
-}
+  mixins: [parkingFeeDiscountsJs],
+};
 </script>
 
 <style lang="less" scoped>

+ 2 - 2
src/pages/parkingFee/components/officeBlue/parkingFeeList.vue

@@ -17,7 +17,7 @@
         :class="['choice_card', index === 0 && 'mt30']"
         v-for="(item, index) in list"
         :key="index"
-        @click="toDetail(item.orderNo)"
+        @click="toDetail(item.id)"
       >
         <div class="carno-box">
           <div class="carno">{{ item.vehicleNo }}</div>
@@ -25,7 +25,7 @@
         </div>
         <div class="choice_card_index">{{ item.parkName }} </div>
         <div class="choice_card_index orderno-box">
-          <div class="orderno">订单号 : {{ item.orderNo }}</div>
+          <div class="orderno">订单号 : {{ item.id }}</div>
           <van-icon name="arrow" />
         </div>
         <div class="choice_card_index">

+ 1033 - 0
src/pages/parkingFee/components/purple/parkingFee.vue

@@ -0,0 +1,1033 @@
+<template>
+  <scroll-view :class="{ 'scroll-Y': true, 'color-scroll-Y': custTypeId !== 0 }">
+    <!--    <wx-points-commit ref='wxPointsCommit'></wx-points-commit>-->
+    <!--    <authorize ref="authorize"></authorize>-->
+    <!--    <my-protocol-modal ref="szProtocolModal" title="会员协议政策更新提示"></my-protocol-modal>-->
+    <div class="wrap">
+      <div class="parkingFee">
+        <!--        <div>{{ `url(${picUrl}${blueHeadBg});` }}:{{ typeof custTypeId }}:{{ custTypeId }}</div>-->
+        <!--        <img :src="`${picUrl}${blueHeadBg}`" alt="">-->
+        <!-- 菜单 -->
+        <div
+          :class="{
+            top_menu: true,
+            blue_top_menu: custTypeId === 1,
+            green_top_menu: custTypeId === 2,
+          }"
+          v-if="custTypeId >= 0"
+        >
+          <div class="menu_item" @click="doRouter">
+            <img :src="`${require(`../../static/images/icon-order.png`)}`" />
+            <span>缴费记录</span>
+          </div>
+          <div class="menu_item" @click="doRouter3">
+            <img :src="`${require(`../../static/images/icon-coupon.png`)}`" />
+            <span>停车劵兑换</span>
+          </div>
+          <div class="menu_item" @click="doRouter1">
+            <img :src="`${require(`../../static/images/icon-ticket.png`)}`" />
+            <span>停车开票</span>
+          </div>
+          <div class="menu_item" @click="doRouter2">
+            <img :src="`${require(`../../static/images/icon-car.png`)}`" />
+            <span>车辆管理</span>
+          </div>
+        </div>
+        <!-- 中控 -->
+        <div class="parkingFee-bottom">
+          <div class="parkingFee-tab">
+            <div :class="['bar', tabbarActive === '手动缴费' && 'active']" @click="tabbarActiveEvent('手动缴费')">手动缴费</div>
+            <div :class="['bar', tabbarActive === '无牌缴费' && 'active']" @click="tabbarActiveEvent('无牌缴费')">无牌缴费</div>
+          </div>
+          <!-- 手动缴费 -->
+          <div class="manual-box" v-if="tabbarActive === '手动缴费'">
+            <div class="parkingFee-search">
+              <div class="search_tip">
+                <div class="title">车辆类型</div>
+                <div class="search_tip_pt">
+                  <div :class="carType == 0 ? 'search_tip_pt_index' : ''" @click="toggleType(0)">普通车牌</div>
+                  <div :class="carType == 1 ? 'search_tip_pt_index' : ''" @click="toggleType(1)">新能源</div>
+                  <div :class="carType == 2 ? 'search_tip_pt_index' : ''" @click="toggleType(2)">特殊车牌</div>
+                </div>
+              </div>
+              <div class="input-box">
+                <!-- <div v-for="i in carType === 1 ? 8 : 7" class="li" :key="`numArr${i}`" @click="clickShowKeyboard(i)" :class="[active === i ? 'active' : '']">
+                  {{ numArr[i] }}
+                </div> -->
+                <div class="li" @click="clickShowKeyboard(0)" :class="[active === 0 ? 'active' : '']">
+                  {{ numArr[0] }}
+                </div>
+                <div class="li" @click="clickShowKeyboard(1)" :class="[active === 1 ? 'active' : '']">
+                  {{ numArr[1] }}
+                </div>
+                <div class="input_box_dian">·</div>
+                <div class="li" @click="clickShowKeyboard(2)" :class="[active === 2 ? 'active' : '']">
+                  {{ numArr[2] }}
+                </div>
+                <div class="li" @click="clickShowKeyboard(3)" :class="[active === 3 ? 'active' : '']">
+                  {{ numArr[3] }}
+                </div>
+                <div class="li" @click="clickShowKeyboard(4)" :class="[active === 4 ? 'active' : '']">
+                  {{ numArr[4] }}
+                </div>
+                <div class="li" @click="clickShowKeyboard(5)" :class="[active === 5 ? 'active' : '']">
+                  {{ numArr[5] }}
+                </div>
+                <div class="li" @click="clickShowKeyboard(6)" :class="[active === 6 ? 'active' : '']">
+                  {{ numArr[6] }}
+                </div>
+                <div class="li" @click="clickShowKeyboard(7)" :class="[active === 7 ? 'active' : '']" v-if="carType == 1">
+                  <span v-if="numArr[7]">{{ numArr[7] }}</span>
+                </div>
+              </div>
+              <div type="primary" class="search-btn" :class="disabledBtn ? 'disabled-btn' : ''" :disabled="disabledBtn" @click="preHandleSearch">查询缴费</div>
+            </div>
+            <div class="vehicleMgt-list">
+              <div class="vehicleMgt-title">
+                <div>历史车辆</div>
+                <!-- <image src="./static/images/icon5.png" class="vehicleMgt-title-img"/> -->
+              </div>
+              <div class="vehicleMgt-content" v-if="carList.length">
+                <div class="item" v-for="(item, index) in carList" :key="index" @click="toHandleSearch(item, 1)" :class="vehicleNumber == item ? 'vehicleMgt-content_cls' : ''">
+                  {{ item | formatCarno }}
+                </div>
+              </div>
+            </div>
+          </div>
+
+          <!-- 无牌缴费 -->
+          <div class="unlicensed-box">无牌车</div>
+        </div>
+        <div
+          class="parkingFee-top"
+          :style="{
+            color: '#999',
+            background: `url(${require('../../static/images/parking-bgi.png')})`,
+            a: 'url()',
+            backgroundAttachment: 'fixed',
+          }"
+        >
+          <div
+            :class="{
+              top_content: true,
+              blue_top_content: custTypeId === 1,
+              green_top_content: custTypeId === 2,
+            }"
+            :style="{
+              'background-image': custTypeId === 1 ? `url(${picUrl}${blueHeadBg})` : '',
+            }"
+          >
+            <div class="title_box">
+              <span class="btn">缴费说明</span>
+            </div>
+            <div class="info" :class="!init_ch ? 'info_show' : ''">
+              <span>{{ description }}</span>
+            </div>
+          </div>
+          <div class="top_down" @click="top_display" v-if="!init_ch && description && description.length > 60">︾</div>
+          <div class="top_down" @click="top_display" v-else>︽</div>
+        </div>
+      </div>
+      <plate-number ref="plateKeyboard" :carType="carType" :active="active" :ind="ind" :numArr="numArr" @carnoArr="updateCarno"></plate-number>
+    </div>
+  </scroll-view>
+</template>
+
+<script>
+import parkingFeeJs from '../../mixins/parkingFee';
+
+export default {
+  mixins: [parkingFeeJs],
+  name: 'parkingFeeCom',
+};
+</script>
+
+<style lang="less" scoped>
+//@import '../../styles/mixins.less';
+.scroll-Y {
+  width: 100%;
+  // display: flex;
+  // flex-direction: column;
+  height: 100vh;
+}
+
+.color-scroll-Y {
+  background: #f5f7fe;
+}
+
+.wrap {
+  display: flex;
+  flex-direction: column;
+  width: 100%;
+
+  .parkingFee {
+    display: flex;
+    flex-direction: column;
+
+    .top_menu {
+      //margin-top: 10px;
+      background: #fff;
+      //padding-top: 50px;
+      box-sizing: border-box;
+      display: flex;
+      justify-content: space-between;
+      //border-radius: 15px;
+      // position: absolute;
+      // left: 50%;
+      //box-shadow: 0 0 5px #666;
+      // transform: translateX(-50%);
+      //top: 160px;
+      //width: 700px;
+      //margin-left: 25px;
+      padding-top: 34px;
+      margin-bottom: 20px;
+      //height: 250px;
+      padding-bottom: 30px;
+
+      .menu_item {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        width: 33.3%;
+
+        img {
+          width: 100px;
+          height: 100px;
+          margin-bottom: 2px;
+        }
+
+        span {
+          font-size: 30px;
+          margin-top: 10px;
+          color: #333333;
+          font-size: 28px;
+        }
+      }
+    }
+
+    .parkingFee-bottom {
+      width: 100%;
+      display: flex;
+      flex-direction: column;
+      box-sizing: border-box;
+      // tabber 切换
+      .parkingFee-tab {
+        padding-top: 46px;
+        padding-left: 27px;
+        padding-bottom: 50px;
+        background-color: #ffffff;
+        display: flex;
+        align-items: flex-end;
+
+        .bar {
+          color: #666666;
+          font-size: 32px;
+
+          &:nth-child(1) {
+            margin-right: 24px;
+          }
+
+          &.active {
+            font-size: 38px;
+            color: #333333;
+            font-weight: 600;
+          }
+        }
+      }
+
+      // 车牌号查询
+      .parkingFee-search {
+        width: 100%;
+        display: flex;
+        flex-direction: column;
+        background: #fff;
+        //border-radius: 15px;
+        //padding: 26px 25px 20px;
+        box-sizing: border-box;
+
+        .search_tip {
+          width: 100%;
+          margin-left: -1px;
+          display: flex;
+          justify-content: flex-start;
+          align-items: center;
+          padding-right: 30px;
+          margin-bottom: 40px;
+
+          .title {
+            font-size: 30px;
+            color: #333333;
+            padding-left: 27px;
+            margin-right: 33px;
+          }
+
+          .search_tip_pt {
+            font-size: 28px;
+            margin-right: 30px;
+            flex: 1;
+            display: flex;
+            justify-content: space-around;
+            align-items: center;
+            border: 1px solid #999999;
+            height: 60px;
+            color: #999999;
+            overflow: hidden;
+            border-radius: 90px;
+
+            div {
+              height: 100%;
+              width: 100%;
+              border-radius: 90px;
+              line-height: 62px;
+              text-align: center;
+            }
+
+            .search_tip_pt_index {
+              color: #fff;
+              //background-image: linear-gradient(to right, #7e4fa1, #433c7f);
+              background-color: #644a79;
+            }
+          }
+        }
+
+        // 车牌号 & 虚拟键盘
+        .input-box {
+          width: 100%;
+          flex: 1;
+          display: flex;
+          margin-bottom: 40px;
+          padding: 0 17px;
+          justify-content: center;
+          box-sizing: border-box;
+
+          .li {
+            width: 100%;
+            border: 1px solid #D9DBE0;
+            box-sizing: border-box;
+            height: 90px;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            color: #333333;
+            background-color: #f4f7ff;
+            border-radius: 4px;
+            font-size: 40px;
+            margin: 0 3px;
+
+            &:nth-child(9) {
+              background-color: #fafbff;
+              border-style: dashed;
+            }
+
+            &.active {
+              border-color: #3e67ff;
+            }
+          }
+
+          .input_box_dian {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            font-size: 120px;
+            height: 70px;
+            //line-height: 20px;
+            color: #644a79;
+          }
+        }
+
+        .search-btn {
+          color: #fff;
+          margin: 0 auto;
+          height: 90px;
+          width: calc(100% - 60px);
+          line-height: 90px;
+          border-radius: 80px;
+          font-size: 36px;
+          text-align: center;
+          //background-image: linear-gradient(to right, #7e4fa1, #433c7f);
+          background-color: #644a79;
+          margin-bottom: 43px;
+        }
+
+        .disabled-btn {
+          background-color: #c1c1c1 !important;
+          //background-image: none !important;
+        }
+      }
+
+      .vehicleMgt-list {
+        display: flex;
+        flex-direction: column;
+        margin-bottom: 35px;
+        //margin-top: 20px;
+        //padding-top: 20px;
+        background-color: #ffffff;
+
+        .vehicleMgt-title {
+          //width: 91%;
+          padding-left: 27px;
+          display: flex;
+          text-align: left;
+          justify-content: space-between;
+          //margin-left: 4%;
+          // padding-left: 30px;
+          //padding-top: 30px;
+          box-sizing: border-box;
+          border-top: 1px solid #f2f2f2;
+          font-size: 30px;
+
+          .vehicleMgt-title-img {
+            width: 30px;
+            height: 30px;
+          }
+        }
+
+        .vehicleMgt-content {
+          width: 94%;
+          margin-left: 3%;
+          display: flex;
+          flex-wrap: wrap;
+          // justify-content: space-around;
+          border-radius: 15px;
+
+          .item {
+            width: 30%;
+            height: 60px;
+            margin-top: 30px;
+            margin-left: 16px;
+            text-align: center;
+            box-sizing: border-box;
+            border: 2px solid #dcdcdc;
+            line-height: 60px;
+            font-size: 26px;
+            border-radius: 10px;
+            color: #a5a5a5;
+          }
+
+          .vehicleMgt-content_cls {
+            color: #703a98;
+            border: 2px solid #703a98;
+          }
+
+          // .item::after {
+          // 	content: '';
+          // 	display: block;
+          // 	height: 1px;
+          // 	width: 92%;
+          // 	position: absolute;
+          // 	background-color: #F2F2F2;
+          // 	bottom: 0px;
+          // 	left: 4%;
+          // }
+          // .item:last-child::after {
+          // 	display: none;
+          // }
+        }
+      }
+
+      .search-list {
+        display: flex;
+        flex-direction: column;
+        background: #fff;
+        padding: 0 30px;
+        box-sizing: border-box;
+        margin-top: 20px;
+        border-radius: 15px;
+        width: 100%;
+
+        .list_item {
+          padding: 38px 0;
+          box-sizing: border-box;
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          border-bottom: 1px solid #f2f2f2;
+
+          span {
+            font-size: 28px;
+          }
+
+          button {
+            height: 60px;
+            line-height: 60px;
+            margin: 0;
+          }
+        }
+      }
+    }
+
+    .parkingFee-top {
+      display: flex;
+      flex-direction: column;
+      background-size: 100% 30%;
+      // height: 350px;
+      // margin-bottom: 25px;
+
+      .top_content {
+        padding: 25px 35px;
+        box-sizing: border-box;
+        display: flex;
+        flex-direction: column;
+
+        span {
+          font-size: 24px;
+          color: #898989;
+          text-align: left;
+        }
+
+        .title_box {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          margin-bottom: 20px;
+
+          .btn {
+            padding: 0px 14px;
+            box-sizing: border-box;
+            border-radius: 20px;
+            font-size: 30px;
+            color: #000;
+            text-align: center;
+          }
+        }
+
+        .info {
+          padding-left: 18px;
+          font-size: 27px;
+          width: 95%;
+          color: #666;
+          line-height: 45px;
+        }
+
+        .info_show {
+          word-break: break-all;
+          text-overflow: ellipsis;
+          overflow: hidden;
+          display: -webkit-box;
+          -webkit-line-clamp: 2;
+          -webkit-box-orient: vertical;
+        }
+      }
+
+      .blue_top_content {
+        .color_top_content('blue');
+        background-position: 0 0;
+        background-size: 100% 100%;
+        background-repeat: no-repeat;
+      }
+
+      .green_top_content {
+        .color_top_content('green');
+      }
+
+      .color_top_content(@value) {
+        @color: 'color-@{value}';
+        background-color: @@color;
+        span {
+          color: @color-white;
+        }
+        .title_box {
+          .btn {
+            color: @color-gold;
+          }
+        }
+        .info {
+          font-size: 24px;
+        }
+      }
+
+      .top_down {
+        width: 100%;
+        text-align: center;
+        color: #b0a9a9;
+      }
+    }
+
+    .blue_top_menu {
+      .color_top_menu('blue');
+      background: @color-pink;
+    }
+
+    .green_top_menu {
+      .color_top_menu('green');
+      background: @color-light-green;
+    }
+
+    .color_top_menu(@value) {
+      @color: 'color-@{value}';
+      margin-top: 0;
+      margin-left: 0;
+      padding-top: 0;
+      width: 100%;
+      height: 211px;
+      color: @@color;
+      border-radius: 0;
+      align-items: center;
+      .menu_item {
+        width: 25%;
+
+        image {
+          width: 83px;
+          height: 83px;
+        }
+
+        span {
+          font-size: 24px;
+          margin-top: 20px;
+        }
+      }
+    }
+  }
+}
+
+// 缴费说明
+.payInstruct_wrap {
+  width: 300px;
+  margin: 0 auto;
+  display: flex;
+  flex-direction: column;
+  background: #fff;
+  border-radius: 20px;
+
+  .scroll {
+    height: 600px;
+    display: flex;
+    flex-direction: column;
+    padding: 20px;
+    box-sizing: border-box;
+
+    .payInstruct_title {
+      font-size: 30px;
+      text-align: center;
+      padding: 20px 0;
+      box-sizing: border-box;
+      border-bottom: 1px solid #f2f2f2;
+    }
+
+    .payInstruct_con {
+      display: flex;
+      width: 100%;
+      padding: 20px 10px;
+      box-sizing: border-box;
+
+      span {
+        font-size: 28px;
+        color: #999;
+      }
+    }
+  }
+}
+
+.class-van-button-small {
+  min-width: 0;
+  border-radius: 10px;
+  margin: 10px 3px;
+  box-shadow: 10px 10px 10px #aaa;
+}
+
+.class-plate-box {
+  width: 100%;
+  padding: 24px 0;
+  box-sizing: border-box;
+  position: relative;
+}
+
+.plate_number {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+
+  .plate_number_wrap {
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    background: #eaf1f9;
+    padding: 0 0 10px;
+    box-sizing: border-box;
+
+    .close-box {
+      width: 100%;
+      font-size: 24px;
+      color: #3e67ff;
+      text-align: right;
+      margin-right: 1.25rem;
+
+      div {
+        padding: 10px;
+      }
+    }
+
+    .plate_chinese_box {
+      width: 100%;
+      display: flex;
+      flex-wrap: wrap;
+      justify-content: center;
+
+      button {
+        width: 9%;
+        height: 2.5rem;
+        line-height: 2.5rem;
+        text-align: center;
+        padding: 0;
+        font-size: 28px;
+        .class-van-button-small;
+      }
+    }
+  }
+}
+
+.allBoard {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+
+  .allBoard_wrap {
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    background: #eaf1f9;
+    padding: 0 0 10px;
+    box-sizing: border-box;
+  }
+
+  .close-box {
+    padding-top: 22px;
+    box-sizing: border-box;
+    font-size: 24px;
+    color: #3e67ff;
+    text-align: right;
+    margin-right: 1.25rem;
+  }
+
+  .plate_number_box {
+    width: 100%;
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: center;
+
+    button {
+      width: 9%;
+      height: 2.5rem;
+      line-height: 2.5rem;
+      text-align: center;
+      padding: 0;
+      font-size: 28px;
+      .class-van-button-small;
+    }
+  }
+}
+
+.delBtn {
+  color: #fff;
+  height: 38px;
+  line-height: 38px;
+  font-size: 20px;
+  width: 124px;
+  border-radius: 7px;
+  text-align: center;
+  padding: 4px;
+  background-color: #c69c6d;
+}
+
+.payThe {
+  background-color: #fff;
+  width: 100%;
+
+  .pay_index {
+    text-align: center;
+    width: 200px;
+    padding-top: 10px;
+    margin: 0px auto;
+  }
+
+  .pay_title {
+    width: 500px;
+    display: flex;
+    align-items: center;
+    margin-top: 30px;
+  }
+
+  .pay_title1 {
+    width: 100%;
+    margin-top: 20px;
+    display: flex;
+    align-items: center;
+  }
+
+  .pay_title_yhj {
+    margin-left: 60px;
+    font-size: 20px;
+  }
+
+  .pay_title_yhj1 {
+    margin-left: 35px;
+    font-size: 20px;
+  }
+
+  .payjf {
+    font-size: 20px;
+    margin-left: 30px;
+  }
+
+  .paySelect {
+    color: rgba(16, 16, 16, 100);
+    font-size: 20px;
+    font-family: Arial;
+    border: 1px solid rgba(187, 187, 187, 100);
+    border-radius: 10px;
+    margin-left: 80px;
+    width: 260px;
+    height: 80px;
+  }
+
+  .paySelect1 {
+    color: rgba(16, 16, 16, 100);
+    font-size: 20px;
+    font-family: Arial;
+    border: 1px solid rgba(187, 187, 187, 100);
+    border-radius: 10px;
+    margin-left: 80px;
+    width: 260px;
+    height: 80px;
+    display: flex;
+    align-items: center;
+  }
+
+  .pay-se {
+    width: 120px;
+    height: 100%;
+    background-color: #d8dce6;
+
+    .pay-se-l {
+      height: 48%;
+      text-align: center;
+      font-size: 50px;
+      line-height: 68px;
+    }
+
+    .pay-se-l1 {
+      border-left: 1px solid rgba(187, 187, 187, 100);
+      border-bottom: 1px solid rgba(187, 187, 187, 100);
+    }
+
+    .pay-se-l2 {
+      border-left: 1px solid rgba(187, 187, 187, 100);
+    }
+  }
+
+  .payjfzk {
+    font-size: 20px;
+    color: #8b8c8b;
+    margin-top: 10px;
+    margin-left: 210px;
+  }
+
+  .pay_time {
+    font-size: 28px;
+    margin-left: 180px;
+    padding-bottom: 40px;
+  }
+
+  .pay_time1 {
+    margin-top: 26px;
+  }
+}
+
+.pay_jiaof {
+  width: 97%;
+  height: 60px;
+  line-height: 60px;
+  margin-left: 10px;
+  background-color: #c69c6d;
+  text-align: center;
+  color: rgba(255, 255, 255, 100);
+  font-size: 28px;
+  font-family: Microsoft Yahei;
+  border-radius: 10px;
+  margin-top: 20px;
+}
+
+.sq_content {
+  width: 700px;
+  background-color: #fff;
+  position: fixed;
+  bottom: 25px;
+  left: 25px;
+  height: 50px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  border-radius: 15px;
+  font-size: 16px;
+  color: #c69c6d;
+  padding: 0px 30px;
+  box-sizing: border-box;
+}
+
+.sq_content .btn {
+  width: 180px;
+  height: 30px;
+  line-height: 30px;
+  text-align: center;
+  color: #fff;
+  background-color: #c69c6d;
+  margin-top: -3px;
+  border-radius: 25px;
+}
+
+// 停车券弹窗
+.ticketPopup {
+  display: flex;
+  flex-direction: column;
+  background: #fff;
+  border-radius: 20px 20px 0 0;
+  z-index: 999;
+
+  .popup-title {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    padding: 30px 42px;
+    box-sizing: border-box;
+    border-bottom: 1px solid #f2f2f2;
+    position: relative;
+
+    span {
+      color: #999;
+      font-size: 28px;
+    }
+
+    .useRule-text {
+      position: absolute;
+      right: 42px;
+      color: rgb(58, 130, 248);
+    }
+  }
+
+  .popup_scroll {
+    height: 70vh;
+    background: #f2f2f2;
+  }
+
+  .popup_content {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    padding: 10px 20px;
+    box-sizing: border-box;
+
+    .item {
+      display: flex;
+      background: #fff;
+      margin-bottom: 20px;
+      border-radius: 10px;
+
+      .item-left {
+        flex: 1;
+        display: flex;
+        align-items: center;
+        padding: 20px 0;
+        box-sizing: border-box;
+        position: relative;
+
+        .item-type {
+          position: absolute;
+          top: 0;
+          left: 0;
+          background: #fff5f1;
+          border-radius: 10px 0 10px 0;
+          width: 205px;
+          display: flex;
+          justify-content: center;
+
+          span {
+            color: #999;
+            font-size: 20px;
+            text-align: center;
+            line-height: 28px;
+          }
+        }
+
+        .item-value {
+          color: #c69c6d;
+          font-size: 40px;
+          padding: 10px 30px;
+          box-sizing: border-box;
+          width: 205px;
+          display: flex;
+          justify-content: center;
+
+          .b {
+            color: #c69c6d;
+            font-weight: 600;
+            font-size: 60px;
+          }
+        }
+
+        .color_disabled {
+          color: #999 !important;
+        }
+      }
+
+      .item-right {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        border-radius: 0 8px 8px 0;
+        position: relative;
+
+        span {
+          color: #c69c6d;
+          font-size: 24px;
+          padding: 0 20px;
+          box-sizing: border-box;
+        }
+
+        .color_disabled {
+          color: #999;
+        }
+
+        // 对勾
+        .dot {
+          position: absolute;
+          top: 0;
+          right: 0;
+          width: 2.25rem;
+          height: 2.375rem;
+        }
+      }
+    }
+  }
+}
+
+// 弹窗按钮
+.popup_button {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 10px 20px;
+  box-sizing: border-box;
+
+  span {
+    height: 110px;
+    line-height: 110px;
+    text-align: center;
+  }
+
+  .cancel_btn {
+    background: #fff;
+    color: #ed1c24 !important;
+  }
+
+  .ok_btn {
+    background: #c69c6d;
+    color: #fff !important;
+    width: 120px;
+    height: 40px;
+    line-height: 40px;
+    border-radius: 40px;
+  }
+}
+</style>

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

@@ -12,7 +12,7 @@ export default {
     }),
   },
   mounted() {
-    const com = ['purpleCom', 'blueCom', 'greenCom', 'officeBlueCom'];
+    const com = ['purpleCom', 'blueCom', 'greenCom', 'officeBlueCom', 'purpleCom'];
     if ( this.custTypeId < 3 || ! this.custTypeId) {
       this.componentName = 'baseParkingFeeCom';
     } else {

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

@@ -50,6 +50,7 @@ export default {
       openId: null,
       options: null,
       preUrl: '',
+      tabbarActive: '手动缴费',
       // custTypeId: 0,
     };
   },
@@ -219,7 +220,8 @@ export default {
        });*/
       try {
         console.log(222222);
-        const res = await parkingLots('shenzhen01');
+        // const res = await parkingLots('8aaa83397bf7310e017bf7c8fb740009');
+        const res = await parkingLots('8aaa87bc7ce98224017ce995fd8a0002');
         console.log('223,2323', res);
         /*const data = {
          parkName: '杭州停车场',
@@ -591,5 +593,8 @@ export default {
     blueComChange(value) {
       console.log('blueComChange', value);
     },
+    tabbarActiveEvent(name) {
+      this.tabbarActive = name
+    }
   },
 };

+ 120 - 118
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -38,26 +38,22 @@ export default {
         title: '优惠券',
       });
       if (isInWeixinH5()) {
-        initWxJsSdkConfig(
-          ['checkJsApi', 'chooseImage'],
-          ['wx-open-launch-weapp']
-        );
+        initWxJsSdkConfig(['checkJsApi', 'chooseImage'], ['wx-open-launch-weapp']);
         // this.launchPathInit();
       }
     }, 300);
     this.pageInit();
     console.log(44);
   },
-/*watch:{
-  checkedCouponList(oldVal,newVal) {
+  /*watch:{
+   checkedCouponList(oldVal,newVal) {
 
-    console.log({newVal,oldVal})
-  }
-},*/
+   console.log({newVal,oldVal})
+   }
+   },*/
   methods: {
     remainPriceInit() {
-      this.usingTotalDiscount
-
+      // this.usingTotalDiscount
       // const {maxOneDayCoupons, remainConsumeTime, hourPrice} = checkOutResponse.parkingRule;
       // const {
       //   usingTotalDiscount, // 使用总抵扣
@@ -88,7 +84,6 @@ export default {
       // commit('setCoupons', couponsList);
     },
     pageInit() {
-
       // const {maxOneDayCoupons, remainConsumeTime, hourPrice} = checkOutResponse.parkingRule;
       // const {
       //   usingTotalDiscount, // 使用总抵扣
@@ -118,86 +113,91 @@ export default {
       // console.log(343, {couponsList});
       // commit('setCoupons', couponsList);
 
-
       /*
        * 电子优惠券初始化逻辑(后端处理)
        *
        * 1、每次change之后,需要重新计算每个电子优惠券的逻辑
-       * 2、superpositionrule  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加);
+       * 2、superposition  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加);
        * */
       this.couponList = [...this.coupons];
+      console.log(129, this.couponList);
       if (this.couponList.length) {
         this.couponList = this.couponList.map((elm, index) => {
-          if (elm.defaultSelected) {
+          elm.disabled = true;
+          const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
+          console.log(132, selected, elm.hasOwnProperty('selected'));
+          if (selected) {
             this.maxCouponFee = this.maxCouponFee + elm.discountFee;
             this.checkedCouponList.push(`coupon${index}`);
-            elm.disabled = false
+            elm.disabled = false;
           } else {
-            elm.disabled = true
+            // elm.disabled = !elm.defaultSelected
           }
-          return elm
+          return elm;
         });
+        console.log(143, this.checkedCouponList);
+        if (!this.checkedCouponList.length) {
+          this.couponList = this.couponList.map((elm) => {
+            elm.disabled = false;
+            return elm;
+          });
+        }
         // 验证剩余优惠券是否可勾选(无需验证:后端已计算可勾选的优惠券)
       }
     },
     item2Number(i) {
-      return Number.parseInt(i.replace(/coupon/g, ''))
+      return Number.parseInt(i.replace(/coupon/g, ''));
     },
-    checkboxItemChange(name, index){
+    checkboxItemChange(name, index) {
       console.log(7676, name);
       // 取消勾选时
-      if ( this.checkedCouponList.indexOf(name) > -1 ) {
+      if (this.checkedCouponList.indexOf(name) > -1) {
         this.couponList = this.couponList.map((elm, index) => {
-          elm.disabled = false
-          return elm
+          elm.disabled = false;
+          return elm;
         });
-        this.checkedCouponList = this.checkedCouponList.filter(i => i !== name)
-        return
+        this.checkedCouponList = this.checkedCouponList.filter((i) => i !== name);
+        return;
       }
       // 如果有选中项
       const item = this.couponList[index];
-      this.checkedCouponList.push(`coupon${index}`);
-      // 根据电子券规则判断是否可选
-      this.isDisabledByRule(item);
+      if (!item.disabled) {
+        this.checkedCouponList.push(`coupon${index}`);
+        // 根据电子券规则判断是否可选
+        this.isDisabledByRule(item);
+      }
     },
     // 根据电子券规则判断是否可选
     isDisabledByRule(item) {
-      const { parkMallCode } = this.orderDetail.parkInfo
+      const { parkMallCode } = this.orderDetail.parkInfo;
       // 杭州电子券使用上限(单位: 张)
       /*if (this.parkMallCode === 2) {
-        // 达到上限
-        if (
-          this.checkedCouponList.length ===
-          this.parkFee.parkInfoEntity.useTicketNum -
-          this.parkFee.parkInfoEntity.couponcodeNum
-        ) {
-          this.list.forEach((e, i) => {
-            if (this.checkedCouponList.findIndex((c) => c == i) === -1) {
-              e.disabled = true;
-            } else {
-              e.checked = true;
-            }
-          });
-          return uni.showToast({
-            title: `电子券每天最多可使用${this.parkFee.parkInfoEntity.useTicketNum}张`,
-            icon: "none",
-          });
-        } else {
-          this.list.forEach((e) => {
-            e.disabled = false;
-          });
-        }
-      }*/
+       // 达到上限
+       if (
+       this.checkedCouponList.length ===
+       this.parkFee.parkInfoEntity.useTicketNum -
+       this.parkFee.parkInfoEntity.couponcodeNum
+       ) {
+       this.list.forEach((e, i) => {
+       if (this.checkedCouponList.findIndex((c) => c == i) === -1) {
+       e.disabled = true;
+       } else {
+       e.checked = true;
+       }
+       });
+       return uni.showToast({
+       title: `电子券每天最多可使用${this.parkFee.parkInfoEntity.useTicketNum}张`,
+       icon: "none",
+       });
+       } else {
+       this.list.forEach((e) => {
+       e.disabled = false;
+       });
+       }
+       }*/
 
       // 浦东每次缴费超限控制、沈阳每日超限控制
-      if (
-        (parkMallCode === 1 ||
-          parkMallCode === 4 ||
-          parkMallCode === 5 ||
-          parkMallCode === 999 ||
-          parkMallCode === 6) &&
-        this.crossMessage()
-      ) {
+      if ((parkMallCode === 1 || parkMallCode === 4 || parkMallCode === 5 || parkMallCode === 999 || parkMallCode === 6) && this.crossMessage()) {
         this.couponList.forEach((e, i) => {
           if (this.checkedCouponList.findIndex((c) => c === `coupon${i}`) === -1) {
             e.disabled = true;
@@ -213,22 +213,22 @@ export default {
         } else {
           e.checked = false;
         }
-        // superpositionrule  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加)
-        if (item.superpositionrule === "1") {
+        // superposition  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加)
+        if (item.superposition === '1') {
           if (e.code !== item.code) {
             e.disabled = true;
           }
-        } else if (item.superpositionrule === "2") {
-          if (e.superpositionrule === "2") {
+        } else if (item.superposition === '2') {
+          if (e.superposition === '2') {
             // 统计当前(同类型&同可叠加次数)
             let count = 0;
             this.checkedCouponList.forEach((i) => {
-              const index = this.item2Number(i)
+              const index = this.item2Number(i);
               if (this.couponList[index].code === item.code) {
                 count++;
               }
             });
-            console.log(item.code + "合计:" + count);
+            console.log(item.code + '合计:' + count);
             if (item.code === e.code) {
               // 超限判断
               if (item.limitUseNum !== 0 && count + 1 > item.limitUseNum) {
@@ -249,7 +249,7 @@ export default {
           // 类型3可叠加
           e.disabled = false;
         }
-        return e
+        return e;
       });
     },
     // 是否选中
@@ -258,19 +258,19 @@ export default {
     },
     // 超限提示
     crossMessage() {
-      const { parkMallCode } = this.orderDetail.parkInfo
-      const {maxOneDayCoupons,maxonedaydiscountFee, remainConsumeTime, hourPrice} = this.orderDetail.parkingRule;
+      const { parkMallCode } = this.orderDetail.parkInfo;
+      const { maxOneDayCoupons, maxonedaydiscountFee, remainConsumeTime, hourPrice } = this.orderDetail.parkingRule;
       const {
         usingTotalDiscount, // 使用总抵扣
-        coupons
+        coupons,
       } = this.orderDetail.discountInfo;
       const {
         // totalFee, // 应缴
-        actualPayFee // 应付金额
+        actualPayFee, // 应付金额
       } = this.orderDetail.parkingRecord;
       // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
       let remainPrice = remainConsumeTime * hourPrice;
-      if ( remainPrice > actualPayFee ) {
+      if (remainPrice > actualPayFee) {
         remainPrice = actualPayFee;
       }
       // let totalFee = this.parkDiscountTotal.feeCopy;
@@ -278,36 +278,36 @@ export default {
       // 电子券优惠金额总计
       // 浦东每次优惠上限
       /*if (
-        parkMallCode === 1 &&
-        totalFee - this.paperCouponFee >= this.maxonetimediscountFee
-      ) {
-        //  uni.showToast({
-        //   title: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
-        //   icon: 'none',
-        // });
-        return Toast({
-          message: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
-          icon: 'none',
-        });
-        return;
-      }*/
+       parkMallCode === 1 &&
+       totalFee - this.paperCouponFee >= this.maxonetimediscountFee
+       ) {
+       //  uni.showToast({
+       //   title: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
+       //   icon: 'none',
+       // });
+       return Toast({
+       message: `超出抵扣上限,每次最高可抵扣${this.parkFee.parkInfoEntity.maxonetimediscount}小时`,
+       icon: 'none',
+       });
+       return;
+       }*/
       // 沈阳超限处理(maxonedaydiscountFee 会员、消费、电子券减免)
       /*if (
-        parkMallCode === 4 &&
-        totalFee - this.paperCouponFee - this.parkDiscountTotal.bonusfee >=
-          this.maxonedaydiscountFee
-      ) {
-        return Toast({
-          message: `(会员等级、消费、电子券)每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}小时`,
-          icon: 'none',
-        });
-        // return uni.showToast({
-        //   title: `(会员等级、消费、电子券)每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}小时`,
-        //   icon: 'none',
-        // });
-      }*/
+       parkMallCode === 4 &&
+       totalFee - this.paperCouponFee - this.parkDiscountTotal.bonusfee >=
+       this.maxonedaydiscountFee
+       ) {
+       return Toast({
+       message: `(会员等级、消费、电子券)每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}小时`,
+       icon: 'none',
+       });
+       // return uni.showToast({
+       //   title: `(会员等级、消费、电子券)每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}小时`,
+       //   icon: 'none',
+       // });
+       }*/
       // 深圳超限处理
-      if (parkMallCode === 5 && totalFee >= remainPrice) {
+      if (parkMallCode === 5 && usingTotalDiscount >= remainPrice) {
         return Toast({
           message: `每日最高可抵扣${remainPrice}元`,
           icon: 'none',
@@ -320,28 +320,33 @@ export default {
     },
     // 确认
     confirm() {
+      console.log(336, this.checkedCouponList);
       // 重新计算兑换券优惠
-      const checkedCouponList = this.checkedCouponList.map(i => this.item2Number(i));
-      const  couponList = this.couponList.map((elm, index) => {
-        if ( checkedCouponList[index] > -1 ) {
-          elm.defaultSelected = false
+      const checkedCouponList = this.checkedCouponList.map((i) => this.item2Number(i));
+      console.log(checkedCouponList);
+      const couponList = this.couponList.map((elm, index) => {
+        elm.selected = false;
+        console.log(checkedCouponList, index);
+        if (this.checkedCouponList.indexOf(`coupon${index}`) > -1) {
+          elm.selected = true;
         }
-        return elm
-      })
+        return elm;
+      });
+      console.log(348, couponList);
       this.$store.dispatch('order/saveCouponMath', {
         couponList: couponList,
-        callback:() => {
+        callback: () => {
           this.$router.back();
-        }
-      })
+        },
+      });
 
       /*uni.setStorageSync('checkedCouponList', this.checkedCouponList);
-      uni.setStorageSync('list', this.list);
-      uni.setStorageSync('couponInfo', {
-        couponfee: this.totalFee,
-        couponcode: this.couponCode.join('#'),
-      });
-      this.$router.back();*/
+       uni.setStorageSync('list', this.list);
+       uni.setStorageSync('couponInfo', {
+       couponfee: this.totalFee,
+       couponcode: this.couponCode.join('#'),
+       });
+       this.$router.back();*/
     },
     launchPathInit() {
       const groupId = uni.getStorageSync('groupId');
@@ -417,10 +422,7 @@ export default {
       console.log('H5 跳转到 嘉里中心小程序: success');
     },
     launchErrorFn({ errMsg, appId, extInfo }) {
-      console.log(
-        'H5 跳转到 嘉里中心小程序: fail',
-        JSON.stringify({ errMsg, appId, extInfo })
-      );
+      console.log('H5 跳转到 嘉里中心小程序: fail', JSON.stringify({ errMsg, appId, extInfo }));
     },
     onLaunchReady() {
       console.log('H5 跳转到 嘉里中心小程序 的标签 渲染了');

+ 43 - 12
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -54,15 +54,47 @@ export default {
       usePoints: (state) => state.order.usePoints,
       usePointsTime: (state) => state.order.usePointsTime,
       enableConsume: (state) => state.order.enableConsume,
+      unitAmount: (state) => state.order.unitAmount,
       // checkedTotal: state => state.order.checkedTotal,
     }),
     // 支付按钮状态
     payBtnDisabled() {
+      console.log(626262626262626262, this.member);
       return (
         !this.actualPayFee ||
         (JSON.stringify(this.member) !== '{}' && !this.orderDetail.parkInfo)
       );
     },
+    integralDesc() {
+      if (this.pointsTime > 0) {
+        // 深圳特殊处理(单位:金额)
+        if (this.orderDetail.parkInfo.parkMallCode === 5 || this.orderDetail.parkInfo.parkMallCode === 999) {
+          return `已选择兑换${this.pointsTime}元`;
+        }
+        return `已选择兑换${this.pointsTime}小时`;
+      }
+      if (this.bonusCopy < this.integral) {
+        return `${this.integral}积分可停车1小时`;
+      }
+      if (this.orderDetail.parkInfo.parkMallCode === 3 && app.globalData.member?.currnentintegral >= this.integral && !this.bonus) {
+        return `今日已达上限`;
+      }
+      return `${this.available}积分可减免`;
+    },
+  },
+  filters: {
+    parkingTime(val) {
+      const days = parseInt(val / 60 / 24)
+      const hours = parseInt((val / 60) % 24)
+      const minutes = parseInt(val % 60)
+      if (days > 0) {
+        return `${days}天 ${hours}小时 ${minutes}分钟`
+      }
+      if (hours > 0) {
+        return `${hours}小时 ${minutes}分钟`
+      }
+      return `${minutes}分钟`
+    },
   },
   created() {
     this.pageInit();
@@ -86,17 +118,15 @@ export default {
           discountInfo: {
             usingTotalDiscount: discountInfo.usingTotalDiscount, //优惠金额"
             actualUsedDiscount: discountInfo.usingTotalDiscount, //实际优惠金额
-            points: [
-              {
-                discountTime: 60,
-                // 如果是深圳的话,是金额,还得计算出对应的积分
-                discountFee: discountInfo.points[0].maxDiscountFee,
-                discountPoints:
-                  (discountInfo.points[0].pointsPerUnit /
-                    discountInfo.points[0].unitAmount) *
-                  discountInfo.points[0].maxDiscountFee,
-              },
-            ],
+            // points: {
+            //   discountTime: 60,
+            //   // 如果是深圳的话,是金额,还得计算出对应的积分
+            //   discountFee: discountInfo.points[0].maxDiscountFee,
+            //   discountPoints:
+            //     (discountInfo.points[0].pointsPerUnit /
+            //       discountInfo.points[0].unitAmount) *
+            //     discountInfo.points[0].maxDiscountFee,
+            // },
           },
         };
         const res = await ordersAndPrepay(params);
@@ -161,7 +191,8 @@ export default {
     couponCount() {},
     // 重置倒计时
     resetCountDown() {
-      this.refreshTime = 0;
+      this.refreshTime = 180;
+      this.$store.dispatch('order/orderInit', '000')
       // 重新创建订单
       // this.createParkOrder();
     },

+ 14 - 13
src/pages/parkingFee/mixins/parkingFeeDetailSuccess.js

@@ -57,22 +57,23 @@ export default {
       try {
         const res = await orderInfo(this.orderNo);
         console.log(59595959, res);
+        // this.detail = ordersInfoMockData;
+        this.detail = res;
+        const isInvoice = this.detail.isInvoice;
+        if (isInvoice == 0) {
+          this.isInvoiceName = '未开票';
+        } else if (isInvoice == 1) {
+          this.isInvoiceName = '已申请开票';
+        } else if (isInvoice == 2) {
+          this.isInvoiceName = '开票中';
+        } else if (isInvoice == 3) {
+          this.isInvoiceName = '开票完成';
+        } else if (isInvoice == 4) {
+          this.isInvoiceName = '开票失败';
+        }
       } catch (err) {
         console.log(err);
       }
-      this.detail = ordersInfoMockData;
-      const isInvoice = this.detail.isInvoice;
-      if (isInvoice == 0) {
-        this.isInvoiceName = '未开票';
-      } else if (isInvoice == 1) {
-        this.isInvoiceName = '已申请开票';
-      } else if (isInvoice == 2) {
-        this.isInvoiceName = '开票中';
-      } else if (isInvoice == 3) {
-        this.isInvoiceName = '开票完成';
-      } else if (isInvoice == 4) {
-        this.isInvoiceName = '开票失败';
-      }
       return;
       this.$md(params);
       uni.request({

+ 39 - 458
src/pages/parkingFee/mixins/parkingFeeDiscounts.js

@@ -5,181 +5,6 @@ import uni from '@/utils/uniHooks';
 export default {
   components: { uniNumberBox },
   created() {
-    setTimeout(() => {
-      uni.setNavigationBarTitle({
-        title: '选择优惠',
-      });
-    }, 300);
-    console.log('103,', uni.getStorageSync('paperCouponInfo'));
-    // 纸质优惠券
-    if (uni.getStorageSync('paperCouponInfo')) {
-      this.paperCouponFee =
-        uni.getStorageSync('paperCouponInfo').paperDiscountFee || 0;
-    }
-    // 电子券
-    if (uni.getStorageSync('couponInfo')) {
-      this.couponFee = uni.getStorageSync('couponInfo').couponfee || 0;
-    }
-    const servicefee = uni.getStorageSync('servicefee'); // 应缴金额
-    this.servicefee = servicefee ? Number.parseInt(servicefee) : 0;
-    console.log(10101, uni.getStorageSync('servicefee'));
-    this.parkDiscountTotal = uni.getStorageSync('parkingTotal'); // 总停车优惠
-    console.log('电子券', uni.getStorageSync('parkingTotal'));
-    // 重置优惠 防止二次叠加
-    try {
-      this.discountTotal = uni.getStorageSync('discountTotal');
-
-      if (this.discountTotal) {
-        this.parkDiscountTotal.feeCopy -= this.discountTotal.fee;
-      }
-    } catch (err) {
-      console.log('discountTotal 异常', err);
-    }
-
-    const parkFee = uni.getStorageSync('parkFee');
-    this.parkFee = parkFee ? JSON.parse(uni.getStorageSync('parkFee')) : {};
-
-    const parkInfo = uni.getStorageSync('parkInfo');
-    this.parkInfo = parkInfo ? JSON.parse(uni.getStorageSync('parkInfo')) : {};
-
-
-    console.log('116, 尝试定位问题', this.parkFee);
-    this.parkInfoEntity = this.parkFee.parkInfoEntity;
-    this.parkInfoEntity.useReduceTime = this.parkInfoEntity.useReduceTime
-      ? this.parkInfoEntity.useReduceTime
-      : 0; // 已用优惠时长
-    this.parkInfoEntity.remainReduceTime =
-      this.parkInfoEntity.remainReduceTime > 0
-        ? this.parkInfoEntity.remainReduceTime
-        : 0; // 剩余可用优惠时长
-    this.parkMallCode = this.parkInfoEntity.parkMallCode;
-    // 浦东每次上限处理
-    if (
-      this.parkMallCode === 1 &&
-      this.parkInfoEntity.remainReduceTime >
-      this.parkInfoEntity.maxonetimediscount
-    ) {
-      this.parkInfoEntity.remainReduceTime =
-        this.parkInfoEntity.maxonetimediscount;
-    }
-
-    // 沈阳上限处理
-    if (this.parkMallCode === 4) {
-      this.parkInfoEntity.remainReduceTime =
-        this.parkInfoEntity.maxOneDayHour -
-        this.parkInfoEntity.ticketandMemeberGradeAndConsumeUseHour;
-      if (this.couponFee) {
-        this.parkInfoEntity.remainReduceTime -=
-          this.couponFee / this.parkInfoEntity.needmoney;
-      }
-    }
-
-    // 上限金额
-    this.maxonetimediscountFee =
-      this.parkInfoEntity.maxonetimediscount * this.parkInfoEntity.needmoney;
-    this.maxonedaydiscountFee =
-      (this.parkInfoEntity.maxOneDayHour -
-        this.parkInfoEntity.ticketandMemeberGradeAndConsumeUseHour) *
-      this.parkInfoEntity.needmoney || 0;
-    if (this.maxonedaydiscountFee < 0) {
-      this.maxonedaydiscountFee = 0;
-    }
-
-    // 会员优惠
-    if (
-      this.parkFee.parkMemberOrderReducesEntityList &&
-      this.parkFee.parkMemberOrderReducesEntityList[0]
-    ) {
-      this.memberDiscount = this.parkFee.parkMemberOrderReducesEntityList[0];
-    }
-
-    // 消费减免
-    if (
-      this.parkFee.parkConsumeReducesEntityList &&
-      this.parkFee.parkConsumeReducesEntityList.length
-    ) {
-      this.reducesDiscount = this.parkFee.parkConsumeReducesEntityList[0];
-    } else {
-      this.reducesDiscount = { consumerLimit: 0, recuceContent: 0 };
-    }
-
-    // 消费减免可拆分上限
-    this.maxReduceDiscount = this.reducesDiscount.recuceContent;
-    if (this.maxReduceDiscount > this.parkInfoEntity.remainReduceTime) {
-      this.maxReduceDiscount = this.parkInfoEntity.remainReduceTime;
-    }
-    this.reduceHours = this.maxReduceDiscount;
-
-    // 反显处理
-    if (this.discountTotal.consumeFee) {
-      this.reduceHours =
-        this.discountTotal.consumeFee / this.parkInfoEntity.needmoney || 0;
-    }
-    const checkedList = uni.getStorageSync('checkedList');
-    console.log('反显处理', checkedList);
-    if (checkedList && checkedList.length) {
-      this.checkedList = JSON.parse(checkedList);
-    } else {
-      this.checkedList = [];
-    }
-    console.log('反显处理', this.checkedList);
-    /* else {
-     if (this.memberDiscount.reduceContent > 0) {
-     // 浦东上限控制
-     if (this.parkMallCode === 1) {
-     if (!this.crossMessage()) {
-     this.checkedList = ['member'];
-     this.maxReduceDiscount = this.parkInfoEntity.remainReduceTime - this.memberDiscount.reduceContent - (this.discountTotal.time || 0);
-     this.reduceHours = this.maxReduceDiscount;
-     }
-     } else {
-     this.checkedList = ['member'];
-     }
-     } else {
-     if (this.parkMallCode === 1) {
-     if (!this.isCheck('reduces')) {
-     this.maxReduceDiscount = this.parkInfoEntity.remainReduceTime - (this.parkDiscountTotal.time || 0);
-     this.reduceHours = this.maxReduceDiscount;
-     }
-     }
-     }
-     }*/
-    // 浦东上限控制
-    if (this.parkMallCode === 1 || this.parkMallCode === 4) {
-      if (this.discountTotal.memberGradeFee) {
-        this.maxReduceDiscount =
-          this.parkInfoEntity.remainReduceTime -
-          this.discountTotal.memberGradeFee / this.parkInfoEntity.needmoney;
-        if (
-          this.parkMallCode === 4 &&
-          this.maxReduceDiscount > this.reducesDiscount.recuceContent
-        ) {
-          this.maxReduceDiscount = this.reducesDiscount.recuceContent;
-        }
-      }
-      if (this.crossMessage()) {
-        if (this.isCheck('reduces')) {
-          this.maxReduceDiscount = this.reduceHours;
-        } else {
-          this.maxReduceDiscount = 0;
-          this.reduceHours = 0;
-        }
-      } else {
-        if (!this.isCheck('reduces')) {
-          this.reduceHours = this.maxReduceDiscount;
-        }
-      }
-    }
-
-    // 会员优惠每天只可使用一次
-    if (this.parkInfoEntity.memberLevelFlag == 1) {
-      this.isMemberDiscountDisabled = true;
-      const memberIndex = this.checkedList.indexOf('member');
-      if (memberIndex !== -1) {
-        this.checkedList.splice(memberIndex, 1);
-      }
-    }
-
     // 超限提示
     this.crossMessage();
   },
@@ -191,306 +16,62 @@ export default {
   // },
   data() {
     return {
-      parkInfo: {}, // 订单详情
-      parkFee: {}, // 停车规则信息及优惠信息
-      parkInfoEntity: {}, // 停车规则信息
-      memberDiscount: {}, // 会员优惠
-      isMemberDiscountDisabled: false, // 会员等级减免是否可用(当天仅限使用一次)
-      isDiscountDisabled: false, // 浦东减免是否超限
-      reducesDiscount: {}, // 消费优惠
       checkedList: [], // 已选优惠列表
-      firstPark: 0, // 首停减免金额
-      member: 0, // 会员优惠金额
-      reduces: 0, // 消费减免金额
-      reduceHours: 0, // 消费减免拆分时长
-      maxReduceDiscount: 0, // 消费减免规则最大优惠
-      servicefee: 0, // 应缴金额
-      parkDiscountTotal: {}, // 总停车优惠
-      discountTotal: {}, // 首停、会员、消费优惠合计
-      // groupId: app.globalData.groupId,
-      maxonetimediscountFee: 0, // 每次优惠上限金额
-      maxonedaydiscountFee: 0, // 每天优惠上限金额
-      parkMallCode: 1, // 0静安 1浦东 2杭州 3北京 4沈阳 5深圳
-      paperCouponFee: 0, // 纸质优惠金额
-      couponFee: 0, // 电子券优惠金额
-      active: 'a',
+      memberLevelReduce:[],
+      memberGrade: {},
+      consume: {},
+      todayReduceDiscountMessage: '',
+      isMemberDiscountDisabled: false,
     };
   },
   computed: {
-    // 是否显示消费减免
-    isShowReduceDiscount() {
-      if (
-        this.parkInfoEntity.parkMallCode === 0 ||
-        this.parkInfoEntity.parkMallCode === 1
-      ) {
-        return (
-          this.parkInfoEntity.consumeReduce &&
-          this.reducesDiscount.consumerLimit
-        );
-      }
-      return this.parkInfoEntity.consumeReduce;
-    },
-    // 首停减免金额
-    firstParkDiscountFee() {
-      return this.parkInfoEntity.parkHour * this.parkInfoEntity.needmoney;
-    },
-    // 会员减免金额
-    memberDiscountFee() {
-      return this.memberDiscount.reduceContent * this.parkInfoEntity.needmoney;
-    },
-    // 消费减免金额
-    reducesDiscountFee() {
-      return this.reduceHours * this.parkInfoEntity.needmoney;
-    },
-    // 浦东有效期内消费提示
-    reduceDiscountMessage() {
-      return (
-        this.parkInfoEntity.expirationDate +
-        '日内消费了' +
-        this.parkInfoEntity.totalAmont +
-        '元,已使用' +
-        parseInt(
-          this.parkInfoEntity.useConsumeFee / this.parkInfoEntity.needmoney
-        ) +
-        '小时满减抵扣。'
-      );
-    },
-    // 消费减免(拆分部分)提示文本
-    reduceSplitMessage() {
-      if (this.parkInfoEntity.isSplit === 0) {
-        return `选择${this.reduceHours}小时,`;
-      }
-      return '';
-    },
-    // 当日消费提示
-    todayReduceDiscountMessage() {
-      if (
-        this.parkInfoEntity.remainReduceTime ||
-        this.parkInfoEntity.maxOneDayHour -
-        this.parkInfoEntity.ticketandMemeberGradeAndConsumeUseHour
-      ) {
-        if (this.reducesDiscount.consumerLimit) {
-          if (this.parkMallCode === 0) {
-            return `今日可减免${this.reducesDiscount.recuceContent}小时`;
-          }
-          // 沈阳提示信息
-          if (this.parkMallCode === 4) {
-            return `未达上限时今日可减免${this.reducesDiscount.recuceContent}小时`;
-          }
-          if (
-            this.reducesDiscount.recuceContent >
-            this.parkInfoEntity.remainReduceTime
-          ) {
-            return `消费已满${this.reducesDiscount.consumerLimit}元,减免${this.reducesDiscount.recuceContent}小时。超出优惠上限,可减免${this.maxReduceDiscount}小时,${this.reduceSplitMessage}可优惠${this.reducesDiscountFee}元`;
-          }
-          return `消费已满${this.reducesDiscount.consumerLimit}元,减免${this.reducesDiscount.recuceContent}小时。${this.reduceSplitMessage}可优惠${this.reducesDiscountFee}元`;
-        }
-        return '消费金额未达到最低优惠要求';
-      }
-      if (this.parkInfoEntity.dateReduceUpperliLimit) {
-        return `您今日消费减免已达${this.parkInfoEntity.dateReduceUpperliLimit}小时上限`;
-      }
-    },
-    // 选择优惠数量
-    checkedTotal() {
-      return this.checkedList.length;
-    },
-    // 首停、会员、消费优惠总计金额
-    totalFee() {
-      this.first = 0;
-      this.member = 0;
-      this.reduces = 0;
-      let total = 0;
-      console.log(360, this.checkedList);
-      this.checkedList.forEach((item) => {
-        this[item] = this[item + 'DiscountFee'];
-        total += this[item + 'DiscountFee'];
-      });
-      console.log(364, total);
-      return total;
-    },
-    // 首停、会员、消费优惠总计时长
-    totalTime() {
-      return this.totalFee / this.parkInfoEntity.needmoney;
-    },
-    // 实际支付金额
-    actualFee() {
-      console.log('实际支付金额', this.servicefee, this.discountFee);
-      const fee = this.servicefee - this.discountFee;
-      console.log('实际支付金额', fee);
-      return fee > 0 ? fee : 0;
-    },
-    // 已优惠金额
-    discountFee() {
-      let total = this.parkDiscountTotal.feeCopy + this.totalFee;
-      console.log(380, this.parkDiscountTotal.feeCopy, this.totalFee);
-      // 超出上限按上限计算
-      if (this.parkMallCode === 1) {
-        if (total - this.paperCouponFee > this.maxonetimediscountFee) {
-          total = this.maxonetimediscountFee + this.paperCouponFee;
-        }
-      }
-      if (this.parkMallCode === 4) {
-        if (
-          total - this.paperCouponFee - this.parkDiscountTotal.bonusfee >
-          this.maxonedaydiscountFee
-        ) {
-          total =
-            this.maxonedaydiscountFee +
-            this.parkDiscountTotal.bonusfee +
-            this.paperCouponFee;
-        }
-      }
-      return total;
-    },
     ...mapState({
+      orderDetail: state => state.order.orderDetail,
       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,
     }),
   },
+  mounted() {
+    this.pageInit();
+  },
   methods: {
-    // 选择回调
-    checkboxChange(e) {
-      console.log(this.checkedList);
-      // console.log('checkboxChange');
-      // console.log('paperCouponFee------>', this.paperCouponFee);
-      // 浦东上限控制
-      if (this.parkMallCode === 1) {
-        if (this.isCheck('member')) {
-          this.maxReduceDiscount =
-            this.parkInfoEntity.remainReduceTime -
-            (this.discountFee - this.paperCouponFee - this.reduces) /
-            this.parkInfoEntity.needmoney;
-          this.reduceHours = this.maxReduceDiscount;
-        } else {
-          if (this.isCheck('reduces')) {
-            this.maxReduceDiscount =
-              this.parkInfoEntity.remainReduceTime -
-              (this.discountFee - this.paperCouponFee - this.reduces) /
-              this.parkInfoEntity.needmoney;
-          } else {
-            this.maxReduceDiscount =
-              this.parkInfoEntity.remainReduceTime -
-              (this.discountFee - this.paperCouponFee) /
-              this.parkInfoEntity.needmoney;
-            this.reduceHours = this.maxReduceDiscount;
-          }
-        }
+    pageInit() {
+      this.checkedList = []
+      const {memberGrade, consume, memberLevelDiscount} = this.orderDetail.discountInfo;
+      if (!memberLevelDiscount) {
+
       }
-      // 沈阳上限控制
-      if (this.parkMallCode === 4) {
-        if (this.isCheck('member')) {
-          this.maxReduceDiscount =
-            this.parkInfoEntity.remainReduceTime -
-            this.memberDiscount.reduceContent;
-          if (this.maxReduceDiscount < 0) {
-            this.maxReduceDiscount = 0;
-          }
-          if (this.maxReduceDiscount > this.reducesDiscount.recuceContent) {
-            this.maxReduceDiscount = this.reducesDiscount.recuceContent;
-          }
-          this.reduceHours = this.maxReduceDiscount;
-        } else {
-          this.maxReduceDiscount = this.parkInfoEntity.remainReduceTime;
-          if (this.maxReduceDiscount > this.reducesDiscount.recuceContent) {
-            this.maxReduceDiscount = this.reducesDiscount.recuceContent;
-          }
-          this.reduceHours = this.maxReduceDiscount;
-        }
+      this.memberGrade = {...memberGrade[0]}
+      this.consume = {...consume[0]}
+      if (memberGrade.length && memberGrade[0].defaultSelected) {
+        this.checkedList.push('member')
       }
-      this.crossMessage();
-    },
-
-    // 是否选中
-    isCheck(val) {
-      return this.checkedList.findIndex((e) => e == val) !== -1;
-    },
+      if (memberGrade.length && consume[0].defaultSelected) {
 
-    // 计数器回调
-    reducesChange() {
-      console.log('reducesChange');
-      if (this.isCheck('reduces')) {
-        this.crossMessage();
+        this.checkedList.push('reduces')
       }
+      console.log(44444, this.checkedList);
     },
-
-    // 超限提示
-    crossMessage() {
-      let totalFee = this.parkDiscountTotal.feeCopy;
-      const remainReduceFee =
-        this.parkInfoEntity.remainReduceTime * this.parkInfoEntity.needmoney;
-      // if (this.discountTotal && this.discountTotal.fee !== 0) {
-      // 	totalFee += this.totalFee - this.discountTotal.fee;
-      // } else {
-      // 	totalFee += this.totalFee;
-      // }
-      totalFee += this.totalFee;
-      // 浦东每次总优惠上限
-      this.isDiscountDisabled = false;
-      if (
-        this.parkMallCode === 1 &&
-        totalFee - this.paperCouponFee >= this.maxonetimediscountFee
-      ) {
-        this.isDiscountDisabled = true;
-        return uni.showToast({
-          title: `超出抵扣上限,每次最高可抵扣${this.parkInfoEntity.maxonetimediscount}小时`,
-          icon: 'none',
-        });
-      }
-      // 沈阳超限处理(maxonedaydiscountFee 会员、消费、电子券减免)
-      if (
-        this.parkMallCode === 4 &&
-        totalFee - this.paperCouponFee - this.parkDiscountTotal.bonusfee >=
-        this.maxonedaydiscountFee
-      ) {
-        this.isDiscountDisabled = true;
-        return uni.showToast({
-          title: `(会员等级、消费、电子券)每日最高可抵扣${this.parkInfoEntity.maxOneDayHour}小时`,
-          icon: 'none',
-        });
-      }
-      // 消费每天优惠上限(非浦东、沈阳)
-      if (
-        this.parkMallCode !== 1 &&
-        this.parkMallCode !== 4 &&
-        this.reduces > remainReduceFee
-      ) {
-        this.reduces = remainReduceFee;
-        return uni.showToast({
-          title: `超出抵扣上限,消费减免每天最高可抵扣${this.parkInfoEntity.dateReduceUpperliLimit}小时,可使用${this.parkInfoEntity.remainReduceTime}小时`,
-          icon: 'none',
-        });
-      }
+    setIsMemberDiscountDisabled() {
+      this.todayReduceDiscountMessage = '当日'
     },
+    actualFee() {},
+    discountFee() {},
+    confirm() {},
+    crossMessage() {},
+    checkboxChange() {},
+    parkInfoEntity() {},
+    isShowReduceDiscount() {},
+    // todayReduceDiscountMessage() {},
+    // 验证当前的选项是否可选择
+    isCheck(type) {
 
-    // 确认
-    confirm() {
-      // 计算单价
-      const cost =
-        this.reducesDiscount.consumerLimit / this.reducesDiscount.recuceContent;
-      // 算出消费减免在哪个档
-      let useConsumeFee = 0;
-      if (this.reduces) {
-        if (this.parkInfoEntity.isSplit === 0) {
-          useConsumeFee = this.reduceHours * cost;
-        } else {
-          useConsumeFee = this.reducesDiscount.consumerLimit;
-        }
-      }
-
-      uni.setStorageSync('checkedList', this.checkedList);
-      uni.setStorageSync('checkedTotal', this.checkedTotal);
-      uni.setStorageSync('discountTotal', {
-        firstParkFee: this.firstPark,
-        memberGradeFee: this.member,
-        consumeFee: this.reduces,
-        useConsumeFee: useConsumeFee,
-        time: this.totalTime,
-        fee: this.totalFee,
-      });
-      this.$nextTick(() => {
-        this.$router.back();
-      });
     },
+
   },
+
 };

+ 2 - 0
src/pages/parkingFee/parkingFee.vue

@@ -5,12 +5,14 @@
 <script>
 import officeBlueCom from './components/officeBlue/parkingFee.vue';
 import baseParkingFeeCom from './components/base/parkingFee.vue';
+import purpleCom from './components/purple/parkingFee.vue';
 import baseMixins from './mixins/base'
 export default {
   mixins:[baseMixins],
   components: {
     officeBlueCom,
     baseParkingFeeCom,
+    purpleCom,
   },
 };
 </script>

BIN=BIN
src/pages/parkingFee/static/images/icon-coupon.png


+ 6 - 1
src/store/index.js

@@ -28,6 +28,7 @@ const store = new Vuex.Store({
     // mallId: '8a8486a37f48f7bd017f4e5bddd10000',
     // openid: 'oudWQ5SCDElfn-IQH6eBR5JesOz4',
     // appId: 'wx92c3e55fbef6b2af',
+    lbsId: '',
     groupId: '',
     kipUserId: '',
     mallId: '',
@@ -36,7 +37,7 @@ const store = new Vuex.Store({
     member: {},
     userInfo: {},
     mobile: '',
-    custTypeId: 0, // 0 默认版本,1 上海静安 2 上海浦东 3 KIP:默认版本
+    custTypeId: 0, // 0 默认版本,1 上海静安 2 上海浦东 3 KIP:默认版本 4: 新的baseUI
     paramsScene: {},
     parkFee: {},
     marketList: [],
@@ -142,6 +143,9 @@ const store = new Vuex.Store({
       // TODO: 与小程序通信时打开
       state.isInit = payload;
     },
+    SET_LBS_ID(state, payload) {
+      state.lbsId = payload;
+    },
   },
   actions: {
     async baseInit({ commit, dispatch }, { options, callback }) {
@@ -214,6 +218,7 @@ const store = new Vuex.Store({
          mallId = '8a888aed7d0295e5017d029ff1f40000';
          commit('SET_MALL_ID', '8a888aed7d0295e5017d029ff1f40000');
          }*/
+        commit('SET_LBS_ID', lbsId);
         commit('SET_OPENID', openid);
         if (isLogin) {
           commit('SET_ACCESS_TOKEN', accessToken);

+ 142 - 121
src/store/order.js

@@ -1,5 +1,7 @@
-import { checkOut, calculateDiscount, ordersAndPrepay} from '@/api/parking';
-import checkOutQHResponse from '@/api/mockData/checkout.qh.response.json'
+import { checkOut, calculateDiscount, ordersAndPrepay } from '@/api/parking';
+
+// import checkOutQHResponse from '@/api/mockData/checkout.qh3.response.json'
+// import checkOutQHResponse from '@/api/mockData/checkout.hz.response.json';
 
 // 微服务接口字段
 const state = {
@@ -22,14 +24,16 @@ const state = {
   enablePaperCoupons: false, // 启动纸质优惠券
   usingTotalDiscount: 0, // 优惠金额
   actualPayFee: 0, // 应付金额
+  // 积分相关
   available: 0, // 用户可用积分
   maxPointsTime: '', // 积分最大兑换时长
   pointsTime: '', // 已兑换的积分时间
+  unitAmount: 0,
   // 停车优惠:会员等级和消费减免
   memberLevelDiscount: false, // 是否开启会员等级
   enableConsume: false, // 是否开启消费减免
   pointsPerUnit: 0, //
-}
+};
 
 const mutations = {
   setOrderDetail(state, payload) {
@@ -66,7 +70,6 @@ const mutations = {
     state.maxOneDayCoupons = payload;
   },
   setCoupons(state, payload) {
-    console.log('setCoupons', payload)
     state.coupons = payload;
   },
   setCouponCount(state, payload) {
@@ -108,7 +111,13 @@ const mutations = {
   setMaxOneDayDiscountFee(state, payload) {
     state.maxOneDayDiscountFee = payload;
   },
-}
+  setUnitAmount(state, payload) {
+    state.unitAmount = payload;
+  },
+  setMaxDiscountFee(state, payload) {
+    state.maxDiscountFee = payload;
+  },
+};
 
 const actions = {
   async orderInit({ commit, dispatch, state }, vehicleNo = '浙A616A1') {
@@ -120,17 +129,22 @@ const actions = {
       //   setIsFirst(1);
       // }
       // const res = await checkOut('浙A616A1');
+      // const res = await checkOut('闽AAQ5519');
+      const res = await checkOut('闽AAQ5518');
+      // const res = await checkOut('沪DCJ986');
       // console.log('浙A616A1', res);
       // 所有的优惠时间长转为金额
       // console.log(112, '所有的优惠时间长转为金额');
-      dispatch('orderInitRule', checkOutQHResponse);
-      // dispatch('orderInitRule', res);
+      // dispatch('orderInitRule', checkOutQHResponse);
+      dispatch('orderInitRule', res);
     } catch (error) {
       console.log(error);
     }
   },
   orderInitRule({ commit, dispatch, state }, checkOutResponse) {
     console.log(119, checkOutResponse);
+    // 记录buildingId
+    window.localStorage.setItem('buildingId', checkOutResponse.parkingRecord.buildingId);
     commit('setOrderDetail', checkOutResponse);
     // 是否展示优惠
     commit('setIsShowDiscounts', checkOutResponse?.parkingRule?.enableCoupon || false);
@@ -144,7 +158,7 @@ const actions = {
     // dispatch('getIntegralDesc', checkOutResponse.parkingRule.enablePoints);
     // 电子优惠券:是否启用
     // 处理电子优惠券相关逻辑
-    dispatch('couponRule', checkOutResponse)
+    dispatch('couponRule', checkOutResponse);
     // 纸质优惠券(hold)
     commit('setEnablePaperCoupons', checkOutResponse.parkingRule.enablePaperCoupons);
     // 其他数据收集
@@ -156,167 +170,175 @@ const actions = {
     let checkedTotal = 0;
     console.log(orderDetail);
     if (orderDetail?.discountInfo.memberLevelDiscount && orderDetail?.discountInfo?.memberGrade.length) {
-      orderDetail.discountInfo.memberGrade.forEach(elm => {
+      orderDetail.discountInfo.memberGrade.forEach((elm) => {
         if (elm.defaultSelected) {
-          checkedTotal++
+          checkedTotal++;
         }
-      })
+      });
     }
     if (orderDetail?.discountInfo?.consume?.length) {
-      orderDetail.discountInfo.consume.forEach(elm => {
+      orderDetail.discountInfo.consume.forEach((elm) => {
         if (elm.defaultSelected) {
-          checkedTotal++
+          checkedTotal++;
         }
-      })
+      });
     }
     commit('setMemberLevelDiscount', orderDetail.discountInfo.memberLevelDiscount);
     commit('setCheckedTotal', checkedTotal);
     dispatch('getDiscountDesc', {
       orderDetail,
-      checkedTotal
-    })
+      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', `已选择${checkedTotal}项优惠`);
       }
-      return commit('setDiscountDesc', `立即使用`)
+      return commit('setDiscountDesc', `立即使用`);
     } else {
-      return commit('setDiscountDesc', `暂无可用优惠`)
+      return commit('setDiscountDesc', `暂无可用优惠`);
     }
   },
   // 积分相关计算(仅计算用户可使用的积分)
-  pointsRule({ commit, dispatch, state }, { discountInfo, parkingRule, parkInfo }) {
-    const { points,
-      usingTotalDiscount // 当前车辆的已使用优惠的总上限
-    } = discountInfo
+  pointsRule({ commit, dispatch, state }, checkOutResponse) {
+    const { discountInfo, parkingRule, parkInfo } = checkOutResponse
+    const {
+      points,
+      usingTotalDiscount, // 当前车辆的已使用优惠的总上限
+    } = discountInfo;
     const {
       maxPointsTime = 0, // 最大积分
       enablePoints,
-      maxOneDayDiscountFee // 每日最大优惠金额(深圳车场)
-    } = parkingRule
-    const [{
-      pointsPerHour,
-      available, // 用户可用的积分(当前车辆在) available是用户选择抵扣N小时后剩余的可用积分
-      maxDiscountFee,// 单次上限(元)
-      unitAmount, // 兑换值(元)
-      pointsPerUnit = 0 // 500积分对应的价值
-    }] = points
-
-    //
-    // // 如果当前车辆的已使用优惠的总上限小于每日最大优惠金额(深圳车场),自动计算积分逻辑
-    // if (usingTotalDiscount < maxOneDayDiscountFee) {
-    //   // 剩余可使用的优惠金额
-
-    //   // 计算当前用户的剩余积分可兑换的优惠金额
-    //   const discountFee = available / (pointsPerUnit / unitAmount);
-    //   // 如果用户的可兑换优惠金额大于 每日最大优惠金额(深圳车场)
-    //   console.log({ discountFee });
-    // }
+      maxOneDayDiscountFee, // 每日最大优惠金额(深圳车场)
+      remainConsumeTime, // 当前订单剩余可使用的优惠
+    } = parkingRule;
+    const [
+      {
+        pointsPerHour,
+        available, // 用户可用的积分(当前车辆在) available是用户选择抵扣N小时后剩余的可用积分
+        maxDiscountFee, // 单次上限(元)
+        unitAmount, // 兑换值(元)
+        pointsPerUnit = 0, // 500积分对应的价值
+        discountFee,
+        label,
+      },
+    ] = points;
+    dispatch('maxPointsTimeMath', checkOutResponse) // 剩余积分可兑换上限
     commit('setEnablePoints', enablePoints);
     commit('setAvailable', available);
     commit('setMaxPointsTime', maxPointsTime);
-    commit('setPointsTime', maxPointsTime);
+    commit('setMaxDiscountFee', maxDiscountFee);
+    commit('setPointsTime', discountFee || 0);
     commit('setPointsPerUnit', pointsPerUnit);
-    commit('setMaxOneDayDiscountFee', maxOneDayDiscountFee)
-    // commit('setPointsPerHour', pointsPerHour)
-
-    console.log({pointsPerHour});
-    // 如果是深圳车场,动态计算已兑换的积分
-    if (maxPointsTime > 0) {
-      // // 需要在页面展示已选的积分
-      // // 先计算已选择的积分
-      // const usePoints = maxPointsTime * pointsPerUnit;
-      // console.log({ usePoints });
-      // commit('setUsePoints', maxPointsTime);
-      // console.log({maxPointsTime});
-      // if (usePoints && usePoints > pointsPerUnit) {
-
-      // }
-      // maxPointsTime
-      // 控制积分是否可选
-      // 深圳特殊处理(单位:金额
-      if (parkInfo.parkMallCode === 999) {
-        return commit('setIntegralDesc', `已选择兑换${maxPointsTime}元`)
-      }
-      return commit('setIntegralDesc', `已选择兑换${maxPointsTime}小时`)
-    }
-    if (available < pointsPerHour) {
-      return `${pointsPerHour}积分可停车1小时`;
-    }
-    if (
-      parkInfo.parkMallCode === 3 &&
-      enablePoints && !maxPointsTime
-    ) {
-      return commit('setIntegralDesc', `今日已达上限`);
-    }
-    return commit('setIntegralDesc', `${available}积分可减免`);
+    commit('setMaxOneDayDiscountFee', maxOneDayDiscountFee);
+    commit('setPointsPerHour', pointsPerUnit);
+    commit('setUnitAmount', unitAmount);
+    commit('setIntegralDesc', label);
   },
+  // 当前最大可选优惠时间
+  /*
+   * 当前最大可选优惠时间
+   * 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);
+    // 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 }) {
-    if (type === 'add' && state.pointsTime < state.maxPointsTime) {
-      const pointsTime = state.pointsTime + 1
+    // console.log('289289289289289289289289', state.available / (state.pointsPerUnit / state.unitAmount) + state.pointsTime);
+    let maxPointsTime = state.available / (state.pointsPerUnit / state.unitAmount) + state.pointsTime;
+    if ( maxPointsTime > state.maxDiscountFee) {
+      maxPointsTime = state.maxDiscountFee
+    }
+    if (type === 'add' && state.pointsTime < maxPointsTime) {
+      const pointsTime = state.pointsTime + 1;
       // 如果是深圳车场
-      commit('setAvailable', state.available - state.pointsPerUnit);
+      commit('setAvailable', state.available - state.pointsPerUnit / state.unitAmount);
       commit('setPointsTime', pointsTime);
     }
     if (type === 'minus' && state.pointsTime > 0) {
-      const pointsTime = state.pointsTime - 1
+      const pointsTime = state.pointsTime - 1;
       // 如果是深圳车场
-      commit('setAvailable', state.available + state.pointsPerUnit);
+      commit('setAvailable', state.available + state.pointsPerUnit / state.unitAmount);
       commit('setPointsTime', pointsTime);
     }
   },
   cancelPointsMath({ commit, dispatch, state }, callback) {
-    const { discountInfo: { points }, parkingRule } = state.orderDetail;
-    const [{ pointsPerHour, available }] = points
-    const { maxPointsTime, enablePoints } = parkingRule
+    const {
+      discountInfo: { points },
+      parkingRule,
+    } = state.orderDetail;
+    const [{ pointsPerHour, available }] = points;
+    const { maxPointsTime, enablePoints } = parkingRule;
     commit('setAvailable', available);
-    commit('setPointsTime', maxPointsTime)
-    callback && callback()
+    commit('setPointsTime', maxPointsTime);
+    callback && callback();
   },
   async savePointsMath({ commit, dispatch, state }, callback) {
     const orderDetail = { ...state.orderDetail };
     // 计算积分修改之后的金额,返回给后端
-    orderDetail.discountInfo.points[0].discountFee = state.pointsTime * orderDetail.discountInfo.points[0].unitAmount
+    // 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;
     try {
       const res = await calculateDiscount({
-        ...orderDetail
-      })
-      console.log({res});
-      dispatch('orderInitRule', orderDetail)
-      callback && callback()
+        ...orderDetail,
+      });
+      console.log('积分修改失败', { res });
+      dispatch('orderInitRule', res);
+      callback && callback();
     } catch (err) {
       console.log('积分修改失败!', err);
-      callback && callback()
+      callback && callback();
     }
     //
   },
-  async saveCouponMath({ commit, dispatch, state }, {couponList, callback}) {
+  async saveCouponMath({ commit, dispatch, state }, { couponList, callback }) {
     const orderDetail = { ...state.orderDetail };
     orderDetail.discountInfo.coupons = couponList;
-
+    orderDetail.discountInfo.points[0].selected = false;
     try {
       const res = await calculateDiscount({
-        ...orderDetail
-      })
-      console.log({res});
-      dispatch('orderInitRule', orderDetail)
-      callback && callback()
+        ...orderDetail,
+      });
+      dispatch('orderInitRule', res);
+      callback && callback();
     } catch (err) {
       console.log('积分修改失败!', err);
-      callback && callback()
+      callback && callback();
     }
     // commit('setCoupons', checkOutResponse.discountInfo.coupons);
-
   },
   getIntegralDesc() {
     // 自动勾选积分优惠
     // 深圳是最大抵扣金额
-
     // available
-
     /*
     if (this.duration > 0) {
         // 深圳特殊处理(单位:金额)
@@ -370,27 +392,27 @@ const actions = {
       // })
       // console.log(343, {couponsList});
       // commit('setCoupons', couponsList);
-
-      commit('setMaxOneDayCoupons', checkOutResponse.parkingRule.maxOneDayCoupons);// 仅在杭州使用
+      commit('setMaxOneDayCoupons', checkOutResponse.parkingRule.maxOneDayCoupons); // 仅在杭州使用
       commit('setCoupons', checkOutResponse.discountInfo.coupons);
       // 统计已选择优惠券
-      let couponCount = 0
-      checkOutResponse.discountInfo.coupons.forEach(elm => {
-        if (elm.defaultSelected) {
-          couponCount++
+      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 (couponCount > 0) {
-          return commit('setCouponDesc', `您有${couponCount}张可用优惠劵`);
+        if (checkOutResponse.discountInfo.coupons.length) {
+          return commit('setCouponDesc', `您有${checkOutResponse.discountInfo.coupons.length}张可用优惠劵`);
         }
         return commit('setCouponDesc', `暂无可用优惠券`);
       }
     }
-  }
+  },
 
   // 是否展示优惠
   // getIsShowDiscounts({commit, dispatch}, orderDetail) {
@@ -399,15 +421,14 @@ const actions = {
   // calculateDiscount
 
   /*
-    如果积分发生变化
-  */
-}
+   如果积分发生变化
+   */
+};
 
 export default {
   //开启命名模块
   namespaced: true,
   state,
   mutations,
-  actions
-}
-
+  actions,
+};

+ 1 - 0
vue.config.js

@@ -110,6 +110,7 @@ module.exports = {
         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
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
         //ws: true, // proxy websockets
         //pathRewrite方法重写url