- {/* 启动屏图标 */}
+ {/* 启动屏图标 - 使用 app.icon */}

{
diff --git a/src/services/ecosystem/registry.ts b/src/services/ecosystem/registry.ts
index 5404118e..76fcf5b2 100644
--- a/src/services/ecosystem/registry.ts
+++ b/src/services/ecosystem/registry.ts
@@ -57,12 +57,8 @@ function normalizeAppFromSource(app: MiniappManifest, source: SourceRecord, payl
icon: resolve(app.icon),
url: resolve(app.url),
screenshots: app.screenshots?.map(resolve),
- splashScreen: app.splashScreen
- ? {
- ...app.splashScreen,
- icon: app.splashScreen.icon ? resolve(app.splashScreen.icon) : undefined,
- }
- : undefined,
+ // splashScreen 现在是 true | { timeout?: number },不再需要解析 icon
+ splashScreen: app.splashScreen,
// 来源元数据
sourceUrl: source.url,
sourceName: source.name,
diff --git a/src/services/ecosystem/schema.ts b/src/services/ecosystem/schema.ts
index 2caf6b7e..444a1cd8 100644
--- a/src/services/ecosystem/schema.ts
+++ b/src/services/ecosystem/schema.ts
@@ -10,13 +10,12 @@ const MiniappCategorySchema = z.enum([
'other',
])
-const SplashScreenSchema = z
- .object({
- backgroundColor: z.string().optional(),
- icon: z.string().optional(),
+const SplashScreenSchema = z.union([
+ z.literal(true),
+ z.object({
timeout: z.number().int().positive().optional(),
- })
- .passthrough()
+ }).passthrough(),
+])
export const MiniappManifestSchema = z
.object({
diff --git a/src/services/ecosystem/types.ts b/src/services/ecosystem/types.ts
index 6b639e9a..1c43df52 100644
--- a/src/services/ecosystem/types.ts
+++ b/src/services/ecosystem/types.ts
@@ -171,12 +171,18 @@ export interface MiniappManifest {
* 启动屏配置
* 如果配置了启动屏,小程序需要调用 bio.closeSplashScreen() 来关闭
* 如果未配置,则使用 iframe load 事件自动关闭加载状态
+ *
+ * - 图标自动使用 manifest.icon
+ * - 背景色自动使用 manifest.themeColor
+ *
+ * @example
+ * // 简写形式
+ * "splashScreen": true
+ *
+ * // 自定义超时
+ * "splashScreen": { "timeout": 3000 }
*/
- splashScreen?: {
- /** 启动屏背景色 (CSS 颜色值) */
- backgroundColor?: string
- /** 启动屏图标 URL (默认使用 app.icon) */
- icon?: string
+ splashScreen?: true | {
/** 最大等待时间 (ms),超时后自动关闭启动屏,默认 5000 */
timeout?: number
}