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