Commit bb1a1c3c authored by wildfirecode's avatar wildfirecode

1

parent 4abe6267
...@@ -217,5 +217,8 @@ ...@@ -217,5 +217,8 @@
"value": "http://yun.duiba.com.cn/db_games/fishlogo.png" "value": "http://yun.duiba.com.cn/db_games/fishlogo.png"
} }
] ]
},
"16dd8f58b77": {
"bindingDataTestObj": []
} }
} }
\ No newline at end of file
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
"name": "friend" "name": "friend"
}, },
{ {
"keys": "invite_invite_png,invite_help_png,invite_btn_png,invite_bg_png,invitePrize_btn_png,invitePrize_bg_png,invitePrize_game_btn_png,invateCut_bg_png,invateCut_btn_png,invite_wx_tip_png,invite_rule_bg_png", "keys": "invite_invite_png,invite_help_png,invite_btn_png,invite_bg_png,invitePrize_btn_png,invitePrize_bg_png,invitePrize_game_btn_png,invateCut_bg_png,invateCut_btn_png,invite_wx_tip_png,invite_rule_bg_png,invitebg2_png",
"name": "invite" "name": "invite"
}, },
{ {
...@@ -2259,6 +2259,11 @@ ...@@ -2259,6 +2259,11 @@
"url": "assets/sharefriendwx.jpg", "url": "assets/sharefriendwx.jpg",
"type": "image", "type": "image",
"name": "sharefriendwx_jpg" "name": "sharefriendwx_jpg"
},
{
"url": "assets/invite/invitebg2.png",
"type": "image",
"name": "invitebg2_png"
} }
] ]
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" <e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing"> xmlns:w="http://ns.egret.com/wing">
<e:Image y="45.33" horizontalCenter="0" source="invite_bg_png" /> <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 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>
......
...@@ -9,7 +9,36 @@ export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) => ...@@ -9,7 +9,36 @@ export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) =>
parent.addChild(mv); parent.addChild(mv);
mv.addEventListener(egret.Event.COMPLETE, () => { mv.addEventListener(egret.Event.COMPLETE, () => {
// console.log("播放完成") console.log("播放完成")
}, this);
resolve(mv);
}, (error) => {
reject(error.message);
})
});
}
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); }, this);
resolve(mv); resolve(mv);
......
...@@ -7,6 +7,8 @@ import Utils from "../Utils"; ...@@ -7,6 +7,8 @@ import Utils from "../Utils";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import { changeMapScene } from "../startScene/StartScene"; import { changeMapScene } from "../startScene/StartScene";
import { GDispatcher } from "../../libs/tc/util/GDispatcher"; 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;
...@@ -29,6 +31,23 @@ export default class InvitePanel extends Panel { ...@@ -29,6 +31,23 @@ export default class InvitePanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
this['light1'].visible=this['light2'].visible=false;
loadSvga2(
getResPath() + 'resource/assets/svgas/invite.svga',
this['con'],()=>{
}
);
setTimeout(() => {
this.playBgAni();
}, 800);
}
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() { showlog() {
...@@ -68,27 +87,27 @@ export default class InvitePanel extends Panel { ...@@ -68,27 +87,27 @@ export default class InvitePanel extends Panel {
initUI() { initUI() {
this.setWXShareTip(); this.setWXShareTip();
this.prizeImg.source = this.data.prizeImg; this.prizeImg.source = this.data.prizeImg;
if(!this.data.invitationUser){ if (!this.data.invitationUser) {
this.data.invitationUser = []; this.data.invitationUser = [];
} }
let dNum = this.data.invitationCount - this.data.invitationUser.length; let dNum = this.data.invitationCount - this.data.invitationUser.length;
this.numLabel.text = `仅差${dNum}人可获得`; this.numLabel.text = `仅差${dNum}人可获得`;
for(let i = 0; i < dNum; i++) { for (let i = 0; i < dNum; i++) {
this.data.invitationUser.push({ this.data.invitationUser.push({
nickname: "nickname", nickname: "nickname",
avatar: this.invite_img, avatar: this.invite_img,
}); });
} }
for(let i = 0; i < this.data.invitationUser.length;i++){ for (let i = 0; i < this.data.invitationUser.length; i++) {
this.data.invitationUser[i]['callFun'] = ()=>{ this.data.invitationUser[i]['callFun'] = () => {
NetManager.ins.getShareCode((success, res) => { NetManager.ins.getShareCode((success, res) => {
if(!success) { if (!success) {
return; return;
} }
let shareCode = res.data; // 分享码 let shareCode = res.data; // 分享码
CFG.wxShareLink = window['h5URL'] + "&shareCode=" + shareCode; // 分享链接 CFG.wxShareLink = window['h5URL'] + "&shareCode=" + shareCode; // 分享链接
if(iswx()) { //微信端 if (iswx()) { //微信端
this.wxShareTip.visible = true; this.wxShareTip.visible = true;
window["invokeWX"](); window["invokeWX"]();
} else {//端内 } else {//端内
...@@ -103,7 +122,7 @@ export default class InvitePanel extends Panel { ...@@ -103,7 +122,7 @@ export default class InvitePanel extends Panel {
this.list.dataProvider = new eui.ArrayCollection(this.data.invitationUser); this.list.dataProvider = new eui.ArrayCollection(this.data.invitationUser);
this.cutTime = this.data.endTime - this.data.sysTime + 5000; this.cutTime = this.data.endTime - this.data.sysTime + 5000;
if(this.timer){ if (this.timer) {
this.timer.stop(); this.timer.stop();
} }
this.timer = new egret.Timer(1000, 0); this.timer = new egret.Timer(1000, 0);
...@@ -114,7 +133,7 @@ export default class InvitePanel extends Panel { ...@@ -114,7 +133,7 @@ export default class InvitePanel extends Panel {
private cutTimer() { private cutTimer() {
let timer = this.convertTime(this.cutTime -= 1000); let timer = this.convertTime(this.cutTime -= 1000);
if(timer.hour === "00" if (timer.hour === "00"
&& timer.min === "00" && timer.min === "00"
&& timer.sec === "00") { && timer.sec === "00") {
this.timer.stop(); this.timer.stop();
...@@ -174,7 +193,7 @@ class InviteItem extends eui.ItemRenderer { ...@@ -174,7 +193,7 @@ class InviteItem extends eui.ItemRenderer {
console.log(this.data); console.log(this.data);
this.img.source = this.data.avatar || "http://yun.duiba.com.cn/db_games/default_avatar.png"; this.img.source = this.data.avatar || "http://yun.duiba.com.cn/db_games/default_avatar.png";
this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this.img.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if(this.data.callFun) { if (this.data.callFun) {
this.data.callFun(); this.data.callFun();
} }
}, this); }, this);
......
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