From efe5db2e887636826bdd56edae73fc4b33cd208d Mon Sep 17 00:00:00 2001 From: kicer Date: Wed, 23 Sep 2026 23:45:50 +0800 Subject: [PATCH] =?UTF-8?q?data-page=E6=A8=A1=E6=9D=BF=E8=A1=A5=E3=80=8C?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=BA=94=E7=94=A8=E3=80=8DFAB(=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E6=96=B9=E6=A1=88=E6=8C=89=E5=BA=93=E5=86=85=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E4=BF=AE=E6=AD=A3):returnToApp=E4=BC=98=E5=85=88?= =?UTF-8?q?=E7=BA=A7=E9=93=BE=3DAPK=20JS=E6=A1=A5(Android.backToApp/webkit?= =?UTF-8?q?=20handler)=E2=86=92=3Ffrom=3D(=E9=99=90=E7=AB=99=E5=86=85?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84,=E5=A0=B5=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E9=87=8D=E5=AE=9A=E5=90=91)=E2=86=92history.back?= =?UTF-8?q?=E2=86=92=E6=A0=B9=E8=B7=AF=E5=BE=84=E2=80=94=E2=80=94=E4=B8=8D?= =?UTF-8?q?=E5=86=99=E6=AD=BB'/chat'(=E6=9C=AC=E5=BA=93=E4=B8=BB=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=AFpublic=E6=A0=B9,=E5=B7=B2=E6=A0=B8=E5=AE=9E),?= =?UTF-8?q?=E7=BA=AF=E6=B5=8F=E8=A7=88=E5=99=A8=E8=87=AA=E7=84=B6=E8=90=BD?= =?UTF-8?q?=E5=9C=A8=E5=9B=9E=E4=B8=8A=E4=B8=80=E9=A1=B5/=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=97=A0=E9=9C=80=E7=8E=AF=E5=A2=83=E5=88=A4=E6=96=AD?= =?UTF-8?q?;=E4=BD=8D=E7=BD=AE=E9=80=89FAB=E5=BC=83footer(=E6=A1=8C?= =?UTF-8?q?=E9=9D=A2=E4=BC=98=E5=85=88=E6=96=B9=E9=92=88=E4=B8=8Bfooter?= =?UTF-8?q?=E5=90=83=E5=9E=82=E7=9B=B4=E7=A9=BA=E9=97=B4,=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=E5=88=97=E9=AB=98/=E9=95=BF=E8=A1=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=A6=96=E5=BD=93=E5=85=B6=E5=86=B2);=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E7=94=A8=E5=86=85=E8=81=94SVG(=E2=8C=82=E7=A0=81?= =?UTF-8?q?=E4=BD=8DWebView=E5=AD=97=E4=BD=93=E4=B8=8D=E4=BF=9D=E8=AF=81);?= =?UTF-8?q?SKILL.md=E6=88=90=E6=96=87:=E6=AF=8F=E4=B8=AAapp/*.html(?= =?UTF-8?q?=E5=90=ABindex)=E5=BF=85=E5=B8=A6,=E6=A3=80=E6=9F=A5=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E5=90=8C=E6=AD=A5;=E7=BA=BF=E4=B8=8A=E5=9B=9B?= =?UTF-8?q?=E9=A1=B5=E4=B8=80=E5=B9=B6=E8=A1=A5=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/data-page/SKILL.md | 2 ++ skills/data-page/templates/dashboard.html | 27 +++++++++++++++++++++- skills/data-page/templates/kanban.html | 28 ++++++++++++++++++++++- skills/data-page/templates/table.html | 28 ++++++++++++++++++++++- 4 files changed, 82 insertions(+), 3 deletions(-) diff --git a/skills/data-page/SKILL.md b/skills/data-page/SKILL.md index fa160ab..c813dcc 100644 --- a/skills/data-page/SKILL.md +++ b/skills/data-page/SKILL.md @@ -83,6 +83,7 @@ const taskId = location.pathname.split('/').filter(Boolean)[1]; - 桌面优先、移动兼容的样式:容器宽度按页面类型给足(表格类 1200px、看板类 1400px 或不设、统计类 1080px),不要照搬 800px 级别的移动端尺寸 - 通过 `fetch` 调用数据 API - 错误处理和加载状态 +- **返回应用入口**:右下角 FAB(.fab,内联 SVG 图标),onclick 走 `returnToApp()`,优先级链:APK 注册的 JS 桥(`window.Android.backToApp` / webkit handler,有则最干净)→ `?from=` 参数(须站内绝对路径,防开放重定向)→ `history.back()` → 根路径。**每一个 `app/*.html` 页面(含 index.html)都要带**——用户可能从任意子页直入,缺入口即被困住 ## 模板 @@ -215,4 +216,5 @@ const taskId = location.pathname.split('/').filter(Boolean)[1]; - [ ] 页面动态解析 task_id - [ ] 包含错误处理和加载状态 - [ ] 用户输入渲染时已转义 +- [ ] 每个 `app/*.html` 页面右下角都有「返回应用」FAB(returnToApp 链完整) - [ ] 已告知用户完整访问 URL(run 输出「访问地址」那行,含域名,非相对路径) diff --git a/skills/data-page/templates/dashboard.html b/skills/data-page/templates/dashboard.html index 35e83b8..ae677ef 100644 --- a/skills/data-page/templates/dashboard.html +++ b/skills/data-page/templates/dashboard.html @@ -43,10 +43,18 @@ tr:last-child td { border-bottom: none; } .msg { text-align: center; padding: 40px 20px; color: var(--text-2); } .msg.err { color: #d70015; } @media (max-width: 480px) { - body { padding: 8px; } + body { padding: 8px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); } h1 { font-size: 18px; margin-bottom: 14px; } .stat .val { font-size: 20px; } } +/* 返回应用 FAB:固定右下、零版面占用;图标用内联 SVG 不用 ⌂ 字符(WebView 字体不保证) */ +.fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); + width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; + border: none; box-shadow: 0 4px 12px rgba(0,113,227,0.3); cursor: pointer; z-index: 100; + display: flex; align-items: center; justify-content: center; } +.fab:hover { filter: brightness(1.08); } +.fab:active { transform: scale(0.94); } +body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } @@ -63,6 +71,10 @@ tr:last-child td { border-bottom: none; } + + diff --git a/skills/data-page/templates/kanban.html b/skills/data-page/templates/kanban.html index 9d53640..d422fb0 100644 --- a/skills/data-page/templates/kanban.html +++ b/skills/data-page/templates/kanban.html @@ -45,7 +45,16 @@ h1 { font-size: 20px; margin: 4px 0 20px; letter-spacing: -0.02em; } .col-bd .empty { text-align: center; color: var(--text-2); padding: 20px 8px; font-size: 12px; } .msg { text-align: center; padding: 40px 20px; color: var(--text-2); } .msg.err { color: #d70015; } -@media (max-width: 480px) { body { padding: 8px; } h1 { font-size: 18px; margin-bottom: 14px; } } +@media (max-width: 480px) { body { padding: 8px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); } h1 { font-size: 18px; margin-bottom: 14px; } } +/* 返回应用 FAB:固定右下、零版面占用(看板列高按视口算,footer 会直接吃掉一截); + 图标用内联 SVG 不用 ⌂ 字符(WebView 字体不保证有该码位) */ +.fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); + width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; + border: none; box-shadow: 0 4px 12px rgba(0,113,227,0.3); cursor: pointer; z-index: 100; + display: flex; align-items: center; justify-content: center; } +.fab:hover { filter: brightness(1.08); } +.fab:active { transform: scale(0.94); } +body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } @@ -54,6 +63,10 @@ h1 { font-size: 20px; margin: 4px 0 20px; letter-spacing: -0.02em; }
加载中…
+ + diff --git a/skills/data-page/templates/table.html b/skills/data-page/templates/table.html index 2b84541..b67d186 100644 --- a/skills/data-page/templates/table.html +++ b/skills/data-page/templates/table.html @@ -68,8 +68,17 @@ dialog::backdrop { background: rgba(0,0,0,0.35); } .acts .pri { background: var(--accent); color: #fff; border-color: var(--accent); } .acts .pri:hover { background: var(--accent-h); } @media (max-width: 480px) { - body { padding: 8px; } th, td { padding: 8px 12px; font-size: 13px; } + body { padding: 8px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); } th, td { padding: 8px 12px; font-size: 13px; } } +/* 返回应用 FAB:固定右下、零版面占用(桌面优先方针下 footer 会吃掉长表/看板的垂直空间)。 + 图标用内联 SVG 不用 ⌂ 字符——WebView 字体不保证有该码位,缺字即变豆腐块。 */ +.fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); + width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; + border: none; box-shadow: 0 4px 12px rgba(0,113,227,0.3); cursor: pointer; z-index: 100; + display: flex; align-items: center; justify-content: center; } +.fab:hover { filter: brightness(1.08); } +.fab:active { transform: scale(0.94); } +body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } @@ -97,6 +106,10 @@ dialog::backdrop { background: rgba(0,0,0,0.35); } + +