From a07e43ec3a370d394763b3c05c10d6e2413a327c Mon Sep 17 00:00:00 2001 From: duxingchen Date: Mon, 10 Aug 2026 15:19:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(mobile):=20=E4=BF=AE=E5=A4=8D=E7=94=BB?= =?UTF-8?q?=E5=B8=83=E7=A9=BA=E7=99=BD=E5=8C=BA=E5=9F=9F=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E6=8B=96=E6=8B=BD=E7=BC=A9=E6=94=BE=E6=89=8B?= =?UTF-8?q?=E5=8A=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit canvas-inner 使用 position:absolute 但未设置 width/height, 导致只缩到子元素大小(几乎为0)。在卡片之外的空白区域触摸时, 事件无法穿透到 movable-view 原生组件。 修复: - canvas-inner: 添加 width:100%; height:100% 铺满 movable-view - tree-movable-view: 添加 width:100%; height:100% 确保触摸覆盖 --- track-uniapp/src/pages/scan/components/TreeCanvas.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/track-uniapp/src/pages/scan/components/TreeCanvas.vue b/track-uniapp/src/pages/scan/components/TreeCanvas.vue index 34e8594..5b0db70 100644 --- a/track-uniapp/src/pages/scan/components/TreeCanvas.vue +++ b/track-uniapp/src/pages/scan/components/TreeCanvas.vue @@ -280,7 +280,9 @@ export default { .zero-icon { font-size: 40px; margin-bottom: 10px; } .zero-text { font-size: 14px; color: #9ca3af; } .tree-movable-area { width: 100%; background-color: #f0f2f5; background-image: linear-gradient(#dde1e6 1px, transparent 1px), linear-gradient(90deg, #dde1e6 1px, transparent 1px); background-size: 24px 24px; overflow: hidden; } -.canvas-inner { position: absolute; left: 0; top: 0; } +.canvas-inner { position: absolute; left: 0; top: 0; width: 100%; height: 100%; } +/* 🚀 movable-view 填充整个父容器,确保空白区域也能响应拖拽/缩放手势 */ +.tree-movable-view { width: 100%; height: 100%; } /* 🔧 连线(禁止吞事件) */ .cn-line { position: absolute; height: 2px; pointer-events: none; }