feat: 首页所有组右侧显示功能数量

- 各组标题右侧统一绿色圆角数量徽章: 精选推荐/近期新功能/最近使用/我的收藏/新增工具/全部工具
- nf-head组margin-left:auto靠右; h3组改flex两端对齐
- 徽章实时随条目变化

验证: 精选7/新功能11/最近1/收藏1/全部108 ✓

CHANGELOG记录
This commit is contained in:
personal82555 committed 2026-10-13 17:51:15 +08:00
1 parent 59eaf2d7a7
commit c842c3589a
2 files changed
+53 -9

No files matched your search

+46 -9
View File
@@ -126,6 +126,7 @@ function onUpdateFavoriteTools() {
<div class="nf-head">
<span class="nf-title">⭐ 精选推荐</span>
<span class="nf-sub">为您精选的实用工具,管理员持续更新</span>
<span class="nf-count">{{ recoList.length }}</span>
</div>
<div class="nf-grid">
<RouterLink v-for="f in recoList" :key="f.path" :to="f.path" class="nf-card reco-card">
@@ -143,6 +144,7 @@ function onUpdateFavoriteTools() {
<div class="nf-head">
<span class="nf-title">🆕 近期新功能</span>
<span class="nf-sub">持续更新中,登录后数据云端同步、授权跟随账号</span>
<span class="nf-count">{{ newFeatures.length }}</span>
</div>
<div class="nf-grid">
<RouterLink v-for="f in newFeatures" :key="f.path" :to="f.path" class="nf-card">
@@ -178,8 +180,9 @@ function onUpdateFavoriteTools() {
</div>
<div v-if="recentToolList.length > 0">
<h3 class="mb-5px mt-25px text-neutral-400 font-500">
🕘 {{ $t('home.categories.recentTools') }}
<h3 class="mb-5px mt-25px text-neutral-400 font-500 grp-h3">
<span>🕘 {{ $t('home.categories.recentTools') }}</span>
<span class="grp-count">{{ recentToolList.length }}</span>
</h3>
<div class="grid grid-cols-1 gap-12px lg:grid-cols-3 md:grid-cols-3 sm:grid-cols-2 xl:grid-cols-4">
<ToolCard v-for="tool in recentToolList" :key="tool.name" :tool="tool" />
@@ -188,11 +191,14 @@ function onUpdateFavoriteTools() {
<transition name="height">
<div v-if="toolStore.favoriteTools.length > 0">
<h3 class="mb-5px mt-25px text-neutral-400 font-500">
{{ $t('home.categories.favoriteTools') }}
<c-tooltip :tooltip="$t('home.categories.favoritesDndToolTip')">
<n-icon :component="IconDragDrop" size="18" />
</c-tooltip>
<h3 class="mb-5px mt-25px text-neutral-400 font-500 grp-h3">
<span>
{{ $t('home.categories.favoriteTools') }}
<c-tooltip :tooltip="$t('home.categories.favoritesDndToolTip')">
<n-icon :component="IconDragDrop" size="18" />
</c-tooltip>
</span>
<span class="grp-count">{{ favoriteTools.length }}</span>
</h3>
<Draggable
:list="favoriteTools"
@@ -209,8 +215,9 @@ function onUpdateFavoriteTools() {
</transition>
<div v-if="toolStore.newTools.length > 0">
<h3 class="mb-5px mt-25px text-neutral-400 font-500">
{{ t('home.categories.newestTools') }}
<h3 class="mb-5px mt-25px text-neutral-400 font-500 grp-h3">
<span>{{ t('home.categories.newestTools') }}</span>
<span class="grp-count">{{ toolStore.newTools.length }}</span>
</h3>
<div class="grid grid-cols-1 gap-12px lg:grid-cols-3 md:grid-cols-3 sm:grid-cols-2 xl:grid-cols-4">
<ToolCard v-for="tool in toolStore.newTools" :key="tool.name" :tool="tool" />
@@ -236,6 +243,36 @@ function onUpdateFavoriteTools() {
</template>
<style scoped lang="less">
// 首页各组右侧数量徽章(统一绿色圆角)
.nf-count,
.grp-count {
margin-left: auto;
min-width: 26px;
padding: 1px 9px;
border-radius: 999px;
background: rgba(24, 160, 88, 0.15);
color: #18a058;
font-size: 12.5px;
font-weight: 700;
text-align: center;
flex-shrink: 0;
line-height: 1.5;
}
// h3 组标题:左标签 + 右数量 两端对齐
.grp-h3 {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
> span:first-child {
display: flex;
align-items: center;
gap: 6px;
}
}
// 全部工具:默认折叠,标题左侧箭头 + 右侧数量徽章
.all-tools {
margin-top: 25px;