Browse Source

红包界面客户端逻辑

薛鸿潇 5 năm trước cách đây
mục cha
commit
ed86cc0a79

+ 1 - 1
assets/resources/game/prefab/game.prefab

@@ -918,7 +918,7 @@
       "__id__": 24
     },
     "_enabled": true,
-    "panel_name": "sign",
+    "panel_name": "reward",
     "open_type": 0,
     "panel_type": 2,
     "onComplete": {

+ 9 - 0
assets/resources/module/reward/RewardOpen.anim

@@ -0,0 +1,9 @@
+{
+  "__type__": "cc.AnimationClip",
+  "_name": "",
+  "_objFlags": 0,
+  "_duration": 0,
+  "sample": 60,
+  "curveData": {},
+  "events": []
+}

+ 5 - 0
assets/resources/module/reward/RewardOpen.anim.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "2.1.0",
+  "uuid": "b3fe8a24-9df4-45cd-a6b9-9eae78842bb1",
+  "subMetas": {}
+}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 269 - 297
assets/resources/module/reward/reward.prefab


BIN
assets/resources/module/reward/红包1.png


+ 0 - 36
assets/resources/module/reward/红包1.png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "845e5457-bac8-4da5-8791-6417a28d890f",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 750,
-  "height": 1334,
-  "platformSettings": {},
-  "subMetas": {
-    "红包1": {
-      "ver": "1.0.4",
-      "uuid": "eab50c3f-71c3-4136-ae80-7310e0d062fe",
-      "rawTextureUuid": "845e5457-bac8-4da5-8791-6417a28d890f",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 750,
-      "height": 1334,
-      "rawWidth": 750,
-      "rawHeight": 1334,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/resources/module/reward/红包2.png


+ 0 - 36
assets/resources/module/reward/红包2.png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "93533dc3-809f-487c-812f-aa6324b87d2a",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 750,
-  "height": 1334,
-  "platformSettings": {},
-  "subMetas": {
-    "红包2": {
-      "ver": "1.0.4",
-      "uuid": "90d67af0-cc88-4c78-bb69-c1e15b253a72",
-      "rawTextureUuid": "93533dc3-809f-487c-812f-aa6324b87d2a",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 750,
-      "height": 1334,
-      "rawWidth": 750,
-      "rawHeight": 1334,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

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

@@ -13,6 +13,8 @@ export default class BtnClosePanel extends cc.Component {
     @property({ displayName: '完成回调', tooltip: "面板打开完成后触发", type: cc.Component.EventHandler })
     public onComplete: cc.Component.EventHandler[] = [];
 
+    /** 阻断点击 */
+    public block_click: boolean = false;
     onLoad() {
         if (!this.node.getComponent(cc.Button)) this.node.addComponent(cc.Button);
     }
@@ -22,6 +24,7 @@ export default class BtnClosePanel extends cc.Component {
     }
 
     private async closePanel() {
+        if (this.block_click) return;
         if (this.node_panel) {
             mk.ui.closePanel(this.node_panel.name);
         }

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

@@ -39,13 +39,6 @@ export class PigBankData extends Data {
 
     /** 提现最低限制 */
     public cash_min_limit: number = 0.3;
-    /** 存款最高限制 */
-    // public cash_max_limit: number = 0.45;
-    /** 
-     * 视频数最低限制 
-     * 存钱罐提现次数*10【配置】,未满足视频数要求则不打款
-    */
-    // public ad_count_min_limit: number = 0;
 
     /** 
      * 提现操作

+ 16 - 3
assets/script/game/data/module/RewardData.ts

@@ -2,9 +2,22 @@ import { Data } from "../../../mk/data/Data";
 
 /**
  * @description 奖励数据
- * @author 邹勇
+ * @author 邹勇 薛鸿潇
  */
- export class RewardData extends Data{
+export class RewardData extends Data {
+    public init_luck_style: boolean = false;
 
-    data:any;
+    /** 默认幸运红包 */
+    private _is_luck: boolean = true;
+    /** 是幸运红包 不是通关红包 */
+    set is_luck(value: boolean) {
+        this._is_luck = value;
+        this.init_luck_style = true;
+    }
+    get is_luck() {
+        return this._is_luck;
+    }
+
+    /** 奖励列表 */
+    data: any;
 }

+ 2 - 1
assets/script/game/module/game/FunBtns.ts

@@ -23,7 +23,8 @@ export default class FunBtns extends cc.Component {
     }
 
     init() {
-        let data = [1, 1, 0, 1];
+        // data功能开启
+        let data = [1, 1, 1, 1];
         for (let i = 0; i < data.length; i++) {
             if (data[i] == 0) {
                 this['btn' + (i + 1)].active = data[i] == 1;

+ 59 - 9
assets/script/game/module/module/reward/Reward.ts

@@ -1,25 +1,75 @@
-// Learn TypeScript:
-//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
-// Learn Attribute:
-//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
-// Learn life-cycle callbacks:
-//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
 
 const { ccclass, property } = cc._decorator;
-
+/**
+ * 获取奖励界面-红包
+ * @author 薛鸿潇
+ */
 @ccclass
-export default class reward extends cc.Component {
+export default class Reward extends cc.Component {
 
     @property({ displayName: '领取按钮', type: cc.Button })
     private btn_receive: cc.Button = null;
 
+    @property({ displayName: '幸运红包', type: cc.Node })
+    private node_luck: cc.Node = null;
+    @property({ displayName: '通关红包', type: cc.Node })
+    private node_mission: cc.Node = null;
+
+    @property({ displayName: 'spr提现进度', type: cc.Sprite })
+    private spr_cash_out: cc.Sprite = null;
+    @property({ displayName: 'lbl提现进度', type: cc.Label })
+    private lbl_cash_out: cc.Label = null;
+    @property({ displayName: '提现金额', type: cc.Label })
+    private lbl_cash: cc.Label = null;
+
     onLoad() {
 
     }
 
     start() {
+        /** 盖子 */
+        this.initLid();
+    }
+
+    update(dt) {
+        if (gData.reward.init_luck_style) {
+            gData.reward.init_luck_style = false;
+            this.initLid();
+        }
+    }
+    
+    /**
+     * 初始化封面样式
+     */
+    private initLid() {
+        if (gData.reward.is_luck) {
+            this.node_luck.active = true;
+            this.node_mission.active = false;
+        } else {
+            this.node_luck.active = false;
+            this.node_mission.active = true;
+        }
+    }
+
+    /**
+     * 获得奖励
+     */
+    private clickGetReward() {
+        cc.log('获取奖励:', gData.reward.data);
+    }
+
+    /**
+     * 提现操作
+     */
+    private clickCashOut() {
+        cc.log('提现:');
+    }
+
+    /**
+     * 下一关操作
+     */
+    private clickNextMission() {
 
     }
 
-    // update (dt) {}
 }

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác