效果预览
实现方案
- 需先在小程序后台添加客服
- 在小程序中添加客户按钮
<button open-type='contact' class='contactButton'>
<t-grid-item style="width: 100%;" text="客服" icon="service" />
</button>
- button 组件上,添加
open-type='contact'
即可打开微信客服会话 - 此处将要显示的内容放在 button 组件内
.contactButton {
display: inline-block;
width: 25%;
background-color: transparent;
padding: 0;
margin: 0;
font-size: inherit;
}
.contactButton::after {
border: none
}
- 修改button 组件的样式,来
隐藏
原生按钮 - 根据页面的需求,修改对应的 width 值