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
15aadf7b
Commit
15aadf7b
authored
Aug 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
aac4d300
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
16 deletions
+29
-16
getHomeData.ts
egret/src/getHomeData.ts
+2
-1
MapBottomPart.ts
egret/src/mapScene/MapBottomPart.ts
+4
-2
MapScene.ts
egret/src/mapScene/MapScene.ts
+14
-10
BloodPanel.ts
egret/src/panels/BloodPanel.ts
+2
-2
home.json
mock/happyclear/home.json
+7
-1
No files found.
egret/src/getHomeData.ts
View file @
15aadf7b
...
...
@@ -2,9 +2,10 @@ import { DataManager } from "../libs/tw/manager/DataManager";
interface
IHomeData
{
levels
:{
levelNum
,
maxScore
,
stars
}[];
totalRemainStarts
;
canReceiveTreasureBoxNum
;
wealth
;
heartNums
;
shared
;
askForEnergy
:
boolean
;
props
:{
propType
,
nums
}[]
}
export
default
():
IHomeData
=>
{
...
...
egret/src/mapScene/MapBottomPart.ts
View file @
15aadf7b
...
...
@@ -2,6 +2,7 @@ import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import
MapScene
from
"./MapScene"
;
import
MapStarComp
from
"./MapStarComp"
;
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
import
setGray
from
"../setGray"
;
export
default
class
MapBottomPart
extends
ComponentBase
{
static
LEVEL_NUMS
=
12
;
...
...
@@ -9,13 +10,14 @@ export default class MapBottomPart extends ComponentBase {
super
.
start
();
for
(
let
i
=
0
;
i
<
MapBottomPart
.
LEVEL_NUMS
;
i
++
)
{
if
(
i
==
MapBottomPart
.
LEVEL_NUMS
-
1
)
{
setGray
(
this
.
getIcon
(
i
));
this
.
getIcon
(
i
).
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
showToast
(
'敬请期待更多关卡~'
);
},
this
);
return
;
}
const
levelOrder
=
i
+
1
+
(
70
-
MapBottomPart
.
LEVEL_NUMS
);
const
levelOrder
=
i
+
1
+
(
70
-
MapBottomPart
.
LEVEL_NUMS
)
+
1
;
const
icon
=
MapScene
.
iconHash
[
levelOrder
]
=
this
.
getIcon
(
i
);
const
star
=
new
MapStarComp
();
...
...
egret/src/mapScene/MapScene.ts
View file @
15aadf7b
import
Scene
from
"../../libs/new_wx/components/Scene"
;
import
setGlow
from
"../setGlow"
;
import
MapBottomPart
from
"./MapBottomPart"
;
import
MapRpeatPart
from
"./MapRpeatPart"
;
import
MapTopPart
from
"./MapTopPart"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"../../libs/new_wx/types/sceneTypes"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
getHomeData
from
"../getHomeData"
;
import
getShowOffPic
from
"../getShowOffPic"
;
import
getSharePic
from
"../getSharePic"
;
import
{
getlogItem
}
from
"../Main"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
setGlow
from
"../setGlow"
;
import
MapBottomPart
from
"./MapBottomPart"
;
import
MapRpeatPart
from
"./MapRpeatPart"
;
import
MapTopPart
from
"./MapTopPart"
;
export
default
class
MapScene
extends
Scene
{
scrollGroup
:
eui
.
Group
;
...
...
@@ -65,13 +63,13 @@ export default class MapScene extends Scene {
}
disableIcon
(
level
)
{
this
.
setGray
(
MapScene
.
iconHash
[
level
]
);
this
.
setGray
(
level
);
MapScene
.
starHash
[
level
].
visible
=
false
;
}
enableIcon
(
level
)
{
MapScene
.
iconHash
[
level
].
filters
=
[];
MapScene
.
starHash
[
level
].
visible
=
fals
e
;
MapScene
.
starHash
[
level
].
visible
=
tru
e
;
}
showLog
()
{
...
...
@@ -88,6 +86,10 @@ export default class MapScene extends Scene {
this
[
'bloodTxt'
].
text
=
`
${
homeData
.
heartNums
}
/5`
;
this
[
'goldTxt'
].
text
=
`
${
homeData
.
wealth
}
`
;
this
[
'totalStarTxt'
].
text
=
`
${
homeData
.
totalRemainStarts
}
/210`
;
this
[
'boxNumsTxt'
].
text
=
`
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
for
(
let
j
=
0
;
j
<
70
;
j
++
)
{
this
.
disableIcon
(
j
+
1
);
}
for
(
let
i
=
0
;
i
<
homeData
.
levels
.
length
;
i
++
)
{
const
level
=
homeData
.
levels
[
i
];
const
star
=
MapScene
.
starHash
[
i
+
1
];
...
...
@@ -132,6 +134,8 @@ export default class MapScene extends Scene {
setGray
(
order
:
number
)
{
const
d
=
MapScene
.
iconHash
[
order
];
const
colorMatrix
=
[
0.3
,
0.6
,
0
,
0
,
0
,
0.3
,
0.6
,
0
,
0
,
0
,
...
...
@@ -143,4 +147,4 @@ export default class MapScene extends Scene {
}
get
skinKey
()
{
return
'Map'
}
}
\ No newline at end of file
}
egret/src/panels/BloodPanel.ts
View file @
15aadf7b
...
...
@@ -22,7 +22,7 @@ export default class BloodPanel extends Panel {
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
heartNums
}
`
;
const
data
=
getHomeData
();
this
[
'invitTxt'
].
text
=
`(已领0/1)`
;
if
(
data
.
shared
)
if
(
data
.
askForEnergy
)
this
[
'invitTxt'
].
text
=
`(已领1/1)`
;
}
...
...
@@ -49,7 +49,7 @@ export default class BloodPanel extends Panel {
onTapInvite
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
4
));
const
data
=
getHomeData
();
if
(
data
.
shared
)
{
if
(
data
.
askForEnergy
)
{
showToast
(
'今日已经分享过了.'
);
return
;
}
...
...
mock/happyclear/home.json
View file @
15aadf7b
{
"code"
:
"0000000000"
,
"data"
:{
"shared"
:
1
,
"askForEnergy"
:
true
,
"canReceiveTreasureBoxNum"
:
101
,
"heartNums"
:
1
,
"props"
:[
{
"propType"
:
1
,
"nums"
:
1
},
...
...
@@ -13,6 +14,11 @@
"maxScore"
:
23
,
"stars"
:
3
},
{
"levelNum"
:
3
,
"maxScore"
:
23
,
"stars"
:
1
},
{
"levelNum"
:
2
,
"maxScore"
:
45
,
...
...
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