Просмотр исходного кода

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

kaka 5 лет назад
Родитель
Сommit
52f512925f

+ 92 - 66
assets/resources/game/prefab/game.prefab

@@ -30,13 +30,13 @@
         "__id__": 16
       },
       {
-        "__id__": 157
+        "__id__": 159
       },
       {
-        "__id__": 160
+        "__id__": 162
       },
       {
-        "__id__": 169
+        "__id__": 171
       },
       {
         "__id__": 105
@@ -45,14 +45,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 171
+        "__id__": 173
       },
       {
-        "__id__": 172
+        "__id__": 174
       }
     ],
     "_prefab": {
-      "__id__": 173
+      "__id__": 175
     },
     "_opacity": 255,
     "_color": {
@@ -528,7 +528,7 @@
       }
     ],
     "_prefab": {
-      "__id__": 156
+      "__id__": 158
     },
     "_opacity": 255,
     "_color": {
@@ -3362,26 +3362,26 @@
     },
     "_children": [
       {
-        "__id__": 141
+        "__id__": 142
       },
       {
-        "__id__": 144
+        "__id__": 145
       },
       {
-        "__id__": 148
+        "__id__": 150
       },
       {
-        "__id__": 151
+        "__id__": 153
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 154
+        "__id__": 156
       }
     ],
     "_prefab": {
-      "__id__": 155
+      "__id__": 157
     },
     "_opacity": 255,
     "_color": {
@@ -3457,11 +3457,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 139
+        "__id__": 140
       }
     ],
     "_prefab": {
-      "__id__": 140
+      "__id__": 141
     },
     "_opacity": 255,
     "_color": {
@@ -4115,20 +4115,20 @@
         "__id__": 127
       },
       {
-        "__id__": 131
+        "__id__": 132
       },
       {
-        "__id__": 134
+        "__id__": 135
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 137
+        "__id__": 138
       }
     ],
     "_prefab": {
-      "__id__": 138
+      "__id__": 139
     },
     "_opacity": 255,
     "_color": {
@@ -4299,10 +4299,13 @@
       },
       {
         "__id__": 129
+      },
+      {
+        "__id__": 130
       }
     ],
     "_prefab": {
-      "__id__": 130
+      "__id__": 131
     },
     "_opacity": 255,
     "_color": {
@@ -4405,6 +4408,16 @@
     "_id": ""
   },
   {
+    "__type__": "88626F5Zl9BIKjmKaYlyRWH",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 127
+    },
+    "_enabled": true,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -4426,11 +4439,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 132
+        "__id__": 133
       }
     ],
     "_prefab": {
-      "__id__": 133
+      "__id__": 134
     },
     "_opacity": 255,
     "_color": {
@@ -4484,7 +4497,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 131
+      "__id__": 132
     },
     "_enabled": true,
     "_materials": [
@@ -4533,11 +4546,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 135
+        "__id__": 136
       }
     ],
     "_prefab": {
-      "__id__": 136
+      "__id__": 137
     },
     "_opacity": 255,
     "_color": {
@@ -4591,7 +4604,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 134
+      "__id__": 135
     },
     "_enabled": true,
     "_materials": [
@@ -4705,11 +4718,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 142
+        "__id__": 143
       }
     ],
     "_prefab": {
-      "__id__": 143
+      "__id__": 144
     },
     "_opacity": 255,
     "_color": {
@@ -4763,7 +4776,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 141
+      "__id__": 142
     },
     "_enabled": true,
     "_materials": [
@@ -4812,14 +4825,17 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 145
+        "__id__": 146
       },
       {
-        "__id__": 146
+        "__id__": 147
+      },
+      {
+        "__id__": 148
       }
     ],
     "_prefab": {
-      "__id__": 147
+      "__id__": 149
     },
     "_opacity": 255,
     "_color": {
@@ -4873,7 +4889,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 144
+      "__id__": 145
     },
     "_enabled": true,
     "_materials": [
@@ -4908,7 +4924,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 144
+      "__id__": 145
     },
     "_enabled": true,
     "_color": {
@@ -4922,6 +4938,16 @@
     "_id": ""
   },
   {
+    "__type__": "88626F5Zl9BIKjmKaYlyRWH",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 145
+    },
+    "_enabled": true,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -4943,11 +4969,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 149
+        "__id__": 151
       }
     ],
     "_prefab": {
-      "__id__": 150
+      "__id__": 152
     },
     "_opacity": 255,
     "_color": {
@@ -5001,7 +5027,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 148
+      "__id__": 150
     },
     "_enabled": true,
     "_materials": [
@@ -5050,11 +5076,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 152
+        "__id__": 154
       }
     ],
     "_prefab": {
-      "__id__": 153
+      "__id__": 155
     },
     "_opacity": 255,
     "_color": {
@@ -5108,7 +5134,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 151
+      "__id__": 153
     },
     "_enabled": true,
     "_materials": [
@@ -5193,11 +5219,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 158
+        "__id__": 160
       }
     ],
     "_prefab": {
-      "__id__": 159
+      "__id__": 161
     },
     "_opacity": 255,
     "_color": {
@@ -5251,7 +5277,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 157
+      "__id__": 159
     },
     "_enabled": true,
     "_materials": [
@@ -5308,20 +5334,20 @@
     },
     "_children": [
       {
-        "__id__": 161
+        "__id__": 163
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 165
+        "__id__": 167
       },
       {
-        "__id__": 167
+        "__id__": 169
       }
     ],
     "_prefab": {
-      "__id__": 168
+      "__id__": 170
     },
     "_opacity": 255,
     "_color": {
@@ -5375,20 +5401,20 @@
     "_name": "Background",
     "_objFlags": 512,
     "_parent": {
-      "__id__": 160
+      "__id__": 162
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 162
+        "__id__": 164
       },
       {
-        "__id__": 163
+        "__id__": 165
       }
     ],
     "_prefab": {
-      "__id__": 164
+      "__id__": 166
     },
     "_opacity": 255,
     "_color": {
@@ -5442,7 +5468,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 161
+      "__id__": 163
     },
     "_enabled": true,
     "_materials": [
@@ -5474,7 +5500,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 161
+      "__id__": 163
     },
     "_enabled": true,
     "alignMode": 0,
