Browse Source

添加虚拟列表,完善提现记录逻辑

mojunshou 8 months ago
parent
commit
84db3fa9ea

+ 316 - 154
assets/bundle/gui/eliminate/prefab/withdrawalRecord.prefab

@@ -28,17 +28,17 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 62
+        "__id__": 79
       },
       {
-        "__id__": 64
+        "__id__": 81
       },
       {
-        "__id__": 66
+        "__id__": 83
       }
     ],
     "_prefab": {
-      "__id__": 68
+      "__id__": 85
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -266,14 +266,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 57
+        "__id__": 74
       },
       {
-        "__id__": 59
+        "__id__": 76
       }
     ],
     "_prefab": {
-      "__id__": 61
+      "__id__": 78
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -851,22 +851,25 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 50
+        "__id__": 62
       },
       {
-        "__id__": 52
+        "__id__": 64
+      },
+      {
+        "__id__": 66
       },
       {
-        "__id__": 54
+        "__id__": 68
       }
     ],
     "_prefab": {
-      "__id__": 56
+      "__id__": 73
     },
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -2.328,
+      "y": 527.751,
       "z": 0
     },
     "_lrot": {
@@ -908,17 +911,17 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 43
+        "__id__": 55
       },
       {
-        "__id__": 45
+        "__id__": 57
       },
       {
-        "__id__": 47
+        "__id__": 59
       }
     ],
     "_prefab": {
-      "__id__": 49
+      "__id__": 61
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -965,16 +968,19 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 40
+        "__id__": 50
+      },
+      {
+        "__id__": 52
       }
     ],
     "_prefab": {
-      "__id__": 42
+      "__id__": 54
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -1.624,
-      "y": 498.313,
+      "x": 0,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -1002,165 +1008,235 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "item",
     "_objFlags": 0,
-    "__editorExtras__": {},
     "_parent": {
       "__id__": 33
     },
-    "_children": [],
-    "_active": true,
-    "_components": [
+    "_prefab": {
+      "__id__": 35
+    },
+    "__editorExtras__": {}
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 34
+    },
+    "asset": {
+      "__uuid__": "e1559d01-a092-4e23-b305-693a2659751c",
+      "__expectedType__": "cc.Prefab"
+    },
+    "fileId": "c46/YsCPVOJYA4mWEpNYRx",
+    "instance": {
+      "__id__": 36
+    },
+    "targetOverrides": null
+  },
+  {
+    "__type__": "cc.PrefabInstance",
+    "fileId": "e27BNTJzJBVZIl/Y/kmY3t",
+    "prefabRootNode": {
+      "__id__": 1
+    },
+    "mountedChildren": [],
+    "mountedComponents": [
+      {
+        "__id__": 37
+      }
+    ],
+    "propertyOverrides": [
       {
-        "__id__": 35
+        "__id__": 41
       },
       {
-        "__id__": 37
+        "__id__": 43
+      },
+      {
+        "__id__": 44
+      },
+      {
+        "__id__": 45
+      },
+      {
+        "__id__": 46
+      },
+      {
+        "__id__": 48
       }
     ],
-    "_prefab": {
-      "__id__": 39
+    "removedComponents": []
+  },
+  {
+    "__type__": "cc.MountedComponentsInfo",
+    "targetInfo": {
+      "__id__": 38
     },
-    "_lpos": {
+    "components": [
+      {
+        "__id__": 39
+      }
+    ]
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "c46/YsCPVOJYA4mWEpNYRx"
+    ]
+  },
+  {
+    "__type__": "95212EyccpCj4EFPKMZrM7G",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {
+      "mountedRoot": {
+        "__id__": 34
+      }
+    },
+    "node": {
+      "__id__": 34
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 40
+    },
+    "selectedMode": 0,
+    "selectedFlag": null,
+    "selectedSpriteFrame": null,
+    "adaptiveSize": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "76CZA+av1PyZZAAc1SH05T"
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 42
+    },
+    "propertyPath": [
+      "_name"
+    ],
+    "value": "recordItem"
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "c46/YsCPVOJYA4mWEpNYRx"
+    ]
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 42
+    },
+    "propertyPath": [
+      "_lpos"
+    ],
+    "value": {
       "__type__": "cc.Vec3",
-      "x": -102,
-      "y": -10.15,
+      "x": 0,
+      "y": -72.5,
       "z": 0
+    }
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 42
     },
-    "_lrot": {
+    "propertyPath": [
+      "_lrot"
+    ],
+    "value": {
       "__type__": "cc.Quat",
       "x": 0,
       "y": 0,
       "z": 0,
       "w": 1
+    }
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 42
     },
-    "_lscale": {
-      "__type__": "cc.Vec3",
-      "x": 1,
-      "y": 1,
-      "z": 1
-    },
-    "_mobility": 0,
-    "_layer": 33554432,
-    "_euler": {
+    "propertyPath": [
+      "_euler"
+    ],
+    "value": {
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
       "z": 0
-    },
-    "_id": ""
+    }
   },
   {
-    "__type__": "cc.UITransform",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 34
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 47
     },
