perf: 完善 UI

This commit is contained in:
richarjiang
2026-05-06 11:58:57 +08:00
parent b288c0bc8f
commit 168288f6ae
9 changed files with 1921 additions and 560 deletions

View File

@@ -35,7 +35,7 @@ export class PageLevel extends BaseView {
/** 默认体力上限,服务端未返回 max 时使用 */
private static readonly DEFAULT_STAMINA_MAX = 50;
/** 答案正确后展示包袱答案的停留时间 */
/** 答案正确后到弹出通关弹窗之间的停留时间(不论是否有谐音梗都保持一致) */
private static readonly PASS_MODAL_DELAY_MS = 2000;
/** 图片2描述默认文案 */
@@ -769,10 +769,24 @@ export class PageLevel extends BaseView {
* 点击解锁线索顺序解锁先线索2再线索3全部解锁后切换为查看答案入口
*/
private onUnlockClue(): void {
// 全部已解锁后,按钮保留为"查看答案",后续弹窗逻辑在这里接入
// 全部已解锁后,点击"查看答案":自动填入正确答案并走通关流程
if (this._nextClueIndex > 3) {
if (this._isTransitioning) return;
const answer = this._currentConfig?.answer;
if (!answer) {
ToastManager.show('答案暂未配置');
return;
}
this.playClickSound();
console.log('[PageLevel] 点击查看答案,后续弹窗逻辑待接入');
console.log('[PageLevel] 点击查看答案,自动填充答案并触发通关流程');
// 填充答案到输入格distributeInputText 内部会用 _isSyncingInputText 阻止 EditBox 事件回调)
this.distributeInputText(answer);
// 走提交流程(答案命中 → showSuccess → 通关弹窗)
this.onSubmitAnswer();
return;
}
@@ -1234,9 +1248,9 @@ export class PageLevel extends BaseView {
const timeSpent = Math.max(0, Math.round((Date.now() - this._levelStartTime) / 1000));
this.reportLevelCompleted(levelId, timeSpent);
if (punchline) {
await this.delay(PageLevel.PASS_MODAL_DELAY_MS);
}
// 不论是否有谐音梗,都停留固定时间再弹出通关弹窗,保证节奏一致
await this.delay(PageLevel.PASS_MODAL_DELAY_MS);
// 显示通关弹窗
this._showPassModal();