Commit 6b930424 authored by wildfirecode's avatar wildfirecode

1

parent bb1a1c3c
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"invite","version":5,"files":["../assets/invite/invite_invite.png","../assets/invite/invite_help.png","../assets/invite/invite_btn.png","../assets/invite/invite_bg.png","../assets/invite/prize/invitePrize_btn.png","../assets/invite/prize/invitePrize_bg.png","../assets/invite/prize/invitePrize_game_btn.png","../assets/invite/cutTime/invateCut_bg.png","../assets/invite/cutTime/invateCut_btn.png","../assets/invite/invite_wx_tip.png","../assets/invite/rule/invite_rule_bg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"invite","version":5,"files":["../assets/invite/invite_invite.png","../assets/invite/invite_help.png","../assets/invite/invite_btn.png","../assets/invite/invite_bg.png","../assets/invite/prize/invitePrize_btn.png","../assets/invite/prize/invitePrize_bg.png","../assets/invite/prize/invitePrize_game_btn.png","../assets/invite/cutTime/invateCut_bg.png","../assets/invite/cutTime/invateCut_btn.png","../assets/invite/invite_wx_tip.png","../assets/invite/rule/invite_rule_bg.png","../assets/invite/invitebg2.png"]}
\ No newline at end of file
......@@ -4,9 +4,9 @@
<w:Config id="16dd8f58b77" visible="false"/>
<e:Image id="light2" source="invitebg2_png" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296"/>
<e:Image id="light1" source="invitebg2_png" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296"/>
<e:Group id="con" y="-50"/>
<e:Image y="45.33" horizontalCenter="0" source="invite_bg_png" visible="false"/>
<e:Label text="邀请" y="679.33" textColor="0xF54500" size="28" horizontalCenter="0"/>
<e:Image y="241.33" horizontalCenter="0" source="invite_bg_png"/>
<e:Group id="con" y="-67"/>
<e:Label text="邀请好友闯关可得现金券!" y="381.33" textColor="0xF54500" size="28" horizontalCenter="0"/>
<e:Image id="prizeImg" y="439.33" horizontalCenter="0.5" source="" width="510" height="228"/>
<e:Button id="closeBtn" label="" x="605" y="227.33">
<e:skinName>
......@@ -26,7 +26,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="numLabel" text="仅差3人可获得" y="679.33" textColor="0xf54500" size="28" horizontalCenter="0" />
<e:Label id="numLabel" text="仅差3人可获得" y="679.33" textColor="0xf54500" size="28" horizontalCenter="0" visible="false"/>
<e:Label id="cutTimeLabel" text="将在23:43:21后失效" y="883.33" size="28" textColor="0xffffff" horizontalCenter="0"/>
<e:Scroller width="545" height="90" y="766.33" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0">
<e:Group anchorOffsetX="0">
......
const parser = new window["SVGA"].Parser();
export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) => {
return new Promise((resolve, reject) => {
const parser = new window["SVGA"].Parser();
parser.load(url, (videoItem) => {
const mv = new window["SVGA"].EgretMovieClip(videoItem)
mv.gotoAndPlay(1, true)
if (parent)
parent.addChild(mv);
......@@ -20,31 +21,30 @@ export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) =>
});
}
export const loadSvga2 = (url: string, parent: egret.DisplayObjectContainer,callback) => {
return new Promise((resolve, reject) => {
const parser = new window["SVGA"].Parser();
parser.load(url, (videoItem) => {
const mv = new window["SVGA"].EgretMovieClip(videoItem)
mv.gotoAndStop(1);
mv.visible=false;
setTimeout(() => {
mv.visible=true;
}, 50);
setTimeout(() => {
mv.gotoAndPlay(1, true)
},500);
if (parent)
parent.addChild(mv);
mv.addEventListener(egret.Event.COMPLETE, () => {
mv.stop();
callback();
}, this);
resolve(mv);
}, (error) => {
reject(error.message);
})
});
}
\ No newline at end of file
// export const loadSvga2 = (url: string, parent: egret.DisplayObjectContainer, callback) => {
// return new Promise((resolve, reject) => {
// const parser = new window["SVGA"].Parser();
// parser.load(url, (videoItem) => {
// const mv = new window["SVGA"].EgretMovieClip(videoItem)
// mv.visible=false;
// wait(100).then(()=>{
// mv.visible=true;
// })
// mv.gotoAndPlay(1, true)
// if (parent)
// parent.addChild(mv);
// // mv.addEventListener(egret.Event.COMPLETE, () => {
// // mv.stop();
// // callback();
// // }, this);
// resolve(mv);
// }, (error) => {
// reject(error.message);
// })
// });
// }
\ No newline at end of file
......@@ -21,6 +21,7 @@ import CountDown from "./CountDown";
import AvatarComp from "./AvatarComp";
import Utils from "../Utils";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import Loading from "../../libs/new_wx/components/Loading";
let doHelpFlag = false;
let adTag = false;
......@@ -237,11 +238,11 @@ export default class MapScene extends Scene {
this['avatar'].visible = false;
this['nameTxt'].text = '';
// NetManager.ins.hc_userInfo(() => {
this['avatar'].visible = true;
const { data } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = data.avatar;
this['avatar'].visible = true;
const { data } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = data.avatar;
this['nameTxt'].text = getNick(data.nickname);
this['nameTxt'].text = getNick(data.nickname);
// });
}
......@@ -354,8 +355,8 @@ export default class MapScene extends Scene {
avatar.start(ele);
parent.addChild(avatar);
avatar.x = item.x + 10;
avatar.y = item.y - avatar.height-30;
if(!MapScene.starHash[level].visible ) {
avatar.y = item.y - avatar.height - 30;
if (!MapScene.starHash[level].visible) {
avatar.y = item.y - avatar.height;
}
}
......@@ -366,7 +367,7 @@ export default class MapScene extends Scene {
if (!hc_mapRank) return;
const { data } = DataManager.ins.getData('hc_userInfo');
hc_mapRank.forEach((ele) => {
if(ele.levelNum == getHomeData().levels.length + 1 ){
if (ele.levelNum == getHomeData().levels.length + 1) {
ele.rank[0].avatar = data.avatar;
}
this.addAvatar(ele.levelNum, ele.rank[0]);
......@@ -440,7 +441,7 @@ export default class MapScene extends Scene {
let flag = res.data.completeFlag;
switch (true) {
case (flag == 0): // 未完成
PanelCtrl.instance.show('invite', res.data);
this.loadsvga(res);
break;
case (flag == 1): // 完成未开奖 待领奖 请求领奖接口
try {
......@@ -466,11 +467,12 @@ export default class MapScene extends Scene {
PanelCtrl.instance.show('inviteCutTime', res.data);
break;
case (flag == 4): // 可以开启下一次发任务
NetManager.ins.acceptInvitationInfo((success, res) => {
if (!success) {
return;
}
PanelCtrl.instance.show('invite', res.data);
this.loadsvga(res);
});
break;
case (flag == 5): // 可以开启下一次发任务
......@@ -482,6 +484,26 @@ export default class MapScene extends Scene {
});
}
loadsvga(res) {
if( MapScene['svga']) {
const mv = MapScene['svga']
mv.gotoAndStop(1);
res.data.svga = mv;
PanelCtrl.instance.show('invite', res.data);
return;
}
Loading.instace.show();
loadSvga(getResPath() + 'resource/assets/svgas/invite.svga').then(async (mv: any) => {
console.log('svga', mv)
MapScene['svga']=mv;
await wait(200);
Loading.instace.hide();
mv.gotoAndStop(1);
res.data.svga = mv;
PanelCtrl.instance.show('invite', res.data);
})
}
//////////////////////////////////////// 邀请有礼角标 //////////////////////////////////////////////
/**
* 查询邀请信息
......
import Panel from "../../libs/new_wx/components/Panel";
import { iswx } from "../iswx";
import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import InviteRulePanel from "./InviteRulePanel";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { iswx } from "../iswx";
import Utils from "../Utils";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { changeMapScene } from "../startScene/StartScene";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import { loadSvga, loadSvga2 } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
import InviteRulePanel from "./InviteRulePanel";
import wait from "../../libs/new_tc/wait";
export default class InvitePanel extends Panel {
public prizeImg: eui.Image;
......@@ -28,26 +25,35 @@ export default class InvitePanel extends Panel {
this.data = data;
}
start(data) {
async start(data) {
super.start();
this.showlog();
this['light1'].visible=this['light2'].visible=false;
loadSvga2(
getResPath() + 'resource/assets/svgas/invite.svga',
this['con'],()=>{
}
);
this['light1'].visible = this['light2'].visible = false;
this['con'].addChild(this.data.svga);
this.data.svga.gotoAndPlay(1, true);
this.data.svga.once(egret.Event.COMPLETE, () => {
this.data.svga.gotoAndPlay(1);
}, this);
setTimeout(() => {
this.playBgAni();
}, 800);
}, 500);
// wait(500).then(()=>{
// loadSvga2(
// ,
// );
//
// });
}
playBgAni(){
this['light1'].visible=this['light2'].visible=true;
const time=7000;
egret.Tween.get(this['light1'],{loop:true}).to({rotation:360},time);
egret.Tween.get(this['light2'],{loop:true}).to({rotation:-360},time);
playBgAni() {
this['light1'].visible = this['light2'].visible = true;
const time = 7000;
egret.Tween.get(this['light1'], { loop: true }).to({ rotation: 360 }, time);
egret.Tween.get(this['light2'], { loop: true }).to({ rotation: -360 }, time);
}
showlog() {
......
......@@ -19,7 +19,7 @@
"avatar": null
}
],
"completeFlag": 4,
"completeFlag": 0,
"openPrizeMsg": "图片",
"prizeType": "nickname",
"prizeName": "nickname",
......
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