点击弹出呼叫、添加联系人
//打电话 还是 添加到联系人
viewClick01: function (e) {
var phonenum = e.currentTarget.dataset.phonenum;
//显示“呼叫”、“添加联系人”弹窗
wx.showActionSheet({
itemList: ['呼叫', '添加联系人'],
success: function (res) {
console.log("点击电话 res:", res)
if (res.tapIndex == 0) {//直接呼叫
wx.makePhoneCall({
phoneNumber:phonenum,
success: function (res_makephone) {
console.log("呼叫电话返回:", res_makephone)
}
})
} else if (res.tapIndex == 1) {//添加联系人
wx.addPhoneContact({
firstName: '关关',
mobilePhoneNumber:phonenum,
success: function (res_addphone) {
console.log("电话添加联系人返回:", res_addphone)
}
})
}
}
})
},