Ver Fonte

存钱罐界面

薛鸿潇 há 5 anos atrás
pai
commit
852fd24ab8

+ 105 - 74
mk_framework/assets/resources/module/pigBank/pigBank.prefab

@@ -24,20 +24,20 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 92
+        "__id__": 94
       },
       {
-        "__id__": 93
+        "__id__": 95
       },
       {
-        "__id__": 94
+        "__id__": 96
       },
       {
-        "__id__": 95
+        "__id__": 97
       }
     ],
     "_prefab": {
-      "__id__": 96
+      "__id__": 98
     },
     "_opacity": 255,
     "_color": {
@@ -104,29 +104,29 @@
         "__id__": 47
       },
       {
-        "__id__": 55
+        "__id__": 56
       },
       {
-        "__id__": 60
+        "__id__": 61
       },
       {
-        "__id__": 69
+        "__id__": 70
       },
       {
-        "__id__": 72
+        "__id__": 73
       },
       {
-        "__id__": 75
+        "__id__": 77
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 90
+        "__id__": 92
       }
     ],
     "_prefab": {
-      "__id__": 91
+      "__id__": 93
     },
     "_opacity": 255,
     "_color": {
@@ -1820,7 +1820,7 @@
       }
     ],
     "_prefab": {
-      "__id__": 54
+      "__id__": 55
     },
     "_opacity": 255,
     "_color": {
@@ -1912,7 +1912,7 @@
       "ctor": "Float64Array",
       "array": [
         0,
-        9,
+        10,
         0,
         0,
         0,
@@ -2044,7 +2044,11 @@
     "_grayMaterial": null,
     "duration": 0.1,
     "zoomScale": 1.2,
-    "clickEvents": [],
+    "clickEvents": [
+      {
+        "__id__": 54
+      }
+    ],
     "_N$interactable": true,
     "_N$enableAutoGrayEffect": false,
     "_N$transition": 3,
@@ -2101,6 +2105,16 @@
     "_id": ""
   },
   {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "b7b79eT6/VPr5yd7mCH4hR7",
+    "handler": "cashOP",
+    "customEventData": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -2122,17 +2136,17 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 56
-      },
-      {
         "__id__": 57
       },
       {
         "__id__": 58
+      },
+      {
+        "__id__": 59
       }
     ],
     "_prefab": {
-      "__id__": 59
+      "__id__": 60
     },
     "_opacity": 255,
     "_color": {
@@ -2186,7 +2200,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 55
+      "__id__": 56
     },
     "_enabled": true,
     "panel_name": "help",
@@ -2200,7 +2214,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 55
+      "__id__": 56
     },
     "_enabled": true,
     "_materials": [
@@ -2232,7 +2246,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 55
+      "__id__": 56
     },
     "_enabled": true,
     "_normalMaterial": null,
@@ -2315,20 +2329,20 @@
     },
     "_children": [
       {
-        "__id__": 61
+        "__id__": 62
       },
       {
-        "__id__": 64
+        "__id__": 65
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 67
+        "__id__": 68
       }
     ],
     "_prefab": {
-      "__id__": 68
+      "__id__": 69
     },
     "_opacity": 255,
     "_color": {
@@ -2382,17 +2396,17 @@
     "_name": "绿色纸币",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 60
+      "__id__": 61
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 62
+        "__id__": 63
       }
     ],
     "_prefab": {
-      "__id__": 63
+      "__id__": 64
     },
     "_opacity": 255,
     "_color": {
@@ -2446,7 +2460,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 61
+      "__id__": 62
     },
     "_enabled": true,
     "_materials": [
@@ -2489,17 +2503,17 @@
     "_name": "存款数量",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 60
+      "__id__": 61
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 65
+        "__id__": 66
       }
     ],
     "_prefab": {
-      "__id__": 66
+      "__id__": 67
     },
     "_opacity": 255,
     "_color": {
@@ -2553,7 +2567,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 64
+      "__id__": 65
     },
     "_enabled": true,
     "_materials": [
@@ -2599,7 +2613,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 60
+      "__id__": 61
     },
     "_enabled": true,
     "_materials": [
@@ -2648,11 +2662,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 70
+        "__id__": 71
       }
     ],
     "_prefab": {
-      "__id__": 71
+      "__id__": 72
     },
     "_opacity": 255,
     "_color": {
@@ -2706,7 +2720,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 69
+      "__id__": 70
     },
     "_enabled": true,
     "_materials": [
@@ -2755,11 +2769,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 73
+        "__id__": 74
+      },
+      {
+        "__id__": 75
       }
     ],
     "_prefab": {
-      "__id__": 74
+      "__id__": 76
     },
     "_opacity": 255,
     "_color": {
@@ -2776,20 +2793,20 @@
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
+      "x": 0.43,
+      "y": 0.05
     },
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        145.489,
-        -107.972,
+        136.1,
+        -137.652,
         0,
         0,
         0,
