소스 검색

Merge branch 'master' of http://git.mokasz.com/zouyong/mk_framework into master

fengcong 5 년 전
부모
커밋
eb770c522e

+ 0 - 0
assets/resources/module/hotUpdate/111.txt


+ 0 - 12
assets/resources/module/hotUpdate/perfab.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "e45f4d0f-7aa3-4f6e-a64f-6b9bcde71855",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 3 - 0
assets/script/game/component/BtnOpenPanel.ts

@@ -32,6 +32,9 @@ export default class BtnOpenPanel extends cc.Component {
     }
 
     private async openPanel() {
+        if(!mk.game.checkContinuousClick(this.node)){
+            return;
+        }
         mk.audio.playEffect("button");
         if (this.bool_Auth) {
             if (!gData.loginData.isAuth) {

+ 2 - 0
assets/script/game/data/GameData.ts

@@ -26,6 +26,8 @@ export class GameData {
     /** 标志位:刷新主界面货币 */
     public init_coin: boolean = false;
 
+    public updatePiggyBankValue:boolean = false;
+
     /** 标志位:刷新主界面头像 */
     public init_head: boolean = false;
 

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

@@ -47,6 +47,7 @@ export class PigBankData extends Data {
         mk.ui.openPanel('module/receiptNotice/receiptNotice');
         gData.gameData.gameData.piggyBank = 0;
         gData.gameData.gameData.isWithdrawable = 0;
+        gData.gameData.updatePiggyBankValue = true;
         gData.cashNormal.getRecord();// 请求新的提现记录
 
     }

+ 10 - 0
assets/script/game/game/Game.ts

@@ -98,6 +98,11 @@ export default class Game extends cc.Component {
     }
 
     update() {
+        if(gData.gameData.updatePiggyBankValue){
+            this.updatePiggyBankValue();
+            gData.gameData.updatePiggyBankValue = false;
+
+        }
         if (gData.gameData.init_coin) {
             this.changeInfo();
         }
@@ -163,6 +168,11 @@ export default class Game extends cc.Component {
         this.img_head.spriteFrame = new cc.SpriteFrame(result);
     }
 
+    private updatePiggyBankValue(){
+        this.lbl_rmb.string = (gData.gameData.gameData.piggyBank / 100).toFixed(2);
+        gData.gameData.updatePiggyBankValue = false;
+    }
+
     /**
      * 初始化红点
      */

+ 0 - 1
assets/script/game/module/reward/Reward.ts

@@ -278,7 +278,6 @@ export default class Reward extends cc.Component {
 
     onClickClose() {
         mk.ad.destoryBanner();
-        console.log("清除积分啦啦啦啦啦阿拉拉拉啦--------------------------------", GamePlay.Inst.ifPass)
         //如果是关卡消除红包 关闭之后则清除
         if (gData.reward.subType == 2) {
             console.log("清除积分啦啦啦啦啦阿拉拉拉啦--------------------------------", GamePlay.Inst.ifPass)

+ 20 - 0
assets/script/mk/utils/GameUtil.ts

@@ -29,6 +29,26 @@ export default class GameUtil {
         }
     }
 
+    private btnTimeDic: Object;
+    /**给按钮做连续点击检测
+     * @param btn 点击的按钮
+     * @param delay 按钮连续点击间隔,delay间隔内不能连续点击
+     * @return true 可以点击
+     */
+	public checkContinuousClick(btn:cc.Node, delay: number = 1): boolean {
+		if (this.btnTimeDic == null) {
+			this.btnTimeDic = {};
+		}
+		let key = (btn as any)._id;
+		let last: number = this.btnTimeDic[key];
+		let now: number = new Date().getTime();
+		var b = last == null || now - last > delay * 1000;
+		if (b) {
+			this.btnTimeDic[key] = now;
+		}
+		return b;
+	}
+
     /**
      * 获取世界坐标
      * @param 需要获取的节点