Draft
As a 小程序用户, I want 能够直接通过微信客服功能联系客服, so that 可以快速获得帮助和解决问题。
wx.openCustomerServiceChat 实现客服功能Taro.openCustomerServiceChat API调用mini/src/pages/profile/index.tsxmini/.env.development, mini/.env.productiondocs/wx-kefu.mddocs/error-handling.mdwx.openCustomerServiceChatTARO_APP_WX_CORP_ID=wwc6d7911e2d23b7fbTARO_APP_WX_KEFU_URL=https://work.weixin.qq.com/kfid/kfc5f4d729bc3c893d7已配置完成:
TARO_APP_WX_CORP_ID=wwc6d7911e2d23b7fbTARO_APP_WX_KEFU_URL=https://work.weixin.qq.com/kfid/kfc5f4d729bc3c893d7/mnt/code/176-162-template-21/mini/src/pages/profile/index.tsxconst handleCustomerService = () => {
try {
wx.openCustomerServiceChat({
extInfo: {
url: process.env.TARO_APP_WX_KEFU_URL
},
corpId: process.env.TARO_APP_WX_CORP_ID,
success: () => {
console.log('客服聊天打开成功')
},
fail: (error) => {
console.error('客服聊天打开失败:', error)
Taro.showToast({
title: '客服功能暂不可用,请稍后重试',
icon: 'none'
})
}
})
} catch (error) {
console.error('客服功能异常:', error)
Taro.showToast({
title: '客服功能异常,请稍后重试',
icon: 'none'
})
}
}
mini/tests/unit/pages/profile.test.tsx| Date | Version | Description | Author |
|---|---|---|---|
| 2025-10-30 | 1.0 | 初始故事创建 | John (PM) |
| Date | Version | Description | Author |
|---|---|---|---|
| 2025-10-30 | 1.0 | 初始故事创建 | John (PM) |
| 2025-10-30 | 1.1 | 实现微信客服功能 | James (Dev) |
Ready for Review
此部分将由QA代理在质量保证过程中填写