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
0a4b334d
Commit
0a4b334d
authored
Oct 11, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f466d79e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
18 deletions
+83
-18
MapScene.ts
egret/src/mapScene/MapScene.ts
+9
-4
FriendItem2Renderer.ts
egret/src/panels/FriendItem2Renderer.ts
+6
-3
FriendPanel.ts
egret/src/panels/FriendPanel.ts
+4
-5
StartPanel.ts
egret/src/panels/StartPanel.ts
+11
-6
config.js
mock/config.js
+3
-0
levelNumRank.json
mock/happyclear/levelNumRank.json
+50
-0
No files found.
egret/src/mapScene/MapScene.ts
View file @
0a4b334d
...
@@ -192,10 +192,8 @@ export default class MapScene extends Scene {
...
@@ -192,10 +192,8 @@ export default class MapScene extends Scene {
this
[
'avatar'
].
visible
=
true
;
this
[
'avatar'
].
visible
=
true
;
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_userInfo'
);
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_userInfo'
);
this
[
'avatar'
].
source
=
data
.
avatar
;
this
[
'avatar'
].
source
=
data
.
avatar
;
const
max
=
4
;
if
(
data
.
nickname
.
length
>
max
)
this
[
'nameTxt'
].
text
=
getNick
(
data
.
nickname
);
data
.
nickname
=
data
.
nickname
.
slice
(
0
,
max
)
+
'...'
;
this
[
'nameTxt'
].
text
=
data
.
nickname
;
});
});
}
}
...
@@ -555,3 +553,10 @@ export default class MapScene extends Scene {
...
@@ -555,3 +553,10 @@ export default class MapScene extends Scene {
get
skinKey
()
{
return
'Map'
}
get
skinKey
()
{
return
'Map'
}
}
}
export
const
getNick
=
(
nickname
)
=>
{
if
(
!
nickname
)
return
nickname
;
const
max
=
4
;
if
(
nickname
.
length
>
max
)
return
nickname
.
slice
(
0
,
max
)
+
'...'
;
return
nickname
;
}
\ No newline at end of file
egret/src/panels/FriendItem2Renderer.ts
View file @
0a4b334d
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
{
getNick
}
from
"../mapScene/MapScene"
;
export
default
class
FriendItem2Renderer
extends
eui
.
ItemRenderer
{
export
default
class
FriendItem2Renderer
extends
eui
.
ItemRenderer
{
constructor
()
{
constructor
()
{
...
@@ -8,7 +9,7 @@ export default class FriendItem2Renderer extends eui.ItemRenderer {
...
@@ -8,7 +9,7 @@ export default class FriendItem2Renderer extends eui.ItemRenderer {
score
:
eui
.
Label
;
score
:
eui
.
Label
;
dataChanged
()
{
dataChanged
()
{
const
rank
=
this
.
data
;
const
{
rank
,
nickName
,
avatar
,
maxScore
}
=
this
.
data
;
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
...
@@ -25,9 +26,11 @@ export default class FriendItem2Renderer extends eui.ItemRenderer {
...
@@ -25,9 +26,11 @@ export default class FriendItem2Renderer extends eui.ItemRenderer {
this
[
'rankbg'
].
visible
=
true
;
this
[
'rankbg'
].
visible
=
true
;
}
}
this
[
'nameTxt'
].
text
=
this
.
data
+
'name'
;
this
[
'avatar'
].
source
=
avatar
this
[
'nameTxt'
].
text
=
getNick
(
nickName
);
this
.
score
.
textFlow
=
(
new
egret
.
HtmlTextParser
).
parser
(
this
.
score
.
textFlow
=
(
new
egret
.
HtmlTextParser
).
parser
(
`分数:<font color=0xff4501><b>
${
15
}
</b></font>分`
);
`分数:<font color=0xff4501><b>
${
maxScore
}
</b></font>分`
);
}
}
}
}
\ No newline at end of file
egret/src/panels/FriendPanel.ts
View file @
0a4b334d
...
@@ -2,6 +2,7 @@ import Panel from "../../libs/new_wx/components/Panel";
...
@@ -2,6 +2,7 @@ import Panel from "../../libs/new_wx/components/Panel";
import
FriendItemRenderer
from
"./FriendItemRenderer"
;
import
FriendItemRenderer
from
"./FriendItemRenderer"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
getNick
}
from
"../mapScene/MapScene"
;
export
default
class
FriendPanel
extends
Panel
{
export
default
class
FriendPanel
extends
Panel
{
public
list
:
eui
.
List
;
public
list
:
eui
.
List
;
...
@@ -39,11 +40,9 @@ export default class FriendPanel extends Panel {
...
@@ -39,11 +40,9 @@ export default class FriendPanel extends Panel {
this
[
'avatar0'
].
visible
=
true
;
this
[
'avatar0'
].
visible
=
true
;
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_userInfo'
);
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_userInfo'
);
this
[
'avatar'
].
source
=
this
[
'avatar0'
].
source
=
data
.
avatar
;
this
[
'avatar'
].
source
=
this
[
'avatar0'
].
source
=
data
.
avatar
;
const
max
=
4
;
if
(
data
.
nickname
.
length
>
max
)
this
[
'nameTxt'
].
text
=
getNick
(
data
.
nickname
);
data
.
nickname
=
data
.
nickname
.
slice
(
0
,
max
)
+
'...'
;
this
[
'nameTxt0'
].
text
=
getNick
(
data
.
nickname
);
this
[
'nameTxt'
].
text
=
data
.
nickname
;
this
[
'nameTxt0'
].
text
=
data
.
nickname
;
});
});
}
}
...
...
egret/src/panels/StartPanel.ts
View file @
0a4b334d
...
@@ -18,6 +18,7 @@ import { ElementType } from "../something/enum/ElementType";
...
@@ -18,6 +18,7 @@ import { ElementType } from "../something/enum/ElementType";
import
{
PassType
}
from
"../something/enum/PassType"
;
import
{
PassType
}
from
"../something/enum/PassType"
;
import
FriendItem2Renderer
from
"./FriendItem2Renderer"
;
import
FriendItem2Renderer
from
"./FriendItem2Renderer"
;
import
TargetItemRenderer
from
"./TargetItemRenderer"
;
import
TargetItemRenderer
from
"./TargetItemRenderer"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
StartPanel
extends
Panel
{
export
default
class
StartPanel
extends
Panel
{
private
_level
;
private
_level
;
...
@@ -25,14 +26,18 @@ export default class StartPanel extends Panel {
...
@@ -25,14 +26,18 @@ export default class StartPanel extends Panel {
public
friendlist
:
eui
.
List
;
public
friendlist
:
eui
.
List
;
start
(
data
)
{
start
(
data
)
{
super
.
start
();
super
.
start
();
this
.
friendlist
.
useVirtualLayout
=
false
;
this
.
friendlist
.
useVirtualLayout
=
false
;
this
.
friendlist
.
itemRenderer
=
FriendItem2Renderer
;
this
.
friendlist
.
itemRenderer
=
FriendItem2Renderer
;
const
friends
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
];
this
.
friendlist
.
visible
=
false
;
if
(
friends
.
length
>
5
)
friends
.
length
=
5
;
NetManager
.
ins
.
hc_levelNumRank
(()
=>
{
const
ac
=
new
eui
.
ArrayCollection
(
friends
);
this
.
friendlist
.
visible
=
true
;
this
.
friendlist
.
dataProvider
=
ac
;
const
{
data
:
friends
}
=
DataManager
.
ins
.
getData
(
'hc_levelNumRank'
);
if
(
friends
.
length
>
5
)
friends
.
length
=
5
;
const
ac
=
new
eui
.
ArrayCollection
(
friends
);
this
.
friendlist
.
dataProvider
=
ac
;
},
data
)
setGlow
(
this
[
'levelTxt'
],
0xfa4b09
,
1
);
setGlow
(
this
[
'levelTxt'
],
0xfa4b09
,
1
);
this
[
'levelTxt'
].
text
=
`第
${
data
}
关`
;
this
[
'levelTxt'
].
text
=
`第
${
data
}
关`
;
...
...
mock/config.js
View file @
0a4b334d
...
@@ -3,6 +3,9 @@ const config = {
...
@@ -3,6 +3,9 @@ const config = {
'/customActivity/happyclear/userInfo'
:
{
'/customActivity/happyclear/userInfo'
:
{
data
:
'./happyclear/userInfo.json'
data
:
'./happyclear/userInfo.json'
},
},
'/customActivity/happyclear/levelNumRank'
:
{
data
:
'./happyclear/levelNumRank.json'
},
'/customActivity/happyclear/mapRank'
:
{
'/customActivity/happyclear/mapRank'
:
{
data
:
'./happyclear/mapRank.json'
data
:
'./happyclear/mapRank.json'
},
},
...
...
mock/happyclear/levelNumRank.json
0 → 100644
View file @
0a4b334d
{
"success"
:
true
,
"code"
:
null
,
"desc"
:
null
,
"timestamp"
:
1566199822308
,
"data"
:
[
{
"nickName"
:
"奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
11
,
"rank"
:
"1"
},
{
"nickName"
:
"2奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
22
,
"rank"
:
"2"
},
{
"nickName"
:
"3奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
333
,
"rank"
:
"3"
},
{
"nickName"
:
"4奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
44444
,
"rank"
:
"4"
},
{
"nickName"
:
"5奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
123
,
"rank"
:
"5"
},
{
"nickName"
:
"6奈何本人没文化,一句卧槽行天下"
,
"avatar"
:
"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg"
,
"stars"
:
1
,
"maxScore"
:
555555
,
"rank"
:
"6"
}
]
}
\ 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