app点击客服怎么直接跳转企业微信客服界面而不是先跳转浏览器再打开微信跳转客服界面

用户2739280
- 发布:2025-03-30 21:28
- 更新:2025-03-31 18:00
- 阅读:681

这是接入文档,需要接入微信SDK 调用SDK提供的接口会把企业微信客服的HttpUrl自动转成微信APP对应客服的页面地址(SchemeURL)。实际上你要跳转的不是企业微信APP而是微信APP,企微只是作为客服服务提供方。
在uni-app中好像有集成相关接口,使用h5+接口即可。 网上找了一段例子你试试。
html5+ 跳转微信客服
// #ifdef APP-PLUS
let sweixin = null
plus.share.getServices(res=>{
sweixin = res.find(i => i.id === 'weixin')
if(sweixin){
sweixin.openCustomerServiceChat({
corpid: '企业ID',
url: '客服地址',
},suc=>{
console.log("success",JSON.stringify(res))
},err=>{
console.log("error",JSON.stringify(err))
})
}else{
plus.nativeUI.alert('当前环境不支持微信操作!')
}
},function(){
uni.showToast({title: "获取服务失败,不支持该操作。"+JSON.stringify(e), icon: 'error'})
})
// #endif
用户2739280 (作者)
有示例吗
2025-03-31 16:47