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

@@ -52,17 +52,17 @@
"_active": true,
"_components": [
{
"__id__": 246
"__id__": 258
},
{
"__id__": 248
"__id__": 260
},
{
"__id__": 250
"__id__": 262
}
],
"_prefab": {
"__id__": 252
"__id__": 264
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -5057,19 +5057,22 @@
},
{
"__id__": 229
},
{
"__id__": 241
}
],
"_active": true,
"_components": [
{
"__id__": 241
"__id__": 253
},
{
"__id__": 243
"__id__": 255
}
],
"_prefab": {
"__id__": 245
"__id__": 257
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -5868,6 +5871,282 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "MileStone",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 208
},
"_children": [
{
"__id__": 242
}
],
"_active": true,
"_components": [
{
"__id__": 248
},
{
"__id__": 250
}
],
"_prefab": {
"__id__": 252
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 455.467,
"y": 4.346,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 0.25,
"y": 0.25,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "IconMileStone",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 241
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 243
},
{
"__id__": 245
}
],
"_prefab": {
"__id__": 247
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -2.024,
"y": -9.576,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 0.8,
"y": 0.8,
"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__": 242
},
"_enabled": true,
"__prefab": {
"__id__": 244
},
"_contentSize": {
"__type__": "cc.Size",
"width": 392,
"height": 380
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "bcQjzG0s9Ob4XaSq6xDWFX"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 242
},
"_enabled": true,
"__prefab": {
"__id__": 246
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "447f92b8-70aa-462a-8caa-b91321c8995b@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": "60d6pHtMNDUqKFQWVz7mBF"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "33Umm9BjVJz4bLO/ZtY6dM",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 241
},
"_enabled": true,
"__prefab": {
"__id__": 249
},
"_contentSize": {
"__type__": "cc.Size",
"width": 416,
"height": 416
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "bdv/P/CP1O95HsemlJPz71"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 241
},
"_enabled": true,
"__prefab": {
"__id__": 251
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 186,
"g": 255,
"b": 177,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7a17df33-9d28-4272-9f3e-f336af8d4afb@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": "041llJlEtAUJB3RW6WtAgE"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "bcSVywsB5LoK44DA0vzk/F",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -5878,7 +6157,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 242
"__id__": 254
},
"_contentSize": {
"__type__": "cc.Size",
@@ -5906,7 +6185,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 244
"__id__": 256
},
"_alignFlags": 4,
"_target": null,
@@ -5955,7 +6234,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 247
"__id__": 259
},
"_contentSize": {
"__type__": "cc.Size",
@@ -5983,7 +6262,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 249
"__id__": 261
},
"_alignFlags": 45,
"_target": null,
@@ -6019,7 +6298,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 251
"__id__": 263
},
"startGameBtn": {
"__id__": 81

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();

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "447f92b8-70aa-462a-8caa-b91321c8995b",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "447f92b8-70aa-462a-8caa-b91321c8995b@6c48a",
"displayName": "IconMileStone",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "447f92b8-70aa-462a-8caa-b91321c8995b",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "447f92b8-70aa-462a-8caa-b91321c8995b@f9941",
"displayName": "IconMileStone",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 54,
"trimY": 60,
"width": 392,
"height": 380,
"rawWidth": 500,
"rawHeight": 500,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-196,
-190,
0,
196,
-190,
0,
-196,
190,
0,
196,
190,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
54,
440,
446,
440,
54,
60,
446,
60
],
"nuv": [
0.108,
0.12,
0.892,
0.12,
0.108,
0.88,
0.892,
0.88
],
"minPos": [
-196,
-190,
0
],
"maxPos": [
196,
190,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "447f92b8-70aa-462a-8caa-b91321c8995b@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"fixAlphaTransparencyArtifacts": false,
"hasAlpha": true,
"redirect": "447f92b8-70aa-462a-8caa-b91321c8995b@6c48a"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "270ea403-0905-4f0e-bf85-811d26bf0f75",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "270ea403-0905-4f0e-bf85-811d26bf0f75@6c48a",
"displayName": "ChallengeInfoBanner",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "270ea403-0905-4f0e-bf85-811d26bf0f75",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "270ea403-0905-4f0e-bf85-811d26bf0f75@f9941",
"displayName": "ChallengeInfoBanner",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 845,
"height": 140,
"rawWidth": 845,
"rawHeight": 140,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-422.5,
-70,
0,
422.5,
-70,
0,
-422.5,
70,
0,
422.5,
70,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
140,
845,
140,
0,
0,
845,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-422.5,
-70,
0
],
"maxPos": [
422.5,
70,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "270ea403-0905-4f0e-bf85-811d26bf0f75@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"fixAlphaTransparencyArtifacts": false,
"hasAlpha": true,
"redirect": "270ea403-0905-4f0e-bf85-811d26bf0f75@6c48a"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "85e493f5-2715-47af-a44c-2431b9e229de",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "85e493f5-2715-47af-a44c-2431b9e229de@6c48a",
"displayName": "ChallengeInfoBannerGreen",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "85e493f5-2715-47af-a44c-2431b9e229de",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "85e493f5-2715-47af-a44c-2431b9e229de@f9941",
"displayName": "ChallengeInfoBannerGreen",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 845,
"height": 140,
"rawWidth": 845,
"rawHeight": 140,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-422.5,
-70,
0,
422.5,
-70,
0,
-422.5,
70,
0,
422.5,
70,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
140,
845,
140,
0,
0,
845,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-422.5,
-70,
0
],
"maxPos": [
422.5,
70,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "85e493f5-2715-47af-a44c-2431b9e229de@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"fixAlphaTransparencyArtifacts": false,
"hasAlpha": true,
"redirect": "85e493f5-2715-47af-a44c-2431b9e229de@6c48a"
}
}