SanHQin 2 月之前
父節點
當前提交
87c6dc6675

文件差異過大導致無法顯示
+ 0 - 0
dist/index.html


文件差異過大導致無法顯示
+ 1 - 1
dist/report.html


文件差異過大導致無法顯示
+ 0 - 0
dist/static/css/chunk-0cbd4011.c29a61df.css


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/app.7b5d3b70.js


文件差異過大導致無法顯示
+ 0 - 0
dist/static/js/chunk-0cbd4011.8907dd94.js


+ 30 - 26
src/components/weChatQrcode.vue

@@ -20,34 +20,38 @@ export default {
     onScan() {
       this.getConfig()
       const that = this
-      wx.ready(function() {
-        console.log('测试2222')
-        wx.checkJsApi({
-          // 需要使用的JS接口列表,在这里只需要用到scanQRCode
-          jsApiList: ['scanQRCode'],
-          success: function(res1) {
-            if (res1.checkResult.scanQRCode) {
-              // 当scanQRCode可使用时
-              wx.scanQRCode({
-                needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
-                scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
-                success: function(res2) {
-                  const result = res2.resultStr
-                  that.$emit('success', result)
-                  // console.log(res2.resultStr, '扫描的结果~')
-                  // window.location.href = result
-                },
-                error: function(response) {
-                  this.close()
-                  this.$nextTick(() => {
-                    that.$toast(response)
-                  })
-                }
-              })
+      try {
+        wx.ready(function() {
+          console.log('测试2222')
+          wx.checkJsApi({
+            // 需要使用的JS接口列表,在这里只需要用到scanQRCode
+            jsApiList: ['scanQRCode'],
+            success: function(res1) {
+              if (res1.checkResult.scanQRCode) {
+                // 当scanQRCode可使用时
+                wx.scanQRCode({
+                  needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
+                  scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
+                  success: function(res2) {
+                    const result = res2.resultStr
+                    that.$emit('success', result)
+                    // console.log(res2.resultStr, '扫描的结果~')
+                    // window.location.href = result
+                  },
+                  error: function(response) {
+                    this.close()
+                    this.$nextTick(() => {
+                      that.$toast(response)
+                    })
+                  }
+                })
+              }
             }
-          }
+          })
         })
-      })
+      } catch (error) {
+        console.log(error)
+      }
     },
     async getConfig() {
       const that = this

部分文件因文件數量過多而無法顯示