|
@@ -205,10 +205,21 @@
|
|
this.product = res.data.data.productList[0]
|
|
this.product = res.data.data.productList[0]
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
|
|
+ // 首次进来参数不含code,需要前端跳转后获取code
|
|
this.getWxCode()
|
|
this.getWxCode()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getWxCode() {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ const appId = 'wxf05800eea975a68b'
|
|
|
|
+ const redirect_uri = encodeURIComponent('https://h5-pay.ai160.com/reader-ios?uid=' + this.uid)
|
|
|
|
+ // const redirect_uri = encodeURIComponent('https://h5-pay.ai160.com/reader-ios?uid=d83d947655f6455a96f4197d31afa6d4')
|
|
|
|
+ const url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appId + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_base#wechat_redirect'
|
|
|
|
+ location.href = url
|
|
|
|
+ }, 300)
|
|
|
|
+ },
|
|
|
|
+
|
|
selected(e) {
|
|
selected(e) {
|
|
this.active = e.id
|
|
this.active = e.id
|
|
this.product = e
|
|
this.product = e
|
|
@@ -287,15 +298,6 @@
|
|
closeMask() {
|
|
closeMask() {
|
|
this.mask = false
|
|
this.mask = false
|
|
this.getWxCode()
|
|
this.getWxCode()
|
|
- },
|
|
|
|
- getWxCode() {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- const appId = 'wxf05800eea975a68b'
|
|
|
|
- const redirect_uri = encodeURIComponent('https://h5-pay.ai160.com/reader-ios?uid=' + this.uid)
|
|
|
|
- // const redirect_uri = encodeURIComponent('https://h5-pay.ai160.com/reader-ios?uid=d83d947655f6455a96f4197d31afa6d4')
|
|
|
|
- const url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appId + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_base#wechat_redirect'
|
|
|
|
- location.href = url
|
|
|
|
- }, 300)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|