liweitao

一、

wxml

<button  catchtap="toCall">免费咨询</button>

 

wxjs

toCall:function(e){    
    wx.makePhoneCall({
      phoneNumber: this.data.info.traininfo.phone,
      success: function () {
        console.log(\'成功拨打电话\')
      }
    })
  },

 二、

wxml

<view class="page_li sub" data-phone="{{shop.shopinfo.contact_phone}}" catchtap="tophone">
    <image class="page_phone" src="/image/iocn.png" mode="aspectFill"></image>
    打电话
</view>

wxjs

tophone: function(el) {
    let phone = el.currentTarget.dataset.phone;
    // console.log(phone)
    wx.makePhoneCall({
        phoneNumber: phone,
        success: function() {
            console.log(\'成功拨打电话\')
        }
    })
  },

 

分类:

技术点:

相关文章:

  • 2022-01-12
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2021-11-25
猜你喜欢
  • 2021-06-02
  • 2021-05-19
  • 2022-02-19
  • 2022-12-23
  • 2022-02-20
相关资源
相似解决方案