From 7d6c98d9c650ad9d3a8fc938a144467603d07f99 Mon Sep 17 00:00:00 2001 From: Default User Date: Thu, 5 Feb 2026 14:08:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DiOS=E7=AB=AF=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E8=A1=A8=E5=8D=95=E9=A1=B5=E9=9D=A2=E5=8F=AF=E6=8B=96?= =?UTF-8?q?=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/supply.html b/supply.html index 37c05e1..7bba1af 100644 --- a/supply.html +++ b/supply.html @@ -5783,6 +5783,9 @@ // 隐藏body滚动条,避免双滚动条 document.body.style.overflow = 'hidden'; + // 防止iOS上的页面拖动 + preventiOSScrolling(); + // 重新加载联系人数据,确保最新 loadContacts(); @@ -5922,6 +5925,22 @@ setupAutoSave(); } + // 防止iOS页面拖动的函数 + function preventiOSScrolling() { + // 阻止触摸事件的默认行为,防止页面滚动 + document.addEventListener('touchmove', function(e) { + e.preventDefault(); + }, { passive: false }); + } + + // 恢复iOS页面滚动的函数 + function restoreiOSScrolling() { + // 移除触摸事件监听器,恢复页面滚动 + document.removeEventListener('touchmove', function(e) { + e.preventDefault(); + }, { passive: false }); + } + // 隐藏创建货源模态框 function hideAddSupplyModal() { // 保存当前表单状态 @@ -5930,6 +5949,9 @@ // 恢复body滚动条 document.body.style.overflow = 'auto'; + // 恢复iOS页面滚动 + restoreiOSScrolling(); + // 不再禁用添加按钮,而是在点击时检查数量并弹出提示 // 确保添加按钮始终可用,以便用户可以点击并看到提示信息 } @@ -8923,6 +8945,10 @@ // 对于普通modal,使用display: none隐藏 if (modal.classList.contains('modal')) { modal.style.display = 'none'; + // 恢复iOS页面滚动 + restoreiOSScrolling(); + // 恢复body滚动条 + document.body.style.overflow = 'auto'; } // 对于select-modal,使用移除active类来隐藏 else if (modal.classList.contains('select-modal')) {