From af65f513bf0c2dff15e0447b6d5346347a2b4287 Mon Sep 17 00:00:00 2001 From: Default User Date: Thu, 5 Feb 2026 14:45:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96iOS=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=80=81?= =?UTF-8?q?=E6=A1=86=E8=A7=A6=E6=91=B8=E4=BA=8B=E4=BB=B6=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply.html | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/supply.html b/supply.html index 71bec2b..1b12486 100644 --- a/supply.html +++ b/supply.html @@ -478,6 +478,15 @@ box-shadow: none; display: flex; flex-direction: column; + -webkit-overflow-scrolling: touch; + overscroll-behavior: contain; + } + + .modal-body { + flex: 1; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + overscroll-behavior: contain; } .modal-header { @@ -5791,6 +5800,31 @@ // 防止iOS上的页面拖动 preventiOSScrolling(); + // 为模态框内容添加滚动处理 + const modalContent = document.querySelector('#createSupplyModal .modal-content'); + if (modalContent) { + // 确保模态框内容可以滚动 + modalContent.style.overflowY = 'auto'; + modalContent.style.webkitOverflowScrolling = 'touch'; + + // 添加触摸事件监听器,允许模态框内的滚动 + modalContent.addEventListener('touchstart', function(e) { + this.allowUp = (this.scrollTop > 0); + this.allowDown = (this.scrollTop < this.scrollHeight - this.clientHeight); + this.prevTop = null; + this.prevBottom = null; + }, { passive: true }); + + modalContent.addEventListener('touchmove', function(e) { + if ((this.allowUp && e.touches[0].pageY < e.changedTouches[0].pageY) || + (this.allowDown && e.touches[0].pageY > e.changedTouches[0].pageY)) { + e.stopPropagation(); + } else { + e.preventDefault(); + } + }, { passive: false }); + } + // 重新加载联系人数据,确保最新 loadContacts();