style(home): 首页筛选/横幅视觉优化,重置按钮与筛选胶囊悬浮点击统一主题橙

This commit is contained in:
yml2213
2026-10-16 14:35:04 +08:00
parent 703deb17d0
commit b5867e3c5e
6 changed files with 215 additions and 83 deletions
@@ -23,6 +23,9 @@ interface Props {
const props = defineProps<Props>() const props = defineProps<Props>()
// 轮播高度由 CSS 变量统一控制,方便大屏/窄屏按比例收敛。
const carouselHeight = 'var(--home-hero-height, 340px)'
const previewVisible = ref(false) const previewVisible = ref(false)
const previewIndex = ref(0) const previewIndex = ref(0)
@@ -52,7 +55,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
<template> <template>
<section class="hero-board"> <section class="hero-board">
<el-carousel height="200px" :interval="3600"> <el-carousel :height="carouselHeight" :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"
@@ -102,6 +105,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
<style scoped> <style scoped>
.hero-board { .hero-board {
--home-hero-height: 340px;
position: relative; position: relative;
min-width: 0; min-width: 0;
width: 100%; width: 100%;
@@ -115,7 +119,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
} }
.hero-board :deep(.el-carousel__container) { .hero-board :deep(.el-carousel__container) {
height: 200px; height: var(--home-hero-height, 340px);
overflow: hidden; overflow: hidden;
} }
@@ -128,7 +132,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 24px 36px; padding: 28px 44px;
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%);
@@ -172,13 +176,14 @@ function hasSlideCopy(slide: HomeBannerSlide) {
.hero-copy { .hero-copy {
position: relative; position: relative;
z-index: 1; z-index: 1;
max-width: 480px; max-width: 560px;
} }
.hero-copy span { .hero-copy span {
color: #ff6a00; color: #ff6a00;
font-size: 12px; font-size: 13px;
font-weight: 700; font-weight: 700;
letter-spacing: 0.3px;
} }
.hero-slide.has-image .hero-copy { .hero-slide.has-image .hero-copy {
@@ -190,21 +195,22 @@ function hasSlideCopy(slide: HomeBannerSlide) {
} }
.hero-copy h1 { .hero-copy h1 {
margin: 6px 0; margin: 8px 0;
font-size: 22px; font-size: 30px;
font-weight: 800; font-weight: 800;
line-height: 1.2; line-height: 1.22;
letter-spacing: -0.4px;
} }
.hero-copy p { .hero-copy p {
display: inline-block; display: inline-block;
margin: 0; margin: 0;
padding: 3px 10px; padding: 5px 13px;
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: 12px; font-size: 13px;
font-weight: 700; font-weight: 700;
} }
@@ -257,6 +263,30 @@ function hasSlideCopy(slide: HomeBannerSlide) {
color: #cbd5e1; color: #cbd5e1;
} }
@media (max-width: 1440px) {
.hero-board {
--home-hero-height: 300px;
}
.hero-copy h1 {
font-size: 26px;
}
}
@media (max-width: 1024px) {
.hero-board {
--home-hero-height: 240px;
}
.hero-slide {
padding: 22px 28px;
}
.hero-copy h1 {
font-size: 22px;
}
}
@media (max-width: 768px) { @media (max-width: 768px) {
.banner-stat-chips { .banner-stat-chips {
display: none; display: none;
@@ -141,7 +141,9 @@ const redSkinGroup = computed(() =>
<strong>筛选条件</strong> <strong>筛选条件</strong>
<span>{{ totalListings }} 个结果</span> <span>{{ totalListings }} 个结果</span>
</div> </div>
<el-button :icon="Refresh" link @click="emit('reset')">重置全部条件</el-button> <el-button class="reset-conditions-btn" round :icon="Refresh" @click="emit('reset')">
重置全部条件
</el-button>
</div> </div>
<div class="quick-filter-grid"> <div class="quick-filter-grid">
@@ -1,6 +1,6 @@
export const coinRangeOptions = [ export const coinRangeOptions = [
{ label: '全部', min: undefined, max: undefined }, { label: '全部', min: undefined, max: undefined },
{ label: '15-50', min: 15, max: 50 }, { label: '10-50', min: 10, max: 50 },
{ label: '50-100', min: 50, max: 100 }, { label: '50-100', min: 50, max: 100 },
{ label: '100-150', min: 100, max: 150 }, { label: '100-150', min: 100, max: 150 },
{ label: '150-200', min: 150, max: 200 }, { label: '150-200', min: 150, max: 200 },
+109 -59
View File
@@ -539,47 +539,41 @@ if (!restored) {
<div class="hero-section"> <div class="hero-section">
<HomeBanner :banners="displayBanners" :stats="statCards" /> <HomeBanner :banners="displayBanners" :stats="statCards" />
</div>
<div class="biz-entry-grid" aria-label="业务入口"> <!-- 业务入口:贴在轮播右侧竖排;原「租号大厅」只是跳回首页,已移除 -->
<RouterLink class="biz-entry" to="/"> <div class="biz-entry-rail" aria-label="业务入口">
<div class="biz-title-row"> <RouterLink v-if="!siteStore.isDistribution" class="biz-entry crash" to="/crash">
<strong>租号大厅</strong> <div class="biz-title-row">
<small>安全交接 · 随租随玩</small> <strong>撞车 <em>NEW</em></strong>
</div> <small>选购商品 · 进群交接</small>
<van-icon name="arrow" :size="12" class="biz-arrow" /> </div>
</RouterLink> <van-icon name="arrow" :size="14" class="biz-arrow" />
<RouterLink v-if="!siteStore.isDistribution" class="biz-entry crash" to="/crash"> </RouterLink>
<div class="biz-title-row"> <button
<strong>撞车 <em>NEW</em></strong> v-if="awRecycle.enabled"
<small>选购商品 · 进群交接</small> type="button"
</div> class="biz-entry aw-recycle"
<van-icon name="arrow" :size="12" class="biz-arrow" /> @click="openAWRecycle"
</RouterLink> >
<button <div class="biz-title-row">
v-if="awRecycle.enabled" <strong>{{ awRecycle.title }}</strong>
type="button" <small>{{ awRecycle.subtitle }}</small>
class="biz-entry aw-recycle" </div>
@click="openAWRecycle" <van-icon name="arrow" :size="14" class="biz-arrow" />
> </button>
<div class="biz-title-row"> <button
<strong>{{ awRecycle.title }}</strong> v-if="cooperationFeedback.enabled"
<small>{{ awRecycle.subtitle }}</small> type="button"
</div> class="biz-entry cooperation-feedback"
<van-icon name="arrow" :size="12" class="biz-arrow" /> @click="openCooperationFeedback"
</button> >
<button <div class="biz-title-row">
v-if="cooperationFeedback.enabled" <strong>{{ cooperationFeedback.title }}</strong>
type="button" <small>{{ cooperationFeedback.subtitle }}</small>
class="biz-entry cooperation-feedback" </div>
@click="openCooperationFeedback" <van-icon name="arrow" :size="14" class="biz-arrow" />
> </button>
<div class="biz-title-row"> </div>
<strong>{{ cooperationFeedback.title }}</strong>
<small>{{ cooperationFeedback.subtitle }}</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</button>
</div> </div>
<el-dialog <el-dialog
@@ -695,29 +689,37 @@ if (!restored) {
} }
.hero-section { .hero-section {
display: grid;
grid-template-columns: minmax(0, 1fr) 320px;
gap: 14px;
align-items: stretch;
width: 100%; width: 100%;
min-width: 0; min-width: 0;
} }
.biz-entry-grid { .biz-entry-rail {
display: grid; display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr);
gap: 12px; gap: 14px;
min-width: 0;
} }
.biz-entry { .biz-entry {
position: relative;
display: flex; display: flex;
align-items: center; flex-direction: column;
justify-content: space-between; justify-content: center;
gap: 10px; gap: 6px;
min-height: 52px; min-height: 84px;
padding: 12px 18px; padding: 16px 46px 16px 20px;
border-radius: 12px; border-radius: 14px;
border: 1px solid #e2e8f0; border: 1px solid #e2e8f0;
background: #ffffff; background: #ffffff;
text-decoration: none; text-decoration: none;
text-align: left;
cursor: pointer; cursor: pointer;
font: inherit; font: inherit;
overflow: hidden;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
transition: transition:
border-color 0.2s ease, border-color 0.2s ease,
@@ -725,22 +727,39 @@ if (!restored) {
transform 0.2s ease; transform 0.2s ease;
} }
.biz-entry::before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 3px;
background: linear-gradient(180deg, #ff8a3d 0%, #ff6a00 100%);
opacity: 0;
transition: opacity 0.2s ease;
}
.biz-entry:hover { .biz-entry:hover {
border-color: #ffbe98; border-color: #ffbe98;
box-shadow: 0 6px 16px rgba(255, 106, 0, 0.08); box-shadow: 0 8px 20px rgba(255, 106, 0, 0.1);
transform: translateY(-2px); transform: translateY(-2px);
} }
.biz-entry:hover::before {
opacity: 1;
}
.biz-title-row { .biz-title-row {
display: flex; display: flex;
align-items: baseline; flex-direction: column;
gap: 10px; align-items: flex-start;
gap: 5px;
min-width: 0; min-width: 0;
} }
.biz-entry strong { .biz-entry strong {
color: #0f172a; color: #0f172a;
font-size: 15px; font-size: 16px;
font-weight: 700; font-weight: 700;
letter-spacing: -0.01em; letter-spacing: -0.01em;
white-space: nowrap; white-space: nowrap;
@@ -749,14 +768,17 @@ if (!restored) {
.biz-entry small { .biz-entry small {
color: #64748b; color: #64748b;
font-size: 12px; font-size: 12px;
white-space: nowrap; line-height: 1.4;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.biz-arrow { .biz-arrow {
position: absolute;
top: 50%;
right: 18px;
color: #94a3b8; color: #94a3b8;
flex-shrink: 0; transform: translateY(-50%);
transition: transition:
transform 0.2s ease, transform 0.2s ease,
color 0.2s ease; color 0.2s ease;
@@ -764,7 +786,7 @@ if (!restored) {
.biz-entry:hover .biz-arrow { .biz-entry:hover .biz-arrow {
color: #ff6a00; color: #ff6a00;
transform: translateX(2px); transform: translateY(-50%) translateX(2px);
} }
.biz-entry.crash strong em { .biz-entry.crash strong em {
@@ -797,9 +819,37 @@ if (!restored) {
background: #f8fafc; background: #f8fafc;
} }
@media (max-width: 960px) { @media (max-width: 1440px) {
.biz-entry-grid { .hero-section {
grid-template-columns: repeat(2, 1fr); grid-template-columns: minmax(0, 1fr) 280px;
gap: 12px;
}
.biz-entry-rail {
gap: 12px;
}
}
@media (max-width: 1024px) {
.hero-section {
grid-template-columns: minmax(0, 1fr);
}
.biz-entry-rail {
grid-template-columns: repeat(3, minmax(0, 1fr));
grid-auto-rows: auto;
gap: 10px;
}
.biz-entry {
min-height: 76px;
padding: 14px 40px 14px 16px;
}
}
@media (max-width: 680px) {
.biz-entry-rail {
grid-template-columns: repeat(2, minmax(0, 1fr));
} }
} }
@@ -916,10 +916,6 @@ if (!restoreHomeConfigFromCache()) {
</van-swipe> </van-swipe>
<div class="biz-entry-grid" aria-label="业务入口"> <div class="biz-entry-grid" aria-label="业务入口">
<RouterLink class="biz-entry" to="/">
<strong>租号大厅</strong>
<small>高哈夫币 · 随租随玩</small>
</RouterLink>
<RouterLink v-if="!siteStore.isDistribution" class="biz-entry" to="/crash"> <RouterLink v-if="!siteStore.isDistribution" class="biz-entry" to="/crash">
<strong>撞车</strong> <strong>撞车</strong>
<small>选购商品 · 一键找客服</small> <small>选购商品 · 一键找客服</small>
+62 -8
View File
@@ -50,11 +50,55 @@
color: #64748b; color: #64748b;
} }
/* PC 点击式快速筛选 */ /* 重置全部条件:橙色胶囊按钮,默认浅色描边,悬停填充品牌橙,按下加深,突出主题色。
注意:styles/admin.css 里的通用 .el-button 规则用超长 :not() 链把权重拉得很高,
会把这里的默认/悬浮/按下态压回灰白色,所以本组属性必须带 !important 才能保住橙色。 */
.filter-header .reset-conditions-btn {
height: 32px;
padding: 0 16px;
border: 1px solid #ffc79b !important;
border-radius: 999px;
background: linear-gradient(135deg, #fff7ed 0%, #ffeedd 100%) !important;
color: #ff6a00 !important;
font-size: 13px;
font-weight: 800;
letter-spacing: 0.2px;
box-shadow: 0 2px 6px rgba(255, 106, 0, 0.14);
transition:
background 0.2s ease,
border-color 0.2s ease,
color 0.2s ease,
box-shadow 0.2s ease,
transform 0.2s ease;
}
.filter-header .reset-conditions-btn .el-icon {
font-size: 14px;
color: currentColor;
}
.filter-header .reset-conditions-btn:hover,
.filter-header .reset-conditions-btn:focus-visible {
border-color: #ff6a00 !important;
background: linear-gradient(135deg, #ff6a00 0%, #ff8533 100%) !important;
color: #ffffff !important;
box-shadow: 0 8px 18px rgba(255, 106, 0, 0.3) !important;
transform: translateY(-1px);
}
.filter-header .reset-conditions-btn:active {
border-color: #e85f00 !important;
background: linear-gradient(135deg, #e85f00 0%, #ff7a20 100%) !important;
color: #ffffff !important;
transform: translateY(0);
box-shadow: 0 3px 8px rgba(255, 106, 0, 0.3) !important;
}
/* PC 点击式快速筛选:左列占左半边,右列左对齐到卡片中线偏右(居中的「展开高级筛选」右边一点) */
.quick-filter-grid { .quick-filter-grid {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: minmax(0, 54%) minmax(0, max-content);
gap: 12px 28px; gap: 12px 40px;
} }
.filter-field { .filter-field {
@@ -107,18 +151,28 @@
transition: transition:
background 0.15s, background 0.15s,
color 0.15s, color 0.15s,
box-shadow 0.15s; box-shadow 0.15s,
transform 0.15s;
} }
/* 悬浮/按下统一走主题橙,避免灰蓝色调与品牌色脱节(active 更实,便于区分已选) */
.pill-chip:hover { .pill-chip:hover {
background: #e8edf5; background: #fff4ea;
color: #1e293b; color: #ff6a00;
box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.28);
}
.pill-chip:active {
background: #ffe9d6;
color: #e85f00;
transform: translateY(1px);
} }
.pill-chip.active { .pill-chip.active {
background: #fff1e6; background: #ffe8d5;
color: #ff6a00; color: #ff6a00;
box-shadow: inset 0 0 0 1px #ffd0a8; font-weight: 700;
box-shadow: inset 0 0 0 1px #ff6a00;
} }
.pill-empty { .pill-empty {