<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> </button>
按照小程序官方写法,始终报错Component "pages/myCar/myCar" does not have a method "getPhoneNumber" to handle event "getphonenumber".
请问这个回调函数写在什么地方
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"> </button>
按照小程序官方写法,始终报错Component "pages/myCar/myCar" does not have a method "getPhoneNumber" to handle event "getphonenumber".
请问这个回调函数写在什么地方
<button type="default" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</button>
methods: {
getPhoneNumber(e){
if(e.detail.errMsg == "getPhoneNumber:ok"){
console.log('用户同意提供手机号');
console.log(JSON.stringify(e.detail.encryptedData));
console.log(JSON.stringify(e.detail.iv));
var encryptedData = e.detail.encryptedData;
var iv = e.detail.iv;
}
},
}
安修丶
为啥这么久了文档不更新该方法。
2019-04-22 10:45