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"]} {"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 \ No newline at end of file
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
<w:Config id="16dd8f58b77" visible="false"/> <w:Config id="16dd8f58b77" visible="false"/>
<e:Image id="light2" source="invitebg2_png" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296"/> <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:Image id="light1" source="invitebg2_png" x="376" y="317" anchorOffsetX="356" anchorOffsetY="296"/>
<e:Group id="con" y="-50"/> <e:Image y="241.33" horizontalCenter="0" source="invite_bg_png"/>
<e:Image y="45.33" horizontalCenter="0" source="invite_bg_png" visible="false"/> <e:Group id="con" y="-67"/>
<e:Label text="邀请" y="679.33" textColor="0xF54500" size="28" horizontalCenter="0"/> <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: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:Button id="closeBtn" label="" x="605" y="227.33">
<e:skinName> <e:skinName>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </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: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:Scroller width="545" height="90" y="766.33" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0">
<e:Group anchorOffsetX="0"> <e:Group anchorOffsetX="0">
......
const parser = new window["SVGA"].Parser();
export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) => { export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const parser = new window["SVGA"].Parser();
parser.load(url, (videoItem) => { parser.load(url, (videoItem) => {
const mv = new window["SVGA"].EgretMovieClip(videoItem) const mv = new window["SVGA"].EgretMovieClip(videoItem)
mv.gotoAndPlay(1, true) mv.gotoAndPlay(1, true)
if (parent) if (parent)
parent.addChild(mv); parent.addChild(mv);
...@@ -20,31 +21,30 @@ export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) => ...@@ -20,31 +21,30 @@ export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) =>
}); });
} }
export const loadSvga2 = (url: string, parent: egret.DisplayObjectContainer,callback) => { // export const loadSvga2 = (url: string, parent: egret.DisplayObjectContainer, callback) => {
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
const parser = new window["SVGA"].Parser(); // const parser = new window["SVGA"].Parser();
parser.load(url, (videoItem) => { // parser.load(url, (videoItem) => {
const mv = new window["SVGA"].EgretMovieClip(videoItem) // const mv = new window["SVGA"].EgretMovieClip(videoItem)
mv.gotoAndStop(1);
mv.visible=false; // mv.visible=false;
setTimeout(() => { // wait(100).then(()=>{
mv.visible=true; // mv.visible=true;
}, 50); // })
setTimeout(() => { // mv.gotoAndPlay(1, true)
mv.gotoAndPlay(1, true)
},500); // if (parent)
if (parent) // parent.addChild(mv);
parent.addChild(mv);
// // mv.addEventListener(egret.Event.COMPLETE, () => {
mv.addEventListener(egret.Event.COMPLETE, () => { // // mv.stop();
mv.stop(); // // callback();
callback(); // // }, this);
}, this);
// resolve(mv);
resolve(mv);
// }, (error) => {
}, (error) => { // reject(error.message);
reject(error.message); // })
}) // });
}); // }
} \ No newline at end of file
\ No newline at end of file
...@@ -21,6 +21,7 @@ import CountDown from "./CountDown"; ...@@ -21,6 +21,7 @@ import CountDown from "./CountDown";
import AvatarComp from "./AvatarComp"; import AvatarComp from "./AvatarComp";
import Utils from "../Utils"; import Utils from "../Utils";
import { GDispatcher } from "../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import Loading from "../../libs/new_wx/components/Loading";
let doHelpFlag = false; let doHelpFlag = false;
let adTag = false; let adTag = false;
...@@ -354,8 +355,8 @@ export default class MapScene extends Scene { ...@@ -354,8 +355,8 @@ export default class MapScene extends Scene {
avatar.start(ele); avatar.start(ele);
parent.addChild(avatar); parent.addChild(avatar);
avatar.x = item.x + 10; avatar.x = item.x + 10;
avatar.y = item.y - avatar.height-30; avatar.y = item.y - avatar.height - 30;
if(!MapScene.starHash[level].visible ) { if (!MapScene.starHash[level].visible) {
avatar.y = item.y - avatar.height; avatar.y = item.y - avatar.height;
} }
} }
...@@ -366,7 +367,7 @@ export default class MapScene extends Scene { ...@@ -366,7 +367,7 @@ export default class MapScene extends Scene {
if (!hc_mapRank) return; if (!hc_mapRank) return;
const { data } = DataManager.ins.getData('hc_userInfo'); const { data } = DataManager.ins.getData('hc_userInfo');
hc_mapRank.forEach((ele) => { hc_mapRank.forEach((ele) => {
if(ele.levelNum == getHomeData().levels.length + 1 ){ if (ele.levelNum == getHomeData().levels.length + 1) {
ele.rank[0].avatar = data.avatar; ele.rank[0].avatar = data.avatar;
} }
this.addAvatar(ele.levelNum, ele.rank[0]); this.addAvatar(ele.levelNum, ele.rank[0]);
...@@ -440,7 +441,7 @@ export default class MapScene extends Scene { ...@@ -440,7 +441,7 @@ export default class MapScene extends Scene {
let flag = res.data.completeFlag; let flag = res.data.completeFlag;
switch (true) { switch (true) {
case (flag == 0): // 未完成 case (flag == 0): // 未完成
PanelCtrl.instance.show('invite', res.data); this.loadsvga(res);
break; break;
case (flag == 1): // 完成未开奖 待领奖 请求领奖接口 case (flag == 1): // 完成未开奖 待领奖 请求领奖接口
try { try {
...@@ -466,11 +467,12 @@ export default class MapScene extends Scene { ...@@ -466,11 +467,12 @@ export default class MapScene extends Scene {
PanelCtrl.instance.show('inviteCutTime', res.data); PanelCtrl.instance.show('inviteCutTime', res.data);
break; break;
case (flag == 4): // 可以开启下一次发任务 case (flag == 4): // 可以开启下一次发任务
NetManager.ins.acceptInvitationInfo((success, res) => { NetManager.ins.acceptInvitationInfo((success, res) => {
if (!success) { if (!success) {
return; return;
} }
PanelCtrl.instance.show('invite', res.data); this.loadsvga(res);
}); });
break; break;
case (flag == 5): // 可以开启下一次发任务 case (flag == 5): // 可以开启下一次发任务
...@@ -482,6 +484,26 @@ export default class MapScene extends Scene { ...@@ -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 Panel from "../../libs/new_wx/components/Panel";
import { iswx } from "../iswx";
import getSkinPath from "../../libs/new_wx/utils/getSkinPath"; 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 { NetManager } from "../../libs/tw/manager/NetManager";
import { iswx } from "../iswx";
import Utils from "../Utils"; import Utils from "../Utils";
import { DataManager } from "../../libs/tw/manager/DataManager"; import InviteRulePanel from "./InviteRulePanel";
import { changeMapScene } from "../startScene/StartScene"; import wait from "../../libs/new_tc/wait";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
import { loadSvga, loadSvga2 } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
export default class InvitePanel extends Panel { export default class InvitePanel extends Panel {
public prizeImg: eui.Image; public prizeImg: eui.Image;
...@@ -28,26 +25,35 @@ export default class InvitePanel extends Panel { ...@@ -28,26 +25,35 @@ export default class InvitePanel extends Panel {
this.data = data; this.data = data;
} }
start(data) { async start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
this['light1'].visible=this['light2'].visible=false; this['light1'].visible = this['light2'].visible = false;
loadSvga2(
getResPath() + 'resource/assets/svgas/invite.svga', this['con'].addChild(this.data.svga);
this['con'],()=>{ this.data.svga.gotoAndPlay(1, true);
this.data.svga.once(egret.Event.COMPLETE, () => {
this.data.svga.gotoAndPlay(1);
}, this);
}
);
setTimeout(() => { setTimeout(() => {
this.playBgAni(); this.playBgAni();
}, 800); }, 500);
// wait(500).then(()=>{
// loadSvga2(
// ,
// );
//
// });
} }
playBgAni(){ playBgAni() {
this['light1'].visible=this['light2'].visible=true; this['light1'].visible = this['light2'].visible = true;
const time=7000; const time = 7000;
egret.Tween.get(this['light1'],{loop:true}).to({rotation:360},time); egret.Tween.get(this['light1'], { loop: true }).to({ rotation: 360 }, time);
egret.Tween.get(this['light2'],{loop:true}).to({rotation:-360},time); egret.Tween.get(this['light2'], { loop: true }).to({ rotation: -360 }, time);
} }
showlog() { showlog() {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"avatar": null "avatar": null
} }
], ],
"completeFlag": 4, "completeFlag": 0,
"openPrizeMsg": "图片", "openPrizeMsg": "图片",
"prizeType": "nickname", "prizeType": "nickname",
"prizeName": "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