feat: show all community tags

This commit is contained in:
hajimi
2026-08-02 01:50:48 +08:00
parent f287e9faad
commit 255c3495b3
+3 -12
View File
@@ -31,16 +31,11 @@
<view class="community-topics">
<scroll-view scroll-x class="community-topics__scroll" :show-scrollbar="false">
<view class="community-topics__list">
<view v-for="tag in featuredTags" :key="tag.id" class="community-topic"
<view v-for="tag in displayTags" :key="tag.id" class="community-topic"
:class="{ 'community-topic--active': activeTagId === tag.id }" @tap="selectTag(tag)">
<text class="community-topic__icon" :style="{ color: tag.theme.color }">{{ tag.theme.icon }}</text>
<text>{{ tag.name }}</text>
</view>
<view v-if="tagList.length > featuredTags.length" class="community-topic community-topic--more"
@tap="switchFeed('topic')">
<u-icon name="more-circle" size="26" color="#667085" />
<text>更多话题</text>
</view>
</view>
</scroll-view>
</view>
@@ -131,8 +126,8 @@ const TOPIC_THEMES = [
{ icon: '🎮', color: '#596bff' }
]
const featuredTags = computed(() => {
return tagList.value.slice(0, 5).map((tag, index) => ({
const displayTags = computed(() => {
return tagList.value.map((tag, index) => ({
...tag,
theme: TOPIC_THEMES[index % TOPIC_THEMES.length]
}))
@@ -557,10 +552,6 @@ onShow(() => {
background: #f1f6ff;
box-shadow: 0 5rpx 14rpx rgba(20, 104, 245, 0.1);
}
&--more {
color: #667085;
}
}
.community-list {