-    "_enabled": true,
-    "__prefab": {
-      "__id__": 36
+    "propertyPath": [
+      "_string"
+    ],
+    "value": "已经打款"
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "4apCtC4o9KvZ8KzHH33hY1"
+    ]
+  },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 49
     },
-    "_contentSize": {
+    "propertyPath": [
+      "_contentSize"
+    ],
+    "value": {
       "__type__": "cc.Size",
-      "width": 131.328125,
-      "height": 25.2
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 1
-    },
-    "_id": ""
+      "width": 80,
+      "height": 50.4
+    }
   },
   {
-    "__type__": "cc.CompPrefabInfo",
-    "fileId": "24MsbFMbJKa7bdSpXdTdm8"
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "5fSmDVowREZZC3twG/bm7k"
+    ]
   },
   {
-    "__type__": "cc.Label",
+    "__type__": "cc.UITransform",
     "_name": "",
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 34
+      "__id__": 33
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 38
-    },
-    "_customMaterial": null,
-    "_srcBlendFactor": 2,
-    "_dstBlendFactor": 4,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 0,
-      "g": 0,
-      "b": 0,
-      "a": 255
-    },
-    "_string": "ScrollView content",
-    "_horizontalAlign": 0,
-    "_verticalAlign": 0,
-    "_actualFontSize": 16,
-    "_fontSize": 16,
-    "_fontFamily": "Arial",
-    "_lineHeight": 20,
-    "_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
+      "__id__": 51
     },
-    "_outlineWidth": 2,
-    "_enableShadow": false,
-    "_shadowColor": {
-      "__type__": "cc.Color",
-      "r": 0,
-      "g": 0,
-      "b": 0,
-      "a": 255
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 640,
+      "height": 145
     },
-    "_shadowOffset": {
+    "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 2,
-      "y": 2
+      "x": 0.5,
+      "y": 1
     },
-    "_shadowBlur": 2,
     "_id": ""
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "dbIa8NmVlOQoArxdvd6z9T"
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__id__": 0
-    },
-    "fileId": "9f2kw9FIhBFb0PYxV/ekRd",
-    "instance": null,
-    "targetOverrides": null,
-    "nestedPrefabInstanceRoots": null
+    "fileId": "e7icno2/lD7aLluNjGR2T5"
   },
   {
-    "__type__": "cc.UITransform",
+    "__type__": "cc.Layout",
     "_name": "",
     "_objFlags": 0,
     "__editorExtras__": {},
@@ -1169,23 +1245,33 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 41
+      "__id__": 53
     },
-    "_contentSize": {
+    "_resizeMode": 1,
+    "_layoutType": 2,
+    "_cellSize": {
       "__type__": "cc.Size",
-      "width": 640,
-      "height": 400
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 1
+      "width": 40,
+      "height": 40
     },
+    "_startAxis": 0,
+    "_paddingLeft": 0,
+    "_paddingRight": 0,
+    "_paddingTop": 5,
+    "_paddingBottom": 5,
+    "_spacingX": 0,
+    "_spacingY": 5,
+    "_verticalDirection": 1,
+    "_horizontalDirection": 0,
+    "_constraint": 0,
+    "_constraintNum": 2,
+    "_affectedByScale": false,
+    "_isAlign": false,
     "_id": ""
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "e7icno2/lD7aLluNjGR2T5"
+    "fileId": "33Wkf5bztFppleTrd7VEiR"
   },
   {
     "__type__": "cc.PrefabInfo",
@@ -1210,7 +1296,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 44
+      "__id__": 56
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1220,7 +1306,7 @@
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "x": 0.5,
-      "y": 0.5
+      "y": 1
     },
     "_id": ""
   },
@@ -1238,7 +1324,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 46
+      "__id__": 58
     },
     "_type": 0,
     "_inverted": false,
@@ -1260,7 +1346,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 48
+      "__id__": 60
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -1319,7 +1405,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 51
+      "__id__": 63
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1329,7 +1415,7 @@
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "x": 0.5,
-      "y": 0.5
+      "y": 1
     },
     "_id": ""
   },
@@ -1347,7 +1433,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 53
+      "__id__": 65
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -1392,7 +1478,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 55
+      "__id__": 67
     },
     "bounceDuration": 0.23,
     "brake": 0.75,
