From f6feb14ff32c34dafb871224882de4596ad28efa Mon Sep 17 00:00:00 2001 From: richarjiang Date: Thu, 12 Mar 2026 20:30:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=9B=9E=E5=88=B0=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/prefabs/PageLevel.prefab | 316 ++++++++++++++---------- assets/prefabs/PageLevel.ts | 36 ++- settings/v2/packages/cocos-service.json | 23 ++ settings/v2/packages/information.json | 8 +- 4 files changed, 251 insertions(+), 132 deletions(-) create mode 100644 settings/v2/packages/cocos-service.json diff --git a/assets/prefabs/PageLevel.prefab b/assets/prefabs/PageLevel.prefab index 138c1f6..df0208b 100644 --- a/assets/prefabs/PageLevel.prefab +++ b/assets/prefabs/PageLevel.prefab @@ -25,29 +25,29 @@ "__id__": 10 }, { - "__id__": 18 + "__id__": 20 }, { - "__id__": 60 + "__id__": 62 }, { - "__id__": 76 + "__id__": 78 } ], "_active": true, "_components": [ - { - "__id__": 96 - }, { "__id__": 98 }, { "__id__": 100 + }, + { + "__id__": 102 } ], "_prefab": { - "__id__": 102 + "__id__": 104 }, "_lpos": { "__type__": "cc.Vec3", @@ -254,10 +254,13 @@ }, { "__id__": 15 + }, + { + "__id__": 17 } ], "_prefab": { - "__id__": 17 + "__id__": 19 }, "_lpos": { "__type__": "cc.Vec3", @@ -397,6 +400,62 @@ "__type__": "cc.CompPrefabInfo", "fileId": "7fSph66PxCzKzewaKLPszT" }, + { + "__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": "c9aKGSeypKCptxZVG/wbkB" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -420,23 +479,23 @@ }, "_children": [ { - "__id__": 19 + "__id__": 21 }, { - "__id__": 25 + "__id__": 27 } ], "_active": true, "_components": [ { - "__id__": 55 + "__id__": 57 }, { - "__id__": 57 + "__id__": 59 } ], "_prefab": { - "__id__": 59 + "__id__": 61 }, "_lpos": { "__type__": "cc.Vec3", @@ -473,20 +532,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 18 + "__id__": 20 }, "_children": [], "_active": true, "_components": [ { - "__id__": 20 + "__id__": 22 }, { - "__id__": 22 + "__id__": 24 } ], "_prefab": { - "__id__": 24 + "__id__": 26 }, "_lpos": { "__type__": "cc.Vec3", @@ -523,11 +582,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 19 + "__id__": 21 }, "_enabled": true, "__prefab": { - "__id__": 21 + "__id__": 23 }, "_contentSize": { "__type__": "cc.Size", @@ -551,11 +610,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 19 + "__id__": 21 }, "_enabled": true, "__prefab": { - "__id__": 23 + "__id__": 25 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -609,30 +668,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 18 + "__id__": 20 }, "_children": [ { - "__id__": 26 + "__id__": 28 }, { - "__id__": 32 + "__id__": 34 }, { - "__id__": 38 + "__id__": 40 } ], "_active": true, "_components": [ { - "__id__": 50 + "__id__": 52 }, { - "__id__": 52 + "__id__": 54 } ], "_prefab": { - "__id__": 54 + "__id__": 56 }, "_lpos": { "__type__": "cc.Vec3", @@ -669,20 +728,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 25 + "__id__": 27 }, "_children": [], "_active": true, "_components": [ { - "__id__": 27 + "__id__": 29 }, { - "__id__": 29 + "__id__": 31 } ], "_prefab": { - "__id__": 31 + "__id__": 33 }, "_lpos": { "__type__": "cc.Vec3", @@ -719,11 +778,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 26 + "__id__": 28 }, "_enabled": true, "__prefab": { - "__id__": 28 + "__id__": 30 }, "_contentSize": { "__type__": "cc.Size", @@ -747,11 +806,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 26 + "__id__": 28 }, "_enabled": true, "__prefab": { - "__id__": 30 + "__id__": 32 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -828,20 +887,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 25 + "__id__": 27 }, "_children": [], "_active": true, "_components": [ { - "__id__": 33 + "__id__": 35 }, { - "__id__": 35 + "__id__": 37 } ], "_prefab": { - "__id__": 37 + "__id__": 39 }, "_lpos": { "__type__": "cc.Vec3", @@ -878,11 +937,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 32 + "__id__": 34 }, "_enabled": true, "__prefab": { - "__id__": 34 + "__id__": 36 }, "_contentSize": { "__type__": "cc.Size", @@ -906,11 +965,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 32 + "__id__": 34 }, "_enabled": true, "__prefab": { - "__id__": 36 + "__id__": 38 }, "_resizeMode": 1, "_layoutType": 1, @@ -957,24 +1016,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 25 + "__id__": 27 }, "_children": [ { - "__id__": 39 + "__id__": 41 } ], "_active": false, "_components": [ { - "__id__": 45 + "__id__": 47 }, { - "__id__": 47 + "__id__": 49 } ], "_prefab": { - "__id__": 49 + "__id__": 51 }, "_lpos": { "__type__": "cc.Vec3", @@ -1011,20 +1070,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 38 + "__id__": 40 }, "_children": [], "_active": true, "_components": [ { - "__id__": 40 + "__id__": 42 }, { - "__id__": 42 + "__id__": 44 } ], "_prefab": { - "__id__": 44 + "__id__": 46 }, "_lpos": { "__type__": "cc.Vec3", @@ -1061,11 +1120,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 39 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 41 + "__id__": 43 }, "_contentSize": { "__type__": "cc.Size", @@ -1089,11 +1148,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 39 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 43 + "__id__": 45 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1170,11 +1229,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 38 + "__id__": 40 }, "_enabled": true, "__prefab": { - "__id__": 46 + "__id__": 48 }, "_contentSize": { "__type__": "cc.Size", @@ -1198,11 +1257,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 38 + "__id__": 40 }, "_enabled": true, "__prefab": { - "__id__": 48 + "__id__": 50 }, "clickEvents": [], "_interactable": true, @@ -1267,11 +1326,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 25 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 51 + "__id__": 53 }, "_contentSize": { "__type__": "cc.Size", @@ -1295,11 +1354,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 25 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 53 + "__id__": 55 }, "_resizeMode": 0, "_layoutType": 1, @@ -1346,11 +1405,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 18 + "__id__": 20 }, "_enabled": true, "__prefab": { - "__id__": 56 + "__id__": 58 }, "_contentSize": { "__type__": "cc.Size", @@ -1374,11 +1433,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 18 + "__id__": 20 }, "_enabled": true, "__prefab": { - "__id__": 58 + "__id__": 60 }, "_alignFlags": 1, "_target": null, @@ -1427,14 +1486,11 @@ }, "_children": [ { - "__id__": 61 + "__id__": 63 } ], "_active": true, "_components": [ - { - "__id__": 67 - }, { "__id__": 69 }, @@ -1443,10 +1499,13 @@ }, { "__id__": 73 + }, + { + "__id__": 75 } ], "_prefab": { - "__id__": 75 + "__id__": 77 }, "_lpos": { "__type__": "cc.Vec3", @@ -1483,20 +1542,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 60 + "__id__": 62 }, "_children": [], "_active": true, "_components": [ { - "__id__": 62 + "__id__": 64 }, { - "__id__": 64 + "__id__": 66 } ], "_prefab": { - "__id__": 66 + "__id__": 68 }, "_lpos": { "__type__": "cc.Vec3", @@ -1533,11 +1592,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 61 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 63 + "__id__": 65 }, "_contentSize": { "__type__": "cc.Size", @@ -1561,11 +1620,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 61 + "__id__": 63 }, "_enabled": true, "__prefab": { - "__id__": 65 + "__id__": 67 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1642,11 +1701,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 60 + "__id__": 62 }, "_enabled": true, "__prefab": { - "__id__": 68 + "__id__": 70 }, "_contentSize": { "__type__": "cc.Size", @@ -1670,11 +1729,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 60 + "__id__": 62 }, "_enabled": true, "__prefab": { - "__id__": 70 + "__id__": 72 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1715,11 +1774,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 60 + "__id__": 62 }, "_enabled": true, "__prefab": { - "__id__": 72 + "__id__": 74 }, "_alignFlags": 4, "_target": null, @@ -1751,11 +1810,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 60 + "__id__": 62 }, "_enabled": true, "__prefab": { - "__id__": 74 + "__id__": 76 }, "clickEvents": [], "_interactable": true, @@ -1824,26 +1883,26 @@ }, "_children": [ { - "__id__": 77 + "__id__": 79 }, { - "__id__": 83 + "__id__": 85 } ], "_active": true, "_components": [ - { - "__id__": 89 - }, { "__id__": 91 }, { "__id__": 93 + }, + { + "__id__": 95 } ], "_prefab": { - "__id__": 95 + "__id__": 97 }, "_lpos": { "__type__": "cc.Vec3", @@ -1880,20 +1939,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 76 + "__id__": 78 }, "_children": [], "_active": false, "_components": [ { - "__id__": 78 + "__id__": 80 }, { - "__id__": 80 + "__id__": 82 } ], "_prefab": { - "__id__": 82 + "__id__": 84 }, "_lpos": { "__type__": "cc.Vec3", @@ -1930,11 +1989,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 79 + "__id__": 81 }, "_contentSize": { "__type__": "cc.Size", @@ -1958,11 +2017,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 77 + "__id__": 79 }, "_enabled": true, "__prefab": { - "__id__": 81 + "__id__": 83 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2039,20 +2098,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 76 + "__id__": 78 }, "_children": [], "_active": true, "_components": [ { - "__id__": 84 + "__id__": 86 }, { - "__id__": 86 + "__id__": 88 } ], "_prefab": { - "__id__": 88 + "__id__": 90 }, "_lpos": { "__type__": "cc.Vec3", @@ -2089,11 +2148,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 83 + "__id__": 85 }, "_enabled": true, "__prefab": { - "__id__": 85 + "__id__": 87 }, "_contentSize": { "__type__": "cc.Size", @@ -2117,11 +2176,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 83 + "__id__": 85 }, "_enabled": true, "__prefab": { - "__id__": 87 + "__id__": 89 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2198,11 +2257,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 76 + "__id__": 78 }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 92 }, "_contentSize": { "__type__": "cc.Size", @@ -2226,11 +2285,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 76 + "__id__": 78 }, "_enabled": true, "__prefab": { - "__id__": 92 + "__id__": 94 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2268,21 +2327,21 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 76 + "__id__": 78 }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 96 }, "editingDidBegan": [], "textChanged": [], "editingDidEnded": [], "editingReturn": [], "_textLabel": { - "__id__": 80 + "__id__": 82 }, "_placeholderLabel": { - "__id__": 86 + "__id__": 88 }, "_returnType": 0, "_string": "", @@ -2320,7 +2379,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 97 + "__id__": 99 }, "_contentSize": { "__type__": "cc.Size", @@ -2348,7 +2407,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 99 + "__id__": 101 }, "_alignFlags": 0, "_target": null, @@ -2384,19 +2443,22 @@ }, "_enabled": true, "__prefab": { - "__id__": 101 + "__id__": 103 }, "inputLayout": { - "__id__": 32 + "__id__": 34 }, "submitButton": { - "__id__": 38 + "__id__": 40 }, "inputTemplate": { - "__id__": 76 + "__id__": 78 }, "actionNode": { - "__id__": 25 + "__id__": 27 + }, + "iconSetting": { + "__id__": 10 }, "defaultInputCount": 2, "_id": "" diff --git a/assets/prefabs/PageLevel.ts b/assets/prefabs/PageLevel.ts index 7658bc1..9d5fa5b 100644 --- a/assets/prefabs/PageLevel.ts +++ b/assets/prefabs/PageLevel.ts @@ -1,5 +1,6 @@ -import { _decorator, Node, EditBox, instantiate, Vec3 } from 'cc'; +import { _decorator, Node, EditBox, instantiate, Vec3, Button } from 'cc'; import { BaseView } from 'db://assets/scripts/core/BaseView'; +import { ViewManager } from 'db://assets/scripts/core/ViewManager'; const { ccclass, property } = _decorator; /** @@ -31,6 +32,9 @@ export class PageLevel extends BaseView { @property(Node) actionNode: Node | null = null; + @property(Node) + iconSetting: Node | null = null; + // ========== 配置属性 ========== @property({ tooltip: '默认输入框数量', @@ -55,6 +59,7 @@ export class PageLevel extends BaseView { onViewLoad(): void { console.log('[PageLevel] onViewLoad'); this.initLevel(); + this.initIconSetting(); } /** @@ -216,6 +221,35 @@ export class PageLevel extends BaseView { private onInputEditingEnded(editBox: EditBox): void { this.checkAllInputsFilled(); } + + // ========== IconSetting 按钮相关 ========== + + /** + * 初始化 IconSetting 按钮事件 + */ + private initIconSetting(): void { + if (!this.iconSetting) { + console.warn('[PageLevel] iconSetting 节点未设置'); + return; + } + + const button = this.iconSetting.getComponent(Button); + if (!button) { + console.warn('[PageLevel] iconSetting 节点缺少 Button 组件'); + return; + } + + this.iconSetting.on(Node.EventType.TOUCH_END, this.onIconSettingClick, this); + console.log('[PageLevel] IconSetting 按钮事件已绑定'); + } + + /** + * IconSetting 按钮点击回调 + */ + private onIconSettingClick(): void { + console.log('[PageLevel] IconSetting 点击,返回主页'); + ViewManager.instance.back(); + } } diff --git a/settings/v2/packages/cocos-service.json b/settings/v2/packages/cocos-service.json new file mode 100644 index 0000000..2b06b22 --- /dev/null +++ b/settings/v2/packages/cocos-service.json @@ -0,0 +1,23 @@ +{ + "__version__": "3.0.9", + "game": { + "name": "UNKNOW GAME", + "app_id": "UNKNOW", + "c_id": "0" + }, + "appConfigMaps": [ + { + "app_id": "UNKNOW", + "config_id": "42bc86" + } + ], + "configs": [ + { + "app_id": "UNKNOW", + "config_id": "42bc86", + "config_name": "Default", + "config_remarks": "", + "services": [] + } + ] +} diff --git a/settings/v2/packages/information.json b/settings/v2/packages/information.json index b05147f..94848de 100644 --- a/settings/v2/packages/information.json +++ b/settings/v2/packages/information.json @@ -4,19 +4,19 @@ "customSplash": { "id": "customSplash", "label": "customSplash", - "enable": true, + "enable": false, "customSplash": { "complete": false, - "form": "https://creator-api.cocos.com/api/form/show?sid=51d0aa399094bb683b7737f0a16a459b" + "form": "https://creator-api.cocos.com/api/form/show?" } }, "removeSplash": { "id": "removeSplash", "label": "removeSplash", - "enable": true, + "enable": false, "removeSplash": { "complete": false, - "form": "https://creator-api.cocos.com/api/form/show?sid=51d0aa399094bb683b7737f0a16a459b" + "form": "https://creator-api.cocos.com/api/form/show?" } } }