Commit 06e4d8b1 authored by zjz1994's avatar zjz1994

修改签到界面第七天不能连续弹出

parent dd42a3b4
......@@ -331,6 +331,9 @@ export default class SignPanel extends Panel {
super.removeEvents();
this["closeBtn"].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap_closeBtn, this);
this["btn1"].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.signToday, this);
this.rmMvListener();
}
movep1:egret.Point;
......@@ -653,10 +656,10 @@ export default class SignPanel extends Panel {
if(!svgaParser) svgaParser = new window["SVGA"].Parser();
var svgas = ["signgiftbox", "signsandot", "signshine", "signxistar"];
for (let i = 0; i < svgas.length; i++) {
// if (movieClips[svgas[i]]){
// // this.addMvListener(svgas[i]);
// continue;
// }
if (movieClips[svgas[i]]){
this.addMvListener(svgas[i]);
continue;
}
let mvname = svgas[i];
svgaParser.load(resPath + 'resource/assets/svgas/' + svgas[i] + ".svga", (videoItem) => {
var mv = new window["SVGA"].EgretMovieClip(videoItem);
......@@ -694,9 +697,18 @@ export default class SignPanel extends Panel {
})
}
}
completeCall:{signxistar:Function,signshine:Function,signsandot:Function,signgiftbox:Function} = {
signxistar:null,signshine:null,signsandot:null,signgiftbox:null
};
enterFrameCall:{signxistar:Function,signshine:Function,signsandot:Function,signgiftbox:Function} = {
signxistar:null,signshine:null,signsandot:null,signgiftbox:null
};
addMvListener(mvname){
let fun;
movieClips[mvname].addEventListener(egret.Event.COMPLETE, fun = function(e) {
if(this.completeCall[mvname]){
this.completeCall[mvname] = null;
}
this.completeCall[mvname] = function(e) {
if(mvname=="signxistar"){
if(this.autoClose){
e.target.stop()
......@@ -718,10 +730,13 @@ export default class SignPanel extends Panel {
// movieClips['signxistar'].alpha = 1;
// movieClips['signxistar'].gotoAndPlay(1,1);
// }
}, this)
}.bind(this);
movieClips[mvname].addEventListener(egret.Event.COMPLETE, this.completeCall[mvname], this)
if(mvname=="signshine"){
let fun1;
movieClips['signshine'].addEventListener(egret.Event.ENTER_FRAME,fun1 = function(e){
if(this.enterFrameCall[mvname]){
this.enterFrameCall[mvname] = null;
}
this.enterFrameCall[mvname] = function(e){
var curframe = movieClips['signshine'].currentFrame;
if(curframe==20){
egret.Tween.get(movieClips['signxistar'])
......@@ -735,10 +750,14 @@ export default class SignPanel extends Panel {
movieClips['signxistar'].gotoAndPlay(1,1);
},this);
}
},this);
}.bind(this);
movieClips['signshine'].addEventListener(egret.Event.ENTER_FRAME,this.enterFrameCall[mvname] ,this);
}else if(mvname=="signgiftbox"){
let fun2;
movieClips['signgiftbox'].addEventListener(egret.Event.ENTER_FRAME,fun2 = function(e){
if(this.enterFrameCall[mvname]){
this.enterFrameCall[mvname] = null;
}
this.enterFrameCall[mvname] = function(e){
var curframe = movieClips['signgiftbox'].currentFrame;
if(curframe==5){
// egret.Tween.get(movieClips['signxistar'])
......@@ -760,10 +779,10 @@ export default class SignPanel extends Panel {
this.playShineDot();
this.tweenShowGroup();
}
},this);
}.bind(this);
movieClips['signgiftbox'].addEventListener(egret.Event.ENTER_FRAME,this.enterFrameCall[mvname],this);
movieClips['signgiftbox']
}
// if(mvname=="signxistar"){//开始收
// let fun1;
......@@ -780,4 +799,23 @@ export default class SignPanel extends Panel {
// },this)
// }
}
rmMvListener(){
var svgas = ["signgiftbox", "signsandot", "signshine", "signxistar"];
for (let i = 0; i < svgas.length; i++) {
let mvname = svgas[i];
if(movieClips[mvname]&&this.completeCall[mvname]){
movieClips[mvname].removeEventListener(egret.Event.COMPLETE,this.completeCall[mvname], this);
}
if(mvname=="signshine"){
if(movieClips[mvname]&&this.enterFrameCall[mvname]){
movieClips['signshine'].removeEventListener(egret.Event.ENTER_FRAME,this.enterFrameCall[mvname] ,this);
}
}else if(mvname=="signgiftbox"){
if(movieClips[mvname]&&this.enterFrameCall[mvname]){
movieClips['signgiftbox'].removeEventListener(egret.Event.ENTER_FRAME,this.enterFrameCall[mvname] ,this);
}
}
}
}
}
\ No newline at end of file
{
"success": true,
"signInfoVO": {
"continueDay": 4,
"continueDay": 5,
"todaySigned": 0
}
}
\ No newline at end of file
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