@@ -1414,6 +1500,74 @@
     "fileId": "bdh7LZRYlKJJdcKIZgzbOT"
   },
   {
+    "__type__": "81487N4LkFKpKSjCyeXGbN/",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 31
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 69
+    },
+    "templateType": 1,
+    "tmpNode": {
+      "__id__": 34
+    },
+    "tmpPrefab": null,
+    "_slideMode": 1,
+    "pageDistance": 0.3,
+    "pageChangeEvent": {
+      "__id__": 70
+    },
+    "_virtual": true,
+    "cyclic": false,
+    "lackCenter": false,
+    "lackSlide": true,
+    "_updateRate": 0,
+    "frameByFrameRenderNum": 0,
+    "renderEvent": {
+      "__id__": 71
+    },
+    "selectedMode": 0,
+    "selectedEvent": {
+      "__id__": 72
+    },
+    "repeatEventSingle": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "f2Z8MuSK9KSox+iYaYgTFB"
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": null,
+    "component": "",
+    "_componentId": "",
+    "handler": "",
+    "customEventData": ""
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "73ea115Z1NMUoHZ3o2oct7G",
+    "handler": "onListRender",
+    "customEventData": ""
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": null,
+    "component": "",
+    "_componentId": "",
+    "handler": "",
+    "customEventData": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -1436,7 +1590,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 58
+      "__id__": 75
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1464,7 +1618,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 60
+      "__id__": 77
     },
     "_alignFlags": 45,
     "_target": null,
@@ -1513,7 +1667,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 63
+      "__id__": 80
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1541,7 +1695,10 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 65
+      "__id__": 82
+    },
+    "recordList": {
+      "__id__": 68
     },
     "_id": ""
   },
@@ -1559,7 +1716,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 67
+      "__id__": 84
     },
     "_alignFlags": 45,
     "_target": null,
@@ -1595,6 +1752,11 @@
     },
     "fileId": "34qepRVwVJGrVhlJc5UFWU",
     "instance": null,
-    "targetOverrides": null
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": [
+      {
+        "__id__": 34
+      }
+    ]
   }
 ]

+ 28 - 8
assets/script/game/common/config/GameUIConfig.ts

@@ -1,7 +1,7 @@
 /*
  * @Date: 2021-08-12 09:33:37
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-27 18:36:48
+ * @LastEditTime: 2025-03-28 14:45:46
  */
 import { LayerType, UIConfig } from "../../../../../extensions/oops-plugin-framework/assets/core/gui/layer/LayerManager";
 
@@ -25,16 +25,28 @@ export enum UIID {
     Setting,
     /** 关于我们页面 */
     AboutUs,
-    /** 微信提现 */
-    WechatWithdraw,
     /**红包提现 */
     RedPacketWithdraw,
+    /**游戏主界面*/
+    Game,
+    /**提现必返*/
+    CashRebate,
+    /**惊喜翻倍*/
+    DoubleRewards,
     /** 双倍加速 */
     DoubleSpeed,
+    /** 游戏结束 */
+    GameOver,
+    /**恭喜通关*/
+    GamePass,
+    /**提现预约表*/
+    Reserve,
+    /**安全验证*/
+    Verify,
     /**提现记录 */
     WithdrawRecord,
-    /** 游戏结束 */
-    GameOver
+    /** 微信提现 */
+    WechatWithdraw
 }
 
 /** 打开界面方式的配置数据 */
@@ -48,9 +60,17 @@ export var UIConfigData: { [key: number]: UIConfig } = {
     [UIID.Eliminate]: { layer: LayerType.UI, prefab: "gui/eliminate/eliminate" },
     [UIID.Setting]: { layer: LayerType.UI, prefab: "common/prefab/setting", vacancy: true, mask: true },
     [UIID.AboutUs]: { layer: LayerType.UI, prefab: "common/prefab/about" },
-    [UIID.WechatWithdraw]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/wechatWithdrawal" },
     [UIID.RedPacketWithdraw]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/redPacketWithdrawal" },
     [UIID.DoubleSpeed]: { layer: LayerType.PopUp, prefab: "gui/eliminate/prefab/doubleSpeed" },
-    [UIID.WithdrawRecord]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/withdrawRecord" },
-    [UIID.GameOver]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/gameOver" }
+    [UIID.GameOver]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/gameOver", vacancy: true, mask: true },
+    [UIID.Game]: { layer: LayerType.UI, prefab: "gui/eliminate/Game" },
+    [UIID.CashRebate]: { layer: LayerType.PopUp, prefab: "gui/eliminate/prefab/cashRebate" },
+    [UIID.DoubleRewards]: { layer: LayerType.PopUp, prefab: "gui/eliminate/prefab/doubleRewards" },
+    [UIID.GamePass]: { layer: LayerType.PopUp, prefab: "gui/eliminate/prefab/gamePass" },
+    [UIID.Reserve]: { layer: LayerType.PopUp, prefab: "gui/eliminate/prefab/reserve" },
+    [UIID.Verify]: { layer: LayerType.PopUp, prefab: "gui/eliminate/prefab/verify" },
+    [UIID.WithdrawRecord]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/withdrawalRecord" },
+    [UIID.WechatWithdraw]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/wechatWithdrawal" },
+
+
 }

+ 9 - 0
assets/script/game/eliminate/ui.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "42ee4e54-497d-47ad-927a-7e88ad3401ce",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

