Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
1b9d4977
Commit
1b9d4977
authored
Oct 12, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
dc161287
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
122 additions
and
73 deletions
+122
-73
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+16
-2
FriendItem2Skin.exml
egret/resource/skins/FriendItem2Skin.exml
+1
-1
FriendItemSkin.exml
egret/resource/skins/FriendItemSkin.exml
+1
-1
FriendSkin.exml
egret/resource/skins/FriendSkin.exml
+9
-8
MapSkin.exml
egret/resource/skins/MapSkin.exml
+21
-21
FriendItemRenderer.ts
egret/src/panels/FriendItemRenderer.ts
+7
-5
FriendPanel.ts
egret/src/panels/FriendPanel.ts
+29
-13
totalNumRank.json
mock/happyclear/totalNumRank.json
+38
-22
No files found.
egret/libs/tw/manager/NetManager.ts
View file @
1b9d4977
...
...
@@ -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
:
'
pos
t'
,
type
:
'
ge
t'
,
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
:
'
pos
t'
,
type
:
'
ge
t'
,
dataType
:
'json'
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
...
...
egret/resource/skins/FriendItem2Skin.exml
View file @
1b9d4977
...
...
@@ -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"
>
...
...
egret/resource/skins/FriendItemSkin.exml
View file @
1b9d4977
...
...
@@ -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"
>
...
...
egret/resource/skins/FriendSkin.exml
View file @
1b9d4977
<?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=
"X
55
"
x=
"597.94"
y=
"329.79"
size=
"24"
/>
<e:Label
id=
"star"
text=
"X
0
"
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
egret/resource/skins/MapSkin.exml
View file @
1b9d4977
...
...
@@ -5,7 +5,7 @@
<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"
/>
...
...
@@ -20,7 +20,7 @@
<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"
/>
...
...
@@ -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"
>
...
...
egret/src/panels/FriendItemRenderer.ts
View file @
1b9d4977
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
egret/src/panels/FriendPanel.ts
View file @
1b9d4977
...
...
@@ -11,22 +11,38 @@ export default class FriendPanel extends Panel {
start
(
data
)
{
super
.
start
();
this
.
showlog
();
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
;
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>
${
15
}
</b></font>关`
);
`第<font color=0xfff000><b>
${
user
.
levelNum
}
</b></font>关`
);
this
.
score
.
textFlow
=
(
new
egret
.
HtmlTextParser
).
parser
(
`分数:<font color=0xfff000><b>
${
15
}
</b></font>分`
);
`<font color=0xfff000><b>
${
user
.
maxScore
}
</b></font>分`
);
this
[
'rankTxt'
].
text
=
user
.
rank
this
[
'star'
].
text
=
`X
${
user
.
stars
}
`
}
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
]);
if
(
list
&&
list
.
length
>
0
)
{
this
.
list
.
visible
=
true
;
this
[
'empty'
].
visible
=
false
;
const
ac
=
new
eui
.
ArrayCollection
(
list
);
this
.
list
.
dataProvider
=
ac
;
this
[
'btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapInvite
,
this
);
}
else
{
this
.
list
.
visible
=
false
;
this
[
'empty'
].
visible
=
true
;
}
})
}
private
updateMyInfo
()
{
...
...
mock/happyclear/totalNumRank.json
View file @
1b9d4977
...
...
@@ -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"
:
1
23
},
"list"
:[
{
"levelNum"
:
1
,
"nickName"
:
"
3
奈何本人没文化,一句卧槽行天下"
,
"levelNum"
:
1
1
,
"nickName"
:
"
1
奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
1
234567
,
"stars"
:
1
1
,
"maxScore"
:
1
11111
,
"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
}
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment