From 684b9b2604133345a4852c225f1c25620a4ae822 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 1 Nov 2026 19:17:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20PWA=20manifest=20=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=89=B2=E8=B7=9F=E9=9A=8F=E6=96=B0=E4=B8=BB=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 安装到主屏后的启动背景与状态栏色此前仍是旧的墨绿/暖白;e2e 断言与文档同步更新。 --- 2.Design/ROADMAP-M0-M1.md | 2 +- web/e2e/pwa.mjs | 2 +- web/vite.config.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/2.Design/ROADMAP-M0-M1.md b/2.Design/ROADMAP-M0-M1.md index 8415e82..b8b6972 100644 --- a/2.Design/ROADMAP-M0-M1.md +++ b/2.Design/ROADMAP-M0-M1.md @@ -520,7 +520,7 @@ ### 8.3 实现 | 位置 | 内容 | |---|---| -| `web/vite.config.ts` | manifest(standalone、主题色 `#2f6054`、三个图标)+ workbox(`navigateFallback` 回退 `index.html`,`/vditor/` 走 CacheFirst,`/api/` NetworkOnly) | +| `web/vite.config.ts` | manifest(standalone、主题色 `#274b73`、三个图标)+ workbox(`navigateFallback` 回退 `index.html`,`/vditor/` 走 CacheFirst,`/api/` NetworkOnly) | | `web/index.html` | favicon 改成同款 Logo(内联 SVG)、`theme-color`、`apple-touch-icon`、`viewport-fit=cover` | | `web/src/lib/pwa.ts` | 生产环境注册 SW、`dadao:pwa-update-ready` 事件、`applyServiceWorkerUpdate()`、`isStandalone()` | | `web/src/components/UpdatePrompt.tsx` | 底部卡片「有新版了」+ 稍后 / 刷新(**居中用 flex 包一层**:`animate-slide-up` 的 keyframes 自带 transform,会和 `-translate-x-1/2` 抢属性,手机窄屏上卡片会被推出屏幕右侧) | diff --git a/web/e2e/pwa.mjs b/web/e2e/pwa.mjs index 20c2a51..80c5061 100644 --- a/web/e2e/pwa.mjs +++ b/web/e2e/pwa.mjs @@ -118,7 +118,7 @@ async function main() { check("页面骨架已预缓存", shellCached); const themeColor = await page.getAttribute('meta[name="theme-color"]', "content"); - check("主题色是墨绿", themeColor === "#2f6054", String(themeColor)); + check("主题色是景泰蓝", themeColor === "#274b73", String(themeColor)); check("桌面尺寸没有控制台报错", errors.length === 0, errors.join(" | ")); await desktop.close(); diff --git a/web/vite.config.ts b/web/vite.config.ts index 47a48d7..03e55ff 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -22,8 +22,8 @@ export default defineConfig({ scope: "/", display: "standalone", orientation: "any", - background_color: "#f7f5f0", - theme_color: "#2f6054", + background_color: "#f3f5f9", + theme_color: "#274b73", categories: ["productivity", "business"], icons: [ { src: "/icons/icon-192.png", sizes: "192x192", type: "image/png", purpose: "any" },