Files
汉秋 258c438f9a 优化冷启动流程:Launch Screen 对齐 Splash,仅阻塞 rolePermissions。
移除 SplashCoordinator,bootstrap 期间用 SplashView 覆盖避免空白闪屏,其余账号数据改为后台补充刷新。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 09:56:49 +08:00

38 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Splash 模块业务逻辑
## 模块职责
Splash 模块负责冷启动品牌展示,与系统 Launch Screen 保持相同视觉,并在 bootstrap 完成前避免空白页或登录页闪屏。
冷启动恢复登录态由 `SessionBootstrapper` 负责;`SplashView` 仅覆盖 bootstrap 阻塞阶段,不做固定时长品牌停留。
## 核心对象
- `SplashView`:冷启动 bootstrap 期间展示的品牌页,与 Launch Screen 布局一致。
- `SplashTypography`:启动页标题/副标题字号与 UIKit 字体,供 `SplashView``Launch Screen.storyboard` 对齐。
- `SplashLogo` / `LaunchBackground`:启动页图片与背景色资源。
- `SessionBootstrapper`:冷启动恢复登录态,阻塞等待 `rolePermissions`,其余数据后台刷新。
- `AccountContextLoader.restorePermissions` / `refreshSupplementalContext`:拆分阻塞阶段与后台补充阶段。
## 展示规则
- 系统 Launch Screen白底、180×180 Logo、「随心瞰 / 商家版」文案。
- 应用内 `SplashView`bootstrap 完成前覆盖根视图,避免 `.restoring` 空白或登录页闪现。
- bootstrap 结束后淡出 Splash进入 `LoginView``MainTabsView`
- 无固定最短展示时长。
## 启动时序
1. iOS 系统 Launch Screen 展示品牌页。
2. `RootView` 挂载后立即显示 `SplashView` 覆盖层。
3. `SessionBootstrapper.restore` 并行恢复登录态。
4. 无 tokenbootstrap 完成后进入 `LoginView`
5. 有 token恢复 `AccountSnapshot` → 阻塞请求 `rolePermissions``markLoggedIn` → 进入 `MainTabsView`
6. `userInfo``scenicListAll``storeAll` 在后台补充刷新,不阻塞首屏。
7. 冷启动期间不显示 Lottie 全局 Loading。
## 与 Android 的差异
- Android 首启隐私弹窗在 Splash 上iOS 仍在登录页勾选协议。
- Android 系统 Launch Screen 与应用内 Splash 使用同一 XMLiOS 系统 Launch Screen 与应用内 `SplashView` 保持相同布局,但应用内 Splash 仅在 bootstrap 期间展示。