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
86276783
Commit
86276783
authored
Aug 20, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ffed44d0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
5 deletions
+46
-5
getHomeData.ts
egret/src/getHomeData.ts
+1
-0
BloodPanel.ts
egret/src/panels/BloodPanel.ts
+22
-2
Buy1Panel.ts
egret/src/panels/Buy1Panel.ts
+4
-0
Buy2Panel.ts
egret/src/panels/Buy2Panel.ts
+4
-0
Buy3Panel.ts
egret/src/panels/Buy3Panel.ts
+4
-0
ShopPanel.ts
egret/src/panels/ShopPanel.ts
+10
-3
home.json
mock/happyclear/home.json
+1
-0
No files found.
egret/src/getHomeData.ts
View file @
86276783
...
...
@@ -4,6 +4,7 @@ interface IHomeData {
totalRemainStarts
;
wealth
;
heartNums
;
shared
;
}
export
default
():
IHomeData
=>
{
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_home'
);
...
...
egret/src/panels/BloodPanel.ts
View file @
86276783
...
...
@@ -2,6 +2,7 @@ import Panel from "../../libs/new_wx/components/Panel";
import
getHomeData
from
"../getHomeData"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
export
default
class
BloodPanel
extends
Panel
{
start
(
data
)
{
...
...
@@ -12,6 +13,10 @@ export default class BloodPanel extends Panel {
private
updateData
()
{
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
heartNums
}
`
;
const
data
=
getHomeData
();
this
[
'invitTxt'
].
text
=
`(已领0/1)`
;
if
(
data
.
shared
)
this
[
'invitTxt'
].
text
=
`(已领1/1)`
;
}
initEvents
()
{
...
...
@@ -34,8 +39,23 @@ export default class BloodPanel extends Panel {
}
onTapInvite
()
{
const
data
=
getHomeData
();
if
(
data
.
shared
)
{
showToast
(
'今日已经分享过了.'
);
return
;
}
this
[
'inviteBtn'
].
enabled
=
false
;
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
this
[
'inviteBtn'
].
enabled
=
true
;
if
(
success
)
{
this
[
'invitTxt'
].
text
=
`(已领1/1)`
;
}
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
])
})
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
],
this
[
'resumeBtn
s
'
]]
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
],
this
[
'resumeBtn'
]]
}
get
skinKey
()
{
return
'Blood'
}
}
\ No newline at end of file
egret/src/panels/Buy1Panel.ts
View file @
86276783
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
PropType
from
"../PropType"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
export
default
class
Buy1Panel
extends
Panel
{
buyBtn
:
eui
.
Button
...
...
@@ -16,6 +17,9 @@ export default class Buy1Panel extends Panel {
this
.
buyBtn
.
enabled
=
true
;
if
(
success
)
{
this
.
hidePanel
();
NetManager
.
ins
.
hc_home
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
}
},
2
,
PropType
.
HAMMER
);
//兑换道具
}
...
...
egret/src/panels/Buy2Panel.ts
View file @
86276783
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
PropType
from
"../PropType"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
export
default
class
Buy2Panel
extends
Panel
{
start
(
data
)
{
...
...
@@ -15,6 +16,9 @@ export default class Buy2Panel extends Panel {
this
.
buyBtn
.
enabled
=
true
;
if
(
success
)
{
this
.
hidePanel
();
NetManager
.
ins
.
hc_home
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
}
},
2
,
PropType
.
BOOM
);
//兑换道具
}
...
...
egret/src/panels/Buy3Panel.ts
View file @
86276783
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
PropType
from
"../PropType"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
export
default
class
Buy3Panel
extends
Panel
{
start
(
data
)
{
...
...
@@ -16,6 +17,9 @@ export default class Buy3Panel extends Panel {
this
.
buyBtn
.
enabled
=
true
;
if
(
success
)
{
this
.
hidePanel
();
NetManager
.
ins
.
hc_home
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
}
},
2
,
PropType
.
CHANCE_NUM
);
//兑换道具
}
...
...
egret/src/panels/ShopPanel.ts
View file @
86276783
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
PropType
from
"../PropType"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
export
default
class
ShopPanel
extends
Panel
{
buyBtn1
:
eui
.
Button
;
...
...
@@ -18,7 +19,9 @@ export default class ShopPanel extends Panel {
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
this
.
buyBtn1
.
enabled
=
true
;
if
(
success
)
{
NetManager
.
ins
.
hc_home
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
])
}
},
2
,
PropType
.
HAMMER
);
//兑换道具
}
...
...
@@ -28,7 +31,9 @@ export default class ShopPanel extends Panel {
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
this
.
buyBtn2
.
enabled
=
true
;
if
(
success
)
{
NetManager
.
ins
.
hc_home
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
])
}
},
2
,
PropType
.
BOOM
);
//兑换道具
}
...
...
@@ -38,7 +43,9 @@ export default class ShopPanel extends Panel {
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
this
.
buyBtn3
.
enabled
=
true
;
if
(
success
)
{
NetManager
.
ins
.
hc_home
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
])
}
},
2
,
PropType
.
CHANCE_NUM
);
//兑换道具
}
...
...
mock/happyclear/home.json
View file @
86276783
{
"code"
:
"0000000000"
,
"data"
:{
"shared"
:
1
,
"heartNums"
:
1
,
"levels"
:[
{
...
...
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