From 9c34fe5e08d39430e6ac4b0242907e2c4e575745 Mon Sep 17 00:00:00 2001 From: zjlnb666 <14659021+zhangjianlong666@user.noreply.gitee.com> Date: Wed, 21 Jan 2026 15:30:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtab=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=A4=9A=E4=BA=8E=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C=E5=92=8C?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 35 +++++++++- src/assets/main.css | 1 + src/components/HeaderNav.vue | 38 ++++++++--- src/components/Mask.vue | 88 +++++++++++++++++++++++++ src/components/about/AboutContactUs.vue | 21 +++--- src/components/about/AboutDynamic.vue | 16 ++++- src/components/about/AboutHonor.vue | 13 +++- src/components/about/Map.vue | 23 ++++++- src/utils/function.js | 39 +++++++++-- src/views/AboutUs.vue | 37 ++++++++--- 10 files changed, 270 insertions(+), 41 deletions(-) create mode 100644 src/components/Mask.vue diff --git a/src/App.vue b/src/App.vue index 7e2c9c2..b1417fa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,12 +2,45 @@ import HeaderNav from "@/components/HeaderNav.vue"; import Footer from "@/components/Footer.vue" +import {nextTick, ref, watch} from 'vue'; +import { useRoute, useRouter, RouterView } from 'vue-router'; +const route = useRoute(); +const router = useRouter(); +const routerUpdateKey = ref(Date.now()); +watch( + () => route.fullPath, + () => { + routerUpdateKey.value = Date.now(); // 改变 key 触发重新渲染 + // 额外:触发一次 DOM 刷新,确保菜单交互恢复 + nextTick(() => { + restoreMenuInteraction(); + }); + }, + { immediate: true, deep: true } +); +const restoreMenuInteraction = () => { + const menuItems = document.querySelectorAll('.menu-item'); // 替换为你的菜单类名 + menuItems.forEach(item => { + // 移除可能的禁用状态,恢复点击事件 + item.style.pointerEvents = 'auto'; + item.removeAttribute('disabled'); + // 重新绑定点击事件(如果事件丢失) + item.onclick = null; // 先清空旧事件 + item.addEventListener('click', (e) => { + // 这里可以复用你原有菜单点击逻辑,或触发路由跳转 + const path = item.dataset.path; // 假设菜单元素有 data-path 属性存路由 + if (path) { + router.push({ path }); + } + }); + }); +}; diff --git a/src/assets/main.css b/src/assets/main.css index b6bfe14..ed1b5e0 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -15,3 +15,4 @@ button{ .hover-effect{ cursor: pointer; } + diff --git a/src/components/HeaderNav.vue b/src/components/HeaderNav.vue index fe03732..2c3077e 100644 --- a/src/components/HeaderNav.vue +++ b/src/components/HeaderNav.vue @@ -1,8 +1,9 @@ diff --git a/src/components/Mask.vue b/src/components/Mask.vue new file mode 100644 index 0000000..6efbd31 --- /dev/null +++ b/src/components/Mask.vue @@ -0,0 +1,88 @@ + + + + + + + + diff --git a/src/components/about/AboutContactUs.vue b/src/components/about/AboutContactUs.vue index c4131f6..0cb33c9 100644 --- a/src/components/about/AboutContactUs.vue +++ b/src/components/about/AboutContactUs.vue @@ -6,8 +6,9 @@ import Map from "@/components/about/Map.vue"; // 百度地图组件引用 const bmapRef = ref(null); // 地图中心点坐标(飞利信大厦) -const mapCenter = ref({ lng: 116.372326, lat: 39.991868}); -//116.365873,39.985891 +const mapCenter = ref({ lng: 116.371127, lat: 39.992468}); +const mapMark = ref({ lng: 116.372326, lat: 39.991868}); +//高德坐标 116.365873,39.985891 // 组件挂载后操作地图 onMounted(() => { // 确保地图组件已经初始化完成 @@ -17,16 +18,16 @@ onMounted(() => { const mapInstance = bmapRef.value.getMap(); // 添加标记点 - const point = new window.BMap.Point(mapCenter.value.lng, mapCenter.value.lat); + const point = new window.BMap.Point(mapMark.value.lng, mapMark.value.lat); const marker = bmapRef.value.addMarker(point); - // 添加信息窗口 - bmapRef.value.openInfoWindow("飞利信大厦
地址:北京市海淀区塔院志新村2号", point); - - // 绑定点击事件 - marker.addEventListener("click", () => { - bmapRef.value.openInfoWindow("飞利信大厦
地址:北京市海淀区塔院志新村2号", point); - }); + // // 添加信息窗口 + // bmapRef.value.openInfoWindow("飞利信大厦
地址:北京市海淀区塔院志新村2号", point); + // + // // 绑定点击事件 + // marker.addEventListener("click", () => { + // bmapRef.value.openInfoWindow("飞利信大厦
地址:北京市海淀区塔院志新村2号", point); + // }); } }, 100); }); diff --git a/src/components/about/AboutDynamic.vue b/src/components/about/AboutDynamic.vue index d385903..9251641 100644 --- a/src/components/about/AboutDynamic.vue +++ b/src/components/about/AboutDynamic.vue @@ -1,5 +1,5 @@