Просмотр исходного кода

Merge pull request #136 from John-Hong/John/release-2.4.0/SCRM-3298

John/release 2.4.0/scrm 3298
Tron 2 лет назад
Родитель
Сommit
845eaca40b

+ 1 - 1
src/api/request.js

@@ -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", "LOCK_OCCUPIED"]; // 默认处理的错误code
+      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_NOT_FOUND', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCAL_PARK_ERROR", "LOCK_OCCUPIED"]; // 默认处理的错误code
       if (codeList.indexOf(code) > -1) {
         uni.showToast({ title: langMessage || message, duration: 3000, icon: 'fail' });
       }

+ 20 - 17
src/pages/parkingFee/mixins/parkingFee.js

@@ -4,7 +4,7 @@ import LoginDom from '@/components/Login/Login.vue';
 import { mapState } from 'vuex';
 import { initWxJsSdkConfig } from '@/utils/login';
 import { getPlatform,requestInit } from '@/utils/index';
-import { wxToLoginCallback } from '@/utils';
+import { wxToLoginCallback, getUrlParams } from '@/utils';
 
 const app = {
   globalData: {
@@ -510,25 +510,27 @@ export default {
         // this.qrCodesRule('e41d4d9dd5534f4aa3de88326a2e6f85')
         // return
         const runScanFn = (res) => {
-          if (res.scanType == 'QR_CODE' && res.scanType) {
+          console.log(513, res);
+          if (res.scanType && res.scanType == 'QR_CODE') {
             console.log(res.result);
             // 获取二维码参数之后,模拟提取参数
             const url = res.result;
-            if (url.indexOf('auth/') === -1) { // 单纯的code
-              console.log('提取到的参数', res.result);
-              this.qrCodesRule(res.result)
-              // this.getPaperCouponInfo(res.result);
-            } else { // 从url中提取参数
-              const start = url.indexOf('auth/');
-              const end = url.indexOf('?');
-              const params = url.slice(start, end).split('/');
-              if (params && params.length) {
-                const couponCode = params[1];
-                console.log('提取到的参数', couponCode);
-                this.qrCodesRule(couponCode)
-                // this.getPaperCouponInfo(couponCode);
-              }
+            const {path} = getUrlParams(res.result)
+            let params = null
+            if(path) {
+              params = getUrlParams(decodeURIComponent(path))
+            }
+            /*
+            微信扫码之后,处理过的参数 {"code": "e41d4d9dd5534f4aa3de88326a2e6f85", "type": "unlicensedIn#wechat-redirect"}
+            */
+            if (params?.type.indexOf('wechat-redirect') > -1) {
+              params.type = params.type.replace('#wechat-redirect', '');
             }
+            console.log('微信扫码之后,处理过的参数', params);
+            this.$store.commit('SET_UNLICENSED_INFO', params);
+            this.$nextTick(() => {
+              this.qrCodesRule(params.code);
+            })
           }
         };
         // 微信小程序
@@ -580,7 +582,8 @@ export default {
               query: {
                 type: 'success',
                 gateId: qrCodesres.gateId,
-                vehicleNo: vehicleNo
+                vehicleNo: vehicleNo,
+                type: this.unlicensedInfo.type
               }
             })
           });

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

@@ -64,6 +64,7 @@ export default {
       enableConsume: (state) => state.order.enableConsume,
       unitAmount: (state) => state.order.unitAmount,
       unlicensedInfo: state => state.unlicensedInfo,
+      endlessLoop: (state) => state.endlessLoop,
       appId: state => state.appId,
     }),
     // 支付按钮状态
@@ -331,7 +332,7 @@ export default {
               });
               return
             }
-            if (res.code === "INTERNAL_SERVER_ERROR") {
+            if (/LOCAL_PARK_ERROR|INTERNAL_SERVER_ERROR/.test(res.code)) {
               setTimeout(() => {
                 this.$router.back()
               }, 1000)

+ 1 - 1
vue.config.js

@@ -80,7 +80,7 @@ module.exports = {
       .end();
       if ( process.env.NODE_ENV === 'production' ) {
         // 编译之后清理console.log
-        config.optimization.minimizer('vue').use(TerserPlugin, [{ terserOptions: { compress: { drop_console: true } } }])  
+        // config.optimization.minimizer('vue').use(TerserPlugin, [{ terserOptions: { compress: { drop_console: true } } }])  // TODO: 临时注释
       }
       
   },