ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
>[danger] **[点此进入芝麻小客服官网](https://xiaokefu.com.cn/?source=kanyun_mia_1010958)** <br> 在小程序内添加客服按钮,请参考官方文档:[客服按钮文档] (https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/receive.html) 或参考芝麻客服参考代码:[https://github.com/hotapp8/xiaokefu](https://github.com/hotapp8/xiaokefu) 以下是部分代码参考: >注意:客服入口可以有多个。位置及样式均可自定义。 小游戏请参考[官方文档](https://developers.weixin.qq.com/minigame/dev/api/open-api/customer-message/wx.openCustomerServiceConversation.html) <br> <br> ### 打开客服 ``` <button type='default' open-type='contact'> 打开客服 (普通客服) </button> ``` ### 固定的客服头像和昵称 ``` <button type='default' session-from='{"nickName":"赵丽颖","avatarUrl":"https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=956547549,964120469&fm=58"}' open-type="contact"> 带头像客服 (固定头像)</button> ``` ### 通过后端传递用户的头像和昵称(请注意其中的参数需要动态赋值) ``` <button type='default' session-from='{"nickName":"{{userInfo.nickName}}","avatarUrl":"{{userInfo.avatarUrl}}"}' open-type="contact" >带头像客服(微信头像)</button> ``` ### 传递用户浏览哪个产品,跟踪用户来源 ``` <button type='default' session-from='{"source":"产品BBBB","nickName":"{{userInfo.nickName}}","avatarUrl":"{{userInfo.avatarUrl}}"}' open-type="contact" >指定消息来源</button> ``` ### 指定客服 ``` <button type='default' session-from='{"kefu":["126","127"],"nickName":"{{userInfo.nickName}}","avatarUrl":"{{userInfo.avatarUrl}}"}' open-type="contact"> 指定客服</button> ``` ### 卡片消息,聊天页面可发送图片卡片给客服 ``` <button open-type='contact' send-message-title="会话内消息卡片" send-message-path="/pages/index/index" send-message-img="https://imgsa.baidu.com/baike/pic/item/562c11dfa9ec8a13918d4ed4fb03918fa0ecc06b.jpg" show-message-card="true">卡片消息</button> ``` </h> </h> <br> <br> <br> <br> >[danger] **[点此进入芝麻小客服官网](https://xiaokefu.com.cn/?source=kanyun_mia_1010958)** <br> ![](https://img.kancloud.cn/04/a1/04a1fd65b5f5cfbc32ad431a32fabd2a_200x199.png) </h> </h>