has.makePhoneCall(Object object)
拨打电话。
起始版本: 1.0.0
参数:
参数为Object对象,包括以下字段。
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| phoneNumber | string | 是 | 需要拨打的电话号码。 |
| success | function | 否 | 接口调用成功的回调函数。 |
| fail | function | 否 | 接口调用失败的回调函数。 |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行)。 |
错误码信息:
| 错误码 | 错误信息 |
|---|---|
| 101 | context is undefined. |
| 12000201 | 1. cancel: makePhoneCall is not support on current device. 2. confirm: makePhoneCall is not support on current device. 3. makePhoneCall is not support on current device and UIContext is null. |
| 12000301 | 1. makePhoneCall failed. 2. makePhoneCall error. |
示例:
has.makePhoneCall({
phoneNumber: '138********',
success: () => {
console.info('makePhoneCall success');
},
fail: (err) => {
console.error('makePhoneCall fail', err);
},
complete: (res) => {
console.info('makePhoneCall complete', res);
}
});