<template>
<view class="content">
<button type="default" open-type="getAuthorize" @getAuthorize="onGetAuthorize" @error="onAuthError" scope='phoneNumber'>getPhoneNumber</button>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
onGetAuthorize(e) {
my.getPhoneNumber({
success: (res) => {
console.log("encryptedData::", res);
},
fail: (err) => {
console.log(err);
console.log('getPhoneNumber_fail');
}
});
},
onAuthError(e) {
console.error(e);
}
}
}
</script>
2 个回复
DCloud_uni-ad_HDX
请提供模板代码
6***@qq.com
支付宝
一直失败