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

红包提现数据类添加,ui动画效果改名

薛鸿潇 5 лет назад
Родитель
Сommit
b47126e081

+ 1 - 1
assets/script/game/component/tween/UIOpenAndClose.ts → assets/script/game/component/tween/EffectOpenAndClose.ts

@@ -15,7 +15,7 @@ enum EffectType {
 @ccclass
 @executeInEditMode()
 @playOnFocus()
-export default class UIOpenAndClose extends cc.Component {
+export default class EffectOpenAndClose extends cc.Component {
 
     @property({ type: cc.Node, displayName: '动画节点' })
     private effect_par: cc.Node = null

+ 0 - 0
assets/script/game/component/tween/UIOpenAndClose.ts.meta → assets/script/game/component/tween/EffectOpenAndClose.ts.meta


+ 6 - 0
assets/script/game/data/GData.ts

@@ -17,6 +17,7 @@ import { CashNormalData } from "./module/CashNormalData";
 import { ReceiptNoticeData } from "./module/ReceiptNoticeData";
 import { BlessingBagData } from "./module/BlessingBagData";
 import CashProData from "./module/CashProData";
+import { RedBagCashData } from "./module/RedBagCashData";
 
 /**
  * 数据集合全局类
@@ -50,6 +51,8 @@ class GData {
     public sign: SignData;
     /** 到账通知 */
     public receiptNotice: ReceiptNoticeData;
+    /** 红包提现 */
+    public redBagCash: RedBagCashData;
     /** 红包提现(常规提现) */
     public cashNormal: CashNormalData;
     /** 更多游戏 */
@@ -75,6 +78,7 @@ class GData {
         this.pigbank = new PigBankData();
         this.sign = new SignData();
         this.receiptNotice = new ReceiptNoticeData();
+        this.redBagCash = new RedBagCashData();
         this.cashNormal = new CashNormalData();
         this.moreGame = new MoreGameData();
         this.blessingBag = new BlessingBagData();
@@ -88,6 +92,7 @@ class GData {
         this.moduleData.set(Fun.blessingBag, this.blessingBag);
         this.moduleData.set(Fun.sign, this.sign);
         this.moduleData.set(Fun.cashNormal, this.cashNormal);
+        this.moduleData.set(Fun.redBagCash, this.redBagCash);
     }
 }
 
@@ -102,6 +107,7 @@ export enum Fun {
     blessingBag = 5,   //福袋
     sign = 6,       //签到
     cashNormal = 7, //常规提现
+    redBagCash = 8, //红包提现
 }
 
 declare global {

+ 68 - 0
assets/script/game/data/module/RedBagCashData.ts

@@ -0,0 +1,68 @@
+
+import { Data } from "../../../mk/data/Data";
+/**
+ * 红包提现数据
+ * @author 薛鸿潇
+ */
+export class RedBagCashData extends Data {
+
+    /**
+     * 数据初始化
+     */
+    public init() {
+        // 签到配置表
+        this.initCData();
+        if (gData.gameData.configs.cashcfg) {
+            gData.gameData.configs.cashcfg.forEach(item_data => {
+                for (const key in item_data) {
+                    item_data[key] = parseInt(item_data[key])
+                }
+            });
+            this.c_data = gData.gameData.configs.cashcfg;
+            this.init_list = true;
+        }
+    }
+    /** 标志位:初始化列表 */
+    public init_list: boolean = false;
+
+    /** 配置表数据 */
+    public c_data: Array<CDataType> = [];
+
+    /** 客户端造的假数据 */
+    private initCData() {
+        for (let i = 0; i < 10; i++) {
+            let obj = {
+                index: i,
+                /** 毛币数量? */
+                money: i,
+                type_value: i,
+                time: i,
+                directVideoTime: i,
+                delayVideoTimes: i,
+                money_type: i,
+                num: i,
+                moneyshow: i,
+                summoney: i
+            };
+            this.c_data.push(obj)
+        }
+        this.init_list = true;
+
+    }
+}
+/** 配置表数据内容 */
+export type CDataType = {
+    /** id */
+    index: number,
+    /** 毛币数量? */
+    money: number,
+    type_value: number,
+    time: number,
+    directVideoTime: number,
+    delayVideoTimes: number,
+    money_type: number,
+    num: number,
+    moneyshow: number,
+    summoney: number
+}
+

+ 9 - 0
assets/script/game/data/module/RedBagCashData.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "8b9fda5e-c308-4613-abd2-318b5012f278",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 1 - 7
assets/script/game/module/module/redBagCash/RedBagCash.ts

@@ -25,12 +25,6 @@ export default class RedBagCash extends cc.Component {
      * 初始化滚动视图
      */
     private initScrollView() {
-        // 测试数据
-        let data = []
-        for (let i = 0; i < 10; i++) {
-            let obj = {};
-            data.push(666)
-        }
-        this.sroll_view.node.emit('srollview-init', data);
+        this.sroll_view.node.emit('srollview-init', gData.redBagCash.c_data);
     }
 }

+ 5 - 1
assets/script/game/module/module/redBagCash/RedBagCashItem.ts

@@ -1,3 +1,4 @@
+import { CDataType } from "../../../data/module/RedBagCashData";
 
 const { ccclass, property } = cc._decorator;
 /**
@@ -18,6 +19,8 @@ export default class RedBagCashItem extends cc.Component {
     @property({ displayName: '毛币数量', type: cc.Label })
     lbl_rmb_value: cc.Label = null;
 
+    /** 条目数据 */
+    private item_data: CDataType = null;
     onLoad() {
 
     }
@@ -34,7 +37,8 @@ export default class RedBagCashItem extends cc.Component {
         await this.initStyle(item_data);
     }
     private initStyle(item_data) {
-        
+        this.item_data = item_data;
+        // this.item_data.
     }
 
 }

+ 1 - 1
assets/script/mk/system/UISystem.ts

@@ -115,7 +115,7 @@ export default class UISystem extends cc.Component {
         let node_panel = this.getCurOnPanel(panelName);
 
         // 是否存在关闭动画
-        let comp_anim = node_panel.getComponent('UIOpenAndClose');
+        let comp_anim = node_panel.getComponent('EffectOpenAndClose');
         if (comp_anim) {
             comp_anim.hideEffect(this.destroyNode.bind(this, node_panel, panelName, callBack));
         } else {