当前位置:网站首页>微信小程序调用客服接口
微信小程序调用客服接口
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
边栏推荐
猜你喜欢
Quartus prime hardware experimental development (de2-115 board) experiment II function adjustable comprehensive timer design
PySide2
分库分表 & ShardingSphere
Multithreading
[VMware] address of VMware Tools
JDBC入门
大专的我,闭关苦学 56 天,含泪拿下阿里 offer,五轮面试,六个小时灵魂拷问
Ptorch classical convolutional neural network lenet
Question bank and answer analysis of the 2022 simulated examination of the latest eight members of Jiangxi construction (quality control)
趣谈网络协议
随机推荐
Restful WebService和gSoap WebService的本质区别
编程旅行之函数
Oracle告警日志alert.log和跟踪trace文件中文乱码显示
Multithreading
容差分析相关的计算公式
[code analysis (5)] communication efficient learning of deep networks from decentralized data
json反序列化匿名数组/对象
Express②(路由)
Basic knowledge learning record
多重继承虚基类习题
Taobao released the baby prompt "your consumer protection deposit is insufficient, and the expiration protection has been started"
Analysis and understanding of atomicintegerarray source code
力扣刷题 101. 对称二叉树
Port occupied 1
JDBC入门
Kettle--控件解析
Postman reference summary
linux安装mysql后修改密码
Choreographer full resolution
Record a strange bug: component copy after cache component jump