薛鸿潇 5 лет назад
Родитель
Сommit
19ffb0b417

+ 123 - 7
assets/resources/module/redBagCode/redBagCode.prefab

@@ -24,20 +24,20 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 26
+        "__id__": 29
       },
       {
-        "__id__": 27
+        "__id__": 30
       },
       {
-        "__id__": 28
+        "__id__": 31
       },
       {
-        "__id__": 29
+        "__id__": 32
       }
     ],
     "_prefab": {
-      "__id__": 30
+      "__id__": 33
     },
     "_opacity": 255,
     "_color": {
@@ -105,16 +105,19 @@
       },
       {
         "__id__": 18
+      },
+      {
+        "__id__": 24
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 24
+        "__id__": 27
       }
     ],
     "_prefab": {
-      "__id__": 25
+      "__id__": 28
     },
     "_opacity": 255,
     "_color": {
@@ -876,6 +879,116 @@
     "sync": false
   },
   {
+    "__type__": "cc.Node",
+    "_name": "无提现描述",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 25
+      }
+    ],
+    "_prefab": {
+      "__id__": 26
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 280,
+      "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__": 24
+    },
+    "_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__": "157bf3d2-0395-4138-a922-782117d5c979"
+    },
+    "fileId": "1aVR/nJphJsopF7iPpbT+e",
+    "sync": false
+  },
+  {
     "__type__": "cc.Widget",
     "_name": "",
     "_objFlags": 0,
@@ -924,6 +1037,9 @@
     "scroll_view": {
       "__id__": 15
     },
+    "lbl_none": {
+      "__id__": 25
+    },
     "_id": ""
   },
   {

+ 5 - 5
assets/script/game/data/module/PigBankData.ts

@@ -25,14 +25,14 @@ export class PigBankData extends Data {
     /** 标志位:是否需要刷新数据 */
     public init_data: boolean = true;
     /** 是否可提现 */
-    private _cash_enable: boolean = true;
-    set cash_enable(bool: boolean) {
+    private _cash_enable: number = 0;
+    set cash_enable(bool: number) {
         if (this._cash_enable != bool) {
             this._cash_enable = bool;
             this.init_data = true;
         }
     }
-    get cash_enable(): boolean {
+    get cash_enable(): number {
         return this._cash_enable;
     }
 
@@ -64,11 +64,11 @@ export class PigBankData extends Data {
         }
 
         if (response.CashMode == 0) {//星云打款
-
+            // mk.tip.pop('')
         }
         else if (response.CashMode == 1) {//公众号打款
 
         }
-        this.cash_enable = false;
+        this.cash_enable = 0;
     }
 }

+ 5 - 2
assets/script/game/module/pigBank/PigBank.ts

@@ -22,7 +22,7 @@ export default class PigBank extends cc.Component {
 
     start() {
         this.initCashDesc();
-        mk.audio.playEffect("pigBank",false);
+        mk.audio.playEffect("pigBank", false);
     }
 
     update(dt) {
@@ -74,7 +74,10 @@ export default class PigBank extends cc.Component {
      */
     private clickCashOP() {
         mk.audio.playEffect("button");
-        if (!gData.pigbank.cash_enable) return;
+        if (!gData.pigbank.cash_enable) {
+            mk.tip.pop('满' + gData.pigbank.cash_min_limit + '元可提现')
+            return;
+        }
         gData.pigbank.cashOP();
         mk.ui.closePanel(this.node.name);
     }

+ 15 - 1
assets/script/game/module/redBagCode/RedBagCode.ts

@@ -9,7 +9,8 @@ export default class RedBagCode extends cc.Component {
 
     @property({ type: cc.ScrollView, displayName: '滚动视图' })
     private scroll_view: cc.ScrollView = null!;
-
+    @property({ displayName: 'lbl暂无提现', type: cc.Label })
+    private lbl_none: cc.Label = null;
     // onLoad () {}
 
     start() {
@@ -23,5 +24,18 @@ export default class RedBagCode extends cc.Component {
     private initList() {
         let list_data = gData.cashNormal.getListDataHavCode();
         this.scroll_view.node.emit('srollview-init', list_data)
+        this.initNoneItem(list_data);
+    }
+
+    /**
+     * 初始化无条目时的提示
+     */
+    private initNoneItem(list_data) {
+        const count = list_data.length;
+        if (count) {
+            this.lbl_none.node.active = false;
+        } else {
+            this.lbl_none.node.active = true;
+        }
     }
 }