赞
踩
在小程序中使用openCustomerServiceChat接口,可以实现与客服进行实时聊天的功能。下面是使用该接口的步骤:
需要注意的是,使用openCustomerServiceChat接口需要满足以下条件:
- wxContact(contactUrl){
- let that = this
- wx.openCustomerServiceChat({
- extInfo: {url: contactUrl},
- corpId: this.data.shop.corpId,//企业必须去微信客服开通认证,这个是需要收费的
- success(res) {
- console.log(res)
- },
- fail(res){
- if(res.errCode == 6) {
- wx.showModal({
- title: '提示',
- // content: JSON.stringify(res)
- content: '绑定失败,请检查企业微信是否认证、小程序是否授权且认证。',
- })
- }
- }
- })
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。