薛鸿潇 5 tahun lalu
induk
melakukan
8e29e16efa

+ 286 - 64
assets/resources/module/cashNormal/cashNormal.prefab

@@ -21,23 +21,23 @@
         "__id__": 2
       },
       {
-        "__id__": 32
+        "__id__": 35
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 38
+        "__id__": 44
       },
       {
-        "__id__": 39
+        "__id__": 45
       },
       {
-        "__id__": 40
+        "__id__": 46
       }
     ],
     "_prefab": {
-      "__id__": 41
+      "__id__": 47
     },
     "_opacity": 255,
     "_color": {
@@ -104,17 +104,17 @@
         "__id__": 12
       },
       {
-        "__id__": 21
+        "__id__": 24
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 30
+        "__id__": 33
       }
     ],
     "_prefab": {
-      "__id__": 31
+      "__id__": 34
     },
     "_opacity": 255,
     "_color": {
@@ -282,7 +282,7 @@
         "__id__": 7
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 10
@@ -501,19 +501,87 @@
     "_children": [
       {
         "__id__": 13
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 22
+      }
+    ],
+    "_prefab": {
+      "__id__": 23
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 750,
+      "height": 140
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        596.935,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "自动布局",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 12
+    },
+    "_children": [
+      {
+        "__id__": 14
       },
       {
-        "__id__": 16
+        "__id__": 17
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 19
+        "__id__": 20
       }
     ],
     "_prefab": {
-      "__id__": 20
+      "__id__": 21
     },
     "_opacity": 255,
     "_color": {
@@ -525,8 +593,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 720,
-      "height": 140
+      "width": 450.88,
+      "height": 150
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -538,7 +606,7 @@
       "ctor": "Float64Array",
       "array": [
         0,
-        452.869,
+        0,
         0,
         0,
         0,
@@ -567,17 +635,17 @@
     "_name": "累计提现",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 12
+      "__id__": 13
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 14
+        "__id__": 15
       }
     ],
     "_prefab": {
-      "__id__": 15
+      "__id__": 16
     },
     "_opacity": 255,
     "_color": {
@@ -589,8 +657,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 160,
-      "height": 50.4
+      "width": 225,
+      "height": 56.7
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -601,8 +669,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        -131.497,
-        1.252,
+        -112.94,
+        1,
         0,
         0,
         0,
@@ -631,7 +699,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 13
+      "__id__": 14
     },
     "_enabled": true,
     "_materials": [
@@ -643,8 +711,8 @@
     "_dstBlendFactor": 771,
     "_string": "累计提现:",
     "_N$string": "累计提现:",
-    "_fontSize": 32,
-    "_lineHeight": 40,
+    "_fontSize": 45,
+    "_lineHeight": 45,
     "_enableWrapText": true,
     "_N$file": {
       "__uuid__": "0bc2f1e8-1dd4-45ba-8f7e-36c47dde4152"
@@ -669,7 +737,7 @@
     "asset": {
       "__uuid__": "18ca563c-e8dc-4633-bf04-5fdd65113bb0"
     },
-    "fileId": "e5zd+xERZCLqOsiiTz5ez+",
+    "fileId": "b7MKBj7FJPQoBHSldOxkJJ",
     "sync": false
   },
   {
@@ -677,17 +745,17 @@
     "_name": "lbl累计提现",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 12
+      "__id__": 13
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 17
+        "__id__": 18
       }
     ],
     "_prefab": {
-      "__id__": 18
+      "__id__": 19
     },
     "_opacity": 255,
     "_color": {
@@ -711,8 +779,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        75.976,
-        3.08,
+        112.5,
+        1,
         0,
         0,
         0,
@@ -741,7 +809,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 16
+      "__id__": 17
     },
     "_enabled": true,
     "_materials": [
@@ -779,7 +847,50 @@
     "asset": {
       "__uuid__": "18ca563c-e8dc-4633-bf04-5fdd65113bb0"
     },
-    "fileId": "85BNm1Km9HD7zlwBbxmJyM",
+    "fileId": "caHE3GHHtJ+KSW2kt1qsRj",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Layout",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 13
+    },
+    "_enabled": true,
+    "_layoutSize": {
+      "__type__": "cc.Size",
+      "width": 450.88,
+      "height": 150
+    },
+    "_resize": 1,
+    "_N$layoutType": 1,
+    "_N$cellSize": {
+      "__type__": "cc.Size",
+      "width": 40,
+      "height": 40
+    },
+    "_N$startAxis": 0,
+    "_N$paddingLeft": 0,
+    "_N$paddingRight": 0,
+    "_N$paddingTop": 0,
+    "_N$paddingBottom": 0,
+    "_N$spacingX": 0,
+    "_N$spacingY": 0,
+    "_N$verticalDirection": 1,
+    "_N$horizontalDirection": 0,
+    "_N$affectedByScale": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "18ca563c-e8dc-4633-bf04-5fdd65113bb0"
+    },
+    "fileId": "002ddBz5xFH4HW+p1HTA2v",
     "sync": false
   },
   {
@@ -834,20 +945,20 @@
     },
     "_children": [
       {
-        "__id__": 22
+        "__id__": 25
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 27
+        "__id__": 30
       },
       {
-        "__id__": 28
+        "__id__": 31
       }
     ],
     "_prefab": {
-      "__id__": 29
+      "__id__": 32
     },
     "_opacity": 255,
     "_color": {
@@ -860,7 +971,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 720,
-      "height": 1000
+      "height": 1150
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -872,7 +983,7 @@
       "ctor": "Float64Array",
       "array": [
         0,
-        -126.654,
+        -69.584,
         0,
         0,
         0,
@@ -901,21 +1012,21 @@
     "_name": "view",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 21
+      "__id__": 24
     },
     "_children": [
       {
-        "__id__": 23
+        "__id__": 26
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 25
+        "__id__": 28
       }
     ],
     "_prefab": {
-      "__id__": 26
+      "__id__": 29
     },
     "_opacity": 255,
     "_color": {
@@ -928,7 +1039,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 720,
-      "height": 1000
+      "height": 1150
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -969,13 +1080,13 @@
     "_name": "content",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 22
+      "__id__": 25
     },
     "_children": [],
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 24
+      "__id__": 27
     },
     "_opacity": 255,
     "_color": {
@@ -988,7 +1099,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 720,
-      "height": 1000
+      "height": 1150
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1000,7 +1111,7 @@
       "ctor": "Float64Array",
       "array": [
         0,
-        500,
+        575,
         0,
         0,
         0,
@@ -1040,7 +1151,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 22
+      "__id__": 25
     },
     "_enabled": true,
     "_materials": [
@@ -1071,7 +1182,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 21
+      "__id__": 24
     },
     "_enabled": true,
     "horizontal": false,
@@ -1083,10 +1194,10 @@
     "scrollEvents": [],
     "cancelInnerEvents": false,
     "_N$content": {
-      "__id__": 23
+      "__id__": 26
     },
     "content": {
-      "__id__": 23
+      "__id__": 26
     },
     "_N$horizontalScrollBar": null,
     "_N$verticalScrollBar": null,
@@ -1097,7 +1208,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 21
+      "__id__": 24
     },
     "_enabled": true,
     "pre_item": [
@@ -1169,17 +1280,20 @@
     },
     "_children": [
       {
-        "__id__": 33
+        "__id__": 36
+      },
+      {
+        "__id__": 39
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 36
+        "__id__": 42
       }
     ],
     "_prefab": {
-      "__id__": 37
+      "__id__": 43
     },
     "_opacity": 255,
     "_color": {
@@ -1233,17 +1347,17 @@
     "_name": "按钮纹理",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 32
+      "__id__": 35
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 34
+        "__id__": 37
       }
     ],
     "_prefab": {
-      "__id__": 35
+      "__id__": 38
     },
     "_opacity": 255,
     "_color": {
@@ -1297,7 +1411,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 33
+      "__id__": 36
     },
     "_enabled": true,
     "_materials": [
@@ -1336,11 +1450,119 @@
     "sync": false
   },
   {
+    "__type__": "cc.Node",
+    "_name": "lbl描述",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 35
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 40
+      }
+    ],
+    "_prefab": {
+      "__id__": 41
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 35.04,
+      "height": 100.8
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 39
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_string": "<",
+    "_N$string": "<",
+    "_fontSize": 60,
+    "_lineHeight": 80,
+    "_enableWrapText": true,
+    "_N$file": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
+    "_N$horizontalAlign": 1,
+    "_N$verticalAlign": 1,
+    "_N$fontFamily": "Arial",
+    "_N$overflow": 0,
+    "_N$cacheMode": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "18ca563c-e8dc-4633-bf04-5fdd65113bb0"
+    },
+    "fileId": "98tseSk3tBdIy20CSGEfgX",
+    "sync": false
+  },
+  {
     "__type__": "cdc50kCRVVBa5gcp4XXxVO+",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 32
+      "__id__": 35
     },
     "_enabled": true,
     "node_panel": {
@@ -1397,10 +1619,10 @@
     },
     "_enabled": true,
     "sroll_view": {
-      "__id__": 27
+      "__id__": 30
     },
     "lbl_rmb_total": {
-      "__id__": 17
+      "__id__": 18
     },
     "_id": ""
   },

