var that = this
plus.contacts.getAddressBook(plus.contacts.ADDRESSBOOK_PHONE, (addressbook) => {
console.info('获取通信录对象成功')
plus.contacts.getAddressBook(plus.contacts.ADDRESSBOOK_PHONE, (addressbook) => {
var contact = addressbook.create()
console.info(that.shuju.length)
for (let i = 0; i < that.shuju.length; i++) {
console.info(i)
contact.name = {
givenName: that.shuju[i].company
}
contact.phoneNumbers = [{
type: '手机',
value: that.shuju[i].mobile[0],
preferred: true
}]
contact.save((res4) => {
console.log()
uni.$showMsg('导入成功', 'success')
uni.$showMsg(res4)
this.$refs.popup2.hide()
this.duxuan = true
that.api.msg("导入成功", 1)
})
}
})
})