要实现解绑微信号,也就是解除授权
wxhtml:
<view bindtap="individualBtn">
<text>换绑微信号</text>
<image src="../../../img/signIn/1591571968980_.pic_hd.jpg"></image>
</view>
点击完成后,会出现一个弹窗
wxjs:
individualBtn() {
wx.showModal({
title: '警告',
content: '确定退出当前微信号',
success(res) {
if (res.confirm) {
wx.openSetting({
success(res) {
console.log(res.authSetting, '退出是否成功')
// res.authSetting = {
// "scope.userInfo": true,
// "scope.userLocation": true
// }
wx.reLaunch({
url: '../../login/loginAccounts/index'
})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
wx.openSetting可以重新设置是否授权
wx.openSetting({
success(res) {
console.log(res.authSetting, '退出是否成功')
// res.authSetting = {
// "scope.userInfo": true,
// "scope.userLocation": true
// }
wx.reLaunch({
url: '../../login/loginAccounts/index'
})
}
})