File diff suppressed because it is too large
+ 2211 - 0
assets/script/game/eliminate/ui/List.ts


+ 9 - 0
assets/script/game/eliminate/ui/List.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "81487378-2e41-4aa4-a4a3-0b279719b37f",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 189 - 0
assets/script/game/eliminate/ui/ListItem.ts

@@ -0,0 +1,189 @@
+const { ccclass, property, disallowMultiple, menu, executionOrder } = _decorator;
+import { Button, Component, Enum, EventHandler, Node, Sprite, SpriteFrame, Tween, UITransform, Vec3, _decorator, tween } from 'cc';
+import List from './List';
+
+enum SelectedType {
+    NONE = 0,
+    TOGGLE = 1,
+    SWITCH = 2,
+}
+
+@ccclass
+@disallowMultiple()
+@menu('List Item')
+@executionOrder(-5001)          // 先于List
+export default class ListItem extends Component {
+    /** 选择模式 */
+    @property({
+        type: Enum(SelectedType),
+        tooltip: '选择模式'
+    })
+    selectedMode: SelectedType = SelectedType.NONE;
+
+    /** 被选标志 */
+    @property({
+        type: Node, tooltip: '被选标识',
+        //@ts-ignore
+        visible() { return this.selectedMode > SelectedType.NONE }
+    })
+    selectedFlag: Node = null!;
+
+    /** 被选择的SpriteFrame */
+    @property({
+        type: SpriteFrame, tooltip: '被选择的SpriteFrame',
+        //@ts-ignore
+        visible() { return this.selectedMode == SelectedType.SWITCH }
+    })
+    selectedSpriteFrame: SpriteFrame = null!;
+
+    /** 未被选择的SpriteFrame */
+    _unselectedSpriteFrame: SpriteFrame = null!;
+
+    /** 自适应尺寸 */
+    @property({
+        tooltip: '自适应尺寸(宽或高)',
+    })
+    adaptiveSize: boolean = false;
+
+    //选择
+    _selected: boolean = false;
+    set selected(val: boolean) {
+        this._selected = val;
+        Tween
+        if (!this.selectedFlag)
+            return;
+        switch (this.selectedMode) {
+            case SelectedType.TOGGLE:
+                this.selectedFlag.active = val;
+                break;
+            case SelectedType.SWITCH:
+                let sp: Sprite = this.selectedFlag.getComponent(Sprite)!;
+                if (sp) {
+                    sp.spriteFrame = val ? this.selectedSpriteFrame : this._unselectedSpriteFrame;
+                }
+                break;
+        }
+    }
+    get selected() {
+        return this._selected;
+    }
+    // 按钮组件
+    private _btnCom: any;
+    get btnCom() {
+        if (!this._btnCom)
+            this._btnCom = this.node.getComponent(Button);
+        return this._btnCom;
+    }
+
+    /** 序列id */
+    listId: number = 0;
+    /** 依赖的List组件 */
+    list: List = null!;
+    /** 是否已经注册过事件 */
+    private _eventReg = false;
+
+    onLoad() {
+        // //没有按钮组件的话,selectedFlag无效
+        // if (!this.btnCom)
+        //     this.selectedMode == SelectedType.NONE;
+        //有选择模式时,保存相应的东西
+        if (this.selectedMode == SelectedType.SWITCH) {
+            let com: Sprite = this.selectedFlag.getComponent(Sprite)!;
+            this._unselectedSpriteFrame = com.spriteFrame!;
+        }
+    }
+
+    onDestroy() {
+        this.node.off(Node.EventType.SIZE_CHANGED, this._onSizeChange, this);
+    }
+
+    _registerEvent() {
+        if (!this._eventReg) {
+            if (this.btnCom && this.list.selectedMode > 0) {
+                this.btnCom.clickEvents.unshift(this.createEvt(this, 'onClickThis'));
+            }
+            if (this.adaptiveSize) {
+                this.node.on(Node.EventType.SIZE_CHANGED, this._onSizeChange, this);
+            }
+            this._eventReg = true;
+        }
+    }
+
+    _onSizeChange() {
+        this.list._onItemAdaptive(this.node);
+    }
+
+    /**
+     * 创建事件
+     * @param {cc.Component} component 组件脚本
+     * @param {string} handlerName 触发函数名称
+     * @param {cc.Node} node 组件所在node(不传的情况下取component.node)
+     * @returns cc.Component.EventHandler
+     */
+    createEvt(component: Component, handlerName: string, node: Node = null!) {
+        if (!component.isValid)
+            return;//有些异步加载的,节点以及销毁了。
+
+        //@ts-ignore
+        component['comName'] = component['comName'] || component.name.match(/\<(.*?)\>/g).pop().replace(/\<|>/g, '');
+        let evt = new EventHandler();
+        evt.target = node || component.node;
+        //@ts-ignore
+        evt.component = component['comName'];
+        evt.handler = handlerName;
+        return evt;
+    }
+
+    /** 动画显示 */
+    showAni(aniType: number, callFunc: Function, del: boolean) {
+        let t: any = this;
+        let twe: Tween<Node>;
+        let ut: UITransform = t.node.getComponent(UITransform);
+        switch (aniType) {
+            case 0: //向上消失
+                twe = tween(t.node)
+                    .to(.2, { scale: new Vec3(.7, .7) })
+                    .by(.3, { position: new Vec3(0, ut.height * 2) });
+                break;
+            case 1: //向右消失
+                twe = tween(t.node)
+                    .to(.2, { scale: new Vec3(.7, .7) })
+                    .by(.3, { position: new Vec3(ut.width * 2, 0) });
+                break;
+            case 2: //向下消失
+                twe = tween(t.node)
+                    .to(.2, { scale: new Vec3(.7, .7) })
+                    .by(.3, { position: new Vec3(0, ut.height * -2) });
+                break;
+            case 3: //向左消失
+                twe = tween(t.node)
+                    .to(.2, { scale: new Vec3(.7, .7) })
+                    .by(.3, { position: new Vec3(ut.width * -2, 0) });
+                break;
+            default: //默认:缩小消失
+                twe = tween(t.node)
+                    .to(.3, { scale: new Vec3(.1, .1) });
+                break;
+        }
+
+        if (callFunc || del) {
+            twe.call(() => {
+                if (del) {
+                    t.list._delSingleItem(t.node);
+                    for (let n: number = t.list.displayData.length - 1; n >= 0; n--) {
+                        if (t.list.displayData[n].id == t.listId) {
+                            t.list.displayData.splice(n, 1);
+                            break;
+                        }
+                    }
+                }
+                callFunc();
+            });
+        }
+        twe.start();
+    }
+
+    onClickThis() {
+        this.list.selectedId = this.listId;
+    }
+}