@@ -5512,7 +5538,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 160
+      "__id__": 162
     },
     "_enabled": true,
     "_normalMaterial": null,
@@ -5521,7 +5547,7 @@
     "zoomScale": 1.2,
     "clickEvents": [
       {
-        "__id__": 166
+        "__id__": 168
       }
     ],
     "_N$interactable": true,
@@ -5589,7 +5615,7 @@
       "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
     },
     "_N$target": {
-      "__id__": 161
+      "__id__": 163
     },
     "_id": ""
   },
@@ -5608,7 +5634,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 160
+      "__id__": 162
     },
     "_enabled": true,
     "_defaultClip": {
@@ -5640,7 +5666,7 @@
       "__id__": 1
     },
     "_prefab": {
-      "__id__": 170
+      "__id__": 172
     },
     "_name": "游戏核心",
     "_active": false,
@@ -5671,7 +5697,7 @@
   {
     "__type__": "cc.PrefabInfo",
     "root": {
-      "__id__": 169
+      "__id__": 171
     },
     "asset": {
       "__uuid__": "4c49ec9e-c64a-4921-84eb-9bdd737656e5"
@@ -5688,7 +5714,7 @@
     },
     "_enabled": true,
     "node_gameplay": {
-      "__id__": 169
+      "__id__": 171
     },
     "node_btn": {
       "__id__": 16
@@ -5697,16 +5723,16 @@
       "__id__": 118
     },
     "lbl_redMoney": {
-      "__id__": 145
+      "__id__": 146
     },
     "lbl_rmb": {
       "__id__": 128
     },
     "btn_cashOutNormal": {
-      "__id__": 152
+      "__id__": 154
     },
     "btn_cashOutGold": {
-      "__id__": 135
+      "__id__": 136
     },
     "btn_getRed1": {
       "__id__": 9
@@ -5718,13 +5744,13 @@
       "__id__": 13
     },
     "btn_start": {
-      "__id__": 165
+      "__id__": 167
     },
     "icon_hb": {
-      "__id__": 148
+      "__id__": 150
     },
     "icon_zb": {
-      "__id__": 131
+      "__id__": 132
     },
     "node_top_ui": {
       "__id__": 104

+ 8 - 22
assets/resources/module/agreementTip/agreementTip.prefab

@@ -24,17 +24,17 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 53
+        "__id__": 52
       },
       {
-        "__id__": 54
+        "__id__": 53
       },
       {
-        "__id__": 55
+        "__id__": 54
       }
     ],
     "_prefab": {
-      "__id__": 56
+      "__id__": 55
     },
     "_opacity": 255,
     "_color": {
@@ -116,11 +116,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 51
+        "__id__": 50
       }
     ],
     "_prefab": {
-      "__id__": 52
+      "__id__": 51
     },
     "_opacity": 255,
     "_color": {
@@ -1602,7 +1602,7 @@
       }
     ],
     "_prefab": {
-      "__id__": 50
+      "__id__": 49
     },
     "_opacity": 255,
     "_color": {
@@ -1770,24 +1770,10 @@
     "panel_name": "game/prefab/game",
     "open_type": 0,
     "transition_type": 3,
-    "onComplete": [
-      {
-        "__id__": 49
-      }
-    ],
+    "onComplete": [],
     "_id": ""
   },
   {
-    "__type__": "cc.ClickEvent",
-    "target": {
-      "__id__": 1
-    },
-    "component": "",
-    "_componentId": "27e8eZbIM9ApIU8LRLiALwU",
-    "handler": "clickAgreeCall",
-    "customEventData": ""
-  },
-  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1

