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
Show 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";
...
@@ -2,9 +2,10 @@ import { DataManager } from "../libs/tw/manager/DataManager";
interface
IHomeData
{
interface
IHomeData
{
levels
:{
levelNum
,
maxScore
,
stars
}[];
levels
:{
levelNum
,
maxScore
,
stars
}[];
totalRemainStarts
;
totalRemainStarts
;
canReceiveTreasureBoxNum
;
wealth
;
wealth
;
heartNums
;
heartNums
;
shared
;
askForEnergy
:
boolean
;
props
:{
propType
,
nums
}[]
props
:{
propType
,
nums
}[]
}
}
export
default
():
IHomeData
=>
{
export
default
():
IHomeData
=>
{
...
...
egret/src/mapScene/MapBottomPart.ts
View file @
15aadf7b
...
@@ -2,6 +2,7 @@ import ComponentBase from "../../libs/new_wx/components/ComponentBase";
...
@@ -2,6 +2,7 @@ import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import
MapScene
from
"./MapScene"
;
import
MapScene
from
"./MapScene"
;
import
MapStarComp
from
"./MapStarComp"
;
import
MapStarComp
from
"./MapStarComp"
;
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
import
setGray
from
"../setGray"
;
export
default
class
MapBottomPart
extends
ComponentBase
{
export
default
class
MapBottomPart
extends
ComponentBase
{
static
LEVEL_NUMS
=
12
;
static
LEVEL_NUMS
=
12
;
...
@@ -9,13 +10,14 @@ export default class MapBottomPart extends ComponentBase {
...
@@ -9,13 +10,14 @@ export default class MapBottomPart extends ComponentBase {
super
.
start
();
super
.
start
();
for
(
let
i
=
0
;
i
<
MapBottomPart
.
LEVEL_NUMS
;
i
++
)
{
for
(
let
i
=
0
;
i
<
MapBottomPart
.
LEVEL_NUMS
;
i
++
)
{
if
(
i
==
MapBottomPart
.
LEVEL_NUMS
-
1
)
{
if
(
i
==
MapBottomPart
.
LEVEL_NUMS
-
1
)
{
setGray
(
this
.
getIcon
(
i
));
this
.
getIcon
(
i
).
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
getIcon
(
i
).
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
showToast
(
'敬请期待更多关卡~'
);
showToast
(
'敬请期待更多关卡~'
);
},
this
);
},
this
);
return
;
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
icon
=
MapScene
.
iconHash
[
levelOrder
]
=
this
.
getIcon
(
i
);
const
star
=
new
MapStarComp
();
const
star
=
new
MapStarComp
();
...
...
egret/src/mapScene/MapScene.ts
View file @
15aadf7b
import
Scene
from
"../../libs/new_wx/components/Scene"
;
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
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"../../libs/new_wx/types/sceneTypes"
;
import
{
ModuleTypes
}
from
"../../libs/new_wx/types/sceneTypes"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
getHomeData
from
"../getHomeData"
;
import
getHomeData
from
"../getHomeData"
;
import
getShowOffPic
from
"../getShowOffPic"
;
import
getSharePic
from
"../getSharePic"
;
import
{
getlogItem
}
from
"../Main"
;
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
{
export
default
class
MapScene
extends
Scene
{
scrollGroup
:
eui
.
Group
;
scrollGroup
:
eui
.
Group
;
...
@@ -65,13 +63,13 @@ export default class MapScene extends Scene {
...
@@ -65,13 +63,13 @@ export default class MapScene extends Scene {
}
}
disableIcon
(
level
)
{
disableIcon
(
level
)
{
this
.
setGray
(
MapScene
.
iconHash
[
level
]
);
this
.
setGray
(
level
);
MapScene
.
starHash
[
level
].
visible
=
false
;
MapScene
.
starHash
[
level
].
visible
=
false
;
}
}
enableIcon
(
level
)
{
enableIcon
(
level
)
{
MapScene
.
iconHash
[
level
].
filters
=
[];
MapScene
.
iconHash
[
level
].
filters
=
[];
MapScene
.
starHash
[
level
].
visible
=
fals
e
;
MapScene
.
starHash
[
level
].
visible
=
tru
e
;
}
}
showLog
()
{
showLog
()
{
...
@@ -88,6 +86,10 @@ export default class MapScene extends Scene {
...
@@ -88,6 +86,10 @@ export default class MapScene extends Scene {
this
[
'bloodTxt'
].
text
=
`
${
homeData
.
heartNums
}
/5`
;
this
[
'bloodTxt'
].
text
=
`
${
homeData
.
heartNums
}
/5`
;
this
[
'goldTxt'
].
text
=
`
${
homeData
.
wealth
}
`
;
this
[
'goldTxt'
].
text
=
`
${
homeData
.
wealth
}
`
;
this
[
'totalStarTxt'
].
text
=
`
${
homeData
.
totalRemainStarts
}
/210`
;
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
++
)
{
for
(
let
i
=
0
;
i
<
homeData
.
levels
.
length
;
i
++
)
{
const
level
=
homeData
.
levels
[
i
];
const
level
=
homeData
.
levels
[
i
];
const
star
=
MapScene
.
starHash
[
i
+
1
];
const
star
=
MapScene
.
starHash
[
i
+
1
];
...
@@ -132,6 +134,8 @@ export default class MapScene extends Scene {
...
@@ -132,6 +134,8 @@ export default class MapScene extends Scene {
setGray
(
order
:
number
)
{
setGray
(
order
:
number
)
{
const
d
=
MapScene
.
iconHash
[
order
];
const
d
=
MapScene
.
iconHash
[
order
];
const
colorMatrix
=
[
const
colorMatrix
=
[
0.3
,
0.6
,
0
,
0
,
0
,
0.3
,
0.6
,
0
,
0
,
0
,
0.3
,
0.6
,
0
,
0
,
0
,
0.3
,
0.6
,
0
,
0
,
0
,
...
...
egret/src/panels/BloodPanel.ts
View file @
15aadf7b
...
@@ -22,7 +22,7 @@ export default class BloodPanel extends Panel {
...
@@ -22,7 +22,7 @@ export default class BloodPanel extends Panel {
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
heartNums
}
`
;
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
heartNums
}
`
;
const
data
=
getHomeData
();
const
data
=
getHomeData
();
this
[
'invitTxt'
].
text
=
`(已领0/1)`
;
this
[
'invitTxt'
].
text
=
`(已领0/1)`
;
if
(
data
.
shared
)
if
(
data
.
askForEnergy
)
this
[
'invitTxt'
].
text
=
`(已领1/1)`
;
this
[
'invitTxt'
].
text
=
`(已领1/1)`
;
}
}
...
@@ -49,7 +49,7 @@ export default class BloodPanel extends Panel {
...
@@ -49,7 +49,7 @@ export default class BloodPanel extends Panel {
onTapInvite
()
{
onTapInvite
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
4
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
4
));
const
data
=
getHomeData
();
const
data
=
getHomeData
();
if
(
data
.
shared
)
{
if
(
data
.
askForEnergy
)
{
showToast
(
'今日已经分享过了.'
);
showToast
(
'今日已经分享过了.'
);
return
;
return
;
}
}
...
...
mock/happyclear/home.json
View file @
15aadf7b
{
{
"code"
:
"0000000000"
,
"code"
:
"0000000000"
,
"data"
:{
"data"
:{
"shared"
:
1
,
"askForEnergy"
:
true
,
"canReceiveTreasureBoxNum"
:
101
,
"heartNums"
:
1
,
"heartNums"
:
1
,
"props"
:[
"props"
:[
{
"propType"
:
1
,
"nums"
:
1
},
{
"propType"
:
1
,
"nums"
:
1
},
...
@@ -13,6 +14,11 @@
...
@@ -13,6 +14,11 @@
"maxScore"
:
23
,
"maxScore"
:
23
,
"stars"
:
3
"stars"
:
3
},
},
{
"levelNum"
:
3
,
"maxScore"
:
23
,
"stars"
:
1
},
{
{
"levelNum"
:
2
,
"levelNum"
:
2
,
"maxScore"
:
45
,
"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