Commit 6c1696a9 by chenwq

红包登陆,自动跳转

1 parent ed1d6599
...@@ -39,7 +39,7 @@ Page({ ...@@ -39,7 +39,7 @@ Page({
message message
} = await wx.p.api.userApi.authUserPhone(detail, this.sessionId) } = await wx.p.api.userApi.authUserPhone(detail, this.sessionId)
wx.hideLoading() wx.hideLoading()
if (code == '0') this.customerLoginCallBack(data) if (code == '0') this.customerLoginCallBack(data, true)
else throw message else throw message
} catch (error) { } catch (error) {
this.showTips(error || '服务不可用') this.showTips(error || '服务不可用')
...@@ -53,7 +53,7 @@ Page({ ...@@ -53,7 +53,7 @@ Page({
wx.p.wxApi.showToast(typeof message == 'string' ? message : '请同意以下用户协议') wx.p.wxApi.showToast(typeof message == 'string' ? message : '请同意以下用户协议')
}, },
customerLoginCallBack(data) { customerLoginCallBack(data, isAuto = false) {
wx.$LoginStatus = false wx.$LoginStatus = false
wx.p.storage.set('userInfo', data) wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId) wx.p.storage.set('sessionId', data.sessionId)
...@@ -82,6 +82,8 @@ Page({ ...@@ -82,6 +82,8 @@ Page({
this.setData({ this.setData({
hasUserInfo: true hasUserInfo: true
}) })
} else if (isAuto) {
this.jumpAuthUserInfo()
} }
}, },
async jumpAuthUserInfo() { async jumpAuthUserInfo() {
...@@ -93,7 +95,7 @@ Page({ ...@@ -93,7 +95,7 @@ Page({
// redirectUrl = `${domain}/wx-oauth`, // redirectUrl = `${domain}/wx-oauth`,
redirectUrl = `https://scrm.glsx.com.cn/wx-oauth`, redirectUrl = `https://scrm.glsx.com.cn/wx-oauth`,
// redirectUrl = 'http://scrm.dev.glsx.com.cn/wx-oauth', // redirectUrl = 'http://scrm.dev.glsx.com.cn/wx-oauth',
// 云商 wx1cf40dc91c28a7fd ,glsxtest02 wx56bed167ad463f70 // 云商/业主生活社开发者 wx1cf40dc91c28a7fd ,glsxtest02 wx56bed167ad463f70
appid = 'wx56bed167ad463f70', appid = 'wx56bed167ad463f70',
wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect` wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
console.log(redirectUrl, appid) console.log(redirectUrl, appid)
......
...@@ -24,6 +24,7 @@ Page({ ...@@ -24,6 +24,7 @@ Page({
headImgUrl: info.avatarUrl, headImgUrl: info.avatarUrl,
hasUserInfo: true hasUserInfo: true
}) })
res.toCheckMember()
let item = { let item = {
add_way: '104', add_way: '104',
customer_phone: res.data.userInfo.phone, customer_phone: res.data.userInfo.phone,
...@@ -33,7 +34,7 @@ Page({ ...@@ -33,7 +34,7 @@ Page({
} }
let json = JSON.stringify(item) let json = JSON.stringify(item)
// 数据上报 // 数据上报
wx.p.api.common.trackHttp({ json }).then(response => {}) wx.p.api.common.trackHttp({ json }).then(response => { })
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!