|
|
@ -5925,20 +5925,42 @@ |
|
|
setupAutoSave(); |
|
|
setupAutoSave(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 存储触摸事件监听器的引用 |
|
|
|
|
|
let touchMoveListener = null; |
|
|
|
|
|
|
|
|
// 防止iOS页面拖动的函数 |
|
|
// 防止iOS页面拖动的函数 |
|
|
function preventiOSScrolling() { |
|
|
function preventiOSScrolling() { |
|
|
// 阻止触摸事件的默认行为,防止页面滚动 |
|
|
// 先移除之前的监听器,避免重复添加 |
|
|
document.addEventListener('touchmove', function(e) { |
|
|
if (touchMoveListener) { |
|
|
|
|
|
document.removeEventListener('touchmove', touchMoveListener, { passive: false }); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 定义触摸事件监听器 |
|
|
|
|
|
touchMoveListener = function(e) { |
|
|
|
|
|
// 只阻止页面滚动,不阻止模态框内的滚动 |
|
|
|
|
|
const target = e.target; |
|
|
|
|
|
const createSupplyModal = document.getElementById('createSupplyModal'); |
|
|
|
|
|
|
|
|
|
|
|
// 如果触摸目标在模态框内,允许滚动 |
|
|
|
|
|
if (createSupplyModal && createSupplyModal.contains(target)) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 阻止页面滚动 |
|
|
e.preventDefault(); |
|
|
e.preventDefault(); |
|
|
}, { passive: false }); |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 添加触摸事件监听器 |
|
|
|
|
|
document.addEventListener('touchmove', touchMoveListener, { passive: false }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 恢复iOS页面滚动的函数 |
|
|
// 恢复iOS页面滚动的函数 |
|
|
function restoreiOSScrolling() { |
|
|
function restoreiOSScrolling() { |
|
|
// 移除触摸事件监听器,恢复页面滚动 |
|
|
// 移除触摸事件监听器,恢复页面滚动 |
|
|
document.removeEventListener('touchmove', function(e) { |
|
|
if (touchMoveListener) { |
|
|
e.preventDefault(); |
|
|
document.removeEventListener('touchmove', touchMoveListener, { passive: false }); |
|
|
}, { passive: false }); |
|
|
touchMoveListener = null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 隐藏创建货源模态框 |
|
|
// 隐藏创建货源模态框 |
|
|
|