|
@@ -119,24 +119,31 @@ Page({
|
|
|
} = e.currentTarget.dataset;
|
|
|
console.log(name)
|
|
|
if (name == '绑定微信') {
|
|
|
- wx.login({
|
|
|
- success(res) {
|
|
|
- if (res.code) {
|
|
|
- _Http.basic({
|
|
|
- "classname": "common.usercenter.usercenter",
|
|
|
- "method": "WechatBinding",
|
|
|
- "content": {
|
|
|
- "wechat_code": res.code
|
|
|
+ wx.showModal({
|
|
|
+ title: "提示",
|
|
|
+ content: "是否使用当前微信绑定此账号?",
|
|
|
+ success: res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.confirm) {
|
|
|
+ wx.login({
|
|
|
+ success(res) {
|
|
|
+ if (res.code) _Http.basic({
|
|
|
+ "classname": "common.usercenter.usercenter",
|
|
|
+ "method": "WechatBinding",
|
|
|
+ "content": {
|
|
|
+ "wechat_code": res.code
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 0) return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ wx.showToast({
|
|
|
+ title: '绑定成功',
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- /* if (res.code == 0) return wx.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: "none"
|
|
|
- }) */
|
|
|
})
|
|
|
- } else {
|
|
|
- console.log('登录失败!' + res.errMsg)
|
|
|
}
|
|
|
}
|
|
|
})
|