diff --git a/zh-cn/application-dev/reference/apis/js-apis-call.md b/zh-cn/application-dev/reference/apis/js-apis-call.md index 4dd94b70f16f436860dc429e206371b6b6f8aafe..d7aba36c26116438a1a6a584a0f5343232ef5e0b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-call.md +++ b/zh-cn/application-dev/reference/apis/js-apis-call.md @@ -20,6 +20,10 @@ dial\(phoneNumber: string, callback: AsyncCallback\): void 拨打电话。使用callback异步回调。 +>**说明:** +> +>从API version 6 开始支持,从API version 9 开始废弃,建议使用[dialCall](#calldialcall9)替代。 + **需要权限**:ohos.permission.PLACE_CALL **系统能力**:SystemCapability.Telephony.CallManager @@ -46,6 +50,10 @@ dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback**说明:** +> +>从API version 6 开始支持,从API version 9 开始废弃,建议使用[dialCall](#calldialcall9)替代。 + **需要权限**:ohos.permission.PLACE_CALL **系统能力**:SystemCapability.Telephony.CallManager @@ -75,6 +83,10 @@ dial\(phoneNumber: string, options?: DialOptions\): Promise 拨打电话,可设置通话参数。使用Promise异步回调。 +>**说明:** +> +>从API version 6 开始支持,从API version 9 开始废弃,建议使用[dialCall](#calldialcall9)替代。 + **需要权限**:ohos.permission.PLACE_CALL **系统能力**:SystemCapability.Telephony.CallManager @@ -232,12 +244,14 @@ dialCall\(phoneNumber: string, options?: DialCallOptions\): Promise **示例:** ```js -try { - call.dialCall('138xxxxxxxx'); +let promise = call.dialCall("138xxxxxxxx", { + extras: false +}); +promise.then(data => { console.log(`dialCall success, promise: data->${JSON.stringify(data)}`); -} catch (error) { - console.log(`dialCall fail, promise: err->${JSON.stringify(error)}`); -} +}).catch(err => { + console.error(`dialCall fail, promise: err->${JSON.stringify(err)}`); +}); ```