diff --git a/docs/screenshot/Emulator_57jCSg82WF.png b/docs/screenshot/Emulator_57jCSg82WF.png new file mode 100644 index 0000000..a5fb702 Binary files /dev/null and b/docs/screenshot/Emulator_57jCSg82WF.png differ diff --git a/entry/src/main/ets/pages/SplashPage.ets b/entry/src/main/ets/pages/SplashPage.ets index d5010c2..6c8b98c 100644 --- a/entry/src/main/ets/pages/SplashPage.ets +++ b/entry/src/main/ets/pages/SplashPage.ets @@ -6,14 +6,21 @@ import { RouteName, BridgeGameParams } from '../routes/AppRoutes'; * 启动引导页(对应 weclomeactivity1,框架 §4/§8.1)。 * 进入即跑 StartupOrchestrator(本地配置→远程配置→资源准备→app_data 注入), * 完成后 replace 进大厅容器;被 showmessage 阻断时弹公告。 + * + * 闪屏底图 launch_image 为**白底 + 金色 logo**,故覆盖层文字用深色(navy), + * 进度条用品牌金色,且明确展示当前阶段中文文案(获取配置/检测升级/下载等)。 */ @Component export struct SplashPage { pathStack: NavPathStack = new NavPathStack(); - @State private stageText: string = '正在启动…'; + @State private stage: StartupStage = StartupStage.INIT; @State private percent: number = 0; @State private blocked: string = ''; + // 品牌色(取自 logo):navy 文字 + 金色进度 + private static readonly NAVY: string = '#1B2A4A'; + private static readonly GOLD: string = '#D2A312'; + aboutToAppear(): void { this.runStartup(); } @@ -21,7 +28,7 @@ export struct SplashPage { private async runStartup(): Promise { const ctx: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; const orchestrator = new StartupOrchestrator(ctx, (stage: StartupStage, percent: number) => { - this.stageText = stage; + this.stage = stage; this.percent = percent; }); try { @@ -38,37 +45,70 @@ export struct SplashPage { } } + /** 阶段 → 用户可读中文文案(PREPARE_RESOURCE 按进度区分"准备资源/下载更新")。 */ + private stageLabel(): string { + switch (this.stage) { + case StartupStage.INIT: + return '正在启动…'; + case StartupStage.LOAD_LOCAL_CONFIG: + return '读取本地配置…'; + case StartupStage.REQUEST_PERMISSIONS: + return '检测网络权限…'; + case StartupStage.FETCH_REMOTE_CONFIG: + return '获取配置文件…'; + case StartupStage.RESOLVE_VERSION: + return '检测升级版本…'; + case StartupStage.PREPARE_RESOURCE: + // 35% 为内置资源准备;55%~85% 为远程 zip 下载 + return this.percent >= 55 ? '正在下载更新…' : '准备游戏资源…'; + case StartupStage.INJECT_APP_DATA: + return '即将进入大厅…'; + case StartupStage.ENTER_HALL: + return '进入大厅'; + default: + return '正在启动…'; + } + } + build() { NavDestination() { Stack() { - // 启动闪屏全屏背景(docs/Res/LaunchImage,横屏 2436x1125) + // 启动闪屏全屏背景(白底 + 金色 logo,docs/Res/LaunchImage) Image($r('app.media.launch_image')) .width('100%') .height('100%') .objectFit(ImageFit.Cover) - // 启动进度/公告叠加在底部 - Column({ space: 12 }) { + // 启动进度/公告叠加在底部(深色文字,白底可见) + Column({ space: 14 }) { if (this.blocked === '') { - Text(`${this.stageText} ${this.percent}%`) - .fontSize(14) - .fontColor(Color.White) + Row({ space: 8 }) { + LoadingProgress() + .width(20) + .height(20) + .color(SplashPage.GOLD) + Text(`${this.stageLabel()} ${this.percent}%`) + .fontSize(15) + .fontColor(SplashPage.NAVY) + } Progress({ value: this.percent, total: 100, type: ProgressType.Linear }) - .width('60%') + .width('56%') + .color(SplashPage.GOLD) + .backgroundColor('#E6E6E6') } else { Text(this.blocked) .fontSize(16) - .fontColor(Color.White) + .fontColor(SplashPage.NAVY) .textAlign(TextAlign.Center) - .backgroundColor('rgba(0,0,0,0.5)') + .backgroundColor('rgba(255,255,255,0.9)') .borderRadius(8) - .padding(12) + .padding(14) .margin({ left: 24, right: 24 }) } } .width('100%') .height('100%') .justifyContent(FlexAlign.End) - .padding({ bottom: 60 }) + .padding({ bottom: 56 }) } .width('100%') .height('100%') diff --git a/entry/src/main/resources/base/media/startIcon.png b/entry/src/main/resources/base/media/startIcon.png index 205ad8b..cec644b 100644 Binary files a/entry/src/main/resources/base/media/startIcon.png and b/entry/src/main/resources/base/media/startIcon.png differ