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
7ea02176
Commit
7ea02176
authored
Sep 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
45ab0317
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
MainBase.ts
egret/libs/new_wx/MainBase.ts
+3
-3
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+3
-0
StartPanel.ts
egret/src/panels/StartPanel.ts
+2
-0
home.json
mock/happyclear/home.json
+2
-2
No files found.
egret/libs/new_wx/MainBase.ts
View file @
7ea02176
...
...
@@ -36,7 +36,7 @@ import SceneCtrl from "./ctrls/sceneCtrl";
import
{
ModuleTypes
}
from
"./types/sceneTypes"
;
import
layers
from
"./views/layers"
;
import
SignPrizePanel
from
"../../src/panels/SignPrizePanel"
;
import
{
BLOOD_NUMS_MAX
}
from
"../../src/getHomeData"
;
import
getHomeData
,
{
BLOOD_NUMS_MAX
}
from
"../../src/getHomeData"
;
import
BloodPanel2
from
"../../src/panels/BloodPanel2"
;
import
ExchangePanel
from
"../../src/panels/ExchangePanel"
;
...
...
@@ -329,12 +329,12 @@ timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, () => {
},
this
)
export
const
mainTimer
=
timer
;
export
const
updateMainTimer
=
()
=>
{
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_home'
);
const
data
=
getHomeData
(
);
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
mainTimer
.
stop
();
}
else
{
mainTimer
.
reset
();
const
left
=
data
.
c
ountdown
-
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
const
left
=
data
.
refectionC
ountdown
-
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
mainTimer
.
repeatCount
=
left
;
if
(
left
>=
0
)
mainTimer
.
start
();
...
...
egret/libs/tw/manager/NetManager.ts
View file @
7ea02176
...
...
@@ -1780,6 +1780,9 @@ export class NetManager extends ABNetManager {
* @param result 结果
*/
protected
onResponse
(
net
:
INetData
,
result
:
any
):
void
{
if
(
net
.
name
==
'hc_home'
)
{
result
.
data
.
refectionCountdown
+=
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
}
//数据处理
const
data
:
Data
=
DataManager
.
ins
.
updateData
(
net
.
name
,
result
,
net
.
param
);
//接口成功
...
...
egret/src/panels/StartPanel.ts
View file @
7ea02176
...
...
@@ -17,6 +17,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import
{
getlogItem
}
from
"../Main"
;
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
{
updateMainTimerAfterGetData
}
from
"../../libs/new_wx/MainBase"
;
export
default
class
StartPanel
extends
Panel
{
private
_level
;
...
...
@@ -102,6 +103,7 @@ export default class StartPanel extends Panel {
// Loading.instace.hide();
this
.
touchChildren
=
true
;
this
.
touchEnabled
=
true
;
updateMainTimerAfterGetData
();
if
(
success
)
{
// Loading.instace.show();
try
{
...
...
mock/happyclear/home.json
View file @
7ea02176
...
...
@@ -4,8 +4,8 @@
"desc"
:
"OK"
,
"timestamp"
:
1566885811001
,
"data"
:
{
"
countdown"
:
1569058731
,
"remainEnargy"
:
5
,
"
refectionCountdown"
:
100
,
"remainEnargy"
:
4
,
"isGetAllTreasureBox"
:
0
,
"wealth"
:
7960
,
"totalStars"
:
145
,
...
...
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