فهرست منبع

feat: 微服务接入改造40%(创建订单页面:支付)

John-Hong 2 سال پیش
والد
کامیت
75dc651956

+ 66 - 0
README.md

@@ -1,30 +1,96 @@
 # my-project
 # my-project
 
 
 ## Project setup
 ## Project setup
+
 ```
 ```
 yarn install
 yarn install
 ```
 ```
 
 
 ### Compiles and hot-reloads for development
 ### Compiles and hot-reloads for development
+
 ```
 ```
 yarn serve
 yarn serve
 ```
 ```
 
 
 ### Compiles and minifies for production
 ### Compiles and minifies for production
+
 ```
 ```
 yarn build
 yarn build
 ```
 ```
 
 
 ### Customize configuration
 ### Customize configuration
+
 See [Configuration Reference](https://cli.vuejs.org/config/).
 See [Configuration Reference](https://cli.vuejs.org/config/).
 
 
 ### 页面说明
 ### 页面说明
+
 #### 首页
 #### 首页
+
 path: src/pages/parkingFee/parkingFee.vue
 path: src/pages/parkingFee/parkingFee.vue
+
 #### 缴费记录
 #### 缴费记录
+
 path: src/pages/parkingFee/parkingFeeList.vue
 path: src/pages/parkingFee/parkingFeeList.vue
+
 #### 停车兑换券
 #### 停车兑换券
+
 path: src/pages/pointsMall/pointsMall.vue
 path: src/pages/pointsMall/pointsMall.vue
+
 #### 停车开票
 #### 停车开票
 
 
 #### 车辆管理
 #### 车辆管理
+
+## UNI相关
+
+```js
+// 修改标题颜色
+window.toWXSendMsg({
+    type: 'uni_func',
+    funcName: 'setNavigationBarColor',
+    options: {
+        frontColor: '#000000',
+        backgroundColor: '#2151C5',
+    },
+});
+```
+
+```js
+// 请求 projectId
+window.toWXSendMsg({ // 发送请求,再由小程序返回;
+    type: 'getProjectId',
+    options: {},
+});
+window.subscribe('projectId', (options) => { // 监听小程序的返回事件,如果有返回则销毁当前的事件进程;
+    resolve(options);
+});
+```
+
+```js
+// 扫描二维码
+window.toWXSendMsg({
+  type: 'scanQRCode',
+});
+window.subscribe('scanQRCodeOver', (options) => {
+  console.log('微信扫码结束之后的返回参数', options);
+  runScanFn(options);
+});
+```
+
+```js
+// 前往登录
+// 验证当前用户是否需要登陆
+window.toWXSendMsg({
+  type: 'toLogin',
+  options: {
+    path: path,
+  },
+});
+window.subscribe('callback', (options) => {
+  console.log('登录成功之后的回调', JSON.stringify(options));
+  if (options.isReload) {
+    window.location.reload();
+  } else {
+    callback && callback(options);
+  }
+});
+```

+ 2 - 2
src/api/parking/index.js

@@ -19,10 +19,10 @@ export function parkingLots(lbsId) {
 
 
 // 1.6 查询车辆是否在场及停车费用: https://kerryprops.atlassian.net/wiki/spaces/TAIC/pages/94076936/1.6
 // 1.6 查询车辆是否在场及停车费用: https://kerryprops.atlassian.net/wiki/spaces/TAIC/pages/94076936/1.6
 // 新接口路径:https://{kip-service-host}/c/api/temporary-parking-service/parking/check-out?vehicleNo={{vehicleNo}}
 // 新接口路径:https://{kip-service-host}/c/api/temporary-parking-service/parking/check-out?vehicleNo={{vehicleNo}}
-export function checkOut(vehicleNo) {
+export function checkOut(vehicleNo, unlicensed) {
   console.log(212121, vehicleNo);
   console.log(212121, vehicleNo);
   // 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service/parking/check-out?vehicleNo=浙
   // 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service/parking/check-out?vehicleNo=浙
-  return window.requestms.get(`/parking/check-out?vehicleNo=${vehicleNo}`, {
+  return window.requestms.get(`/parking/check-out?vehicleNo=${vehicleNo}&unlicensed=${unlicensed}`, {
     loading: true,
     loading: true,
     headers: {
     headers: {
       buildingId: window.localStorage.getItem('buildingId'),
       buildingId: window.localStorage.getItem('buildingId'),

+ 4 - 3
src/api/request.js

@@ -111,11 +111,11 @@ function XUser(config) {
     projectId: store.state.projectId || '4028e3817c2b3f79017c2b48c54c0000', // 楼盘id
     projectId: store.state.projectId || '4028e3817c2b3f79017c2b48c54c0000', // 楼盘id
     // buildingId: 'shenyang01',
     // buildingId: 'shenyang01',
     // buildingId: window.localStorage.getItem('buildingId'),
     // buildingId: window.localStorage.getItem('buildingId'),
-    // brandId: store.state.mallId,
+    brandId: store.state.groupId,
     // brandId: '8aaa81947c6e1ca0017c73c13cc30006',
     // brandId: '8aaa81947c6e1ca0017c73c13cc30006',
-    brandId: store.state.brandId,
+    // brandId: store.state.brandId,
     // cid: '8aaa809d835ba76d018378bc57180006',
     // cid: '8aaa809d835ba76d018378bc57180006',
-    cId: store.state.openid, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+    cid: store.state.openid, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
     // vipCode: 'KERRY100213505',
     // vipCode: 'KERRY100213505',
     // vipCode: store.state.member.vipcode, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
     // vipCode: store.state.member.vipcode, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
     vipCode: 'KERRY100213853', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
     vipCode: 'KERRY100213853', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
@@ -137,6 +137,7 @@ function XUser(config) {
   if (/orders-and-prepay|calculate-discount/.test(config.url)) {
   if (/orders-and-prepay|calculate-discount/.test(config.url)) {
     params.buildingId = window.localStorage.getItem('buildingId');
     params.buildingId = window.localStorage.getItem('buildingId');
   }
   }
+  console.log(140140140140, params);
   return JSON.stringify(params);
   return JSON.stringify(params);
 }
 }
 
 

+ 8 - 2
src/common/js/BaseDictionary.js

@@ -85,5 +85,11 @@ export const lbsDictionary = {
   }
   }
 };
 };
 
 
-
-
+// 订单状态枚举数据
+export const ORDER_STATUS = {
+  CREATED:'已创建',
+  TO_BE_PAID: '待支付',
+  PAID: '已支付',
+  REFUND: '已退款',
+  TIME_OUT: '已超时',
+}

+ 0 - 4
src/crmPages/vehicleAddOrEdit.vue

@@ -373,10 +373,6 @@ export default {
                   plate_type: params.licensePlateType === 'ORDINARY_CAR_NO' ? 1 : (params.licensePlateType === 'NEW_ENERGY_CAR_NO' ? 2 : 3),
                   plate_type: params.licensePlateType === 'ORDINARY_CAR_NO' ? 1 : (params.licensePlateType === 'NEW_ENERGY_CAR_NO' ? 2 : 3),
                   plate_num: params.vehicleNo
                   plate_num: params.vehicleNo
                 })
                 })
-                // this.sensorsClick('$ClickVehicleAddOrEdit', {
-                //   confirm_type: 'edit',
-                //   redirect_url: 'pages/parkingFee/vehicleManagement',
-                // })
                 uni.showToast({
                 uni.showToast({
                   title: '修改车牌成功',
                   title: '修改车牌成功',
                   duration: 1300,
                   duration: 1300,

+ 0 - 22
src/pages/login/login.vue

@@ -221,30 +221,8 @@ export default {
     getContainer() {
     getContainer() {
       return this.$refs.showAuth;
       return this.$refs.showAuth;
     },
     },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query');
-      let fixedParams = {
-          cta_itemno: '',
-          cta_name: '',
-          previous_url: this.preUrl || '',
-          redirect_url: '',
-          // $brand_id: uni.getStorageSync('groupId'),
-          // $location: uni.getStorageSync('mallid'),
-          $channel: optionsQuery.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery.utm_channel || '',
-          $utm_method: optionsQuery.utm_method || '',
-          $utm_source: optionsQuery.utm_source || '',
-          $utm_function: optionsQuery.utm_function || '',
-          $utm_user: optionsQuery.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params);
-    },
     // 获取验证码
     // 获取验证码
     onCode: function () {
     onCode: function () {
-      // console.log(191);
-      // return;
       if (this.check()) {
       if (this.check()) {
         this.getCodeData();
         this.getCodeData();
       }
       }

+ 5 - 2
src/pages/parkingFee/components/base/parkingFeeDetailSuccess.vue

@@ -7,7 +7,8 @@
         <div class="parking-price">
         <div class="parking-price">
           <div class="price">{{ (detail.payFee / 100) | currency }}</div>
           <div class="price">{{ (detail.payFee / 100) | currency }}</div>
           <div class="price-text">
           <div class="price-text">
-            {{ ['支付成功', '支付失败', '已退款'][detail.payStatus] }}
+            <!-- {{ ['支付成功', '支付失败', '已退款'][detail.payStatus] }} -->
+            {{ detail.orderStatus | orderStatus }}
           </div>
           </div>
         </div>
         </div>
         <div class="parking-part parking-detail">
         <div class="parking-part parking-detail">
@@ -63,8 +64,10 @@
           </div>
           </div>
           <div class="parking-info-item">
           <div class="parking-info-item">
             <span class="info-key">会员等级减免</span>
             <span class="info-key">会员等级减免</span>
+            <!-- // (detail.discountInfo.memberLevelDiscount / 100) | currency -->
             <span class="info-value">{{
             <span class="info-value">{{
-              (detail.discountInfo.memberLevelDiscount / 100) | currency
+              
+              detail.discountInfo && detail.discountInfo.memberLevelDiscount
             }}</span>
             }}</span>
           </div>
           </div>
           <div class="parking-info-item">
           <div class="parking-info-item">

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

@@ -47,7 +47,8 @@
         >
         >
           <div>停车时长 : {{ item.serviceMin | parkingTime }}</div>
           <div>停车时长 : {{ item.serviceMin | parkingTime }}</div>
           <div style="margin-right: 20px">
           <div style="margin-right: 20px">
-            {{ ['支付成功', '支付失败', '已退款'][item.refundStatus] }}
+            {{ item.orderStatus | orderStatus  }}
+            <!-- {{ ['支付成功', '支付失败', '已退款'][] item.refundStatus | orderStatus }} -->
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>

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

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y">
+  <scroll-view scroll-y="true" class="scroll-Y">
     <!--    <wx-points-commit ref='wxPointsCommit'></wx-points-commit>-->
     <!--    <wx-points-commit ref='wxPointsCommit'></wx-points-commit>-->
 
 
     <!--    <authorize ref="authorize"></authorize>-->
     <!--    <authorize ref="authorize"></authorize>-->

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

@@ -153,7 +153,7 @@ export default {
 }
 }
 
 
 .color-scroll-Y {
 .color-scroll-Y {
-  background: #f5f7fe;
+  background: #F4F7FF;
   // background: red;
   // background: red;
 }
 }
 
 

+ 19 - 95
src/pages/parkingFee/mixins/parkingFee.js

@@ -84,7 +84,7 @@ export default {
       }
       }
     },
     },
   },
   },
-  async created(params) {},
+  async created(params) { },
   mounted() {
   mounted() {
     setTimeout(() => {
     setTimeout(() => {
       uni.setNavigationBarTitle({
       uni.setNavigationBarTitle({
@@ -272,32 +272,6 @@ export default {
     //缴费说明隐藏显示
     //缴费说明隐藏显示
     top_display() {
     top_display() {
       this.init_ch = !this.init_ch;
       this.init_ch = !this.init_ch;
-      // 缴费说明展开/收起埋点(增加动作参数)
-      this.sensorsClick('$ClickExpandPaymentInstructions', {
-        action: this.init_ch ? 'open' : 'close',
-        redirect_url: '',
-        cta_itemno: '',
-        cta_name: '',
-      });
-    },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query');
-      let fixedParams = {
-          previous_url: this.preUrl || '',
-          // 原previous_url: uni.getStorageSync('previousUrl') || ''
-          // previous_url: 使用sdk预置参数$referrer,
-          $brand_id: uni.getStorageSync('groupId'),
-          $location: uni.getStorageSync('mallid'),
-          $channel: optionsQuery?.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery?.utm_channel || '',
-          $utm_method: optionsQuery?.utm_method || '',
-          $utm_source: optionsQuery?.utm_source || '',
-          $utm_function: optionsQuery?.utm_function || '',
-          $utm_user: optionsQuery?.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params);
     },
     },
     // 唤起键盘
     // 唤起键盘
     clickShowKeyboard(index) {
     clickShowKeyboard(index) {
@@ -337,43 +311,38 @@ export default {
         }
         }
       }
       }
     },
     },
-
     // 校验车牌号
     // 校验车牌号
     preHandleSearch() {
     preHandleSearch() {
-      if ( this.disabledBtn ) return
+      if (this.disabledBtn) return
       uni.setStorageSync('carList', [
       uni.setStorageSync('carList', [
         ...new Set([this.vehicleNumber, ...this.carList]),
         ...new Set([this.vehicleNumber, ...this.carList]),
       ].slice(0, 6));
       ].slice(0, 6));
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
         name: 'parkingFeeDetail',
         name: 'parkingFeeDetail',
       });
       });
-      this.$router.push({
-        path: 'parkingFeeDetail',
-        query: {
-          vehicleNo: this.vehicleNumber,
-        },
-      });
+      this.$nextTick(() => {
+        this.$router.push({
+          path: 'parkingFeeDetail',
+          query: {
+            vehicleNo: this.vehicleNumber,
+          },
+        });
+      })
     },
     },
     // 历史车牌快速查询
     // 历史车牌快速查询
-    toHandleSearch(carno) {
-      // uni.getStorageSync('carList');
-
-      uni.setStorageSync('carList', [...new Set([carno, ...this.carList])].slice(0, 6));
-
+    toHandleSearch(vehicleNo) {
+      uni.setStorageSync('carList', [...new Set([vehicleNo, ...this.carList])].slice(0, 6));
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
         name: 'parkingFeeDetail',
         name: 'parkingFeeDetail',
       });
       });
-
-      this.$router.push({
-        path: 'parkingFeeDetail',
-        query: {
-          vehicleNo: carno,
-        },
+      this.$nextTick(() => {
+        this.$router.push({
+          path: 'parkingFeeDetail',
+          query: {
+            vehicleNo,
+          },
+        });
       });
       });
-
-      // this.throttle(() => {
-      //   this.handleSearch(carno, '$ClickHistoryAndPayment');
-      // }, 3000);
     },
     },
     // 查询车费信息
     // 查询车费信息
     async handleSearch(carno, clickEvent = '$ClickQueryAndPayment') {
     async handleSearch(carno, clickEvent = '$ClickQueryAndPayment') {
@@ -400,17 +369,7 @@ export default {
           carTypeName = 'special';
           carTypeName = 'special';
           break;
           break;
       }
       }
-      // this.sensorsClick(clickEvent, { $car_type: carTypeName })
-      // TODO: 暂定埋点传参为车牌类型,是否需要其他参数比如车牌号码;埋点位置是否要放在查询接口回调函数中
       this.$md(params);
       this.$md(params);
-      // console.log(539, uni.getStorageSync('handleUser'));
-      // try {
-      //   const res = await checkOut(carno)
-      //   console.log(res)
-      // } catch ( err ) {
-      //   console.log('errerrerrerr',err)
-      // }
-      // return
       this.$request({
       this.$request({
         // url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
         // url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
         url: this.$baseURL + 'api/1.0/park/checkCarIsInParkAndCarFee',
         url: this.$baseURL + 'api/1.0/park/checkCarIsInParkAndCarFee',
@@ -468,13 +427,6 @@ export default {
               icon: 'none',
               icon: 'none',
             });
             });
           }
           }
-          this.sensorsClick(clickEvent, {
-            car_type: carTypeName,
-            redirect_url: redirectUrl,
-            time: parkTime,
-            cta_itemno: '',
-            cta_name: '',
-          });
         })
         })
         .catch((err) => {
         .catch((err) => {
           // uni.hideLoading();
           // uni.hideLoading();
@@ -521,11 +473,6 @@ export default {
         return;
         return;
       }
       }
       this.$router.push({ path: 'parkingFeeList' });
       this.$router.push({ path: 'parkingFeeList' });
-      this.sensorsClick('$ClickParkRouter', {
-        cta_itemno: '',
-        cta_name: '缴费记录',
-        redirect_url: '/pages/parkingFee/parkingFeeList.vue',
-      });
     },
     },
     // 车牌管理
     // 车牌管理
     doRouter2: function () {
     doRouter2: function () {
@@ -535,11 +482,6 @@ export default {
       }
       }
       uni.removeStorageSync('passLogin');
       uni.removeStorageSync('passLogin');
       this.$router.push({ path: 'vehicleManagement' });
       this.$router.push({ path: 'vehicleManagement' });
-      this.sensorsClick('$ClickParkRouter', {
-        cta_itemno: '',
-        cta_name: '车牌管理',
-        redirect_url: '/pages/parkingFee/vehicleManagement.vue',
-      });
     },
     },
     //停车发票
     //停车发票
     doRouter1: function () {
     doRouter1: function () {
@@ -563,27 +505,9 @@ export default {
       if (this.$store.state.passLogin) {
       if (this.$store.state.passLogin) {
       }
       }
       this.$router.push({ path: 'parkingReceipt' });
       this.$router.push({ path: 'parkingReceipt' });
-      this.sensorsClick('$ClickParkRouter', {
-        cta_itemno: '',
-        cta_name: '停车发票',
-        redirect_url: '/pages/parkingFee/parkingReceipt/parkingReceipt.vue',
-      });
     },
     },
     //停车券兑换
     //停车券兑换
     doRouter3: function () {
     doRouter3: function () {
-      // this.$router.push({
-      //   path: '/pages/pointsMall/pointsMall?exchangeTypes=2',
-      // })
-      // TODO 跳转到crm的积分商城
-      // this.$router.push({ path: 'pointsMall?exchangeTypes=2' });
-      // this.sensorsClick('$ClickParkRouter', {
-      //   cta_itemno: '',
-      //   cta_name: '停车券兑换',
-      //   redirect_url: '/pages/pointsMall/pointsMall.vue',
-      // });
-      // uni.navigateTo({
-      //   url: '/pages/pointsMall/pointsMall?exchangeTypes=2',
-      // })
       window.toWXSendMsg({
       window.toWXSendMsg({
         type: 'toPage',
         type: 'toPage',
         options: {
         options: {

+ 77 - 87
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -43,76 +43,9 @@ export default {
       }
       }
     }, 300);
     }, 300);
     this.pageInit();
     this.pageInit();
-    console.log(44);
   },
   },
-  /*watch:{
-   checkedCouponList(oldVal,newVal) {
-
-   console.log({newVal,oldVal})
-   }
-   },*/
   methods: {
   methods: {
-    remainPriceInit() {
-      // this.usingTotalDiscount
-      // const {maxOneDayCoupons, remainConsumeTime, hourPrice} = checkOutResponse.parkingRule;
-      // const {
-      //   usingTotalDiscount, // 使用总抵扣
-      //   coupons
-      // } = checkOutResponse.discountInfo;
-      // const {
-      //   totalFee, // 应缴
-      //   actualPayFee // 应付金额
-      // } = checkOutResponse.parkingRecord;
-      // // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
-      // let remainPrice = remainConsumeTime * hourPrice;
-      // if ( remainPrice > actualPayFee ) {
-      //   remainPrice = actualPayFee;
-      // }
-      // let couponPrice = 0
-      // // 确认优惠券是否可选择
-      // let couponsList = coupons.sort((itema,itemb) => itema.discountFee - itemb.discountFee)
-      // couponsList = couponsList.map(elm => {
-      //   if ( !elm.defaultSelected ) {
-      //     if ( elm.discountFee <=  remainPrice && couponPrice <= remainPrice) {
-      //       elm.disabled = false
-      //     } else {
-      //       elm.disabled = true
-      //     }
-      //   }
-      // })
-      // console.log(343, {couponsList});
-      // commit('setCoupons', couponsList);
-    },
     pageInit() {
     pageInit() {
-      // const {maxOneDayCoupons, remainConsumeTime, hourPrice} = checkOutResponse.parkingRule;
-      // const {
-      //   usingTotalDiscount, // 使用总抵扣
-      //   coupons
-      // } = checkOutResponse.discountInfo;
-      // const {
-      //   totalFee, // 应缴
-      //   actualPayFee // 应付金额
-      // } = checkOutResponse.parkingRecord;
-      // // 剩余可使用的优惠金额,支持动态计算; 优惠时长,不可能全部使用,不能超过车费减去优惠的金额;不能超过单次的应付金额
-      // let remainPrice = remainConsumeTime * hourPrice;
-      // if ( remainPrice > actualPayFee ) {
-      //   remainPrice = actualPayFee;
-      // }
-      // let couponPrice = 0
-      // // 确认优惠券是否可选择
-      // let couponsList = coupons.sort((itema,itemb) => itema.discountFee - itemb.discountFee)
-      // couponsList = couponsList.map(elm => {
-      //   if ( !elm.defaultSelected ) {
-      //     if ( elm.discountFee <=  remainPrice && couponPrice <= remainPrice) {
-      //       elm.disabled = false
-      //     } else {
-      //       elm.disabled = true
-      //     }
-      //   }
-      // })
-      // console.log(343, {couponsList});
-      // commit('setCoupons', couponsList);
-
       /*
       /*
        * 电子优惠券初始化逻辑(后端处理)
        * 电子优惠券初始化逻辑(后端处理)
        *
        *
@@ -120,12 +53,11 @@ export default {
        * 2、superposition  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加);
        * 2、superposition  叠加使用规则 (1不可叠加,2仅同类型可叠加,3可叠加);
        * */
        * */
       this.couponList = [...this.coupons];
       this.couponList = [...this.coupons];
-      console.log(129, this.couponList);
+      this.remainPrice = this.usingTotalDiscount * 1;
       if (this.couponList.length) {
       if (this.couponList.length) {
         this.couponList = this.couponList.map((elm, index) => {
         this.couponList = this.couponList.map((elm, index) => {
           elm.disabled = true;
           elm.disabled = true;
           const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
           const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
-          console.log(132, selected, elm.hasOwnProperty('selected'));
           if (selected) {
           if (selected) {
             this.maxCouponFee = this.maxCouponFee + elm.discountFee;
             this.maxCouponFee = this.maxCouponFee + elm.discountFee;
             this.checkedCouponList.push(`coupon${index}`);
             this.checkedCouponList.push(`coupon${index}`);
@@ -135,7 +67,6 @@ export default {
           }
           }
           return elm;
           return elm;
         });
         });
-        console.log(143, this.checkedCouponList);
         if (!this.checkedCouponList.length) {
         if (!this.checkedCouponList.length) {
           this.couponList = this.couponList.map((elm) => {
           this.couponList = this.couponList.map((elm) => {
             elm.disabled = false;
             elm.disabled = false;
@@ -154,12 +85,15 @@ export default {
         this.checkedCouponList = this.checkedCouponList.filter((i) => i !== name);
         this.checkedCouponList = this.checkedCouponList.filter((i) => i !== name);
         setTimeout(() => {
         setTimeout(() => {
           // console.log(158, this.checkedCouponList);
           // console.log(158, this.checkedCouponList);
-          this.groupedCouponData();
+          // this.groupedCouponData();
+          this.remainPrice = this.remainPrice - this.couponList[index].discountFee
+          this.newGroupedCouponData()
         }, 100)
         }, 100)
         return;
         return;
       }
       }
       // 如果有选中项
       // 如果有选中项
       const item = this.couponList[index];
       const item = this.couponList[index];
+      this.remainPrice = this.remainPrice + this.couponList[index].discountFee
       if (!item.disabled) {
       if (!item.disabled) {
         this.checkedCouponList.push(`coupon${index}`);
         this.checkedCouponList.push(`coupon${index}`);
         setTimeout(() => {
         setTimeout(() => {
@@ -194,23 +128,41 @@ export default {
       })
       })
       // 对分好组的优惠券进行不同规则处理
       // 对分好组的优惠券进行不同规则处理
       Object.keys(groupedData).forEach(key => {
       Object.keys(groupedData).forEach(key => {
-        const { selectedList, noSelectedList } = groupedData[key]; //
+        const { selectedList, noSelectedList } = groupedData[key]; // 取出已选择的和未选择的
         const { superposition, limitCountPerOrder = 0 } = [...selectedList, ...noSelectedList][0]; // 获取当前批次兑换的类型和可选上限
         const { superposition, limitCountPerOrder = 0 } = [...selectedList, ...noSelectedList][0]; // 获取当前批次兑换的类型和可选上限
         switch (superposition) {
         switch (superposition) {
-          case '1':
-            couponList = couponList.map(elm => {
-              if (elm.superposition === '1') {
-                elm.disabled = this.checkedCouponList.length > 0;
+          case '1': // 不可叠加
+            couponList = couponList.map((item, index) => {
+              const elmName = `coupon${index}`;
+              // 如果是不可叠加的电子优惠券,设置未选中的为不可选择
+              if (item?.superposition === '1') {
+                if (selectedList.length) {// 如果存在已选择项,设置未选中的为不可选择
+                  item.disabled = this.checkedCouponList.indexOf(elmName) < 0;
+                  /* 
+                  TODO: 如果不可叠加电子券的选择规则改变为,选中某一项不可叠加券,其他券不可选择,则打开此处注释
+                  if (item.superposition === '2') {
+                    item.disabled = selectedList.length > 0
+                  } */
+                } else {
+                  item.disabled = this.checkedCouponList.length > 0;
+                }
               }
               }
-              return elm
+              /* 
+              // TODO: 如果不可叠加电子券的选择规则改变为,选中某一项不可叠加券,其他券不可选择,则打开此处注释
+              // 如果存在已选的电子优惠券,将其他类型的优惠券设置为不可选中
+              if ( item.superposition === '2' && selectedList.length) {
+                item.disabled = true
+              } */
+              return item
             })
             })
             break
             break
           case '2':
           case '2':
+            // 统计未选择项是否需要禁用
             noSelectedList.forEach(elm => {
             noSelectedList.forEach(elm => {
               const _elm = { ...couponList[elm.index] };
               const _elm = { ...couponList[elm.index] };
               couponList = couponList.map((item, index) => {
               couponList = couponList.map((item, index) => {
                 if (index === elm.index && limitCountPerOrder > 0) {
                 if (index === elm.index && limitCountPerOrder > 0) {
-                  elm.disabled = selectedList.length >= limitCountPerOrder;
+                  // elm.disabled = selectedList.length >= limitCountPerOrder;
                   _elm.disabled = selectedList.length >= limitCountPerOrder;
                   _elm.disabled = selectedList.length >= limitCountPerOrder;
                   return _elm
                   return _elm
                 }
                 }
@@ -222,6 +174,46 @@ export default {
       })
       })
       this.couponList = [...couponList];
       this.couponList = [...couponList];
     },
     },
+    // 对不同类型的优惠券进行汇总统计
+    newGroupedCouponData() {
+      let couponList = [...this.couponList]; // 获取目前用户的电子券
+      if (!this.checkedCouponList.length) {
+        this.couponList = couponList.map(elm => {
+          elm.disabled = false
+          return elm;
+        })
+        return
+      }
+      const index = this.item2Number(this.checkedCouponList[0])
+      const item = this.couponList[index];
+      const { superposition, limitCountPerOrder = 0, name } = item;
+      switch (superposition) {
+        case '1': // 不可叠加
+          couponList = couponList.map((elm, i) => {
+            elm.disabled = i !== index
+            return elm;
+          })
+          break;
+        case '2': // 同类型可叠加
+          couponList = couponList.map((elm, i) => {
+            elm.disabled = false; // 默认可选
+            const elmName = `coupon${i}`;
+            if (elm.name === name) {
+              if (limitCountPerOrder) { // 是否存在上限
+                if (this.checkedCouponList.length >= limitCountPerOrder) {
+                  elm.disabled = this.checkedCouponList.indexOf(elmName) < 0
+                }
+              }
+            } else {
+              elm.disabled = true; // 非同批次的优惠券设置为不可选择
+            }
+            return elm
+          })
+          break;
+      }
+      console.log(282, couponList);
+      this.couponList = [...couponList];
+    },
     // 根据电子券规则判断是否可选
     // 根据电子券规则判断是否可选
     isDisabledByRule(item) {
     isDisabledByRule(item) {
       const { parkMallCode } = this.orderDetail.parkInfo;
       const { parkMallCode } = this.orderDetail.parkInfo;
@@ -253,16 +245,18 @@ export default {
 
 
       // 浦东每次缴费超限控制、沈阳每日超限控制
       // 浦东每次缴费超限控制、沈阳每日超限控制
       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) => {
+        this.couponList = this.couponList.map((e, i) => {
           if (this.checkedCouponList.findIndex((c) => c === `coupon${i}`) === -1) {
           if (this.checkedCouponList.findIndex((c) => c === `coupon${i}`) === -1) {
             e.disabled = true;
             e.disabled = true;
           }
           }
+          return e
         });
         });
         return;
         return;
       }
       }
 
 
       // 选中状态赋值
       // 选中状态赋值
-      this.groupedCouponData();
+      // this.groupedCouponData();
+      this.newGroupedCouponData();
     },
     },
     // 是否选中
     // 是否选中
     isCheck(val) {
     isCheck(val) {
@@ -271,7 +265,7 @@ export default {
     // 超限提示
     // 超限提示
     crossMessage() {
     crossMessage() {
       const { parkMallCode } = this.orderDetail.parkInfo;
       const { parkMallCode } = this.orderDetail.parkInfo;
-      const { maxOneDayCoupons, maxonedaydiscountFee, remainConsumeTime, hourPrice } = this.orderDetail.parkingRule;
+      const { maxOneDayCoupons, maxonedaydiscountFee, remainConsumeTime, hourPrice, availableDiscountFee } = this.orderDetail.parkingRule;
       const {
       const {
         usingTotalDiscount, // 使用总抵扣
         usingTotalDiscount, // 使用总抵扣
         coupons,
         coupons,
@@ -319,15 +313,11 @@ export default {
        // });
        // });
        }*/
        }*/
       // 深圳超限处理
       // 深圳超限处理
-      if (parkMallCode === 5 && usingTotalDiscount >= remainPrice) {
+      if (parkMallCode === 5 && this.remainPrice  > actualPayFee) {
         return Toast({
         return Toast({
-          message: `每日最高可抵扣${remainPrice}元`,
+          message: `每日最高可抵扣${this.remainPrice}元`,
           icon: 'none',
           icon: 'none',
         });
         });
-        // return uni.showToast({
-        //   title: `每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元`,
-        //   icon: 'none',
-        // });
       }
       }
     },
     },
     // 确认
     // 确认

+ 77 - 52
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -102,8 +102,8 @@ export default {
   methods: {
   methods: {
     // 前往支付
     // 前往支付
     async toPay() {
     async toPay() {
-      console.log('orderDetail', this.orderDetail);
       const { parkingRecord, discountInfo } = this.orderDetail;
       const { parkingRecord, discountInfo } = this.orderDetail;
+      const { coupons, points } = discountInfo
       try {
       try {
         const params = {
         const params = {
           // vehicleNo: '', // 车牌号
           // vehicleNo: '', // 车牌号
@@ -118,21 +118,39 @@ export default {
           discountInfo: {
           discountInfo: {
             usingTotalDiscount: discountInfo?.usingTotalDiscount || 0, //优惠金额"
             usingTotalDiscount: discountInfo?.usingTotalDiscount || 0, //优惠金额"
             actualUsedDiscount: discountInfo?.usingTotalDiscount || 0, //实际优惠金额
             actualUsedDiscount: discountInfo?.usingTotalDiscount || 0, //实际优惠金额
-            // points: {
-            //   discountTime: 60,
-            //   // 如果是深圳的话,是金额,还得计算出对应的积分
-            //   discountFee: discountInfo.points[0].maxDiscountFee,
-            //   discountPoints:
-            //     (discountInfo.points[0].pointsPerUnit /
-            //       discountInfo.points[0].unitAmount) *
-            //     discountInfo.points[0].maxDiscountFee,
-            // },
           },
           },
         };
         };
+        // 积分
+        if (points.length && points[0].discountFee > 0) {
+          // 15 兑换 5元
+          const { pointsPerUnit, unitAmount, discountFee, available } = points[0]
+          params.discountInfo.points = {
+            "discountTime": discountFee / pointsPerUnit,
+            "discountFee": discountFee,
+            "discountPoints": discountFee * (unitAmount / pointsPerUnit)
+          }
+        }
+        // 优惠券
+        if (coupons.length) {
+          const selectedCoupons = coupons.filter(elm => {
+            const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
+            return selected
+          })
+          if (selectedCoupons.length) {
+            params.discountInfo.coupons = selectedCoupons
+          }
+        }
         const res = await ordersAndPrepay(params);
         const res = await ordersAndPrepay(params);
         console.log('orderDetail', res);
         console.log('orderDetail', res);
-
-        this.kerryPayment(res.sessionId)
+        if (res?.paymentType === 'NO_FEE_PAY') {
+          this.btnLoading = false;
+          this.$router.replace({
+            path: 'parkingFeeSuccess?vehicleNo=' + this.$route.query.vehicleNo,
+          });
+          // 支付成功
+          return
+        }
+        this.kerryPayment(res.sessionId);
       } catch (err) {
       } catch (err) {
         console.log(err);
         console.log(err);
       }
       }
@@ -142,7 +160,8 @@ export default {
       let appId = uni.getStorageSync('appid');
       let appId = uni.getStorageSync('appid');
       let openId = uni.getStorageSync('openid') || this.openid;
       let openId = uni.getStorageSync('openid') || this.openid;
       if (platform === 'miniprogram') {
       if (platform === 'miniprogram') {
-        appId = 'wx92c3e55fbef6b2af';
+        // appId = 'wx92c3e55fbef6b2af';
+        appId = 'wxd830fe4d1e04988e';
       }
       }
       const params = {
       const params = {
         region: 'cn',
         region: 'cn',
@@ -207,42 +226,11 @@ export default {
                 } else {
                 } else {
                   this.btnLoading = false;
                   this.btnLoading = false;
                   this.$router.replace({
                   this.$router.replace({
-                    path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
+                    path: 'parkingFeeSuccess?vehicleNo=' + this.$route.query.vehicleNo,
                   });
                   });
                 }
                 }
               });
               });
             }
             }
-            return;
-            // 微信支付接口
-            // uni.requestPayment({
-            //   provider: 'wxpay',
-            //   timeStamp: prepayJson.timeStamp,
-            //   nonceStr: prepayJson.nonceStr,
-            //   package: prepayJson.package,
-            //   signType: prepayJson.signType,
-            //   paySign: prepayJson.paySign,
-            //   success: () => {
-            //     uni.showModal({
-            //       showCancel: false,
-            //       title: '提示',
-            //       content: '支付成功',
-            //       complete: () => {
-            //         this.sensorsClick('$ClickParkingPay', {
-            //           car_no: payParams.carno,
-            //           pay_fee: payParams.payfee,
-            //           total_fee: payParams.totalfee,
-            //           redirect_path: 'pages/parkingFee/parkingFeeSuccess',
-            //         });
-            //         this.$router.replace({
-            //           path: './parkingFeeSuccess?carno=' + this.parkInfo.carno,
-            //         });
-            //       },
-            //     });
-            //   },
-            //   fail: () => {
-            //     this.reCreateParkOrder();
-            //   },
-            // });
           } else {
           } else {
             // this.reCreateParkOrder();
             // this.reCreateParkOrder();
           }
           }
@@ -308,13 +296,36 @@ export default {
       console.log(83838383);
       console.log(83838383);
 
 
       // this.$store.commit('order/SET_ORDER_DETAIL', checkOutResponse);
       // this.$store.commit('order/SET_ORDER_DETAIL', checkOutResponse);
-      this.$store.dispatch('order/orderInit', this.$route.query.vehicleNo);
-      // try {
-      //   const res = await checkOut(this.$route.query.carno)
-      //   console.log(res)
-      // } catch ( err ) {
-      //   console.log(err)
-      // }
+      try {
+        this.$store.dispatch('order/orderInit', {
+          vehicleNo: this.$route.query.vehicleNo,
+          callback: (res) => {
+            console.log(303, res);
+            if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(res.code)) {
+              // 当前车辆没有查到账单
+              this.$router.replace({
+                path: 'parkingFeePayment',
+                query: {
+                  msg: res.message,
+                  vehicleNo: this.$route.query.vehicleNo,
+                },
+              });
+              return
+            }
+            if (res.code === "INTERNAL_SERVER_ERROR") {
+              setTimeout(() => {
+                this.$router.back()
+              }, 1000)
+            }
+          }
+        });
+      } catch (err) {
+        console.log('查询车辆是否在场的报错信息?', err, err.code === "INTERNAL_SERVER_ERROR");
+        // 如果网络异常(这里是因为订单页面存在空白场景,才需要单独处理报错交互)
+        if (err.code === "INTERNAL_SERVER_ERROR") {
+          this.$router.back()
+        }
+      }
     },
     },
     // 停车优惠
     // 停车优惠
     discounts() {
     discounts() {
@@ -327,6 +338,20 @@ export default {
         path: 'parkingFeeDiscounts',
         path: 'parkingFeeDiscounts',
       });
       });
     },
     },
+    setColor() {
+      window?.toWXSendMsg({
+        type: 'uni_func',
+        funcName: 'setNavigationBarColor',
+        options: {
+          frontColor: '#000000',
+          backgroundColor: '#2151C5',
+        },
+      });
+      // uni.setNavigationBarColor({
+      //   frontColor: '#000000',
+      //   backgroundColor: '#FAFBFF',
+      // });
+    },
     // 是否展示优惠信息
     // 是否展示优惠信息
     // isShowDiscounts(params) {
     // isShowDiscounts(params) {
     //   console.log(277, params?.parkingRule?.enableCoupon);
     //   console.log(277, params?.parkingRule?.enableCoupon);

+ 5 - 0
src/pages/parkingFee/mixins/parkingFeeDetailSuccess.js

@@ -117,4 +117,9 @@ export default {
       });
       });
     },
     },
   },
   },
+  filters:{
+    orderStatus(val) {
+      return ORDER_STATUS[val]
+    } 
+  }
 };
 };

+ 5 - 1
src/pages/parkingFee/mixins/parkingFeeList.js

@@ -4,6 +4,7 @@ import LoginDom from '@/components/Login/Login.vue';
 import { wxToLoginCallback } from '@/utils';
 import { wxToLoginCallback } from '@/utils';
 import { orders } from '@/api/parking';
 import { orders } from '@/api/parking';
 import orderMockData from '@/api/mockData/orders.json'
 import orderMockData from '@/api/mockData/orders.json'
+import {ORDER_STATUS} from '@/common/js/BaseDictionary'
 
 
 let canloading = true;
 let canloading = true;
 let pageNum = 0;
 let pageNum = 0;
@@ -101,6 +102,9 @@ export default {
       }
       }
       return `${minutes}分钟`;
       return `${minutes}分钟`;
     },
     },
+    orderStatus(val) {
+      return ORDER_STATUS[val]
+    }
   },
   },
   methods: {
   methods: {
     bindscrolltolower: function () {
     bindscrolltolower: function () {
@@ -140,7 +144,7 @@ export default {
         canloading = true;
         canloading = true;
         this.initPage();
         this.initPage();
         uni.showToast({
         uni.showToast({
-          title: 'res.data.msg',
+          title: err.langMessage,
           duration: 2000,
           duration: 2000,
           icon: 'none',
           icon: 'none',
         });
         });

+ 1 - 0
src/pages/parkingFee/mixins/parkingFeeSuccess.js

@@ -1,5 +1,6 @@
 import payIcon from '../static/images/hint.png';
 import payIcon from '../static/images/hint.png';
 import { mapState } from 'vuex';
 import { mapState } from 'vuex';
+import uni from '@/utils/uniHooks';
 
 
 export default {
 export default {
   onLoad(params) {
   onLoad(params) {

+ 355 - 381
src/pages/parkingFee/mixins/parkingReceipt/parkingApplication.js

@@ -1,391 +1,365 @@
 
 
-  // const app = getApp()
-  const app = {};
-  import arrowIcon from '../../static/images/arrows.png';
-  import { mapState } from 'vuex';
-  // import MemberCacheTool from '@/utils/member-cache-tool.js';
-  import uni from '@/utils/uniHooks';
-  import { getUrlParams } from '@/utils/index.js';
-  import { Dialog, Toast } from 'vant';
+// const app = getApp()
+const app = {};
+import arrowIcon from '../../static/images/arrows.png';
+import { mapState } from 'vuex';
+// import MemberCacheTool from '@/utils/member-cache-tool.js';
+import uni from '@/utils/uniHooks';
+import { getUrlParams } from '@/utils/index.js';
+import { Dialog, Toast } from 'vant';
 
 
-  export default {
+export default {
   data() {
   data() {
-  return {
-  picUrl: this.$picUrl,
-  globalData: app.globalData,
-  arrowIcon: arrowIcon,
-  isShow: false,
-  isDefaultEMail: false,
-  ids: [],
-  condition: {
-  // openid: this.openid,
-  // groupId: this.groupId,
-  // vipcode: this.member?.vipcode,
-  invoiceName: '', // 否|发票名称
-  invoiceCategory: 0, // 发票类型 0:停车缴费  1:活动
-  invoiceType: 0, // 发票类型:0:增值税普通电子发票
-  remark: '',
-  invoiceTitleId: 0, // long|发票抬头id
-  ids: [], // 被选中的缴费记录id
-  isDefaultEmail: '1', // 是|邮箱是否默认 0:否 1:是
-  mailbox: '',
-},
-  headerInfo: {},
-  // 总金额,单位分
-  invoiceAmount: 0,
-  orderInfo: {},
-  type: '', // 当前是活动还是停车
-  isSubmitFlag: true, // 发票提交申请的flag,
-  pageOptions: null,
-  preUrl: '',
-  orderQuantity: 0,
-  parkingOrder: null,
-};
-},
+    return {
+      picUrl: this.$picUrl,
+      globalData: app.globalData,
+      arrowIcon: arrowIcon,
+      isShow: false,
+      isDefaultEMail: false,
+      ids: [],
+      condition: {
+        // openid: this.openid,
+        // groupId: this.groupId,
+        // vipcode: this.member?.vipcode,
+        invoiceName: '', // 否|发票名称
+        invoiceCategory: 0, // 发票类型 0:停车缴费  1:活动
+        invoiceType: 0, // 发票类型:0:增值税普通电子发票
+        remark: '',
+        invoiceTitleId: 0, // long|发票抬头id
+        ids: [], // 被选中的缴费记录id
+        isDefaultEmail: '1', // 是|邮箱是否默认 0:否 1:是
+        mailbox: '',
+      },
+      headerInfo: {},
+      // 总金额,单位分
+      invoiceAmount: 0,
+      orderInfo: {},
+      type: '', // 当前是活动还是停车
+      isSubmitFlag: true, // 发票提交申请的flag,
+      pageOptions: null,
+      preUrl: '',
+      orderQuantity: 0,
+      parkingOrder: null,
+    };
+  },
   created() {
   created() {
-  // const options = this.$route.query;
-  // console.log('===>onLoad', options);
-  // this.pageOptions = options;
-  // 埋点本地化
-  this.preUrl = uni.getStorageSync('previousUrl');
-  uni.setStorageSync(
-  'previousUrl',
-  '/pages/parkingFee/parkingReceipt/parkingApplication.vue'
-  );
-},
+    // const options = this.$route.query;
+    // console.log('===>onLoad', options);
+    // this.pageOptions = options;
+    // 埋点本地化
+    this.preUrl = uni.getStorageSync('previousUrl');
+    uni.setStorageSync(
+      'previousUrl',
+      '/pages/parkingFee/parkingReceipt/parkingApplication.vue'
+    );
+  },
   mounted() {
   mounted() {
-  // console.log(253, this.ids);
-  setTimeout(() => {
-  uni.setNavigationBarTitle({
-  title: '发票申请',
-});
-}, 300);
-  // console.clear();
-  const query = getUrlParams();
-  // console.log('是否重新回到改页面', this.pageOptions);
-  // console.log('是否重新回到改页面', query);
-  // console.log(260, this.$route.query);
-  this.pageOptions = query;
-  if (this.pageOptions) {
-  const options = this.pageOptions;
-  // console.log('===>onShow', options);
-  // console.log('===>onShow', options.ids);
+    // console.log(253, this.ids);
+    setTimeout(() => {
+      uni.setNavigationBarTitle({
+        title: '发票申请',
+      });
+    }, 300);
+    // console.clear();
+    const query = getUrlParams();
+    // console.log('是否重新回到改页面', this.pageOptions);
+    // console.log('是否重新回到改页面', query);
+    // console.log(260, this.$route.query);
+    this.pageOptions = query;
+    if (this.pageOptions) {
+      const options = this.pageOptions;
+      // console.log('===>onShow', options);
+      // console.log('===>onShow', options.ids);
 
 
-  if (options.type && options.money) {
-  this.type = options.type;
-  this.invoiceAmount = options.money;
-}
-  if (options.ids) {
-  const ids = options.ids;
-  if (ids.indexOf(',') > -1) {
-  this.ids = ids.split(',');
-} else {
-  this.ids =
-  typeof ids === 'string'
-  ? ids.indexOf('[') > -1
-  ? JSON.parse(ids)
-  : [ids]
-  : ids;
-}
-  this.orderQuantity = this.ids.length;
-  // console.log('获取订单信息');
-  this.getParkOrderInfo();
-  this.getInvoiceEmailInfo();
-}
-  if (options.header) {
-  if (typeof options.header == 'string') {
-  this.headerInfo = JSON.parse(options.header);
-} else if (typeof options.header == 'object') {
-  this.headerInfo = options.header;
-}
-} else {
-  this.getInvoiceTitle();
-}
-}
-},
+      if (options.type && options.money) {
+        this.type = options.type;
+        this.invoiceAmount = options.money;
+      }
+      if (options.ids) {
+        const ids = options.ids;
+        if (ids.indexOf(',') > -1) {
+          this.ids = ids.split(',');
+        } else {
+          this.ids =
+            typeof ids === 'string'
+              ? ids.indexOf('[') > -1
+                ? JSON.parse(ids)
+                : [ids]
+              : ids;
+        }
+        this.orderQuantity = this.ids.length;
+        // console.log('获取订单信息');
+        this.getParkOrderInfo();
+        this.getInvoiceEmailInfo();
+      }
+      if (options.header) {
+        if (typeof options.header == 'string') {
+          this.headerInfo = JSON.parse(options.header);
+        } else if (typeof options.header == 'object') {
+          this.headerInfo = options.header;
+        }
+      } else {
+        this.getInvoiceTitle();
+      }
+    }
+  },
   computed: {
   computed: {
-  ...mapState({
-  custTypeId: (state) => state.custTypeId,
-  groupId: (state) => state.groupId,
-  openid: (state) => state.openid,
-  mallId: (state) => state.mallId,
-  kipUserId: (state) => state.kipUserId,
-  userInfo: (state) => state.userInfo,
-  member: (state) => state.member,
-}),
-},
+    ...mapState({
+      custTypeId: (state) => state.custTypeId,
+      groupId: (state) => state.groupId,
+      openid: (state) => state.openid,
+      mallId: (state) => state.mallId,
+      kipUserId: (state) => state.kipUserId,
+      userInfo: (state) => state.userInfo,
+      member: (state) => state.member,
+    }),
+  },
   methods: {
   methods: {
-  changeShowMore() {
-  this.isShow = !this.isShow;
-},
-  changeDefaultEMail() {
-  this.isDefaultEMail = !this.isDefaultEMail;
-},
-  changeHeader() {
-  this.$router.push({
-  path: 'parkingChooseHeader?ids=' + this.ids,
-});
-},
-  gotoDetail() {
-  this.$store.commit('setTempParkingOrder', this.parkingOrder);
-  this.$router.push({
-  path: 'parkingOrderDetail?useParkingOrderCache=true',
-});
-  // this.$router.push({
-  //   path:
-  //     '/pages/parkingFee/parkingFeeDetailSuccess?orderNo=' +
-  //     this.orderInfo.orderNo,
-  // })
-},
-  // 查询全部抬头列表信息
-  getInvoiceTitle() {
-  const self = this;
-  const params = {
-  vipcode: this.member?.vipcode,
-};
-  self.$md(params);
-  // console.log(265, '开票信息', params);
-  // console.log(
-  //   265,
-  //   '开票信息 path: ',
-  //   self.$baseURL + 'api/1.0/invoiceTitle/page'
-  // );
-  uni.request({
-  url: self.$baseURL + 'api/1.0/invoiceTitle/page',
-  method: 'GET',
-  data: params,
-  header: JSON.parse(uni.getStorageSync('handleUser')),
-  success: (res) => {
-  // console.log('开票信息', res.data);
-  if (res.data.code === 0) {
-  const list = res.data.data;
-  let currentIndex = 0;
-  list.map((item, index) => {
-  if (item.setDefault == 1) currentIndex = index;
-});
-  const headerInfo = list[currentIndex] || {};
-  self.headerInfo = headerInfo;
-  // console.log('发票抬头--', self.headerInfo);
-} else {
-  // uni.showToast({
-  //   title: res.data.msg,
-  //   duration: 2000,
-  //   icon: 'none',
-  // });
-  Toast({
-  message: res.data.msg,
-});
-}
-},
-  fail: () => {
-  Toast({
-  message: '服务器开小差了呢,请您稍后再试',
-});
-  /* uni.showToast({
-   title: '服务器开小差了呢,请您稍后再试',
-   icon: 'none',
-   }); */
-},
-});
-},
-  // 根据选中的停车缴费记录id获取详情信息
-  getParkOrderInfo() {
-  // 如果当前是活动开票的话,则不差详情
-  if (this.type) return;
-  const self = this;
-  // console.log('根据选中的停车缴费记录id获取详情信息', this.ids);
-  self.$md(this.ids);
-  // console.log(
-  //   'getParkOrderInfo',
-  //   self.$baseURL + 'api/1.0/invoice/myParkOrderListByIds'
-  // );
-  // return;
-  uni.request({
-  url: self.$baseURL + 'api/1.0/invoice/myParkOrderListByIds',
-  method: 'POST',
-  data: typeof this.ids === 'string' ? [this.ids] : this.ids,
-  header: JSON.parse(uni.getStorageSync('handleUser')),
-  success: (res) => {
-  if (res.data.code === 0) {
-  const datas = res.data.data;
-  console.log('387387387387387387387获取详情信息', datas);
-  self.parkingOrder = datas;
-  self.invoiceAmount = (datas.invoiceAmount / 100).toFixed(2);
-  self.orderInfo = datas.list[0];
-} else {
-  /* uni.showToast({
-   title: res.data.msg,
-   duration: 2000,
-   icon: 'none',
-   }); */
-  Toast({
-  message: res.data.msg,
-});
-}
-},
-  fail: () => {
-  /* uni.showToast({
-   title: '服务器开小差了呢,请您稍后再试',
-   icon: 'none',
-   }); */
-  Toast({
-  message: '服务器开小差了呢,请您稍后再试',
-});
-},
-});
-},
-  // 获取用户邮箱信息
-  getInvoiceEmailInfo() {
-  const self = this;
-  // const openId = MemberCacheTool.getOpenId(app);
-  var data = {
-  openid: this.openId,
-  groupId: this.groupId,
-  vipcode: this.member?.vipcode,
-};
-  self.$md(data);
-  // console.log(
-  //   '获取用户邮箱信息',
-  //   self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo'
-  // );
-  // console.log(421, data);
-  uni.request({
-  url: self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo',
-  method: 'POST',
-  data: data,
-  header: JSON.parse(uni.getStorageSync('handleUser')),
-  success: (res) => {
-  if (res.data.code === 0) {
-  console.log('获取用户邮箱信息', res.data);
-  if (res.data.data) {
-  this.isDefaultEMail = true;
-  this.condition.mailbox = res.data.data;
-} else {
-  this.isDefaultEMail = false;
-  this.condition.mailbox = '';
-}
-} else {
-  /* uni.showToast({
-   title: res.data.msg,
-   duration: 2000,
-   icon: 'none',
-   }); */
-  Toast({
-  message: res.data.msg,
-});
-}
-},
-  fail: () => {
-  Toast({
-  title: '服务器开小差了呢,请您稍后再试',
-});
-  /* uni.showToast({
-   title: '服务器开小差了呢,请您稍后再试',
-   icon: 'none',
-   }); */
-},
-});
-},
-  submit() {
-  const self = this;
-  if (!self.condition.mailbox) {
-  /* uni.showToast({
-   title: '请输入电子邮箱地址',
-   duration: 2000,
-   icon: 'none',
-   }); */
-  Toast({
-  message: '请输入电子邮箱地址',
-});
-  return false;
-}
-  // const re =
-  //   /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/;
-  // if (re.test(self.condition.mailbox)) {
-  //   uni.showToast({
-  //     title: '电子邮箱格式有误,请输入正确的电子邮箱',
-  //     duration: 2000,
-  //     icon: 'none',
-  //   });
-  //   return false;
-  // }
-  if (self.type && self.type == 'activity') {
-  self.condition.invoiceCategory = 1;
-}
-  const params = self.condition;
-  params.ids = self.ids;
-  params.isDefaultEmail = self.isDefaultEMail ? '1' : '0';
-  params.invoiceTitleId = self.headerInfo.id;
+    changeShowMore() {
+      this.isShow = !this.isShow;
+    },
+    changeDefaultEMail() {
+      this.isDefaultEMail = !this.isDefaultEMail;
+    },
+    changeHeader() {
+      this.$router.push({
+        path: 'parkingChooseHeader?ids=' + this.ids,
+      });
+    },
+    gotoDetail() {
+      this.$store.commit('setTempParkingOrder', this.parkingOrder);
+      this.$router.push({
+        path: 'parkingOrderDetail?useParkingOrderCache=true',
+      });
+      // this.$router.push({
+      //   path:
+      //     '/pages/parkingFee/parkingFeeDetailSuccess?orderNo=' +
+      //     this.orderInfo.orderNo,
+      // })
+    },
+    // 查询全部抬头列表信息
+    getInvoiceTitle() {
+      const self = this;
+      const params = {
+        vipcode: this.member?.vipcode,
+      };
+      self.$md(params);
+      // console.log(265, '开票信息', params);
+      // console.log(
+      //   265,
+      //   '开票信息 path: ',
+      //   self.$baseURL + 'api/1.0/invoiceTitle/page'
+      // );
+      uni.request({
+        url: self.$baseURL + 'api/1.0/invoiceTitle/page',
+        method: 'GET',
+        data: params,
+        header: JSON.parse(uni.getStorageSync('handleUser')),
+        success: (res) => {
+          // console.log('开票信息', res.data);
+          if (res.data.code === 0) {
+            const list = res.data.data;
+            let currentIndex = 0;
+            list.map((item, index) => {
+              if (item.setDefault == 1) currentIndex = index;
+            });
+            const headerInfo = list[currentIndex] || {};
+            self.headerInfo = headerInfo;
+            // console.log('发票抬头--', self.headerInfo);
+          } else {
+            // uni.showToast({
+            //   title: res.data.msg,
+            //   duration: 2000,
+            //   icon: 'none',
+            // });
+            Toast({
+              message: res.data.msg,
+            });
+          }
+        },
+        fail: () => {
+          Toast({
+            message: '服务器开小差了呢,请您稍后再试',
+          });
+          /* uni.showToast({
+           title: '服务器开小差了呢,请您稍后再试',
+           icon: 'none',
+           }); */
+        },
+      });
+    },
+    // 根据选中的停车缴费记录id获取详情信息
+    getParkOrderInfo() {
+      // 如果当前是活动开票的话,则不差详情
+      if (this.type) return;
+      const self = this;
+      // console.log('根据选中的停车缴费记录id获取详情信息', this.ids);
+      self.$md(this.ids);
+      // console.log(
+      //   'getParkOrderInfo',
+      //   self.$baseURL + 'api/1.0/invoice/myParkOrderListByIds'
+      // );
+      // return;
+      uni.request({
+        url: self.$baseURL + 'api/1.0/invoice/myParkOrderListByIds',
+        method: 'POST',
+        data: typeof this.ids === 'string' ? [this.ids] : this.ids,
+        header: JSON.parse(uni.getStorageSync('handleUser')),
+        success: (res) => {
+          if (res.data.code === 0) {
+            const datas = res.data.data;
+            console.log('387387387387387387387获取详情信息', datas);
+            self.parkingOrder = datas;
+            self.invoiceAmount = (datas.invoiceAmount / 100).toFixed(2);
+            self.orderInfo = datas.list[0];
+          } else {
+            /* uni.showToast({
+             title: res.data.msg,
+             duration: 2000,
+             icon: 'none',
+             }); */
+            Toast({
+              message: res.data.msg,
+            });
+          }
+        },
+        fail: () => {
+          /* uni.showToast({
+           title: '服务器开小差了呢,请您稍后再试',
+           icon: 'none',
+           }); */
+          Toast({
+            message: '服务器开小差了呢,请您稍后再试',
+          });
+        },
+      });
+    },
+    // 获取用户邮箱信息
+    getInvoiceEmailInfo() {
+      const self = this;
+      // const openId = MemberCacheTool.getOpenId(app);
+      var data = {
+        openid: this.openId,
+        groupId: this.groupId,
+        vipcode: this.member?.vipcode,
+      };
+      self.$md(data);
+      // console.log(
+      //   '获取用户邮箱信息',
+      //   self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo'
+      // );
+      // console.log(421, data);
+      uni.request({
+        url: self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo',
+        method: 'POST',
+        data: data,
+        header: JSON.parse(uni.getStorageSync('handleUser')),
+        success: (res) => {
+          if (res.data.code === 0) {
+            console.log('获取用户邮箱信息', res.data);
+            if (res.data.data) {
+              this.isDefaultEMail = true;
+              this.condition.mailbox = res.data.data;
+            } else {
+              this.isDefaultEMail = false;
+              this.condition.mailbox = '';
+            }
+          } else {
+            /* uni.showToast({
+             title: res.data.msg,
+             duration: 2000,
+             icon: 'none',
+             }); */
+            Toast({
+              message: res.data.msg,
+            });
+          }
+        },
+        fail: () => {
+          Toast({
+            title: '服务器开小差了呢,请您稍后再试',
+          });
+          /* uni.showToast({
+           title: '服务器开小差了呢,请您稍后再试',
+           icon: 'none',
+           }); */
+        },
+      });
+    },
+    submit() {
+      const self = this;
+      if (!self.condition.mailbox) {
+        /* uni.showToast({
+         title: '请输入电子邮箱地址',
+         duration: 2000,
+         icon: 'none',
+         }); */
+        Toast({
+          message: '请输入电子邮箱地址',
+        });
+        return false;
+      }
+      // const re =
+      //   /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/;
+      // if (re.test(self.condition.mailbox)) {
+      //   uni.showToast({
+      //     title: '电子邮箱格式有误,请输入正确的电子邮箱',
+      //     duration: 2000,
+      //     icon: 'none',
+      //   });
+      //   return false;
+      // }
+      if (self.type && self.type == 'activity') {
+        self.condition.invoiceCategory = 1;
+      }
+      const params = self.condition;
+      params.ids = self.ids;
+      params.isDefaultEmail = self.isDefaultEMail ? '1' : '0';
+      params.invoiceTitleId = self.headerInfo.id;
 
 
-  params.openid = this.openid;
-  params.groupId = this.groupId;
-  params.vipcode = this.member?.vipcode;
-  // console.log('提交发票请求的入参', params);
-  self.$md(params);
-  if (self.isSubmitFlag) {
-  // 勾选默认邮箱埋点
-  if (self.isDefaultEMail) {
-  self.sensorsClick('$SetDefaultEmail', {
-  redirect_path: '',
-  mailbox: self.condition.mailbox,
-});
-}
-  self.isSubmitFlag = false;
-  console.log(488, '前往开票', params);
-  uni.request({
-  url: self.$baseURL + 'api/1.0/invoice/addMyInvoiceInfo',
-  method: 'POST',
-  data: params,
-  header: JSON.parse(uni.getStorageSync('handleUser')),
-  success: (res) => {
-  console.log('提交发票请求', res.data);
-  if (res.data.code === 0) {
-  // 因为合并开票接口中无法判断是否是一个CO(一个发票id可以直接进发票详情)还是两个CO,所以统一返回到发票列表页面 ?
-  this.$router.replace({
-  path: 'parkingReceipt',
-});
-} else {
-  /* uni.showToast({
-   title: res.data.msg,
-   duration: 2000,
-   icon: 'none',
-   }); */
-  Toast({
-  message: res.data.msg,
-});
-}
-},
-  fail: () => {
-  self.isSubmitFlag = true;
-  /* uni.showToast({
-   title: '服务器开小差了呢,请您稍后再试',
-   icon: 'none',
-   }); */
-  oast({
-  message: '服务器开小差了呢,请您稍后再试',
-});
-},
-});
-}
-},
-  // 埋点方法
-  sensorsClick(eventName, params) {
-  let optionsQuery = uni.getStorageSync('options_query');
-  let fixedParams = {
-  cta_itemno: '',
-  cta_name: '',
-  previous_path: this.preUrl || '',
-  $location: uni.getStorageSync('mallid'),
-  $brand_id: uni.getStorageSync('groupId'),
-  $channel: optionsQuery.channel || '',
-  // $utm_lbs: this.optionsQuery.utm_lbs || '',
-  $utm_channel: optionsQuery.utm_channel || '',
-  $utm_method: optionsQuery.utm_method || '',
-  $utm_source: optionsQuery.utm_source || '',
-  $utm_function: optionsQuery.utm_function || '',
-  $utm_user: optionsQuery.utm_user || '',
-},
-  finalParams = Object.assign(fixedParams, params);
-},
-},
+      params.openid = this.openid;
+      params.groupId = this.groupId;
+      params.vipcode = this.member?.vipcode;
+      // console.log('提交发票请求的入参', params);
+      self.$md(params);
+      if (self.isSubmitFlag) {
+        self.isSubmitFlag = false;
+        console.log(488, '前往开票', params);
+        uni.request({
+          url: self.$baseURL + 'api/1.0/invoice/addMyInvoiceInfo',
+          method: 'POST',
+          data: params,
+          header: JSON.parse(uni.getStorageSync('handleUser')),
+          success: (res) => {
+            console.log('提交发票请求', res.data);
+            if (res.data.code === 0) {
+              // 因为合并开票接口中无法判断是否是一个CO(一个发票id可以直接进发票详情)还是两个CO,所以统一返回到发票列表页面 ?
+              this.$router.replace({
+                path: 'parkingReceipt',
+              });
+            } else {
+              /* uni.showToast({
+               title: res.data.msg,
+               duration: 2000,
+               icon: 'none',
+               }); */
+              Toast({
+                message: res.data.msg,
+              });
+            }
+          },
+          fail: () => {
+            self.isSubmitFlag = true;
+            /* uni.showToast({
+             title: '服务器开小差了呢,请您稍后再试',
+             icon: 'none',
+             }); */
+            oast({
+              message: '服务器开小差了呢,请您稍后再试',
+            });
+          },
+        });
+      }
+    },
+  },
 };
 };

+ 0 - 32
src/pages/parkingFee/mixins/parkingReceipt/parkingChangeHeader.js

@@ -141,20 +141,7 @@ export default {
         success: (res) => {
         success: (res) => {
           console.log(271, res.data);
           console.log(271, res.data);
           if (res.data.code === 0) {
           if (res.data.code === 0) {
-            // 保存结果埋点
-            // self.sensorsClick('$ClickSubmitHeader',{
-            //   redirect_url: '',
-            //   type_header:
-            //     params.invoiceTitleType == 0
-            //       ? 'SelectCompany'
-            //       : 'SelectPersonal',
-            //   default_header:
-            //     params.setDefault == 0
-            //       ? 'SetAsDefaultClose'
-            //       : 'SetAsDefaultOpen',
-            // })
             this.$router.back();
             this.$router.back();
-            // uni.navigateBack({delta: 1})
           } else {
           } else {
             uni.showToast({
             uni.showToast({
               title: res.data.msg,
               title: res.data.msg,
@@ -171,24 +158,5 @@ export default {
         },
         },
       });
       });
     },
     },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query');
-      let fixedParams = {
-          cta_itemno: '',
-          cta_name: '',
-          previous_url: this.preUrl || '',
-          $brand_id: uni.getStorageSync('groupId'),
-          $location: uni.getStorageSync('mallid'),
-          $channel: optionsQuery.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery.utm_channel || '',
-          $utm_method: optionsQuery.utm_method || '',
-          $utm_source: optionsQuery.utm_source || '',
-          $utm_function: optionsQuery.utm_function || '',
-          $utm_user: optionsQuery.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params);
-    },
   },
   },
 };
 };

+ 0 - 24
src/pages/parkingFee/mixins/parkingReceipt/parkingChooseHeader.js

@@ -66,25 +66,6 @@ export default {
           path: 'parkingChangeHeader?type=' + type,
           path: 'parkingChangeHeader?type=' + type,
         });
         });
     },
     },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query');
-      let fixedParams = {
-          cta_itemno: '',
-          cta_name: '',
-          previous_path: this.preUrl || '',
-          $brand_id: uni.getStorageSync('groupId'),
-          $location: uni.getStorageSync('mallid'),
-          $channel: optionsQuery.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery.utm_channel || '',
-          $utm_method: optionsQuery.utm_method || '',
-          $utm_source: optionsQuery.utm_source || '',
-          $utm_function: optionsQuery.utm_function || '',
-          $utm_user: optionsQuery.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params);
-    },
     // 删除抬头
     // 删除抬头
     delHeader(id) {
     delHeader(id) {
       const self = this;
       const self = this;
@@ -101,11 +82,6 @@ export default {
               success: (res) => {
               success: (res) => {
                 console.log('删除抬头', res.data);
                 console.log('删除抬头', res.data);
                 if (res.data.code === 0) {
                 if (res.data.code === 0) {
-                  // 删除抬头埋点
-                  self.sensorsClick('$ClickDeleteIcon', {
-                    redirect_path: '',
-                    delete_header_id: id,
-                  });
                   self.getInvoiceTitle();
                   self.getInvoiceTitle();
                 } else {
                 } else {
                   uni.showToast({
                   uni.showToast({

+ 0 - 25
src/pages/parkingFee/mixins/parkingReceipt/parkingInvoiceImage.js

@@ -102,12 +102,6 @@ export default {
         success: (res) => {
         success: (res) => {
           console.log('推送', res.data);
           console.log('推送', res.data);
           if (res.data.code === 0) {
           if (res.data.code === 0) {
-            // 埋点
-            self.sensorsClick('$ClickSendAgain', {
-              redirect_url: '',
-              invoice_url: url,
-              subject: self.order.invoiceTitleName + '的电子发票',
-            });
             uni.showToast({
             uni.showToast({
               title: '邮件已发送邮箱,请注意查收',
               title: '邮件已发送邮箱,请注意查收',
               icon: 'none',
               icon: 'none',
@@ -128,24 +122,5 @@ export default {
         },
         },
       });
       });
     },
     },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query');
-      let fixedParams = {
-          cta_itemno: '',
-          cta_name: '',
-          previous_url: this.preUrl || '',
-          $brand_id: uni.getStorageSync('groupId'),
-          $location: uni.getStorageSync('mallid'),
-          $channel: optionsQuery.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery.utm_channel || '',
-          $utm_method: optionsQuery.utm_method || '',
-          $utm_source: optionsQuery.utm_source || '',
-          $utm_function: optionsQuery.utm_function || '',
-          $utm_user: optionsQuery.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params);
-    },
   },
   },
 };
 };

+ 0 - 20
src/pages/parkingFee/mixins/parkingReceipt/parkingReceipt.js

@@ -117,28 +117,8 @@ export default {
         redirect_url: '',
         redirect_url: '',
         type_tab: e == 1 ? 'UnInvoicedTab' : 'InvoicedTab',
         type_tab: e == 1 ? 'UnInvoicedTab' : 'InvoicedTab',
       };
       };
-      this.sensorsClick('$ClickParkingReceiptTab', params);
       this.getInvoiceList();
       this.getInvoiceList();
     },
     },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query');
-      let fixedParams = {
-          cta_itemno: '',
-          cta_name: '',
-          previous_url: this.preUrl || '',
-          $brand_id: uni.getStorageSync('groupId'),
-          $location: uni.getStorageSync('mallid'),
-          $channel: optionsQuery.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery.utm_channel || '',
-          $utm_method: optionsQuery.utm_method || '',
-          $utm_source: optionsQuery.utm_source || '',
-          $utm_function: optionsQuery.utm_function || '',
-          $utm_user: optionsQuery.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params);
-    },
     goToDeatil(item) {
     goToDeatil(item) {
       if (this.tabIndex === 2 && item.status === 2) {
       if (this.tabIndex === 2 && item.status === 2) {
         this.$router.push({
         this.$router.push({

+ 0 - 73
src/pages/parkingFee/mixins/vehicleAddOrEdit.js

@@ -174,73 +174,25 @@ export default {
             // const result = resp.data;
             // const result = resp.data;
             if (result && result.code == '000000') {
             if (result && result.code == '000000') {
               if (result.data) {
               if (result.data) {
-                this.sensorsClick('$ClickVehicleAddOrEdit', {
-                  confirm_type: 'edit',
-                  redirect_url: 'pages/parkingFee/vehicleManagement',
-                });
-                // uni.showToast({
-                //   title: '修改车牌成功',
-                //   duration: 1300,
-                //   icon: 'none',
-                // });
                 Toast({
                 Toast({
                   message: '绑定车牌成功',
                   message: '绑定车牌成功',
                   onClose: () => {
                   onClose: () => {
                     this.$router.back();
                     this.$router.back();
-                    // this.$router.push({
-                    //   path: `vehicleManagement`,
-                    // });
-                    // this.$router.back();
                   },
                   },
                 });
                 });
-                /* Dialog.alert({
-                 message: '绑定车牌成功',
-                 confirmButtonColor: '#333',
-                 }).then(() => {
-                 // on confirm
-                 this.$router.back();
-                 }); */
-                // setTimeout(() => {
-                //   this.$router.back();
-                // }, 1500);
               }
               }
             } else {
             } else {
               const message = result.message || '修改车牌失败';
               const message = result.message || '修改车牌失败';
-              // uni.showToast({
-              //   title: message,
-              //   duration: 2000,
-              //   icon: 'none',
-              // });
               Toast({
               Toast({
                 message: message,
                 message: message,
               });
               });
-              /* Dialog.alert({
-               message: message,
-               confirmButtonColor: '#333',
-               }).then(() => {
-               // on confirm
-               // this.$router.back();
-               }); */
             }
             }
           })
           })
           .catch((err) => {
           .catch((err) => {
             uni.hideLoading();
             uni.hideLoading();
-            console.error(err);
-            // uni.showToast({
-            //   title: '修改车牌失败',
-            //   duration: 2000,
-            //   icon: 'none',
-            // });
             Toast({
             Toast({
               message: '修改车牌失败',
               message: '修改车牌失败',
             });
             });
-            /* Dialog.alert({
-             message: '修改车牌失败',
-             confirmButtonColor: '#333',
-             }).then(() => {
-             // on confirm
-             // this.$router.back();
-             }); */
           });
           });
       } else {
       } else {
         kipAddMemberVehicles(
         kipAddMemberVehicles(
@@ -251,10 +203,6 @@ export default {
             uni.hideLoading();
             uni.hideLoading();
             // const result = resp.data;
             // const result = resp.data;
             if (result && result.code == '000000') {
             if (result && result.code == '000000') {
-              this.sensorsClick('$ClickVehicleAddOrEdit', {
-                confirm_type: 'add',
-                redirect_url: 'pages/parkingFee/vehicleManagement',
-              });
               if (result.data) {
               if (result.data) {
                 Dialog.alert({
                 Dialog.alert({
                   message: '绑定车牌成功',
                   message: '绑定车牌成功',
@@ -316,26 +264,5 @@ export default {
           });
           });
       }
       }
     },
     },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query');
-      let fixedParams = {
-          cta_itemno: '',
-          cta_name: '',
-          previous_url: this.preUrl || '',
-          // 原previous_url: uni.getStorageSync('previousUrl') || ''
-          // previous_url: 使用sdk预置参数$referrer,
-          $brand_id: uni.getStorageSync('groupId'),
-          $location: uni.getStorageSync('mallid'),
-          $channel: optionsQuery.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery.utm_channel || '',
-          $utm_method: optionsQuery.utm_method || '',
-          $utm_source: optionsQuery.utm_source || '',
-          $utm_function: optionsQuery.utm_function || '',
-          $utm_user: optionsQuery.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params);
-    },
   },
   },
 };
 };

+ 0 - 30
src/pages/parkingFee/mixins/vehicleManagement.js

@@ -210,10 +210,6 @@ export default {
       const carType = LICENSE_PLATE_TYPE_ARR.findIndex(
       const carType = LICENSE_PLATE_TYPE_ARR.findIndex(
         (e) => e.value == licensePlateType
         (e) => e.value == licensePlateType
       );
       );
-      this.sensorsClick('$ClickEditLicensePlate', {
-        carno_old: item.vehicleNo,
-        redirect_url: 'pages/parkingFee/vehicleAddOrEdit',
-      });
       this.$router.push({
       this.$router.push({
         path: `vehicleAddOrEdit?id=${id}&carno=${vehicleNo}&carType=${carType}`,
         path: `vehicleAddOrEdit?id=${id}&carno=${vehicleNo}&carType=${carType}`,
       });
       });
@@ -249,10 +245,6 @@ export default {
           // console.log(resp)
           // console.log(resp)
           // const result = resp.data
           // const result = resp.data
           if (result && result.code == '000000') {
           if (result && result.code == '000000') {
-            this.sensorsClick('$ClickDeleteLicensePlate', {
-              carno_old: this.activeCarno,
-              redirect_url: '',
-            });
             if (result.data) {
             if (result.data) {
               // this.deleteDialogSwitch = false;
               // this.deleteDialogSwitch = false;
               // this.deleteSuccessDialogSwitch = true;
               // this.deleteSuccessDialogSwitch = true;
@@ -286,28 +278,6 @@ export default {
           });
           });
         });
         });
     },
     },
-    // 埋点方法
-    sensorsClick(eventName, params) {
-      let optionsQuery = uni.getStorageSync('options_query');
-      let fixedParams = {
-          cta_itemno: '',
-          cta_name: '',
-          previous_url: this.preUrl || '',
-          // 原previous_url: uni.getStorageSync('previousUrl') || ''
-          // previous_url: 使用sdk预置参数$referrer,
-          $brand_id: this.groupId,
-          redirect_url: params.redirect_url || '',
-          $location: this.mallid,
-          $channel: optionsQuery.channel || '',
-          // $utm_lbs: this.optionsQuery.utm_lbs || '',
-          $utm_channel: optionsQuery.utm_channel || '',
-          $utm_method: optionsQuery.utm_method || '',
-          $utm_source: optionsQuery.utm_source || '',
-          $utm_function: optionsQuery.utm_function || '',
-          $utm_user: optionsQuery.utm_user || '',
-        },
-        finalParams = Object.assign(fixedParams, params);
-    },
     cancelDelete() {
     cancelDelete() {
       this.deleteDialogSwitch = true;
       this.deleteDialogSwitch = true;
     },
     },

+ 1 - 0
src/store/cachedViews.js

@@ -13,6 +13,7 @@ const mutations = {
   // 移除缓存
   // 移除缓存
   DEL_CACHED_VIEW: (state, view) => {
   DEL_CACHED_VIEW: (state, view) => {
     const index = state.cachedViews.indexOf(view.name)
     const index = state.cachedViews.indexOf(view.name)
+    console.log('1616161616', index);
     index > -1 && state.cachedViews.splice(index, 1)
     index > -1 && state.cachedViews.splice(index, 1)
   },
   },
 
 

+ 18 - 15
src/store/order.js

@@ -2,8 +2,8 @@ import { checkOut, calculateDiscount, ordersAndPrepay } from '@/api/parking';
 
 
 // import checkOutQHResponse from '@/api/mockData/checkout.qh3.response.json'
 // import checkOutQHResponse from '@/api/mockData/checkout.qh3.response.json'
 // import checkOutQHResponse from '@/api/mockData/checkout.hz.response.json';
 // import checkOutQHResponse from '@/api/mockData/checkout.hz.response.json';
-import checkOutQHResponse from '@/api/mockData/checkout.qh4.response.json'
-
+// import checkOutQHResponse from '@/api/mockData/checkout.qh4.response.json'
+// 大于等于停车费
 // 微服务接口字段
 // 微服务接口字段
 const state = {
 const state = {
   // 微服务接口字段
   // 微服务接口字段
@@ -35,6 +35,7 @@ const state = {
   memberLevelDiscount: false, // 是否开启会员等级
   memberLevelDiscount: false, // 是否开启会员等级
   enableConsume: false, // 是否开启消费减免
   enableConsume: false, // 是否开启消费减免
   pointsPerUnit: 0, //
   pointsPerUnit: 0, //
+  // unlicensed: false // true: 临时车牌;false:普通车牌
 };
 };
 
 
 const mutations = {
 const mutations = {
@@ -125,25 +126,25 @@ const mutations = {
 };
 };
 
 
 const actions = {
 const actions = {
-  async orderInit({ commit, dispatch, state }, vehicleNo = '浙A616A1') {
+  async orderInit({ commit, dispatch, state }, {vehicleNo = '浙A616A1', callback}) {
     try {
     try {
-      // 请求接口
-      // ...
-      // ...
-      // if(state.isFirst < 1) {
-      //   setIsFirst(1);
-      // }
+      const unlicensed = vehicleNo.indexOf('临') > -1; // true: 临时车牌;false:普通车牌
       // const res = await checkOut('浙A616A1');
       // const res = await checkOut('浙A616A1');
-      // const res = await checkOut('闽AAQ5519');
-      const res = await checkOut('粤A51113');
+      // const res = await checkOut('闽AAQ5519', unlicensed);
+      // const res = await checkOut('粤A51113');
       // const res = await checkOut('沪DCJ986');
       // const res = await checkOut('沪DCJ986');
-      // console.log('浙A616A1', res);
+      const res = await checkOut(vehicleNo, unlicensed);
+      console.log(vehicleNo, res);
       // 所有的优惠时间长转为金额
       // 所有的优惠时间长转为金额
       // console.log(112, '所有的优惠时间长转为金额');
       // console.log(112, '所有的优惠时间长转为金额');
       // dispatch('orderInitRule', checkOutQHResponse);
       // dispatch('orderInitRule', checkOutQHResponse);
-      dispatch('orderInitRule', checkOutQHResponse);
+      dispatch('orderInitRule', res);
     } catch (error) {
     } catch (error) {
-      console.log(error);
+      console.log('143143143143143', error);
+      /* if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(error.code)) {
+        callback && callback(error)
+      } */
+      callback && callback(error); // 统一处理错误原因
     }
     }
   },
   },
   orderInitRule({ commit, dispatch, state }, checkOutResponse) {
   orderInitRule({ commit, dispatch, state }, checkOutResponse) {
@@ -351,7 +352,7 @@ const actions = {
         ...orderDetail,
         ...orderDetail,
       });
       });
       console.log('积分修改失败', { res });
       console.log('积分修改失败', { res });
-      dispatch('orderInitRule', checkOutQHResponse);
+      dispatch('orderInitRule', res);
       callback && callback();
       callback && callback();
     } catch (err) {
     } catch (err) {
       console.log('积分修改失败!', err);
       console.log('积分修改失败!', err);
@@ -364,6 +365,8 @@ const actions = {
     orderDetail.discountInfo.coupons = couponList;
     orderDetail.discountInfo.coupons = couponList;
     if (orderDetail?.discountInfo?.points[0]?.discountFee) {
     if (orderDetail?.discountInfo?.points[0]?.discountFee) {
       orderDetail.discountInfo.points[0].selected = true;
       orderDetail.discountInfo.points[0].selected = true;
+    } else {
+      orderDetail.discountInfo.points[0].selected = false;
     }
     }
     try {
     try {
       const res = await calculateDiscount({
       const res = await calculateDiscount({