公众号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初始化完成')
})
文档里没有就不能用,别自己造API,难道是AI提供的?