Commit 08c802d7 by chenwq1

feat: 优化车详情页面布局与样式

- 更新顶部区域结构,增强导航与进度显示
- 改进内容区样式,提升用户体验
- 调整按钮颜色以符合设计规范
- 优化整体布局,确保响应式设计
1 parent d8efadbe
Pipeline #70 for 08c802d7 failed in 0 seconds
<template>
<div class="inspect-page">
<!-- 顶部固定区 -->
<div class="inspect-header">
<!-- 导航行(含大项切换 + 进度) -->
<!-- 顶部区:大项切换 + 检测进度,跟随页面背景色 -->
<div class="inspect-top">
<!-- 第一行:返回 + 大项切换 + 进度数字 -->
<div class="inspect-nav">
<van-icon class="nav-back"
name="arrow-left"
......@@ -15,36 +15,51 @@
name="arrow-down"
size="13" />
</div>
<div class="nav-progress">
<span class="progress-text">{{ progressDone }}/{{ progressTotal }}</span>
</div>
</div>
<!-- 二级项 Tab 行 -->
<div class="subtab-row">
<div v-for="sub in activeBigModule.subTabs"
:key="sub.key"
class="subtab-item"
:class="{ active: sub.key === activeSubKey }"
@click="onSelectSubTab(sub.key)">
{{ sub.label }}
</div>
<!-- 第二行:进度条 + 进度文案 -->
<div class="inspect-progress-bar">
<van-progress class="progress-track"
color="#185efe"
:percentage="Math.round((progressDone / progressTotal) * 100)"
:show-pivot="false"
stroke-width="8"
track-color="#185efe1f" />
<span class="progress-label">
检测进度
<span class="progress-done">{{ progressDone }}</span>/{{ progressTotal }}
</span>
</div>
</div>
<!-- 中间内容区 -->
<div class="inspect-content">
<!-- 二级项内容组件占位 -->
<div class="content-placeholder">
<van-icon color="#c8c9cc"
name="photo-o"
size="48" />
<p class="placeholder-title">
{{ activeBigModule.label }} · {{ activeSubTab.label }}
</p>
<p class="placeholder-desc">
检测内容组件将在此渲染
</p>
<!-- 内容区:白色圆角卡片,二级tab固定 + 中间内容可滚动 -->
<div class="inspect-body">
<div class="inspect-card">
<!-- 二级项 Tab(固定,不随内容滚动) -->
<div class="subtab-row">
<div v-for="sub in activeBigModule.subTabs"
:key="sub.key"
class="subtab-item"
:class="{ active: sub.key === activeSubKey }"
@click="onSelectSubTab(sub.key)">
{{ sub.label }}
</div>
</div>
<!-- 中间滚动内容区 -->
<div class="inspect-content">
<!-- 二级项内容组件占位 -->
<div class="content-placeholder">
<van-icon color="#c8c9cc"
name="photo-o"
size="48" />
<p class="placeholder-title">
{{ activeBigModule.label }} · {{ activeSubTab.label }}
</p>
<p class="placeholder-desc">
检测内容组件将在此渲染
</p>
</div>
</div>
</div>
</div>
......@@ -59,7 +74,7 @@
</van-button>
<van-button block
class="btn-next"
color="#1989fa"
color="#477ffe"
round
type="primary"
@click="onNext">
......@@ -78,7 +93,7 @@
@click="onSelectBigModule(mod)">
<span class="picker-label">{{ mod.label }}</span>
<van-icon v-if="mod.key === activeBigKey"
color="#1989fa"
color="#477ffe"
name="success"
size="16" />
</div>
......@@ -240,29 +255,28 @@ function onBack() {
<style lang="scss" scoped>
@use "@assets/styles/variables" as *;
// ===== 整体布局:固定视口,不整页滚动 =====
// ===== 整体布局 =====
.inspect-page {
display: flex;
flex-direction: column;
height: 100vh;
// stylelint-disable-next-line declaration-block-no-duplicate-properties
height: calc(100vh - env(safe-area-inset-top));
height: calc(100dvh - env(safe-area-inset-top));
overflow: hidden;
background-color: $color-bg-page;
background: #f2f3f7;
}
// ===== 顶部固定区 =====
.inspect-header {
// ===== 顶部区(透明,跟随页面背景) =====
.inspect-top {
flex-shrink: 0;
background-color: $color-bg-card;
box-shadow: $shadow-sm;
padding: calc(env(safe-area-inset-top) + 12px) $spacing-base 12px;
}
.inspect-nav {
display: flex;
align-items: center;
gap: $spacing-sm;
padding: calc(env(safe-area-inset-top) + 10px) $spacing-base 10px;
margin-bottom: 10px;
.nav-back {
flex-shrink: 0;
......@@ -274,11 +288,12 @@ function onBack() {
display: flex;
flex: 1;
align-items: center;
gap: 2px;
justify-content: center;
gap: 4px;
cursor: pointer;
.nav-module-name {
font-size: $font-size-md;
font-size: 18px;
font-weight: 700;
color: $color-text-primary;
}
......@@ -288,24 +303,73 @@ function onBack() {
transition: $transition-fast;
}
}
}
.inspect-progress-bar {
display: flex;
align-items: center;
gap: 10px;
.progress-track {
flex: 1;
:deep(.van-progress__portion) {
border-radius: 176px;
}
:deep(.van-progress__pivot) {
display: none;
}
}
.nav-progress {
:deep(.van-progress) {
height: 8px;
border-radius: 176px;
}
.progress-label {
flex-shrink: 0;
font-size: 14px;
font-weight: 400;
color: #333;
white-space: nowrap;
.progress-text {
font-size: $font-size-sm;
color: $color-text-secondary;
.progress-done {
font-size: 16px;
font-weight: 700;
color: #185efe;
}
}
}
// ===== 内容区(高度跟随内容,超出最大高度才滚动) =====
.inspect-body {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
// ===== 白色圆角卡片(高度自适应内容) =====
.inspect-card {
display: flex;
flex-direction: column;
background: #fff;
border: 1px solid #fff;
border-radius: 12px;
}
// ===== 二级项 Tab(固定在卡片顶部) =====
.subtab-row {
display: flex;
flex-shrink: 0;
gap: 10px;
padding: 10px $spacing-base;
overflow-x: auto;
background-color: $color-bg-card;
border-radius: 12px 12px 0 0;
background: linear-gradient(180deg, #185efe1a 0%, #185efe00 100%);
&::-webkit-scrollbar {
display: none;
}
......@@ -333,12 +397,9 @@ function onBack() {
}
}
// ===== 中间滚动内容区 =====
// ===== 中间内容区(高度自适应,不独立滚动) =====
.inspect-content {
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: $spacing-base;
padding: 0 $spacing-base $spacing-base;
}
.content-placeholder {
......@@ -346,12 +407,9 @@ function onBack() {
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
min-height: 300px;
gap: $spacing-sm;
padding: $spacing-xl;
background-color: $color-bg-card;
border-radius: $radius-md;
.placeholder-title {
font-size: $font-size-base;
......@@ -404,7 +462,7 @@ function onBack() {
&.selected .picker-label {
font-weight: 700;
color: $color-primary;
color: #477ffe;
}
.picker-label {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!