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
937553a1
Commit
937553a1
authored
Oct 25, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6d04de41
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
25 deletions
+54
-25
MapScene.ts
egret/src/mapScene/MapScene.ts
+15
-21
IconBase.ts
egret/src/mapScene/icon/IconBase.ts
+2
-2
ScratchIcon.ts
egret/src/mapScene/icon/ScratchIcon.ts
+9
-2
TurntableIcon.ts
egret/src/mapScene/icon/TurntableIcon.ts
+28
-0
No files found.
egret/src/mapScene/MapScene.ts
View file @
937553a1
...
...
@@ -23,6 +23,7 @@ import Utils from "../Utils";
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
Loading
from
"../../libs/new_wx/components/Loading"
;
import
ScratchIcon
from
"./icon/ScratchIcon"
;
import
TurntableIcon
from
"./icon/TurntableIcon"
;
let
doHelpFlag
=
false
;
// let adTag = false;
...
...
@@ -37,6 +38,8 @@ export default class MapScene extends Scene {
static
starHash
:
any
=
{};
_data
;
private
icons
=
{};
sendInvite
()
{
const
code
=
Utils
.
getRequestByKey
(
'shareCode'
);
if
(
!
code
)
return
;
...
...
@@ -72,10 +75,12 @@ export default class MapScene extends Scene {
async
start
(
data
?)
{
super
.
start
();
this
.
addIcon
();
// 添加Icon
this
.
sendInvite
();
PanelCtrl
.
instance
.
show
(
'back'
);
this
.
updateMyInfo
();
this
.
updateAdData
();
GDispatcher
.
dispatchEvent
(
"getInviteInfo"
);
// 查询邀请信息,控制邀请有礼角标
...
...
@@ -91,8 +96,6 @@ export default class MapScene extends Scene {
stopGamebg
();
let
scratchBtn
=
new
ScratchIcon
(
"scratch"
,
this
[
"scratchGroup"
],
this
[
"scratchBtn"
],
this
[
"scratchTipsBg"
],
this
[
"scratchTips"
]);
NetManager
.
ins
.
getSignInfo
(()
=>
{
const
panels
=
[];
const
date
=
new
Date
();
...
...
@@ -248,6 +251,14 @@ export default class MapScene extends Scene {
}
// 添加图标
private
addIcon
(){
this
.
icons
=
{
"scratchIcon"
:
new
ScratchIcon
(
"scratchIcon"
,
this
[
"scratchGroup"
],
this
[
"scratchBtn"
],
this
[
"scratchTipsBg"
],
this
[
"scratchTips"
]),
"turntableIcon"
:
new
TurntableIcon
(
"turntableIcon"
,
this
[
"turnTableGroup"
],
this
[
"turnTableBtn"
],
this
[
"turnTableTipsBg"
],
this
[
"turnTableTips"
])
};
}
updateMyInfo
()
{
this
[
'avatar'
].
visible
=
false
;
this
[
'nameTxt'
].
text
=
''
;
...
...
@@ -299,7 +310,7 @@ export default class MapScene extends Scene {
if
(
this
[
'pic'
])
egret
.
Tween
.
removeTweens
(
this
[
'pic'
]);
if
(
this
.
inviteTimer
){
if
(
this
.
inviteTimer
)
{
this
.
inviteTimer
.
stop
();
this
.
inviteTimer
.
removeEventListener
(
egret
.
TimerEvent
.
TIMER
,
this
.
inviteCutTimer
,
this
);
}
...
...
@@ -639,25 +650,8 @@ export default class MapScene extends Scene {
},
window
[
'signActivityId'
])
}
////////////////////////////////////////////////// 刮刮卡 //////////////////////////////////////////////////
onTap_scratchBtn
()
{
NetManager
.
ins
.
getInviteInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
return
;
}
PanelCtrl
.
instance
.
show
(
'scratch'
,
res
.
data
);
});
}
////////////////////////////////////////////////// 大转盘 //////////////////////////////////////////////////
onTap_turnTableBtn
()
{
PanelCtrl
.
instance
.
show
(
'turnTable'
)
}
protected
initEvents
()
{
// this['goldBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_goldBtn, this)
this
[
'turnTableBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_turnTableBtn
,
this
)
// this['scratchBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_scratchBtn, this)
this
[
'inviteBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_inviteBtn
,
this
)
this
[
'friendBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_friendBtn
,
this
)
this
[
'adBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_adBtn
,
this
)
...
...
egret/src/mapScene/icon/IconBase.ts
View file @
937553a1
...
...
@@ -14,7 +14,7 @@ export default class 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
){
this
.
iconGroup
=
group
;
this
.
iconBtn
=
btn
;
this
.
iconTipsBg
=
tipsBg
;
...
...
@@ -28,7 +28,7 @@ export default class IconBase{
}
protected
onTouchBtn
(
e
:
egret
.
TouchEvent
){
console
.
log
(
"基类"
);
}
protected
removeEvents
(){
...
...
egret/src/mapScene/icon/ScratchIcon.ts
View file @
937553a1
import
IconBase
from
"./IconBase"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
export
default
class
ScratchIcon
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
);
}
...
...
@@ -11,7 +13,12 @@ export default class ScratchIcon extends IconBase {
protected
onTouchBtn
(
e
:
egret
.
TouchEvent
)
{
super
.
onTouchBtn
(
e
);
console
.
log
(
"子类"
);
NetManager
.
ins
.
getInviteInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
return
;
}
PanelCtrl
.
instance
.
show
(
'scratch'
,
res
.
data
);
});
}
protected
removeEvents
()
{
...
...
egret/src/mapScene/icon/TurntableIcon.ts
0 → 100644
View file @
937553a1
import
IconBase
from
"./IconBase"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
export
default
class
TurntableIcon
extends
IconBase
{
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
?:
eui
.
Image
,
tipsLabel
?:
eui
.
Label
)
{
super
(
name
,
group
,
btn
,
tipsBg
,
tipsLabel
);
}
protected
initEvents
()
{
super
.
initEvents
();
}
protected
onTouchBtn
(
e
:
egret
.
TouchEvent
)
{
super
.
onTouchBtn
(
e
);
PanelCtrl
.
instance
.
show
(
'turnTable'
);
}
protected
removeEvents
()
{
super
.
removeEvents
();
}
protected
destory
()
{
super
.
destory
();
}
}
\ 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