Commit 06e4d8b1 authored by zjz1994's avatar zjz1994

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

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