This commit is contained in:
@@ -177,6 +177,16 @@ const ForumList = () => {
|
||||
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 (
|
||||
<View className='forum-page'>
|
||||
<View className='hero-section'>
|
||||
@@ -238,7 +248,7 @@ const ForumList = () => {
|
||||
</View>
|
||||
<ScrollView scrollX className='star-users-scroll'>
|
||||
{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' />
|
||||
<Text className='user-name'>{user.nickname}</Text>
|
||||
<Text className='user-title'>{user.title || '专家'}</Text>
|
||||
@@ -282,7 +292,11 @@ const ForumList = () => {
|
||||
|
||||
<View className='card-footer'>
|
||||
<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' : ''}`}>
|
||||
{item.author_info?.nickname || '匿名'}
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user