uni-app在app中挑起(打开)微信客服
APP挑起微信客服
·
uni-app在app中挑起微信客服
代码
// #ifndef APP-PLUS
uni.showToast({
title: '请在app打开',icon:"none"
});
// #endif
let wechat = null
plus.share.getServices(res => {
wechat = res.find(i => i.id === 'weixin')
if (wechat) {
wechat.openCustomerServiceChat({
corpid: 'wweab5f2e918****',//企业ID
url: 'https://work.weixin.qq.com/kfid/****',//客服地址
}, src => {
console.log("success:", JSON.stringify(src))
}, err => {
console.log("error:", JSON.stringify(err))
})
} else {
uni.showToast({
title: '当前环境不支持微信操作',icon:"error"
});
}
}, function() {
uni.showToast({
title: "获取服务失败,不支持该操作。" + JSON.stringify(e),
icon: 'none'
})
});
常见错误
deeplink customerservice no permission
-
解决方法1
如果出现此错误,请检查企业ID,或者打包测试(真机测试不行)。
-
解决方法2
网页登录企业微信-》应用管理-》企业客服
**企业认证后才能关联app**
更多推荐
已为社区贡献5条内容
所有评论(0)