如题,在hbuilder uniapp 中,无论是真机调试还是打包android运行,显示的结果是删除成功,但是实际上联系人还在,以下是代码,求帮助
测试机:红米K40S
刚刚换手机试了一次,可以删除,但是红米手机删除不了啊,咋回事,求大神
// 删除数据
// 其中obj为[例]: {displayName: "钱老板1", phoneNumbers: "13822222222"}}
// chkContactsWrite() 为权限验证
doDistoryContact(obj) {
let that = this
this.chkContactsWrite().then(() => {
// that.makeCompleteModal.show = true // 执行完成后显示
console.log('权限验证已完成,准备删除')
plus.contacts.getAddressBook(plus.contacts.ADDRESSBOOK_PHONE, (addressBook) => {
addressBook.find(null, function(contacts) {
if (contacts.length > 0) {
var dc = contacts[0]
console.log('dc的值为:', JSON.stringify(dc))
dc.remove(() => {
console.log("Remove " + dc.displayName + " success!")
}, (e) => {
console.log(e.message)
})
}
}, (e) => {
uni.showToast({
title: e.message,
icon: 'none'
})
}, {
filter: [{
logic: "or",
field: "displayName",
value: "*" + obj.displayName + "*"
},
{
logic: "or",
field: "phoneNumbers",
value: "*" + obj.phoneNumbers + "*"
}
],
multi: false
})
})
})
},
console 内容