收藏
回答

h5里面怎么用wx.openCustomerServiceChat打开客服链接?

公众号h5网页,打开公众号客服,使用一下方法,但是打不开!

wx.config({

debug: true, // 生产环境设为false

appId: 'wx3f1bbc25e1aa2c4c',

timestamp: '1747204748',

nonceStr: '2025051414390898841321',

signature: '134b715fc2400f18e9db96314a3323a905650831',

jsApiList: ['openCustomerServiceChat'] // 需要使用的JS接口列表

})


wx.ready((ret) => {

wx.checkJsApi({

jsApiList: ['openCustomerServiceChat'],

success: (res) => {

wx.openCustomerServiceChat({

extInfo: {

url: ''

}, // 客服链接(可选)

corpId: '',

success: (ret) => {

console.log(ret)

uni.showToast({

title: '成功1111111111111',

icon: 'none'

})

console.log('客服会话已打开');

},

fail: (err) => {

console.error('打开客服失败:', err);

uni.showToast({

title: '失败9999999',

icon: 'none'

})

console.error('打开客服失败:', err);

}

})

},

fail: (err) => {

uni.showModal({

title: '提示',

content: JSON.stringify(err)

})

}

})


console.log('微信JS-SDK初始化完成')

})


回答关注问题邀请回答
收藏

2 个回答

  • 智能回答 智能回答 该问答由AI生成
    2天前
    有用
  • Mr.Zhao
    Mr.Zhao
    2天前

    文档里没有就不能用,别自己造API,难道是AI提供的?

    2天前
    有用
    回复 1
    • 初々心
      初々心
      2天前
      对,ai给的
      2天前
      回复
登录 后发表内容