SanHQin 2 months ago
parent
commit
2f883250b2

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 1 - 1
dist/report.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-21e9f5d6.5a7c510a.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.b0baac12.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-21e9f5d6.351f450d.js


+ 7 - 8
src/components/weChatQrcode.vue

@@ -22,8 +22,8 @@ export default {
       const that = this
       try {
         console.log('测试测试ready')
-        console.log(wx.ready)
-        console.log(wx.ready())
+        // console.log(wx.ready)
+        // console.log(wx.ready())
         wx.ready(function() {
           console.log('测试2222')
           wx.checkJsApi({
@@ -52,11 +52,6 @@ export default {
             }
           })
         })
-        wx.error(function(res) {
-          console.log('测试测试111')
-          that.close()
-          alert('出错了👉' + res.errMsg) // wx.config配置错误,会弹出窗口哪里错误,然后根据微信文档查询即可。
-        })
       } catch (error) {
         console.log(error)
       }
@@ -80,7 +75,11 @@ export default {
           jsApiList: ['scanQRCode', 'checkJsApi'] // 必填,需要使用的JS接口列表
         }
         wx.config(params)
-
+        wx.error(function(res) {
+          console.log('测试测试111')
+          that.close()
+          alert('出错了👉' + res.errMsg) // wx.config配置错误,会弹出窗口哪里错误,然后根据微信文档查询即可。
+        })
         console.log('测试测试wxConfig')
       } catch (error) {
         console.log(error)

+ 10 - 11
src/main.js

@@ -42,19 +42,18 @@ import '@/permission' // permission control
 Vue.prototype.$storage = storage
 Vue.prototype.$sessionStorage = sessionStorage
 
-// 判断是否为微信浏览器
-Vue.prototype.$isWechat = () => {
-  const ua = navigator.userAgent.toLowerCase()
-  const isWeChat = /micromessenger/i.test(ua)
+const ua = navigator.userAgent.toLowerCase()
+const isWeChat = /micromessenger/i.test(ua)
 
-  // 额外验证:检查微信JSBridge
-  if (isWeChat && typeof WeixinJSBridge === 'undefined') {
-    // 这种情况可能发生在某些特殊微信版本或modified UA
-    console.warn('检测到微信UA但无JSBridge,可能是不完整的微信环境')
-  }
-  console.log('$isWechat', isWeChat)
-  return isWeChat
+// 额外验证:检查微信JSBridge
+if (isWeChat && typeof WeixinJSBridge === 'undefined') {
+  // 这种情况可能发生在某些特殊微信版本或modified UA
+  console.warn('检测到微信UA但无JSBridge,可能是不完整的微信环境')
 }
+console.log('$isWechat', isWeChat)
+
+// 判断是否为微信浏览器
+Vue.prototype.$isWechat = isWeChat
 
 // 动态设置title
 Vue.use(require('vue-wechat-title'))

+ 2 - 2
src/views/testDetail/components/sweep.vue

@@ -83,7 +83,7 @@ export default {
       return JSON.parse(JSON.stringify(s))
     },
     sweepBtn() {
-      if (this.$isWechat()) {
+      if (this.$isWechat) {
         this.$refs.weChatQrcodeRef.open()
       } else {
         this.$refs.qrScannerRef.open()
@@ -91,7 +91,7 @@ export default {
     },
     sweepSuccess(result) {
       this.checkJson.answer2 = result
-      if (this.$isWechat()) {
+      if (this.$isWechat) {
         this.$refs.weChatQrcodeRef.close()
       } else {
         this.$refs.qrScannerRef.close()

Some files were not shown because too many files changed in this diff