Ver Fonte

针对微信的小程序码进行的兼容改造

john há 2 anos atrás
pai
commit
c6b22f83bf
1 ficheiros alterados com 12 adições e 0 exclusões
  1. 12 0
      src/pages/parkingFee/mixins/parkingFee.js

+ 12 - 0
src/pages/parkingFee/mixins/parkingFee.js

@@ -550,6 +550,18 @@ export default {
             this.$nextTick(() => {
               this.qrCodesRule(params.code);
             })
+            return
+          }
+          /*
+            针对微信的小程序码进行的兼容改造
+            微信扫码结束之后的返回参数 {"errMsg": "scanCode:ok", "scanType": "WX_CODE", "charSet": "ISO8859-1", "rawData": "bGsoP3gyT1Aud3QpbW1JeHRfVHJsUjg4JnR5cGU9dW5saWNlbnNlZElu", "path": "pages/automatic/automaticIndex?scene=code%3D9988%26type%3DunlicensedIn"}
+            */
+          if(res.scanType && res.scanType == 'WX_CODE') {
+            const params = getUrlParams(`?${decodeURIComponent(res.path.replace(/.*scene=/g, ''))}`)
+            this.$store.commit('SET_UNLICENSED_INFO', params);
+            this.$nextTick(() => {
+              this.qrCodesRule(params.code);
+            })
           }
         };
         // 微信小程序