Commit 8d3f4b58 by 张立顺

feat(venus-usedcar-h5): 检测报告自测修复

1 parent 5322f7f5
export * from "./inspect-report";
export * from "./page"; export * from "./page";
export * from "./record"; export * from "./record";
export * from "./template"; export * from "./template";
...@@ -28,6 +28,7 @@ declare module 'vue' { ...@@ -28,6 +28,7 @@ declare module 'vue' {
VanForm: typeof import('vant/es')['Form'] VanForm: typeof import('vant/es')['Form']
VanIcon: typeof import('vant/es')['Icon'] VanIcon: typeof import('vant/es')['Icon']
VanImage: typeof import('vant/es')['Image'] VanImage: typeof import('vant/es')['Image']
VanImagePreview: typeof import('vant/es')['ImagePreview']
VanList: typeof import('vant/es')['List'] VanList: typeof import('vant/es')['List']
VanLoading: typeof import('vant/es')['Loading'] VanLoading: typeof import('vant/es')['Loading']
VanOverlay: typeof import('vant/es')['Overlay'] VanOverlay: typeof import('vant/es')['Overlay']
...@@ -40,8 +41,12 @@ declare module 'vue' { ...@@ -40,8 +41,12 @@ declare module 'vue' {
VanSearch: typeof import('vant/es')['Search'] VanSearch: typeof import('vant/es')['Search']
VanSkeleton: typeof import('vant/es')['Skeleton'] VanSkeleton: typeof import('vant/es')['Skeleton']
VanSlider: typeof import('vant/es')['Slider'] VanSlider: typeof import('vant/es')['Slider']
VanSwipe: typeof import('vant/es')['Swipe']
VanSwipeItem: typeof import('vant/es')['SwipeItem']
VanTab: typeof import('vant/es')['Tab']
VanTabbar: typeof import('vant/es')['Tabbar'] VanTabbar: typeof import('vant/es')['Tabbar']
VanTabbarItem: typeof import('vant/es')['TabbarItem'] VanTabbarItem: typeof import('vant/es')['TabbarItem']
VanTabs: typeof import('vant/es')['Tabs']
VanTag: typeof import('vant/es')['Tag'] VanTag: typeof import('vant/es')['Tag']
VanUploader: typeof import('vant/es')['Uploader'] VanUploader: typeof import('vant/es')['Uploader']
WorkOrderStatusTags: typeof import('./components/WorkOrderStatusTags.vue')['default'] WorkOrderStatusTags: typeof import('./components/WorkOrderStatusTags.vue')['default']
......
...@@ -5,6 +5,7 @@ import { computed, nextTick, onMounted, ref } from "vue"; ...@@ -5,6 +5,7 @@ import { computed, nextTick, onMounted, ref } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { detail } from "@api/modules/inspect-report"; import { detail } from "@api/modules/inspect-report";
import { showToast } from "vant";
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
...@@ -298,6 +299,28 @@ const arcStyle = computed(() => { ...@@ -298,6 +299,28 @@ const arcStyle = computed(() => {
}; };
}); });
async function copyCurrentPageLink() {
const url = window.location.href;
try {
if (navigator.clipboard?.writeText) {
await navigator.clipboard.writeText(url);
} else {
const ta = document.createElement("textarea");
ta.value = url;
ta.setAttribute("readonly", "");
ta.style.position = "fixed";
ta.style.left = "-9999px";
document.body.append(ta);
ta.select();
document.execCommand("copy");
ta.remove();
}
showToast("已复制链接");
} catch {
showToast("复制失败,请重试");
}
}
onMounted(() => { onMounted(() => {
fetchDetail(); fetchDetail();
}); });
...@@ -603,6 +626,14 @@ onMounted(() => { ...@@ -603,6 +626,14 @@ onMounted(() => {
</div> </div>
</div> </div>
<div class="report-share">
<button class="report-share__btn"
type="button"
@click="copyCurrentPageLink">
分享
</button>
</div>
<van-image-preview closeable <van-image-preview closeable
:images="albumPreviewUrls" :images="albumPreviewUrls"
:show="albumPreviewShow" :show="albumPreviewShow"
...@@ -636,6 +667,24 @@ onMounted(() => { ...@@ -636,6 +667,24 @@ onMounted(() => {
background: #f2f3f7; background: #f2f3f7;
} }
.report-share {
padding: $spacing-base $spacing-md 0;
}
.report-share__btn {
display: block;
width: 100%;
padding-block: 12px;
padding-inline: $spacing-md;
font-size: $font-size-lg;
font-weight: 500;
color: #fff;
cursor: pointer;
background: $color-primary;
border: none;
border-radius: $radius-base;
}
// ===== 顶部认证头 ===== // ===== 顶部认证头 =====
.cert-header { .cert-header {
display: flex; display: flex;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!