|
@@ -83,7 +83,7 @@ export default {
|
|
|
return JSON.parse(JSON.stringify(s))
|
|
return JSON.parse(JSON.stringify(s))
|
|
|
},
|
|
},
|
|
|
sweepBtn() {
|
|
sweepBtn() {
|
|
|
- if (!this.isWechatBrowser) {
|
|
|
|
|
|
|
+ if (this.isWechatBrowser) {
|
|
|
this.$refs.weChatQrcodeRef.open()
|
|
this.$refs.weChatQrcodeRef.open()
|
|
|
} else {
|
|
} else {
|
|
|
this.$refs.qrScannerRef.open()
|
|
this.$refs.qrScannerRef.open()
|
|
@@ -93,7 +93,7 @@ export default {
|
|
|
const _valueAndTime = this.extractValueAndTime(result)
|
|
const _valueAndTime = this.extractValueAndTime(result)
|
|
|
|
|
|
|
|
if (!_valueAndTime) {
|
|
if (!_valueAndTime) {
|
|
|
- if (!this.isWechatBrowser) {
|
|
|
|
|
|
|
+ if (this.isWechatBrowser) {
|
|
|
this.$refs.weChatQrcodeRef.close()
|
|
this.$refs.weChatQrcodeRef.close()
|
|
|
} else {
|
|
} else {
|
|
|
this.$refs.qrScannerRef.close()
|
|
this.$refs.qrScannerRef.close()
|
|
@@ -118,7 +118,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
console.log(_valueAndTime)
|
|
console.log(_valueAndTime)
|
|
|
// this.checkJson.answer2 = result;
|
|
// this.checkJson.answer2 = result;
|
|
|
- if (!this.isWechatBrowser) {
|
|
|
|
|
|
|
+ if (this.isWechatBrowser) {
|
|
|
this.$refs.weChatQrcodeRef.close()
|
|
this.$refs.weChatQrcodeRef.close()
|
|
|
} else {
|
|
} else {
|
|
|
this.$refs.qrScannerRef.close()
|
|
this.$refs.qrScannerRef.close()
|
|
@@ -185,7 +185,7 @@ export default {
|
|
|
// 检查是否在微信浏览器中
|
|
// 检查是否在微信浏览器中
|
|
|
isWechatBrowser() {
|
|
isWechatBrowser() {
|
|
|
const ua = navigator.userAgent.toLowerCase()
|
|
const ua = navigator.userAgent.toLowerCase()
|
|
|
- return ua.indexOf('micromessenger') !== -1
|
|
|
|
|
|
|
+ return /micromessenger/.test(ua) // 全部转为小写后匹配
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|