当前位置:网站首页>微信小程序调用客服接口
微信小程序调用客服接口
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
边栏推荐
- pthread_self()为何重复了
- Elmo (bilstm-crf + Elmo) (conll-2003 named entity recognition NER)
- Android interview theme collection
- Neuron and neural network
- Ptorch classical convolutional neural network lenet
- Function executes only the once function for the first time
- json反序列化匿名数组/对象
- Multithreading
- The latest development of fed digital currency
- PySide2
猜你喜欢

Elmo (bilstm-crf + Elmo) (conll-2003 named entity recognition NER)

STM32 learning record 0007 - new project (based on register version)

smart-doc + torna生成接口文档

Qt Designer怎样加入资源文件

趣谈网络协议

elmo(BiLSTM-CRF+elmo)(Conll-2003 命名实体识别NER)

神经元与神经网络

Quartus prime hardware experimental development (de2-115 board) experiment II function adjustable comprehensive timer design

分库分表 & ShardingSphere

Port occupied 1
随机推荐
Interesting talk about network protocol
mysql新表,自增id长达20位,原因竟是......
联想产品经理林林:天津当地网络运营商网络故障 ZUI系统后台服务器暂时无法正常工作
接口文档yaml
Spark入门基本操作
[code analysis (5)] communication efficient learning of deep networks from decentralized data
AtomicIntegerArray源码分析与感悟
Pytorch 经典卷积神经网络 LeNet
scikit-learn构建模型的万能模板
Nodejs安装及环境配置
腾讯根据ip解析地址
Function executes only the once function for the first time
cnpm的诡异bug
微信小程序setInterval定时函数使用详细教程
China creates vast research infrastructure to support ambitious climate goals
_模_板_
pthread_self()为何重复了
低频量化之明日涨停预测
freeCodeCamp----time_ Calculator exercise
linux MySQL数据定时dump