-        0,
-        1,
+        0.03656993883114308,
+        0.9993310960707099,
         1,
         1,
         1
@@ -2799,7 +2816,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": 0
+      "z": 4.19154092523328
     },
     "_skewX": 0,
     "_skewY": 0,
@@ -2813,7 +2830,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 72
+      "__id__": 73
     },
     "_enabled": true,
     "_materials": [
@@ -2841,6 +2858,18 @@
     "_id": ""
   },
   {
+    "__type__": "93753AIt45HwoqU8o6Vee0w",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 73
+    },
+    "_enabled": true,
+    "angle": 15,
+    "time": 1,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -2860,23 +2889,23 @@
     },
     "_children": [
       {
-        "__id__": 76
+        "__id__": 78
       },
       {
-        "__id__": 80
+        "__id__": 82
       },
       {
-        "__id__": 84
+        "__id__": 86
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 88
+        "__id__": 90
       }
     ],
     "_prefab": {
-      "__id__": 89
+      "__id__": 91
     },
     "_opacity": 255,
     "_color": {
@@ -2930,20 +2959,20 @@
     "_name": "描述1",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 75
+      "__id__": 77
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 77
+        "__id__": 79
       },
       {
-        "__id__": 78
+        "__id__": 80
       }
     ],
     "_prefab": {
-      "__id__": 79
+      "__id__": 81
     },
     "_opacity": 255,
     "_color": {
@@ -2997,7 +3026,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 76
+      "__id__": 78
     },
     "_enabled": true,
     "_materials": [
@@ -3032,7 +3061,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 76
+      "__id__": 78
     },
     "_enabled": true,
     "_color": {
@@ -3061,20 +3090,20 @@
     "_name": "描述2",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 75
+      "__id__": 77
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 81
+        "__id__": 83
       },
       {
-        "__id__": 82
+        "__id__": 84
       }
     ],
     "_prefab": {
-      "__id__": 83
+      "__id__": 85
     },
     "_opacity": 255,
     "_color": {
@@ -3128,7 +3157,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 80
+      "__id__": 82
     },
     "_enabled": true,
     "_materials": [
@@ -3163,7 +3192,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 80
+      "__id__": 82
     },
     "_enabled": true,
     "_color": {
@@ -3192,20 +3221,20 @@
     "_name": "描述3",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 75
+      "__id__": 77
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 85
+        "__id__": 87
       },
       {
-        "__id__": 86
+        "__id__": 88
       }
     ],
     "_prefab": {
-      "__id__": 87
+      "__id__": 89
     },
     "_opacity": 255,
     "_color": {
@@ -3259,7 +3288,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 84
+      "__id__": 86
     },
     "_enabled": true,
     "_materials": [
@@ -3294,7 +3323,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 84
+      "__id__": 86
     },
     "_enabled": true,
     "_color": {
@@ -3323,7 +3352,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 75
+      "__id__": 77
     },
     "_enabled": true,
     "_layoutSize": {
@@ -3438,7 +3467,10 @@
       "__id__": 49
     },
     "lbl_deposit": {
-      "__id__": 65
+      "__id__": 66
+    },
+    "node_tip_anim": {
+      "__id__": 73
     },
     "_id": ""
   },
@@ -3458,7 +3490,6 @@
       "a": 120
     },
     "bClickClose": false,
-    "btn_close": null,
     "_id": ""
   },
   {

+ 12 - 0
mk_framework/assets/resources/module/pigBank/spine_prefab.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.2",
+  "uuid": "4bf7eaa3-d71c-45bb-88dc-d8527605cdf5",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 27 - 0
mk_framework/assets/resources/module/pigBank/spine_prefab/pig.atlas

@@ -0,0 +1,27 @@
+
+pig.png
+size: 427,355
+format: RGBA8888
+filter: Linear,Linear
+repeat: none
+icon_hb
+  rotate: false
+  xy: 360, 270
+  size: 65, 83
+  orig: 65, 83
+  offset: 0, 0
+  index: -1
+xing
+  rotate: false
+  xy: 360, 231
+  size: 33, 37
+  orig: 35, 39
+  offset: 1, 1
+  index: -1
+zhu
+  rotate: false
+  xy: 2, 2
+  size: 356, 351
+  orig: 356, 351
+  offset: 0, 0
+  index: -1

+ 5 - 0
mk_framework/assets/resources/module/pigBank/spine_prefab/pig.atlas.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "1.0.1",
+  "uuid": "97d51e7c-adeb-454b-8c93-1975eaf64dd4",
+  "subMetas": {}
+}

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
mk_framework/assets/resources/module/pigBank/spine_prefab/pig.json


