#打卡不停更#HarmonyOS应用API-拨打电话
1.import需要的模块。import需要的模块importcallfrom'ohos.telephony.call';importobserverfrom'ohos.telephony.observer';2.调用hasVoiceCapability()接口获取当前设备呼叫能力,如果支持继续下一步;如果不支持则无法发起呼叫。letisSupportcall.hasVoiceCapability();if(!isSupport){console.log("notsupportvoicecapability,return.");return;}3.跳转到拨号界面,并显示拨号的号码。call.makeCall("13xxxx",(err){if(!err){console.log("makecallsuccess.");}else{console.log("makecallfail,erris:"+JSON.stringify(err));}});