小程序拨打电话

Posted pycmsj

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了小程序拨打电话相关的知识,希望对你有一定的参考价值。

index.wxml
<view class="hotLine" bindtap="callPhone" data-phone="{{mobile}}">{{mobile}}</view>


index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    mobile:‘1008611‘
  },
  callPhone(e){
     var mobile = e.currentTarget.dataset.phone; 
     var that = this;
     wx.makePhoneCall({
       phoneNumber: mobile,
       success:function(){},
     })
  },
})

以上是关于小程序拨打电话的主要内容,如果未能解决你的问题,请参考以下文章