Commit 3b062717 authored by zjz1994's avatar zjz1994

签到奖励暂存

parent 312b26d0
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<e:Group id="lightbot" width="750" height="1206" x="0" y="0"/> <e:Group id="lightbot" width="750" height="1206" x="0" y="0"/>
<e:Group id="giftbox" width="750" height="1206"/> <e:Group id="giftbox" width="750" height="1206"/>
<e:Group id="contmid" width="750" height="1206" anchorOffsetX="375" x="375" anchorOffsetY="603" y="603"> <e:Group id="contmid" width="750" height="1206" anchorOffsetX="375" x="375" anchorOffsetY="603" y="603">
<e:Image id="prizeimg" scaleX="2" scaleY="2" y="537" source="" x="296"/> <e:Image id="prizeimg" scaleX="2" scaleY="2" y="537" source="" horizontalCenter="0"/>
<e:Image id="prizeimg1" scaleX="1" scaleY="1" y="537" source="" horizontalCenter="0"/> <e:Image id="prizeimg1" scaleX="1" scaleY="1" y="537" source="" horizontalCenter="0"/>
<e:Image id="prizeimg2" source="turnprize_icon2_png" scaleX="1" scaleY="1" x="317" y="545" visible="false"/> <e:Image id="prizeimg2" source="turnprize_icon2_png" scaleX="1" scaleY="1" x="317" y="545" visible="false"/>
<e:Group id="numsgroup" anchorOffsetX="0" width="188" anchorOffsetY="0" height="62" x="281" y="684"> <e:Group id="numsgroup" anchorOffsetX="0" width="188" anchorOffsetY="0" height="62" x="281" y="684">
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Group id="container2" y="-38"/> <e:Group id="container2" y="-38"/>
<e:Label id="nums" text="我的元宝:0" y="323.95" fontFamily="FZY3JW" horizontalCenter="1" textColor="0xffe9c0" size="32"/> <e:Label id="nums" text="我的元宝:0" y="323.95" fontFamily="FZY3JW" horizontalCenter="1" textColor="0xffe9c0" size="32" width="750" verticalAlign="middle" textAlign="center"/>
<e:Label id="btnLabel" text="Label" size="28" verticalCenter="315" verticalAlign="middle" textAlign="center" bold="true" touchEnabled="false" fontFamily="FZY3JW" horizontalCenter="0.5" textColor="0xffe9c0"/> <e:Label id="btnLabel" text="免费次数:4次" size="28" verticalCenter="315" verticalAlign="middle" textAlign="center" bold="true" touchEnabled="false" fontFamily="FZY3JW" horizontalCenter="0.5" textColor="0xffe9c0" width="750" wordWrap="false"/>
<e:Image id="rulebtn" source="turntable_rulebtn_png" y="1162.01" horizontalCenter="0"/> <e:Image id="rulebtn" source="turntable_rulebtn_png" y="1162.01" horizontalCenter="0"/>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -106,7 +106,6 @@ export default class SignPanel extends Panel { ...@@ -106,7 +106,6 @@ export default class SignPanel extends Panel {
this.hidePanel(); this.hidePanel();
}, window['signActivityId']) }, window['signActivityId'])
// console.log(data);
}; };
const list: any[] = [{}, {}, {}, {}, {}, {}, {}]; const list: any[] = [{}, {}, {}, {}, {}, {}, {}];
...@@ -170,7 +169,6 @@ export default class SignPanel extends Panel { ...@@ -170,7 +169,6 @@ export default class SignPanel extends Panel {
// { nums: '0.3元', type: 'quan30' } // { nums: '0.3元', type: 'quan30' }
private getConfigs() { private getConfigs() {
let config = DataManager.ins.getData(NetName.GET_CONFIG).data; let config = DataManager.ins.getData(NetName.GET_CONFIG).data;
// console.log("签到原始数据",config);
let getSignConfig = config && config.signConf; let getSignConfig = config && config.signConf;
if (getSignConfig && getSignConfig.sixDaysBeforeOptions && getSignConfig.theSeventhDayOptions) { if (getSignConfig && getSignConfig.sixDaysBeforeOptions && getSignConfig.theSeventhDayOptions) {
...@@ -223,7 +221,6 @@ export default class SignPanel extends Panel { ...@@ -223,7 +221,6 @@ export default class SignPanel extends Panel {
isNotGift(theSeventhDayOptions: any[]) { isNotGift(theSeventhDayOptions: any[]) {
const results = theSeventhDayOptions.filter(item => item.rate == 100); const results = theSeventhDayOptions.filter(item => item.rate == 100);
let result; let result;
// console.log("礼盒检测",results);
if (results.length == 1) { if (results.length == 1) {
result = results[0]; result = results[0];
return result; return result;
...@@ -268,7 +265,9 @@ export default class SignPanel extends Panel { ...@@ -268,7 +265,9 @@ export default class SignPanel extends Panel {
this["btn2"].visible = false; this["btn2"].visible = false;
this.tweenGroup(this['contmid'],"close",function(){ this.tweenGroup(this['contmid'],"close",function(){
this["prizegroup"].visible = false; this["prizegroup"].visible = false;
if(movieClips["signxistar"].parent){
movieClips["signxistar"].parent.removeChild(movieClips["signxistar"]);
}
//签到完毕 //签到完毕
this.changeSignToday(); this.changeSignToday();
}.bind(this)); }.bind(this));
...@@ -339,6 +338,9 @@ export default class SignPanel extends Panel { ...@@ -339,6 +338,9 @@ export default class SignPanel extends Panel {
movep2:egret.Point; movep2:egret.Point;
moveimg:eui.Image; moveimg:eui.Image;
//自动关闭或是手动关闭
autoClose:boolean = true;
async changeShowPrize(customInfo){ async changeShowPrize(customInfo){
this["prizegroup"].visible = true; this["prizegroup"].visible = true;
...@@ -385,7 +387,6 @@ export default class SignPanel extends Panel { ...@@ -385,7 +387,6 @@ export default class SignPanel extends Panel {
this['prizeimg'].source = 'signicon2_png'; this['prizeimg'].source = 'signicon2_png';
}else{ }else{
showprizeimg = false; showprizeimg = false;
// console.log("之前应该有处理");
} }
...@@ -414,30 +415,27 @@ export default class SignPanel extends Panel { ...@@ -414,30 +415,27 @@ export default class SignPanel extends Panel {
movieClips['signxistar'].alpha = 0; movieClips['signxistar'].alpha = 0;
} }
if(this.showsxbtn||!this['prizeimg'].visible){//手动关闭 if(this.showsxbtn||!this['prizeimg'].visible){//手动关闭
this.autoClose = false;
this['contmid'].visible = false; this['contmid'].visible = false;
this['giftbox'].visible = true;
//礼盒动画播放完毕,弹出奖励,奖励弹出完毕弹出收下按钮 //礼盒动画播放完毕,弹出奖励,奖励弹出完毕弹出收下按钮
if(this.showsxbtn){//是第七天并且奖励是礼盒 if(this.showsxbtn){//是第七天并且奖励是礼盒
this['giftbox'].visible = true;
this['giftbox'].alpha = 1;
if(movieClips['signgiftbox']){ if(movieClips['signgiftbox']){
this['giftbox'].addChild(movieClips['signgiftbox']); this['giftbox'].addChild(movieClips['signgiftbox']);
movieClips['signgiftbox'].gotoAndPlay(1,1); movieClips['signgiftbox'].gotoAndPlay(1,1);
} }
}else{//其他 }else{//其他,如虚拟物品
this.playShineDot(); this.playShineDot();
this.tweenShowGroup();
} }
this['contmid'].visible = true;
this["btn2"].visible = false;
this.tweenGroup(this['contmid'],"open",function(){
this["btn2"].visible = true;
this.tweenBtn(this['btn2'],'tb');
}.bind(this));
}else{//自动关闭 }else{//自动关闭
this.autoClose = true;
var item = this.list.getChildAt(this.todayidx); var item = this.list.getChildAt(this.todayidx);
var prizeimgx = item['prizeimg'].x; var prizeimgx = item['prizeimg'].x;
var prizeimgy = item['prizeimg'].y; var prizeimgy = item['prizeimg'].y;
var wtopos = item.localToGlobal(prizeimgx,prizeimgy); var wtopos = item.localToGlobal(prizeimgx,prizeimgy);
// console.log("位置需要缩进",this['prizeimg'].width); var wstpos = this['contmid'].localToGlobal(this['prizeimg'].x-this['prizeimg'].width,this['prizeimg'].y);
var wstpos = this['contmid'].localToGlobal(this['prizeimg'].x,this['prizeimg'].y);
var wctrlpos = item.localToGlobal(0,item.height); var wctrlpos = item.localToGlobal(0,item.height);
var lstpos = this.globalToLocal(wstpos.x,wstpos.y); var lstpos = this.globalToLocal(wstpos.x,wstpos.y);
...@@ -489,10 +487,12 @@ export default class SignPanel extends Panel { ...@@ -489,10 +487,12 @@ export default class SignPanel extends Panel {
},150) },150)
.call(()=>{ .call(()=>{
if(movieClips['signshine']){ if(movieClips['signshine']){
this['lightop'].addChild(movieClips['signshine']);
movieClips['signshine'].alpha = 1; movieClips['signshine'].alpha = 1;
movieClips['signshine'].gotoAndPlay(1,1); movieClips['signshine'].gotoAndPlay(1,1);
} }
if(movieClips['signsandot']){ if(movieClips['signsandot']){
this['lightop'].addChild(movieClips['signsandot']);
movieClips['signsandot'].gotoAndPlay(1,1); movieClips['signsandot'].gotoAndPlay(1,1);
} }
},this); },this);
...@@ -506,6 +506,7 @@ export default class SignPanel extends Panel { ...@@ -506,6 +506,7 @@ export default class SignPanel extends Panel {
// this.movec1.x,this.movec1.y,'\n', // this.movec1.x,this.movec1.y,'\n',
// this.moveimg.x,this.moveimg.y); // this.moveimg.x,this.moveimg.y);
//(100,300)锚点坐标 //(100,300)锚点坐标
// console.log("曲线运动",this.movep1,this.movep2,this.movec1);
this.moveimg.x = (1 - value) * (1 - value) * this.movep1.x + 2 * value * (1 - value) * this.movec1.x + value * value * this.movep2.x; this.moveimg.x = (1 - value) * (1 - value) * this.movep1.x + 2 * value * (1 - value) * this.movec1.x + value * value * this.movep2.x;
this.moveimg.y = (1 - value) * (1 - value) * this.movep1.y + 2 * value * (1 - value) * this.movec1.y + value * value * this.movep2.y; this.moveimg.y = (1 - value) * (1 - value) * this.movep1.y + 2 * value * (1 - value) * this.movec1.y + value * value * this.movep2.y;
...@@ -528,11 +529,19 @@ export default class SignPanel extends Panel { ...@@ -528,11 +529,19 @@ export default class SignPanel extends Panel {
this.tweenBtn(this['btn1'],'tb'); this.tweenBtn(this['btn1'],'tb');
}.bind(this)); }.bind(this));
} }
//礼盒弹出后的弹窗
tweenShowGroup(){
this['contmid'].visible = true;
this["btn2"].visible = false;
this.tweenGroup(this['contmid'],"open",function(){
this["btn2"].visible = true;
this.tweenBtn(this['btn2'],'tb');
}.bind(this));
}
//item动效 //item动效
itemEffect(effectype:string,callfunc=null){ itemEffect(effectype:string,callfunc=null){
var todayitem:SignItem = this.list.getChildAt(this.todayidx) as SignItem; var todayitem:SignItem = this.list.getChildAt(this.todayidx) as SignItem;
// console.log(todayitem);
if(effectype=="shake"){//奖励开始飞的售后item的图标抖一下 if(effectype=="shake"){//奖励开始飞的售后item的图标抖一下
var prizeimg = todayitem['prizeimg']; var prizeimg = todayitem['prizeimg'];
var titletxt = todayitem['title']; var titletxt = todayitem['title'];
...@@ -555,7 +564,6 @@ export default class SignPanel extends Panel { ...@@ -555,7 +564,6 @@ export default class SignPanel extends Panel {
}else if(effectype=="roasign"){//签到完成,修改状态时对号旋转归位 }else if(effectype=="roasign"){//签到完成,修改状态时对号旋转归位
todayitem.setSigned(); todayitem.setSigned();
var roaimg = todayitem["roaimg"]; var roaimg = todayitem["roaimg"];
// console.log(this.todayidx,"旋转对号",roaimg);
egret.Tween.get(roaimg) egret.Tween.get(roaimg)
.set({ .set({
rotation:70, rotation:70,
...@@ -645,10 +653,10 @@ export default class SignPanel extends Panel { ...@@ -645,10 +653,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);
...@@ -656,7 +664,6 @@ export default class SignPanel extends Panel { ...@@ -656,7 +664,6 @@ export default class SignPanel extends Panel {
mv.stop(); mv.stop();
// console.log(mvname,mv);
var boxwidth = 750; var boxwidth = 750;
var boxheight = 1206; var boxheight = 1206;
...@@ -690,14 +697,22 @@ export default class SignPanel extends Panel { ...@@ -690,14 +697,22 @@ export default class SignPanel extends Panel {
addMvListener(mvname){ addMvListener(mvname){
let fun; let fun;
movieClips[mvname].addEventListener(egret.Event.COMPLETE, fun = function(e) { movieClips[mvname].addEventListener(egret.Event.COMPLETE, fun = function(e) {
if(mvname=="signxistar"){
if(this.autoClose){
e.target.stop() e.target.stop()
if (e.target.parent) { if (e.target.parent) {
e.target.parent.removeChild(e.target) e.target.parent.removeChild(e.target)
} }
if(mvname=="signxistar"){
this["prizegroup"].visible = false; this["prizegroup"].visible = false;
egret.Tween.get(this).to({factor: 1}, 500).call(this.moveOver, this); egret.Tween.get(this).to({factor: 1}, 500).call(this.moveOver, this);
}else{
// movieClips["signxistar"].gotoAndStop(120);
}
}else{
e.target.stop()
if (e.target.parent) {
e.target.parent.removeChild(e.target)
}
} }
// if(mvname=="signshine"){ // if(mvname=="signshine"){
// movieClips['signxistar'].alpha = 1; // movieClips['signxistar'].alpha = 1;
...@@ -720,7 +735,35 @@ export default class SignPanel extends Panel { ...@@ -720,7 +735,35 @@ export default class SignPanel extends Panel {
movieClips['signxistar'].gotoAndPlay(1,1); movieClips['signxistar'].gotoAndPlay(1,1);
},this); },this);
} }
},this) },this);
}else if(mvname=="signgiftbox"){
let fun2;
movieClips['signgiftbox'].addEventListener(egret.Event.ENTER_FRAME,fun2 = function(e){
var curframe = movieClips['signgiftbox'].currentFrame;
if(curframe==5){
// egret.Tween.get(movieClips['signxistar'])
// .set({
// alpha:0
// })
// .to({
// alpha:1,
// },200)
// .call(()=>{
// movieClips['signxistar'].gotoAndPlay(1,1);
// },this);
}
else if(curframe==150){
egret.Tween.get(this['giftbox'])
.to({
alpha:0
},200);
this.playShineDot();
this.tweenShowGroup();
}
},this);
movieClips['signgiftbox']
} }
// if(mvname=="signxistar"){//开始收 // if(mvname=="signxistar"){//开始收
// let fun1; // let fun1;
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
"success":true, "success":true,
"errorMsg":null, "errorMsg":null,
"code":"", "code":"",
"prizeType":"coin", "prizeType":"prop",
"prizeName":"奖品名称", "prizeName":"奖品名称",
"logo":"http://yun.duiba.com.cn/db_games/activity/game/guideImage/guide2.png", "logo":"http://yun.duiba.com.cn/db_games/activity/game/guideImage/guide2.png",
"prizeCount":11, "prizeCount":11,
"itemId":59029 "itemId":59031
} }
} }
\ No newline at end of file
{ {
"success": true, "success": true,
"signInfoVO": { "signInfoVO": {
"continueDay": 2, "continueDay": 4,
"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