M0: App 入口与路由壳(T-M0-07)

框架 §4 路由骨架,Navigation + NavPathStack:
- AppRoutes:路由名(Splash/BridgeGame/GenericWeb)、容器参数类型、前后台事件名
- Index:@Entry 导航宿主,初始进 Splash,navDestination 按名分发
- SplashPage:启动引导壳(weclomeactivity1),replacePathByName 进大厅
- BridgeGameContainer:大厅容器壳(webviewActivity),pushPathByName+onPop 演示
  打开通用网页并接收 101 回传
- GenericWebContainer:通用网页容器壳(openwebActivity1),pop(result) 模拟
  backgameData 带数据返回(§11.2 结果码 101 语义)
- EntryAbility:onForeground/onBackground 经 EventBus 广播应用前后台事件
  (M3 容器订阅后 callHandler('appservice','1'/'2'))
- build 编译通过

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
lanterngamescn
2026-06-25 07:44:57 +08:00
co-authored by Claude Opus 4.8
parent f89275ea4b
commit 7fb0c194f7
6 changed files with 191 additions and 18 deletions
+34
View File
@@ -0,0 +1,34 @@
import { RouteName, BridgeGameParams } from '../routes/AppRoutes';
/**
* 启动引导页壳(对应 weclomeactivity1)。
* M0:仅路由壳,点击进入大厅容器。M2:接入 StartupOrchestrator(配置/资源/app_data 注入)后再跳。
*/
@Component
export struct SplashPage {
pathStack: NavPathStack = new NavPathStack();
private enterHall(): void {
const params: BridgeGameParams = { entryUrl: '', launchType: '0' };
this.pathStack.replacePathByName(RouteName.BRIDGE_GAME, params, false);
}
build() {
NavDestination() {
Column({ space: 16 }) {
Text('TSGame 启动引导')
.fontSize(22)
.fontWeight(FontWeight.Bold)
Text('M0 脚手架 · 路由壳')
.fontSize(14)
.fontColor(Color.Gray)
Button('进入大厅')
.onClick(() => this.enterHall())
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
}
.hideTitleBar(true)
}
}