用户信息授权按钮怎么回调其他方法 比如confirm()方法
以下是代码片段
https://developers.weixin.qq.com/s/ox54fVm17fgg
Page({
data: {
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
bindGetUserInfo:function(){
that.confirm()
// 查看是否授权
wx.getSetting({
withCredentials:true ,
success: res => {
if (res.authSetting['scope.userInfo']) {
wx.getUserInfo({
success: res => {
console.log(res)
var userInfo = res.userInfo
console.log(userInfo)
}
})
}
}
})
},
confirm:function() {
console.log("测试")
},
})
<view class="submit" style="margin-top:70px;">
<button wx:if="{{canIUse}}" id="dologin" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">手机一键登录</button>
</view>
var userInfo = res.userInfo this.confirm(userInfo) 不太懂,到底是啥意思
授权成功后再调用其他方法啊