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
6a6cdeb4
Commit
6a6cdeb4
authored
Nov 11, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
92cecba8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
HbCutTime.ts
egret/src/panels/HongbaoRain/HbCutTime.ts
+22
-6
hbRainBaseInfo.json
mock/happyclear/hbRainBaseInfo.json
+8
-2
No files found.
egret/src/panels/HongbaoRain/HbCutTime.ts
View file @
6a6cdeb4
...
...
@@ -34,10 +34,19 @@ export default class HbCutTime extends Panel {
this
.
ok_btn
.
anchorOffsetY
=
52
;
}
private
hbRainBaseInfo
()
{
getData
():
any
{
return
new
Promise
((
r
)
=>
{
NetManager
.
ins
.
hbRainBaseInfo
((
success
,
res
)
=>
{
r
(
res
);
});
});
}
private
hbRainBaseInfo
(
updateData
?)
{
const
success
=
this
.
data
.
res
.
success
;
const
res
=
this
.
data
.
res
;
const
data
=
this
.
data
.
res
.
data
;
const
res
=
updateData
||
this
.
data
.
res
;
const
data
=
(
updateData
&&
updateData
.
data
)
||
this
.
data
.
res
.
data
;
if
(
updateData
&&
updateData
.
data
)
this
.
data
.
res
=
updateData
;
if
(
!
success
)
{
this
.
ok_btn
.
source
=
'hbCutTime_btn_soon_png'
;
...
...
@@ -45,11 +54,16 @@ export default class HbCutTime extends Panel {
this
.
ok_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchOK
,
this
);
return
;
}
this
.
cutTimer
=
new
CutTimer
(
this
.
cutTimeLabel
,
'hh时mm分ss秒'
,
()
=>
{
this
.
hidePanel
();
this
.
cutTimer
=
this
.
cutTimer
||
new
CutTimer
(
this
.
cutTimeLabel
,
'hh时mm分ss秒'
,
async
()
=>
{
const
getData
=
await
this
.
getData
();
//重新获取数据
if
(
getData
.
success
)
{
this
.
hbRainBaseInfo
(
getData
);
}
else
{
this
.
hidePanel
();
//没有数据关闭窗口
}
GDispatcher
.
dispatchEvent
(
'updateHbRainIcon'
);
});
le
t
sysTime
=
res
.
timestamp
;
// 当前系统时间
cons
t
sysTime
=
res
.
timestamp
;
// 当前系统时间
let
time
;
if
(
data
.
currentSession
)
{
time
=
data
.
currentSession
.
endTime
-
sysTime
+
3000
;
...
...
@@ -68,6 +82,8 @@ export default class HbCutTime extends Panel {
this
.
cutTimer
.
start
(
time
);
}
}
else
if
(
data
.
nextSession
)
{
egret
.
Tween
.
removeTweens
(
this
.
ok_btn
);
this
.
ok_btn
.
scaleX
=
this
.
ok_btn
.
scaleY
=
1
;
time
=
data
.
nextSession
.
startTime
-
sysTime
+
3000
;
this
.
ok_btn
.
source
=
'hbCutTime_btn_soon_png'
;
this
.
ok_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchOK
,
this
);
...
...
mock/happyclear/hbRainBaseInfo.json
View file @
6a6cdeb4
...
...
@@ -2,13 +2,19 @@
"success"
:
true
,
"code"
:
"0000000000"
,
"desc"
:
"OK"
,
"timestamp"
:
1573
206010193
,
"timestamp"
:
1573
440905952
,
"data"
:
{
"currentRemainTimes"
:
0
,
"currentSession"
:
{
"sessionIndex"
:
10
,
"startTime"
:
1573210800000
,
"endTime"
:
1573212600000
,
"endTime"
:
1573440915952
,
"limitScore"
:
10
},
"nextSession"
:
{
"sessionIndex"
:
10
,
"startTime"
:
1573440915952
,
"endTime"
:
1573440915952
,
"limitScore"
:
10
},
"canJoin"
:
true
...
...
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