Commit 3b062717 authored by zjz1994's avatar zjz1994

签到奖励暂存

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