|
|
@ -2,7 +2,7 @@ |
|
|
<html lang="zh-CN"> |
|
|
<html lang="zh-CN"> |
|
|
<head> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0"> |
|
|
<title>货源管理</title> |
|
|
<title>货源管理</title> |
|
|
<style> |
|
|
<style> |
|
|
body { |
|
|
body { |
|
|
@ -12,6 +12,8 @@ |
|
|
background-color: #f5f5f5; |
|
|
background-color: #f5f5f5; |
|
|
color: #333; |
|
|
color: #333; |
|
|
font-size: 14px; |
|
|
font-size: 14px; |
|
|
|
|
|
touch-action: none; |
|
|
|
|
|
overflow: hidden; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.container { |
|
|
.container { |
|
|
@ -19,6 +21,8 @@ |
|
|
margin: 0 auto; |
|
|
margin: 0 auto; |
|
|
background-color: #fff; |
|
|
background-color: #fff; |
|
|
min-height: 100vh; |
|
|
min-height: 100vh; |
|
|
|
|
|
overflow-y: auto; |
|
|
|
|
|
-webkit-overflow-scrolling: touch; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* 标题栏 */ |
|
|
/* 标题栏 */ |
|
|
@ -2410,6 +2414,58 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 阻止iOS端触摸拖动 |
|
|
|
|
|
function preventIOSDrag() { |
|
|
|
|
|
document.addEventListener('touchstart', function(e) { |
|
|
|
|
|
// 仅在垂直方向上阻止默认行为 |
|
|
|
|
|
if (e.touches.length === 1) { |
|
|
|
|
|
const touch = e.touches[0]; |
|
|
|
|
|
const startX = touch.clientX; |
|
|
|
|
|
const startY = touch.clientY; |
|
|
|
|
|
|
|
|
|
|
|
function handleTouchMove(e) { |
|
|
|
|
|
const touch = e.touches[0]; |
|
|
|
|
|
const deltaX = touch.clientX - startX; |
|
|
|
|
|
const deltaY = touch.clientY - startY; |
|
|
|
|
|
|
|
|
|
|
|
// 检测是否为垂直拖动 |
|
|
|
|
|
if (Math.abs(deltaY) > Math.abs(deltaX)) { |
|
|
|
|
|
// 检查目标元素是否为可滚动元素 |
|
|
|
|
|
const target = e.target; |
|
|
|
|
|
let isScrollable = false; |
|
|
|
|
|
let currentElement = target; |
|
|
|
|
|
|
|
|
|
|
|
while (currentElement) { |
|
|
|
|
|
const style = window.getComputedStyle(currentElement); |
|
|
|
|
|
if (style.overflowY === 'auto' || style.overflowY === 'scroll' || |
|
|
|
|
|
style.overflow === 'auto' || style.overflow === 'scroll') { |
|
|
|
|
|
const rect = currentElement.getBoundingClientRect(); |
|
|
|
|
|
if (currentElement.scrollHeight > rect.height) { |
|
|
|
|
|
isScrollable = true; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
currentElement = currentElement.parentElement; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 如果不是可滚动元素,则阻止默认行为 |
|
|
|
|
|
if (!isScrollable) { |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function handleTouchEnd() { |
|
|
|
|
|
document.removeEventListener('touchmove', handleTouchMove, { passive: false }); |
|
|
|
|
|
document.removeEventListener('touchend', handleTouchEnd); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('touchmove', handleTouchMove, { passive: false }); |
|
|
|
|
|
document.addEventListener('touchend', handleTouchEnd); |
|
|
|
|
|
} |
|
|
|
|
|
}, { passive: false }); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 初始化 |
|
|
// 初始化 |
|
|
window.onload = function() { |
|
|
window.onload = function() { |
|
|
// 登录检查 |
|
|
// 登录检查 |
|
|
@ -2418,6 +2474,9 @@ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 阻止iOS端触摸拖动 |
|
|
|
|
|
preventIOSDrag(); |
|
|
|
|
|
|
|
|
// 初始化WebSocket连接 |
|
|
// 初始化WebSocket连接 |
|
|
initWebSocket(); |
|
|
initWebSocket(); |
|
|
|
|
|
|
|
|
|