微信小程序> 微信小程序一键拨号功能在线客服

微信小程序一键拨号功能在线客服

浏览量:648 时间: 来源:嵤荣

一键拨号需要使用bindtap方法,然后在JS中写逻辑,具体如下:

在线客服微信小程序有自己的按钮时,只需要加上开放型='接触'就可以直接点击触发

小程序前端

view style='top:76%;left:82%; position: fixed;'     !-- 一键拨号 --     view class='hw50' style='background-color: rgba(0, 0, 0, 0.5);border-radius: 50%;' bindtap='callme'        image src='/images/xph.png' style='width:45rpx;height:45rpx;margin-top:18rpx; margin-left:30rpx;'/image        text class='block font10 white center'style='margin-top:-8rpx'一键拨号/text     /view     !-- 微信客服 --     view class='m_t5 hw50' style='background-color: rgba(0, 0, 0, 0.5);border-radius: 50%;'       button class='form_button'  open-type='contact'           image src='/images/xkf.png' style='width:45rpx;height:45rpx;margin-top:18rpx; margin-left:30rpx;'/image          text class='block font10 white center'style='margin-top:-20rpx'微信客服/text       /button     /view/view

样式:

.hw50{width:100rpx;height:100rpx;}/* 覆盖button样式 */button.form_button{  background-color:transparent;  padding:0;  margin:0;  display:inline;  position:static;  border:0;  padding-left:0;  padding-right:0;  border-radius:0;  font-size:0rpx;  color:transparent;}

拨号功能的方法

callme: function() {    var that = this    wx.makePhoneCall({      phoneNumber: '你的电话号',    })  },

 

版权声明

即速应用倡导尊重与保护知识产权。如发现本站文章存在版权问题,烦请提供版权疑问、身份证明、版权证明、联系方式等发邮件至197452366@qq.com ,我们将及时处理。本站文章仅作分享交流用途,作者观点不等同于即速应用观点。用户与作者的任何交易与本站无关,请知悉。

产品经理

手机 : 13312967497

擅长 : 小程序流量变现

扫码领取礼包

最新资讯

热门模板

  • 头条
  • 搜狐
  • 微博
  • 百家
  • 一点资讯
  • 知乎