+ 32 - 2
assets/resources/module/guide/guide.prefab

@@ -28,10 +28,13 @@
     "_components": [
       {
         "__id__": 15
+      },
+      {
+        "__id__": 16
       }
     ],
     "_prefab": {
-      "__id__": 16
+      "__id__": 17
     },
     "_opacity": 255,
     "_color": {
@@ -56,7 +59,7 @@
       "ctor": "Float64Array",
       "array": [
         0,
-        0,
+        667,
         0,
         0,
         0,
@@ -522,6 +525,33 @@
     "_id": ""
   },
   {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 5,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 1334,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1

+ 78 - 0
assets/script/game/component/NumberAnim.ts

@@ -0,0 +1,78 @@
+
+const { ccclass, property } = cc._decorator;
+/**
+ * 数字跳动动画
+ * @author 薛鸿潇
+ */
+@ccclass
+export default class NumberAnim extends cc.Component {
+
+    /** 动画目标 */
+    private lbl_count: cc.Label = null;
+    onLoad() {
+        this.lbl_count = this.node.getComponent(cc.Label) || this.node.addComponent(cc.Label);
+    }
+
+    /**
+     * 设置数值
+     * @param new_value 目标值
+     */
+    public setValue(new_value: number) {
+        let time = new_value - this.targetProgress;
+        this.targetProgress = new_value;
+        this.PlayMoneyAni(0.3)
+    }
+
+    //////////////////////////////////数字滚动效果//////////////////////////////////
+    /** 滚动的目标值 */
+    private targetProgress: number = 0;
+
+    private delta: number = 0;
+    /** 滚动中的数字 */
+    private curValue: number = 0;
+    private curTime: number = 0;
+    private totalTime: number = 0;
+    /** 上次值 */
+    private lastNum: number = 0;
+    /** 动画中 */
+    private isPlayAni: boolean = false;
+
+    private PlayMoneyAni(time) {
+        this.totalTime = time;
+        this.delta = (this.targetProgress - this.lastNum) / time;
+        this.curValue = this.lastNum;
+        this.curTime = 0;
+        // console.log("--->Update Time: " + time + " delta: " + this.delta + " curValue: " + this.curValue + " lastNum: " + this.lastNum);
+        this.isPlayAni = true;
+    }
+
+    private PlayMoneyAniUpdate(dt) {
+        if (this.isPlayAni) {
+            if (this.curTime < this.totalTime) {
+                this.curTime += dt;
+                this.curValue += this.delta * dt;
+                if (this.curValue >= this.targetProgress) {
+                    this.isPlayAni = false;
+                    this.curValue = this.targetProgress;
+                    this.lastNum = this.targetProgress;
+                }
+                // console.log("-->CurValue:" + this.curValue);
+            } else {
+                this.isPlayAni = false;
+                this.curTime = this.totalTime;
+                //this.unschedule(this.UpdateAni);
+                this.curValue = this.targetProgress;
+                this.lastNum = this.targetProgress;
+            }
+            if (this.curValue == this.targetProgress) {
+                this.lbl_count.string = `${this.targetProgress}`;
+            } else {
+                this.lbl_count.string = `${this.curValue.toFixed(0)}`;
+            }
+        }
+    }
+
+    update(dt) {
+        this.PlayMoneyAniUpdate(dt);
+    }
+}

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

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "88626179-665f-4120-a8e6-29a625c91587",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 15 - 6
assets/script/game/data/GameData.ts

@@ -24,9 +24,9 @@ export class GameData {
     public gameData: PlayerProp = null;
     /** 标志位:刷新主界面货币 */
     public init_coin: boolean = false;
-    
-     /** 标志位:刷新主界面头像 */
-    public init_head:boolean = false;
+
+    /** 标志位:刷新主界面头像 */
+    public init_head: boolean = false;
 
     public props: Map<number, number> = new Map<number, number>();
 
@@ -179,12 +179,21 @@ export class GameData {
 
         this.setProps(arr);
     }
+
+    /** 是否是新用户 */
+    public isNewPlayer(): boolean {
+        let v = this.getProp(GameProp.newPlayer);
+        return v == 0;
+    }
 }
 
 /**
  * 所有模块的非校验数据
  */
 export enum GameProp {
+    /** -------------------- 通用玩家数据 ------------------------- */
+    newPlayer = 1,
+
     /** ------------------ 游戏核心数据 --------------------------- */
     /** 关卡数 */
     levelNum = 10,
@@ -216,7 +225,7 @@ export enum GameProp {
 class PlayerProp {
     /** 自定义不需要校验的数据 */
     gameUserData = 0;
-    
+
     _isSignInToday = 0;
     /**
      * 今日是否有签到
@@ -433,7 +442,7 @@ export enum EVENT_TYPE {
     UPDATE_CashNum = "UPDATE_CashNum",
 }
 
-export enum StorageKey{
+export enum StorageKey {
+
 
-    
 }

+ 6 - 3
assets/script/game/data/module/GuideData.ts

@@ -5,7 +5,10 @@
 export class GuideData {
 
     /** 新手引导数据 */
-    public data: Map<number, Guide[]>;
+    public data: Map<number, GuideVO[]>;
+
+    /** 当前引导id */
+    public crtID:number = null;
 
     public init(config) {
         this.data = new Map<number, Guide[]>();
@@ -35,12 +38,12 @@ export class GuideData {
         this.data.set(id, arr);
     }
 
-    public getGuidesByID(id): Guide[] {
+    public getGuidesByID(id): GuideVO[] {
         return this.data.get(id);
     }
 
 }
-export class Guide {
+export class GuideVO {
     /** 大步骤 */
     id: number;
     /** 大步骤中的小步 */

+ 27 - 6
assets/script/game/data/module/RewardData.ts

@@ -6,17 +6,14 @@ import { RewardType } from "../GameData";
  * @author 邹勇 薛鸿潇
  */
 export class RewardData extends Data {
-    /** 
-     * 标志位 
-     * - 初始化提现样式
-    */
-    public init_cash_style: boolean = true;
+    
+    /** 增加的红包币 */
+    public add_redbag_value: number = 0;
 
     private _data: Array<any> = [];
     /** 奖励列表 */
     set data(value: Array<any>) {
         this._data = value;
-        this.init_cash_style = true;
     }
     get data(): Array<any> {
         return this._data;
@@ -43,5 +40,29 @@ export class RewardData extends Data {
                 gData.gameData.gameData.piggyBank += gData.reward.data[i].rewardNum;
             }
         }
+        gData.reward.data = [];
+    }
+
+    public flyCoinAnim() {
+        if (!gData.reward.data || !gData.reward.data.length) return;
+        let is_add_money = true;
+        const i_count = gData.reward.data.length;
+        for (let i = 0; i < i_count; i++) {
+            let target_node = gData.gameData.gameStyle.icon_hb;
+            if (gData.reward.data[i].rewardType == RewardType.redBag) {
+                target_node = gData.gameData.gameStyle.icon_hb;
+            } else if (gData.reward.data[i].rewardType == RewardType.rmb) {
+                // target_node = gData.gameData.gameStyle.icon_zb;
+            } else if (gData.reward.data[i].rewardType == RewardType.pigRmb) {
+                target_node = gData.gameData.gameStyle.icon_zb;
+            }
+            const end_world_pos = target_node.parent.convertToWorldSpaceAR(target_node.getPosition());
+            const end_node_pos = gData.gameData.gameStyle.node.parent.convertToNodeSpaceAR(end_world_pos);
+            let start_node_pos = new cc.Vec2(0, -300);
+            mk.fly.PlayCoinAnim(gData.reward.data[i].rewardType, 10, start_node_pos, end_world_pos, () => {
+                is_add_money && this.addReward();
+            })
+        }
+
     }
 }

+ 12 - 1
assets/script/game/game/Game.ts

@@ -1,4 +1,5 @@
 import JsbSystem from "../../mk/system/JsbSystem";
+import { GameProp } from "../data/GameData";
 import FunBtns from "./FunBtns";
 
 const { ccclass, property } = cc._decorator;
@@ -48,7 +49,18 @@ export default class Game extends cc.Component {
         this.initBtns();
         this.initQiPaos();
         this.initInfo();
+
+        if(gData.gameData.isNewPlayer()){
+            this.initGuide();
+            gData.gameData.setProp(GameProp.newPlayer,1);
+        }
     }
+
+    private initGuide(){
+        gData.guideData.crtID = 1;
+        mk.ui.openPanel("module/guide/guide");
+    }
+
     update() {
         if (gData.gameData.init_coin) {
             this.initInfo();
@@ -114,7 +126,6 @@ export default class Game extends cc.Component {
             mk.tip.pop("请先点击头像,在设置界面授权");
             return;
         }
-        console.log("=== 分享图片");
         JsbSystem.sharePic();
     }
 }

+ 0 - 7
assets/script/game/module/agreementTip/agreementTip.ts

@@ -16,13 +16,6 @@ export default class agreementTip extends cc.Component {
     }
 
     /**
-     * 同意按钮回调
-     */
-    private clickAgreeCall() {
-        mk.storage.setStorage('notShowAgreementTip', true)
-    }
-
-    /**
      * 点击协议按钮
      * @param data 协议类型
      */

+ 25 - 0
assets/script/game/module/guide/Guide.ts

@@ -1,3 +1,5 @@
+import { GuideVO } from "../../data/module/GuideData";
+
 /**
  * @description 新手引导
  * @author 邹勇
@@ -14,9 +16,32 @@ export default class Guide extends cc.Component {
     @property(cc.Node)
     node_block: cc.Node = null;
 
+    private guides: GuideVO[];
+    private crtStep: number;
+    private crtGuide: GuideVO;
 
     onLoad() {
+        
+    }
+
+    start(){
+        if(gData.guideData.crtID == null){
+            this.node.destroy();
+            return;
+        }
+        this.guides = gData.guideData.getGuidesByID(gData.guideData.crtID);
+        this.crtStep = -1;
+        this.nextStep();
+    }
+
+    private nextStep() {
+        this.crtStep++;
+        this.crtGuide = this.guides[this.crtStep];
+        this.updateGuide();
+    }
 
+    private updateGuide(){
+        
     }
 
 

+ 3 - 3
assets/script/game/module/login/Login.ts

@@ -47,10 +47,10 @@ export default class Login extends cc.Component {
                 gData.appData.getDeviceInfoCompelete = false;
             }
             else if (gData.gameData.dataFinish) {//登录流程完毕
-                if (!mk.storage.getStorage('notShowAgreementTip')) {
-                    //!mk.storage.getStorage('notShowAgreementTip')
+                if(gData.gameData.isNewPlayer()){
                     mk.ui.openPanel("module/agreementTip/agreementTip");
-                } else {
+                }
+                else{
                     mk.ui.openPanel("game/prefab/game");
                 }
 

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

@@ -23,11 +23,13 @@ export default class PigBank extends cc.Component {
     start() {
         this.initCashDesc();
         mk.audio.playEffect("pigBank", false);
-        // let target_node = gData.gameData.gameStyle.icon_zb;
+        // let target_node = gData.gameData.gameStyle.icon_hb;
         // const end_world_pos = target_node.parent.convertToWorldSpaceAR(target_node.getPosition());
         // const end_node_pos = gData.gameData.gameStyle.node.parent.convertToNodeSpaceAR(end_world_pos);
         // let start_node_pos = new cc.Vec2(0, -300);
-        // mk.fly.PlayCoinAnim(3, 10, start_node_pos, end_node_pos);
+        // mk.fly.PlayCoinAnim(1, 10, start_node_pos, end_node_pos, () => {
+        //     if (!gData.gameData.init_coin) gData.gameData.gameData.redMoney = 1234
+        // });
     }
 
     update(dt) {

+ 22 - 30
assets/script/game/module/reward/Reward.ts

@@ -61,12 +61,13 @@ export default class Reward extends cc.Component {
     start() {
         /** 盖子 */
         this.initLid();
-        gData.reward.init_cash_style = true;
+        // gData.gameData.gameData.redMoney = 1500;// 测试数据
+        this.initCashOutStyle(gData.gameData.gameData.redMoney);
     }
 
     update(dt) {
-        if (gData.reward.init_cash_style) {
-            this.initCashOutStyle();
+        if (gData.reward.add_redbag_value) {
+            this.initCashOutStyle(gData.gameData.gameData.redMoney + gData.reward.add_redbag_value);
         }
         if (gData.reward.adData) {
             // 展示奖励
@@ -76,7 +77,7 @@ export default class Reward extends cc.Component {
     }
 
     lateUpdate() {
-        gData.reward.init_cash_style = null;
+        gData.reward.add_redbag_value = 0;
         gData.reward.adData = null;
     }
 
@@ -107,16 +108,18 @@ export default class Reward extends cc.Component {
     /**
      * 底部提现相关样式
      */
-    private initCashOutStyle() {
+    private initCashOutStyle(redMoney: number = 0) {
         const cash_bar = gData.redBagCash.cash_bar;
         let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
         if (!cash_data) return;
 
         this.lbl_cash.string = cash_data.money / 100 + '元';
-        this.lbl_cash_out.string = gData.gameData.gameData.redMoney + '/' + cash_data.type_value;
-        this.spr_cash_out.fillRange = gData.gameData.gameData.redMoney / cash_data.type_value;
+        this.lbl_cash_out.string = redMoney + '/' + cash_data.type_value;
+        const fillRange = redMoney / cash_data.type_value >= 1 ? 1 : redMoney / cash_data.type_value;
+        // this.spr_cash_out.fillRange = fillRange;
+        cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();
     }
-
+    
     /**
      * 看广告
      */
@@ -139,6 +142,9 @@ export default class Reward extends cc.Component {
                 }
             });
         }
+        // gData.reward.adData = {}
+        // gData.reward.adData.videoRedMoney = {}
+        // gData.reward.adData.videoRedMoney.videoRewardList = [{ rewardType: 3, rewardNum: 1000 }, { rewardType: 1, rewardNum: 1000 }]// 测试数据
     }
 
     /**
@@ -147,6 +153,7 @@ export default class Reward extends cc.Component {
     private async watchVideoCall() {
         if (gData.reward.adData) {
             // 气泡视频奖励 通关视频奖励 
+            // gData.reward.adData.videoRedMoney.videoRewardList = [{ rewardType: 3, rewardNum: 1000 }, { rewardType: 1, rewardNum: 1000 }]// 测试数据
             gData.reward.data = gData.reward.adData.videoRedMoney.videoRewardList;
         }
         if (!gData.reward.data || !gData.reward.data.length) return;
@@ -164,7 +171,7 @@ export default class Reward extends cc.Component {
                 }
             }
         }
-        
+
         // 图标展示
         if (gData.reward.data[0].rewardType === RewardType.redBag) {
             this.node_coin.spriteFrame = await mk.loader.load('game/texture/coin/' + RewardType.redBag, cc.SpriteFrame);
@@ -183,6 +190,11 @@ export default class Reward extends cc.Component {
         this.node_luck.active = false;
         this.node_mission.active = false;
         this.btn_watch_video.node.active = false;
+
+        // 底部进度动画
+        if (gData.reward.data[0].rewardType === RewardType.redBag) {
+            gData.reward.add_redbag_value = gData.reward.data[0].rewardNum;
+        }
     }
 
     /**
@@ -190,9 +202,7 @@ export default class Reward extends cc.Component {
      */
     private clickGetReward() {
         cc.log('获取奖励:', gData.reward.data);
-        gData.reward.addReward();
-        this.flyCoinAnim();
-        gData.reward.data = [];
+        gData.reward.flyCoinAnim();
     }
 
     /**
@@ -203,24 +213,6 @@ export default class Reward extends cc.Component {
         mk.ui.openPanel(path);
     }
 
-    /**
-     * 飞coin动画
-     */
-    private flyCoinAnim() {
-        if (!gData.reward.data || !gData.reward.data.length) return;
-        let target_node = gData.gameData.gameStyle.icon_hb;
-        if (gData.reward.data[0].rewardType == RewardType.redBag) {
-            target_node = gData.gameData.gameStyle.icon_hb;
-        } else if (gData.reward.data[0].rewardType == RewardType.rmb) {
-            // target_node = gData.gameData.gameStyle.icon_zb;
-        } else if (gData.reward.data[0].rewardType == RewardType.pigRmb) {
-            target_node = gData.gameData.gameStyle.icon_zb;
-        }
-        const end_world_pos = target_node.parent.convertToWorldSpaceAR(target_node.getPosition());
-        const end_node_pos = gData.gameData.gameStyle.node.parent.convertToNodeSpaceAR(end_world_pos);
-        let start_node_pos = new cc.Vec2(0, -300);
-        mk.fly.PlayCoinAnim(gData.reward.data[0].rewardType, 10, start_node_pos, end_node_pos)
-    }
 
     /**
      * 下一关操作

+ 5 - 2
assets/script/mk/system/FlySystem.ts

@@ -10,6 +10,7 @@ export default class FlySystem extends cc.Component {
         mk.fly = this;
     }
 
+    private is_new_cb = true;
     /**
      * @param type 类型 道具id  10001,10002
      * @param num 特效数量
@@ -34,6 +35,7 @@ export default class FlySystem extends cc.Component {
 
             this.FlyIn(type, copyCoin, initPos, endpos, item_cb);
         }
+        this.is_new_cb = true;
     }
 
     private FlyIn(type: number, target: cc.Node, end: cc.Vec2, endpos: cc.Vec2 | string = null, item_cb: Function = null) {
@@ -72,9 +74,10 @@ export default class FlySystem extends cc.Component {
                 }
 
                 if (item_cb != null) {
-                    item_cb();
-                    this.iconScale(type);
+                    this.is_new_cb && item_cb();
+                    this.is_new_cb = false;
                 }
+                this.iconScale(type);
             })
             .start();
     }

+ 6 - 0
assets/script/mk/system/GuideSystem.ts

@@ -11,6 +11,7 @@ export default class GuideSystem {
     private crtGuide: Guide;
 
     public open(id: number) {
+        mk.ui.openPanel("module/guide/guide");
         this.guides = gData.guideData.getGuidesByID(id);
         this.crtStep = -1;
         this.nextStep();
@@ -19,5 +20,10 @@ export default class GuideSystem {
     private nextStep() {
         this.crtStep++;
         this.crtGuide = this.guides[this.crtStep];
+        this.updateGuide();
+    }
+
+    private updateGuide(){
+        
     }
 }