|
@@ -37,15 +37,7 @@ export default {
|
|
|
// title: '纸质优惠券减免',
|
|
|
// });
|
|
|
// },300);
|
|
|
- const platform = getPlatform();
|
|
|
- if ( platform === 'micromessenger' ) {
|
|
|
- // this.getTicket();
|
|
|
- await initWxJsSdkConfig(['checkJsApi','scanQRCode']);
|
|
|
- // await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
|
|
|
- // if (window.wxJsSdkConfigInitPromise) {
|
|
|
- // await window.wxJsSdkConfigInitPromise;
|
|
|
- // }
|
|
|
- }
|
|
|
+ // const platform = getPlatform();
|
|
|
this.pageInit()
|
|
|
// setTimeout(() => {
|
|
|
// uni.setNavigationBarTitle({
|
|
@@ -62,6 +54,18 @@ export default {
|
|
|
// },
|
|
|
// });
|
|
|
// }, 500)
|
|
|
+ try {
|
|
|
+ const href = window.location.href;
|
|
|
+ console.log('初始化扫码1');
|
|
|
+ if(!isAlipayClient && !/808[0-9]/.test(href)) {
|
|
|
+ setTimeout(async () => {
|
|
|
+ console.log('初始化扫码2');
|
|
|
+ await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState({
|
|
@@ -107,6 +111,7 @@ export default {
|
|
|
};
|
|
|
// 支付宝小程序
|
|
|
// const platform = getPlatform();
|
|
|
+ console.log(110);
|
|
|
if ( isAlipayClient ) {
|
|
|
window.toWXSendMsg({
|
|
|
type: 'scanQRCode',
|
|
@@ -116,6 +121,7 @@ export default {
|
|
|
runScanFn(options.options);
|
|
|
});
|
|
|
} else {
|
|
|
+ console.log(120);
|
|
|
this.$wx.scanQRCode({
|
|
|
desc: 'scanQRCode desc',
|
|
|
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|