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
dc161287
Commit
dc161287
authored
Oct 12, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
849ad0dd
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
122 additions
and
24 deletions
+122
-24
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+1
-1
StartPanelSkin.exml
egret/resource/skins/StartPanelSkin.exml
+2
-1
AvatarComp.ts
egret/src/mapScene/AvatarComp.ts
+1
-0
MapScene.ts
egret/src/mapScene/MapScene.ts
+14
-10
FriendItem2Renderer.ts
egret/src/panels/FriendItem2Renderer.ts
+1
-1
StartPanel.ts
egret/src/panels/StartPanel.ts
+12
-5
config.js
mock/config.js
+3
-0
levelNumRank.json
mock/happyclear/levelNumRank.json
+4
-4
mapRank.json
mock/happyclear/mapRank.json
+26
-2
totalNumRank.json
mock/happyclear/totalNumRank.json
+58
-0
No files found.
egret/libs/tw/manager/NetManager.ts
View file @
dc161287
...
...
@@ -1271,7 +1271,7 @@ export class NetManager extends ABNetManager {
public
hc_mapRank
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
name
:
'mapRank'
,
name
:
'
hc_
mapRank'
,
uri
:
window
[
'duiba'
]
+
'/customActivity/happyclear/mapRank'
,
type
:
'post'
,
dataType
:
'json'
,
...
...
egret/resource/skins/StartPanelSkin.exml
View file @
dc161287
...
...
@@ -61,7 +61,7 @@
</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"
>
<e:List
id=
"friendlist"
itemRendererSkinName=
"FriendItem2Skin"
horizontalCenter=
"0"
y=
"973"
visible=
"false"
>
<e:ArrayCollection>
<e:Array>
<e:Object
a=
"null"
/>
...
...
@@ -75,4 +75,5 @@
<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
egret/src/mapScene/AvatarComp.ts
View file @
dc161287
...
...
@@ -6,6 +6,7 @@ export default class AvatarComp extends ComponentBase {
this
.
touchEnabled
=
this
.
touchChildren
=
false
;
super
.
start
(
data
);
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
this
[
'avatar'
].
source
=
data
.
avatar
;
}
get
skinKey
():
string
{
return
'Avatar'
}
...
...
egret/src/mapScene/MapScene.ts
View file @
dc161287
...
...
@@ -148,7 +148,7 @@ export default class MapScene extends Scene {
this
.
updateHomeData
();
this
.
update
Avatar
s
();
this
.
update
Friend
s
();
this
.
showLog
();
this
.
updateBox
();
...
...
@@ -286,21 +286,25 @@ export default class MapScene extends Scene {
updateScene
()
{
this
.
updateHomeData
();
}
addAvatar
(
level
,
data
?)
{
addAvatar
(
level
,
ele
)
{
const
item
=
MapScene
.
starHash
[
level
];
const
parent
=
item
.
parent
;
const
avatar
=
new
AvatarComp
();
avatar
.
loadSkin
();
avatar
.
start
(
data
);
avatar
.
start
(
ele
);
parent
.
addChild
(
avatar
);
avatar
.
x
=
item
.
x
;
avatar
.
y
=
item
.
y
-
avatar
.
height
;
}
updateAvatars
()
{
// 4 70
this
.
addAvatar
(
4
);
this
.
addAvatar
(
70
);
this
.
addAvatar
(
71
);
updateFriends
()
{
NetManager
.
ins
.
hc_mapRank
(()
=>
{
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_mapRank'
);
data
.
forEach
((
ele
)
=>
{
this
.
addAvatar
(
ele
.
levelNum
,
ele
.
rank
[
0
]);
});
});
}
updateHomeData
()
{
...
...
@@ -360,7 +364,7 @@ export default class MapScene extends Scene {
}
onTap_inviteBtn
()
{
NetManager
.
ins
.
getInvateInfo
((
success
,
res
)
=>
{
if
(
!
success
||
!
res
.
data
)
{
if
(
!
success
||
!
res
.
data
)
{
return
;
}
PanelCtrl
.
instance
.
show
(
'invite'
,
res
.
data
);
...
...
@@ -559,7 +563,7 @@ export default class MapScene extends Scene {
get
skinKey
()
{
return
'Map'
}
}
export
const
getNick
=
(
nickname
)
=>
{
if
(
!
nickname
)
return
nickname
;
if
(
!
nickname
)
return
nickname
;
const
max
=
4
;
if
(
nickname
.
length
>
max
)
return
nickname
.
slice
(
0
,
max
)
+
'...'
;
...
...
egret/src/panels/FriendItem2Renderer.ts
View file @
dc161287
...
...
@@ -31,6 +31,6 @@ export default class FriendItem2Renderer extends eui.ItemRenderer {
this
[
'nameTxt'
].
text
=
getNick
(
nickName
);
this
.
score
.
textFlow
=
(
new
egret
.
HtmlTextParser
).
parser
(
`
分数:
<font color=0xff4501><b>
${
maxScore
}
</b></font>分`
);
`<font color=0xff4501><b>
${
maxScore
}
</b></font>分`
);
}
}
\ No newline at end of file
egret/src/panels/StartPanel.ts
View file @
dc161287
...
...
@@ -29,14 +29,21 @@ export default class StartPanel extends Panel {
this
.
friendlist
.
useVirtualLayout
=
false
;
this
.
friendlist
.
itemRenderer
=
FriendItem2Renderer
;
this
.
friendlist
.
visible
=
false
;
this
[
'empty'
].
visible
=
false
;
NetManager
.
ins
.
hc_levelNumRank
(()
=>
{
this
.
friendlist
.
visible
=
true
;
const
{
data
:
friends
}
=
DataManager
.
ins
.
getData
(
'hc_levelNumRank'
);
if
(
friends
&&
friends
.
length
>
0
)
{
this
.
friendlist
.
visible
=
true
;
if
(
friends
.
length
>
5
)
friends
.
length
=
5
;
const
ac
=
new
eui
.
ArrayCollection
(
friends
);
this
.
friendlist
.
dataProvider
=
ac
;
}
else
{
this
[
'empty'
].
visible
=
true
;
}
},
data
)
setGlow
(
this
[
'levelTxt'
],
0xfa4b09
,
1
);
...
...
mock/config.js
View file @
dc161287
const
path
=
require
(
'path'
);
const
config
=
{
'/customActivity/happyclear/totalNumRank'
:
{
data
:
'./happyclear/totalNumRank.json'
},
'/customActivity/happyclear/userInfo'
:
{
data
:
'./happyclear/userInfo.json'
},
...
...
mock/happyclear/levelNumRank.json
View file @
dc161287
...
...
@@ -8,28 +8,28 @@
"nickName"
:
"奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
1
1
,
"maxScore"
:
1
234567
,
"rank"
:
"1"
},
{
"nickName"
:
"2奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
22
,
"maxScore"
:
1234567
,
"rank"
:
"2"
},
{
"nickName"
:
"3奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
333
,
"maxScore"
:
1234567
,
"rank"
:
"3"
},
{
"nickName"
:
"4奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
44444
,
"maxScore"
:
1234567
,
"rank"
:
"4"
},
{
...
...
mock/happyclear/mapRank.json
View file @
dc161287
...
...
@@ -5,11 +5,35 @@
"timestamp"
:
1566199822308
,
"data"
:[
{
"levelNum"
:
1
,
"levelNum"
:
4
,
"rank"
:[
{
"nickName"
:
"昵称"
,
"avatar"
:
"头像"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
123
,
"rank"
:
"排名"
}
]
},
{
"levelNum"
:
70
,
"rank"
:[
{
"nickName"
:
"昵称"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
123
,
"rank"
:
"排名"
}
]
},
{
"levelNum"
:
71
,
"rank"
:[
{
"nickName"
:
"昵称"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
123
,
"rank"
:
"排名"
...
...
mock/happyclear/totalNumRank.json
0 → 100644
View file @
dc161287
{
"success"
:
true
,
"code"
:
null
,
"desc"
:
null
,
"timestamp"
:
1566199822308
,
"data"
:
{
"user"
:
{
"levelNum"
:
1
,
"nickName"
:
"3奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
1234567
,
"rank"
:
1
},
"list"
:[
{
"levelNum"
:
1
,
"nickName"
:
"3奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
1234567
,
"rank"
:
1
},
{
"levelNum"
:
1
,
"nickName"
:
"3奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
1234567
,
"rank"
:
1
},
{
"levelNum"
:
1
,
"nickName"
:
"3奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
1234567
,
"rank"
:
1
},
{
"levelNum"
:
1
,
"nickName"
:
"3奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
1234567
,
"rank"
:
1
},
{
"levelNum"
:
1
,
"nickName"
:
"3奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
1234567
,
"rank"
:
1
}
]
}
}
\ No newline at end of file
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