Commit 10a368e0 by yancanhua

Merge branch 'release/venus-usedcar-h5/1.0.0' of http://192.168.3.233:8090/monor…

…epo/venus into release/venus-usedcar-h5/1.0.0
2 parents 585fe59d 1fbcb942
Pipeline #135 for 10a368e0 failed in 0 seconds
...@@ -156,6 +156,12 @@ export interface DetailRes { ...@@ -156,6 +156,12 @@ export interface DetailRes {
id?: number; id?: number;
/** 检测完成时间 */ /** 检测完成时间 */
inspectionCompletedTime?: string; inspectionCompletedTime?: string;
/** 是否有事故 0 否 1 是 */
accident?: string;
/** 是否有火烧 0 否 1 是 */
burn?: string;
/** 是否有涉水 0 否 1 是 */
wade?: string;
inspectionNodeList: InspectionNodeDetail[]; inspectionNodeList: InspectionNodeDetail[];
inspectionScoreVO?: InspectionDetailScoreVO; inspectionScoreVO?: InspectionDetailScoreVO;
licensePlate?: string; licensePlate?: string;
......
...@@ -358,27 +358,27 @@ defineExpose({ ...@@ -358,27 +358,27 @@ defineExpose({
<style lang="scss" scoped> <style lang="scss" scoped>
.formTitle { .formTitle {
width: 100%;
float: left; float: left;
background: #ffffff;
padding: 16px 12px;
display: flex; display: flex;
width: 100%;
padding: 16px 12px;
background: #fff;
} }
.radioText { .radioText {
color: #666666;
font-size: 12px;
padding-left: 4px; padding-left: 4px;
font-size: 12px;
color: #666;
} }
.customizeList { .customizeList {
width: 100%;
float: left; float: left;
width: 100%;
} }
.customizeList50 { .customizeList50 {
width: 50% !important;
float: left; float: left;
width: 50% !important;
} }
.border-bottom { .border-bottom {
...@@ -386,11 +386,11 @@ defineExpose({ ...@@ -386,11 +386,11 @@ defineExpose({
} }
.loadingBox { .loadingBox {
width: 80px;
height: 80px;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
width: 80px;
height: 80px;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import type { InspectionDetailResultVO, InspectionNodeDetail } from "@api/modules/inspect-report"; import type {
InspectionDetailResultVO,
InspectionNodeDetail,
} from "@api/modules/inspect-report";
import { computed, onMounted, onUnmounted, ref } from "vue"; import { computed, onMounted, onUnmounted, ref } from "vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
...@@ -7,25 +10,25 @@ import { useRoute } from "vue-router"; ...@@ -7,25 +10,25 @@ import { useRoute } from "vue-router";
import { detail } from "@api/modules/inspect-report"; import { detail } from "@api/modules/inspect-report";
interface InspectItem { interface InspectItem {
descriptions: string[];
images: string[];
name: string; name: string;
status: "abnormal" | "normal"; status: "abnormal" | "normal";
descriptions: string[];
images: string[];
videos: string[]; videos: string[];
} }
interface InspectCategory { interface InspectCategory {
items: InspectItem[];
name: string; name: string;
totalCount: number; totalCount: number;
items: InspectItem[];
} }
interface DisplayGroup { interface DisplayGroup {
type: "abnormal" | "normal";
label: string;
icon: string; icon: string;
iconColor: string; iconColor: string;
items: InspectItem[]; items: InspectItem[];
label: string;
type: "abnormal" | "normal";
} }
const MAX_VISIBLE = 5; const MAX_VISIBLE = 5;
...@@ -45,9 +48,11 @@ const collapseState = ref<Record<string, boolean>>({}); ...@@ -45,9 +48,11 @@ const collapseState = ref<Record<string, boolean>>({});
* image_upload → 图片,button_select → 文字描述 * image_upload → 图片,button_select → 文字描述
* - 其他类型 → 文字描述 * - 其他类型 → 文字描述
*/ */
function extractLeafData( function extractLeafData(leaf: InspectionNodeDetail): {
leaf: InspectionNodeDetail, descriptions: string[];
): { descriptions: string[]; images: string[]; videos: string[] } { images: string[];
videos: string[];
} {
const vo: InspectionDetailResultVO | null = leaf.inspectionResultVO; const vo: InspectionDetailResultVO | null = leaf.inspectionResultVO;
const descriptions: string[] = []; const descriptions: string[] = [];
const images: string[] = []; const images: string[] = [];
...@@ -115,8 +120,9 @@ function buildCategories(nodes: InspectionNodeDetail[]): InspectCategory[] { ...@@ -115,8 +120,9 @@ function buildCategories(nodes: InspectionNodeDetail[]): InspectCategory[] {
.sort((a, b) => a.sortOrder - b.sortOrder); .sort((a, b) => a.sortOrder - b.sortOrder);
return modules.map((mod) => { return modules.map((mod) => {
const children = (mod.childrenNodes ?? []) const children = (mod.childrenNodes ?? []).sort(
.sort((a, b) => a.sortOrder - b.sortOrder); (a, b) => a.sortOrder - b.sortOrder
);
const items: InspectItem[] = []; const items: InspectItem[] = [];
for (const child of children) { for (const child of children) {
...@@ -125,8 +131,9 @@ function buildCategories(nodes: InspectionNodeDetail[]): InspectCategory[] { ...@@ -125,8 +131,9 @@ function buildCategories(nodes: InspectionNodeDetail[]): InspectCategory[] {
items.push(leafToItem(child)); items.push(leafToItem(child));
} else { } else {
// 情况①:nodeType=2 中间分组,展开其 nodeType=3 子节点 // 情况①:nodeType=2 中间分组,展开其 nodeType=3 子节点
const leafNodes = (child.childrenNodes ?? []) const leafNodes = (child.childrenNodes ?? []).sort(
.sort((a, b) => a.sortOrder - b.sortOrder); (a, b) => a.sortOrder - b.sortOrder
);
for (const leaf of leafNodes) { for (const leaf of leafNodes) {
items.push(leafToItem(leaf)); items.push(leafToItem(leaf));
} }
...@@ -135,7 +142,8 @@ function buildCategories(nodes: InspectionNodeDetail[]): InspectCategory[] { ...@@ -135,7 +142,8 @@ function buildCategories(nodes: InspectionNodeDetail[]): InspectCategory[] {
return { return {
name: mod.nodeName, name: mod.nodeName,
totalCount: (mod.failNum ?? 0) + (mod.successNum ?? 0) + (mod.noStructureNum ?? 0), totalCount:
(mod.failNum ?? 0) + (mod.successNum ?? 0) + (mod.noStructureNum ?? 0),
items, items,
}; };
}); });
...@@ -195,7 +203,8 @@ function onPreview(images: string[], index: number) { ...@@ -195,7 +203,8 @@ function onPreview(images: string[], index: number) {
previewVisible.value = true; previewVisible.value = true;
} }
const CDN_BASE = "https://img02.glsx.com.cn/weapp/resource/venus/web/venus-usedcar-quality"; const CDN_BASE =
"https://img02.glsx.com.cn/weapp/resource/venus/web/venus-usedcar-quality";
const CDN = { const CDN = {
fail: `${CDN_BASE}/fail.png`, fail: `${CDN_BASE}/fail.png`,
success: `${CDN_BASE}/success.png`, success: `${CDN_BASE}/success.png`,
...@@ -318,8 +327,7 @@ onUnmounted(() => { ...@@ -318,8 +327,7 @@ onUnmounted(() => {
<div v-for="group in cat.groups" <div v-for="group in cat.groups"
:key="group.type" :key="group.type"
class="group-card"> class="group-card">
<div class="group-header" <div class="group-header" @click="toggleCollapse(catIdx, group.type)">
@click="toggleCollapse(catIdx, group.type)">
<div class="group-header__left"> <div class="group-header__left">
<img alt="" <img alt=""
class="group-type-icon" class="group-type-icon"
...@@ -329,9 +337,15 @@ onUnmounted(() => { ...@@ -329,9 +337,15 @@ onUnmounted(() => {
</span> </span>
</div> </div>
<div class="group-header__right"> <div class="group-header__right">
<span>{{ isExpanded(catIdx, group.type) ? '收起' : '展开' }}</span> <span>
{{
isExpanded(catIdx, group.type) ? "收起" : "展开"
}}
</span>
<van-icon color="#969799" <van-icon color="#969799"
:name="isExpanded(catIdx, group.type) ? 'arrow-up' : 'arrow-down'" :name="
isExpanded(catIdx, group.type) ? 'arrow-up' : 'arrow-down'
"
size="10" /> size="10" />
</div> </div>
</div> </div>
...@@ -344,7 +358,7 @@ onUnmounted(() => { ...@@ -344,7 +358,7 @@ onUnmounted(() => {
{{ item.name }} {{ item.name }}
</div> </div>
<div v-if="item.descriptions.length > 0" class="item-desc"> <div v-if="item.descriptions.length > 0" class="item-desc">
{{ item.descriptions.join('、') }} {{ item.descriptions.join("、") }}
</div> </div>
<div v-if="item.images.length > 0" class="image-row"> <div v-if="item.images.length > 0" class="image-row">
<!-- 超过5张只渲染前5张,第5张叠加 +N 遮罩,N=隐藏数量 --> <!-- 超过5张只渲染前5张,第5张叠加 +N 遮罩,N=隐藏数量 -->
...@@ -357,7 +371,10 @@ onUnmounted(() => { ...@@ -357,7 +371,10 @@ onUnmounted(() => {
radius="4" radius="4"
:src="img" :src="img"
width="56" /> width="56" />
<div v-if="item.images.length > MAX_VISIBLE && imgIdx === MAX_VISIBLE - 1" <div v-if="
item.images.length > MAX_VISIBLE &&
imgIdx === MAX_VISIBLE - 1
"
class="image-more-mask" class="image-more-mask"
@click.stop="onPreview(item.images, MAX_VISIBLE)"> @click.stop="onPreview(item.images, MAX_VISIBLE)">
+{{ item.images.length - MAX_VISIBLE }} +{{ item.images.length - MAX_VISIBLE }}
...@@ -465,7 +482,8 @@ onUnmounted(() => { ...@@ -465,7 +482,8 @@ onUnmounted(() => {
} }
.category-name { .category-name {
font-weight: 700; font-size: 18px;
font-weight: 600;
} }
.category-count { .category-count {
...@@ -519,8 +537,24 @@ onUnmounted(() => { ...@@ -519,8 +537,24 @@ onUnmounted(() => {
} }
.inspect-item { .inspect-item {
box-sizing: border-box;
padding: $spacing-md $spacing-base; padding: $spacing-md $spacing-base;
margin: 0 12px ;
background: #f8f9fb;
border-top: 1px solid #f2f3f5; border-top: 1px solid #f2f3f5;
border-radius: 0;
&:first-child:not(:last-child) {
border-radius: 8px 8px 0 0;
}
&:last-child:not(:first-child) {
border-radius: 0 0 8px 8px;
}
&:first-child:last-child {
border-radius: 8px;
}
} }
.item-name { .item-name {
...@@ -536,7 +570,7 @@ onUnmounted(() => { ...@@ -536,7 +570,7 @@ onUnmounted(() => {
font-size: 13px; font-size: 13px;
line-height: 1.6; line-height: 1.6;
// font-size: $font-size-sm; // font-size: $font-size-sm;
color:#999; color: #999;
} }
.image-row { .image-row {
......
...@@ -34,6 +34,7 @@ const reportData = ref({ ...@@ -34,6 +34,7 @@ const reportData = ref({
carName: "", carName: "",
licensePlate: "", licensePlate: "",
vin: "", vin: "",
emissionStandard: "",
coverUrl: "", coverUrl: "",
tags: [] as { text: string; type: string }[], tags: [] as { text: string; type: string }[],
registrationDate: "", registrationDate: "",
...@@ -44,9 +45,12 @@ const reportData = ref({ ...@@ -44,9 +45,12 @@ const reportData = ref({
appearanceScore: 0, appearanceScore: 0,
skeletonLevel: "", skeletonLevel: "",
interiorLevel: "", interiorLevel: "",
hasAccident: false, /** 是否有事故 0 否 1 是 */
hasFire: false, accident: "0",
hasFlood: false, /** 是否有火烧 0 否 1 是 */
burn: "0",
/** 是否有涉水 0 否 1 是 */
wade: "0",
scoreDescriptions: [] as { label: string; text: string }[], scoreDescriptions: [] as { label: string; text: string }[],
totalInspectItems: 0, totalInspectItems: 0,
inspectDetails: [] as { inspectDetails: [] as {
...@@ -62,6 +66,31 @@ const reportData = ref({ ...@@ -62,6 +66,31 @@ const reportData = ref({
albums: [] as FileInfo[], albums: [] as FileInfo[],
}); });
function isInspectionRiskYes(value: null | number | string | undefined): boolean {
if (value === null || value === undefined) {
return false;
}
return String(value) === "1";
}
const riskIndicatorItems = computed(() => {
const d = reportData.value;
const item = (field: "accident" | "burn" | "wade", yesLabel: string, noLabel: string) => {
const active = isInspectionRiskYes(d[field]);
return {
key: field,
active,
label: active ? yesLabel : noLabel,
icon: active ? CDN.fail : CDN.success,
};
};
return [
item("accident", "事故", "无事故"),
item("burn", "火烧", "无火烧"),
item("wade", "涉水", "无涉水"),
];
});
// ===== 接口请求 ===== // ===== 接口请求 =====
const loading = ref(false); const loading = ref(false);
...@@ -91,7 +120,11 @@ async function fetchDetail() { ...@@ -91,7 +120,11 @@ async function fetchDetail() {
reportData.value.registrationDate = res.registrationDate ?? ""; reportData.value.registrationDate = res.registrationDate ?? "";
reportData.value.mileage = res.mileage ?? ""; reportData.value.mileage = res.mileage ?? "";
reportData.value.displacement = res.displacement ?? ""; reportData.value.displacement = res.displacement ?? "";
reportData.value.emissionStandard = res.emissionStandard ?? "";
reportData.value.inspectDate = res.inspectionCompletedTime ?? ""; reportData.value.inspectDate = res.inspectionCompletedTime ?? "";
reportData.value.accident = res.accident ?? "0";
reportData.value.burn = res.burn ?? "0";
reportData.value.wade = res.wade ?? "0";
// 车况评分 // 车况评分
const score = res.inspectionScoreVO; const score = res.inspectionScoreVO;
...@@ -375,8 +408,13 @@ onMounted(() => { ...@@ -375,8 +408,13 @@ onMounted(() => {
</div> </div>
<div class="vehicle-plate"> <div class="vehicle-plate">
<span>{{ reportData.licensePlate }}</span> <span>{{ reportData.licensePlate }}</span>
<!-- <div class="vehicle-plate__extra"> -->
<span class="vehicle-vin">{{ reportData.vin }}</span> <span class="vehicle-vin">{{ reportData.vin }}</span>
<span v-if="reportData.emissionStandard"
class="vehicle-emission">
{{ reportData.emissionStandard }}
</span>
<!-- </div> -->
</div> </div>
<div class="vehicle-tags"> <div class="vehicle-tags">
<img alt="认证标签" <img alt="认证标签"
...@@ -404,29 +442,20 @@ onMounted(() => { ...@@ -404,29 +442,20 @@ onMounted(() => {
</div> </div>
<!-- 车况评分 --> <!-- 车况评分 -->
<div class="section-card"> <div class="section-card section-card--score">
<div class="section-header"> <div class="section-header">
<div class="section-title-bar"> <div class="section-title-bar">
<span class="section-title">车况评分</span> <span class="section-title">车况评分</span>
</div> </div>
<div class="risk-indicators"> <div class="risk-indicators">
<span class="risk-item" :class="{ active: reportData.hasAccident }"> <span v-for="row in riskIndicatorItems"
:key="row.key"
class="risk-item"
:class="{ active: row.active }">
<img alt="" <img alt=""
class="risk-icon" class="risk-icon"
:src="CDN.fail" /> :src="row.icon" />
事故 {{ row.label }}
</span>
<span class="risk-item" :class="{ active: reportData.hasFire }">
<img alt=""
class="risk-icon"
:src="CDN.fail" />
火烧
</span>
<span class="risk-item" :class="{ active: reportData.hasFlood }">
<img alt=""
class="risk-icon"
:src="CDN.fail" />
水泡
</span> </span>
</div> </div>
</div> </div>
...@@ -518,7 +547,7 @@ onMounted(() => { ...@@ -518,7 +547,7 @@ onMounted(() => {
<!-- 检测详情 --> <!-- 检测详情 -->
<div class="section-card"> <div class="section-card">
<div class="section-header"> <div class="section-header section-header--inspect-detail">
<div class="section-title-bar"> <div class="section-title-bar">
<span class="section-title">检测详情</span> <span class="section-title">检测详情</span>
</div> </div>
...@@ -681,9 +710,9 @@ onMounted(() => { ...@@ -681,9 +710,9 @@ onMounted(() => {
font-weight: 500; font-weight: 500;
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
background: $color-primary; background: #2c66f7;
border: none; border: none;
border-radius: $radius-base; border-radius: 40px;
} }
// ===== 顶部认证头 ===== // ===== 顶部认证头 =====
...@@ -778,8 +807,8 @@ onMounted(() => { ...@@ -778,8 +807,8 @@ onMounted(() => {
&__badge { &__badge {
position: absolute; position: absolute;
right: 9px; right: 12px;
bottom: 8px; bottom: 12px;
z-index: 1; z-index: 1;
padding: 2px 7px; padding: 2px 7px;
font-size: 10px; font-size: 10px;
...@@ -822,15 +851,27 @@ onMounted(() => { ...@@ -822,15 +851,27 @@ onMounted(() => {
.vehicle-plate { .vehicle-plate {
display: flex; display: flex;
gap: $spacing-sm; gap: $spacing-sm;
align-items: center; align-items: flex-start;
font-size: $font-size-sm; font-size: $font-size-sm;
color: $color-text-secondary; color: $color-text-secondary;
} }
.vehicle-plate__extra {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
}
.vehicle-vin { .vehicle-vin {
color: $color-text-disabled; color: $color-text-disabled;
} }
.vehicle-emission {
font-size: $font-size-sm;
color: $color-text-secondary;
}
.vehicle-tags { .vehicle-tags {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -884,11 +925,15 @@ onMounted(() => { ...@@ -884,11 +925,15 @@ onMounted(() => {
// ===== 通用 section 卡片 ===== // ===== 通用 section 卡片 =====
.section-card { .section-card {
padding: $spacing-base; padding: $spacing-base;
margin: $spacing-md $spacing-base 0; margin: 12px #{$spacing-base} 0;
background: #fff; background: #fff;
border-radius: $radius-md; border-radius: $radius-md;
} }
.section-card.section-card--score {
margin-top: 4px;
}
.section-header { .section-header {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -896,6 +941,9 @@ onMounted(() => { ...@@ -896,6 +941,9 @@ onMounted(() => {
padding: $spacing-base; padding: $spacing-base;
margin: -#{$spacing-base} -#{$spacing-base} $spacing-base; margin: -#{$spacing-base} -#{$spacing-base} $spacing-base;
margin-bottom: 0; margin-bottom: 0;
}
.section-header--inspect-detail {
background: linear-gradient(180deg, #185efe1a 0%, #185efe00 100%); background: linear-gradient(180deg, #185efe1a 0%, #185efe00 100%);
border-radius: $radius-md $radius-md 0 0; border-radius: $radius-md $radius-md 0 0;
} }
...@@ -1240,6 +1288,15 @@ onMounted(() => { ...@@ -1240,6 +1288,15 @@ onMounted(() => {
overflow: hidden; overflow: hidden;
border-radius: $radius-base; border-radius: $radius-base;
// 指示器置于轮播区域正中(默认在底部)
:deep(.van-swipe__indicators) {
top: 80%;
bottom: auto;
left: 50%;
pointer-events: none;
transform: translate(-50%, -50%);
}
:deep(.van-swipe__indicator) { :deep(.van-swipe__indicator) {
opacity: 0.65; opacity: 0.65;
} }
...@@ -1272,7 +1329,7 @@ onMounted(() => { ...@@ -1272,7 +1329,7 @@ onMounted(() => {
.video-slide-label { .video-slide-label {
position: absolute; position: absolute;
bottom: 25px; bottom: 30px;
left: 10px; left: 10px;
z-index: 1; z-index: 1;
max-width: calc(100% - 20px); max-width: calc(100% - 20px);
...@@ -1289,6 +1346,7 @@ onMounted(() => { ...@@ -1289,6 +1346,7 @@ onMounted(() => {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
z-index: 3;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!