+ 9 - 0
mk_framework/assets/resources/module/pigBank/spine_prefab/pig.json.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.3",
+  "uuid": "18ff1999-641d-40dc-bc3f-e4efbb12918a",
+  "textures": [
+    "c7809d04-48c8-49b4-aa64-2328c414ac7b"
+  ],
+  "scale": 1,
+  "subMetas": {}
+}

BIN
mk_framework/assets/resources/module/pigBank/spine_prefab/pig.png


+ 36 - 0
mk_framework/assets/resources/module/pigBank/spine_prefab/pig.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "c7809d04-48c8-49b4-aa64-2328c414ac7b",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 427,
+  "height": 355,
+  "platformSettings": {},
+  "subMetas": {
+    "pig": {
+      "ver": "1.0.4",
+      "uuid": "d40fb5e7-2ff6-484e-afef-30d1e3b133d9",
+      "rawTextureUuid": "c7809d04-48c8-49b4-aa64-2328c414ac7b",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 2,
+      "trimY": 2,
+      "width": 423,
+      "height": 351,
+      "rawWidth": 427,
+      "rawHeight": 355,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 1 - 0
mk_framework/assets/script/game/component/tween/UIOpenAndClose.ts

@@ -60,6 +60,7 @@ export default class UIOpenAndClose extends cc.Component {
     }
 
     start() {
+        if (CC_EDITOR) return;
         this.showEffect();
     }
 

+ 20 - 1
mk_framework/assets/script/game/data/module/PigBankData.ts

@@ -3,5 +3,24 @@
  * @author 
  */
 export class PigBankData {
-    
+    /** 提现最低限制 */
+    public cash_min_limit: number = 0.3;
+    /** 存款最高限制 */
+    public cash_max_limit: number = 0.45;
+    /** 今日可提现数量 */
+    public cur_cash_count: number = 0.30;
+    /** 明日可提现数量 */
+    public next_cash_count: number = 0;
+    /** 
+     * 视频数最低限制 
+     * 存钱罐提现次数*10【配置】,未满足视频数要求则不打款
+    */
+    public ad_count_min_limit: number = 0;
+
+    /** 
+     * 提现操作
+     */
+    public cashOP() {
+        this.cur_cash_count = 0;
+    }
 }

+ 33 - 16
mk_framework/assets/script/game/module/module/pigBank/PigBank.ts

@@ -1,3 +1,5 @@
+import { PigBankData } from "../../../data/module/PigBankData";
+import { OpenActionType, PanelType } from '../../../../mk/system/UISystem';
 
 const { ccclass, property } = cc._decorator;
 /**
@@ -11,47 +13,62 @@ export default class PigBank extends cc.Component {
     private lbl_get_desc: cc.Label = null!;
     @property({ type: cc.Label, displayName: '存款数量' })
     private lbl_deposit: cc.Label = null!;
+    @property({ type: cc.Node, displayName: '提示动画' })
+    private node_tip_anim: cc.Node = null!;
+
+    private ui_data: PigBankData = new PigBankData();
     onLoad() {
 
     }
 
     start() {
-        this.initGetDesc();
+        this.initCashDesc();
     }
 
-    update(dt) {
-
-    }
+    // update(dt) {
+    // }
 
-    /** 按钮描述展示 */
-    private initGetDesc() {
-        if (false) {
-            this.lbl_get_desc.string = '明日可提现';
+    /** 
+     * 提现描述展示
+     */
+    private initCashDesc() {
+        if (this.ui_data.cur_cash_count) {
+            if (this.ui_data.cur_cash_count >= this.ui_data.cash_min_limit) {
+                this.lbl_get_desc.string = '直接提现';
+                this.node_tip_anim.active = false;
+            } else {
+                this.lbl_get_desc.string = '满' + 0.3 + '元可提';
+                this.node_tip_anim.active = true;
+            }
+            this.initDeposit(this.ui_data.cur_cash_count)
         } else {
-            this.lbl_get_desc.string = '满' + 0.3 + '元可提现';
+            this.lbl_get_desc.string = '明日可提现';
+            this.initDeposit(this.ui_data.next_cash_count)
+            this.node_tip_anim.active = true;
         }
     }
 
     /**
      * 提现操作
      */
-    private cashOP() {
-
+    private clickCashOP() {
+        this.ui_data.cashOP();
+        mk.ui.closePanel(this.node.name);
     }
 
     /** 
      * 初始化存钱罐金额
      * - 精确到分
      */
-    private initDeposit() {
-        const count = 0
-        this.lbl_deposit.string = 0 + '元';
+    private initDeposit(count = 0) {
+        const new_count = count.toFixed(2)
+        this.lbl_deposit.string = new_count + '元';
     }
 
     /**
      * 打开帮助界面
      */
-    private openHelpPanel() {
-
+    private ClockOpenHelpPanel() {
+        mk.ui.openPanel('help', PanelType.module, OpenActionType.normal);
     }
 }

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff