Idea: Set two identical buttons, one is the click event button, used to judge whether it is checked; the other is the authorized login button, used to obtain user information
<button class='bottom' wx:if="{
{checked==false}}" bindtap="handleAgree">授权登录</button>
<button class='bottom' wx:else open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">授权登录</button>
data:{
checked:false
},
handleAgree() {
if (!this.data.checked) {
wx.showToast({
icon: "none",
title: '请阅读并同意平台服务协议及隐私协议',
duration: 2000
})
return false
}
},