文档管理中心

联系人

has.chooseContact

has.chooseContact(Object object)

拉起手机通讯录,选择联系人。

起始版本: 1.0.4

参数:

参数为Object对象,包括以下字段。

展开
参数 类型 必填 描述
success function 接口调用成功的回调函数。
fail function 接口调用失败的回调函数。
complete function 接口调用结束的回调函数(调用成功、失败都会执行)。

success返回值:

展开
参数 类型 描述
phoneNumber string 手机号。
displayName string 联系人姓名。

错误码信息:

展开
错误码 错误信息
126 chooseContact is not supported.
12004101

1. chooseContact error.

2. no select contact.

示例:

has.chooseContact({
  success: (res) => {
    console.info('chooseContact success', res);
  },
  fail: (err) => {
    console.error('chooseContact fail', err);
  },
  complete: (res) => {
    console.info('chooseContact complete', res);
  }
});

has.addPhoneContact

has.addPhoneContact(Object object)

添加手机通讯录联系人。用户可以选择将该表单以“新增联系人”或“添加到已有联系人”的方式,写入手机系统通讯录。

起始版本: 1.0.13

参数:

参数为Object对象,包括以下字段。

展开
参数 类型 必填 描述
firstName string 名字。
photoFilePath string 头像本地文件路径。
remark string 备注。
mobilePhoneNumber string 手机号。
addressCountry string 联系地址国家。
addressState string 联系地址省份。
addressCity string 联系地址城市。
addressStreet string 联系地址街道。
addressPostalCode string 联系地址邮政编码。
organization string 公司。
title string 职位。
workFaxNumber string 工作传真。
workPhoneNumber string 工作电话。
hostNumber string 公司电话。
email string 电子邮件。
url string 网站。
workAddressCountry string 工作地址国家。
workAddressState string 工作地址省份。
workAddressCity string 工作地址城市。
workAddressStreet string 工作地址街道。
workAddressPostalCode string 工作地址邮政编码。
homeFaxNumber string 住宅传真。
homePhoneNumber string 住宅电话。
homeAddressCountry string 住宅地址国家。
homeAddressState string 住宅地址省份。
homeAddressCity string 住宅地址城市。
homeAddressStreet string 住宅地址街道。
homeAddressPostalCode string 住宅地址邮政编码。
success function 接口调用成功的回调函数。
fail function 接口调用失败的回调函数。
complete function 接口调用结束的回调函数(调用成功、失败都会执行)。

错误码信息:

展开
错误码 错误信息
126 addPhoneContact is not supported on this device, higher sdk is required.
12004001 addPhoneContact error.

示例:

has.addPhoneContact({
  firstName: '某',
  success: () => {
    console.info('addPhoneContact success');
  },
  fail: (err) => {
    console.error('addPhoneContact fail', err);
  },
  complete: (res) => {
    console.info('addPhoneContact complete', res);
  }
});
搜索
请输入您想要搜索的关键词