当前位置:网站首页>微信小程序调用客服接口
微信小程序调用客服接口
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
边栏推荐
- request模块
- Oracle告警日志alert.log和跟踪trace文件中文乱码显示
- [code analysis (7)] communication efficient learning of deep networks from decentralized data
- 大专的我,闭关苦学 56 天,含泪拿下阿里 offer,五轮面试,六个小时灵魂拷问
- Autumn recruitment in 2021, salary ranking No
- L2-024 部落 (25 分)
- 项目中遇到的问题(五)操作Excel接口Poi的理解
- [code analysis (4)] communication efficient learning of deep networks from decentralized data
- Express ② (routage)
- 低频量化之明日涨停预测
猜你喜欢
How does redis solve the problems of cache avalanche, cache breakdown and cache penetration
Express ② (routing)
go 语言 数组,字符串,切片
SQL数据库
Jenkins construction and use
蓝绿发布、滚动发布、灰度发布,有什么区别?
大专的我,闭关苦学 56 天,含泪拿下阿里 offer,五轮面试,六个小时灵魂拷问
Express ② (routage)
3300万IOPS、39微秒延迟、碳足迹认证,谁在认真搞事情?
Special test 05 · double integral [Li Yanfang's whole class]
随机推荐
Business case | how to promote the activity of sports and health app users? It is enough to do these points well
理解虚基类、虚函数与纯虚函数的概念(转)
多线程 @Async 线程池
Restful WebService和gSoap WebService的本质区别
JDBC入门
对List集合进行分页
elmo(BiLSTM-CRF+elmo)(Conll-2003 命名实体识别NER)
As a junior college student, I studied hard in closed doors for 56 days, won Ali offer with tears, five rounds of interviews and six hours of soul torture
leetcode--357. 统计各位数字都不同的数字个数
try --finally
Postman reference summary
JMeter pressure test tool
Choreographer full resolution
Express②(路由)
_模_板_
Crontab timing task output generates a large number of mail and runs out of file system inode problem processing
Quartus Prime硬件实验开发(DE2-115板)实验二功能可调综合计时器设计
Program compilation and debugging learning record
Kettle--控件解析
China creates vast research infrastructure to support ambitious climate goals