Commit 1b9d4977 authored by wildfirecode's avatar wildfirecode

1

parent dc161287
......@@ -1269,11 +1269,25 @@ export class NetManager extends ABNetManager {
this.send(net);
}
public hc_totalNumRank(callback: Function): void {
const net: INetData = {
name:'hc_totalNumRank',
uri: window['duiba']+'/customActivity/happyclear/totalNumRank',
type: 'get',
dataType: 'json',
param: {
activityId: DataManager.ins.customCfgData.actId
},
hideMsg:true,
callback: callback
};
this.send(net);
}
public hc_mapRank(callback: Function): void {
const net: INetData = {
name:'hc_mapRank',
uri: window['duiba']+'/customActivity/happyclear/mapRank',
type: 'post',
type: 'get',
dataType: 'json',
param: {
activityId: DataManager.ins.customCfgData.actId
......@@ -1303,7 +1317,7 @@ export class NetManager extends ABNetManager {
const net: INetData = {
name:'hc_userInfo',
uri: window['duiba']+'/customActivity/happyclear/userInfo',
type: 'post',
type: 'get',
dataType: 'json',
param: {
activityId: DataManager.ins.customCfgData.actId
......
......@@ -4,7 +4,7 @@
<e:Label id="nameTxt" text="Label" y="89.5" size="16" textColor="0x784325" horizontalCenter="0.5"/>
<e:Label text="分数:12345分" y="115.29" id="score" size="16" anchorOffsetX="0" anchorOffsetY="0" textColor="0x784325" horizontalCenter="0.5"/>
<e:Group x="22" y="14">
<e:Image id="avatar" y="0" source="testavatar_png" width="64" height="64" x="0"/>
<e:Image id="avatar" y="0" width="64" height="64" x="0" source=""/>
<e:Rect id="avatarMask" width="64" height="64" y="0" ellipseWidth="64" ellipseHeight="64"/>
</e:Group>
<e:Group x="8">
......
......@@ -7,7 +7,7 @@
<e:Label text="第15关" x="189" y="54.29" id="progress" size="24" textColor="0x784325"/>
<e:Label text="分数:123分" x="297" y="54.29" id="score" size="24" anchorOffsetX="0" anchorOffsetY="0" textColor="0x784325"/>
<e:Group x="108.87" y="23.79">
<e:Image id="avatar" y="0" source="testavatar_png" width="60" height="60" x="0"/>
<e:Image id="avatar" y="0" width="60" height="60" x="0" source=""/>
<e:Rect id="avatarMask" width="60" height="60" y="0" ellipseWidth="60" ellipseHeight="60"/>
</e:Group>
<e:Group x="10" y="16">
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="FriendSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="friendbg_png" y="31" horizontalCenter="1"/>
<e:Label id="star" text="X55" x="597.94" y="329.79" size="24"/>
<e:Label id="star" text="X0" x="597.94" y="329.79" size="24"/>
<e:Button id="closeBtn" label="" x="632.94" y="164.98">
<e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
......@@ -12,7 +12,7 @@
</e:Button>
<e:Scroller id="scroll" width="546" height="555" y="412.35" scrollPolicyV="on" scrollPolicyH="off" x="122">
<e:Group>
<e:List id="list" width="100%" itemRendererSkinName="FriendItemSkin">
<e:List id="list" width="100%" itemRendererSkinName="FriendItemSkin" visible="false">
<e:ArrayCollection>
<e:Array>
<e:Object a="taskname1"/>
......@@ -42,16 +42,17 @@
</e:skinName>
</e:Button>
<e:Group x="323.87" y="104.79">
<e:Image id="avatar" y="0" source="testavatar_png" width="120" height="120" x="0"/>
<e:Image id="avatar" y="0" width="120" height="120" x="0" source=""/>
<e:Rect id="avatarMask" width="120" height="120" y="0" ellipseWidth="120" ellipseHeight="120"/>
</e:Group>
<e:Group x="226.87" y="308.79">
<e:Image id="avatar0" y="0" source="testavatar_png" width="60" height="60" x="0"/>
<e:Image id="avatar0" y="0" width="60" height="60" x="0" source=""/>
<e:Rect id="avatarMask0" width="60" height="60" y="0" ellipseWidth="60" ellipseHeight="60"/>
</e:Group>
<e:Label id="nameTxt0" text="nickname" y="245" textColor="0x784325" horizontalCenter="6.5"/>
<e:Label id="rankTxt" text="73" x="112" y="311" width="86" textAlign="center" verticalAlign="middle" height="52" size="48"/>
<e:Label id="nameTxt" text="Label" x="306" y="307" size="24"/>
<e:Label id="progress" text="第15关" x="306" y="340.79" size="24"/>
<e:Label id="score" text="分数:123分" x="414" y="340.79" size="24" anchorOffsetX="0" anchorOffsetY="0"/>
<e:Label id="rankTxt" text="0" x="112" y="311" width="86" textAlign="center" verticalAlign="middle" height="52" size="48"/>
<e:Label id="nameTxt" text="-" x="306" y="307" size="24"/>
<e:Label id="progress" text="第0关" x="306" y="340.79" size="24"/>
<e:Label id="score" text="分数:0分" x="414" y="340.79" size="24" anchorOffsetX="0" anchorOffsetY="0"/>
<e:Label id="empty" text="您还没有好友" y="636" textColor="0x784325" horizontalCenter="6.5"/>
</e:Skin>
\ No newline at end of file
......@@ -5,41 +5,41 @@
<e:Group id="scrollGroup">
</e:Group>
</e:Scroller>
<e:Group id="treasureboxBtn" y="-3.06" x="467.84">
<e:Group id="treasureboxBtn" y="-3.06" x="516.26" scaleX="0.8" scaleY="0.8">
<e:Image source="宝箱bg_png" y="22"/>
<e:Group x="41.08" y="45.48">
<e:Rect id="rect" width="124" height="45" x="0" y="0" visible="false"/>
<e:Image id="progressbg" source="progress2_png" y="0" x="0" visible="false"/>
<e:Image id="progressfront" source="progress1_png" y="0" x="0" visible="false"/>
<e:Image source="星星_png" verticalCenter="-2.5" x="-17.31"/>
<e:Label id="totalStarTxt" text="0/0" x="24.04" verticalAlign="middle" textAlign="left" size="26" verticalCenter="1.5" bold="true"/>
<e:Rect id="rect" width="124" height="45" x="0" y="0" visible="false"/>
<e:Image id="progressbg" source="progress2_png" y="0" x="0" visible="false"/>
<e:Image id="progressfront" source="progress1_png" y="0" x="0" visible="false"/>
<e:Image source="星星_png" verticalCenter="-2.5" x="-17.31"/>
<e:Label id="totalStarTxt" text="0/0" x="24.04" verticalAlign="middle" textAlign="left" size="26" verticalCenter="1.5" bold="true"/>
</e:Group>
<e:Image id="box" source="宝箱_png" right="32" verticalCenter="13.5" anchorOffsetX="34" anchorOffsetY="34"/>
<e:Group id="boxiconWrapper" x="197.33" y="34.86" touchEnabled="false" touchChildren="false">
<e:Image x="8.32" y="0" source="iconbg_png"/>
<e:Label id="boxNumsTxt" text="0" x="0" verticalAlign="middle" textAlign="center" size="18" width="46" y="6.14"/>
<e:Image x="8.32" y="0" source="iconbg_png"/>
<e:Label id="boxNumsTxt" text="0" x="0" verticalAlign="middle" textAlign="center" size="18" width="46" y="6.14"/>
</e:Group>
</e:Group>
<e:Group id="top" x="36" y="24">
<e:Group id="top" x="167.04" y="18.05" scaleX="0.8" scaleY="0.8">
<e:Image source="元宝bg_png" x="0" y="0"/>
<e:Label id="bloodTxt" text="5" x="12.71" y="22.84" width="49" verticalAlign="middle" textAlign="center" size="36"/>
<e:Label id="fullTxt" text="已满" x="76.71" y="29.84" width="82" verticalAlign="middle" textAlign="center" size="24" visible="false"/>
<e:Label id="goldTxt" text="0" x="317.23" y="27.84" width="88" verticalAlign="middle" textAlign="center"/>
<e:Button id="bloodBtn" label="" x="168.38" y="16.6">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="关闭 拷贝_png" source.down="关闭 拷贝_png" source.disabled="关闭 拷贝_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="关闭 拷贝_png" source.down="关闭 拷贝_png" source.disabled="关闭 拷贝_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="goldBtn" label="" x="385.2" y="16.6" visible="false">
<e:skinName>
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="关闭 拷贝_png" source.down="关闭 拷贝_png" source.disabled="关闭 拷贝_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
<e:Image width="100%" height="100%" source="关闭 拷贝_png" source.down="关闭 拷贝_png" source.disabled="关闭 拷贝_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:skinName>
</e:Button>
<e:Label id="countdown" text="00:00:00" x="77.39" y="31.19" verticalAlign="middle" textAlign="center" size="22"/>
</e:Group>
......@@ -67,7 +67,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Group id="friendBtn" x="13.56" y="126.88" width="171" height="120">
<e:Group id="friendBtn" x="5.96" y="22.31" width="171" height="120">
<e:Image source="avatar_png" y="0" horizontalCenter="0"/>
<e:Group x="38.5" y="10">
<e:Image id="avatar" y="0" source="testavatar_png" width="96" height="96" x="0"/>
......@@ -85,7 +85,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Group id="inviteGroup" x="32" y="265.37">
<e:Group id="inviteGroup" x="24.4" y="163.76">
<e:Button id="inviteBtn" label="" x="0" y="1.54">
<e:skinName>
<e:Skin states="up,down,disabled">
......
import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import { getNick } from "../mapScene/MapScene";
export default class FriendItemRenderer extends eui.ItemRenderer {
constructor() {
......@@ -8,8 +9,7 @@ export default class FriendItemRenderer extends eui.ItemRenderer {
progress: eui.Label;
score: eui.Label;
dataChanged() {
const rank = this.data;
const rank = this.data.rank;
this['avatar'].mask = this['avatarMask'];
this['rank1'].visible = this['rank2'].visible = this['rank3'].visible = this['rankTxt'].visible = false;
......@@ -24,10 +24,12 @@ export default class FriendItemRenderer extends eui.ItemRenderer {
this['rankTxt'].visible = true;
}
this['nameTxt'].text = this.data + 'name';
this['nameTxt'].text = getNick(this.data.nickName) ;
this['avatar'].source = this.data.avatar;
this['star'].text = `X${this.data.stars}`;
this.progress.textFlow = (new egret.HtmlTextParser).parser(
`第<font color=0xff4501><b>${15}</b></font>关`);
`第<font color=0xff4501><b>${this.data.levelNum}</b></font>关`);
this.score.textFlow = (new egret.HtmlTextParser).parser(
`分数:<font color=0xff4501><b>${15}</b></font>分`);
`<font color=0xff4501><b>${this.data.maxScore}</b></font>分`);
}
}
\ No newline at end of file
......@@ -11,22 +11,38 @@ export default class FriendPanel extends Panel {
start(data) {
super.start();
this.showlog();
this.updateMyInfo();
this.progress.textFlow = (new egret.HtmlTextParser).parser(
`第<font color=0xfff000><b>${15}</b></font>关`);
this.score.textFlow = (new egret.HtmlTextParser).parser(
`分数:<font color=0xfff000><b>${15}</b></font>分`);
this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this);
this['avatar'].mask = this['avatarMask'];
this['avatar0'].mask = this['avatarMask0'];
this.list.useVirtualLayout = false;
this.list.itemRenderer = FriendItemRenderer;
const ac = new eui.ArrayCollection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
this.list.dataProvider = ac;
this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this);
this.updateMyInfo();
this.list.visible = false;
this['empty'].visible = false;
NetManager.ins.hc_totalNumRank(() => {
const { data: hc_totalNumRank } = DataManager.ins.getData('hc_totalNumRank');
const { list, user } = hc_totalNumRank;
if (user) {
this.progress.textFlow = (new egret.HtmlTextParser).parser(
`第<font color=0xfff000><b>${user.levelNum}</b></font>关`);
this.score.textFlow = (new egret.HtmlTextParser).parser(
`<font color=0xfff000><b>${user.maxScore}</b></font>分`);
this['rankTxt'].text = user.rank
this['star'].text = `X${user.stars}`
}
if (list && list.length > 0) {
this.list.visible = true;
this['empty'].visible = false;
const ac = new eui.ArrayCollection(list);
this.list.dataProvider = ac;
} else {
this.list.visible = false;
this['empty'].visible = true;
}
})
}
private updateMyInfo() {
......@@ -34,13 +50,13 @@ export default class FriendPanel extends Panel {
this['avatar0'].visible = false;
this['nameTxt'].text = '';
this['nameTxt0'].text = '';
NetManager.ins.hc_userInfo(() => {
this['avatar'].visible = true;
this['avatar0'].visible = true;
const { data } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = this['avatar0'].source = data.avatar;
this['nameTxt'].text = getNick(data.nickname);
this['nameTxt0'].text = getNick(data.nickname);
});
......
......@@ -5,53 +5,69 @@
"timestamp": 1566199822308,
"data": {
"user": {
"levelNum": 1,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"levelNum": 555,
"nickName": "奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"stars": 666,
"maxScore": 1234567,
"rank": 1
"rank": 123
},
"list":[
{
"levelNum": 1,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"levelNum": 11,
"nickName": "1奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 1234567,
"stars": 11,
"maxScore": 111111,
"rank": 1
},
{
"levelNum": 1,
"levelNum": 22,
"nickName": "2奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 22,
"maxScore": 222222,
"rank": 2
},
{
"levelNum": 33,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 1234567,
"rank": 1
"stars": 33,
"maxScore": 33333,
"rank": 3
},
{
"levelNum": 1,
"levelNum": 44,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 1234567,
"rank": 1
"stars": 44,
"maxScore": 4444444,
"rank": 4
},
{
"levelNum": 1,
"levelNum": 55,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"stars": 55,
"maxScore": 1234567,
"rank": 1
"rank": 5
},
{
"levelNum": 1,
"levelNum": 55,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"stars": 55,
"maxScore": 1234567,
"rank": 1
"rank": 5
},
{
"levelNum": 9999,
"nickName": "99奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 55,
"maxScore": 1234567,
"rank": 999
}
]
}
......
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