瀏覽代碼

验证扫码

john 1 年之前
父節點
當前提交
f430670ce5
共有 1 個文件被更改,包括 10 次插入3 次删除
  1. 10 3
      src/pages/parkingFeeV2/mixins/parkingFee.js

+ 10 - 3
src/pages/parkingFeeV2/mixins/parkingFee.js

@@ -88,7 +88,9 @@ export default {
     // console.log('二次加载this.$route.query.fromPage', this.$route.query.fromPage, this.$store.state.pageHistory);
     // console.log('二次加载', this.$route.query.fromPage && !this.$store.state.pageHistory[this.$route.query.fromPage]);
     const fromPage = localStorage.getItem(`${this.$route.query.fromPage}`)
+    // console.log(9191, this.$route.query?.fromPage);
     if(this.$route.query?.fromPage !== 'undefined' && !this.$store.state.pageHistory[this.$route.query.fromPage] && !fromPage) {
+      // console.log(93939);
       this.$store.commit('setPageHistory', {
         [this.$route.query.fromPage]: 1
       })
@@ -677,11 +679,13 @@ export default {
           });
         } else {
           this.$wx.scanQRCode({
-            desc: 'scanQRCode desc',
-            needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
+            onlyFromCamera: false,
+            // desc: 'scanQRCode desc',
+            // needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
             // scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
-            success: (res) => {
+            success: (res1) => {
               console.log('H5页面扫码获取到的参数——成功', res);
+              // const res = {"resultStr": "lo$Qed.3YuVi*D7vXilrrV0571a1&type=unlicensedIn", "errMsg": "scanQRCode:ok"}
               // const test = {"resultStr": "lp$Qed.3YuVi*D7vXilrrV0571a2&type=unlicensedOut", "errMsg": "scanQRCode:ok"}
               let path = res.resultStr.replace(/.*([a-z0-9]{6}&type)/g, '8b$1')
               console.log(614, path);
@@ -689,6 +693,7 @@ export default {
               const match = path.match(regex);
               const obj = { code: match[1], type: match[2] };
               console.log(618, obj);
+              console.log(696, this.qrCodesRule);
               this.$store.commit('SET_UNLICENSED_INFO', obj);
               this.$nextTick(() => {
                 this.qrCodesRule(obj.code, 'scan');
@@ -709,6 +714,7 @@ export default {
     },
     // 处理扫码结果: 组装参数,剩余流程,在 缴费支付页面 实现
     async qrCodesRule(code, source = '') {
+      console.log(717, code, source);
       // source 是为了避免重复刷新
       if(this.$store.state.pageHistory.parkingFeeMsg && !source) {
         return
@@ -726,6 +732,7 @@ export default {
         this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
           name: 'parkingFeeDetail',
         });
+        console.log(735);
         // return
         if (this.unlicensedInfo?.type === 'unlicensedOut') {
             const query = {