feat: 完善挑战结算页面

This commit is contained in:
richarjiang
2026-05-10 15:10:57 +08:00
parent 110038ceea
commit b68e32ddce
14 changed files with 4502 additions and 12 deletions

View File

@@ -1679,6 +1679,11 @@ export class PageLevel extends BaseView {
// 不论是否有谐音梗,都停留固定时间再弹出通关弹窗,保证节奏一致
await this.delay(PageLevel.PASS_MODAL_DELAY_MS);
if (this._isFinalShareLevel()) {
this._showShareEndPage();
return;
}
// 显示通关弹窗
this._showPassModal();
}
@@ -2016,8 +2021,7 @@ export class PageLevel extends BaseView {
if (this._shareLevelIndex >= totalLevels) {
console.log('[PageLevel] 分享关卡全部完成');
this.stopCountdown();
ShareManager.instance.clearShareMode();
ViewManager.instance.replace('PageHome');
this._showShareEndPage();
return;
}
@@ -2042,4 +2046,19 @@ export class PageLevel extends BaseView {
await this._enterAndInitLevel();
console.log(`[PageLevel] 进入关卡 第${this._currentLevelNumber}`);
}
private _isFinalShareLevel(): boolean {
if (!this._isShareMode) {
return false;
}
const totalLevels = ShareManager.instance.getShareLevelCount();
return totalLevels > 0 && this._shareLevelIndex >= totalLevels - 1;
}
private _showShareEndPage(): void {
console.log('[PageLevel] 分享关卡全部完成,进入 PK 结算页');
this.stopCountdown();
ViewManager.instance.replace('PagePKEnd');
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "4fc485cf-8c22-47f2-80d0-ae366a380cb6",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "PagePKEnd"
}
}

View File

@@ -0,0 +1,55 @@
import { _decorator, Button, Node } from 'cc';
import { BaseView } from 'db://assets/scripts/core/BaseView';
import { ViewManager } from 'db://assets/scripts/core/ViewManager';
import { ShareManager } from 'db://assets/scripts/utils/ShareManager';
const { ccclass, property } = _decorator;
@ccclass('PagePKEnd')
export class PagePKEnd extends BaseView {
@property({ type: Node, tooltip: '返回首页按钮' })
settingButton: Node | null = null;
onViewLoad(): void {
this._resolveNodes();
this._bindEvents();
}
onViewShow(): void {
console.log('[PagePKEnd] onViewShow');
}
onViewDestroy(): void {
this._unbindEvents();
}
private _resolveNodes(): void {
if (!this.settingButton || !this.settingButton.isValid) {
this.settingButton = this.node.getChildByName('SettingButton');
}
if (!this.settingButton) {
console.warn('[PagePKEnd] 未找到 SettingButton 节点');
}
}
private _bindEvents(): void {
const button = this.settingButton?.getComponent(Button);
if (!button) {
console.warn('[PagePKEnd] SettingButton 缺少 Button 组件');
return;
}
this.settingButton?.on(Button.EventType.CLICK, this._onHomeClick, this);
}
private _unbindEvents(): void {
if (this.settingButton && this.settingButton.isValid) {
this.settingButton.off(Button.EventType.CLICK, this._onHomeClick, this);
}
}
private _onHomeClick(): void {
ShareManager.instance.clearShareMode();
ViewManager.instance.replace('PageHome');
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "d1c89ad0-ffa9-4d7b-9fac-e27d810495b4",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -29,22 +29,25 @@
},
{
"__id__": 106
},
{
"__id__": 154
}
],
"_active": true,
"_components": [
{
"__id__": 154
"__id__": 164
},
{
"__id__": 156
"__id__": 166
},
{
"__id__": 158
"__id__": 168
}
],
"_prefab": {
"__id__": 160
"__id__": 170
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -931,7 +934,7 @@
"__uuid__": "5b988a03-f6a3-498f-b68d-d3b5786b1879@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
@@ -1215,7 +1218,7 @@
"_isSystemFontUsed": false,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
@@ -3687,6 +3690,240 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "SettingButton",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 155
},
{
"__id__": 157
},
{
"__id__": 159
},
{
"__id__": 161
}
],
"_prefab": {
"__id__": 163
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -408.431,
"y": 931.196,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 154
},
"_enabled": true,
"__prefab": {
"__id__": 156
},
"_contentSize": {
"__type__": "cc.Size",
"width": 115,
"height": 123
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "bauGrsRWBLN77Asy0qAUp1"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 154
},
"_enabled": true,
"__prefab": {
"__id__": 158
},
"clickEvents": [],
"_interactable": true,
"_transition": 0,
"_normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_hoverColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_pressedColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_normalSprite": null,
"_hoverSprite": null,
"_pressedSprite": null,
"_disabledSprite": null,
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "a4lbn1xrJDBrQ6quo7efQ4"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 154
},
"_enabled": true,
"__prefab": {
"__id__": 160
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7a8edfce-b0ad-41b3-8dc9-ec1c1ee22153@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "178d/akXNFo4OBQH4W6IkK"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 154
},
"_enabled": true,
"__prefab": {
"__id__": 162
},
"_alignFlags": 9,
"_target": null,
"_left": 74.06900000000002,
"_right": 0,
"_top": 87.30399999999997,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6d0LQxInlLpbiQGO3LEpD4"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "d0Wnpx7CpNeqaNIu0J1DFB",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -3697,7 +3934,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 155
"__id__": 165
},
"_contentSize": {
"__type__": "cc.Size",
@@ -3725,7 +3962,7 @@
},
"_enabled": false,
"__prefab": {
"__id__": 157
"__id__": 167
},
"_alignFlags": 45,
"_target": null,
@@ -3761,7 +3998,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 159
"__id__": 169
},
"animationNodes": [
{