微信小程序增加悬浮在线客服
2018-03-27 本文已影响22人
极乐叔
例如在index首页增加客服代码及一键拨打电话
1、index.wxss或者app.wxss文件里增加样式
.img-plus-style {
height: 70rpx;
width: 70rpx;
position: fixed;
bottom: 220rpx;
right: 30rpx;
opacity: 0.7
}
.img-plus-style1 {
height: 70rpx;
width: 70rpx;
position: fixed;
bottom: 130rpx;
right: 30rpx;
opacity: 0.7
}
.zindex100{z-index: 100}
.yc{opacity: 0}
2、index.wxml文件增加代码
<view>
<contact-button type="default-dark" size="20" session-from="weapp" class="img-plus-style zindex100 yc">
</contact-button>
<image src="../../image/xk_kefu.png" class="img-plus-style"></image>
<image src="../../image/xk_tel.png" class="img-plus-style1" bindtap="calling"></image>
</view>
3、index.js增加 一键拨号
calling: function () {
wx.makePhoneCall({
phoneNumber: '10086',
})
},
4、把两个图标放在image目录下


作者:侠客源码
链接:微信小程序增加悬浮在线客服-资讯/观点-小程序社区-微信小程序-微信小程序开发社区-小程序开发论坛-微信小程序联盟
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。