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 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 { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
export default class RedBombAlertPanel extends Panel {
async start(data) {
......@@ -14,28 +10,40 @@ export default class RedBombAlertPanel extends Panel {
const times = getRedBombTimes();
this['tips'].text = `今日还有${times}个红包在其他关卡等你哦~`;
if(times <= 0) {
if (times <= 0) {
this['tips'].text = `当日红包任务达成,明日再来~`;
}
this['group'].alpha=0;
egret.Tween.get(this['group']).wait(1500).to({alpha:1},300);
this['group'].alpha = 0;
egret.Tween.get(this['group']).wait(1500).to({ alpha: 1 }, 300);
loadSvga(getResPath() + 'resource/assets/svgas/redbomb.svga').then(async (mv: any) => {
this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => {
mv.stop();
this.removeChild(mv);
this.playNoPrizeAni();
egret.Tween.get(this['group']).to({ alpha: 0 }, 300).call(() => {
this.removeChild(this['group']);
});
// this.playNoPrizeAni();
this.playPrizeAni();
}, 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) => {
this.addChild(mv);
mv.once(egret.Event.COMPLETE, () => {
mv.stop();
this.once(egret.TouchEvent.TOUCH_TAP,()=>{this.hidePanel()},this);
}, this);
});
}
......@@ -46,11 +54,11 @@ export default class RedBombAlertPanel extends Panel {
initEvents() {
super.initEvents();
// this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this);
}
onTapInvite() {
}
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