uniapp 小程序接入企业微信客服
uniapp小程序有接入客服自带的方法,将button设置属性open-type='contact',就可以接入,但是只支持接入小程序客服,并不支持企业微信客服<button open-type='contact' session-from='' class="contact">联系我们</button>原生微信小程序方法,可以使用wx.openCustomerServic
·
uniapp小程序有接入客服自带的方法,将button设置属性open-type='contact',就可以接入,但是只支持接入小程序客服,并不支持企业微信客服
<button open-type='contact' session-from='' class="contact">联系我们</button>
原生微信小程序方法,可以使用wx.openCustomerServiceChat()去调用企业微信客服,去uniapp官方文档搜索并不支持,其实是可以直接使用的
一、去微信公众平台客服接入微信客服(详情见官方文档)
二、在代码中加上条件编译直接使用微信原生的wx.openCustomerServiceChat()方法
// #ifdef MP-WEIXIN
wx.openCustomerServiceChat({
extInfo: {
url: 'https://work.weixin.qq.com/...'//客服地址链接
},
corpId: '企业ID',//必须和你小程序上的一致
success(res) {
console.log(res, 1)
},
fail(res) {
console.log(res, 2)
},
})
// #endif
更多推荐
已为社区贡献2条内容
所有评论(0)