feat: 支持加载进度提示和 API 重试机制
- 添加 ProgressTips 节点到 PageLoading 展示加载状态消息 - 连接 statusLabel 到 ProgressTips 组件 - LevelDataManager 添加 API 请求重试机制(重试 2 次) - 优化进度消息:正在请求服务端数据、正在加载游戏必备资源等 - 初始化失败时显示"网络异常,请重新打开游戏" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,15 +29,20 @@ export class PageLoading extends Component {
|
||||
}
|
||||
|
||||
// 阶段1: 初始化 LevelDataManager (0-80%)
|
||||
await LevelDataManager.instance.initialize((progress, message) => {
|
||||
const success = await LevelDataManager.instance.initialize((progress, message) => {
|
||||
this._updateProgress(progress);
|
||||
this._updateStatusLabel(message);
|
||||
});
|
||||
|
||||
if (!success) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 阶段2: 预加载 PageHome (80-100%)
|
||||
ViewManager.instance.preload('PageHome',
|
||||
(progress) => {
|
||||
this._updateProgress(0.8 + progress * 0.2);
|
||||
this._updateStatusLabel('正在加载界面资源...');
|
||||
},
|
||||
() => {
|
||||
this._onPreloadComplete();
|
||||
|
||||
Reference in New Issue
Block a user