Commit 08c802d7 by chenwq1

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

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