当前位置:网站首页>微信小程序调用客服接口
微信小程序调用客服接口
2022-04-23 14:02:00 【1029179954】
实现思路
由于小程序接口开发比较完善,所以我们直接调用微信小程序客服接口就可以。但必须阅读下面的接口文档
(1)客服功能使用指南
https://developers.weixin.qq.com/miniprogram/introduction/custom.html#%E5%8A%9F%E8%83%BD%E4%BB%8B%E7%BB%8D
(2)客服消息使用指南
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html
实现效果
由于自己没有服务器,所以客服消息统一使用微信第三方工具。小程序发起联系客服,消息就会推送到你自己的微信(服务推送),客服就可以回复客户发过来的消息。
微信小程序发送消息(客户)->微信的第三方工具(客服)->回复客户消息
具体实现的思路
(1)在页面使用客服消息
需要将 button 组件 open-type 的值设置为 contact,当用户点击后就会进入客服会话,如果用户在会话中点击了小程序消息,则会返回到小程序,开发者可以通过 bindcontact 事件回调获取到用户所点消息的页面路径 path 和对应的参数 query。
示例代码
wxxml
<button open-type="contact" bindcontact="handleContact"></button>
js
Page({
handleContact (e) {
console.log(e.detail.path)
console.log(e.detail.query)
}
})
(2)进入微信公众平台绑定客服微信号
按照下面的操作实现微信号的绑定

(3)绑定的微信号扫描下面的二维码(微信客服小程序)

(4)测试
1)微信小程序客户发消息 客户

2:微信收到消息 客服

3:点击服务通知进行消息回复 客服

4:客户收到客服的回复 客户
查看回复
更多的示例代码及学习资料请搜索微信公众号:小白XBIT
版权声明
本文为[1029179954]所创,转载请带上原文链接,感谢
https://blog.csdn.net/baidu_38978508/article/details/112093912
边栏推荐
- PATH环境变量
- Nodejs安装及环境配置
- 程序编译调试学习记录
- Un modèle universel pour la construction d'un modèle d'apprentissage scikit
- The art of automation
- 接口文档yaml
- Taobao released the baby prompt "your consumer protection deposit is insufficient, and the expiration protection has been started"
- crontab定时任务输出产生大量邮件耗尽文件系统inode问题处理
- AtomicIntegerArray源码分析与感悟
- STM32学习记录0007——新建工程(基于寄存器版)
猜你喜欢
随机推荐
Special test 05 · double integral [Li Yanfang's whole class]
json反序列化匿名数组/对象
1256: bouquet for algenon
nodejs通过require读取本地json文件出现Unexpected token / in JSON at position
读了一篇博客,重新理解闭包整理一下
websocket
Taobao released the baby prompt "your consumer protection deposit is insufficient, and the expiration protection has been started"
【报名】TF54:工程师成长地图与卓越研发组织打造
33 million IOPs, 39 microsecond delay, carbon footprint certification, who is serious?
JMeter pressure test tool
The latest development of fed digital currency
对List集合进行分页
低频量化之明日涨停预测
JS 力扣刷题 103. 二叉树的锯齿形层序遍历
多线程 @Async 线程池
Decimal 格式化小数位/DateTime 转换处理
[code analysis (3)] communication efficient learning of deep networks from decentralized data
Program compilation and debugging learning record
MySQL 修改主数据库
分库分表 & ShardingSphere








