1.在 .wxml文件中添加点击事件 bindtap=‘to_call’
    <view class='right' bindtap='to_call'>
      <text class='iconfont icon-phone'>拨打</text>
    </view>
2.在 .js文件中处理
Page({
  data: {
  	phone: '1234567'
  },

  to_call: function(){
    wx.makePhoneCall({
      phoneNumber: this.data.phone 
    })
  }
})
3.拨打电话的效果图如下

微信小程序的一键拨打电话,wx.makePhoneCall接口

相关文章: