style(home): 全面重构PC首页UI视觉层级与商品卡片布局
- 重构商品卡片为双栏分翼展台,消灭宽屏中间大面积空白 - 去除大粗冗余标题行,以核心资产微卡(哈夫币/保险/币比)作为视觉中心 - 过滤规格胶囊中的重复项(如AWM),与右侧仓库物资展台明确职责分工 - 优化核心资产文字与数字垂直居中对齐,统一沉稳灰阶底色与品牌点睛色 - 调整轮播图Banner高度与业务入口条呼吸感,提升首屏空间利用率与可读性
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user