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
6c294f7e
Commit
6c294f7e
authored
Aug 20, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
86276783
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
getHomeData.ts
egret/src/getHomeData.ts
+15
-0
StartPanel.ts
egret/src/panels/StartPanel.ts
+15
-0
home.json
mock/happyclear/home.json
+4
-0
No files found.
egret/src/getHomeData.ts
View file @
6c294f7e
...
...
@@ -5,8 +5,23 @@ interface IHomeData {
wealth
;
heartNums
;
shared
;
props
:{
propType
,
nums
}[]
}
export
default
():
IHomeData
=>
{
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_home'
);
return
data
;
}
export
const
getPropNums
=
(
type
)
=>
{
const
data
:
IHomeData
=
DataManager
.
ins
.
getData
(
'hc_home'
).
data
;
const
props
=
data
.
props
;
let
nums
=
0
;
for
(
const
prop
of
props
)
{
if
(
type
==
prop
.
propType
)
{
nums
=
prop
.
nums
;
break
;
}
}
return
nums
;
}
\ No newline at end of file
egret/src/panels/StartPanel.ts
View file @
6c294f7e
...
...
@@ -5,6 +5,8 @@ import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import
{
ModuleTypes
}
from
"../../libs/new_wx/types/sceneTypes"
;
import
{
Chapters
}
from
"../something/Chapters"
;
import
{
PassType
}
from
"../something/enum/PassType"
;
import
{
getPropNums
}
from
"../getHomeData"
;
import
PropType
from
"../PropType"
;
export
default
class
StartPanel
extends
Panel
{
private
_level
;
...
...
@@ -22,6 +24,19 @@ export default class StartPanel extends Panel {
this
[
'targetTxt'
].
text
=
'在规定步数内
\
n消除足够数量目标'
;
else
if
(
levelType
==
PassType
.
SCORE_TARGET
)
this
[
'targetTxt'
].
text
=
`在规定步数内\n分数达到
${
Chapters
[
data
].
passTarget
.
score
}
分`
;
const
prop2Nums
=
getPropNums
(
PropType
.
BOOM
);
const
prop1Nums
=
getPropNums
(
PropType
.
HAMMER
);
const
prop3Nums
=
getPropNums
(
PropType
.
CHANCE_NUM
);
this
[
'buy1btn'
].
visible
=
prop1Nums
<=
0
;
this
[
'nums1'
].
visible
=
prop1Nums
>
0
;
this
[
'buy2btn'
].
visible
=
prop2Nums
<=
0
;
this
[
'nums2'
].
visible
=
prop2Nums
>
0
;
this
[
'buy3btn'
].
visible
=
prop3Nums
<=
0
;
this
[
'nums3'
].
visible
=
prop3Nums
>
0
;
this
[
'nums1Txt'
].
text
=
prop1Nums
;
this
[
'nums2Txt'
].
text
=
prop2Nums
;
this
[
'nums3Txt'
].
text
=
prop3Nums
;
}
initEvents
()
{
...
...
mock/happyclear/home.json
View file @
6c294f7e
...
...
@@ -3,6 +3,10 @@
"data"
:{
"shared"
:
1
,
"heartNums"
:
1
,
"props"
:[
{
"propType"
:
1
,
"nums"
:
1
},
{
"propType"
:
2
,
"nums"
:
2
}
],
"levels"
:[
{
"levelNum"
:
1
,
...
...
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