From 2385d95d38257118fb886fca0427c1c11a153354 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Fri, 8 Dec 2023 16:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NewBottom.vue | 2 +- src/components/NewBottomWhite.vue | 2 +- src/components/design/CaseCard/index.vue | 5 +---- src/components/design/Header/index.vue | 5 +---- src/router/index.js | 4 ++-- src/views/DesignDetail/index.vue | 28 ++++++++++++++++------------ 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/components/NewBottom.vue b/src/components/NewBottom.vue index e9076ce..49f9c85 100644 --- a/src/components/NewBottom.vue +++ b/src/components/NewBottom.vue @@ -58,7 +58,7 @@
电子邮箱 | E-mail

商务邮箱:info@iflytop.com

-

招聘邮箱:info@iflytop.com

+

招聘邮箱:hr@iflytop.com

我们的位置 | Position
diff --git a/src/components/NewBottomWhite.vue b/src/components/NewBottomWhite.vue index 846a2b5..111060e 100644 --- a/src/components/NewBottomWhite.vue +++ b/src/components/NewBottomWhite.vue @@ -58,7 +58,7 @@
电子邮箱 | E-mail

商务邮箱:info@iflytop.com

-

招聘邮箱:info@iflytop.com

+

招聘邮箱:hr@iflytop.com

我们的位置 | Position
diff --git a/src/components/design/CaseCard/index.vue b/src/components/design/CaseCard/index.vue index 6d9299e..311d704 100644 --- a/src/components/design/CaseCard/index.vue +++ b/src/components/design/CaseCard/index.vue @@ -57,10 +57,7 @@ const router = useRouter() const toDetail = t => { document.body.scrollTop = document.documentElement.scrollTop = 0 router.push({ - path: '/design-detail', - query: { - t, - }, + path: `/catalog/${t}`, }) } diff --git a/src/components/design/Header/index.vue b/src/components/design/Header/index.vue index aadb281..ee000c8 100644 --- a/src/components/design/Header/index.vue +++ b/src/components/design/Header/index.vue @@ -100,10 +100,7 @@ const toHomePage = (path, p) => { const toDetail = t => { document.body.scrollTop = document.documentElement.scrollTop = 0 router.push({ - path: '/design-detail', - query: { - t, - }, + path: `/catalog/${t}`, }) } diff --git a/src/router/index.js b/src/router/index.js index e0bf637..43f87af 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -33,12 +33,12 @@ const routes = [ component: () => import('@/views/Design'), }, { - path: '/design-detail', + path: '/catalog/:pId', name: 'design-detail', component: () => import('@/views/DesignDetail'), }, { - path: '/design-detail/:pId/:id', + path: '/product/:pId/:id', name: 'design-detail-product', component: () => import('@/views/DesignDetail'), }, diff --git a/src/views/DesignDetail/index.vue b/src/views/DesignDetail/index.vue index 918c6e0..66446e6 100644 --- a/src/views/DesignDetail/index.vue +++ b/src/views/DesignDetail/index.vue @@ -165,22 +165,26 @@ onMounted(() => { return } const { pId, id } = route.params || {} - activeTab.value = pId - // 展示该产品详情 - // 取消html的滚动条 - const rootTag = document.getElementById('iflytop') - rootTag.style.overflow = 'hidden' - rootTag.style.height = '100%' - showModalVisible.value = true - // 根据activeTab和id确定详情数据 - productInfo.value = case_detail_list[pId][id] + if (id) { + activeTab.value = pId + // 展示该产品详情 + // 取消html的滚动条 + const rootTag = document.getElementById('iflytop') + rootTag.style.overflow = 'hidden' + rootTag.style.height = '100%' + showModalVisible.value = true + // 根据activeTab和id确定详情数据 + productInfo.value = case_detail_list[pId][id] + } else { + activeTab.value = pId + } }) watch( - () => route.query?.t, + () => route.params, () => { - if ((activeTab.value = route.query?.t)) { - activeTab.value = route.query?.t + if (route.params?.pId) { + activeTab.value = route.params?.pId } }, { immediate: true, deep: true },