鸿蒙 点击获取电话号拨打电话 @ohos.telephony.call (拨打电话)

1, 先看看效果

2, 直接CV 代码

 

 

import call from '@ohos.telephony.call'

@Entry
@Component
struct Index {
  @State
  photo: string = '15517189270'

  build() {
    Column() {
      Row() {
        Text(this.photo)
        Image($r('app.media.ic_contacts_incoming_filled'))
          .width(30)
          .height(30)
          .fillColor(Color.Orange)
      }
      .onClick(() => {
        console.log('onClick', 1111)
        call.makeCall(this.photo)
      })
    }
    .width('100%')
    .height('100%')
    .justifyContent(FlexAlign.Center)
  }
}