+ 9 - 0
assets/script/game/eliminate/ui/ListItem.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "95212132-71ca-428f-8105-3ca319accec6",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 20 - 1
assets/script/game/eliminate/view/CashRebateView.ts

@@ -2,18 +2,37 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 11:45:43
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-21 11:55:27
+ * @LastEditTime: 2025-03-28 14:08:25
  * @Description: 提现必返
  */
+import { Label } from 'cc';
 import { _decorator } from 'cc';
+import { oops } from 'db://oops-framework/core/Oops';
 import { GameComponent } from "db://oops-framework/module/common/GameComponent";
+import { UIID } from '../../common/config/GameUIConfig';
 
 const { ccclass, property } = _decorator;
 
 /** 显示对象控制 */
 @ccclass('CashRebateView')
 export class CashRebateView extends GameComponent {
+    private _num: number = 0;
+    private lab_num: Label = null!;
     protected start() {
+        this.lab_num = this.node.getChildByPath("Sprite/lab_num")!.uiLabel;
+    }
+
+    private btn_ok() {
+
+
 
     }
+
+    private btn_close() {
+        //看广告
+
+        oops.gui.remove(UIID.CashRebate);
+
+    }
+
 }

+ 84 - 50
assets/script/game/eliminate/view/EliminateViewComp.ts

@@ -2,34 +2,18 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:01:09
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-27 18:40:24
+ * @LastEditTime: 2025-03-28 11:47:41
  * @Description: 消除游戏主场景
  */
-import { _decorator } from "cc";
+import { _decorator, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, Toggle, tween, UITransform, Vec2, Vec3, Widget } from "cc";
+import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
 import { oops } from "db://oops-framework/core/Oops";
 import { ecs } from "db://oops-framework/libs/ecs/ECS";
+import { LabelChange } from "db://oops-framework/libs/gui/label/LabelChange";
 import { CCComp } from "db://oops-framework/module/common/CCComp";
+import { GameEvent } from "../../common/config/GameEvent";
 import { UIID } from "../../common/config/GameUIConfig";
-import { Node } from "cc";
-import { Toggle } from "cc";
-import { ToggleContainer } from "cc";
-import { Prefab } from "cc";
-import { LabelChange } from "db://oops-framework/libs/gui/label/LabelChange";
-import { Label } from "cc";
-import { Vec3 } from "cc";
 import { BlockItemView } from "./BlockItemView";
-import { UITransform } from "cc";
-import { instantiate } from "cc";
-import { Sprite } from "cc";
-import { Color } from "cc";
-import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
-import { Widget } from "cc";
-import { JsonAsset } from "cc";
-import { randomRangeInt } from "cc";
-import { EventTouch } from "cc";
-import { Vec2 } from "cc";
-import { tween } from "cc";
-import { GameEvent } from "../../common/config/GameEvent";
 
 const { ccclass, property } = _decorator;
 
@@ -211,6 +195,7 @@ export class EliminateViewComp extends CCComp {
         await this.loadConfig();
         this.initGrid();
         this.initData();
+        this.addEventList();
     }
 
 
