当前位置:网站首页>微信小程序调用客服接口
微信小程序调用客服接口
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
边栏推荐
猜你喜欢

try --finally

crontab定时任务输出产生大量邮件耗尽文件系统inode问题处理

mysql新表,自增id长达20位,原因竟是......

Oracle告警日志alert.log和跟踪trace文件中文乱码显示

专题测试05·二重积分【李艳芳全程班】

Programming travel function

Question bank and answer analysis of the 2022 simulated examination of the latest eight members of Jiangxi construction (quality control)

PySide2

Wechat applet

2021年秋招,薪资排行NO
随机推荐
JS 力扣刷题 103. 二叉树的锯齿形层序遍历
Decimal 格式化小数位/DateTime 转换处理
Atcoder beginer contest 248c dice sum (generating function)
【报名】TF54:工程师成长地图与卓越研发组织打造
基础知识学习记录
groutine
centOS下mysql主从配置
PySide2
Jiannanchun understood the word game
visio安装报错 1:1935 2:{XXXXXXXX...
The art of automation
Decentralized Collaborative Learning Framework for Next POI Recommendation
浅谈基于openssl的多级证书,Multi-level CA的签发和管理,以及双向认证
MySQL 修改主数据库
Postman reference summary
What is the difference between blue-green publishing, rolling publishing and gray publishing?
Universal template for scikit learn model construction
AtomicIntegerArray源码分析与感悟
Android: answers to the recruitment and interview of intermediate Android Development Agency in early 2019 (medium)
JS 力扣刷题 102. 二叉树的层序遍历