|
|
@@ -5,7 +5,6 @@
|
|
|
|
|
|
import { AdFun } from "../../../data/AdData";
|
|
|
import { cashProType } from "../../../data/module/CashProData";
|
|
|
-import BlessingBagItem from "./BlessingBagItem";
|
|
|
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
@@ -71,12 +70,12 @@ export default class BlessingBag extends cc.Component {
|
|
|
/**红包页面类型 1 大额 2 任务*/
|
|
|
private rbPanelType: number = 0;
|
|
|
|
|
|
- private adrbArray: BlessingBagItem[] = [];
|
|
|
+ private adrbArray = [];
|
|
|
|
|
|
private isPlayInitAni = true;
|
|
|
|
|
|
onLoad() {
|
|
|
- // this.testNode.active = gData.gameData.configs.globalCfg.VideoRedBagEmpty == 1;
|
|
|
+ this.testNode.active = gData.gameData.configs.globalCfg.VideoRedBagEmpty == 1;
|
|
|
}
|
|
|
|
|
|
onEnable() {
|
|
|
@@ -84,13 +83,13 @@ export default class BlessingBag extends cc.Component {
|
|
|
this.isPlayInitAni = true;
|
|
|
}
|
|
|
|
|
|
- onDisable() {
|
|
|
- if (this.adrbArray.length >= 4) {
|
|
|
- for (let i = 0; i < this.adrbArray.length; i++) {
|
|
|
- this.adrbArray[i].OnExit();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // onDisable() {
|
|
|
+ // if (this.adrbArray.length >= 4) {
|
|
|
+ // for (let i = 0; i < this.adrbArray.length; i++) {
|
|
|
+ // this.adrbArray[i].OnExit();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
update(dt) {
|
|
|
this.PlayMoneyAniUpdate(dt);
|
|
|
@@ -160,18 +159,29 @@ export default class BlessingBag extends cc.Component {
|
|
|
if (this.adrbArray.length < 4) {
|
|
|
this.adrbArray = [];
|
|
|
this.itemContent.removeAllChildren();
|
|
|
+
|
|
|
for (let i = 0; i < data.redMonies.length; i++) {
|
|
|
- let copyitem = cc.instantiate(this.blassingBagItem);
|
|
|
- copyitem.active = true;
|
|
|
- this.itemContent.addChild(copyitem);
|
|
|
- let copySrc = copyitem.getComponent(BlessingBagItem);
|
|
|
- copySrc.Init(data.redMonies[i], gData.blessingBag.isPlayAniUpdate, this.isPlayInitAni);
|
|
|
- this.adrbArray.push(copySrc);
|
|
|
+ let obj = {
|
|
|
+ data: data.redMonies[i],
|
|
|
+ isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
|
|
|
+ isPlayInitAni: this.isPlayInitAni
|
|
|
+ }
|
|
|
+ this.adrbArray.push(obj);
|
|
|
}
|
|
|
+ this.itemContent.emit('srollview-init', this.adrbArray);
|
|
|
} else {
|
|
|
+ this.adrbArray = [];
|
|
|
+
|
|
|
for (let i = 0; i < data.redMonies.length; i++) {
|
|
|
- this.adrbArray[i].Init(data.redMonies[i], gData.blessingBag.isPlayAniUpdate, this.isPlayInitAni);
|
|
|
+ let obj = {
|
|
|
+ data: data.redMonies[i],
|
|
|
+ isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
|
|
|
+ isPlayInitAni: this.isPlayInitAni
|
|
|
+ }
|
|
|
+ this.adrbArray.push(obj);
|
|
|
}
|
|
|
+ //刷新
|
|
|
+
|
|
|
}
|
|
|
|
|
|
this.isPlayInitAni = false;
|
|
|
@@ -304,12 +314,8 @@ export default class BlessingBag extends cc.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Click_RedCodeBtn() {
|
|
|
- // UIMng.Ins.AsyncGetPanel(PanelType.RedCodeListPanel, (panel) => {
|
|
|
- // panel.OnEnter(60);
|
|
|
- // });
|
|
|
- }
|
|
|
|
|
|
+ /** 点击帮助回调 */
|
|
|
clickHelpCallBack() {
|
|
|
gData.help.getDescContent(this.node.name)
|
|
|
}
|