Browse Source

优化未无牌车扫码出场的环节

john.hong 2 năm trước cách đây
mục cha
commit
b21d193f58

+ 2 - 2
src/api/request.js

@@ -101,7 +101,7 @@ function XUser(config) {
     lbsId: store.state?.lbsId || '',
   };
   // params = {"userId":"8aaa809d835ba76d018377d482ac0004","sourceType":"WECHAT","phoneNumber":"15090631337","projectId":"","brandId":"8aaa81947c6e1ca0017c73c13cc30006","cid":"oudWQ5ccsJLSlUGt0s_RQysoHqgg","vipCode":"KERRY100213432","lbsId":"8aaa82ea804d07cd0180516ff03b0008"}
-  if (/orders-and-prepay|calculate-discount|unlicensed-car-check-in/.test(config.url)) {
+  if (/orders-and-prepay|calculate-discount|unlicensed-car-check-in|unlicensed-car-checkout/g.test(config.url)) {
     params.buildingId = window.localStorage.getItem('buildingId');
   }
   return JSON.stringify(params);
@@ -175,7 +175,7 @@ export const createAxiosByinterceptors = (config) => {
       }
       // 错误信息提示
       const { code, langMessage, message } = error.response.data;
-      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_NOT_FOUND', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCAL_PARK_ERROR", "LOCK_OCCUPIED"]; // 默认处理的错误code
+      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_NOT_FOUND', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCAL_PARK_ERROR", "LOCK_OCCUPIED", "REMOTE_CALL_FAIL"]; // 默认处理的错误code
       if (codeList.indexOf(code) > -1) {
         uni.showToast({ title: langMessage || message, duration: 3000, icon: 'fail' });
       }

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

@@ -95,7 +95,7 @@ export default {
     },
     unlicensedInfo:{
       handler(){
-        console.log('用户是扫码进来的97', this.unlicensedInfo);
+        console.log('用户是扫码进来的98', this.unlicensedInfo);
         // 不论是否出入场,都使用此函数获取 gateId(闸口机器的ID)
         if (this.unlicensedInfo?.type && /unlicensedOut|unlicensedIn/.test(this.unlicensedInfo.type) && this.endlessLoop.length === 0) {
           // 此处记录扫码流程执行次数。如果超过一次则不再执行
@@ -122,6 +122,8 @@ export default {
     // 如果用户未登录的话,返回之后,重新获取数据用户的基础数据
     if (!member && window?.toWXSendMsg) {
       wxToLoginCallback('parkingFee', (options) => {
+        console.log('用户是扫码进来的125', this.unlicensedInfo);
+        console.log('用户是扫码进来的126', options);
         this.$store.commit('SET_IS_INIT', false);
         // 请求 projectId
         window.toWXSendMsg({
@@ -129,6 +131,7 @@ export default {
           options: {},
         });
         window.subscribe('projectId', (newOptions) => {
+          console.log(134, newOptions);
           this.$store.dispatch('baseInit', {
             options: newOptions,
             callback: () => {
@@ -136,6 +139,13 @@ export default {
                 requestInit();
                 this.getParkInfo();
                 this.$store.commit('SET_IS_INIT', true);
+                this.$nextTick(() => {
+                  console.log(143, newOptions);
+                  // 如果是无牌车的扫码入场
+                  if(options?.options?.type && /unlicensedIn|unlicensedOut/.test(options.options.type)) {
+                    this.$store.commit('SET_UNLICENSED_INFO', options.options);
+                  }  
+                })
               })
             },
           });

+ 9 - 9
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -329,15 +329,15 @@ export default {
             }
             // 如果是无需缴费的话,提示用户无需缴费
             if (res?.orderDetail?.parkingRecord?.totalFee <= 0) {
-              this.$store.dispatch('order/orderInitRule', res);
-              uni.showModal({
-                showCancel: false,
-                title: '提示',
-                content: '当前无需缴费',
-                complete: () => {
-                  this.$router.back()
-                },
-              });
+              this.$store.dispatch('order/orderInitRule', res.orderDetail);
+                setTimeout(() => {
+                  Dialog.alert({
+                    message: '当前无需缴费',
+                    confirmButtonColor: '#333',
+                  }).then(() => {
+                    this.$router.back()
+                  });
+                }, 1000)
               return
             }
             if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(res.code)) {