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
e2b99b85
Commit
e2b99b85
authored
Nov 11, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9cef89f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
35 deletions
+58
-35
Scene.ts
egret/libs/new_wx/components/Scene.ts
+6
-0
sceneCtrl.ts
egret/libs/new_wx/ctrls/sceneCtrl.ts
+4
-2
MapScene.ts
egret/src/mapScene/MapScene.ts
+10
-1
HbRainIcon.ts
egret/src/mapScene/icon/HbRainIcon.ts
+38
-32
No files found.
egret/libs/new_wx/components/Scene.ts
View file @
e2b99b85
...
@@ -11,6 +11,12 @@ export default class Scene extends ComponentBase {
...
@@ -11,6 +11,12 @@ export default class Scene extends ComponentBase {
this
.
playAnimation
();
this
.
playAnimation
();
}
}
onLoad
(){
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
();
})
}
updateScene
(){
updateScene
(){
}
}
...
...
egret/libs/new_wx/ctrls/sceneCtrl.ts
View file @
e2b99b85
...
@@ -48,8 +48,10 @@ export default class SceneCtrl {
...
@@ -48,8 +48,10 @@ export default class SceneCtrl {
scene
.
addEventListener
(
egret
.
Event
.
ADDED_TO_STAGE
,
()
=>
{
scene
.
addEventListener
(
egret
.
Event
.
ADDED_TO_STAGE
,
()
=>
{
scene
.
start
(
data
);
scene
.
start
(
data
);
},
this
);
},
this
);
this
.
addToStage
(
scene
);
scene
.
onLoad
().
then
(()
=>
{
onComplete
&&
onComplete
();
this
.
addToStage
(
scene
);
onComplete
&&
onComplete
();
});
}
}
addMask
()
{
addMask
()
{
...
...
egret/src/mapScene/MapScene.ts
View file @
e2b99b85
...
@@ -108,6 +108,15 @@ export default class MapScene extends Scene {
...
@@ -108,6 +108,15 @@ export default class MapScene extends Scene {
private
inviteTimer
:
egret
.
Timer
;
private
inviteTimer
:
egret
.
Timer
;
private
cutTime
:
number
;
private
cutTime
:
number
;
onLoad
()
{
super
.
onLoad
().
then
(()
=>
{});
return
new
Promise
((
resolve
,
reject
)
=>
{
NetManager
.
ins
.
hbRainBaseInfo
(()
=>
{
resolve
();
});
});
}
async
start
(
data
?)
{
async
start
(
data
?)
{
super
.
start
();
super
.
start
();
...
@@ -334,7 +343,7 @@ export default class MapScene extends Scene {
...
@@ -334,7 +343,7 @@ export default class MapScene extends Scene {
if
(
item
.
parent
)
item
.
parent
.
addChild
(
item
);
if
(
item
.
parent
)
item
.
parent
.
addChild
(
item
);
});
});
}
}
}
}
// 添加图标
// 添加图标
...
...
egret/src/mapScene/icon/HbRainIcon.ts
View file @
e2b99b85
...
@@ -4,6 +4,8 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
...
@@ -4,6 +4,8 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
{
getlogItem
}
from
"../../Main"
;
import
{
getlogItem
}
from
"../../Main"
;
import
CutTimer
from
"../../CutTimer"
;
import
CutTimer
from
"../../CutTimer"
;
import
{
DataManager
}
from
"../../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../../libs/tw/enum/NetName"
;
export
default
class
HbRainIcon
extends
IconBase
{
export
default
class
HbRainIcon
extends
IconBase
{
...
@@ -11,15 +13,18 @@ export default class HbRainIcon extends IconBase {
...
@@ -11,15 +13,18 @@ export default class HbRainIcon extends IconBase {
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
?:
eui
.
Image
,
tipsLabel
?:
eui
.
Label
)
{
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
?:
eui
.
Image
,
tipsLabel
?:
eui
.
Label
)
{
super
(
name
,
group
,
btn
,
tipsBg
,
tipsLabel
);
super
(
name
,
group
,
btn
,
tipsBg
,
tipsLabel
);
this
.
cutTimer
=
new
CutTimer
();
this
.
cutTimer
.
callFun
=
()
=>
{
this
.
updateIcon
();
};
this
.
updateIcon
();
}
}
protected
start
()
{
protected
start
()
{
super
.
start
();
super
.
start
();
this
.
cutTimer
=
new
CutTimer
();
this
.
cutTimer
.
callFun
=
()
=>
{
this
.
updateIcon
();
};
let
res
=
DataManager
.
ins
.
getData
(
NetName
.
HBRAIN_BASEINFO
);
if
(
res
)
{
this
.
call
(
res
.
success
,
res
);
}
}
}
public
showLog
()
{
public
showLog
()
{
...
@@ -28,37 +33,38 @@ export default class HbRainIcon extends IconBase {
...
@@ -28,37 +33,38 @@ export default class HbRainIcon extends IconBase {
}
}
private
updateIcon
()
{
private
updateIcon
()
{
NetManager
.
ins
.
hbRainBaseInfo
((
success
,
res
)
=>
{
NetManager
.
ins
.
hbRainBaseInfo
((
success
,
res
)
=>
this
.
call
(
success
,
res
));
if
(
!
success
)
{
}
if
(
res
.
code
==
"600054"
||
res
.
code
==
"600055"
)
{
this
.
visible
=
false
;
}
GDispatcher
.
dispatchEvent
(
'updateActIcon'
);
return
;
}
const
data
=
res
.
data
;
let
time
:
number
;
private
call
(
success
,
res
)
{
const
sysTime
=
res
.
timestamp
;
// 当前系统时间
if
(
!
success
)
{
if
(
data
.
currentSession
)
{
if
(
res
.
code
==
"600054"
||
res
.
code
==
"600055"
)
{
this
.
visible
=
true
;
time
=
data
.
currentSession
.
endTime
-
sysTime
+
3000
;
if
(
!
this
.
cutTimer
.
start
(
time
))
{
this
.
cutTimer
.
stop
();
this
.
cutTimer
.
start
(
time
);
}
}
else
if
(
data
.
nextSession
)
{
this
.
visible
=
true
;
time
=
data
.
nextSession
.
startTime
-
sysTime
+
3000
;
if
(
!
this
.
cutTimer
.
start
(
time
))
{
this
.
cutTimer
.
stop
();
this
.
cutTimer
.
start
(
time
);
}
}
else
{
this
.
visible
=
false
;
this
.
visible
=
false
;
}
}
GDispatcher
.
dispatchEvent
(
'updateActIcon'
);
GDispatcher
.
dispatchEvent
(
'updateActIcon'
);
});
return
;
}
const
data
=
res
.
data
;
let
time
:
number
;
const
sysTime
=
res
.
timestamp
;
// 当前系统时间
if
(
data
.
currentSession
)
{
this
.
visible
=
true
;
time
=
data
.
currentSession
.
endTime
-
sysTime
+
3000
;
if
(
!
this
.
cutTimer
.
start
(
time
))
{
this
.
cutTimer
.
stop
();
this
.
cutTimer
.
start
(
time
);
}
}
else
if
(
data
.
nextSession
)
{
this
.
visible
=
true
;
time
=
data
.
nextSession
.
startTime
-
sysTime
+
3000
;
if
(
!
this
.
cutTimer
.
start
(
time
))
{
this
.
cutTimer
.
stop
();
this
.
cutTimer
.
start
(
time
);
}
}
else
{
this
.
visible
=
false
;
}
GDispatcher
.
dispatchEvent
(
'updateActIcon'
);
}
}
...
...
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