@@ -233,6 +218,20 @@ export class EliminateViewComp extends CCComp {
         this.autoOnToggle = toggle.getComponent(Toggle)!;
         this.lab_speed = this.node.getChildByPath("Scene/Bottom/btn_double/lab_time")!.uiLabel;
         this.lab_speed.string = "二倍速"
+
+        // this.brickNode.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
+        //     const touch = event.touch;
+        //     console.log("iiiiii", touch)
+
+        // }, this);
+        // this.brickNode.on(Node.EventType.TOUCH_MOVE, () => {
+
+        //     console.log("22222")
+
+        // }, this);
+        // this.brickNode.on(Node.EventType.TOUCH_END, () => {
+        //     console.log("333333")
+        // }, this);
     }
 
 
@@ -481,8 +480,11 @@ export class EliminateViewComp extends CCComp {
         if (this.brickNode) {
             this.brickNode.addChild(brickNode)
         }
-        brickData.brickNode = brickNode
+        brickData.brickNode = brickNode;
         // 方块间隔
+
+        //这里修改一下,分别放到3个Node中,然后
+
         let offset = 220
         if (this.brickNum % 2 === 1) {
             const middleNum = Math.floor(this.brickNum / 2) + 1
@@ -494,18 +496,16 @@ export class EliminateViewComp extends CCComp {
             }
         }
         if (brickData && brickData.brickNode) {
-            let width = 0;
-            if (this.brickNode) {
-                width = this.brickNode.getComponent(UITransform)!.width;
-            }
             brickData.brickNode.setPosition(offset, 0)
             brickData.brickNode.scale_x = 0.6;
             brickData.brickNode.scale_y = 0.6;
             brickData.brickInitPos = brickData.brickNode.getWorldPosition()
-            this.brickAddEvent(brickData);
         }
+        this.brickAddEvent(brickData);
     }
 
+
+
     // 每个item生成独立的方块节点
     generateBrick(brickKey: string, randomIndex: number) {
         const brickConfig = this.brickConfig['bricks'][brickKey]
@@ -532,14 +532,17 @@ export class EliminateViewComp extends CCComp {
         // 生成独立的方块节点
         const brickNode = new Node()
         brickNode.name = brickKey
+        // 设置方块大小
         const transformCom: UITransform = brickNode.addComponent(UITransform)
         transformCom.setContentSize(
             this.itemSize * columnNum,
             this.itemSize * rowNum
         )
         transformCom.setAnchorPoint(0.5, 0.5)
+
+        // 设置方块位置
         const gridPrefab = this.itemPrefabs[randomIndex]
-        //生成对应的配置方块
+        //生成对应的配置方块设置地址
         brickConfig['gridConfig'].forEach((gridConfigData: GridConfigData) => {
             const gridNode = new Node()
             gridNode.name = 'grid'
@@ -559,13 +562,17 @@ export class EliminateViewComp extends CCComp {
                     this.itemSize,
                 )
             }
-            node.on(Node.EventType.TOUCH_END, () => {
-                console.log("结束")
-            })
-            // 设置位置
             node.setPosition(Vec3.ZERO)
+            node.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
+                event.preventSwallow = true;
+            }, this);
+            node.on(Node.EventType.TOUCH_MOVE, (event: EventTouch) => {
+                event.preventSwallow = true;
+            }, this);
+            node.on(Node.EventType.TOUCH_END, (event: EventTouch) => {
+                event.preventSwallow = true;
+            }, this);
         })
-
         return brickNode
     }
 
