// wxml
<van-button
open-type="getPhoneNumber"
type="primary"
bind:getphonenumber="getPhoneNumber">
微信快速登录
</van-button>
// js
getPhoneNumber({ detail }) {
wx.getUserProfile({
lang: 'zh_CN',
desc: '用户登陆',
success: console.log,
fail: console.log
})
}
不能