feat(user): 修改帮助中心联系客服入口为直连微信客服
- 替换原跳转页面逻辑,使用微信 Button 组件直接调起微信客服 - 设置 Button 关键属性 openType、sessionFrom、showMessageCard、sendMessageTitle 和 onContact 回调 - 重置 Button 样式保持原视觉,调整高度、内边距和圆角 - 从 @tarojs/components 中引入 Button 组件 - 提醒微信客服 Button 在开发者工具无效,需真机预览测试
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react'
|
||||
import { View, Text, ScrollView } from '@tarojs/components'
|
||||
import { View, Text, ScrollView, Button } from '@tarojs/components'
|
||||
import Taro from '@tarojs/taro'
|
||||
import EmptyState from '@/components/common/EmptyState'
|
||||
|
||||
@@ -127,14 +127,25 @@ const HelpCenterPage: React.FC = () => {
|
||||
</View>
|
||||
))}
|
||||
|
||||
{/* 联系客服入口 */}
|
||||
<View
|
||||
className='bg-white rounded-lg p-4 flex items-center justify-center gap-2 mt-3'
|
||||
onClick={() => Taro.navigateTo({ url: '/pages/user/customer-service/index' })}
|
||||
{/* 联系客服入口 - 直接进入微信客服 */}
|
||||
<Button
|
||||
openType="contact"
|
||||
sessionFrom="help_center"
|
||||
showMessageCard
|
||||
sendMessageTitle="欢迎咨询"
|
||||
onContact={(e: any) => console.log('客服会话回调:', e.detail)}
|
||||
className='bg-white rounded-lg w-full mt-3 flex items-center justify-center gap-2'
|
||||
style={{
|
||||
height: 'auto',
|
||||
lineHeight: 'normal',
|
||||
padding: '16px',
|
||||
border: 'none',
|
||||
borderRadius: '8px',
|
||||
}}
|
||||
>
|
||||
<Text className='text-xl'>📞</Text>
|
||||
<Text className='text-sm text-blue-500'>联系在线客服</Text>
|
||||
</View>
|
||||
</Button>
|
||||
|
||||
<View className='h-4'></View>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user