@@ -574,21 +581,34 @@ export class EliminateViewComp extends CCComp {
     brickAddEvent(brickData: BrickData) {
         const brickNode = brickData.brickNode
         if (!brickNode) {
-            console.log("打印进这里来了")
+            console.error("brickNode为空,无法添加事件");
             return
         }
+
+        // 确保节点可交互
+        brickNode.active = true;
+
+        // 移除可能存在的旧事件监听器,防止重复添加
+        brickNode.off(Node.EventType.TOUCH_START);
+        brickNode.off(Node.EventType.TOUCH_MOVE);
+        brickNode.off(Node.EventType.TOUCH_END);
+
+        // 添加调试日志
+        console.log(`为节点 ${brickNode.name} 添加触摸事件监听器`);
+
+        // 添加触摸开始事件
         brickNode.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
-            // if (this.adShowingFlag) return
+            console.log("触发TOUCH_START事件");
             // 未操作完时不能操作下一个方块
             if (this.editingFlag) return
             this.touchStartFlag = true
             this.editingFlag = true
             this.editingData.brickData = null
             this.editingData.gridList.length = 0
-            // 隐藏游戏提示
-            // this.gameTipNode.active = false
+
             // 记录开始触摸的位置,用于结束触摸时,判断位置是否是单击
             this.touchStartLocation.set(event.getUILocation())
+
             // 添加到移动节点里进行移动
             const pos = brickNode.getWorldPosition()
             brickNode.setParent(this.moveNode)
@@ -605,6 +625,7 @@ export class EliminateViewComp extends CCComp {
             } else {
                 console.error("bricksList not find brickData:", brickData)
             }
+
             // 清除旋转数据
             if (this.rotateFlag && this.rotateBrickData !== this.editingData.brickData) {
                 this.rotateFlag = false
@@ -613,11 +634,14 @@ export class EliminateViewComp extends CCComp {
                     this.rotateNode.children.forEach(node => { node.destroy() })
                 }
             }
-        })
-        // 触摸移动时
+        }, this);
+
+        // 触摸移动事件
         brickNode.on(Node.EventType.TOUCH_MOVE, (event: EventTouch) => {
+
             // 防止如放回方块回弹动画时,已经触摸在另一个方块上面,从而导致异常错误
             if (this.editingData.brickData !== brickData) return
+
             // 清除旋转数据
             if (event.getUILocation().subtract(this.touchStartLocation).length() >= this.rotateFaultTolerant) {
                 this.rotateFlag = false
@@ -626,12 +650,16 @@ export class EliminateViewComp extends CCComp {
                     this.rotateNode.children.forEach(node => { node.destroy() })
                 }
             }
+
             // 格子颜色恢复
             this.gridColorRecovery()
+
             // 移动
             brickNode.setWorldPosition(brickNode.getWorldPosition().add(event.getUIDelta().toVec3()))
+
             // 每次移动重置数据
             this.editingData.gridList.length = 0
+
             // 实时获取方块位置判断在哪个格子上
             const tempGridList: GridData[] = []
             brickNode.children.forEach((brickGridNode) => {
@@ -653,6 +681,7 @@ export class EliminateViewComp extends CCComp {
                 }
                 tempGridList.push(gridData)
             })
+
             // 检查整体情况
             let checkFlag = false
             if (
@@ -664,6 +693,7 @@ export class EliminateViewComp extends CCComp {
                     this.editingData.gridList.push(gridData)
                 })
             }
+
             // 格子给用户提示
             tempGridList.forEach((gridData) => {
                 if (gridData.status !== CellState.EMPTY) {
@@ -678,18 +708,22 @@ export class EliminateViewComp extends CCComp {
                 // 用于恢复格子
                 this.gridColorList.push(gridData)
             })
-        })
+        }, this);
 
-        // 触摸结束
+        // 触摸结束事件
         brickNode.on(Node.EventType.TOUCH_END, (event: EventTouch) => {
-            console.log("移动结束数据查看", this.editingData.gridList.length);
-            console.log("brickData数据查看", this.editingData.brickData);
+            console.log("触发TOUCH_END事件", this.touchStartFlag);
+
+            // 防止事件冒泡
+            event.propagationStopped = true;
+
             // 当连击很快时,会出现1次start,2次end情况,为了避免所以通过标志位表示是一个连贯操作
             if (!this.touchStartFlag) return
             this.touchStartFlag = false
-            // console.log("TOUCH_END", this.editingFlag, this.editingData.brickData.index)
+
             // 防止如放回方块回弹动画时,已经触摸在另一个方块上面,从而导致异常错误
             if (this.editingData.brickData !== brickData) return
+
             // 第二次单击,旋转
             if (this.rotateFlag) {
                 const brickData = this.editingData.brickData
@@ -698,7 +732,6 @@ export class EliminateViewComp extends CCComp {
                 this.bricksList.push(brickData)
                 if (this.brickNode && brickData.brickNode) {
                     this.brickNode.addChild(brickData.brickNode)
-                    // brickData.brickNode.setWorldPosition(brickData.brickInitPos)
                     tween(brickData.brickNode)
                         .to(0.2, {
                             worldPosition: brickData.brickInitPos,
@@ -740,7 +773,7 @@ export class EliminateViewComp extends CCComp {
             }
             // 方块回到待选区
             else {
-                console.log("返回待选区域")
+                console.log("返回待选区域")
                 const brickData = this.editingData.brickData
                 this.bricksList.push(brickData)
                 // this.audioManager.playMoveFail()
@@ -761,6 +794,7 @@ export class EliminateViewComp extends CCComp {
                         .start();
                 }
             }
+
             // 旋转标志位
             if (
                 !this.rotateFlag &&
@@ -771,18 +805,18 @@ export class EliminateViewComp extends CCComp {
                 this.rotateFlag = true
                 this.rotateBrickData = this.editingData.brickData;
                 if (this.rotateBrickData.brickNode) {
-                    const prosition = this.rotateBrickData.brickNode.getWorldPosition()
+                    const position = this.rotateBrickData.brickNode.getWorldPosition()
                     const rotateNode = instantiate(this.rotatePrefab)
                     if (this.rotateNode && rotateNode) {
                         const instantiatedRotateNode = instantiate(rotateNode);
                         this.rotateNode.addChild(instantiatedRotateNode);
-                        instantiatedRotateNode.setWorldPosition(prosition)
+                        instantiatedRotateNode.setWorldPosition(position)
                     }
                 }
             }
             // 格子颜色恢复
             this.gridColorRecovery();
-        })
+        }, this);
     }
 
     //格子颜色恢复
@@ -1469,7 +1503,7 @@ export class EliminateViewComp extends CCComp {
     private reopenGrid() {
         for (let rowIndex = 0; rowIndex < this.rows; rowIndex++) {
             for (let columnIndex = 0; columnIndex < this.cols; columnIndex++) {
-                this.gridList[rowIndex][columnIndex].status = CellState.FILLED
+                this.gridList[rowIndex][columnIndex].status = CellState.EMPTY
                 this.generateGrid(this.gridList[rowIndex][columnIndex])
             }
         }

+ 4 - 0
assets/script/game/eliminate/view/WechatWithdrawalViewComp.ts

@@ -33,5 +33,9 @@ export class WechatWithdrawalViewComp extends CCComp {
         oops.gui.remove(UIID.WechatWithdraw);
     }
 
+    private btn_record() {
+        oops.gui.open(UIID.WithdrawRecord);
+    }
+
 
 }

+ 49 - 2
assets/script/game/eliminate/view/WithdrawalRecordViewComp.ts

@@ -2,12 +2,16 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 10:17:49
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-21 14:30:48
+ * @LastEditTime: 2025-03-28 14:57:51
  * @Description: 提现记录
  */
-import { _decorator } from "cc";
+import { _decorator, Node } from "cc";
 import { ecs } from "db://oops-framework/libs/ecs/ECS";
 import { CCComp } from "db://oops-framework/module/common/CCComp";
+import List from "../ui/List";
+import { Label } from "cc";
+import { oops } from "db://oops-framework/core/Oops";
+import { UIID } from "../../common/config/GameUIConfig";
 
 const { ccclass, property } = _decorator;
 
@@ -16,10 +20,53 @@ const { ccclass, property } = _decorator;
 @ecs.register('WithdrawalRecordView', false)
 export class WithdrawalRecordViewComp extends CCComp {
     /** 视图层逻辑代码分离演示 */
+    @property(List)
+    recordList: List = null!;
+
+    data: any[] = [];
+
     start() {
+
+        const data = {
+            state: "提现成功",
+            time: "2025-03-20 17:30",
+            money: 0.1,
+            type: "已打款"
+        }
+
+        for (let i = 0; i < 20; i++) {
+            data.money = i;
+            this.data.push(data);
+        }
+        this.recordList.numItems = this.data.length;
+
+        this.setButton();
         // const entity = this.ent as ecs.Entity;         // ecs.Entity 可转为当前模块的具体实体对象
     }
 
+
+    // 列表渲染器
+    private onListRender(item: Node, idx: number) {
+        // item.getComponentInChildren(Label)!.string = this.data[idx] + '';
+        const data = this.data[idx];
+        const stateLabel = item.getChildByName("lab_state")?.getComponent(Label);
+        if (stateLabel) stateLabel.string = data.state;
+
+        const timeLabel = item.getChildByName("lab_time")?.getComponent(Label);
+        if (timeLabel) timeLabel.string = data.time;
+
+        const moneyLabel = item.getChildByName("lab_money")?.getComponent(Label);
+        if (moneyLabel) moneyLabel.string = data.money + "元";
+
+        const typeLabel = item.getChildByName("lab_moneyState")?.getComponent(Label);
+        if (typeLabel) typeLabel.string = data.type;
+    }
+
+
+    private btn_back() {
+        oops.gui.remove(UIID.WithdrawRecord)
+    }
+
     /** 视图对象通过 ecs.Entity.remove(WithdrawalRecordViewComp) 删除组件是触发组件处理自定义释放逻辑 */
     reset() {
         this.node.destroy();

+ 3 - 1
assets/script/game/initialize/view/LoadingViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 16:23:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-24 11:19:38
+ * @LastEditTime: 2025-03-28 12:03:26
  * @Description: loading界面
  */
 import { _decorator, sys } from "cc";
@@ -16,6 +16,7 @@ import { UIID } from "../../common/config/GameUIConfig";
 import { AndroidMessageCenter } from '../../common/manager/AndroidMessageCenter';
 import { smc } from "../../common/SingletonModuleComp";
 import { EliminateViewComp } from "../../eliminate/view/EliminateViewComp";
+import { GameView } from "../../eliminate/view/GameView";
 
 const { ccclass, property } = _decorator;
 
@@ -123,6 +124,7 @@ export class LoadingViewComp extends CCVMParentComp {
         // 获取用户信息的多语言提示文本
         this.data.prompt = oops.language.getLangByID("loading_load_player");
         await ModuleUtil.addViewUiAsync(smc.account, EliminateViewComp, UIID.Eliminate);
+        // oops.gui.open(UIID.Game);
         ModuleUtil.removeViewUi(this.ent, LoadingViewComp, UIID.Loading);
     }