Commit 70978553 authored by wildfirecode's avatar wildfirecode

1

parent 21e79a8e
......@@ -8,7 +8,7 @@
"globalBackgroundHeight": -1,
"globalBackgroundColor": "#c1c1c1",
"globalBackgroundImage": "",
"globalAutoLayerMarkEnable": false
"globalAutoLayerMarkEnable": true
},
"1667fb18fa6": {
"bindingDataTestObj": [
......
......@@ -2,6 +2,7 @@
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/RankFriendListSkin.exml",
"resource/skins/ADSkin.exml",
"resource/skins/ADSmallSkin.exml",
"resource/skins/AlertSkin.exml",
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="RankFriendListSkin" width="582" height="203" xmlns:e="http://ns.egret.com/eui">
<e:Image source="startpanel_bg2_png" y="0" x="0"/>
<e:List id="friendlist" itemRendererSkinName="FriendItem2Skin" y="48" x="9">
<e:ArrayCollection>
<e:Array>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
</e:Array>
</e:ArrayCollection>
<e:layout>
<e:HorizontalLayout/>
</e:layout>
</e:List>
<e:Label id="empty" text="该关卡没有好友通关" y="97" textColor="0xC33700" size="26" x="174"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="StartPanelSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16cd285c715"/>
<e:Image source="startpanel_bg2_png" y="925" horizontalCenter="0"/>
<e:Group x="84" y="925" visible="false">
<e:Image source="startpanel_bg2_png" y="0" x="0"/>
<e:List id="friendlist" itemRendererSkinName="FriendItem2Skin" y="48" x="9">
<e:ArrayCollection>
<e:Array>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
</e:Array>
</e:ArrayCollection>
<e:layout>
<e:HorizontalLayout/>
</e:layout>
</e:List>
<e:Label id="empty" text="该关卡没有好友通关" y="97" textColor="0xc33700" size="26" x="174"/>
</e:Group>
<e:Image y="52" horizontalCenter="0" source="startpanel通关条件_png"/>
<e:Label id="levelTxt" text="第一关" y="204" horizontalCenter="0" size="42"/>
<e:Label id="targetTxt" text="在规定的步数内\n消除足够数量目标" y="332" width="444" x="157" textAlign="center" lineSpacing="15" verticalAlign="middle" height="156" anchorOffsetX="0" textColor="0xa32020" visible="false"/>
......@@ -61,19 +78,4 @@
</e:List>
<e:Label id="tips" text="在指定步数内消灭目标元素" y="7" size="23" textColor="0x885037" bold="true" horizontalCenter="0"/>
</e:Group>
<e:List id="friendlist" itemRendererSkinName="FriendItem2Skin" horizontalCenter="0" y="973" visible="false">
<e:ArrayCollection>
<e:Array>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
</e:Array>
</e:ArrayCollection>
<e:layout>
<e:HorizontalLayout/>
</e:layout>
</e:List>
<e:Label id="empty" text="该关卡没有好友通关" y="1022" horizontalCenter="0" textColor="0xc33700" size="26"/>
</e:Skin>
\ No newline at end of file
import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { NetManager } from "../../libs/tw/manager/NetManager";
import FriendItem2Renderer from "../panels/FriendItem2Renderer";
export default class RankFriendList extends ComponentBase {
public friendlist: eui.List;
start(data?) {
this.friendlist.useVirtualLayout = false;
this.friendlist.itemRenderer = FriendItem2Renderer;
this.friendlist.visible = false;
this['empty'].visible = false;
NetManager.ins.hc_levelNumRank(() => {
let friends = DataManager.ins.getData('hc_levelNumRank').data;
if (friends == null)
friends = { rank: [] };
friends = friends.rank;
if (friends && friends.length > 0) {
this.friendlist.visible = true;
if (friends.length > 5)
friends.length = 5;
friends.forEach((ele, index) => {
ele.rank = index + 1;
});
const ac = new eui.ArrayCollection(friends);
this.friendlist.dataProvider = ac;
}
else {
this['empty'].visible = true;
}
}, data)
}
get skinKey(): string { return 'RankFriendList' }
}
export const addRankFriendList = (x, y, parent: egret.DisplayObjectContainer) => {
const comp = new RankFriendList();
comp.loadSkin();
comp.start();
parent.addChildAt(comp, 0);
comp.x = x;
comp.y = y;
}
......@@ -24,7 +24,7 @@ export default class FriendItemRenderer extends eui.ItemRenderer {
this['rankTxt'].visible = true;
}
this['nameTxt'].text = getNick(this.data.nickName) ;
this['nameTxt'].text = getNick(this.data.nickName,10) ;
this['avatar'].source = this.data.avatar;
this['star'].text = `X${this.data.stars}`;
this.progress.textFlow = (new egret.HtmlTextParser).parser(
......
......@@ -63,7 +63,7 @@ export default class FriendPanel extends Panel {
const { data } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = this['avatar0'].source = data.avatar;
this['nameTxt'].text = getNick(data.nickname);
this['nameTxt'].text = getNick(data.nickname,10);
this['nameTxt0'].text = getNick(data.nickname, 10);
});
}
......
......@@ -16,41 +16,17 @@ import { showShare } from "../shareCtrl";
import { Chapters } from "../something/Chapters";
import { ElementType } from "../something/enum/ElementType";
import { PassType } from "../something/enum/PassType";
import FriendItem2Renderer from "./FriendItem2Renderer";
import TargetItemRenderer from "./TargetItemRenderer";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { addRankFriendList } from "../mapScene/RankFriendList";
export default class StartPanel extends Panel {
private _level;
private list: eui.List;
public friendlist: eui.List;
start(data) {
super.start();
this.friendlist.useVirtualLayout = false;
this.friendlist.itemRenderer = FriendItem2Renderer;
this.friendlist.visible = false;
this['empty'].visible = false;
NetManager.ins.hc_levelNumRank(() => {
let friends = DataManager.ins.getData('hc_levelNumRank').data;
if (friends == null)
friends = { rank: [] };
friends = friends.rank;
if (friends && friends.length > 0) {
this.friendlist.visible = true;
if (friends.length > 5)
friends.length = 5;
friends.forEach((ele, index) => {
ele.rank = index + 1;
});
const ac = new eui.ArrayCollection(friends);
this.friendlist.dataProvider = ac;
}
else {
this['empty'].visible = true;
}
}, data)
addRankFriendList(84,925,this);
setGlow(this['levelTxt'], 0xfa4b09, 1);
this['levelTxt'].text = `第${data}关`;
......
{"success":true,"code":"0000000000","desc":"OK","timestamp":1571055816178,"data":null}
\ No newline at end of file
{
"success": true,
"code": null,
"desc": null,
"timestamp": 1566199822308,
"data": {
"userRank": {
"levelNum": 555,
"nickName": "奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 666,
"maxScore": 1234567,
"rank": 123
},
"rank":[
{
"levelNum": 11,
"nickName": "1奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 11,
"maxScore": 111111,
"rank": 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": 33,
"maxScore": 33333,
"rank": 3
},
{
"levelNum": 44,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 44,
"maxScore": 4444444,
"rank": 4
},
{
"levelNum": 55,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 55,
"maxScore": 1234567,
"rank": 5
},
{
"levelNum": 55,
"nickName": "3奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 55,
"maxScore": 1234567,
"rank": 5
},
{
"levelNum": 9999,
"nickName": "99奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 55,
"maxScore": 1234567,
"rank": 999
}
]
}
}
\ 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