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
}
interface StatItem {
label: string
value: string
hint?: string
}
interface Props {
banners: HomeBannerSlide[]
stats?: StatItem[]
}
const props = defineProps<Props>()
@@ -45,7 +52,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
<template>
<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">
<div
class="hero-slide"
@@ -74,6 +81,14 @@ function hasSlideCopy(slide: HomeBannerSlide) {
</el-carousel-item>
</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
v-if="previewVisible"
:url-list="previewUrls"
@@ -87,8 +102,10 @@ function hasSlideCopy(slide: HomeBannerSlide) {
<style scoped>
.hero-board {
position: relative;
min-width: 0;
border-radius: 16px;
width: 100%;
border-radius: 14px;
overflow: hidden;
background: #ffffff;
}
@@ -98,7 +115,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
}
.hero-board :deep(.el-carousel__container) {
height: 240px;
height: 200px;
overflow: hidden;
}
@@ -111,7 +128,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
height: 100%;
display: flex;
align-items: center;
padding: 40px;
padding: 24px 36px;
overflow: hidden;
color: #17233d;
background: linear-gradient(135deg, #eff6ff 0%, #ffffff 58%, #fff7ed 100%);
@@ -160,8 +177,8 @@ function hasSlideCopy(slide: HomeBannerSlide) {
.hero-copy span {
color: #ff6a00;
font-size: 13px;
font-weight: 900;
font-size: 12px;
font-weight: 700;
}
.hero-slide.has-image .hero-copy {
@@ -173,35 +190,76 @@ function hasSlideCopy(slide: HomeBannerSlide) {
}
.hero-copy h1 {
margin: 12px 0;
font-size: 32px;
font-weight: 900;
margin: 6px 0;
font-size: 22px;
font-weight: 800;
line-height: 1.2;
}
.hero-copy p {
display: inline-block;
margin: 0;
padding: 6px 12px;
padding: 3px 10px;
border-radius: 999px;
color: #1e293b;
background: rgba(255, 255, 255, 0.72);
backdrop-filter: blur(4px);
font-size: 14px;
font-weight: 800;
font-size: 12px;
font-weight: 700;
}
.hero-slide em {
position: absolute;
top: 22px;
right: 24px;
top: 14px;
right: 18px;
z-index: 1;
padding: 6px 10px;
padding: 4px 9px;
border-radius: 999px;
color: #ffffff;
background: #ff6a00;
font-size: 12px;
font-size: 11px;
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>
@@ -35,134 +35,79 @@ function selectZone(key: string) {
</script>
<template>
<div class="zone-tabs">
<div class="zone-pill-group">
<button
v-for="zone in zones"
:key="zone.key"
type="button"
class="zone-tab"
class="zone-pill-item"
:class="{ active: activeZone === zone.key }"
:title="zone.hint"
@click="selectZone(zone.key)"
>
<span class="zone-icon" aria-hidden="true">
<el-icon><component :is="zoneIcons[zone.key] || Grid" /></el-icon>
</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>
<el-icon class="zone-pill-icon"><component :is="zoneIcons[zone.key] || Grid" /></el-icon>
<span class="zone-pill-label">{{ zone.label }}</span>
<span class="zone-pill-badge" :class="{ 'is-zero': zone.count === 0 }">{{ zone.count }}</span>
</button>
</div>
</template>
<style scoped>
.zone-tabs {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 12px;
min-width: 0;
}
.zone-tab {
.zone-pill-group {
display: flex;
flex-direction: column;
gap: 10px;
min-width: 0;
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;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.zone-tab:hover {
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 {
.zone-pill-item {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 9px;
background: #f3f5f9;
color: #94a3b8;
font-size: 18px;
transition:
background-color 0.18s ease,
color 0.18s ease;
gap: 6px;
min-height: 32px;
padding: 0 12px;
border: 1px solid #e2e8f0;
border-radius: 999px;
background: #ffffff;
color: #475569;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.18s ease;
}
.zone-tab:hover .zone-icon,
.zone-tab.active .zone-icon {
background: #ffe6d2;
.zone-pill-item:hover {
border-color: #ffd4b0;
color: #ff6a00;
background: #fffaf5;
}
.zone-title {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
min-width: 0;
.zone-pill-item.active {
border-color: #ff6a00;
background: #ff6a00;
color: #ffffff;
box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
}
.zone-title strong {
overflow: hidden;
font-size: 15px;
font-weight: 700;
color: #17233d;
text-overflow: ellipsis;
white-space: nowrap;
.zone-pill-icon {
font-size: 14px;
}
.zone-count {
flex-shrink: 0;
font-size: 15px;
font-weight: 800;
color: #ff6a00;
font-variant-numeric: tabular-nums;
}
.zone-count.is-empty {
color: #c0c8d4;
.zone-pill-badge {
padding: 1px 6px;
border-radius: 999px;
background: #f1f5f9;
color: #64748b;
font-size: 11px;
font-weight: 700;
}
.zone-tab small {
overflow: hidden;
font-size: 12px;
color: #7b8798;
text-overflow: ellipsis;
white-space: nowrap;
.zone-pill-item.active .zone-pill-badge {
background: rgba(255, 255, 255, 0.25);
color: #ffffff;
}
@media (max-width: 900px) {
.zone-tabs {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (max-width: 560px) {
.zone-tabs {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.zone-pill-badge.is-zero {
opacity: 0.6;
}
</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 HomeAnnouncement from '../components/HomeAnnouncement.vue'
import HomeBanner from '../components/HomeBanner.vue'
import HomeStats from '../components/HomeStats.vue'
import HomeFilters from '../components/HomeFilters.vue'
import HomeZones from '../components/HomeZones.vue'
import ListingCard from '../components/ListingCard.vue'
@@ -358,18 +357,23 @@ loadHome()
<main class="home-content">
<div class="hero-section">
<HomeBanner :banners="banners" />
<HomeStats :stats="statCards" />
<HomeBanner :banners="banners" :stats="statCards" />
</div>
<div class="biz-entry-grid" aria-label="业务入口">
<RouterLink class="biz-entry" to="/">
<strong>租号大厅</strong>
<small>高哈夫币 · 安全交接 · 随租随玩</small>
<div class="biz-title-row">
<strong>租号大厅</strong>
<small>安全交接 · 随租随玩</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</RouterLink>
<RouterLink class="biz-entry crash" to="/crash">
<strong>撞车 <em>NEW</em></strong>
<small>选购商品 · 支付后进群联系客服</small>
<div class="biz-title-row">
<strong>撞车 <em>NEW</em></strong>
<small>选购商品 · 进群交接</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</RouterLink>
<button
v-if="awRecycle.enabled"
@@ -377,8 +381,11 @@ loadHome()
class="biz-entry aw-recycle"
@click="openAWRecycle"
>
<strong>{{ awRecycle.title }}</strong>
<small>{{ awRecycle.subtitle }}</small>
<div class="biz-title-row">
<strong>{{ awRecycle.title }}</strong>
<small>{{ awRecycle.subtitle }}</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</button>
<button
v-if="cooperationFeedback.enabled"
@@ -386,8 +393,11 @@ loadHome()
class="biz-entry cooperation-feedback"
@click="openCooperationFeedback"
>
<strong>{{ cooperationFeedback.title }}</strong>
<small>{{ cooperationFeedback.subtitle }}</small>
<div class="biz-title-row">
<strong>{{ cooperationFeedback.title }}</strong>
<small>{{ cooperationFeedback.subtitle }}</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</button>
</div>
@@ -444,11 +454,13 @@ loadHome()
@reset="handleResetFilters"
/>
<div class="list-head">
<div class="zone-head">
<p class="eyebrow">Account Zone</p>
<h2>账号专区</h2>
</div>
<!-- 专区与排序合并为同一行极简操作条 -->
<div class="list-control-bar">
<HomeZones
:zones="zoneOptions"
:active-zone="activeZone"
@update:active-zone="activeZone = $event"
/>
<div class="list-actions sort-bar" role="group" aria-label="排序方式">
<button
v-for="item in sortOptions"
@@ -463,12 +475,6 @@ loadHome()
</div>
</div>
<HomeZones
:zones="zoneOptions"
:active-zone="activeZone"
@update:active-zone="activeZone = $event"
/>
<div v-if="!loading && listings.length === 0" class="home-empty-state">
<strong>没有符合条件的账号</strong>
<span>可以放宽筛选条件或切回全部专区。</span>
@@ -489,7 +495,7 @@ loadHome()
<style scoped>
.pc-home-redesign {
display: grid;
gap: 20px;
gap: 12px;
width: 100%;
max-width: 1720px;
min-width: 0;
@@ -499,7 +505,12 @@ loadHome()
.home-content {
display: grid;
gap: 20px;
gap: 12px;
min-width: 0;
}
.hero-section {
width: 100%;
min-width: 0;
}
@@ -511,54 +522,83 @@ loadHome()
.biz-entry {
display: flex;
flex-direction: column;
gap: 6px;
padding: 16px 18px;
border-radius: 14px;
border: 1px solid #eef1f5;
background: #fff;
align-items: center;
justify-content: space-between;
gap: 10px;
min-height: 52px;
padding: 12px 18px;
border-radius: 12px;
border: 1px solid #e2e8f0;
background: #ffffff;
text-decoration: none;
text-align: left;
cursor: pointer;
font: inherit;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
transition:
border-color 0.18s ease,
box-shadow 0.18s ease;
border-color 0.2s ease,
box-shadow 0.2s ease,
transform 0.2s ease;
}
.biz-entry:hover {
border-color: #ffd4b0;
border-color: #ffbe98;
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 {
color: #17233d;
font-size: 16px;
color: #0f172a;
font-size: 15px;
font-weight: 700;
letter-spacing: -0.01em;
white-space: nowrap;
}
.biz-entry small {
color: #7b8798;
font-size: 13px;
color: #64748b;
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 {
margin-left: 6px;
padding: 1px 6px;
padding: 2px 6px;
border-radius: 999px;
background: #ff6a00;
color: #fff;
font-size: 11px;
font-size: 10px;
font-style: normal;
font-weight: 700;
}
.biz-entry.aw-recycle {
border-color: #e8edff;
background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
border-color: #e0e7ff;
background: linear-gradient(135deg, #ffffff 0%, #f6f8fe 100%);
}
.biz-entry.cooperation-feedback {
border-color: #d9f0e5;
background: linear-gradient(135deg, #ffffff 0%, #f1fbf6 100%);
border-color: #ccfbf1;
background: linear-gradient(135deg, #ffffff 0%, #f0fdf9 100%);
}
:deep(.aw-recycle-image) {
@@ -572,74 +612,47 @@ loadHome()
@media (max-width: 960px) {
.biz-entry-grid {
grid-template-columns: 1fr;
grid-template-columns: repeat(2, 1fr);
}
}
.infinite-load-state {
padding: 6px 0 18px;
padding: 12px 0 24px;
color: #94a3b8;
font-size: 13px;
font-weight: 700;
font-weight: 600;
text-align: center;
}
.hero-section {
display: grid;
grid-template-columns: minmax(0, 1fr) 320px;
gap: 20px;
min-width: 0;
}
.list-head {
/* 专区与排序单行交互条 */
.list-control-bar {
display: flex;
justify-content: space-between;
align-items: flex-end;
gap: 16px;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.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;
padding: 2px 0;
}
.sort-bar {
display: inline-flex;
flex-wrap: wrap;
gap: 8px;
gap: 4px;
align-items: center;
padding: 4px;
border-radius: 12px;
background: #f3f5f9;
padding: 3px;
border-radius: 10px;
background: #f1f5f9;
}
.sort-chip {
min-height: 32px;
padding: 0 14px;
min-height: 28px;
padding: 0 12px;
border: none;
border-radius: 9px;
border-radius: 8px;
background: transparent;
color: #64748b;
font-size: 13px;
font-weight: 700;
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition:
background 0.15s ease,
@@ -648,14 +661,14 @@ loadHome()
}
.sort-chip:hover {
color: #334155;
background: rgba(255, 255, 255, 0.7);
color: #0f172a;
background: rgba(255, 255, 255, 0.8);
}
.sort-chip.active {
background: #ffffff;
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 {