Commit 744259a2 authored by wildfirecode's avatar wildfirecode

1

parent 5734288e
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";
import getResPath from "../../libs/new_tc/getResPath";
export default class RedBombAlertPanel extends Panel { export default class RedBombAlertPanel extends Panel {
async start(data) { async start(data) {
...@@ -14,28 +10,40 @@ export default class RedBombAlertPanel extends Panel { ...@@ -14,28 +10,40 @@ 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);
this.playNoPrizeAni(); egret.Tween.get(this['group']).to({ alpha: 0 }, 300).call(() => {
this.removeChild(this['group']);
});
// this.playNoPrizeAni();
this.playPrizeAni();
}, this); }, this);
}); });
}
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() {
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) => {
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);
}); });
} }
...@@ -46,11 +54,11 @@ export default class RedBombAlertPanel extends Panel { ...@@ -46,11 +54,11 @@ export default class RedBombAlertPanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
// this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this); // this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this);
} }
onTapInvite() { onTapInvite() {
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] } protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
......
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