diff --git a/docs/更新文档.md b/docs/更新文档.md index 3e73974..4513172 100644 --- a/docs/更新文档.md +++ b/docs/更新文档.md @@ -4,6 +4,31 @@ --- +## 2026-07-16 · 电脑端误判平板导致发糊 + +### 修改原因 + +`isTabletLayout()` 曾用「高度 ≤920 即平板」;1080p 电脑有任务栏/浏览器栏时 `innerHeight` 常落在此区间,桌面被套上平板压缩字号(约 10px),观感发糊发虚。 + +### 修改的地方 + +| 文件 | 改动摘要 | +|------|----------| +| `manual_trading_hub/static/app.js` | 平板判定改为横屏 `721–1366 × ≤900` / 竖屏 `≤920 × ≥900`;去掉仅按高度命中 | +| `manual_trading_hub/static/index.html` | JS 缓存 `20260716-hub-desktop-clear` | + +### 达成的目标 + +常规电脑端不再误加 `hub-tablet`,恢复桌面字号与清晰度;真平板视口仍走一屏密度样式。 + +### 交付之后的验收 + +1. 1080p/1440p 电脑打开中控,正文与表格清晰,非异常小字。 +2. 浏览器开发者工具确认 `body` 无 `hub-tablet`(窄窗模拟平板除外)。 +3. 平板横/竖仍为一屏密度布局。 + +--- + ## 2026-07-16 · 平板一屏密度适配(不裁切) ### 修改原因 diff --git a/manual_trading_hub/static/app.js b/manual_trading_hub/static/app.js index 4da46a6..9c03cde 100644 --- a/manual_trading_hub/static/app.js +++ b/manual_trading_hub/static/app.js @@ -77,13 +77,19 @@ return window.matchMedia("(max-width: 720px)").matches; } - /** 平板 CSS 视口(如 2560×1600 @2x ≈ 1280×800),或高度偏矮的大屏 */ + /** + * 平板 CSS 视口(如 2560×1600@2x≈1280×800, 竖屏≈800×1280)。 + * 禁止「仅按高度」判断:1080p 电脑开任务栏/浏览器栏时 innerHeight 常 ≤920, + * 会误加 hub-tablet,字号被压到 ~10px,看起来发糊。 + */ function isTabletLayout() { if (isMobileLayout()) return false; const w = window.innerWidth || 0; const h = window.innerHeight || 0; - if (w >= 721 && w <= 1599) return true; - if (w >= 721 && h > 0 && h <= 920) return true; + // 横屏平板:中等宽度 + 偏矮 + if (w >= 721 && w <= 1366 && h > 0 && h <= 900) return true; + // 竖屏平板:偏窄 + 偏高 + if (w >= 721 && w <= 920 && h >= 900) return true; return false; } diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index 63f356e..59e361f 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -1327,6 +1327,6 @@ - +