Commit 32927ec3 authored by zjz1994's avatar zjz1994

修改签到

parent d4bd92ec
......@@ -62,6 +62,6 @@
</e:Button>
<e:Group id="light" width="151" height="187" horizontalCenter="0" verticalCenter="0">
<e:Image source="sign_mask_png" horizontalCenter="0" verticalCenter="0" x="5" y="5" scaleX="1" scaleY="1"/>
<e:Image source="sign_light_png" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="18.5"/>
<e:Image id="roaimg" source="sign_light_png" scaleX="1" scaleY="1" anchorOffsetX="28" anchorOffsetY="30" x="75" y="112"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -17,7 +17,7 @@
</e:Group>
</e:Scroller>
<e:Label text="连续登录闯关可以获得更丰厚的奖励哦~" y="371" textColor="0xf7713a" size="26" horizontalCenter="0" fontFamily="FZY4JW"/>
<e:Button id="btn1" label="" horizontalCenter="0" bottom="222">
<e:Button id="btn1" label="" anchorOffsetX="184" anchorOffsetY="55" x="375" y="916">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="signbtn1_png" source.down="signbtn1_png" source.disabled="signbtn1_png"/>
......@@ -28,23 +28,25 @@
<e:Group id="prizegroup" width="750" height="1206" x="0" y="0">
<e:Rect id="mask1" fillAlpha="0.8" x="0" y="0" scaleX="1" scaleY="1" width="750" height="1206"/>
<e:Group id="lightbot" width="750" height="1206" x="0" y="0"/>
<e:Group id="contmid" width="750" height="1206" y="0" x="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="prizeimg1" 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:Label id="nums" text="×8" size="48" verticalAlign="middle" fontFamily="FZY3JW" textColor="0xC17343" bold="true" y="7" x="68"/>
</e:Group>
</e:Group>
<e:Group id="lightop" width="750" height="1206">
</e:Group>
<e:Button id="btn2" label="" horizontalCenter="0" bottom="242" x="191" y="861" scaleX="1" scaleY="1">
<e:skinName>
<e:Button id="btn2" label="" x="375" y="901" scaleX="1" scaleY="1" anchorOffsetX="179" anchorOffsetY="50">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="signprize_btn_png" source.down="signprize_btn_png" source.disabled="signprize_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
<e:Image width="100%" height="100%" source="signprize_btn_png" source.down="signprize_btn_png" source.disabled="signprize_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:skinName>
</e:Button>
</e:Group>
<e:Group id="lightop" width="750" height="1206" touchThrough="true" touchEnabled="false">
</e:Group>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -67,13 +67,16 @@ export default class SignItem extends eui.ItemRenderer {
}, this);
}
setSinged() {
setSigned() {
// this['btn1'].visible = false;
// this['btn2'].visible = false;
// this['btn3'].visible = false;
// this['btn4'].visible = false;
this['light'].visible = true;
// this['btn2'].visible = true;
}
}
\ No newline at end of file
......@@ -33,6 +33,12 @@ export default class SignPanel extends Panel {
this.once(egret.TouchEvent.ADDED_TO_STAGE, () => {
this["mask1"].height = this.stage.stageHeight;
this["mask1"].y = (this["prizegroup"].height-this["mask1"].height)/2;
//加入舞台
setTimeout(() => {
this.tweenBtn(this['btn1'],'tl');
}, 200)
}, this);
......@@ -77,7 +83,7 @@ export default class SignPanel extends Panel {
return;
}
item.setSinged();
// item.setSinged();
// showToast('签到成功!快去闯关吧~');
// PanelCtrl.instance.show('signPrize');
// PanelCtrl.instance.addToShowPanels('signPrize');
......@@ -117,6 +123,7 @@ export default class SignPanel extends Panel {
ele.btn = 1;
this.signidx = index;
}
console.log("今日签到数据",index,this.signidx);
this.todayidx = index;
} else if (index == tomorrowIndex) {
ele.btn = 3;
......@@ -207,7 +214,7 @@ export default class SignPanel extends Panel {
isNotGift(theSeventhDayOptions: any[]) {
const results = theSeventhDayOptions.filter(item => item.rate == 100);
let result;
console.log("礼盒检测",result);
console.log("礼盒检测",results);
if (results.length == 1) {
result = results[0];
return result;
......@@ -249,7 +256,13 @@ export default class SignPanel extends Panel {
this["btn2"].addEventListener(egret.TouchEvent.TOUCH_TAP, this.kaixinshouxia, this);
}
kaixinshouxia(){
this["prizegroup"].visible = false;
this["btn2"].visible = false;
this.tweenGroup(this['contmid'],"close",function(){
this["prizegroup"].visible = false;
//签到完毕
this.changeSignToday();
}.bind(this));
}
signToday(){
if(this.signidx!=-1){
......@@ -380,7 +393,15 @@ export default class SignPanel extends Panel {
this["btn2"].visible = this.showsxbtn;
if(this.showsxbtn){//手动关闭
this['contmid'].visible = false;
this['giftbox'].visible = true;
//礼盒动画播放完毕,弹出奖励,奖励弹出完毕弹出收下按钮
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{//自动关闭
var item = this.list.getChildAt(this.todayidx);
var prizeimgx = item['prizeimg'].x;
......@@ -407,8 +428,10 @@ export default class SignPanel extends Panel {
this.movec1 = new egret.Point(lctrlpos.x,lctrlpos.y);
this.movep2 = new egret.Point(ltopos.x,ltopos.y);
this.itemEffect("shake");
await wait(1000);
this["prizegroup"].visible = false;
egret.Tween.get(this).to({factor: 1}, 500).call(this.moveOver, this);
}
}
......@@ -430,11 +453,125 @@ export default class SignPanel extends Panel {
}
moveOver(){
this.moveimg.visible = false;
//签到完毕
this.changeSignToday();
}
changeSignToday(){
//添加遮罩特效
this.list.dataProvider = new eui.ArrayCollection(this.signdata);
// this.list.dataProvider = new eui.ArrayCollection(this.signdata);
this.itemEffect("roasign",function(){
//修改按钮为已签到
this.tweenBtn(this['btn1'],'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'];
egret.Tween.get(prizeimg)
.set({
scaleX:1,
scaleY:1
})
.to({
scaleX:0.7,
scaleY:0.7
},150)
.to({
scaleX:1,
scaleY:1
},150)
.call(()=>{
titletxt.text = "已领取";
},this);
}else if(effectype=="roasign"){//签到完成,修改状态时对号旋转归位
todayitem.setSigned();
var roaimg = todayitem["roaimg"];
console.log(this.todayidx,"旋转对号",roaimg);
egret.Tween.get(roaimg)
.set({
rotation:70,
scaleX:0.5,
scaleY:0.5
})
.to({
scaleX:1,
scaleY:1,
rotation:0
},250,egret.Ease.sineIn)
.call(()=>{
callfunc&&callfunc();
},this);
}
}
//本页面专门的按钮动效
tweenBtn(btn:egret.DisplayObject,act:string,callfunc=null){
if(act=="tl"){//->小->正常
egret.Tween.get(btn).to({
scaleX:0.9,
scaleY:0.9
},150)
.to({
scaleX:1,
scaleY:1
},150)
.call(()=>{
callfunc&&callfunc();
},this)
}else if(act="tb"){//->大->正常
egret.Tween.get(btn).to({
scaleX:1.1,
scaleY:1.1
},150)
.to({
scaleX:1,
scaleY:1
},150)
.call(()=>{
callfunc&&callfunc();
},this);
}
}
//奖励弹窗动效
tweenGroup(group:egret.DisplayObject,act:string,callfunc:Function){
if(act=="open"){
group.scaleX = 0.2;
group.scaleY = 0.2;
group.alpha = 0.2;
egret.Tween.get(group)
.to({
scaleX:1,
scaleY:1,
alpha:1,
},200)
.call(()=>{
callfunc&&callfunc();
},this)
}else if(act=="close"){
group.scaleX = 1;
group.scaleY = 1;
group.alpha = 1;
egret.Tween.get(group)
.to({
scaleX:0.2,
scaleY:0.2,
alpha:0.2,
},200)
.call(()=>{
callfunc&&callfunc();
},this);
}
}
}
\ 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