WeChat applet realizes the function of making calls directly

1. WeChat applet realizes the function of making phone calls

WeChat Mini Program > API > Device > Make a call

js interface wx.makePhoneCall(OBJECT) , used to make phone calls

OBJECT parameter description:

parameter Types of Required illustrate
phoneNumber String Yes phone number to call
success Function no Callback for successful interface call
fail Function no Callback function for interface call failure
complete Function no The callback function of the end of the interface call (the call will be executed if it succeeds or fails)

 

2. Example of use:

wxml:

  <view class="weui-cell weui-cell_access" hover-class="weui-cell_active" bindtap='call'>
    <view class="weui-cell__hd">
      <view class='fa fa-phone'></view>
    </view>
    <view class="weui-cell__bd">{{phone}}</view>
    <view class="weui-cell__ft weui-cell__ft_in-access"></view>
  </view>

js:

//拨打电话事件
call:function(){
  wx.makePhoneCall({
    phoneNumber: this.data.phone,
  })
},

operation result:

 

 

More:

http://ad.jnqianle.cn/ad/11.html

http://www.jnqianle.cn/Mina/Index

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324931641&siteId=291194637