Преглед изворни кода

添加无记录时的显示样式

薛鸿潇 пре 5 година
родитељ
комит
5edf63162f

+ 136 - 18
assets/resources/module/cashNormal/cashNormal.prefab

@@ -21,23 +21,23 @@
         "__id__": 2
       },
       {
-        "__id__": 39
+        "__id__": 42
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 46
+        "__id__": 49
       },
       {
-        "__id__": 47
+        "__id__": 50
       },
       {
-        "__id__": 48
+        "__id__": 51
       }
     ],
     "_prefab": {
-      "__id__": 49
+      "__id__": 52
     },
     "_opacity": 255,
     "_color": {
@@ -105,16 +105,19 @@
       },
       {
         "__id__": 26
+      },
+      {
+        "__id__": 37
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 37
+        "__id__": 40
       }
     ],
     "_prefab": {
-      "__id__": 38
+      "__id__": 41
     },
     "_opacity": 255,
     "_color": {
@@ -1360,6 +1363,116 @@
     "sync": false
   },
   {
+    "__type__": "cc.Node",
+    "_name": "无提现描述",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 38
+      }
+    ],
+    "_prefab": {
+      "__id__": 39
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 240,
+      "height": 50.4
+    },
+    "_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__": 37
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_string": "暂无提现记录",
+    "_N$string": "暂无提现记录",
+    "_fontSize": 40,
+    "_lineHeight": 40,
+    "_enableWrapText": true,
+    "_N$file": {
+      "__uuid__": "0bc2f1e8-1dd4-45ba-8f7e-36c47dde4152"
+    },
+    "_isSystemFontUsed": false,
+    "_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": "67vkHiDftAxIXeLHxuXEEu",
+    "sync": false
+  },
+  {
     "__type__": "cc.Widget",
     "_name": "",
     "_objFlags": 0,
@@ -1406,20 +1519,20 @@
     },
     "_children": [
       {
-        "__id__": 40
+        "__id__": 43
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 43
+        "__id__": 46
       },
       {
-        "__id__": 44
+        "__id__": 47
       }
     ],
     "_prefab": {
-      "__id__": 45
+      "__id__": 48
     },
     "_opacity": 255,
     "_color": {
@@ -1473,17 +1586,17 @@
     "_name": "按钮纹理",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 39
+      "__id__": 42
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 41
+        "__id__": 44
       }
     ],
     "_prefab": {
-      "__id__": 42
+      "__id__": 45
     },
     "_opacity": 255,
     "_color": {
@@ -1537,7 +1650,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 40
+      "__id__": 43
     },
     "_enabled": true,
     "_materials": [
@@ -1580,7 +1693,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 39
+      "__id__": 42
     },
     "_enabled": true,
     "node_panel": {
@@ -1595,7 +1708,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 39
+      "__id__": 42
     },
     "_enabled": true,
     "alignMode": 1,
@@ -1669,6 +1782,9 @@
     "lbl_rmb_total": {
       "__id__": 19
     },
+    "lbl_none": {
+      "__id__": 38
+    },
     "_id": ""
   },
   {
@@ -1686,7 +1802,9 @@
       "b": 0,
       "a": 120
     },
-    "design_block_node": null,
+    "design_block_node": {
+      "__id__": 37
+    },
     "bClickClose": false,
     "_id": ""
   },

+ 15 - 0
assets/script/game/module/cashNormal/CashNormal.ts

@@ -11,12 +11,15 @@ export default class CashNormal extends cc.Component {
     private scroll_view: cc.ScrollView = null!;
     @property({ displayName: 'lbl累计提现', type: cc.Label })
     private lbl_rmb_total: cc.Label = null;
+    @property({ displayName: 'lbl暂无提现', type: cc.Label })
+    private lbl_none: cc.Label = null;
 
     // onLoad () {}
 
     start() {
         this.initTotal();
         this.initScrollView();
+        this.initNoneItem();
     }
 
     // update (dt) {}
@@ -34,4 +37,16 @@ export default class CashNormal extends cc.Component {
     private initTotal() {
         this.lbl_rmb_total.string = '¥' + gData.cashNormal.receip_total_rmb + '元';
     }
+
+    /**
+     * 初始化无条目时的提示
+     */
+    private initNoneItem() {
+        const count = gData.cashNormal.list_data.length;
+        if (count) {
+            this.lbl_none.node.active = false;
+        } else {
+            this.lbl_none.node.active = true;
+        }
+    }
 }