<button open-type="getAuthorize" @getAuthorize="getAlPhoneNumber" @error="onAuthError" scope="phoneNumber"></button>
onAuthError(err) {
console.log('err',err)
uni.showToast({
title: "需要您授权手机号码后领取哦~",
icon: 'none',
duration: 2000
})
},
getAlPhoneNumber() {
my.getPhoneNumber({
scopes: "auth_user",
success: res => {
var resData = JSON.parse(res.response);
console.log('res',resData)
},
fail: res => {
uni.showToast({
title: "需要您授权手机号码后领取哦~",
icon: 'none',
duration: 2000
})
}
});
},