|
|
|
@@ -14,7 +14,20 @@ Page({ |
|
|
|
url: '' |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkFun(){ |
|
|
|
this.setData({ |
|
|
|
ischecked: !this.data.ischecked |
|
|
|
}) |
|
|
|
}, |
|
|
|
login(){ |
|
|
|
if(!this.data.ischecked){ |
|
|
|
wx.showToast({ |
|
|
|
title: '请勾选协议', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
wx.login({ |
|
|
|
success (res) { |
|
|
|
console.log(res) |
|
|
|
@@ -31,5 +44,33 @@ Page({ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 授权手机号 |
|
|
|
getPhoneNumber(e) { |
|
|
|
console.log(e); |
|
|
|
let that = this |
|
|
|
if (e.detail.errMsg == "getPhoneNumber:ok") { |
|
|
|
// console.log(e) |
|
|
|
const { |
|
|
|
iv, |
|
|
|
encryptedData |
|
|
|
} = e.detail; |
|
|
|
// that.$u.api.bindMini({ |
|
|
|
// encrypted: encryptedData, |
|
|
|
// iv |
|
|
|
// }).then((res) => { // 绑定手机号 |
|
|
|
// console.log(res); |
|
|
|
// let userinfo = that.vuex_userInfo |
|
|
|
// userinfo.phone = res.data |
|
|
|
// that.$u.vuex("vuex_userInfo", userinfo); |
|
|
|
// uni.setStorageSync('userInfo', userinfo) |
|
|
|
// that.islogin = true |
|
|
|
// }) |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
icon: "none", |
|
|
|
title: "请授权手机号" |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |