|
|
@ -41,46 +41,47 @@ |
|
|
|
|
|
|
|
|
|
|
|
this.globalData.navInfo = navParams() |
|
|
|
let _this = this; |
|
|
|
wx.login({ |
|
|
|
success: function(res) { |
|
|
|
uni.request({ |
|
|
|
// 组装请求地址 |
|
|
|
url:_this.globalData.wxSilentLoginURL + "?wxCode=" + res.code, |
|
|
|
method: "GET", |
|
|
|
header: { |
|
|
|
'content-type': "application/x-www-form-urlencoded" |
|
|
|
}, |
|
|
|
data: { |
|
|
|
"wxCode": res.code |
|
|
|
}, |
|
|
|
success: res => { |
|
|
|
if (res.statusCode == 200) { |
|
|
|
if (!res.data.success) { |
|
|
|
if (res.data.code == "110") { |
|
|
|
// 需要绑定手机号 |
|
|
|
uni.reLaunch({ |
|
|
|
url: '/pages/index/BindPhone?openid=' + |
|
|
|
res.data.data.wxMpOpenid |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// _this.status = 'more' |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 成功后跳转主页 |
|
|
|
_this.globalData.sid = res.data.data.sid |
|
|
|
console.log("用户sid",_this.globalData.sid) |
|
|
|
} |
|
|
|
} else { |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
fail: function(res) { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// let _this = this; |
|
|
|
// wx.login({ |
|
|
|
// success: function(res) { |
|
|
|
// uni.request({ |
|
|
|
// // 组装请求地址 |
|
|
|
// url:_this.globalData.wxSilentLoginURL + "?wxCode=" + res.code, |
|
|
|
// method: "GET", |
|
|
|
// header: { |
|
|
|
// 'content-type': "application/x-www-form-urlencoded" |
|
|
|
// }, |
|
|
|
// data: { |
|
|
|
// "wxCode": res.code |
|
|
|
// }, |
|
|
|
// success: res => { |
|
|
|
// if (res.statusCode == 200) { |
|
|
|
// if (!res.data.success) { |
|
|
|
// if (res.data.code == "110") { |
|
|
|
// // 需要绑定手机号 |
|
|
|
// uni.reLaunch({ |
|
|
|
// url: '/pages/index/BindPhone?openid=' + |
|
|
|
// res.data.data.wxMpOpenid |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// // _this.status = 'more' |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// // 成功后跳转主页 |
|
|
|
// _this.globalData.sid = res.data.data.sid |
|
|
|
// console.log("用户sid",_this.globalData.sid) |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// fail: (err) => { |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
// fail: function(res) { |
|
|
|
// } |
|
|
|
// }); |
|
|
|
}, |
|
|
|
onShow: function() { |
|
|
|
console.log('App Show') |
|
|
|