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

Разлика између датотеке није приказан због своје велике величине
+ 180 - 140
mk_framework/assets/resources/module/pigBank/pigBank.prefab


+ 34 - 0
mk_framework/assets/script/game/component/BtnClosePanel.ts

@@ -0,0 +1,34 @@
+
+const { ccclass, property } = cc._decorator;
+import { OpenActionType, PanelType } from '../../mk/system/UISystem';
+/**
+ * 关闭指定面板
+ * @author 薛鸿潇
+ */
+@ccclass
+export default class BtnClosePanel extends cc.Component {
+
+    @property({ displayName: '关闭界面', tooltip: '', type: cc.Node })
+    private node_panel: cc.Node = null!;;
+    @property({ displayName: '完成回调', tooltip: "面板打开完成后触发", type: cc.Component.EventHandler })
+    public onComplete: cc.Component.EventHandler[] = [];
+
+    onLoad() {
+        if (!this.node.getComponent(cc.Button)) this.node.addComponent(cc.Button);
+    }
+
+    start() {
+        this.node.on('click', this.closePanel, this);
+    }
+
+    private async closePanel() {
+        if (this.node_panel) {
+            mk.ui.closePanel(this.node_panel.name);
+        }
+        const c_count = this.onComplete.length;
+        for (let i = 0; i < c_count; i++) {
+            if (this.onComplete[i].handler) this.onComplete[i].emit([])
+        }
+    }
+    // update (dt) {}
+}

+ 9 - 0
mk_framework/assets/script/game/component/BtnClosePanel.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "cdc50902-4555-416b-981c-a785d7c553be",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 3 - 3
mk_framework/assets/script/game/component/UIBG.ts

@@ -27,8 +27,8 @@ export class UIBG extends cc.Component {
     private color = new cc.Color(0, 0, 0, 120);
     private color = new cc.Color(0, 0, 0, 120);
     @property({ displayName: '点击关闭' })
     @property({ displayName: '点击关闭' })
     private bClickClose: boolean = false;
     private bClickClose: boolean = false;
-    @property({ displayName: '自定义关闭按钮', type: cc.Button })
-    private btn_close: cc.Button = null!;
+    // @property({ displayName: '自定义关闭按钮', type: cc.Button })
+    // private btn_close: cc.Button = null!;
 
 
     /** 背景节点 */
     /** 背景节点 */
     private node_bg: cc.Node = null;
     private node_bg: cc.Node = null;
@@ -45,7 +45,7 @@ export class UIBG extends cc.Component {
         this.node_bg.zIndex = -10000;
         this.node_bg.zIndex = -10000;
         this.node_bg.addComponent(cc.Button);
         this.node_bg.addComponent(cc.Button);
         this.node_bg.on('click', this.initClick, this);
         this.node_bg.on('click', this.initClick, this);
-        this.btn_close && this.btn_close.node.on('click', this.onClickClose, this);
+        // this.btn_close && this.btn_close.node.on('click', this.onClickClose, this);
     }
     }
 
 
     /**
     /**

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

@@ -21,10 +21,10 @@ export default class UIOpenAndClose extends cc.Component {
     private effect_par: cc.Node = null
     private effect_par: cc.Node = null
 
 
     @property({ type: cc.Enum(EffectType), displayName: '打开动画节点效果', visible() { return this.effect_par } })
     @property({ type: cc.Enum(EffectType), displayName: '打开动画节点效果', visible() { return this.effect_par } })
-    private open_effect: EffectType = EffectType.none;
+    private open_effect: EffectType = EffectType.scale;
 
 
     @property({ type: cc.Enum(EffectType), displayName: '关闭动画节点效果', visible() { return this.effect_par } })
     @property({ type: cc.Enum(EffectType), displayName: '关闭动画节点效果', visible() { return this.effect_par } })
-    private close_effect: EffectType = EffectType.none;
+    private close_effect: EffectType = EffectType.scale;
 
 
     @property({ displayName: '关闭节点缩小到此节点坐标', visible() { return this.close_effect == EffectType.scaleToPoint } })
     @property({ displayName: '关闭节点缩小到此节点坐标', visible() { return this.close_effect == EffectType.scaleToPoint } })
     private close_toPoint: string = "";
     private close_toPoint: string = "";

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

@@ -8,16 +8,50 @@ const { ccclass, property } = cc._decorator;
 export default class PigBank extends cc.Component {
 export default class PigBank extends cc.Component {
 
 
     @property({ type: cc.Label, displayName: '按钮描述' })
     @property({ type: cc.Label, displayName: '按钮描述' })
-    private btn_get_desc: cc.Label = null!;
+    private lbl_get_desc: cc.Label = null!;
+    @property({ type: cc.Label, displayName: '存款数量' })
+    private lbl_deposit: cc.Label = null!;
     onLoad() {
     onLoad() {
 
 
     }
     }
 
 
     start() {
     start() {
-
+        this.initGetDesc();
     }
     }
 
 
     update(dt) {
     update(dt) {
 
 
     }
     }
+
+    /** 按钮描述展示 */
+    private initGetDesc() {
+        if (false) {
+            this.lbl_get_desc.string = '明日可提现';
+        } else {
+            this.lbl_get_desc.string = '满' + 0.3 + '元可提现';
+        }
+    }
+
+    /**
+     * 提现操作
+     */
+    private cashOP() {
+
+    }
+
+    /** 
+     * 初始化存钱罐金额
+     * - 精确到分
+     */
+    private initDeposit() {
+        const count = 0
+        this.lbl_deposit.string = 0 + '元';
+    }
+
+    /**
+     * 打开帮助界面
+     */
+    private openHelpPanel() {
+
+    }
 }
 }

Неке датотеке нису приказане због велике количине промена