From a399a483f02ea4b79f56173ec5e2283788e5fd92 Mon Sep 17 00:00:00 2001 From: liulujian Date: Sun, 5 Jul 2026 00:19:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20qych=20=E5=86=85=E9=83=A8=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E9=9D=A2=E6=9D=BF=E4=B8=8E=E6=95=B4=E9=A1=B5=E7=BF=BB?= =?UTF-8?q?=E5=B1=8F=E4=B8=8D=E5=86=8D=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 _isInsideScrollablePanel: wheel事件源在content-item1内时, 检查面板自身是否还能滚动。能滚→交给浏览器,不能→触发整页翻屏。 Co-Authored-By: Claude --- .../src/pages/index/views/qych/index.vue | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/txw-mhzc-web/src/pages/index/views/qych/index.vue b/txw-mhzc-web/src/pages/index/views/qych/index.vue index 40f9006..0811599 100644 --- a/txw-mhzc-web/src/pages/index/views/qych/index.vue +++ b/txw-mhzc-web/src/pages/index/views/qych/index.vue @@ -471,6 +471,21 @@ export default { this.setNavActive(sectionIndex - 1); } }, + /** 检查事件源是否在可滚动面板内,且面板仍有滚动空间 */ + _isInsideScrollablePanel(e, direction) { + let el = e.target; + while (el) { + if (el.classList && el.classList.contains('content-item1')) { + const atTop = el.scrollTop <= 1; + const atBottom = el.scrollTop + el.clientHeight >= el.scrollHeight - 1; + if (direction > 0 && !atBottom) return true; // 向下滚,面板未到底 + if (direction < 0 && !atTop) return true; // 向上滚,面板未到顶 + return false; + } + el = el.parentElement; + } + return false; + }, handleWheel(e) { if (this.isScrolling) return; const delta = Math.abs(e.deltaY); @@ -480,6 +495,12 @@ export default { if (!scrollRoot) return; const direction = e.deltaY > 0 ? 1 : -1; + + // 如果事件来自内部滚动面板且面板还能滚,交给浏览器处理 + if (this._isInsideScrollablePanel(e, direction)) { + return; + } + const currentIndex = this.getCurrentSectionIndex(scrollRoot); const currentEl = document.getElementById(this.sectionIds[currentIndex]);