frum
All checks were successful
Deploy to Server / deploy (push) Successful in 36s

This commit is contained in:
jeremygan2021
2026-02-24 17:00:31 +08:00
parent bccbec4bb1
commit c5ac3e1445
2 changed files with 36 additions and 4 deletions

View File

@@ -81,6 +81,12 @@ const ForumDetail = () => {
message.info(`已添加 @${nickname}`); message.info(`已添加 @${nickname}`);
}; };
const showUserTitle = (author) => {
if (author?.is_star || author?.title) {
message.info(author.title || '技术专家');
}
};
const handleSubmitReply = async () => { const handleSubmitReply = async () => {
if (!user) { if (!user) {
setLoginModalVisible(true); setLoginModalVisible(true);
@@ -220,7 +226,13 @@ const ForumDetail = () => {
<Space size={isMobile ? 'small' : 'large'} style={{ color: '#888', marginTop: 10, flexWrap: 'wrap' }}> <Space size={isMobile ? 'small' : 'large'} style={{ color: '#888', marginTop: 10, flexWrap: 'wrap' }}>
<Space> <Space>
<Avatar src={topic.author_info?.avatar_url} icon={<UserOutlined />} size={isMobile ? 'small' : 'default'} /> <Avatar
src={topic.author_info?.avatar_url}
icon={<UserOutlined />}
size={isMobile ? 'small' : 'default'}
style={{ cursor: 'pointer' }}
onClick={() => showUserTitle(topic.author_info)}
/>
<span style={{ color: '#ccc', fontSize: isMobile ? 12 : 14 }}>{topic.author_info?.nickname}</span> <span style={{ color: '#ccc', fontSize: isMobile ? 12 : 14 }}>{topic.author_info?.nickname}</span>
{topic.is_verified_owner && ( {topic.is_verified_owner && (
<Tooltip title="已验证购买过相关产品"> <Tooltip title="已验证购买过相关产品">
@@ -286,7 +298,13 @@ const ForumDetail = () => {
styles={{ body: { padding: isMobile ? '15px' : '24px' } }} styles={{ body: { padding: isMobile ? '15px' : '24px' } }}
> >
<div style={{ display: 'flex', gap: isMobile ? 10 : 16 }}> <div style={{ display: 'flex', gap: isMobile ? 10 : 16 }}>
<Avatar src={reply.author_info?.avatar_url} icon={<UserOutlined />} size={isMobile ? 'small' : 'default'} /> <Avatar
src={reply.author_info?.avatar_url}
icon={<UserOutlined />}
size={isMobile ? 'small' : 'default'}
style={{ cursor: 'pointer' }}
onClick={() => showUserTitle(reply.author_info)}
/>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 8 }}> <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 8 }}>
<Space size={isMobile ? 'small' : 'middle'} align="center"> <Space size={isMobile ? 'small' : 'middle'} align="center">

View File

@@ -177,6 +177,16 @@ const ForumList = () => {
return content.replace(/!\[.*?\]\(.*?\)/g, '[图片]').replace(/[#*`]/g, '') return content.replace(/!\[.*?\]\(.*?\)/g, '[图片]').replace(/[#*`]/g, '')
} }
const showUserTitle = (e, user) => {
e.stopPropagation()
if (user.is_star || user.title) {
Taro.showToast({
title: user.title || '技术专家',
icon: 'none'
})
}
}
return ( return (
<View className='forum-page'> <View className='forum-page'>
<View className='hero-section'> <View className='hero-section'>
@@ -238,7 +248,7 @@ const ForumList = () => {
</View> </View>
<ScrollView scrollX className='star-users-scroll'> <ScrollView scrollX className='star-users-scroll'>
{starUsers.map(user => ( {starUsers.map(user => (
<View key={user.id} className='star-user-card'> <View key={user.id} className='star-user-card' onClick={(e) => showUserTitle(e, user)}>
<Image src={user.avatar_url} className='user-avatar' /> <Image src={user.avatar_url} className='user-avatar' />
<Text className='user-name'>{user.nickname}</Text> <Text className='user-name'>{user.nickname}</Text>
<Text className='user-title'>{user.title || '专家'}</Text> <Text className='user-title'>{user.title || '专家'}</Text>
@@ -282,7 +292,11 @@ const ForumList = () => {
<View className='card-footer'> <View className='card-footer'>
<View className='author-info'> <View className='author-info'>
<Image className='avatar' src={item.author_info?.avatar_url || 'https://via.placeholder.com/30'} /> <Image
className='avatar'
src={item.author_info?.avatar_url || 'https://via.placeholder.com/30'}
onClick={(e) => showUserTitle(e, item.author_info)}
/>
<Text className={`nickname ${item.author_info?.is_star ? 'star' : ''}`}> <Text className={`nickname ${item.author_info?.is_star ? 'star' : ''}`}>
{item.author_info?.nickname || '匿名'} {item.author_info?.nickname || '匿名'}
</Text> </Text>