gcz пре 1 месец
родитељ
комит
a20a79045b
3 измењених фајлова са 9 додато и 2 уклоњено
  1. 1 0
      src/components/layout/Footer.vue
  2. 2 0
      src/pages/home/Index.vue
  3. 6 2
      src/router/index.js

+ 1 - 0
src/components/layout/Footer.vue

@@ -252,6 +252,7 @@ export default {
       text-decoration: none;
       font-size: 18px;
       transition: color 0.3s ease;
+      cursor: pointer;
 
       &:hover {
         color: white;

+ 2 - 0
src/pages/home/Index.vue

@@ -348,6 +348,8 @@ export default {
         targetSection = 'history'
       } else if (activeAboutTab.value === 'qualification') {
         targetSection = 'qualification-section'
+      } else {
+        targetSection = 'about-us' // 默认跳转到关于达泽
       }
       
       router.push({

+ 6 - 2
src/router/index.js

@@ -54,6 +54,7 @@ const router = createRouter({
     
     // 如果路由有hash(锚点),滚动到对应元素
     if (to.hash) {
+      console.log('to.hash', to.hash)
       return new Promise((resolve) => {
         // 延迟执行,确保页面内容已加载
         setTimeout(() => {
@@ -78,19 +79,22 @@ const router = createRouter({
 
 // 路由守卫:确保每次路由变化时重新应用缩放策略
 router.afterEach((to, from) => {
+  // 如果有hash(锚点),延迟更长时间执行scaleManager,避免干扰滚动
+  const delay = to.hash ? 800 : 150
+  
   // 延迟执行,确保DOM已更新
   setTimeout(() => {
     import('@/utils/scaleManager.js').then(({ scaleManager }) => {
       scaleManager.checkAndRestore()
     })
-  }, 150)
+  }, delay)
   
   // 再次检查,确保状态正确
   setTimeout(() => {
     import('@/utils/scaleManager.js').then(({ scaleManager }) => {
       scaleManager.checkAndRestore()
     })
-  }, 500)
+  }, delay + 350)
 })
 
 export default router