Commit 277d693d authored by wjf's avatar wjf

l

parents 498edfca 9f8160d0
import getResPath from "../../libs/new_tc/getResPath";
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { createEffect1MovieClip } from "../effect/createEffect1";
import RedBombRule from "./RedBombRule";
import { getRedBombTimes } from "../getRedBombAward"; import { getRedBombTimes } from "../getRedBombAward";
import { loadSvga } from "../loadSvga"; import { loadSvga } from "../loadSvga";
<<<<<<< HEAD
import getResPath from "../../libs/new_tc/getResPath"; import getResPath from "../../libs/new_tc/getResPath";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
=======
>>>>>>> 9f8160d0a4c64b32d674e876fa7c9c5680a3de02
export default class RedBombAlertPanel extends Panel { export default class RedBombAlertPanel extends Panel {
async start(data) { async start(data) {
...@@ -15,35 +15,51 @@ export default class RedBombAlertPanel extends Panel { ...@@ -15,35 +15,51 @@ export default class RedBombAlertPanel extends Panel {
const times = getRedBombTimes(); const times = getRedBombTimes();
this['tips'].text = `今日还有${times}个红包在其他关卡等你哦~`; this['tips'].text = `今日还有${times}个红包在其他关卡等你哦~`;
if(times <= 0) { if (times <= 0) {
this['tips'].text = `当日红包任务达成,明日再来~`; this['tips'].text = `当日红包任务达成,明日再来~`;
} }
this['group'].alpha=0; this['group'].alpha = 0;
egret.Tween.get(this['group']).wait(1500).to({alpha:1},300); egret.Tween.get(this['group']).wait(1500).to({ alpha: 1 }, 300);
loadSvga(getResPath() + 'resource/assets/svgas/redbomb.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/redbomb.svga').then(async (mv: any) => {
this.addChild(mv); this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => { mv.once(egret.Event.COMPLETE, () => {
mv.stop(); mv.stop();
this.removeChild(mv); this.removeChild(mv);
<<<<<<< HEAD
const data = DataManager.ins.getData('hc_redBombAward').data; const data = DataManager.ins.getData('hc_redBombAward').data;
if(data){ if(data){
this.playPrizeAni(); this.playPrizeAni();
}else{ }else{
this.playNoPrizeAni(); this.playNoPrizeAni();
} }
=======
egret.Tween.get(this['group']).to({ alpha: 0 }, 300).call(() => {
this.removeChild(this['group']);
});
// this.playNoPrizeAni();
this.playPrizeAni();
>>>>>>> 9f8160d0a4c64b32d674e876fa7c9c5680a3de02
}, this); }, this);
}); });
} }
playNoPrizeAni(){ playPrizeAni() {
loadSvga(getResPath() + 'resource/assets/svgas/redbomb_prize.svga').then(async (mv: any) => {
this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => {
mv.stop();
this.once(egret.TouchEvent.TOUCH_TAP,()=>{this.hidePanel()},this);
}, this);
});
}
playNoPrizeAni() {
loadSvga(getResPath() + 'resource/assets/svgas/redbomb_noprize.svga').then(async (mv: any) => { loadSvga(getResPath() + 'resource/assets/svgas/redbomb_noprize.svga').then(async (mv: any) => {
//去掉文案 //去掉文案
egret.Tween.get(this['group']).to({alpha:0},300); egret.Tween.get(this['group']).to({alpha:0},300);
this.addChild(mv); this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => { mv.once(egret.Event.COMPLETE, () => {
mv.stop(); mv.stop();
this.once(egret.TouchEvent.TOUCH_TAP,()=>{this.hidePanel()},this);
}, this); }, this);
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment