[体验官活动]
This commit is contained in:
@@ -10,33 +10,19 @@ Page({
|
||||
page : {}, // 分页信息
|
||||
lodingStats : false, // 加载状态
|
||||
disabled : false, // 支付按钮
|
||||
payCode : '', // code获取openid
|
||||
openId : '', // openid
|
||||
payStatus : false, // 支付弹框
|
||||
catchtouchmove: false
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
},
|
||||
onLoad(options) {},
|
||||
|
||||
onShow() {
|
||||
wx.login({
|
||||
success: res => {
|
||||
this.setData({
|
||||
payCode: res.code
|
||||
})
|
||||
// 获取openid
|
||||
this.openInfo()
|
||||
}
|
||||
})
|
||||
|
||||
// 获取登录状态
|
||||
if(wx.getStorageSync("token") != ''){
|
||||
this.setData({
|
||||
userLogin: true,
|
||||
disabled : false
|
||||
})
|
||||
|
||||
// 获取检测结果列表
|
||||
this.aiInfo();
|
||||
} else {
|
||||
@@ -66,24 +52,13 @@ Page({
|
||||
}).catch(err => { })
|
||||
},
|
||||
|
||||
/**
|
||||
* openid
|
||||
*/
|
||||
openInfo() {
|
||||
wx.$api.auth.codeOpenid({code: this.data.payCode}).then(res => {
|
||||
this.setData({
|
||||
openId: res.data
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理未登录时的转跳
|
||||
*/
|
||||
assessGo(){
|
||||
if(wx.getStorageSync("token") != ''){
|
||||
wx.navigateTo({
|
||||
url: '/pages/index/assess/assess?code=' + this.data.openId
|
||||
url: '/pages/index/assess/assess?code=' + wx.getStorageSync("openid")
|
||||
})
|
||||
}else{
|
||||
// 去登录
|
||||
|
||||
Reference in New Issue
Block a user