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>()
// 轮播高度由 CSS 变量统一控制,方便大屏/窄屏按比例收敛。
const carouselHeight = 'var(--home-hero-height, 340px)'
const previewVisible = ref(false)
const previewIndex = ref(0)
@@ -52,7 +55,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
<template>
<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">
<div
class="hero-slide"
@@ -102,6 +105,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
<style scoped>
.hero-board {
--home-hero-height: 340px;
position: relative;
min-width: 0;
width: 100%;
@@ -115,7 +119,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
}
.hero-board :deep(.el-carousel__container) {
height: 200px;
height: var(--home-hero-height, 340px);
overflow: hidden;
}
@@ -128,7 +132,7 @@ function hasSlideCopy(slide: HomeBannerSlide) {
height: 100%;
display: flex;
align-items: center;
padding: 24px 36px;
padding: 28px 44px;
overflow: hidden;
color: #17233d;
background: linear-gradient(135deg, #eff6ff 0%, #ffffff 58%, #fff7ed 100%);
@@ -172,13 +176,14 @@ function hasSlideCopy(slide: HomeBannerSlide) {
.hero-copy {
position: relative;
z-index: 1;
max-width: 480px;
max-width: 560px;
}
.hero-copy span {
color: #ff6a00;
font-size: 12px;
font-size: 13px;
font-weight: 700;
letter-spacing: 0.3px;
}
.hero-slide.has-image .hero-copy {
@@ -190,21 +195,22 @@ function hasSlideCopy(slide: HomeBannerSlide) {
}
.hero-copy h1 {
margin: 6px 0;
font-size: 22px;
margin: 8px 0;
font-size: 30px;
font-weight: 800;
line-height: 1.2;
line-height: 1.22;
letter-spacing: -0.4px;
}
.hero-copy p {
display: inline-block;
margin: 0;
padding: 3px 10px;
padding: 5px 13px;
border-radius: 999px;
color: #1e293b;
background: rgba(255, 255, 255, 0.72);
backdrop-filter: blur(4px);
font-size: 12px;
font-size: 13px;
font-weight: 700;
}
@@ -257,6 +263,30 @@ function hasSlideCopy(slide: HomeBannerSlide) {
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) {
.banner-stat-chips {
display: none;
@@ -141,7 +141,9 @@ const redSkinGroup = computed(() =>
<strong>筛选条件</strong>
<span>{{ totalListings }} 个结果</span>
</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 class="quick-filter-grid">
@@ -1,6 +1,6 @@
export const coinRangeOptions = [
{ 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: '100-150', min: 100, max: 150 },
{ label: '150-200', min: 150, max: 200 },
+109 -59
View File
@@ -539,47 +539,41 @@ if (!restored) {
<div class="hero-section">
<HomeBanner :banners="displayBanners" :stats="statCards" />
</div>
<div class="biz-entry-grid" aria-label="业务入口">
<RouterLink class="biz-entry" to="/">
<div class="biz-title-row">
<strong>租号大厅</strong>
<small>安全交接 · 随租随玩</small>
</div>
<van-icon name="arrow" :size="12" class="biz-arrow" />
</RouterLink>
<RouterLink v-if="!siteStore.isDistribution" class="biz-entry crash" to="/crash">
<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"
type="button"
class="biz-entry aw-recycle"
@click="openAWRecycle"
>
<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"
type="button"
class="biz-entry cooperation-feedback"
@click="openCooperationFeedback"
>
<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 class="biz-entry-rail" aria-label="业务入口">
<RouterLink v-if="!siteStore.isDistribution" class="biz-entry crash" to="/crash">
<div class="biz-title-row">
<strong>撞车 <em>NEW</em></strong>
<small>选购商品 · 进群交接</small>
</div>
<van-icon name="arrow" :size="14" class="biz-arrow" />
</RouterLink>
<button
v-if="awRecycle.enabled"
type="button"
class="biz-entry aw-recycle"
@click="openAWRecycle"
>
<div class="biz-title-row">
<strong>{{ awRecycle.title }}</strong>
<small>{{ awRecycle.subtitle }}</small>
</div>
<van-icon name="arrow" :size="14" class="biz-arrow" />
</button>
<button
v-if="cooperationFeedback.enabled"
type="button"
class="biz-entry cooperation-feedback"
@click="openCooperationFeedback"
>
<div class="biz-title-row">
<strong>{{ cooperationFeedback.title }}</strong>
<small>{{ cooperationFeedback.subtitle }}</small>
</div>
<van-icon name="arrow" :size="14" class="biz-arrow" />
</button>
</div>
</div>
<el-dialog
@@ -695,29 +689,37 @@ if (!restored) {
}
.hero-section {
display: grid;
grid-template-columns: minmax(0, 1fr) 320px;
gap: 14px;
align-items: stretch;
width: 100%;
min-width: 0;
}
.biz-entry-grid {
.biz-entry-rail {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 12px;
grid-auto-rows: minmax(0, 1fr);
gap: 14px;
min-width: 0;
}
.biz-entry {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
min-height: 52px;
padding: 12px 18px;
border-radius: 12px;
flex-direction: column;
justify-content: center;
gap: 6px;
min-height: 84px;
padding: 16px 46px 16px 20px;
border-radius: 14px;
border: 1px solid #e2e8f0;
background: #ffffff;
text-decoration: none;
text-align: left;
cursor: pointer;
font: inherit;
overflow: hidden;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
transition:
border-color 0.2s ease,
@@ -725,22 +727,39 @@ if (!restored) {
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 {
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);
}
.biz-entry:hover::before {
opacity: 1;
}
.biz-title-row {
display: flex;
align-items: baseline;
gap: 10px;
flex-direction: column;
align-items: flex-start;
gap: 5px;
min-width: 0;
}
.biz-entry strong {
color: #0f172a;
font-size: 15px;
font-size: 16px;
font-weight: 700;
letter-spacing: -0.01em;
white-space: nowrap;
@@ -749,14 +768,17 @@ if (!restored) {
.biz-entry small {
color: #64748b;
font-size: 12px;
white-space: nowrap;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
}
.biz-arrow {
position: absolute;
top: 50%;
right: 18px;
color: #94a3b8;
flex-shrink: 0;
transform: translateY(-50%);
transition:
transform 0.2s ease,
color 0.2s ease;
@@ -764,7 +786,7 @@ if (!restored) {
.biz-entry:hover .biz-arrow {
color: #ff6a00;
transform: translateX(2px);
transform: translateY(-50%) translateX(2px);
}
.biz-entry.crash strong em {
@@ -797,9 +819,37 @@ if (!restored) {
background: #f8fafc;
}
@media (max-width: 960px) {
.biz-entry-grid {
grid-template-columns: repeat(2, 1fr);
@media (max-width: 1440px) {
.hero-section {
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>
<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">
<strong>撞车</strong>
<small>选购商品 · 一键找客服</small>
+62 -8
View File
@@ -50,11 +50,55 @@
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 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px 28px;
grid-template-columns: minmax(0, 54%) minmax(0, max-content);
gap: 12px 40px;
}
.filter-field {
@@ -107,18 +151,28 @@
transition:
background 0.15s,
color 0.15s,
box-shadow 0.15s;
box-shadow 0.15s,
transform 0.15s;
}
/* 悬浮/按下统一走主题橙,避免灰蓝色调与品牌色脱节(active 更实,便于区分已选) */
.pill-chip:hover {
background: #e8edf5;
color: #1e293b;
background: #fff4ea;
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 {
background: #fff1e6;
background: #ffe8d5;
color: #ff6a00;
box-shadow: inset 0 0 0 1px #ffd0a8;
font-weight: 700;
box-shadow: inset 0 0 0 1px #ff6a00;
}
.pill-empty {