|
|
|
@@ -57,7 +57,6 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
shouquan(){ |
|
|
|
let userInfo = wx.getStorageSync('userInfo') |
|
|
|
if(userInfo.phone){ |
|
|
|
wx.showToast({ |
|
|
|
icon: 'none', |
|
|
|
@@ -87,64 +86,6 @@ Page({ |
|
|
|
url: '/pages/out/index?index=1&userid='+ this.data.userid+'&gameid=1'+'&type=2', |
|
|
|
}) |
|
|
|
}, |
|
|
|
//登录-获取token |
|
|
|
loginGettoken(){ |
|
|
|
let that = this |
|
|
|
wx.login({ |
|
|
|
success (res) { |
|
|
|
if (res.code) { |
|
|
|
//发起网络请求 |
|
|
|
wx.request({ |
|
|
|
url:'https://cktest.2weisou.com/meta/auth/mobile/token/social?grant_type=mobil&mobile=MINI_C@'+res.code+'@'+'', |
|
|
|
method: "POST", |
|
|
|
data: { |
|
|
|
}, |
|
|
|
header: { |
|
|
|
Authorization: "Basic YXBwbGV0OmFwcGxldA==", |
|
|
|
}, |
|
|
|
success(res1) { |
|
|
|
if (res1.statusCode == 200) { |
|
|
|
let userInfo = res1.data.user_info |
|
|
|
that.setData({ |
|
|
|
token: res1.data.access_token, |
|
|
|
userid: userInfo.id, |
|
|
|
userInfo: userInfo |
|
|
|
}) |
|
|
|
wx.setStorageSync('token', res1.data.access_token) |
|
|
|
wx.setStorageSync('userInfo', userInfo) |
|
|
|
if(!!userInfo.userWxName&&!!userInfo.phone){ |
|
|
|
that.leave() |
|
|
|
return; |
|
|
|
} |
|
|
|
if(!userInfo.userWxName||!userInfo.phone){ |
|
|
|
that.setData({ |
|
|
|
showBg: true |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
that.setData({ |
|
|
|
showBg: false |
|
|
|
}) |
|
|
|
} |
|
|
|
that.setData({ |
|
|
|
avatarModal: !!userInfo.userWxName?false:true, |
|
|
|
phoneModal1: !!userInfo.phone?false:true, |
|
|
|
step: 1 |
|
|
|
}) |
|
|
|
if(!that.data.avatarModal){ |
|
|
|
that.setData({ |
|
|
|
step: 2, |
|
|
|
phoneModal: that.data.phoneModal1 |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
console.log('登录失败!' + res.errMsg) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 绑定用户头像信息 |
|
|
|
bindNickname(obj) { |
|
|
|
let that = this |
|
|
|
|