Commit da338d4e by 张立顺

Merge branch 'release/venus-usedcar-h5/1.0.0' of 192.168.3.233:monorepo/venus in…

…to release/venus-usedcar-h5/1.0.0
2 parents 017d643b ab4299b2
Pipeline #181 for da338d4e failed in 0 seconds
VITE_APP_TITLE=二手车
VITE_APP_TITLE=
VITE_APP_ENV=development
VITE_API_BASE_URL=http://localhost:3000
VITE_APP_TITLE=二手车(开发)
VITE_APP_TITLE=
VITE_APP_ENV=development
VITE_API_BASE_URL=http://dev-api.example.com
VITE_APP_TITLE=二手车
###
# @Author: cen
# @Date: 2026-03-16 15:09:35
# @Description:
# @FilePath: /venus-usedcar-h5/apps/web/venus-usedcar-quality/.env.production
# @LastEditTime: 2026-04-03 14:17:08
# @LastEditors: cenchengwei@foreverht.com
# 可以输入预定的版权声明、个性签名、空行等
###
VITE_APP_TITLE=
VITE_APP_ENV=production
VITE_API_BASE_URL=https://api.example.com
<!--
* @Author: cen
* @Date: 2026-03-23 19:52:07
* @Description:
* @FilePath: /venus-usedcar-h5/apps/web/venus-usedcar-quality/index.html
* @LastEditTime: 2026-04-03 14:16:09
* @LastEditors: cenchengwei@foreverht.com
* 可以输入预定的版权声明、个性签名、空行等
-->
<!doctype html>
<html lang="zh-CN">
<head>
......@@ -11,7 +20,6 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>二手车</title>
<!-- 微信 JSSDK:小程序 webview 通信必需 -->
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- UniApp WebView Bridge:uniapp 容器通信必需 -->
......
<!--
* @Author: cen
* @Date: 2026-03-18 18:09:39
* @Description:
* @Description:
* @FilePath: /venus-usedcar-h5/apps/web/venus-usedcar-quality/src/components/PageTop.vue
* @LastEditTime: 2026-03-26 15:33:11
* @LastEditTime: 2026-04-03 14:13:59
* @LastEditors: cenchengwei@foreverht.com
* 可以输入预定的版权声明、个性签名、空行等
-->
<script setup lang="ts">
import { computed } from "vue";
import { useRoute } from "vue-router";
import PageTitle from "@/components/PageTitle.vue";
defineProps<{
title: string;
}>();
const route = useRoute();
/** 宿主小程序带 openType=miniApp 跳转时隐藏各 Tab 页顶部标题 */
const hideTitle = computed(() => {
const v = route.query.openType;
return (Array.isArray(v) ? v[0] : v) === "miniApp";
});
</script>
<template>
<div class="page-top">
<PageTitle v-if="!hideTitle" :title="title" />
<slot />
</div>
</template>
<style lang="scss" scoped>
.page-top {
width: 100%;
// background: url("@assets/image/top_bg.png") no-repeat top center;
// background-size: 100% auto;
}
</style>
......@@ -3,7 +3,7 @@
* @Date: 2026-03-26 10:52:58
* @Description:
* @FilePath: /venus-usedcar-h5/apps/web/venus-usedcar-quality/src/components/WorkOrderStatusTags.vue
* @LastEditTime: 2026-03-27 16:04:23
* @LastEditTime: 2026-04-02 16:20:57
* @LastEditors: cenchengwei@foreverht.com
* 可以输入预定的版权声明、个性签名、空行等
-->
......@@ -46,10 +46,10 @@ const auditTag = computed(() => {
return { text: "待审核", bg: "#f0eefd", color: "#6A56F0", icon: "clock" as const };
}
if (props.auditStatus === 3) {
return { text: "审核通过", bg: "#e9f9f1", color: "#27CD5A", icon: "checked" as const };
return { text: "已通过", bg: "#e9f9f1", color: "#27CD5A", icon: "checked" as const };
}
if (props.auditStatus === 4) {
return { text: "审核失败", bg: "#fdeded", color: "#EE3140", icon: "warning" as const };
return { text: "已驳回", bg: "#fdeded", color: "#EE3140", icon: "warning" as const };
}
return null;
});
......
......@@ -65,7 +65,7 @@ function onTabChange(index: number | string) {
const i = tabbarIndex(index);
const tab = tabList[i];
if (tab) {
// 保留 query(如 openType=miniApp),避免 Tab 切换后 PageTop 等依赖 query 的状态丢失
// 保留 query(如 openType=miniApp),避免 Tab 切换后依赖 query 的状态丢失
router.push({ name: tab.routeName, query: { ...route.query } });
}
}
......@@ -74,18 +74,21 @@ function onTabChange(index: number | string) {
<template>
<div class="layout-default">
<RouterView v-slot="{ Component, route: currentRoute }">
<Transition mode="out-in" name="fade">
<KeepAlive>
<!-- 单 flex 子项,避免双 Transition 根节点参与 flex 时首帧把页头挤到底部 -->
<div class="layout-main">
<Transition mode="out-in" name="fade">
<KeepAlive>
<component :is="Component"
v-if="currentRoute.meta.keepAlive"
:key="currentRoute.fullPath" />
</KeepAlive>
</Transition>
<Transition mode="out-in" name="fade">
<component :is="Component"
v-if="currentRoute.meta.keepAlive"
v-if="!currentRoute.meta.keepAlive"
:key="currentRoute.fullPath" />
</KeepAlive>
</Transition>
<Transition mode="out-in" name="fade">
<component :is="Component"
v-if="!currentRoute.meta.keepAlive"
:key="currentRoute.fullPath" />
</Transition>
</Transition>
</div>
</RouterView>
<van-tabbar v-if="showTabBar"
......@@ -117,6 +120,14 @@ function onTabChange(index: number | string) {
overflow-x: hidden;
background-color: var(--color-bg-page);
.layout-main {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
min-height: 0;
}
// 让 RouterView 内容区占满剩余空间,tabbar 自然沉底
:deep(.van-tabbar) {
position: sticky;
......
/*
* @Author: cen
* @Date: 2026-04-02 15:37:28
* @Description:
* @FilePath: /venus-usedcar-h5/apps/web/venus-usedcar-quality/src/router/index.ts
* @LastEditTime: 2026-04-03 14:18:49
* @LastEditors: cenchengwei@foreverht.com
* 可以输入预定的版权声明、个性签名、空行等
*/
import { createRouter, createWebHistory } from "vue-router";
import { fetchConfig } from "@/config/center";
......@@ -55,7 +64,7 @@ router.beforeEach(async (to, from, next) => {
}
if (to.meta.title) {
document.title = `${to.meta.title} - ${import.meta.env.VITE_APP_TITLE}`;
document.title = `${to.meta.title}`;
}
// 1. 有 token 的情况
......
......@@ -54,7 +54,7 @@ const routes: RouteRecordRaw[] = [
component: () => import("@views/mine/index.vue"),
meta: {
title: "我的",
keepAlive: false,
keepAlive: true,
showTabBar: true,
},
},
......
/*
* @Author: cen
* @Date: 2026-03-27 17:17:10
* @Description:
* @FilePath: /venus-usedcar-h5/apps/web/venus-usedcar-quality/src/types/views/car-list.ts
* @LastEditTime: 2026-04-02 16:25:09
* @LastEditors: cenchengwei@foreverht.com
* 可以输入预定的版权声明、个性签名、空行等
*/
export interface ReportItem {
address: string;
inspectionAddress: string;
carTitle: string;
coverImage: string;
/** 列表接口返回的报告 H5 链接 */
......
......@@ -5,6 +5,7 @@
round
:show="show"
teleport="#vant-portal-host"
@opened="resetScroll"
@update:show="emit('update:show', $event)">
<div class="rating-guide">
<div class="rating-guide__header">
......@@ -13,7 +14,8 @@
name="cross"
@click="emit('update:show', false)" />
</div>
<div class="rating-guide__scroll">
<div ref="scrollRef"
class="rating-guide__scroll">
<div v-for="level in config.levels"
:key="level.grade"
class="rating-card">
......@@ -48,9 +50,11 @@
<script setup lang="ts">
import type { RatingGuideConfig, RatingGuideGrade } from "./rating-guide-content";
import { nextTick, ref, watch } from "vue";
import { RATING_GUIDE_GRADE_COLORS } from "./rating-guide-content";
defineProps<{
const props = defineProps<{
config: RatingGuideConfig;
show: boolean;
}>();
......@@ -59,6 +63,23 @@ const emit = defineEmits<{
"update:show": [value: boolean];
}>();
const scrollRef = ref<HTMLElement | null>(null);
function resetScroll() {
nextTick(() => {
const el = scrollRef.value;
if (el) el.scrollTop = 0;
});
}
/** 同一弹窗切换骨架 / 内饰指引时,避免沿用上一份内容的滚动位置 */
watch(
() => ({ open: props.show, title: props.config.title }),
({ open }) => {
if (open) resetScroll();
},
);
function gradeColor(grade: RatingGuideGrade): string {
return RATING_GUIDE_GRADE_COLORS[grade];
}
......
......@@ -69,7 +69,7 @@ function mapReportItem(item: Record<string, unknown>): ReportItem {
.join(" "),
plateNo: String(baseInfo.licensePlate ?? "-"),
vin: String(baseInfo.vin ?? "-"),
address: String(addressCandidate || "-"),
inspectionAddress: String(item.inspectionAddress || "-"),
updateTime: String(item.updateTime ?? ""),
coverImage:
(cover.thumbUrl as string | undefined) ||
......@@ -129,16 +129,14 @@ watch([keyword], () => {
});
onActivated(() => {
// keepAlive: true 情况下需要在每次激活时重新拉取,避免容器复用导致数据过期
// keepAlive: true 下首次进入与从子页返回都会触发;勿再在 setup 末尾调用 onRefresh,否则会并发两次 fillMore、第一页重复追加
void onRefresh();
});
void onRefresh();
</script>
<template>
<div class="report-page">
<PageTop title="检测报告">
<PageTop>
<div class="search-wrap">
<van-search v-model="keyword"
placeholder="搜索报告号、车牌号、车型名称"
......@@ -188,7 +186,7 @@ void onRefresh();
</div>
<div class="meta ellipsis">
<span class="k">所在地</span>
<span class="v">{{ item.address }}</span>
<span class="v">{{ item.inspectionAddress }}</span>
</div>
</div>
</div>
......
......@@ -269,7 +269,7 @@ void onRefresh();
<template>
<div class="work-order-page">
<PageTop title="检测工单">
<PageTop>
<!-- 顶部状态 Tab -->
<div class="status-tabs">
<div v-for="t in statusTabs"
......@@ -439,6 +439,7 @@ void onRefresh();
}
.search-wrap {
width: 100%;
padding: 0 12px;
:deep(.van-search) {
......
......@@ -93,7 +93,7 @@ watch(
<template>
<div class="mine-page">
<PageTop title="我的">
<PageTop>
<div class="mine-header !pb-[24px]">
<div class="user-row">
<van-image class="avatar"
......@@ -174,6 +174,7 @@ watch(
display: flex;
flex: 1;
flex-direction: column;
min-height: 0;
overflow: auto;
overscroll-behavior: contain;
-webkit-overflow-scrolling: touch;
......
......@@ -119,12 +119,12 @@ onMounted(() => {
:class="{ 'wo-detail-main--with-foot': status !== 3 }">
<div class="page-head">
<div class="head-left">
工单号 <span class="head-order">{{ orderNo }}</span>
</div>
<div class="head-right">
<van-tag class="head-tag" :style="{ background: pageStatusTag.bg, color: pageStatusTag.color }">
{{ pageStatusTag.text }}
</van-tag>
工单号 <span class="head-order">{{ orderNo }}</span>
</div>
<div class="head-right">
<WorkOrderStatusTags :audit-status="auditStatus"
only-audit
:status="status" />
......@@ -208,7 +208,7 @@ onMounted(() => {
检测完成时间
</div>
<div class="tl-value">
{{ fmtTime(detail?.inspectionCompletedTime) }}
{{ status == 3 ? fmtTime(detail?.inspectionCompletedTime) : '-' }}
</div>
</div>
<div class="tl-line"></div>
......@@ -222,7 +222,7 @@ onMounted(() => {
检测更新时间
</div>
<div class="tl-value">
{{ fmtTime(detail?.updateTime) }}
{{ status == 2 || status == 3 ? fmtTime(detail?.updateTime) : '-' }}
</div>
</div>
<div class="tl-line"></div>
......@@ -289,8 +289,8 @@ onMounted(() => {
height: 100vh;
height: 100dvh;
max-height: 100dvh;
overflow: hidden;
padding: 6px 0;
overflow: hidden;
background: #f2f3f7;
.header-top {
......@@ -307,8 +307,7 @@ onMounted(() => {
.wo-detail-main {
flex: 1;
min-height: 0;
overflow-x: hidden;
overflow-y: auto;
overflow: hidden auto;
-webkit-overflow-scrolling: touch;
&--with-foot {
......@@ -318,16 +317,15 @@ onMounted(() => {
.page-head {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
margin-left: 12px;
background: #f0f2f5;
align-items: center;
justify-content: space-between;
margin:0 12px;
background: #f0f2f5
}
.head-left {
display: flex;
gap: 8px;
align-items: center;
}
......@@ -335,7 +333,7 @@ onMounted(() => {
.head-tag {
padding: 2px 18px;
margin-right:8px;
font-size: 11px;
font-weight: 500;
border: 0;
......@@ -344,12 +342,11 @@ onMounted(() => {
.head-right {
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
flex-wrap: wrap;
font-size: 12px;
color: #999;
margin-right:12px;
}
.head-order {
......@@ -574,9 +571,9 @@ onMounted(() => {
box-sizing: border-box;
width: 100%;
max-width: 430px;
margin: 0 auto;
padding: 12px;
padding-bottom: calc(12px + env(safe-area-inset-bottom));
margin: 0 auto;
background: #fff;
.edit-btn{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!