From 14159523af20e5d9981e03b7d11b3c76ac1f2230 Mon Sep 17 00:00:00 2001 From: KQL Date: Thu, 4 Dec 2025 18:08:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E8=BF=9B=E5=85=A5=E6=97=B6UI=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=92=8C=E8=BD=AC=E5=9C=BA=E6=97=B6=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要修复: 1. 移除 init3DScene 中的 is2DInitialized 重置(避免时序混乱) 2. 在 switchTo2D 中显式隐藏 uiLayer 和 hint(display: none) 3. 确保地图界面不会显示3D场景的UI元素 解决的问题: - 第二次进入时动画播放完整 - 地图界面不会显示"点击地球"按钮 - 转场逻辑更加清晰和可靠 🤖 Generated with Claude Code --- js/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/main.js b/js/main.js index 87bfa17..66a835d 100644 --- a/js/main.js +++ b/js/main.js @@ -115,9 +115,6 @@ class App { this.sceneManager = null; } - // 重置2D地图初始化标志 - this.is2DInitialized = false; - // 重置UI状态 this.canvasContainer.style.display = 'block'; this.speedLines.style.display = 'block'; @@ -126,7 +123,7 @@ class App { this.mapInterface.style.display = 'none'; this.mapInterface.style.opacity = '0'; - // 重置UI层和提示文字的状态(关键修复) + // 重置UI层和提示文字的状态(确保第二次进入时能正常显示) this.uiLayer.style.opacity = '0'; this.uiLayer.style.display = 'flex'; this.hint.style.opacity = '0'; @@ -170,6 +167,10 @@ class App { this.canvasContainer.style.display = 'none'; this.speedLines.style.display = 'none'; + // 隐藏3D场景的UI元素(关键修复) + this.uiLayer.style.display = 'none'; + this.hint.style.display = 'none'; + // 先显示地图容器(opacity: 0,但display: block) this.mapInterface.style.display = 'block'; this.mapInterface.style.opacity = '0';