+ 40 - 0
assets/script/game/data/module/RedBagCashData.ts

@@ -20,6 +20,7 @@ export class RedBagCashData extends Data {
                 }
             });
             this.c_data = gData.gameData.configs.CashCfg;
+            this.sortList();
             this.init_list = true;
         }
         this.cash_bar = gData.gameData.getProp(GameProp.redBag_cash_bar);
@@ -32,6 +33,7 @@ export class RedBagCashData extends Data {
     public c_data: Array<CDataType> = [];
 
     /** 标志位:初始化指定列表 */
+    public old_index = null;
     /** 提现进度 */
     cash_bar: number = 0;
 
@@ -39,8 +41,46 @@ export class RedBagCashData extends Data {
      * 提现操作
      */
     public cashOP() {
+        /** 提现档位 */
+        const cash_index = this.cash_bar;
+        this.old_index = cash_index;
         this.cash_bar++;
         gData.gameData.setProp(GameProp.redBag_cash_bar, this.cash_bar);
+
+        // 扣除红包
+        this.sortList();
+        let item_data = this.getItemDataByIndex(cash_index);
+        gData.gameData.gameData.redMoney -= item_data.type_value;
+
+    }
+
+    /**
+     * 排序
+     * - 已提条目放最后
+     */
+    private sortList() {
+        const l_count = this.c_data.length;
+        for (let i = 0; i < l_count; i++) {
+            if (this.c_data[i].index <= gData.redBagCash.cash_bar) {
+                let item_data = this.c_data.splice(i, 1) as any;
+                this.c_data.push(item_data);
+            }
+        }
+    }
+
+
+    /**
+     * 获取条目,通过index
+     * @param cash_index 对应id
+     * @returns 
+     */
+    private getItemDataByIndex(cash_index: number): CDataType {
+        const l_count = this.c_data.length;
+        for (let i = 0; i < l_count; i++) {
+            if (this.c_data[i].index === cash_index) {
+                return this.c_data[i]
+            }
+        }
     }
 
     // /** 客户端造的假数据 */

+ 1 - 1
assets/script/game/module/module/cashNormal/CashNormalItem.ts

@@ -32,7 +32,7 @@ export default class CashNormalItem extends cc.Component {
 
         this.lbl_cash_type.string = '签到提现';
         this.lbl_cash_time.string = '2021.03.05';
-        this.lbl_red_ma.string = '红包码:' + "AABB左右左右BABA";
+        this.lbl_red_ma.string = '红包码:' + "AABBCC";
         this.lbl_rmb_value.string = '¥' + 0.30 + '元';
     }
 }

+ 11 - 1
assets/script/game/module/module/redBagCash/RedBagCash.ts

@@ -27,13 +27,23 @@ export default class RedBagCash extends cc.Component {
         this.initScrollView();
     }
 
-    // update (dt) {}
+    update(dt) {
+        if (gData.redBagCash.old_index) {
+            // 指定条目数据刷新
+            const last_index = gData.redBagCash.old_index;
+            const next_index = gData.redBagCash.old_index + 1;
+            this.tableview.resetItemData(last_index, gData.sign.list_data[last_index]);
+            if (gData.sign.list_data[next_index]) this.tableview.resetItemData(gData.redBagCash.old_index + 1, gData.sign.list_data[next_index]);
+        }
+    }
+
     /**
      * 初始化滚动视图
      */
     private initScrollView() {
         this.sroll_view.node.emit('srollview-init', gData.redBagCash.c_data);
     }
+
     /**
      * 初始化货币数量
      */

+ 2 - 2
assets/script/game/module/module/redBagCash/RedBagCashItem.ts

@@ -73,12 +73,12 @@ export default class RedBagCashItem extends cc.Component {
      */
     private clickCashOP() {
         // if (!gData.redBagCash.cash_enable) return;
-        if (this.item_data.index > gData.redBagCash.cash_bar) {
+        if (this.item_data.index > gData.redBagCash.cash_bar + 1) {
             mk.tip.pop('请按顺序提现');
             return;
         }
-        cc.log('提现成功')
         gData.redBagCash.cashOP();
+        cc.log('红包现成功')
     }
 
 }