wx.addPhoneContact
微信版本:8.0.26
wx.getSetting({
success(res) {
if (!res.authSetting['scope.addPhoneContact']) {
wx.showModal({
title: '通讯录授权',
content: '请打开通讯录权限,否则无法正常提供功能使用',
success:(res) => {
if (res.confirm) {
wx.authorize({
scope: 'scope.addPhoneContact',
success() {
wx.addPhoneContact({
firstName: name,
mobilePhoneNumber:phone,
organization:companyName,
email,
workAddressState:arr[0],
workAddressCity:arr[1],
workAddressStreet:addres
})
}
})
} else if (res.cancel) {
wx.showToast({
title: '授权失败',
})
}
},
})
} else {
wx.addPhoneContact({
firstName: name,
mobilePhoneNumber:phone,
organization:companyName,
email,
workAddressState:arr[0],
workAddressCity:arr[1],
workAddressStreet:addres
})
}
}
})
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。