微信小程序中添加客服按钮微信小程序中添加客服按钮contact-button功能功能
小程序的客服系统,是微信做的非常成功的一个功能,开发者可以很方便的通过一行代码,就可实现客服功能。
1. 普通客服按钮添加普通客服按钮添加
<button open-type='contact' session-from=''>客服-联系我们</button>
2. 悬浮客服按钮添加,图片自定义悬浮客服按钮添加,图片自定义
大家看地图的有个客服图片图片资源。大家去iconfont 网站去找一个就可以了
index.wxml
<button class="kf_button" open-type="contact" session-from="weapp">
<image class="kf_image" src="../../resources/img/kf.PNG"></image>
</button>
index.wxss
.kf_button{
background-color: rgba(255, 255, 255, 0);
border: 0px;
height: 100rpx;
right: 0;
bottom: 20rpx;
position: fixed;
}