style(home): 全面重构PC首页UI视觉层级与商品卡片布局

- 重构商品卡片为双栏分翼展台,消灭宽屏中间大面积空白
- 去除大粗冗余标题行,以核心资产微卡(哈夫币/保险/币比)作为视觉中心
- 过滤规格胶囊中的重复项(如AWM),与右侧仓库物资展台明确职责分工
- 优化核心资产文字与数字垂直居中对齐,统一沉稳灰阶底色与品牌点睛色
- 调整轮播图Banner高度与业务入口条呼吸感,提升首屏空间利用率与可读性
This commit is contained in:
yml2213
2026-09-06 18:57:13 +08:00
parent 4b9e64e398
commit 8e3283d951
4 changed files with 922 additions and 575 deletions
@@ -10,8 +10,15 @@ interface HomeBannerSlide {
image_url?: string image_url?: string
} }
interface StatItem {
label: string
value: string
hint?: string
}
interface Props { interface Props {
banners: HomeBannerSlide[] banners: HomeBannerSlide[]
stats?: StatItem[]
} }
const props = defineProps<Props>() const props = defineProps<Props>()
@@ -45,7 +52,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
<template> <template>
<section class="hero-board"> <section class="hero-board">
<el-carousel height="240px" indicator-position="outside" :interval="3600"> <el-carousel height="200px" :interval="3600">
<el-carousel-item v-for="slide in banners" :key="slide.title || slide.image_url"> <el-carousel-item v-for="slide in banners" :key="slide.title || slide.image_url">
<div <div
class="hero-slide" class="hero-slide"
@@ -74,6 +81,14 @@ function hasSlideCopy(slide: HomeBannerSlide) {
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<!-- 右下角半透明悬浮统计标签 -->
<div v-if="stats && stats.length" class="banner-stat-chips">
<div v-for="st in stats" :key="st.label" class="stat-pill" :title="st.hint">
<strong class="stat-pill-val">{{ st.value }}</strong>
<span class="stat-pill-lbl">{{ st.label }}</span>
</div>
</div>
<el-image-viewer <el-image-viewer
v-if="previewVisible" v-if="previewVisible"
:url-list="previewUrls" :url-list="previewUrls"
@@ -87,8 +102,10 @@ function hasSlideCopy(slide: HomeBannerSlide) {
<style scoped> <style scoped>
.hero-board { .hero-board {
position: relative;
min-width: 0; min-width: 0;
border-radius: 16px; width: 100%;
border-radius: 14px;
overflow: hidden; overflow: hidden;
background: #ffffff; background: #ffffff;
} }
@@ -98,7 +115,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
} }
.hero-board :deep(.el-carousel__container) { .hero-board :deep(.el-carousel__container) {
height: 240px; height: 200px;
overflow: hidden; overflow: hidden;
} }
@@ -111,7 +128,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 40px; padding: 24px 36px;
overflow: hidden; overflow: hidden;
color: #17233d; color: #17233d;
background: linear-gradient(135deg, #eff6ff 0%, #ffffff 58%, #fff7ed 100%); background: linear-gradient(135deg, #eff6ff 0%, #ffffff 58%, #fff7ed 100%);
@@ -160,8 +177,8 @@ function hasSlideCopy(slide: HomeBannerSlide) {
.hero-copy span { .hero-copy span {
color: #ff6a00; color: #ff6a00;
font-size: 13px; font-size: 12px;
font-weight: 900; font-weight: 700;
} }
.hero-slide.has-image .hero-copy { .hero-slide.has-image .hero-copy {
@@ -173,35 +190,76 @@ function hasSlideCopy(slide: HomeBannerSlide) {
} }
.hero-copy h1 { .hero-copy h1 {
margin: 12px 0; margin: 6px 0;
font-size: 32px; font-size: 22px;
font-weight: 900; font-weight: 800;
line-height: 1.2; line-height: 1.2;
} }
.hero-copy p { .hero-copy p {
display: inline-block; display: inline-block;
margin: 0; margin: 0;
padding: 6px 12px; padding: 3px 10px;
border-radius: 999px; border-radius: 999px;
color: #1e293b; color: #1e293b;
background: rgba(255, 255, 255, 0.72); background: rgba(255, 255, 255, 0.72);
backdrop-filter: blur(4px); backdrop-filter: blur(4px);
font-size: 14px; font-size: 12px;
font-weight: 800; font-weight: 700;
} }
.hero-slide em { .hero-slide em {
position: absolute; position: absolute;
top: 22px; top: 14px;
right: 24px; right: 18px;
z-index: 1; z-index: 1;
padding: 6px 10px; padding: 4px 9px;
border-radius: 999px; border-radius: 999px;
color: #ffffff; color: #ffffff;
background: #ff6a00; background: #ff6a00;
font-size: 12px; font-size: 11px;
font-style: normal; font-style: normal;
font-weight: 900; font-weight: 700;
}
/* 悬浮微型统计标签栏 */
.banner-stat-chips {
position: absolute;
bottom: 12px;
right: 16px;
display: flex;
align-items: center;
gap: 8px;
z-index: 3;
}
.stat-pill {
display: inline-flex;
align-items: baseline;
gap: 5px;
padding: 4px 12px;
border-radius: 999px;
background: rgba(15, 23, 42, 0.65);
backdrop-filter: blur(6px);
border: 1px solid rgba(255, 255, 255, 0.15);
color: #ffffff;
font-size: 12px;
}
.stat-pill-val {
font-size: 14px;
font-weight: 700;
color: #fb923c;
}
.stat-pill-lbl {
font-size: 11px;
color: #cbd5e1;
}
@media (max-width: 768px) {
.banner-stat-chips {
display: none;
}
} }
</style> </style>
@@ -35,134 +35,79 @@ function selectZone(key: string) {
</script> </script>
<template> <template>
<div class="zone-tabs"> <div class="zone-pill-group">
<button <button
v-for="zone in zones" v-for="zone in zones"
:key="zone.key" :key="zone.key"
type="button" type="button"
class="zone-tab" class="zone-pill-item"
:class="{ active: activeZone === zone.key }" :class="{ active: activeZone === zone.key }"
:title="zone.hint"
@click="selectZone(zone.key)" @click="selectZone(zone.key)"
> >
<span class="zone-icon" aria-hidden="true"> <el-icon class="zone-pill-icon"><component :is="zoneIcons[zone.key] || Grid" /></el-icon>
<el-icon><component :is="zoneIcons[zone.key] || Grid" /></el-icon> <span class="zone-pill-label">{{ zone.label }}</span>
</span> <span class="zone-pill-badge" :class="{ 'is-zero': zone.count === 0 }">{{ zone.count }}</span>
<span class="zone-title">
<strong>{{ zone.label }}</strong>
<span class="zone-count" :class="{ 'is-empty': zone.count === 0 }">{{ zone.count }}</span>
</span>
<small>{{ zone.hint }}</small>
</button> </button>
</div> </div>
</template> </template>
<style scoped> <style scoped>
.zone-tabs { .zone-pill-group {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 12px;
min-width: 0;
}
.zone-tab {
display: flex; display: flex;
flex-direction: column; align-items: center;
gap: 10px; gap: 8px;
min-width: 0; flex-wrap: wrap;
padding: 14px;
border: 1px solid #eef1f5;
border-radius: 14px;
background: #ffffff;
cursor: pointer;
text-align: left;
transition:
border-color 0.18s ease,
background-color 0.18s ease,
box-shadow 0.18s ease,
transform 0.18s ease;
} }
.zone-tab:hover { .zone-pill-item {
border-color: #ffd4b0;
background: #fffaf5;
transform: translateY(-1px);
box-shadow: 0 6px 16px rgba(255, 106, 0, 0.08);
}
.zone-tab.active {
border-color: #ff6a00;
background: #fff7ed;
box-shadow: 0 6px 16px rgba(255, 106, 0, 0.1);
}
.zone-icon {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; gap: 6px;
width: 32px; min-height: 32px;
height: 32px; padding: 0 12px;
border-radius: 9px; border: 1px solid #e2e8f0;
background: #f3f5f9; border-radius: 999px;
color: #94a3b8; background: #ffffff;
font-size: 18px; color: #475569;
transition: font-size: 13px;
background-color 0.18s ease, font-weight: 600;
color 0.18s ease; cursor: pointer;
transition: all 0.18s ease;
} }
.zone-tab:hover .zone-icon, .zone-pill-item:hover {
.zone-tab.active .zone-icon { border-color: #ffd4b0;
background: #ffe6d2;
color: #ff6a00; color: #ff6a00;
background: #fffaf5;
} }
.zone-title { .zone-pill-item.active {
display: flex; border-color: #ff6a00;
align-items: baseline; background: #ff6a00;
justify-content: space-between; color: #ffffff;
gap: 8px; box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
min-width: 0;
} }
.zone-title strong { .zone-pill-icon {
overflow: hidden; font-size: 14px;
font-size: 15px;
font-weight: 700;
color: #17233d;
text-overflow: ellipsis;
white-space: nowrap;
} }
.zone-count { .zone-pill-badge {
flex-shrink: 0; padding: 1px 6px;
font-size: 15px; border-radius: 999px;
font-weight: 800; background: #f1f5f9;
color: #ff6a00; color: #64748b;
font-variant-numeric: tabular-nums; font-size: 11px;
}
.zone-count.is-empty {
color: #c0c8d4;
font-weight: 700; font-weight: 700;
} }
.zone-tab small { .zone-pill-item.active .zone-pill-badge {
overflow: hidden; background: rgba(255, 255, 255, 0.25);
font-size: 12px; color: #ffffff;
color: #7b8798;
text-overflow: ellipsis;
white-space: nowrap;
} }
@media (max-width: 900px) { .zone-pill-badge.is-zero {
.zone-tabs { opacity: 0.6;
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (max-width: 560px) {
.zone-tabs {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
} }
</style> </style>
File diff suppressed because it is too large Load Diff
+104 -91
View File
@@ -36,7 +36,6 @@ import {
import { useListingQuery } from '@/features/listings/composables/useListingQuery' import { useListingQuery } from '@/features/listings/composables/useListingQuery'
import HomeAnnouncement from '../components/HomeAnnouncement.vue' import HomeAnnouncement from '../components/HomeAnnouncement.vue'
import HomeBanner from '../components/HomeBanner.vue' import HomeBanner from '../components/HomeBanner.vue'
import HomeStats from '../components/HomeStats.vue'
import HomeFilters from '../components/HomeFilters.vue' import HomeFilters from '../components/HomeFilters.vue'
import HomeZones from '../components/HomeZones.vue' import HomeZones from '../components/HomeZones.vue'
import ListingCard from '../components/ListingCard.vue' import ListingCard from '../components/ListingCard.vue'
@@ -358,18 +357,23 @@ loadHome()
<main class="home-content"> <main class="home-content">
<div class="hero-section"> <div class="hero-section">
<HomeBanner :banners="banners" /> <HomeBanner :banners="banners" :stats="statCards" />
<HomeStats :stats="statCards" />
</div> </div>
<div class="biz-entry-grid" aria-label="业务入口"> <div class="biz-entry-grid" aria-label="业务入口">
<RouterLink class="biz-entry" to="/"> <RouterLink class="biz-entry" to="/">
<strong>租号大厅</strong> <div class="biz-title-row">
<small>高哈夫币 · 安全交接 · 随租随玩</small> <strong>租号大厅</strong>
<small>安全交接 · 随租随玩</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</RouterLink> </RouterLink>
<RouterLink class="biz-entry crash" to="/crash"> <RouterLink class="biz-entry crash" to="/crash">
<strong>撞车 <em>NEW</em></strong> <div class="biz-title-row">
<small>选购商品 · 支付后进群联系客服</small> <strong>撞车 <em>NEW</em></strong>
<small>选购商品 · 进群交接</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</RouterLink> </RouterLink>
<button <button
v-if="awRecycle.enabled" v-if="awRecycle.enabled"
@@ -377,8 +381,11 @@ loadHome()
class="biz-entry aw-recycle" class="biz-entry aw-recycle"
@click="openAWRecycle" @click="openAWRecycle"
> >
<strong>{{ awRecycle.title }}</strong> <div class="biz-title-row">
<small>{{ awRecycle.subtitle }}</small> <strong>{{ awRecycle.title }}</strong>
<small>{{ awRecycle.subtitle }}</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</button> </button>
<button <button
v-if="cooperationFeedback.enabled" v-if="cooperationFeedback.enabled"
@@ -386,8 +393,11 @@ loadHome()
class="biz-entry cooperation-feedback" class="biz-entry cooperation-feedback"
@click="openCooperationFeedback" @click="openCooperationFeedback"
> >
<strong>{{ cooperationFeedback.title }}</strong> <div class="biz-title-row">
<small>{{ cooperationFeedback.subtitle }}</small> <strong>{{ cooperationFeedback.title }}</strong>
<small>{{ cooperationFeedback.subtitle }}</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</button> </button>
</div> </div>
@@ -444,11 +454,13 @@ loadHome()
@reset="handleResetFilters" @reset="handleResetFilters"
/> />
<div class="list-head"> <!-- 专区与排序合并为同一行极简操作条 -->
<div class="zone-head"> <div class="list-control-bar">
<p class="eyebrow">Account Zone</p> <HomeZones
<h2>账号专区</h2> :zones="zoneOptions"
</div> :active-zone="activeZone"
@update:active-zone="activeZone = $event"
/>
<div class="list-actions sort-bar" role="group" aria-label="排序方式"> <div class="list-actions sort-bar" role="group" aria-label="排序方式">
<button <button
v-for="item in sortOptions" v-for="item in sortOptions"
@@ -463,12 +475,6 @@ loadHome()
</div> </div>
</div> </div>
<HomeZones
:zones="zoneOptions"
:active-zone="activeZone"
@update:active-zone="activeZone = $event"
/>
<div v-if="!loading && listings.length === 0" class="home-empty-state"> <div v-if="!loading && listings.length === 0" class="home-empty-state">
<strong>没有符合条件的账号</strong> <strong>没有符合条件的账号</strong>
<span>可以放宽筛选条件或切回全部专区。</span> <span>可以放宽筛选条件或切回全部专区。</span>
@@ -489,7 +495,7 @@ loadHome()
<style scoped> <style scoped>
.pc-home-redesign { .pc-home-redesign {
display: grid; display: grid;
gap: 20px; gap: 12px;
width: 100%; width: 100%;
max-width: 1720px; max-width: 1720px;
min-width: 0; min-width: 0;
@@ -499,7 +505,12 @@ loadHome()
.home-content { .home-content {
display: grid; display: grid;
gap: 20px; gap: 12px;
min-width: 0;
}
.hero-section {
width: 100%;
min-width: 0; min-width: 0;
} }
@@ -511,54 +522,83 @@ loadHome()
.biz-entry { .biz-entry {
display: flex; display: flex;
flex-direction: column; align-items: center;
gap: 6px; justify-content: space-between;
padding: 16px 18px; gap: 10px;
border-radius: 14px; min-height: 52px;
border: 1px solid #eef1f5; padding: 12px 18px;
background: #fff; border-radius: 12px;
border: 1px solid #e2e8f0;
background: #ffffff;
text-decoration: none; text-decoration: none;
text-align: left;
cursor: pointer; cursor: pointer;
font: inherit; font: inherit;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
transition: transition:
border-color 0.18s ease, border-color 0.2s ease,
box-shadow 0.18s ease; box-shadow 0.2s ease,
transform 0.2s ease;
} }
.biz-entry:hover { .biz-entry:hover {
border-color: #ffd4b0; border-color: #ffbe98;
box-shadow: 0 6px 16px rgba(255, 106, 0, 0.08); box-shadow: 0 6px 16px rgba(255, 106, 0, 0.08);
transform: translateY(-2px);
}
.biz-title-row {
display: flex;
align-items: baseline;
gap: 10px;
min-width: 0;
} }
.biz-entry strong { .biz-entry strong {
color: #17233d; color: #0f172a;
font-size: 16px; font-size: 15px;
font-weight: 700;
letter-spacing: -0.01em;
white-space: nowrap;
} }
.biz-entry small { .biz-entry small {
color: #7b8798; color: #64748b;
font-size: 13px; font-size: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.biz-arrow {
color: #94a3b8;
flex-shrink: 0;
transition: transform 0.2s ease, color 0.2s ease;
}
.biz-entry:hover .biz-arrow {
color: #ff6a00;
transform: translateX(2px);
} }
.biz-entry.crash strong em { .biz-entry.crash strong em {
margin-left: 6px; margin-left: 6px;
padding: 1px 6px; padding: 2px 6px;
border-radius: 999px; border-radius: 999px;
background: #ff6a00; background: #ff6a00;
color: #fff; color: #fff;
font-size: 11px; font-size: 10px;
font-style: normal; font-style: normal;
font-weight: 700;
} }
.biz-entry.aw-recycle { .biz-entry.aw-recycle {
border-color: #e8edff; border-color: #e0e7ff;
background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%); background: linear-gradient(135deg, #ffffff 0%, #f6f8fe 100%);
} }
.biz-entry.cooperation-feedback { .biz-entry.cooperation-feedback {
border-color: #d9f0e5; border-color: #ccfbf1;
background: linear-gradient(135deg, #ffffff 0%, #f1fbf6 100%); background: linear-gradient(135deg, #ffffff 0%, #f0fdf9 100%);
} }
:deep(.aw-recycle-image) { :deep(.aw-recycle-image) {
@@ -572,74 +612,47 @@ loadHome()
@media (max-width: 960px) { @media (max-width: 960px) {
.biz-entry-grid { .biz-entry-grid {
grid-template-columns: 1fr; grid-template-columns: repeat(2, 1fr);
} }
} }
.infinite-load-state { .infinite-load-state {
padding: 6px 0 18px; padding: 12px 0 24px;
color: #94a3b8; color: #94a3b8;
font-size: 13px; font-size: 13px;
font-weight: 700; font-weight: 600;
text-align: center; text-align: center;
} }
.hero-section { /* 专区与排序单行交互条 */
display: grid; .list-control-bar {
grid-template-columns: minmax(0, 1fr) 320px;
gap: 20px;
min-width: 0;
}
.list-head {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: center;
gap: 16px; gap: 12px;
flex-wrap: wrap; flex-wrap: wrap;
} padding: 2px 0;
.zone-head {
display: flex;
flex-direction: column;
gap: 4px;
}
.eyebrow {
margin: 0;
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.1em;
color: #ff6a00;
}
.zone-head h2 {
margin: 0;
font-size: 28px;
font-weight: 900;
color: #17233d;
} }
.sort-bar { .sort-bar {
display: inline-flex; display: inline-flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: 4px;
align-items: center; align-items: center;
padding: 4px; padding: 3px;
border-radius: 12px; border-radius: 10px;
background: #f3f5f9; background: #f1f5f9;
} }
.sort-chip { .sort-chip {
min-height: 32px; min-height: 28px;
padding: 0 14px; padding: 0 12px;
border: none; border: none;
border-radius: 9px; border-radius: 8px;
background: transparent; background: transparent;
color: #64748b; color: #64748b;
font-size: 13px; font-size: 12px;
font-weight: 700; font-weight: 600;
cursor: pointer; cursor: pointer;
transition: transition:
background 0.15s ease, background 0.15s ease,
@@ -648,14 +661,14 @@ loadHome()
} }
.sort-chip:hover { .sort-chip:hover {
color: #334155; color: #0f172a;
background: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.8);
} }
.sort-chip.active { .sort-chip.active {
background: #ffffff; background: #ffffff;
color: #ff6a00; color: #ff6a00;
box-shadow: 0 1px 4px rgba(23, 35, 61, 0.08); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
} }
.enhanced-desktop-list { .enhanced-desktop-list {