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
332fcc7e
Commit
332fcc7e
authored
Oct 28, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
546965c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
TurntableIcon.ts
egret/src/mapScene/icon/TurntableIcon.ts
+21
-0
Turntable.ts
egret/src/panels/TurntablePanel/Turntable.ts
+4
-1
No files found.
egret/src/mapScene/icon/TurntableIcon.ts
View file @
332fcc7e
...
...
@@ -3,6 +3,8 @@ import { NetManager } from "../../../libs/tw/manager/NetManager";
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
import
getHomeData
from
"../../getHomeData"
;
import
{
GDispatcher
}
from
"../../../libs/tc/util/GDispatcher"
;
// import { loadTurntableSvga } from "../../panels/TurntablePanel/Turntable";
export
default
class
TurntableIcon
extends
IconBase
{
...
...
@@ -12,13 +14,31 @@ export default class TurntableIcon extends IconBase {
protected
start
()
{
super
.
start
();
//有免费次数
//没有免费次数
//如果元宝足够
this
.
updateIcon
();
}
updateIcon
(){
NetManager
.
ins
.
hc_turnableBaseInfo
((
success
,
res
)
=>
{
if
(
!
success
){
return
;
}
let
data
=
res
.
data
;
if
(
data
.
remainTimes
>
0
||
(
getHomeData
().
wealth
>
data
.
nextTimeNeedCoin
))
{
this
.
tipsVisible
=
true
;
this
.
iconTips
.
text
=
"有优惠"
}
else
{
this
.
tipsVisible
=
false
;
}
})
}
protected
initEvents
()
{
super
.
initEvents
();
GDispatcher
.
addEvent
(
'updateTurntableIcon'
,
this
.
updateIcon
,
this
);
}
protected
onTouchBtn
(
e
:
egret
.
TouchEvent
)
{
...
...
@@ -31,6 +51,7 @@ export default class TurntableIcon extends IconBase {
protected
removeEvents
()
{
super
.
removeEvents
();
GDispatcher
.
removeEvent
(
'updateTurntableIcon'
,
this
.
updateIcon
,
this
);
}
protected
destory
()
{
...
...
egret/src/panels/TurntablePanel/Turntable.ts
View file @
332fcc7e
...
...
@@ -117,6 +117,9 @@ export default class Turntable extends Panel {
// if(!success) {
// return;
// }
GDispatcher
.
dispatchEvent
(
'updateTurntableIcon'
);
// 更新icon
const
data
=
res
.
data
;
const
code
=
res
.
code
;
let
id
=
data
.
option
.
categoryType
;
...
...
@@ -296,6 +299,6 @@ export default class Turntable extends Panel {
}
});
console
.
log
(
RotaryData
);
//
console.log(RotaryData);
}
}
\ No newline at end of file
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