diff --git a/assets/prefabs/PageHome.ts b/assets/prefabs/PageHome.ts index 8f89230..5df4ec1 100644 --- a/assets/prefabs/PageHome.ts +++ b/assets/prefabs/PageHome.ts @@ -131,7 +131,7 @@ export class PageHome extends BaseView { */ private _onPkClick(): void { console.log('[PageHome] PK按钮点击'); - ToastManager.show('功能正在开发中,敬请期待吧!'); + ViewManager.instance.open('PageWriteLevels'); } // ========== 体力消耗动画 ========== diff --git a/assets/prefabs/PagePreviewLevels.prefab b/assets/prefabs/PagePreviewLevels.prefab index 1bdba4d..ccc987f 100644 --- a/assets/prefabs/PagePreviewLevels.prefab +++ b/assets/prefabs/PagePreviewLevels.prefab @@ -25,29 +25,26 @@ "__id__": 10 }, { - "__id__": 20 + "__id__": 22 }, { - "__id__": 28 + "__id__": 58 }, { - "__id__": 64 - }, - { - "__id__": 96 + "__id__": 122 } ], "_active": true, "_components": [ { - "__id__": 110 + "__id__": 136 }, { - "__id__": 112 + "__id__": 138 } ], "_prefab": { - "__id__": 114 + "__id__": 140 }, "_lpos": { "__type__": "cc.Vec3", @@ -182,7 +179,7 @@ "a": 255 }, "_spriteFrame": { - "__uuid__": "d532045e-55f8-47c2-9493-b918e18364b0@f9941", + "__uuid__": "e9f94fb0-2acf-4004-8c6e-023e9deeb9cb@f9941", "__expectedType__": "cc.SpriteFrame" }, "_type": 0, @@ -237,35 +234,83 @@ }, { "__type__": "cc.Node", - "_name": "IconBack", + "_name": "Banner2", "_objFlags": 0, "__editorExtras__": {}, "_parent": { "__id__": 1 }, + "_children": [ + { + "__id__": 11 + } + ], + "_active": true, + "_components": [ + { + "__id__": 17 + }, + { + "__id__": 19 + } + ], + "_prefab": { + "__id__": 21 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 888.121, + "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.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 10 + }, "_children": [], "_active": true, "_components": [ { - "__id__": 11 + "__id__": 12 }, { - "__id__": 13 - }, - { - "__id__": 15 - }, - { - "__id__": 17 + "__id__": 14 } ], "_prefab": { - "__id__": 19 + "__id__": 16 }, "_lpos": { "__type__": "cc.Vec3", - "x": -410.938, - "y": 942.514, + "x": 0, + "y": 14.155, "z": 0 }, "_lrot": { @@ -297,16 +342,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 10 + "__id__": 11 }, "_enabled": true, "__prefab": { - "__id__": 12 + "__id__": 13 }, "_contentSize": { "__type__": "cc.Size", - "width": 108, - "height": 108 + "width": 428, + "height": 96.2 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -317,7 +362,119 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "74C+oVkAVF+qP0KmO0vO9s" + "fileId": "69Xrzyd1xP0I0ZVFrJz9bV" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 11 + }, + "_enabled": true, + "__prefab": { + "__id__": 15 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "挑战名称预览", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 70, + "_fontSize": 70, + "_fontFamily": "Arial", + "_lineHeight": 70, + "_overflow": 0, + "_enableWrapText": true, + "_font": { + "__uuid__": "fb4acba6-6bc7-4eb3-be34-8f2ac9823a80", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": true, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_enableOutline": true, + "_outlineColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_outlineWidth": 4, + "_enableShadow": false, + "_shadowColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_shadowOffset": { + "__type__": "cc.Vec2", + "x": 2, + "y": 2 + }, + "_shadowBlur": 2, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b5sIloC6RJbLTSXpbd8T+9" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "53eWdv3gxMP45frDFDUsL9", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 10 + }, + "_enabled": true, + "__prefab": { + "__id__": 18 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 828, + "height": 156 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7cjg4agHNP464YO2RB5Ad0" }, { "__type__": "cc.Sprite", @@ -329,7 +486,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 14 + "__id__": 20 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -342,7 +499,7 @@ "a": 255 }, "_spriteFrame": { - "__uuid__": "9c27734d-854f-476b-961d-d1b92c75f8c0@f9941", + "__uuid__": "fca884ba-b748-4630-886d-cfebff286af8@f9941", "__expectedType__": "cc.SpriteFrame" }, "_type": 0, @@ -362,99 +519,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "50F2n9/idMcb4kNVxsjCrO" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 10 - }, - "_enabled": true, - "__prefab": { - "__id__": 16 - }, - "_alignFlags": 9, - "_target": null, - "_left": -414.938, - "_right": 0, - "_top": -946.514, - "_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": "aeoBSE1olAMZgVzcdHBpmS" - }, - { - "__type__": "cc.Button", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 10 - }, - "_enabled": true, - "__prefab": { - "__id__": 18 - }, - "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": "82tUBmfqVOgJCAwJwK5EDe" + "fileId": "cbGlnCwdFBx7GXktJ6ArgI" }, { "__type__": "cc.PrefabInfo", @@ -464,205 +529,7 @@ "asset": { "__id__": 0 }, - "fileId": "ac1NMltcFCHYLwVCCxc8qC", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "PKTitle", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 21 - }, - { - "__id__": 23 - }, - { - "__id__": 25 - } - ], - "_prefab": { - "__id__": 27 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": 926.043, - "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__": 20 - }, - "_enabled": true, - "__prefab": { - "__id__": 22 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 120, - "height": 75.6 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "c5ghOAcp1ECbkMMsrPPkVp" - }, - { - "__type__": "cc.Label", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 20 - }, - "_enabled": true, - "__prefab": { - "__id__": 24 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 2, - "g": 0, - "b": 0, - "a": 255 - }, - "_string": "挑战", - "_horizontalAlign": 1, - "_verticalAlign": 1, - "_actualFontSize": 60, - "_fontSize": 60, - "_fontFamily": "Arial", - "_lineHeight": 60, - "_overflow": 0, - "_enableWrapText": true, - "_font": null, - "_isSystemFontUsed": true, - "_spacingX": 0, - "_isItalic": false, - "_isBold": false, - "_isUnderline": false, - "_underlineHeight": 2, - "_cacheMode": 0, - "_enableOutline": false, - "_outlineColor": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_outlineWidth": 2, - "_enableShadow": false, - "_shadowColor": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_shadowOffset": { - "__type__": "cc.Vec2", - "x": 2, - "y": 2 - }, - "_shadowBlur": 2, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "0eoveggdVC3ZCwVHz5eWft" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 20 - }, - "_enabled": true, - "__prefab": { - "__id__": 26 - }, - "_alignFlags": 0, - "_target": null, - "_left": 0, - "_right": 0, - "_top": 0, - "_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": "4c978YnaJIVILderK2iuF+" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "10pKg+ShxGcaRs2ZOkD8zw", + "fileId": "5epXQM8xVARoH0irfIQ3w1", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -677,26 +544,26 @@ }, "_children": [ { - "__id__": 29 + "__id__": 23 }, { - "__id__": 47 + "__id__": 41 } ], "_active": true, "_components": [ { - "__id__": 59 + "__id__": 53 }, { - "__id__": 61 + "__id__": 55 }, { - "__id__": 44 + "__id__": 38 } ], "_prefab": { - "__id__": 63 + "__id__": 57 }, "_lpos": { "__type__": "cc.Vec3", @@ -733,30 +600,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 28 + "__id__": 22 }, "_children": [ { - "__id__": 30 + "__id__": 24 } ], "_active": true, "_components": [ + { + "__id__": 30 + }, + { + "__id__": 32 + }, + { + "__id__": 34 + }, { "__id__": 36 - }, - { - "__id__": 38 - }, - { - "__id__": 40 - }, - { - "__id__": 42 } ], "_prefab": { - "__id__": 58 + "__id__": 52 }, "_lpos": { "__type__": "cc.Vec3", @@ -793,20 +660,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 29 + "__id__": 23 }, "_children": [], "_active": true, "_components": [ { - "__id__": 31 + "__id__": 25 }, { - "__id__": 33 + "__id__": 27 } ], "_prefab": { - "__id__": 35 + "__id__": 29 }, "_lpos": { "__type__": "cc.Vec3", @@ -843,11 +710,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 30 + "__id__": 24 }, "_enabled": true, "__prefab": { - "__id__": 32 + "__id__": 26 }, "_contentSize": { "__type__": "cc.Size", @@ -871,11 +738,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 30 + "__id__": 24 }, "_enabled": true, "__prefab": { - "__id__": 34 + "__id__": 28 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -929,11 +796,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 29 + "__id__": 23 }, "_enabled": true, "__prefab": { - "__id__": 37 + "__id__": 31 }, "_contentSize": { "__type__": "cc.Size", @@ -957,11 +824,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 29 + "__id__": 23 }, "_enabled": true, "__prefab": { - "__id__": 39 + "__id__": 33 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1002,11 +869,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 29 + "__id__": 23 }, "_enabled": true, "__prefab": { - "__id__": 41 + "__id__": 35 }, "_alignFlags": 37, "_target": null, @@ -1038,17 +905,17 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 29 + "__id__": 23 }, "_enabled": true, "__prefab": { - "__id__": 43 + "__id__": 37 }, "_scrollView": { - "__id__": 44 + "__id__": 38 }, "_handle": { - "__id__": 33 + "__id__": 27 }, "_direction": 1, "_enableAutoHide": false, @@ -1065,11 +932,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 28 + "__id__": 22 }, "_enabled": true, "__prefab": { - "__id__": 45 + "__id__": 39 }, "bounceDuration": 0.23, "brake": 0.75, @@ -1080,11 +947,11 @@ "cancelInnerEvents": true, "scrollEvents": [], "_content": { - "__id__": 46 + "__id__": 40 }, "_horizontalScrollBar": null, "_verticalScrollBar": { - "__id__": 42 + "__id__": 36 }, "_id": "" }, @@ -1098,17 +965,17 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 47 + "__id__": 41 }, "_children": [], "_active": true, "_components": [ { - "__id__": 55 + "__id__": 49 } ], "_prefab": { - "__id__": 57 + "__id__": 51 }, "_lpos": { "__type__": "cc.Vec3", @@ -1145,27 +1012,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 28 + "__id__": 22 }, "_children": [ { - "__id__": 46 + "__id__": 40 } ], "_active": true, "_components": [ { - "__id__": 48 + "__id__": 42 }, { - "__id__": 50 + "__id__": 44 }, { - "__id__": 52 + "__id__": 46 } ], "_prefab": { - "__id__": 54 + "__id__": 48 }, "_lpos": { "__type__": "cc.Vec3", @@ -1202,11 +1069,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 47 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 49 + "__id__": 43 }, "_contentSize": { "__type__": "cc.Size", @@ -1230,11 +1097,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 47 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 51 + "__id__": 45 }, "_type": 0, "_inverted": false, @@ -1252,11 +1119,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 47 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 53 + "__id__": 47 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1311,11 +1178,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 46 + "__id__": 40 }, "_enabled": true, "__prefab": { - "__id__": 56 + "__id__": 50 }, "_contentSize": { "__type__": "cc.Size", @@ -1365,11 +1232,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 28 + "__id__": 22 }, "_enabled": true, "__prefab": { - "__id__": 60 + "__id__": 54 }, "_contentSize": { "__type__": "cc.Size", @@ -1393,11 +1260,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 28 + "__id__": 22 }, "_enabled": false, "__prefab": { - "__id__": 62 + "__id__": 56 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1454,33 +1321,36 @@ "__id__": 1 }, "_children": [ + { + "__id__": 59 + }, { "__id__": 65 }, { - "__id__": 71 + "__id__": 81 }, { - "__id__": 77 - }, - { - "__id__": 83 + "__id__": 97 } ], "_active": true, "_components": [ { - "__id__": 89 + "__id__": 113 }, { - "__id__": 91 + "__id__": 115 }, { - "__id__": 93 + "__id__": 117 + }, + { + "__id__": 119 } ], "_prefab": { - "__id__": 95 + "__id__": 121 }, "_lpos": { "__type__": "cc.Vec3", @@ -1517,24 +1387,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 64 + "__id__": 58 }, "_children": [], "_active": true, "_components": [ { - "__id__": 66 + "__id__": 60 }, { - "__id__": 68 + "__id__": 62 } ], "_prefab": { - "__id__": 70 + "__id__": 64 }, "_lpos": { "__type__": "cc.Vec3", - "x": -237.601, + "x": -189.095, "y": 1.509, "z": 0 }, @@ -1567,16 +1437,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 65 + "__id__": 59 }, "_enabled": true, "__prefab": { - "__id__": 67 + "__id__": 61 }, "_contentSize": { "__type__": "cc.Size", - "width": 200, - "height": 200 + "width": 373, + "height": 217 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1595,11 +1465,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 65 + "__id__": 59 }, "_enabled": true, "__prefab": { - "__id__": 69 + "__id__": 63 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1650,25 +1520,79 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 64 + "__id__": 58 + }, + "_children": [ + { + "__id__": 66 + }, + { + "__id__": 72 + } + ], + "_active": true, + "_components": [ + { + "__id__": 78 + } + ], + "_prefab": { + "__id__": 80 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 38.01800000000003, + "y": 65.90200000000004, + "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.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 65 }, "_children": [], "_active": true, "_components": [ { - "__id__": 72 + "__id__": 67 }, { - "__id__": 74 + "__id__": 69 } ], "_prefab": { - "__id__": 76 + "__id__": 71 }, "_lpos": { "__type__": "cc.Vec3", - "x": 74.813, - "y": 74.721, + "x": 60.834, + "y": 16.807, "z": 0 }, "_lrot": { @@ -1700,11 +1624,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 71 + "__id__": 66 }, "_enabled": true, "__prefab": { - "__id__": 73 + "__id__": 68 }, "_contentSize": { "__type__": "cc.Size", @@ -1728,11 +1652,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 71 + "__id__": 66 }, "_enabled": true, "__prefab": { - "__id__": 75 + "__id__": 70 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1805,29 +1729,260 @@ }, { "__type__": "cc.Node", - "_name": "Tips2", + "_name": "icon", "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 64 + "__id__": 65 }, "_children": [], "_active": true, "_components": [ { - "__id__": 78 + "__id__": 73 }, { - "__id__": 80 + "__id__": 75 } ], "_prefab": { - "__id__": 82 + "__id__": 77 }, "_lpos": { "__type__": "cc.Vec3", - "x": 74.813, - "y": 14.526, + "x": -12.833, + "y": 19.962, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 0.14, + "y": 0.14, + "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__": 72 + }, + "_enabled": true, + "__prefab": { + "__id__": 74 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 382, + "height": 486 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "eaB9jPWlZLS6vFSLO9oMgk" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 72 + }, + "_enabled": true, + "__prefab": { + "__id__": 76 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "a428ffd4-ce8c-4682-bf0b-d127509c8f23@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": "d18N20wFREIJtbhLToU7fN" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "6a2yk9Bo1FTbXBUvRn3dsi", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 65 + }, + "_enabled": true, + "__prefab": { + "__id__": 79 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "1b/bNq9LVKhYiYK0k3ZsTC" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "c9ezSJKYlOL494HFkqJHBz", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "Tips2", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 58 + }, + "_children": [ + { + "__id__": 82 + }, + { + "__id__": 88 + } + ], + "_active": true, + "_components": [ + { + "__id__": 94 + } + ], + "_prefab": { + "__id__": 96 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 38.01800000000003, + "y": -6.817999999999984, + "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.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 81 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 83 + }, + { + "__id__": 85 + } + ], + "_prefab": { + "__id__": 87 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 60.834, + "y": 16.807, "z": 0 }, "_lrot": { @@ -1859,11 +2014,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 82 }, "_enabled": true, "__prefab": { - "__id__": 79 + "__id__": 84 }, "_contentSize": { "__type__": "cc.Size", @@ -1879,7 +2034,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "e3mvNJvTZCCJrej2KcHeIV" + "fileId": "f07FQf7Y5OLasQa4VYIr/O" }, { "__type__": "cc.Label", @@ -1887,11 +2042,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 82 }, "_enabled": true, "__prefab": { - "__id__": 81 + "__id__": 86 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1947,7 +2102,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "abugfc6ABEVafG0lUSnEyd" + "fileId": "dcd4asaQdMC7MzjYuTbhbG" }, { "__type__": "cc.PrefabInfo", @@ -1957,7 +2112,184 @@ "asset": { "__id__": 0 }, - "fileId": "73DNQUFGBAZK5N8cYRPa20", + "fileId": "07sBQShppKi5h1iwzrSDf4", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "icon", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 81 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 89 + }, + { + "__id__": 91 + } + ], + "_prefab": { + "__id__": 93 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -12.833, + "y": 19.962, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 0.14, + "y": 0.14, + "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__": 88 + }, + "_enabled": true, + "__prefab": { + "__id__": 90 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 382, + "height": 486 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d9dK6IT5dKto2yBWtMoVKl" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 88 + }, + "_enabled": true, + "__prefab": { + "__id__": 92 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "a428ffd4-ce8c-4682-bf0b-d127509c8f23@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": "70euJjcbJJmp+eKDHIqPSd" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "f0kGXQOjJF0bogEsoRvWbJ", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 81 + }, + "_enabled": true, + "__prefab": { + "__id__": 95 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "87A6OmL8RCgLsMaWxo4MWo" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "94V/P3CGtMood2wcIkRj1a", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -1968,25 +2300,215 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 64 + "__id__": 58 + }, + "_children": [ + { + "__id__": 98 + }, + { + "__id__": 104 + } + ], + "_active": true, + "_components": [ + { + "__id__": 110 + } + ], + "_prefab": { + "__id__": 112 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 27.53, + "y": -67.231, + "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.Node", + "_name": "icon", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 97 }, "_children": [], "_active": true, "_components": [ { - "__id__": 84 + "__id__": 99 }, { - "__id__": 86 + "__id__": 101 } ], "_prefab": { - "__id__": 88 + "__id__": 103 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 0.5, + "y": 0.5, + "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__": 98 + }, + "_enabled": true, + "__prefab": { + "__id__": 100 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 97, + "height": 94 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "a8B+FkY7hDzJnOOzd2OfQf" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 98 + }, + "_enabled": true, + "__prefab": { + "__id__": 102 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "46f1f9c7-6c53-47a8-9570-0098482f26ea@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": "1f8LRCmXJOwabp2hPd9K8F" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "59vbhqrsBNgLGsiBU3wteq", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 97 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 105 + }, + { + "__id__": 107 + } + ], + "_prefab": { + "__id__": 109 }, "_lpos": { "__type__": "cc.Vec3", "x": 74.813, - "y": -60.718, + "y": -2.119, "z": 0 }, "_lrot": { @@ -2018,15 +2540,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 83 + "__id__": 104 }, "_enabled": true, "__prefab": { - "__id__": 85 + "__id__": 106 }, "_contentSize": { "__type__": "cc.Size", - "width": 80, + "width": 70, "height": 50.4 }, "_anchorPoint": { @@ -2046,36 +2568,39 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 83 + "__id__": 104 }, "_enabled": true, "__prefab": { - "__id__": 87 + "__id__": 108 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 219, - "g": 133, - "b": 54, + "r": 201, + "g": 136, + "b": 0, "a": 255 }, "_string": "答案", "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 40, - "_fontSize": 40, + "_actualFontSize": 35, + "_fontSize": 35, "_fontFamily": "Arial", "_lineHeight": 40, "_overflow": 0, "_enableWrapText": false, - "_font": null, - "_isSystemFontUsed": true, + "_font": { + "__uuid__": "fb4acba6-6bc7-4eb3-be34-8f2ac9823a80", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, "_spacingX": 0, "_isItalic": false, - "_isBold": false, + "_isBold": true, "_isUnderline": false, "_underlineHeight": 2, "_cacheMode": 0, @@ -2127,11 +2652,52 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 64 + "__id__": 97 }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 111 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "74/oemj+JFnK5AzZP3maJB" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "3dwQL6NzNEBbqgWh3VdTgS", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 58 + }, + "_enabled": true, + "__prefab": { + "__id__": 114 }, "_contentSize": { "__type__": "cc.Size", @@ -2155,24 +2721,24 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 64 + "__id__": 58 }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 116 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 243, - "g": 225, - "b": 222, + "r": 255, + "g": 255, + "b": 255, "a": 255 }, "_spriteFrame": { - "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__uuid__": "5b2a42ac-89e1-4a48-a171-108e41780903@f9941", "__expectedType__": "cc.SpriteFrame" }, "_type": 0, @@ -2200,11 +2766,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 64 + "__id__": 58 }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 118 }, "clickEvents": [], "_interactable": true, @@ -2243,13 +2809,46 @@ "_disabledSprite": null, "_duration": 0.1, "_zoomScale": 1.2, - "_target": null, + "_target": { + "__id__": 58 + }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", "fileId": "00XHdx8z5Cu7Eu9UXmyV/F" }, + { + "__type__": "5fb35fspnBP/6XN9H8aLY6j", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 58 + }, + "_enabled": true, + "__prefab": { + "__id__": 120 + }, + "levelCover": { + "__id__": 62 + }, + "answerLabel": { + "__id__": 107 + }, + "tips1Label": { + "__id__": 69 + }, + "tips2Label": { + "__id__": 85 + }, + "tips3Label": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "dfV/w8V5JB84bnlSHzVpVG" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -2273,23 +2872,23 @@ }, "_children": [ { - "__id__": 97 + "__id__": 123 } ], "_active": true, "_components": [ { - "__id__": 103 + "__id__": 129 }, { - "__id__": 105 + "__id__": 131 }, { - "__id__": 107 + "__id__": 133 } ], "_prefab": { - "__id__": 109 + "__id__": 135 }, "_lpos": { "__type__": "cc.Vec3", @@ -2306,8 +2905,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, - "y": 1, + "x": 0.7, + "y": 0.7, "z": 1 }, "_mobility": 0, @@ -2326,25 +2925,25 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 96 + "__id__": 122 }, "_children": [], "_active": true, "_components": [ { - "__id__": 98 + "__id__": 124 }, { - "__id__": 100 + "__id__": 126 } ], "_prefab": { - "__id__": 102 + "__id__": 128 }, "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 0, + "y": 10.457, "z": 0 }, "_lrot": { @@ -2376,16 +2975,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 97 + "__id__": 123 }, "_enabled": true, "__prefab": { - "__id__": 99 + "__id__": 125 }, "_contentSize": { "__type__": "cc.Size", - "width": 120, - "height": 75.6 + "width": 223.27999877929688, + "height": 136 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2404,11 +3003,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 97 + "__id__": 123 }, "_enabled": true, "__prefab": { - "__id__": 101 + "__id__": 127 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2420,32 +3019,35 @@ "b": 255, "a": 255 }, - "_string": "返回", + "_string": "返 回", "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 60, - "_fontSize": 60, + "_actualFontSize": 80, + "_fontSize": 80, "_fontFamily": "Arial", - "_lineHeight": 60, + "_lineHeight": 100, "_overflow": 0, "_enableWrapText": true, - "_font": null, - "_isSystemFontUsed": true, + "_font": { + "__uuid__": "fb4acba6-6bc7-4eb3-be34-8f2ac9823a80", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, "_spacingX": 0, "_isItalic": false, - "_isBold": false, + "_isBold": true, "_isUnderline": false, "_underlineHeight": 2, "_cacheMode": 0, - "_enableOutline": false, + "_enableOutline": true, "_outlineColor": { "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, + "r": 72, + "g": 158, + "b": 35, "a": 255 }, - "_outlineWidth": 2, + "_outlineWidth": 5, "_enableShadow": false, "_shadowColor": { "__type__": "cc.Color", @@ -2485,16 +3087,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 96 + "__id__": 122 }, "_enabled": true, "__prefab": { - "__id__": 104 + "__id__": 130 }, "_contentSize": { "__type__": "cc.Size", - "width": 800, - "height": 200 + "width": 1200, + "height": 234 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2513,11 +3115,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 96 + "__id__": 122 }, "_enabled": true, "__prefab": { - "__id__": 106 + "__id__": 132 }, "clickEvents": [], "_interactable": true, @@ -2569,27 +3171,27 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 96 + "__id__": 122 }, "_enabled": true, "__prefab": { - "__id__": 108 + "__id__": 134 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 21, - "g": 228, - "b": 21, + "r": 255, + "g": 255, + "b": 255, "a": 255 }, "_spriteFrame": { - "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__uuid__": "f87d228a-c520-499a-bf3a-e66cbb6def64@f9941", "__expectedType__": "cc.SpriteFrame" }, - "_type": 0, + "_type": 1, "_fillType": 0, "_sizeMode": 0, "_fillCenter": { @@ -2631,7 +3233,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 111 + "__id__": 137 }, "_contentSize": { "__type__": "cc.Size", @@ -2659,25 +3261,25 @@ }, "_enabled": true, "__prefab": { - "__id__": 113 + "__id__": 139 }, "backBtn": { - "__id__": 10 + "__id__": 122 }, "scrollView": { - "__id__": 28 + "__id__": 22 }, "listContent": { - "__id__": 46 + "__id__": 40 }, "listTemplate": { - "__id__": 64 + "__id__": 58 }, "backButton": { - "__id__": 96 + "__id__": 122 }, "pkTitle": { - "__id__": 20 + "__id__": 11 }, "_id": "" }, diff --git a/assets/prefabs/PagePreviewLevels.ts b/assets/prefabs/PagePreviewLevels.ts index f5219b9..a2c44ca 100644 --- a/assets/prefabs/PagePreviewLevels.ts +++ b/assets/prefabs/PagePreviewLevels.ts @@ -1,29 +1,22 @@ -import { _decorator, Node, Button, Sprite, Label, ScrollView, instantiate, UITransform, Vec2 } from 'cc'; +import { _decorator, Node, Button, Label, ScrollView, instantiate, UITransform } from 'cc'; import { BaseView } from 'db://assets/scripts/core/BaseView'; import { ViewManager } from 'db://assets/scripts/core/ViewManager'; -import { LevelDataManager } from 'db://assets/scripts/utils/LevelDataManager'; +import { CompletedLevelsManager } from 'db://assets/scripts/utils/CompletedLevelsManager'; +import { PreviewLevelItem } from './PreviewLevelItem'; const { ccclass, property } = _decorator; /** * 预览试卷页面 * 垂直滚动展示用户在 PageWriteLevels 中选中的 6 个关卡 - * 每个关卡展示:封面图、提示1、提示2、答案 + * 每个关卡展示:封面图、线索1、线索2、线索3、答案 * - * prefab 节点结构(已在编辑器中搭建): + * 节点结构(仅 ScrollView 侧需要固定): * PagePreviewLevels - * ├── Bg - * ├── IconBack ← backBtn (返回按钮) - * ├── PKTitle ← 标题 "挑战" - * ├── ScrollView ← scrollView - * │ ├── scrollBar - * │ └── view - * │ └── content ← listContent - * ├── ListTpl ← listTemplate (关卡模板) - * │ ├── LevelCover ← Sprite 封面图 - * │ ├── Tips1 ← Label 提示1 - * │ ├── Tips2 ← Label 提示2 - * │ └── Answer ← Label 答案 - * └── BackButton ← backButton (底部返回按钮) + * ├── ScrollView / view / content ← listContent 容器 + * └── ListTpl ← listTemplate 模板根节点 + * (挂 PreviewLevelItem 组件,字段由编辑器拖拽绑定) + * + * item 内部节点层级/命名对本文件透明:所有引用都来自 PreviewLevelItem 的 @property。 */ /** 布局配置 — 垂直列表 */ @@ -197,44 +190,26 @@ export class PagePreviewLevels extends BaseView { * 异步加载关卡数据并填充到 item 节点 */ private async _loadLevelData(item: Node, levelIndex: number, displayIndex: number): Promise { - const config = await LevelDataManager.instance.ensureLevelReady(levelIndex); - if (!config || !item.isValid) return; + const level = CompletedLevelsManager.instance.getByIndex(levelIndex); + if (!level || !item.isValid) return; - // 填充封面图 - const levelCover = item.getChildByName('LevelCover'); - if (levelCover) { - const sprite = levelCover.getComponent(Sprite); - if (sprite && config.spriteFrame1) { - sprite.spriteFrame = config.spriteFrame1; - } + const view = item.getComponent(PreviewLevelItem); + if (!view) { + console.warn('[PagePreviewLevels] listTemplate 缺少 PreviewLevelItem 组件'); + return; } - // 填充提示1 - const tips1 = item.getChildByName('Tips1'); - if (tips1) { - const label = tips1.getComponent(Label); - if (label) { - label.string = `线索一:${config.clue1 || ''}`; - } - } + view.setTexts({ + answer: level.answer || '', + hint1: level.hint1 || '', + hint2: level.hint2 || '', + hint3: level.hint3 || '', + }); - // 填充提示2 - const tips2 = item.getChildByName('Tips2'); - if (tips2) { - const label = tips2.getComponent(Label); - if (label) { - label.string = `线索二:${config.clue2 || ''}`; - } - } - - // 填充答案 - const answer = item.getChildByName('Answer'); - if (answer) { - const label = answer.getComponent(Label); - if (label) { - label.string = `答案:${config.answer || ''}`; - } - } + // 异步加载封面图(通常已由 WriteLevels 预热到缓存) + const spriteFrame = await CompletedLevelsManager.instance.loadImage(level.image1Url); + if (!spriteFrame || !item.isValid) return; + view.setCover(spriteFrame); } // ─── 事件处理 ─────────────────────────────────────── diff --git a/assets/prefabs/PageWriteLevels.prefab b/assets/prefabs/PageWriteLevels.prefab index cd227c3..5349b23 100644 --- a/assets/prefabs/PageWriteLevels.prefab +++ b/assets/prefabs/PageWriteLevels.prefab @@ -43,23 +43,29 @@ "__id__": 92 }, { - "__id__": 118 + "__id__": 98 }, { - "__id__": 138 + "__id__": 124 + }, + { + "__id__": 144 } ], "_active": true, "_components": [ { - "__id__": 170 + "__id__": 176 }, { - "__id__": 172 + "__id__": 178 + }, + { + "__id__": 180 } ], "_prefab": { - "__id__": 174 + "__id__": 182 }, "_lpos": { "__type__": "cc.Vec3", @@ -276,8 +282,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": -410.938, - "y": 942.514, + "x": -433.514, + "y": 968.049, "z": 0 }, "_lrot": { @@ -390,9 +396,9 @@ }, "_alignFlags": 9, "_target": null, - "_left": -414.938, + "_left": 52.48599999999999, "_right": 0, - "_top": -946.514, + "_top": 57.95100000000002, "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -510,8 +516,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 362.19400000000013, - "y": 948.282, + "x": 300.236, + "y": 963.872, "z": 0 }, "_lrot": { @@ -683,8 +689,8 @@ "_alignFlags": 33, "_target": null, "_left": 0, - "_right": -464.9940000000001, - "_top": -950.682, + "_right": 86.964, + "_top": 63.728000000000065, "_bottom": 0, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -1242,6 +1248,8 @@ "__id__": 0 }, "fileId": "7aY8hVstZLtrFJP6UfYR+U", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -1598,6 +1606,8 @@ "__id__": 0 }, "fileId": "60mh4f1RpK+7jdifOU4VOs", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -1740,6 +1750,8 @@ "__id__": 0 }, "fileId": "44rSsExlBHA6Rj72Yuqo5r", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -1825,8 +1837,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": -162.429, - "y": 0, + "x": -185.254, + "y": 8.56, "z": 0 }, "_lrot": { @@ -1934,6 +1946,8 @@ "__id__": 0 }, "fileId": "55q5TMnnlFZqxLJqcZ0V+x", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -1959,8 +1973,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 81.93, - "y": 0, + "x": 59.104, + "y": 8.56, "z": 0 }, "_lrot": { @@ -2094,6 +2108,8 @@ "__id__": 0 }, "fileId": "ca4a5Mk2VHbIKZaNRrCdcO", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -2183,7 +2199,7 @@ }, "clickEvents": [], "_interactable": true, - "_transition": 3, + "_transition": 0, "_normalColor": { "__type__": "cc.Color", "r": 214, @@ -2236,45 +2252,34 @@ "__id__": 0 }, "fileId": "19QHEHZv5Eaa1z+ONURTvO", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { "__type__": "cc.Node", - "_name": "ShareTitleEditBox", + "_name": "Bg", "_objFlags": 0, "__editorExtras__": {}, "_parent": { "__id__": 1 }, - "_children": [ + "_children": [], + "_active": true, + "_components": [ { "__id__": 93 }, { - "__id__": 99 - }, - { - "__id__": 105 - } - ], - "_active": true, - "_components": [ - { - "__id__": 111 - }, - { - "__id__": 113 - }, - { - "__id__": 115 + "__id__": 95 } ], "_prefab": { - "__id__": 117 + "__id__": 97 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, + "x": -9.885999999999967, "y": -467.466, "z": 0 }, @@ -2301,26 +2306,175 @@ }, "_id": "" }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 92 + }, + "_enabled": true, + "__prefab": { + "__id__": 94 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1050, + "height": 175 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d1qshGdUFFn7tJ+0FoCJ6p" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 92 + }, + "_enabled": true, + "__prefab": { + "__id__": 96 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "57148729-c68f-4b16-ab10-d60483e80f47@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": "52EgFtMnBPFIcMOs7SLTXV" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "3fVuFdmONFhrpd+4lUOgkv", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "ShareTitleEditBox", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 99 + }, + { + "__id__": 105 + }, + { + "__id__": 111 + } + ], + "_active": true, + "_components": [ + { + "__id__": 117 + }, + { + "__id__": 119 + }, + { + "__id__": 121 + } + ], + "_prefab": { + "__id__": 123 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 6.602, + "y": -467.466, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 0.736, + "y": 0.736, + "z": 1.803 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, { "__type__": "cc.Node", "_name": "TEXT_LABEL", "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 92 + "__id__": 98 }, "_children": [], "_active": false, "_components": [ { - "__id__": 94 + "__id__": 100 }, { - "__id__": 96 + "__id__": 102 } ], "_prefab": { - "__id__": 98 + "__id__": 104 }, "_lpos": { "__type__": "cc.Vec3", @@ -2357,11 +2511,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 99 }, "_enabled": true, "__prefab": { - "__id__": 95 + "__id__": 101 }, "_contentSize": { "__type__": "cc.Size", @@ -2385,33 +2539,36 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 99 }, "_enabled": true, "__prefab": { - "__id__": 97 + "__id__": 103 }, "_customMaterial": null, "_srcBlendFactor": 2, "_dstBlendFactor": 4, "_color": { "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, + "r": 0, + "g": 0, + "b": 0, "a": 255 }, "_string": "", "_horizontalAlign": 0, "_verticalAlign": 1, - "_actualFontSize": 40, - "_fontSize": 20, + "_actualFontSize": 60, + "_fontSize": 60, "_fontFamily": "Arial", - "_lineHeight": 40, + "_lineHeight": 80, "_overflow": 1, "_enableWrapText": false, - "_font": null, - "_isSystemFontUsed": true, + "_font": { + "__uuid__": "fb4acba6-6bc7-4eb3-be34-8f2ac9823a80", + "__expectedType__": "cc.TTFFont" + }, + "_isSystemFontUsed": false, "_spacingX": 0, "_isItalic": false, "_isBold": false, @@ -2466,25 +2623,25 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 92 + "__id__": 98 }, "_children": [], "_active": true, "_components": [ { - "__id__": 100 + "__id__": 106 }, { - "__id__": 102 + "__id__": 108 } ], "_prefab": { - "__id__": 104 + "__id__": 110 }, "_lpos": { "__type__": "cc.Vec3", - "x": -478.136, - "y": 52.39, + "x": -523, + "y": 87.5, "z": 0 }, "_lrot": { @@ -2516,16 +2673,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 105 }, "_enabled": true, "__prefab": { - "__id__": 101 + "__id__": 107 }, "_contentSize": { "__type__": "cc.Size", - "width": 846.73828125, - "height": 100.8 + "width": 1048, + "height": 175 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2544,11 +2701,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 105 }, "_enabled": true, "__prefab": { - "__id__": 103 + "__id__": 109 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2618,6 +2775,8 @@ "__id__": 0 }, "fileId": "a8yF+T4QZLsaK6dvXEWzxs", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -2626,20 +2785,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 92 + "__id__": 98 }, "_children": [], "_active": true, "_components": [ { - "__id__": 106 + "__id__": 112 }, { - "__id__": 108 + "__id__": 114 } ], "_prefab": { - "__id__": 110 + "__id__": 116 }, "_lpos": { "__type__": "cc.Vec3", @@ -2676,11 +2835,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 105 + "__id__": 111 }, "_enabled": true, "__prefab": { - "__id__": 107 + "__id__": 113 }, "_contentSize": { "__type__": "cc.Size", @@ -2704,11 +2863,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 105 + "__id__": 111 }, "_enabled": true, "__prefab": { - "__id__": 109 + "__id__": 115 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2762,11 +2921,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 92 + "__id__": 98 }, "_enabled": true, "__prefab": { - "__id__": 112 + "__id__": 118 }, "_contentSize": { "__type__": "cc.Size", @@ -2784,17 +2943,52 @@ "__type__": "cc.CompPrefabInfo", "fileId": "3do0OqTrhI8Jg3C3CfuVBj" }, + { + "__type__": "cc.EditBox", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 98 + }, + "_enabled": true, + "__prefab": { + "__id__": 120 + }, + "editingDidBegan": [], + "textChanged": [], + "editingDidEnded": [], + "editingReturn": [], + "_textLabel": { + "__id__": 102 + }, + "_placeholderLabel": { + "__id__": 108 + }, + "_returnType": 0, + "_string": "", + "_tabIndex": 0, + "_backgroundImage": null, + "_inputFlag": 5, + "_inputMode": 6, + "_maxLength": 8, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "12rLABi/BCvJt4dWGYQMB4" + }, { "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 92 + "__id__": 98 }, "_enabled": true, "__prefab": { - "__id__": 114 + "__id__": 122 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2806,10 +3000,7 @@ "b": 255, "a": 255 }, - "_spriteFrame": { - "__uuid__": "57148729-c68f-4b16-ab10-d60483e80f47@f9941", - "__expectedType__": "cc.SpriteFrame" - }, + "_spriteFrame": null, "_type": 1, "_fillType": 0, "_sizeMode": 1, @@ -2827,45 +3018,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "b0hhhOxtZKEYrDNz8b/LZp" - }, - { - "__type__": "cc.EditBox", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 92 - }, - "_enabled": true, - "__prefab": { - "__id__": 116 - }, - "editingDidBegan": [], - "textChanged": [], - "editingDidEnded": [], - "editingReturn": [], - "_textLabel": { - "__id__": 96 - }, - "_placeholderLabel": { - "__id__": 102 - }, - "_returnType": 0, - "_string": "", - "_tabIndex": 0, - "_backgroundImage": { - "__uuid__": "57148729-c68f-4b16-ab10-d60483e80f47@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_inputFlag": 5, - "_inputMode": 6, - "_maxLength": 8, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "12rLABi/BCvJt4dWGYQMB4" + "fileId": "24wgn5Jk5ODZiby6t0YeND" }, { "__type__": "cc.PrefabInfo", @@ -2890,28 +3043,28 @@ }, "_children": [ { - "__id__": 119 + "__id__": 125 } ], "_active": true, "_components": [ { - "__id__": 131 + "__id__": 137 }, { - "__id__": 133 + "__id__": 139 }, { - "__id__": 135 + "__id__": 141 } ], "_prefab": { - "__id__": 137 + "__id__": 143 }, "_lpos": { "__type__": "cc.Vec3", "x": 7.846, - "y": 202.066, + "y": 354.386, "z": 0 }, "_lrot": { @@ -2943,27 +3096,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 118 + "__id__": 124 }, "_children": [ { - "__id__": 120 + "__id__": 126 } ], "_active": true, "_components": [ { - "__id__": 124 + "__id__": 130 }, { - "__id__": 126 + "__id__": 132 }, { - "__id__": 128 + "__id__": 134 } ], "_prefab": { - "__id__": 130 + "__id__": 136 }, "_lpos": { "__type__": "cc.Vec3", @@ -3000,22 +3153,22 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 119 + "__id__": 125 }, "_children": [], "_active": true, "_components": [ { - "__id__": 121 + "__id__": 127 } ], "_prefab": { - "__id__": 123 + "__id__": 129 }, "_lpos": { "__type__": "cc.Vec3", "x": -10, - "y": 649.904, + "y": 510.277, "z": 0 }, "_lrot": { @@ -3047,16 +3200,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 120 + "__id__": 126 }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 128 }, "_contentSize": { "__type__": "cc.Size", "width": 900, - "height": 1300 + "height": 1000 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -3088,16 +3241,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 125 + "__id__": 131 }, "_contentSize": { "__type__": "cc.Size", "width": 900, - "height": 1330 + "height": 1000 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -3116,11 +3269,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 127 + "__id__": 133 }, "_type": 0, "_inverted": false, @@ -3138,11 +3291,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 119 + "__id__": 125 }, "_enabled": true, "__prefab": { - "__id__": 129 + "__id__": 135 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3197,16 +3350,16 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 124 }, "_enabled": true, "__prefab": { - "__id__": 132 + "__id__": 138 }, "_contentSize": { "__type__": "cc.Size", "width": 900, - "height": 1300 + "height": 1000 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -3225,11 +3378,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 124 }, "_enabled": false, "__prefab": { - "__id__": 134 + "__id__": 140 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3270,11 +3423,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 118 + "__id__": 124 }, "_enabled": true, "__prefab": { - "__id__": 136 + "__id__": 142 }, "bounceDuration": 0.23, "brake": 0.75, @@ -3285,7 +3438,7 @@ "cancelInnerEvents": true, "scrollEvents": [], "_content": { - "__id__": 120 + "__id__": 126 }, "_horizontalScrollBar": null, "_verticalScrollBar": null, @@ -3317,35 +3470,35 @@ "__id__": 1 }, "_children": [ - { - "__id__": 139 - }, { "__id__": 145 }, { "__id__": 151 + }, + { + "__id__": 157 } ], "_active": true, "_components": [ { - "__id__": 163 + "__id__": 169 }, { - "__id__": 165 + "__id__": 171 }, { - "__id__": 167 + "__id__": 173 } ], "_prefab": { - "__id__": 169 + "__id__": 175 }, "_lpos": { "__type__": "cc.Vec3", - "x": -958.743, - "y": 579.483, + "x": -939.544, + "y": 573.083, "z": 0 }, "_lrot": { @@ -3357,9 +3510,9 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 + "x": 0.693, + "y": 0.693, + "z": 0.693 }, "_mobility": 0, "_layer": 1073741824, @@ -3377,20 +3530,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 138 + "__id__": 144 }, "_children": [], "_active": true, "_components": [ { - "__id__": 140 + "__id__": 146 }, { - "__id__": 142 + "__id__": 148 } ], "_prefab": { - "__id__": 144 + "__id__": 150 }, "_lpos": { "__type__": "cc.Vec3", @@ -3427,11 +3580,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 139 + "__id__": 145 }, "_enabled": true, "__prefab": { - "__id__": 141 + "__id__": 147 }, "_contentSize": { "__type__": "cc.Size", @@ -3455,11 +3608,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 139 + "__id__": 145 }, "_enabled": true, "__prefab": { - "__id__": 143 + "__id__": 149 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3510,20 +3663,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 138 + "__id__": 144 }, "_children": [], "_active": true, "_components": [ { - "__id__": 146 + "__id__": 152 }, { - "__id__": 148 + "__id__": 154 } ], "_prefab": { - "__id__": 150 + "__id__": 156 }, "_lpos": { "__type__": "cc.Vec3", @@ -3560,11 +3713,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 145 + "__id__": 151 }, "_enabled": true, "__prefab": { - "__id__": 147 + "__id__": 153 }, "_contentSize": { "__type__": "cc.Size", @@ -3588,11 +3741,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 145 + "__id__": 151 }, "_enabled": true, "__prefab": { - "__id__": 149 + "__id__": 155 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3672,24 +3825,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 138 + "__id__": 144 }, "_children": [ { - "__id__": 152 + "__id__": 158 } ], "_active": true, "_components": [ { - "__id__": 158 + "__id__": 164 }, { - "__id__": 160 + "__id__": 166 } ], "_prefab": { - "__id__": 162 + "__id__": 168 }, "_lpos": { "__type__": "cc.Vec3", @@ -3726,20 +3879,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 151 + "__id__": 157 }, "_children": [], "_active": true, "_components": [ { - "__id__": 153 + "__id__": 159 }, { - "__id__": 155 + "__id__": 161 } ], "_prefab": { - "__id__": 157 + "__id__": 163 }, "_lpos": { "__type__": "cc.Vec3", @@ -3776,11 +3929,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 152 + "__id__": 158 }, "_enabled": true, "__prefab": { - "__id__": 154 + "__id__": 160 }, "_contentSize": { "__type__": "cc.Size", @@ -3804,11 +3957,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 152 + "__id__": 158 }, "_enabled": true, "__prefab": { - "__id__": 156 + "__id__": 162 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3862,11 +4015,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 151 + "__id__": 157 }, "_enabled": true, "__prefab": { - "__id__": 159 + "__id__": 165 }, "_contentSize": { "__type__": "cc.Size", @@ -3890,11 +4043,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 151 + "__id__": 157 }, "_enabled": true, "__prefab": { - "__id__": 161 + "__id__": 167 }, "clickEvents": [], "_interactable": true, @@ -3937,12 +4090,12 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 151 + "__id__": 157 }, "checkEvents": [], "_isChecked": true, "_checkMark": { - "__id__": 155 + "__id__": 161 }, "_id": "" }, @@ -3969,11 +4122,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 138 + "__id__": 144 }, "_enabled": true, "__prefab": { - "__id__": 164 + "__id__": 170 }, "_contentSize": { "__type__": "cc.Size", @@ -3997,11 +4150,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 138 + "__id__": 144 }, "_enabled": true, "__prefab": { - "__id__": 166 + "__id__": 172 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4042,11 +4195,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 138 + "__id__": 144 }, "_enabled": true, "__prefab": { - "__id__": 168 + "__id__": 174 }, "clickEvents": [], "_interactable": true, @@ -4115,19 +4268,19 @@ }, "_enabled": true, "__prefab": { - "__id__": 171 + "__id__": 177 }, "backBtn": { "__id__": 10 }, "scrollView": { - "__id__": 118 + "__id__": 124 }, "listContent": { - "__id__": 120 + "__id__": 126 }, "listTemplate": { - "__id__": 138 + "__id__": 144 }, "selectedLabel": { "__id__": 37 @@ -4139,7 +4292,7 @@ "__id__": 72 }, "shareTitleEditBox": { - "__id__": 92 + "__id__": 98 }, "dataBtn": { "__id__": 20 @@ -4160,12 +4313,12 @@ }, "_enabled": true, "__prefab": { - "__id__": 173 + "__id__": 179 }, "_contentSize": { "__type__": "cc.Size", - "width": 100, - "height": 100 + "width": 1080, + "height": 2160 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -4178,6 +4331,42 @@ "__type__": "cc.CompPrefabInfo", "fileId": "f8Abjzw6JHHZ9tLJK/WsCf" }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 181 + }, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 1080, + "_originalHeight": 2160, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b6RRsbNDVLwZ72V0f/0qRr" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -4187,6 +4376,7 @@ "__id__": 0 }, "fileId": "c46/YsCPVOJYA4mWEpNYRx", - "instance": null + "instance": null, + "targetOverrides": null } ] \ No newline at end of file diff --git a/assets/prefabs/PageWriteLevels.ts b/assets/prefabs/PageWriteLevels.ts index 8b54341..0c5ede9 100644 --- a/assets/prefabs/PageWriteLevels.ts +++ b/assets/prefabs/PageWriteLevels.ts @@ -1,7 +1,7 @@ import { _decorator, Node, Button, Sprite, Label, Toggle, ScrollView, EditBox, instantiate, UITransform, Vec2, EventTouch } from 'cc'; import { BaseView } from 'db://assets/scripts/core/BaseView'; import { ViewManager } from 'db://assets/scripts/core/ViewManager'; -import { LevelDataManager } from 'db://assets/scripts/utils/LevelDataManager'; +import { CompletedLevelsManager } from 'db://assets/scripts/utils/CompletedLevelsManager'; import { ToastManager } from 'db://assets/scripts/utils/ToastManager'; import { ShareManager } from 'db://assets/scripts/utils/ShareManager'; import { StorageManager } from 'db://assets/scripts/utils/StorageManager'; @@ -9,28 +9,27 @@ import { WxSDK, getUserProfile } from 'db://assets/scripts/utils/WxSDK'; import { AuthManager } from 'db://assets/scripts/utils/AuthManager'; import { API_ENDPOINTS, API_TIMEOUT } from 'db://assets/scripts/config/ApiConfig'; import { HttpUtil } from 'db://assets/scripts/utils/HttpUtil'; +import { ApiEnvelope } from 'db://assets/scripts/types/ApiTypes'; const { ccclass, property } = _decorator; /** * 布局配置 - * 基于实际 prefab 尺寸计算: - * ScrollView / view 宽 900,高 1300 + * view (ScrollView 的可视窗口) 宽 900,高 1000,anchor (0.5, 1) 顶部中点 * ListTpl (item) 宽 300,高 400 * - * 水平居中:2 × 300 + 1 × 40 = 640, padding_left = (900 - 640) / 2 = 130 - * 垂直居中:3 × 400 + 2 × 25 = 1250, padding_top = (1300 - 1250) / 2 = 25 + * 每页 2 行 × 2 列 = 4 个关卡 + * PADDING 不再手写,由 VIEW / ITEM / SPACING 自动派生(见 _getHorizontalPadding / _getVerticalPadding), + * 保证 item 网格在 view 内始终居中。改 SPACING 时不用再算 PADDING。 */ const LAYOUT_CONFIG = { COLS: 2, - ROWS: 3, + ROWS: 2, ITEM_WIDTH: 300, ITEM_HEIGHT: 400, - SPACING_X: 40, - SPACING_Y: 25, - PADDING_LEFT: 130, - PADDING_TOP: 25, + SPACING_X: 160, + SPACING_Y: 180, VIEW_WIDTH: 900, - VIEW_HEIGHT: 1300, + VIEW_HEIGHT: 1000, }; /** 必须选择的关卡数量 */ @@ -140,7 +139,7 @@ export class PageWriteLevels extends BaseView { } } - private _onTouchStart(event: EventTouch): void { + private _onTouchStart(_event: EventTouch): void { if (!this._scrollViewComp) return; this._touchStartOffsetX = this._scrollViewComp.getScrollOffset().x; this._touchStartTime = Date.now(); @@ -149,7 +148,7 @@ export class PageWriteLevels extends BaseView { /** * 触摸结束:根据滑动距离和速度决定翻页方向 */ - private _onTouchEnd(event: EventTouch): void { + private _onTouchEnd(_event: EventTouch): void { if (!this._scrollViewComp || this._totalPages <= 1) return; const currentOffsetX = this._scrollViewComp.getScrollOffset().x; @@ -176,20 +175,27 @@ export class PageWriteLevels extends BaseView { console.log('[PageWriteLevels] onViewShow'); // 仅首次初始化列表,从预览页返回时保留选中状态 if (this._itemNodes.length === 0) { - this._initLevelList(); + void this._initLevelList(); } } - private _initLevelList(): void { + private async _initLevelList(): Promise { this._clearList(); - // TODO: LevelDataManager API 已重构为 NextLevel 驱动,此页面需要重新设计数据来源 - // this._levelCount = LevelDataManager.instance.getLevelCount(); - this._levelCount = 0; - console.log('[PageWriteLevels] 关卡总数:', this._levelCount); + // 拉取当前用户所有已通关关卡 + const levels = await CompletedLevelsManager.instance.fetch(); + if (levels === null) { + console.warn('[PageWriteLevels] 获取已通关关卡失败'); + ToastManager.instance.show('获取关卡列表失败,请稍后重试'); + return; + } + + this._levelCount = levels.length; + console.log('[PageWriteLevels] 已通关关卡总数:', this._levelCount); if (this._levelCount === 0) { - console.warn('[PageWriteLevels] 没有关卡数据'); + console.warn('[PageWriteLevels] 用户尚未通关任何关卡'); + ToastManager.instance.show('还没有已通关的关卡,快去玩几关吧'); return; } @@ -214,6 +220,25 @@ export class PageWriteLevels extends BaseView { this._selectedIndices.clear(); } + /** + * 水平 padding:让整行 item 在 view 宽度内居中 + * padding_left = (VIEW_WIDTH - cols*ITEM_WIDTH - (cols-1)*SPACING_X) / 2 + */ + private _getHorizontalPadding(): number { + const { VIEW_WIDTH, COLS, ITEM_WIDTH, SPACING_X } = LAYOUT_CONFIG; + const gridWidth = COLS * ITEM_WIDTH + (COLS - 1) * SPACING_X; + return (VIEW_WIDTH - gridWidth) / 2; + } + + /** + * 垂直 padding:让整列 item 在 view 高度内居中 + */ + private _getVerticalPadding(): number { + const { VIEW_HEIGHT, ROWS, ITEM_HEIGHT, SPACING_Y } = LAYOUT_CONFIG; + const gridHeight = ROWS * ITEM_HEIGHT + (ROWS - 1) * SPACING_Y; + return (VIEW_HEIGHT - gridHeight) / 2; + } + private _updateContentSize(): void { if (!this.listContent) return; @@ -223,11 +248,12 @@ export class PageWriteLevels extends BaseView { const totalWidth = this._totalPages * LAYOUT_CONFIG.VIEW_WIDTH; contentTransform.setContentSize(totalWidth, LAYOUT_CONFIG.VIEW_HEIGHT); - // anchor=(0,1),将 content 左上角对齐到 view 左上角 + // content anchor=(0,1),view anchor=(0.5,1)。 + // view 本地坐标系下,view 的左上角 = (-viewWidth/2, 0)。 + // content 的 anchor 点(左上角)需要贴到 view 的左上角。 if (this._viewTransform) { const viewWidth = this._viewTransform.contentSize.width; - const viewHeight = this._viewTransform.contentSize.height; - this.listContent.setPosition(-viewWidth / 2, viewHeight / 2, 0); + this.listContent.setPosition(-viewWidth / 2, 0, 0); } } @@ -277,12 +303,15 @@ export class PageWriteLevels extends BaseView { const col = localIndex % LAYOUT_CONFIG.COLS; const row = Math.floor(localIndex / LAYOUT_CONFIG.COLS); + const paddingLeft = this._getHorizontalPadding(); + const paddingTop = this._getVerticalPadding(); + const x = pageIndex * LAYOUT_CONFIG.VIEW_WIDTH - + LAYOUT_CONFIG.PADDING_LEFT + + paddingLeft + col * (LAYOUT_CONFIG.ITEM_WIDTH + LAYOUT_CONFIG.SPACING_X) + LAYOUT_CONFIG.ITEM_WIDTH / 2; - const y = -(LAYOUT_CONFIG.PADDING_TOP + const y = -(paddingTop + row * (LAYOUT_CONFIG.ITEM_HEIGHT + LAYOUT_CONFIG.SPACING_Y) + LAYOUT_CONFIG.ITEM_HEIGHT / 2); @@ -293,11 +322,12 @@ export class PageWriteLevels extends BaseView { * 初始化 item 的默认名称和选中状态(不设置封面,由异步加载负责) */ private _initItemState(item: Node, index: number): void { + const level = CompletedLevelsManager.instance.getByIndex(index); const levelName = item.getChildByName('LevelName'); if (levelName) { const label = levelName.getComponent(Label); if (label) { - label.string = `第${index + 1}关`; + label.string = level ? `第${level.level}关` : `第${index + 1}关`; } } @@ -317,27 +347,20 @@ export class PageWriteLevels extends BaseView { } /** - * 异步加载关卡资源并刷新封面图和名称。 - * TODO: LevelDataManager API 已重构为 NextLevel 驱动,此方法需要重新设计 + * 异步加载关卡封面图并填充到 item */ private async _loadAndRefreshCover(item: Node, index: number): Promise { - // const config = await LevelDataManager.instance.ensureLevelReady(index); - const config = null as any; // TODO: 需要适配新 API - if (!config || !item.isValid) return; + const level = CompletedLevelsManager.instance.getByIndex(index); + if (!level || !item.isValid) return; + + const spriteFrame = await CompletedLevelsManager.instance.loadImage(level.image1Url); + if (!spriteFrame || !item.isValid) return; const levelCover = item.getChildByName('LevelCover'); if (levelCover) { const sprite = levelCover.getComponent(Sprite); - if (sprite && config.spriteFrame1) { - sprite.spriteFrame = config.spriteFrame1; - } - } - - const levelName = item.getChildByName('LevelName'); - if (levelName) { - const label = levelName.getComponent(Label); - if (label) { - label.string = config.name; + if (sprite) { + sprite.spriteFrame = spriteFrame; } } } @@ -550,15 +573,14 @@ export class PageWriteLevels extends BaseView { * 将选中的关卡索引转换为关卡 ID 数组 */ private _getSelectedLevelIds(): string[] { - // TODO: LevelDataManager API 已重构为 NextLevel 驱动,此方法需要重新设计 const ids: string[] = []; - // const sortedIndices = Array.from(this._selectedIndices).sort((a, b) => a - b); - // for (const index of sortedIndices) { - // const config = LevelDataManager.instance.getLevelConfig(index); - // if (config) { - // ids.push(config.id); - // } - // } + const sortedIndices = Array.from(this._selectedIndices).sort((a, b) => a - b); + for (const index of sortedIndices) { + const level = CompletedLevelsManager.instance.getByIndex(index); + if (level) { + ids.push(level.id); + } + } return ids; } @@ -592,7 +614,7 @@ export class PageWriteLevels extends BaseView { StorageManager.setUserInfo(userInfo); // 上传到服务端 - const response = await HttpUtil.post( + const response = await HttpUtil.post>( API_ENDPOINTS.USER_INFO, { userId: userId, diff --git a/assets/prefabs/PreviewLevelItem.ts b/assets/prefabs/PreviewLevelItem.ts new file mode 100644 index 0000000..0ba923b --- /dev/null +++ b/assets/prefabs/PreviewLevelItem.ts @@ -0,0 +1,47 @@ +import { _decorator, Component, Node, Sprite, Label, SpriteFrame } from 'cc'; +const { ccclass, property } = _decorator; + +/** + * 预览页单个关卡 item 的视图组件 + * 挂在 PagePreviewLevels 的 listTemplate 根节点上,由编辑器拖拽绑定子节点。 + * instantiate 克隆 item 时,Cocos 会把这些 Node 引用自动重映射到克隆后的子节点, + * 所以每个 item 拿到的都是自己的封面/标签引用,与节点层级/命名解耦。 + */ +@ccclass('PreviewLevelItem') +export class PreviewLevelItem extends Component { + @property({ type: Sprite, tooltip: '封面图 Sprite' }) + levelCover: Sprite | null = null; + + @property({ type: Label, tooltip: '答案 Label' }) + answerLabel: Label | null = null; + + @property({ type: Label, tooltip: '线索1 Label' }) + tips1Label: Label | null = null; + + @property({ type: Label, tooltip: '线索2 Label' }) + tips2Label: Label | null = null; + + @property({ type: Label, tooltip: '线索3 Label' }) + tips3Label: Label | null = null; + + /** + * 一次性设置所有文本字段 + */ + setTexts(opts: { + answer: string; + hint1: string; + hint2: string; + hint3: string; + }): void { + if (this.answerLabel) this.answerLabel.string = `答案:${opts.answer}`; + if (this.tips1Label) this.tips1Label.string = `线索一:${opts.hint1}`; + if (this.tips2Label) this.tips2Label.string = `线索二:${opts.hint2}`; + if (this.tips3Label) this.tips3Label.string = `线索三:${opts.hint3}`; + } + + setCover(spriteFrame: SpriteFrame | null): void { + if (this.levelCover && spriteFrame) { + this.levelCover.spriteFrame = spriteFrame; + } + } +} diff --git a/assets/prefabs/PreviewLevelItem.ts.meta b/assets/prefabs/PreviewLevelItem.ts.meta new file mode 100644 index 0000000..341dbab --- /dev/null +++ b/assets/prefabs/PreviewLevelItem.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.24", + "importer": "typescript", + "imported": true, + "uuid": "5fb357ec-a670-4fff-a5cd-f47f1a2d8ea3", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/images/pageLevel/ButtonGreen.png.meta b/assets/resources/images/pageLevel/ButtonGreen.png.meta index 271865a..a9b91bd 100644 --- a/assets/resources/images/pageLevel/ButtonGreen.png.meta +++ b/assets/resources/images/pageLevel/ButtonGreen.png.meta @@ -49,8 +49,8 @@ "height": 235, "rawWidth": 666, "rawHeight": 235, - "borderTop": 0, - "borderBottom": 0, + "borderTop": 120, + "borderBottom": 115, "borderLeft": 120, "borderRight": 120, "packable": true, diff --git a/assets/resources/images/pageLevel/ButtonOrange.png b/assets/resources/images/pageLevel/ButtonOrange.png index 481c23f..e5a094e 100644 Binary files a/assets/resources/images/pageLevel/ButtonOrange.png and b/assets/resources/images/pageLevel/ButtonOrange.png differ diff --git a/assets/resources/images/pageLevel/ButtonOrange.png.meta b/assets/resources/images/pageLevel/ButtonOrange.png.meta index 519624a..a61d697 100644 --- a/assets/resources/images/pageLevel/ButtonOrange.png.meta +++ b/assets/resources/images/pageLevel/ButtonOrange.png.meta @@ -41,18 +41,18 @@ "userData": { "trimThreshold": 1, "rotated": false, - "offsetX": -0.5, + "offsetX": 0, "offsetY": 0, "trimX": 0, "trimY": 0, - "width": 665, + "width": 666, "height": 235, "rawWidth": 666, "rawHeight": 235, "borderTop": 112, "borderBottom": 112, - "borderLeft": 120, - "borderRight": 120, + "borderLeft": 112, + "borderRight": 112, "packable": true, "pixelsToUnit": 100, "pivotX": 0.5, @@ -60,16 +60,16 @@ "meshType": 0, "vertices": { "rawPosition": [ - -332.5, + -333, -117.5, 0, - 332.5, + 333, -117.5, 0, - -332.5, + -333, 117.5, 0, - 332.5, + 333, 117.5, 0 ], @@ -84,30 +84,30 @@ "uv": [ 0, 235, - 665, + 666, 235, 0, 0, - 665, + 666, 0 ], "nuv": [ 0, 0, - 0.9984984984984985, + 1, 0, 0, 1, - 0.9984984984984985, + 1, 1 ], "minPos": [ - -332.5, + -333, -117.5, 0 ], "maxPos": [ - 332.5, + 333, 117.5, 0 ] diff --git a/assets/resources/images/pagePK/Banner2.png b/assets/resources/images/pagePK/Banner2.png new file mode 100644 index 0000000..1bcb73d Binary files /dev/null and b/assets/resources/images/pagePK/Banner2.png differ diff --git a/assets/resources/images/pagePK/Banner2.png.meta b/assets/resources/images/pagePK/Banner2.png.meta new file mode 100644 index 0000000..85f3af3 --- /dev/null +++ b/assets/resources/images/pagePK/Banner2.png.meta @@ -0,0 +1,134 @@ +{ + "ver": "1.0.27", + "importer": "image", + "imported": true, + "uuid": "fca884ba-b748-4630-886d-cfebff286af8", + "files": [ + ".json", + ".png" + ], + "subMetas": { + "6c48a": { + "importer": "texture", + "uuid": "fca884ba-b748-4630-886d-cfebff286af8@6c48a", + "displayName": "Banner2", + "id": "6c48a", + "name": "texture", + "userData": { + "wrapModeS": "clamp-to-edge", + "wrapModeT": "clamp-to-edge", + "imageUuidOrDatabaseUri": "fca884ba-b748-4630-886d-cfebff286af8", + "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": "fca884ba-b748-4630-886d-cfebff286af8@f9941", + "displayName": "Banner2", + "id": "f9941", + "name": "spriteFrame", + "userData": { + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 828, + "height": 156, + "rawWidth": 828, + "rawHeight": 156, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [ + -414, + -78, + 0, + 414, + -78, + 0, + -414, + 78, + 0, + 414, + 78, + 0 + ], + "indexes": [ + 0, + 1, + 2, + 2, + 1, + 3 + ], + "uv": [ + 0, + 156, + 828, + 156, + 0, + 0, + 828, + 0 + ], + "nuv": [ + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 1 + ], + "minPos": [ + -414, + -78, + 0 + ], + "maxPos": [ + 414, + 78, + 0 + ] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "fca884ba-b748-4630-886d-cfebff286af8@6c48a", + "atlasUuid": "", + "trimType": "auto" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + } + }, + "userData": { + "type": "sprite-frame", + "fixAlphaTransparencyArtifacts": false, + "hasAlpha": true, + "redirect": "fca884ba-b748-4630-886d-cfebff286af8@6c48a" + } +} diff --git a/assets/resources/images/pagePK/quizThumbLine.png b/assets/resources/images/pagePK/quizThumbLine.png new file mode 100644 index 0000000..1eedd3c Binary files /dev/null and b/assets/resources/images/pagePK/quizThumbLine.png differ diff --git a/assets/resources/images/pagePK/quizThumbLine.png.meta b/assets/resources/images/pagePK/quizThumbLine.png.meta new file mode 100644 index 0000000..570991c --- /dev/null +++ b/assets/resources/images/pagePK/quizThumbLine.png.meta @@ -0,0 +1,134 @@ +{ + "ver": "1.0.27", + "importer": "image", + "imported": true, + "uuid": "5b2a42ac-89e1-4a48-a171-108e41780903", + "files": [ + ".json", + ".png" + ], + "subMetas": { + "6c48a": { + "importer": "texture", + "uuid": "5b2a42ac-89e1-4a48-a171-108e41780903@6c48a", + "displayName": "quizThumbLine", + "id": "6c48a", + "name": "texture", + "userData": { + "wrapModeS": "clamp-to-edge", + "wrapModeT": "clamp-to-edge", + "imageUuidOrDatabaseUri": "5b2a42ac-89e1-4a48-a171-108e41780903", + "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": "5b2a42ac-89e1-4a48-a171-108e41780903@f9941", + "displayName": "quizThumbLine", + "id": "f9941", + "name": "spriteFrame", + "userData": { + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 861, + "height": 228, + "rawWidth": 861, + "rawHeight": 228, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [ + -430.5, + -114, + 0, + 430.5, + -114, + 0, + -430.5, + 114, + 0, + 430.5, + 114, + 0 + ], + "indexes": [ + 0, + 1, + 2, + 2, + 1, + 3 + ], + "uv": [ + 0, + 228, + 861, + 228, + 0, + 0, + 861, + 0 + ], + "nuv": [ + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 1 + ], + "minPos": [ + -430.5, + -114, + 0 + ], + "maxPos": [ + 430.5, + 114, + 0 + ] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "5b2a42ac-89e1-4a48-a171-108e41780903@6c48a", + "atlasUuid": "", + "trimType": "auto" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + } + }, + "userData": { + "type": "sprite-frame", + "fixAlphaTransparencyArtifacts": false, + "hasAlpha": true, + "redirect": "5b2a42ac-89e1-4a48-a171-108e41780903@6c48a" + } +} diff --git a/assets/scripts/config/ApiConfig.ts b/assets/scripts/config/ApiConfig.ts index ad6313b..329abde 100644 --- a/assets/scripts/config/ApiConfig.ts +++ b/assets/scripts/config/ApiConfig.ts @@ -22,6 +22,8 @@ export const API_ENDPOINTS = { SHARE_PROGRESS: `${API_BASE}/share/progress`, /** 用户信息 */ USER_INFO: `${API_BASE}/user/info`, + /** 用户所有已通关的关卡(成就墙 / 关卡回看) */ + COMPLETED_LEVELS: `${API_BASE}/levels/completed`, } as const; export function getLevelEnterUrl(levelId: string): string { diff --git a/assets/scripts/types/ApiTypes.ts b/assets/scripts/types/ApiTypes.ts index e0d3190..88204e1 100644 --- a/assets/scripts/types/ApiTypes.ts +++ b/assets/scripts/types/ApiTypes.ts @@ -156,3 +156,35 @@ export interface CreatedShareItem { export interface CreatedShareListData { items: CreatedShareItem[]; } + +/** 已通关关卡数据(成就墙 / 关卡回看场景) */ +export interface CompletedLevel { + /** 关卡 ID */ + id: string; + /** 关卡编号(sortOrder) */ + level: number; + /** 图片1 URL */ + image1Url: string; + /** 图片1 文本说明 */ + image1Description: string | null; + /** 图片2 URL */ + image2Url: string; + /** 图片2 文本说明 */ + image2Description: string | null; + /** 答案 */ + answer: string; + /** 谐音梗说明 */ + punchline: string | null; + /** 线索1 */ + hint1: string | null; + /** 线索2 */ + hint2: string | null; + /** 线索3 */ + hint3: string | null; + /** 限时(秒),null 表示不限时 */ + timeLimit: number | null; + /** 首次通关时长(秒) */ + timeSpent: number; + /** 通关时间(ISO 8601) */ + completedAt: string; +} diff --git a/assets/scripts/utils/CompletedLevelsManager.ts b/assets/scripts/utils/CompletedLevelsManager.ts new file mode 100644 index 0000000..0c08de5 --- /dev/null +++ b/assets/scripts/utils/CompletedLevelsManager.ts @@ -0,0 +1,138 @@ +import { SpriteFrame, Texture2D, ImageAsset, assetManager } from 'cc'; +import { HttpUtil } from './HttpUtil'; +import { API_ENDPOINTS, API_TIMEOUT } from '../config/ApiConfig'; +import { ApiEnvelope, CompletedLevel } from '../types/ApiTypes'; + +/** + * 已通关关卡管理器 + * 单例模式,负责拉取当前用户所有已通关关卡 + 封面图缓存 + * 适用于「成就墙」「关卡回看」「出题 / 预览」等场景 + */ +export class CompletedLevelsManager { + private static _instance: CompletedLevelsManager | null = null; + + /** 关卡数据按服务端返回顺序缓存 */ + private _levels: CompletedLevel[] = []; + + /** 是否已经成功拉取过一次 */ + private _loaded: boolean = false; + + /** 图片缓存:URL -> SpriteFrame */ + private _imageCache: Map = new Map(); + + /** 正在进行中的请求,用于去重并发调用 */ + private _inflight: Promise | null = null; + + static get instance(): CompletedLevelsManager { + if (!this._instance) { + this._instance = new CompletedLevelsManager(); + } + return this._instance; + } + + private constructor() {} + + /** + * 获取已缓存的关卡列表(需先 fetch 或 ensureLoaded) + */ + get levels(): CompletedLevel[] { + return this._levels; + } + + get count(): number { + return this._levels.length; + } + + isLoaded(): boolean { + return this._loaded; + } + + /** + * 按索引(0-based)获取关卡,越界返回 null + */ + getByIndex(index: number): CompletedLevel | null { + if (index < 0 || index >= this._levels.length) return null; + return this._levels[index]; + } + + /** + * 拉取并缓存已通关关卡列表 + * - forceRefresh=true 强制重新请求 + * - 并发调用会共享同一次请求 + */ + async fetch(forceRefresh: boolean = false): Promise { + if (!forceRefresh && this._loaded) { + return this._levels; + } + + if (this._inflight) { + return this._inflight; + } + + this._inflight = this._doFetch(); + try { + return await this._inflight; + } finally { + this._inflight = null; + } + } + + private async _doFetch(): Promise { + try { + const response = await HttpUtil.get>( + API_ENDPOINTS.COMPLETED_LEVELS, + API_TIMEOUT.DEFAULT, + ); + + if (!response.success || !response.data) { + console.error('[CompletedLevelsManager] 拉取失败:', response.message); + return null; + } + + this._levels = response.data; + this._loaded = true; + console.log(`[CompletedLevelsManager] 拉取成功,共 ${this._levels.length} 关`); + return this._levels; + } catch (err) { + console.error('[CompletedLevelsManager] 拉取异常:', err); + return null; + } + } + + /** + * 按图片 URL 加载并缓存 SpriteFrame + * 已缓存直接返回 + */ + loadImage(url: string): Promise { + if (!url) return Promise.resolve(null); + + const cached = this._imageCache.get(url); + if (cached) { + return Promise.resolve(cached); + } + + return new Promise((resolve) => { + assetManager.loadRemote(url, (err, imageAsset) => { + if (err) { + console.error('[CompletedLevelsManager] 加载图片失败:', url, err); + resolve(null); + return; + } + const texture = new Texture2D(); + texture.image = imageAsset; + const spriteFrame = new SpriteFrame(); + spriteFrame.texture = texture; + this._imageCache.set(url, spriteFrame); + resolve(spriteFrame); + }); + }); + } + + /** 清除缓存(登出等场景) */ + clear(): void { + this._levels = []; + this._loaded = false; + this._imageCache.clear(); + this._inflight = null; + } +} diff --git a/assets/scripts/utils/CompletedLevelsManager.ts.meta b/assets/scripts/utils/CompletedLevelsManager.ts.meta new file mode 100644 index 0000000..45eddba --- /dev/null +++ b/assets/scripts/utils/CompletedLevelsManager.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.24", + "importer": "typescript", + "imported": true, + "uuid": "991baa0f-1a4b-4f71-bfff-3de5f7470c22", + "files": [], + "subMetas": {}, + "userData": {} +}