我的小程序 隐私协议指引已经审核通过,审核版本那里的小程序隐私协议也已经更新,但是还是无法通过 getPhoneNumber 调出打开手机号的页面。
uniapp 开发,调取手机号码的 button 是
<button @getphonenumber="getPhoneNumber" type="default" id="get_phone_number"
class="gui-button gui-padding" style="width: 250rpx;background-color: green;border-color: bisque;"
open-type="getPhoneNumber">
<text class="gui-button-text gui-color-white" style="font-size: 30rpx;">手机号码快捷登录</text>
</button>
,async getPhoneNumber(e) {
if (!e.detail.code) {
uni.showToast({
title: '微信授权失败',
icon: "none"
});
return false;
}
uni.showLoading({
// mask: true,
// title: '正在登录...'
title: '正在认证...'
})
try {
// 请求成功
console.log(e.detail.code)
uni.request({
url: 'https://www.najiahotel.com/get/phone_number',
method: 'POST',
data: {
'code': e.detail.code
},
success: res => {
console.log(res.code == 0)
if (res.data.code == 200 && res.data.data) {
let data = res.data.data;
if (data.errcode == 0 && data.phone_info != undefined && data.phone_info) {
this.authInfo.phone = data.phone_info.phoneNumber;
this.login_real({
"open_id": this.authInfo.open_id,
"phone": data.phone_info.phoneNumber,
})
}
} else {
// 没有注册过,自动注册
uni.showToast({
"title": res.data.message
})
}
uni.hideLoading();
// 请求失败
}
});
} catch (e) {
uni.hideLoading();
// 请求失败
uni.showToast({
title: e,
icon: "none",
duration: 2000
});
}},
报错是 [wxapplib]] backgroundfetch privacy fail {"errno":101,"errMsg":"private_getBackgroundFetchData:fail
你好,请使用微信开发者工具参考手机号组件文档调用接口https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html,可以正常调用吗?