Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
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
崔立强
db-game-template
Commits
993dfeee
Commit
993dfeee
authored
Feb 25, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
1bd97f81
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1611 additions
and
3 deletions
+1611
-3
ShareScene_20200225165736.ts
.history/egret/src/EndScene/ShareScene_20200225165736.ts
+197
-0
ShareScene_20200225165850.ts
.history/egret/src/EndScene/ShareScene_20200225165850.ts
+197
-0
ShareScene_20200225170530.ts
.history/egret/src/EndScene/ShareScene_20200225170530.ts
+199
-0
MapComponent_20200225170107.ts
.history/egret/src/components/MapComponent_20200225170107.ts
+250
-0
MapComponent_20200225170202.ts
.history/egret/src/components/MapComponent_20200225170202.ts
+251
-0
MapComponent_20200225170338.ts
.history/egret/src/components/MapComponent_20200225170338.ts
+252
-0
MapComponent_20200225170425.ts
.history/egret/src/components/MapComponent_20200225170425.ts
+252
-0
ShareScene.ts
egret/src/EndScene/ShareScene.ts
+5
-1
MapComponent.ts
egret/src/components/MapComponent.ts
+8
-2
No files found.
.history/egret/src/EndScene/ShareScene_20200225165736.ts
0 → 100644
View file @
993dfeee
import
Scene
from
"../views/Scene"
;
import
{
MapComponent
}
from
"../components/mapComponent"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
{
NetPromise
}
from
"../NetPromise"
;
import
ChoseCityPanel
from
"../choseScene/ChoseCityPanel"
;
import
{
Buried
}
from
"../../libs/tw/util/Buried"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
export
default
class
ShareScene
extends
Scene
{
public
bg
:
eui
.
Group
;
public
backBtn
:
eui
.
Button
;
public
shareBtn
:
eui
.
Button
;
public
prizeBtn
:
eui
.
Button
;
public
mapGroup
:
eui
.
Group
;
public
lab
:
eui
.
Label
;
private
showExposure
:
any
;
private
shareExposure
:
any
;
private
share2Exposure
:
any
;
private
prizeExposure
:
any
;
private
mdata
:
any
;
public
get
skinKey
()
{
return
'ShareScene'
}
public
get
groupName
()
{
return
'share_scene'
}
constructor
(
data
?)
{
super
(
data
);
this
.
mdata
=
data
;
}
initEvents
()
{
// this.timer.addEventListener(egret.TimerEvent.TIMER, this.ontimer, this);
// this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_startBtn, this);
// this.clickGroup.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onMainTap, this);
this
.
backBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_backBtn
,
this
);
this
.
shareBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shareBtn
,
this
);
this
.
prizeBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_prizeBtn
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
// this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_startBtn, this);
// this.clickGroup.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onMainTap, this);
// this.timer.removeEventListener(egret.TimerEvent.TIMER, this.ontimer, this);
// this.timer.stop();//停止倒计时
this
.
backBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_backBtn
,
this
);
this
.
shareBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shareBtn
,
this
);
this
.
prizeBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_prizeBtn
,
this
);
}
protected
onSkinComplete
():
void
{
super
.
onSkinComplete
();
// this.mainbg.texture = this.bgtexture;
this
.
once
(
egret
.
Event
.
ADDED_TO_STAGE
,
this
.
onLoad
,
this
);
if
(
this
.
stage
)
{
this
.
onLoad
();
}
}
private
bgtexture
:
egret
.
Texture
;
protected
async
preLoadRes
()
{
// var mcJson = await RES.getResAsync('xinxingAct_json');
// var mcImg = await RES.getResAsync('xinxingAct_png');
// var mcFactory = new egret.MovieClipDataFactory(mcJson, mcImg);
//this.xinxingAct = new egret.MovieClip(mcFactory.generateMovieClipData());
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
start
(
data
?)
{
super
.
start
(
data
);
// this.timer = new egret.Timer(1000);
this
.
percentHeight
=
100
;
}
private
onLoad
():
void
{
this
.
showAct
();
this
.
initUI
();
}
map
;
private
initUI
():
void
{
let
showDpmOut
=
Buried
.
connectDpm
(
110
,
12
,
1
);
// 点击埋点
let
showDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
showExposure
=
Buried
.
createExposure
(
showDpmOut
,
showDcmOut
);
NetManager
.
ins
.
showLog
(
this
.
showExposure
);
let
shareDpmOut
=
Buried
.
connectDpm
(
110
,
10
,
1
);
// 点击埋点
let
shareDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
shareExposure
=
Buried
.
createExposure
(
shareDpmOut
,
shareDcmOut
);
let
prizeDpmOut
=
Buried
.
connectDpm
(
110
,
11
,
1
);
// 点击埋点
let
prizeDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
prizeExposure
=
Buried
.
createExposure
(
prizeDpmOut
,
prizeDcmOut
);
let
share2DpmOut
=
Buried
.
connectDpm
(
110
,
18
,
1
);
// 点击埋点
let
share2DcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
share2Exposure
=
Buried
.
createExposure
(
share2DpmOut
,
share2DcmOut
);
PanelCtrl
.
instance
.
btnAni
(
this
.
shareBtn
);
PanelCtrl
.
instance
.
btnAni
(
this
.
prizeBtn
);
this
.
map
=
new
MapComponent
();
this
.
mapGroup
.
addChild
(
this
.
map
);
if
(
NetPromise
.
ins
.
catchAdcode
){
setTimeout
(()
=>
{
this
.
map
.
showPoint
(
NetPromise
.
ins
.
catchAdcode
)
},
500
)
NetPromise
.
ins
.
catchAdcode
=
null
;
}
//中间地图信息待定(不是我做啦啦啦啦啦)
if
(
this
.
mdata
){
if
(
this
.
mdata
.
total
){
if
(
this
.
mdata
.
total
==
0
){
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
else
{
this
.
prizeBtn
.
visible
=
false
;
NetManager
.
ins
.
showLog
(
this
.
share2Exposure
);
}
}
else
{
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
}
else
{
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
this
.
lab
.
alpha
=
0
;
egret
.
Tween
.
get
(
this
.
lab
)
.
set
({
alpha
:
0
,
y
:
600
})
.
to
({
alpha
:
1
,
y
:
640
},
500
)
}
onTap_backBtn
(){
let
data
;
if
(
ChoseCityPanel
.
instance
){
data
=
ChoseCityPanel
.
instance
.
adcodedata
}
else
{
data
=
DataManager
.
ins
.
getData
(
NetName
.
joinInfo
).
data
;
}
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
GAME_SCENE
,
data
);
}
onTap_shareBtn
(){
if
(
this
.
mdata
){
if
(
this
.
mdata
.
total
==
1
){
NetManager
.
ins
.
clickLog
(
this
.
share2Exposure
);
}
else
{
NetManager
.
ins
.
clickLog
(
this
.
shareExposure
);
}
}
else
{
NetManager
.
ins
.
clickLog
(
this
.
shareExposure
);
}
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
SHARE_PANEL
);
}
onTap_prizeBtn
(){
NetManager
.
ins
.
clickLog
(
this
.
prizeExposure
);
PanelCtrl
.
instance
.
btnDelay
(
this
.
prizeBtn
);
NetPromise
.
ins
.
getPrize
()
.
then
(()
=>
{
this
.
prizeBtn
.
visible
=
false
;
let
data
=
DataManager
.
ins
.
getData
(
NetName
.
getPrize
).
data
;
if
(
data
){
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PRIZE_PANEL
,
data
);
}
else
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NOPRIZE_PANEL
);
}
})
.
catch
(()
=>
{
// PanelCtrl.instance.show(ModuleTypes.NOPRIZE_PANEL);
})
}
}
\ No newline at end of file
.history/egret/src/EndScene/ShareScene_20200225165850.ts
0 → 100644
View file @
993dfeee
import
Scene
from
"../views/Scene"
;
import
{
MapComponent
}
from
"../components/mapComponent"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
{
NetPromise
}
from
"../NetPromise"
;
import
ChoseCityPanel
from
"../choseScene/ChoseCityPanel"
;
import
{
Buried
}
from
"../../libs/tw/util/Buried"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
export
default
class
ShareScene
extends
Scene
{
public
bg
:
eui
.
Group
;
public
backBtn
:
eui
.
Button
;
public
shareBtn
:
eui
.
Button
;
public
prizeBtn
:
eui
.
Button
;
public
mapGroup
:
eui
.
Group
;
public
lab
:
eui
.
Label
;
private
showExposure
:
any
;
private
shareExposure
:
any
;
private
share2Exposure
:
any
;
private
prizeExposure
:
any
;
private
mdata
:
any
;
public
get
skinKey
()
{
return
'ShareScene'
}
public
get
groupName
()
{
return
'share_scene'
}
constructor
(
data
?)
{
super
(
data
);
this
.
mdata
=
data
;
}
initEvents
()
{
// this.timer.addEventListener(egret.TimerEvent.TIMER, this.ontimer, this);
// this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_startBtn, this);
// this.clickGroup.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onMainTap, this);
this
.
backBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_backBtn
,
this
);
this
.
shareBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shareBtn
,
this
);
this
.
prizeBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_prizeBtn
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
// this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_startBtn, this);
// this.clickGroup.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onMainTap, this);
// this.timer.removeEventListener(egret.TimerEvent.TIMER, this.ontimer, this);
// this.timer.stop();//停止倒计时
this
.
backBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_backBtn
,
this
);
this
.
shareBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shareBtn
,
this
);
this
.
prizeBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_prizeBtn
,
this
);
}
protected
onSkinComplete
():
void
{
super
.
onSkinComplete
();
// this.mainbg.texture = this.bgtexture;
this
.
once
(
egret
.
Event
.
ADDED_TO_STAGE
,
this
.
onLoad
,
this
);
if
(
this
.
stage
)
{
this
.
onLoad
();
}
}
private
bgtexture
:
egret
.
Texture
;
protected
async
preLoadRes
()
{
// var mcJson = await RES.getResAsync('xinxingAct_json');
// var mcImg = await RES.getResAsync('xinxingAct_png');
// var mcFactory = new egret.MovieClipDataFactory(mcJson, mcImg);
//this.xinxingAct = new egret.MovieClip(mcFactory.generateMovieClipData());
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
start
(
data
?)
{
super
.
start
(
data
);
// this.timer = new egret.Timer(1000);
this
.
percentHeight
=
100
;
}
private
onLoad
():
void
{
this
.
showAct
();
this
.
initUI
();
}
map
;
private
initUI
():
void
{
let
showDpmOut
=
Buried
.
connectDpm
(
110
,
12
,
1
);
// 点击埋点
let
showDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
showExposure
=
Buried
.
createExposure
(
showDpmOut
,
showDcmOut
);
NetManager
.
ins
.
showLog
(
this
.
showExposure
);
let
shareDpmOut
=
Buried
.
connectDpm
(
110
,
10
,
1
);
// 点击埋点
let
shareDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
shareExposure
=
Buried
.
createExposure
(
shareDpmOut
,
shareDcmOut
);
let
prizeDpmOut
=
Buried
.
connectDpm
(
110
,
11
,
1
);
// 点击埋点
let
prizeDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
prizeExposure
=
Buried
.
createExposure
(
prizeDpmOut
,
prizeDcmOut
);
let
share2DpmOut
=
Buried
.
connectDpm
(
110
,
18
,
1
);
// 点击埋点
let
share2DcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
share2Exposure
=
Buried
.
createExposure
(
share2DpmOut
,
share2DcmOut
);
PanelCtrl
.
instance
.
btnAni
(
this
.
shareBtn
);
PanelCtrl
.
instance
.
btnAni
(
this
.
prizeBtn
);
this
.
map
=
new
MapComponent
();
this
.
mapGroup
.
addChild
(
this
.
map
);
if
(
NetPromise
.
ins
.
catchAdcode
){
// setTimeout(()=>{
this
.
map
.
showPoint
(
NetPromise
.
ins
.
catchAdcode
)
// },500)
NetPromise
.
ins
.
catchAdcode
=
null
;
}
//中间地图信息待定(不是我做啦啦啦啦啦)
if
(
this
.
mdata
){
if
(
this
.
mdata
.
total
){
if
(
this
.
mdata
.
total
==
0
){
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
else
{
this
.
prizeBtn
.
visible
=
false
;
NetManager
.
ins
.
showLog
(
this
.
share2Exposure
);
}
}
else
{
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
}
else
{
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
this
.
lab
.
alpha
=
0
;
egret
.
Tween
.
get
(
this
.
lab
)
.
set
({
alpha
:
0
,
y
:
600
})
.
to
({
alpha
:
1
,
y
:
640
},
500
)
}
onTap_backBtn
(){
let
data
;
if
(
ChoseCityPanel
.
instance
){
data
=
ChoseCityPanel
.
instance
.
adcodedata
}
else
{
data
=
DataManager
.
ins
.
getData
(
NetName
.
joinInfo
).
data
;
}
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
GAME_SCENE
,
data
);
}
onTap_shareBtn
(){
if
(
this
.
mdata
){
if
(
this
.
mdata
.
total
==
1
){
NetManager
.
ins
.
clickLog
(
this
.
share2Exposure
);
}
else
{
NetManager
.
ins
.
clickLog
(
this
.
shareExposure
);
}
}
else
{
NetManager
.
ins
.
clickLog
(
this
.
shareExposure
);
}
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
SHARE_PANEL
);
}
onTap_prizeBtn
(){
NetManager
.
ins
.
clickLog
(
this
.
prizeExposure
);
PanelCtrl
.
instance
.
btnDelay
(
this
.
prizeBtn
);
NetPromise
.
ins
.
getPrize
()
.
then
(()
=>
{
this
.
prizeBtn
.
visible
=
false
;
let
data
=
DataManager
.
ins
.
getData
(
NetName
.
getPrize
).
data
;
if
(
data
){
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PRIZE_PANEL
,
data
);
}
else
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NOPRIZE_PANEL
);
}
})
.
catch
(()
=>
{
// PanelCtrl.instance.show(ModuleTypes.NOPRIZE_PANEL);
})
}
}
\ No newline at end of file
.history/egret/src/EndScene/ShareScene_20200225170530.ts
0 → 100644
View file @
993dfeee
import
Scene
from
"../views/Scene"
;
import
{
MapComponent
}
from
"../components/mapComponent"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
{
NetPromise
}
from
"../NetPromise"
;
import
ChoseCityPanel
from
"../choseScene/ChoseCityPanel"
;
import
{
Buried
}
from
"../../libs/tw/util/Buried"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
export
default
class
ShareScene
extends
Scene
{
public
bg
:
eui
.
Group
;
public
backBtn
:
eui
.
Button
;
public
shareBtn
:
eui
.
Button
;
public
prizeBtn
:
eui
.
Button
;
public
mapGroup
:
eui
.
Group
;
public
lab
:
eui
.
Label
;
private
showExposure
:
any
;
private
shareExposure
:
any
;
private
share2Exposure
:
any
;
private
prizeExposure
:
any
;
private
mdata
:
any
;
public
get
skinKey
()
{
return
'ShareScene'
}
public
get
groupName
()
{
return
'share_scene'
}
constructor
(
data
?)
{
super
(
data
);
this
.
mdata
=
data
;
}
initEvents
()
{
// this.timer.addEventListener(egret.TimerEvent.TIMER, this.ontimer, this);
// this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_startBtn, this);
// this.clickGroup.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onMainTap, this);
this
.
backBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_backBtn
,
this
);
this
.
shareBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shareBtn
,
this
);
this
.
prizeBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_prizeBtn
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
// this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_startBtn, this);
// this.clickGroup.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onMainTap, this);
// this.timer.removeEventListener(egret.TimerEvent.TIMER, this.ontimer, this);
// this.timer.stop();//停止倒计时
this
.
backBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_backBtn
,
this
);
this
.
shareBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shareBtn
,
this
);
this
.
prizeBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_prizeBtn
,
this
);
this
.
mapGroup
.
removeChild
(
this
.
map
);
}
protected
onSkinComplete
():
void
{
super
.
onSkinComplete
();
// this.mainbg.texture = this.bgtexture;
this
.
once
(
egret
.
Event
.
ADDED_TO_STAGE
,
this
.
onLoad
,
this
);
if
(
this
.
stage
)
{
this
.
onLoad
();
}
}
private
bgtexture
:
egret
.
Texture
;
protected
async
preLoadRes
()
{
// var mcJson = await RES.getResAsync('xinxingAct_json');
// var mcImg = await RES.getResAsync('xinxingAct_png');
// var mcFactory = new egret.MovieClipDataFactory(mcJson, mcImg);
//this.xinxingAct = new egret.MovieClip(mcFactory.generateMovieClipData());
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
start
(
data
?)
{
super
.
start
(
data
);
// this.timer = new egret.Timer(1000);
this
.
percentHeight
=
100
;
}
private
onLoad
():
void
{
this
.
showAct
();
this
.
initUI
();
}
map
;
private
initUI
():
void
{
let
showDpmOut
=
Buried
.
connectDpm
(
110
,
12
,
1
);
// 点击埋点
let
showDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
showExposure
=
Buried
.
createExposure
(
showDpmOut
,
showDcmOut
);
NetManager
.
ins
.
showLog
(
this
.
showExposure
);
let
shareDpmOut
=
Buried
.
connectDpm
(
110
,
10
,
1
);
// 点击埋点
let
shareDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
shareExposure
=
Buried
.
createExposure
(
shareDpmOut
,
shareDcmOut
);
let
prizeDpmOut
=
Buried
.
connectDpm
(
110
,
11
,
1
);
// 点击埋点
let
prizeDcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
prizeExposure
=
Buried
.
createExposure
(
prizeDpmOut
,
prizeDcmOut
);
let
share2DpmOut
=
Buried
.
connectDpm
(
110
,
18
,
1
);
// 点击埋点
let
share2DcmOut
=
Buried
.
connectDcm
(
202
,
0
,
0
);
// 曝光埋点
this
.
share2Exposure
=
Buried
.
createExposure
(
share2DpmOut
,
share2DcmOut
);
PanelCtrl
.
instance
.
btnAni
(
this
.
shareBtn
);
PanelCtrl
.
instance
.
btnAni
(
this
.
prizeBtn
);
this
.
map
=
new
MapComponent
();
this
.
mapGroup
.
addChild
(
this
.
map
);
if
(
NetPromise
.
ins
.
catchAdcode
){
// setTimeout(()=>{
this
.
map
.
showPoint
(
NetPromise
.
ins
.
catchAdcode
)
// },500)
NetPromise
.
ins
.
catchAdcode
=
null
;
}
//中间地图信息待定(不是我做啦啦啦啦啦)
if
(
this
.
mdata
){
if
(
this
.
mdata
.
total
){
if
(
this
.
mdata
.
total
==
0
){
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
else
{
this
.
prizeBtn
.
visible
=
false
;
NetManager
.
ins
.
showLog
(
this
.
share2Exposure
);
}
}
else
{
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
}
else
{
this
.
prizeBtn
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
this
.
prizeExposure
);
NetManager
.
ins
.
showLog
(
this
.
shareExposure
);
}
this
.
lab
.
alpha
=
0
;
egret
.
Tween
.
get
(
this
.
lab
)
.
set
({
alpha
:
0
,
y
:
600
})
.
to
({
alpha
:
1
,
y
:
640
},
500
)
}
onTap_backBtn
(){
let
data
;
if
(
ChoseCityPanel
.
instance
){
data
=
ChoseCityPanel
.
instance
.
adcodedata
}
else
{
data
=
DataManager
.
ins
.
getData
(
NetName
.
joinInfo
).
data
;
}
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
GAME_SCENE
,
data
);
}
onTap_shareBtn
(){
if
(
this
.
mdata
){
if
(
this
.
mdata
.
total
==
1
){
NetManager
.
ins
.
clickLog
(
this
.
share2Exposure
);
}
else
{
NetManager
.
ins
.
clickLog
(
this
.
shareExposure
);
}
}
else
{
NetManager
.
ins
.
clickLog
(
this
.
shareExposure
);
}
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
SHARE_PANEL
);
}
onTap_prizeBtn
(){
NetManager
.
ins
.
clickLog
(
this
.
prizeExposure
);
PanelCtrl
.
instance
.
btnDelay
(
this
.
prizeBtn
);
NetPromise
.
ins
.
getPrize
()
.
then
(()
=>
{
this
.
prizeBtn
.
visible
=
false
;
let
data
=
DataManager
.
ins
.
getData
(
NetName
.
getPrize
).
data
;
if
(
data
){
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PRIZE_PANEL
,
data
);
}
else
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NOPRIZE_PANEL
);
}
})
.
catch
(()
=>
{
// PanelCtrl.instance.show(ModuleTypes.NOPRIZE_PANEL);
})
}
}
\ No newline at end of file
.history/egret/src/components/MapComponent_20200225170107.ts
0 → 100644
View file @
993dfeee
import
{
LightComponent
}
from
"./LightComponent"
;
import
{
NetPromise
}
from
"../NetPromise"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
Loading
from
"../loading/Loading"
;
export
class
MapComponent
extends
eui
.
Component
{
public
bg
:
eui
.
Image
;
public
mapList
:
eui
.
Group
;
public
z_650000
:
eui
.
Rect
;
public
z_620000
:
eui
.
Rect
;
public
z_630000
:
eui
.
Rect
;
public
z_540000
:
eui
.
Rect
;
public
z_510000
:
eui
.
Rect
;
public
z_530000
:
eui
.
Rect
;
public
z_520000
:
eui
.
Rect
;
public
z_450000
:
eui
.
Rect
;
public
z_440000
:
eui
.
Rect
;
public
z_810000
:
eui
.
Rect
;
public
z_820000
:
eui
.
Rect
;
public
z_460000
:
eui
.
Rect
;
public
z_710000
:
eui
.
Rect
;
public
z_360000
:
eui
.
Rect
;
public
z_350000
:
eui
.
Rect
;
public
z_330000
:
eui
.
Rect
;
public
z_310000
:
eui
.
Rect
;
public
z_320000
:
eui
.
Rect
;
public
z_370000
:
eui
.
Rect
;
public
z_130000
:
eui
.
Rect
;
public
z_120000
:
eui
.
Rect
;
public
z_110000
:
eui
.
Rect
;
public
z_210000
:
eui
.
Rect
;
public
z_220000
:
eui
.
Rect
;
public
z_230000
:
eui
.
Rect
;
public
z_340000
:
eui
.
Rect
;
public
z_430000
:
eui
.
Rect
;
public
z_500000
:
eui
.
Rect
;
public
z_610000
:
eui
.
Rect
;
public
z_640000
:
eui
.
Rect
;
public
z_150000
:
eui
.
Rect
;
public
z_140000
:
eui
.
Rect
;
public
z_410000
:
eui
.
Rect
;
public
z_420000
:
eui
.
Rect
;
public
pointBg
:
eui
.
Rect
;
//点击收取回调
private
clickCallBack
:
Function
;
/**
*
*/
constructor
(
callBack
:
Function
=
null
)
{
super
();
this
.
skinName
=
'resource/skins/item/mapSkin.exml'
;
this
.
clickCallBack
=
callBack
;
this
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
// GDispatcher.addEvent("showpoint",(adcodedata)=>{
// console.log("adcodedata")
// console.log(adcodedata)
// setTimeout((adcode)=>{
// localStorage.adcode=adcodedata.adcode
// this.showPoint()
// },2000)
// },this)
//alert("")
if
(
this
.
skin
)
{
this
.
onSkinComplete
();
}
}
lightList
=
[]
lightListData
=
[]
doLight
showPoint
(
adcode
){
console
.
log
(
"adcode"
)
console
.
log
(
adcode
+
""
)
let
parentAdcode
=
(
adcode
+
""
).
slice
(
0
,
2
)
+
"0000"
this
.
pointBg
.
visible
=
true
;
if
(
this
.
doLight
){
this
.
removeChild
(
this
.
doLight
)
}
this
.
doLight
=
this
.
LoadClip
(
"https://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga"
)
.
then
((
lightStar
)
=>
{
this
.
lightStar
=
lightStar
this
.
lightStar
.
visible
=
true
;
console
.
log
(
`z_
${
parentAdcode
}
`
)
console
.
log
(
this
[
`z_
${
parentAdcode
}
`
])
this
.
lightStar
.
anchorOffsetX
=
300
/
2
this
.
lightStar
.
anchorOffsetY
=
300
/
2
this
.
lightStar
.
x
=
this
[
`z_
${
parentAdcode
}
`
].
x
;
this
.
lightStar
.
y
=
this
[
`z_
${
parentAdcode
}
`
].
y
;
this
.
lightStar
.
startAniRange
()
let
fun
this
.
lightStar
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
fun
=
()
=>
{
this
.
lightStar
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
fun
,
this
)
this
.
pointBg
.
visible
=
false
;
// this.lightStar.gotoAndStop(0, 1)
// this.lightStar.visible=false;
},
this
)
})
.
catch
(()
=>
{
})
// NetPromise.ins.lightStar.visible = true;
// NetPromise.ins.lightStar.gotoAndPlay(0, true)
// this.LoadClip("http://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga")
// .then((lightStar)=>{
// //lightStar["x"]=this[`z_${parentAdcode}`].x;
// //lightStar["y"]=this[`z_${parentAdcode}`].y;
// })
// .catch(()=>{
// })
}
LoadClip
(
url
)
{
return
new
Promise
((
resolev
,
reject
)
=>
{
var
parser
=
new
window
[
"SVGA"
].
Parser
();
parser
.
load
(
url
,
(
videoItem
)
=>
{
let
pet
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
// pet.visible = false;
// this.petBodyGroup.addChild(pet);
this
.
addChild
(
pet
)
resolev
(
pet
)
},
(
error
)
=>
{
reject
(
error
);
})
})
}
lightStar
private
onSkinComplete
():
void
{
//if(!this.lightStar){
// this.LoadClip("http://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga")
// .then((lightStar)=>{
// this.lightStar=lightStar
// })
// .catch(()=>{
// })
//}
this
.
pointBg
.
visible
=
false
;
console
.
log
(
this
.
mapList
)
for
(
let
i
=
0
;
i
<
this
.
mapList
.
$children
.
length
;
i
++
){
this
.
mapList
.
$children
[
i
].
visible
=
false
;
}
if
(
this
.
lightList
){
for
(
let
i
=
0
;
i
<
this
.
lightList
.
length
;
i
++
){
this
.
removeChild
(
this
.
lightList
[
i
]);
}
}
NetPromise
.
ins
.
mapInfo
()
.
then
(()
=>
{
this
.
lightListData
=
DataManager
.
ins
.
getData
(
NetName
.
mapInfo
).
data
;
for
(
let
i
=
0
;
i
<
this
.
lightListData
.
length
;
i
++
){
//一共5个等级,50以内,50-100,100-500,500-2000,2000以上
let
lv
=
0
if
(
this
.
lightListData
[
i
].
count
>
0
&&
this
.
lightListData
[
i
].
count
<
50
){
lv
=
1
}
else
if
(
this
.
lightListData
[
i
].
count
>=
50
&&
this
.
lightListData
[
i
].
count
<
100
){
lv
=
2
}
else
if
(
this
.
lightListData
[
i
].
count
>=
100
&&
this
.
lightListData
[
i
].
count
<
500
){
lv
=
3
}
else
if
(
this
.
lightListData
[
i
].
count
>=
500
&&
this
.
lightListData
[
i
].
count
<
2000
){
lv
=
4
}
else
if
(
this
.
lightListData
[
i
].
count
>=
2000
){
lv
=
5
}
if
(
this
.
lightListData
[
i
].
adcode
==
"150000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
138
,
20
,
0
,
60
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"460000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
48
,
48
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"710000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"330000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"310000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"450000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"820000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"810000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"320000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"370000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"120000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"130000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
{
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
100
,
100
,
0
,
0
);
}
this
.
addChild
(
this
.
lightList
[
i
]);
this
.
lightList
[
i
].
x
=
this
[
`z_
${
this
.
lightListData
[
i
].
adcode
}
`
].
x
+
this
.
mapList
.
x
;
this
.
lightList
[
i
].
anchorOffsetX
=
this
.
lightList
[
i
].
width
/
2
this
.
lightList
[
i
].
anchorOffsetY
=
this
.
lightList
[
i
].
width
/
2
this
.
lightList
[
i
].
y
=
this
[
`z_
${
this
.
lightListData
[
i
].
adcode
}
`
].
y
+
this
.
mapList
.
y
;
}
console
.
log
(
DataManager
.
ins
.
getData
(
NetName
.
mapInfo
))
this
.
addChild
(
this
.
bg
)
this
.
addChild
(
this
.
pointBg
)
})
.
catch
(()
=>
{
})
this
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
}
public
removeEvent
():
void
{
}
private
onClick
():
void
{
if
(
this
.
clickCallBack
)
{
this
.
clickCallBack
(
this
);
}
}
public
playAct
(
start
:
number
=
0
):
void
{
}
public
stopAct
():
void
{
// this.act.stop();
}
}
\ No newline at end of file
.history/egret/src/components/MapComponent_20200225170202.ts
0 → 100644
View file @
993dfeee
import
{
LightComponent
}
from
"./LightComponent"
;
import
{
NetPromise
}
from
"../NetPromise"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
Loading
from
"../loading/Loading"
;
export
class
MapComponent
extends
eui
.
Component
{
public
bg
:
eui
.
Image
;
public
mapList
:
eui
.
Group
;
public
z_650000
:
eui
.
Rect
;
public
z_620000
:
eui
.
Rect
;
public
z_630000
:
eui
.
Rect
;
public
z_540000
:
eui
.
Rect
;
public
z_510000
:
eui
.
Rect
;
public
z_530000
:
eui
.
Rect
;
public
z_520000
:
eui
.
Rect
;
public
z_450000
:
eui
.
Rect
;
public
z_440000
:
eui
.
Rect
;
public
z_810000
:
eui
.
Rect
;
public
z_820000
:
eui
.
Rect
;
public
z_460000
:
eui
.
Rect
;
public
z_710000
:
eui
.
Rect
;
public
z_360000
:
eui
.
Rect
;
public
z_350000
:
eui
.
Rect
;
public
z_330000
:
eui
.
Rect
;
public
z_310000
:
eui
.
Rect
;
public
z_320000
:
eui
.
Rect
;
public
z_370000
:
eui
.
Rect
;
public
z_130000
:
eui
.
Rect
;
public
z_120000
:
eui
.
Rect
;
public
z_110000
:
eui
.
Rect
;
public
z_210000
:
eui
.
Rect
;
public
z_220000
:
eui
.
Rect
;
public
z_230000
:
eui
.
Rect
;
public
z_340000
:
eui
.
Rect
;
public
z_430000
:
eui
.
Rect
;
public
z_500000
:
eui
.
Rect
;
public
z_610000
:
eui
.
Rect
;
public
z_640000
:
eui
.
Rect
;
public
z_150000
:
eui
.
Rect
;
public
z_140000
:
eui
.
Rect
;
public
z_410000
:
eui
.
Rect
;
public
z_420000
:
eui
.
Rect
;
public
pointBg
:
eui
.
Rect
;
//点击收取回调
private
clickCallBack
:
Function
;
/**
*
*/
constructor
(
callBack
:
Function
=
null
)
{
super
();
this
.
skinName
=
'resource/skins/item/mapSkin.exml'
;
this
.
clickCallBack
=
callBack
;
this
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
// GDispatcher.addEvent("showpoint",(adcodedata)=>{
// console.log("adcodedata")
// console.log(adcodedata)
// setTimeout((adcode)=>{
// localStorage.adcode=adcodedata.adcode
// this.showPoint()
// },2000)
// },this)
//alert("")
if
(
this
.
skin
)
{
this
.
onSkinComplete
();
}
}
lightList
=
[]
lightListData
=
[]
doLight
showPoint
(
adcode
){
console
.
log
(
"adcode"
)
console
.
log
(
adcode
+
""
)
let
parentAdcode
=
(
adcode
+
""
).
slice
(
0
,
2
)
+
"0000"
this
.
pointBg
.
visible
=
true
;
if
(
this
.
doLight
){
console
.
log
(
"移除svga"
)
this
.
removeChild
(
this
.
doLight
)
}
this
.
doLight
=
this
.
LoadClip
(
"https://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga"
)
.
then
((
lightStar
)
=>
{
this
.
lightStar
=
lightStar
this
.
lightStar
.
visible
=
true
;
console
.
log
(
`z_
${
parentAdcode
}
`
)
console
.
log
(
this
[
`z_
${
parentAdcode
}
`
])
this
.
lightStar
.
anchorOffsetX
=
300
/
2
this
.
lightStar
.
anchorOffsetY
=
300
/
2
this
.
lightStar
.
x
=
this
[
`z_
${
parentAdcode
}
`
].
x
;
this
.
lightStar
.
y
=
this
[
`z_
${
parentAdcode
}
`
].
y
;
this
.
lightStar
.
startAniRange
()
let
fun
this
.
lightStar
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
fun
=
()
=>
{
this
.
lightStar
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
fun
,
this
)
this
.
pointBg
.
visible
=
false
;
// this.lightStar.gotoAndStop(0, 1)
// this.lightStar.visible=false;
},
this
)
})
.
catch
(()
=>
{
})
// NetPromise.ins.lightStar.visible = true;
// NetPromise.ins.lightStar.gotoAndPlay(0, true)
// this.LoadClip("http://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga")
// .then((lightStar)=>{
// //lightStar["x"]=this[`z_${parentAdcode}`].x;
// //lightStar["y"]=this[`z_${parentAdcode}`].y;
// })
// .catch(()=>{
// })
}
LoadClip
(
url
)
{
return
new
Promise
((
resolev
,
reject
)
=>
{
var
parser
=
new
window
[
"SVGA"
].
Parser
();
parser
.
load
(
url
,
(
videoItem
)
=>
{
let
pet
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
// pet.visible = false;
// this.petBodyGroup.addChild(pet);
this
.
addChild
(
pet
)
resolev
(
pet
)
},
(
error
)
=>
{
reject
(
error
);
})
})
}
lightStar
private
onSkinComplete
():
void
{
//if(!this.lightStar){
// this.LoadClip("http://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga")
// .then((lightStar)=>{
// this.lightStar=lightStar
// })
// .catch(()=>{
// })
//}
this
.
pointBg
.
visible
=
false
;
console
.
log
(
this
.
mapList
)
for
(
let
i
=
0
;
i
<
this
.
mapList
.
$children
.
length
;
i
++
){
this
.
mapList
.
$children
[
i
].
visible
=
false
;
}
if
(
this
.
lightList
){
for
(
let
i
=
0
;
i
<
this
.
lightList
.
length
;
i
++
){
this
.
removeChild
(
this
.
lightList
[
i
]);
}
}
NetPromise
.
ins
.
mapInfo
()
.
then
(()
=>
{
this
.
lightListData
=
DataManager
.
ins
.
getData
(
NetName
.
mapInfo
).
data
;
for
(
let
i
=
0
;
i
<
this
.
lightListData
.
length
;
i
++
){
//一共5个等级,50以内,50-100,100-500,500-2000,2000以上
let
lv
=
0
if
(
this
.
lightListData
[
i
].
count
>
0
&&
this
.
lightListData
[
i
].
count
<
50
){
lv
=
1
}
else
if
(
this
.
lightListData
[
i
].
count
>=
50
&&
this
.
lightListData
[
i
].
count
<
100
){
lv
=
2
}
else
if
(
this
.
lightListData
[
i
].
count
>=
100
&&
this
.
lightListData
[
i
].
count
<
500
){
lv
=
3
}
else
if
(
this
.
lightListData
[
i
].
count
>=
500
&&
this
.
lightListData
[
i
].
count
<
2000
){
lv
=
4
}
else
if
(
this
.
lightListData
[
i
].
count
>=
2000
){
lv
=
5
}
if
(
this
.
lightListData
[
i
].
adcode
==
"150000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
138
,
20
,
0
,
60
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"460000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
48
,
48
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"710000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"330000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"310000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"450000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"820000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"810000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"320000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"370000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"120000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"130000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
{
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
100
,
100
,
0
,
0
);
}
this
.
addChild
(
this
.
lightList
[
i
]);
this
.
lightList
[
i
].
x
=
this
[
`z_
${
this
.
lightListData
[
i
].
adcode
}
`
].
x
+
this
.
mapList
.
x
;
this
.
lightList
[
i
].
anchorOffsetX
=
this
.
lightList
[
i
].
width
/
2
this
.
lightList
[
i
].
anchorOffsetY
=
this
.
lightList
[
i
].
width
/
2
this
.
lightList
[
i
].
y
=
this
[
`z_
${
this
.
lightListData
[
i
].
adcode
}
`
].
y
+
this
.
mapList
.
y
;
}
console
.
log
(
DataManager
.
ins
.
getData
(
NetName
.
mapInfo
))
this
.
addChild
(
this
.
bg
)
this
.
addChild
(
this
.
pointBg
)
})
.
catch
(()
=>
{
})
this
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
}
public
removeEvent
():
void
{
}
private
onClick
():
void
{
if
(
this
.
clickCallBack
)
{
this
.
clickCallBack
(
this
);
}
}
public
playAct
(
start
:
number
=
0
):
void
{
}
public
stopAct
():
void
{
// this.act.stop();
}
}
\ No newline at end of file
.history/egret/src/components/MapComponent_20200225170338.ts
0 → 100644
View file @
993dfeee
import
{
LightComponent
}
from
"./LightComponent"
;
import
{
NetPromise
}
from
"../NetPromise"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
Loading
from
"../loading/Loading"
;
export
class
MapComponent
extends
eui
.
Component
{
public
bg
:
eui
.
Image
;
public
mapList
:
eui
.
Group
;
public
z_650000
:
eui
.
Rect
;
public
z_620000
:
eui
.
Rect
;
public
z_630000
:
eui
.
Rect
;
public
z_540000
:
eui
.
Rect
;
public
z_510000
:
eui
.
Rect
;
public
z_530000
:
eui
.
Rect
;
public
z_520000
:
eui
.
Rect
;
public
z_450000
:
eui
.
Rect
;
public
z_440000
:
eui
.
Rect
;
public
z_810000
:
eui
.
Rect
;
public
z_820000
:
eui
.
Rect
;
public
z_460000
:
eui
.
Rect
;
public
z_710000
:
eui
.
Rect
;
public
z_360000
:
eui
.
Rect
;
public
z_350000
:
eui
.
Rect
;
public
z_330000
:
eui
.
Rect
;
public
z_310000
:
eui
.
Rect
;
public
z_320000
:
eui
.
Rect
;
public
z_370000
:
eui
.
Rect
;
public
z_130000
:
eui
.
Rect
;
public
z_120000
:
eui
.
Rect
;
public
z_110000
:
eui
.
Rect
;
public
z_210000
:
eui
.
Rect
;
public
z_220000
:
eui
.
Rect
;
public
z_230000
:
eui
.
Rect
;
public
z_340000
:
eui
.
Rect
;
public
z_430000
:
eui
.
Rect
;
public
z_500000
:
eui
.
Rect
;
public
z_610000
:
eui
.
Rect
;
public
z_640000
:
eui
.
Rect
;
public
z_150000
:
eui
.
Rect
;
public
z_140000
:
eui
.
Rect
;
public
z_410000
:
eui
.
Rect
;
public
z_420000
:
eui
.
Rect
;
public
pointBg
:
eui
.
Rect
;
//点击收取回调
private
clickCallBack
:
Function
;
/**
*
*/
constructor
(
callBack
:
Function
=
null
)
{
super
();
this
.
skinName
=
'resource/skins/item/mapSkin.exml'
;
this
.
clickCallBack
=
callBack
;
this
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
// GDispatcher.addEvent("showpoint",(adcodedata)=>{
// console.log("adcodedata")
// console.log(adcodedata)
// setTimeout((adcode)=>{
// localStorage.adcode=adcodedata.adcode
// this.showPoint()
// },2000)
// },this)
//alert("")
if
(
this
.
skin
)
{
this
.
onSkinComplete
();
}
}
lightList
=
[]
lightListData
=
[]
doLight
showPoint
(
adcode
){
console
.
log
(
"adcode"
)
console
.
log
(
adcode
+
""
)
let
parentAdcode
=
(
adcode
+
""
).
slice
(
0
,
2
)
+
"0000"
this
.
pointBg
.
visible
=
true
;
if
(
this
.
doLight
){
console
.
log
(
"移除svga"
)
this
.
removeChild
(
this
.
doLight
)
}
this
.
doLight
=
this
.
LoadClip
(
"https://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga"
)
.
then
((
lightStar
)
=>
{
this
.
addChild
(
this
.
doLight
)
this
.
lightStar
=
lightStar
this
.
lightStar
.
visible
=
true
;
console
.
log
(
`z_
${
parentAdcode
}
`
)
console
.
log
(
this
[
`z_
${
parentAdcode
}
`
])
this
.
lightStar
.
anchorOffsetX
=
300
/
2
this
.
lightStar
.
anchorOffsetY
=
300
/
2
this
.
lightStar
.
x
=
this
[
`z_
${
parentAdcode
}
`
].
x
;
this
.
lightStar
.
y
=
this
[
`z_
${
parentAdcode
}
`
].
y
;
this
.
lightStar
.
startAniRange
()
let
fun
this
.
lightStar
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
fun
=
()
=>
{
this
.
lightStar
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
fun
,
this
)
this
.
pointBg
.
visible
=
false
;
// this.lightStar.gotoAndStop(0, 1)
// this.lightStar.visible=false;
},
this
)
})
.
catch
(()
=>
{
})
// NetPromise.ins.lightStar.visible = true;
// NetPromise.ins.lightStar.gotoAndPlay(0, true)
// this.LoadClip("http://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga")
// .then((lightStar)=>{
// //lightStar["x"]=this[`z_${parentAdcode}`].x;
// //lightStar["y"]=this[`z_${parentAdcode}`].y;
// })
// .catch(()=>{
// })
}
LoadClip
(
url
)
{
return
new
Promise
((
resolev
,
reject
)
=>
{
var
parser
=
new
window
[
"SVGA"
].
Parser
();
parser
.
load
(
url
,
(
videoItem
)
=>
{
let
pet
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
// pet.visible = false;
// this.petBodyGroup.addChild(pet);
// this.addChild(pet)
resolev
(
pet
)
},
(
error
)
=>
{
reject
(
error
);
})
})
}
lightStar
private
onSkinComplete
():
void
{
//if(!this.lightStar){
// this.LoadClip("http://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga")
// .then((lightStar)=>{
// this.lightStar=lightStar
// })
// .catch(()=>{
// })
//}
this
.
pointBg
.
visible
=
false
;
console
.
log
(
this
.
mapList
)
for
(
let
i
=
0
;
i
<
this
.
mapList
.
$children
.
length
;
i
++
){
this
.
mapList
.
$children
[
i
].
visible
=
false
;
}
if
(
this
.
lightList
){
for
(
let
i
=
0
;
i
<
this
.
lightList
.
length
;
i
++
){
this
.
removeChild
(
this
.
lightList
[
i
]);
}
}
NetPromise
.
ins
.
mapInfo
()
.
then
(()
=>
{
this
.
lightListData
=
DataManager
.
ins
.
getData
(
NetName
.
mapInfo
).
data
;
for
(
let
i
=
0
;
i
<
this
.
lightListData
.
length
;
i
++
){
//一共5个等级,50以内,50-100,100-500,500-2000,2000以上
let
lv
=
0
if
(
this
.
lightListData
[
i
].
count
>
0
&&
this
.
lightListData
[
i
].
count
<
50
){
lv
=
1
}
else
if
(
this
.
lightListData
[
i
].
count
>=
50
&&
this
.
lightListData
[
i
].
count
<
100
){
lv
=
2
}
else
if
(
this
.
lightListData
[
i
].
count
>=
100
&&
this
.
lightListData
[
i
].
count
<
500
){
lv
=
3
}
else
if
(
this
.
lightListData
[
i
].
count
>=
500
&&
this
.
lightListData
[
i
].
count
<
2000
){
lv
=
4
}
else
if
(
this
.
lightListData
[
i
].
count
>=
2000
){
lv
=
5
}
if
(
this
.
lightListData
[
i
].
adcode
==
"150000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
138
,
20
,
0
,
60
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"460000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
48
,
48
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"710000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"330000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"310000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"450000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"820000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"810000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"320000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"370000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"120000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"130000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
{
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
100
,
100
,
0
,
0
);
}
this
.
addChild
(
this
.
lightList
[
i
]);
this
.
lightList
[
i
].
x
=
this
[
`z_
${
this
.
lightListData
[
i
].
adcode
}
`
].
x
+
this
.
mapList
.
x
;
this
.
lightList
[
i
].
anchorOffsetX
=
this
.
lightList
[
i
].
width
/
2
this
.
lightList
[
i
].
anchorOffsetY
=
this
.
lightList
[
i
].
width
/
2
this
.
lightList
[
i
].
y
=
this
[
`z_
${
this
.
lightListData
[
i
].
adcode
}
`
].
y
+
this
.
mapList
.
y
;
}
console
.
log
(
DataManager
.
ins
.
getData
(
NetName
.
mapInfo
))
this
.
addChild
(
this
.
bg
)
this
.
addChild
(
this
.
pointBg
)
})
.
catch
(()
=>
{
})
this
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
}
public
removeEvent
():
void
{
}
private
onClick
():
void
{
if
(
this
.
clickCallBack
)
{
this
.
clickCallBack
(
this
);
}
}
public
playAct
(
start
:
number
=
0
):
void
{
}
public
stopAct
():
void
{
// this.act.stop();
}
}
\ No newline at end of file
.history/egret/src/components/MapComponent_20200225170425.ts
0 → 100644
View file @
993dfeee
import
{
LightComponent
}
from
"./LightComponent"
;
import
{
NetPromise
}
from
"../NetPromise"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
Loading
from
"../loading/Loading"
;
export
class
MapComponent
extends
eui
.
Component
{
public
bg
:
eui
.
Image
;
public
mapList
:
eui
.
Group
;
public
z_650000
:
eui
.
Rect
;
public
z_620000
:
eui
.
Rect
;
public
z_630000
:
eui
.
Rect
;
public
z_540000
:
eui
.
Rect
;
public
z_510000
:
eui
.
Rect
;
public
z_530000
:
eui
.
Rect
;
public
z_520000
:
eui
.
Rect
;
public
z_450000
:
eui
.
Rect
;
public
z_440000
:
eui
.
Rect
;
public
z_810000
:
eui
.
Rect
;
public
z_820000
:
eui
.
Rect
;
public
z_460000
:
eui
.
Rect
;
public
z_710000
:
eui
.
Rect
;
public
z_360000
:
eui
.
Rect
;
public
z_350000
:
eui
.
Rect
;
public
z_330000
:
eui
.
Rect
;
public
z_310000
:
eui
.
Rect
;
public
z_320000
:
eui
.
Rect
;
public
z_370000
:
eui
.
Rect
;
public
z_130000
:
eui
.
Rect
;
public
z_120000
:
eui
.
Rect
;
public
z_110000
:
eui
.
Rect
;
public
z_210000
:
eui
.
Rect
;
public
z_220000
:
eui
.
Rect
;
public
z_230000
:
eui
.
Rect
;
public
z_340000
:
eui
.
Rect
;
public
z_430000
:
eui
.
Rect
;
public
z_500000
:
eui
.
Rect
;
public
z_610000
:
eui
.
Rect
;
public
z_640000
:
eui
.
Rect
;
public
z_150000
:
eui
.
Rect
;
public
z_140000
:
eui
.
Rect
;
public
z_410000
:
eui
.
Rect
;
public
z_420000
:
eui
.
Rect
;
public
pointBg
:
eui
.
Rect
;
//点击收取回调
private
clickCallBack
:
Function
;
/**
*
*/
constructor
(
callBack
:
Function
=
null
)
{
super
();
this
.
skinName
=
'resource/skins/item/mapSkin.exml'
;
this
.
clickCallBack
=
callBack
;
this
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
// GDispatcher.addEvent("showpoint",(adcodedata)=>{
// console.log("adcodedata")
// console.log(adcodedata)
// setTimeout((adcode)=>{
// localStorage.adcode=adcodedata.adcode
// this.showPoint()
// },2000)
// },this)
//alert("")
if
(
this
.
skin
)
{
this
.
onSkinComplete
();
}
}
lightList
=
[]
lightListData
=
[]
doLight
showPoint
(
adcode
){
console
.
log
(
"adcode"
)
console
.
log
(
adcode
+
""
)
let
parentAdcode
=
(
adcode
+
""
).
slice
(
0
,
2
)
+
"0000"
this
.
pointBg
.
visible
=
true
;
if
(
this
.
lightStar
){
console
.
log
(
"移除svga"
)
this
.
removeChild
(
this
.
lightStar
)
}
this
.
doLight
=
this
.
LoadClip
(
"https://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga"
)
.
then
((
lightStar
)
=>
{
this
.
lightStar
=
lightStar
this
.
addChild
(
this
.
lightStar
)
this
.
lightStar
.
visible
=
true
;
console
.
log
(
`z_
${
parentAdcode
}
`
)
console
.
log
(
this
[
`z_
${
parentAdcode
}
`
])
this
.
lightStar
.
anchorOffsetX
=
300
/
2
this
.
lightStar
.
anchorOffsetY
=
300
/
2
this
.
lightStar
.
x
=
this
[
`z_
${
parentAdcode
}
`
].
x
;
this
.
lightStar
.
y
=
this
[
`z_
${
parentAdcode
}
`
].
y
;
this
.
lightStar
.
startAniRange
()
let
fun
this
.
lightStar
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
fun
=
()
=>
{
this
.
lightStar
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
fun
,
this
)
this
.
pointBg
.
visible
=
false
;
// this.lightStar.gotoAndStop(0, 1)
// this.lightStar.visible=false;
},
this
)
})
.
catch
(()
=>
{
})
// NetPromise.ins.lightStar.visible = true;
// NetPromise.ins.lightStar.gotoAndPlay(0, true)
// this.LoadClip("http://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga")
// .then((lightStar)=>{
// //lightStar["x"]=this[`z_${parentAdcode}`].x;
// //lightStar["y"]=this[`z_${parentAdcode}`].y;
// })
// .catch(()=>{
// })
}
LoadClip
(
url
)
{
return
new
Promise
((
resolev
,
reject
)
=>
{
var
parser
=
new
window
[
"SVGA"
].
Parser
();
parser
.
load
(
url
,
(
videoItem
)
=>
{
let
pet
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
// pet.visible = false;
// this.petBodyGroup.addChild(pet);
// this.addChild(pet)
resolev
(
pet
)
},
(
error
)
=>
{
reject
(
error
);
})
})
}
lightStar
private
onSkinComplete
():
void
{
//if(!this.lightStar){
// this.LoadClip("http://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga")
// .then((lightStar)=>{
// this.lightStar=lightStar
// })
// .catch(()=>{
// })
//}
this
.
pointBg
.
visible
=
false
;
console
.
log
(
this
.
mapList
)
for
(
let
i
=
0
;
i
<
this
.
mapList
.
$children
.
length
;
i
++
){
this
.
mapList
.
$children
[
i
].
visible
=
false
;
}
if
(
this
.
lightList
){
for
(
let
i
=
0
;
i
<
this
.
lightList
.
length
;
i
++
){
this
.
removeChild
(
this
.
lightList
[
i
]);
}
}
NetPromise
.
ins
.
mapInfo
()
.
then
(()
=>
{
this
.
lightListData
=
DataManager
.
ins
.
getData
(
NetName
.
mapInfo
).
data
;
for
(
let
i
=
0
;
i
<
this
.
lightListData
.
length
;
i
++
){
//一共5个等级,50以内,50-100,100-500,500-2000,2000以上
let
lv
=
0
if
(
this
.
lightListData
[
i
].
count
>
0
&&
this
.
lightListData
[
i
].
count
<
50
){
lv
=
1
}
else
if
(
this
.
lightListData
[
i
].
count
>=
50
&&
this
.
lightListData
[
i
].
count
<
100
){
lv
=
2
}
else
if
(
this
.
lightListData
[
i
].
count
>=
100
&&
this
.
lightListData
[
i
].
count
<
500
){
lv
=
3
}
else
if
(
this
.
lightListData
[
i
].
count
>=
500
&&
this
.
lightListData
[
i
].
count
<
2000
){
lv
=
4
}
else
if
(
this
.
lightListData
[
i
].
count
>=
2000
){
lv
=
5
}
if
(
this
.
lightListData
[
i
].
adcode
==
"150000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
138
,
20
,
0
,
60
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"460000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
48
,
48
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"710000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"330000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"310000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"450000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"820000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"810000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
40
,
40
,
20
,
20
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"320000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"370000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"120000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
if
(
this
.
lightListData
[
i
].
adcode
==
"130000"
){
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
60
,
60
,
30
,
30
);
}
else
{
this
.
lightList
[
i
]
=
new
LightComponent
(
lv
,
100
,
100
,
0
,
0
);
}
this
.
addChild
(
this
.
lightList
[
i
]);
this
.
lightList
[
i
].
x
=
this
[
`z_
${
this
.
lightListData
[
i
].
adcode
}
`
].
x
+
this
.
mapList
.
x
;
this
.
lightList
[
i
].
anchorOffsetX
=
this
.
lightList
[
i
].
width
/
2
this
.
lightList
[
i
].
anchorOffsetY
=
this
.
lightList
[
i
].
width
/
2
this
.
lightList
[
i
].
y
=
this
[
`z_
${
this
.
lightListData
[
i
].
adcode
}
`
].
y
+
this
.
mapList
.
y
;
}
console
.
log
(
DataManager
.
ins
.
getData
(
NetName
.
mapInfo
))
this
.
addChild
(
this
.
bg
)
this
.
addChild
(
this
.
pointBg
)
})
.
catch
(()
=>
{
})
this
.
removeEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
}
public
removeEvent
():
void
{
}
private
onClick
():
void
{
if
(
this
.
clickCallBack
)
{
this
.
clickCallBack
(
this
);
}
}
public
playAct
(
start
:
number
=
0
):
void
{
}
public
stopAct
():
void
{
// this.act.stop();
}
}
\ No newline at end of file
egret/src/EndScene/ShareScene.ts
View file @
993dfeee
...
@@ -53,6 +53,8 @@ export default class ShareScene extends Scene {
...
@@ -53,6 +53,8 @@ export default class ShareScene extends Scene {
this
.
backBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_backBtn
,
this
);
this
.
backBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_backBtn
,
this
);
this
.
shareBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shareBtn
,
this
);
this
.
shareBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shareBtn
,
this
);
this
.
prizeBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_prizeBtn
,
this
);
this
.
prizeBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_prizeBtn
,
this
);
this
.
mapGroup
.
removeChild
(
this
.
map
);
}
}
protected
onSkinComplete
():
void
{
protected
onSkinComplete
():
void
{
...
@@ -115,7 +117,9 @@ export default class ShareScene extends Scene {
...
@@ -115,7 +117,9 @@ export default class ShareScene extends Scene {
this
.
map
=
new
MapComponent
();
this
.
map
=
new
MapComponent
();
this
.
mapGroup
.
addChild
(
this
.
map
);
this
.
mapGroup
.
addChild
(
this
.
map
);
if
(
NetPromise
.
ins
.
catchAdcode
){
if
(
NetPromise
.
ins
.
catchAdcode
){
this
.
map
.
showPoint
(
NetPromise
.
ins
.
catchAdcode
)
// setTimeout(()=>{
this
.
map
.
showPoint
(
NetPromise
.
ins
.
catchAdcode
)
// },500)
NetPromise
.
ins
.
catchAdcode
=
null
;
NetPromise
.
ins
.
catchAdcode
=
null
;
}
}
//中间地图信息待定(不是我做啦啦啦啦啦)
//中间地图信息待定(不是我做啦啦啦啦啦)
...
...
egret/src/components/MapComponent.ts
View file @
993dfeee
...
@@ -76,15 +76,21 @@ export class MapComponent extends eui.Component {
...
@@ -76,15 +76,21 @@ export class MapComponent extends eui.Component {
lightList
=
[]
lightList
=
[]
lightListData
=
[]
lightListData
=
[]
doLight
showPoint
(
adcode
){
showPoint
(
adcode
){
console
.
log
(
"adcode"
)
console
.
log
(
"adcode"
)
console
.
log
(
adcode
+
""
)
console
.
log
(
adcode
+
""
)
let
parentAdcode
=
(
adcode
+
""
).
slice
(
0
,
2
)
+
"0000"
let
parentAdcode
=
(
adcode
+
""
).
slice
(
0
,
2
)
+
"0000"
this
.
pointBg
.
visible
=
true
;
this
.
pointBg
.
visible
=
true
;
this
.
LoadClip
(
"https://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga"
)
if
(
this
.
lightStar
){
console
.
log
(
"移除svga"
)
this
.
removeChild
(
this
.
lightStar
)
}
this
.
doLight
=
this
.
LoadClip
(
"https://yun.duiba.com.cn/db_games/activity/zxdljx/svga/doLight.svga"
)
.
then
((
lightStar
)
=>
{
.
then
((
lightStar
)
=>
{
this
.
lightStar
=
lightStar
this
.
lightStar
=
lightStar
this
.
addChild
(
this
.
lightStar
)
this
.
lightStar
.
visible
=
true
;
this
.
lightStar
.
visible
=
true
;
console
.
log
(
`z_
${
parentAdcode
}
`
)
console
.
log
(
`z_
${
parentAdcode
}
`
)
console
.
log
(
this
[
`z_
${
parentAdcode
}
`
])
console
.
log
(
this
[
`z_
${
parentAdcode
}
`
])
...
@@ -125,7 +131,7 @@ export class MapComponent extends eui.Component {
...
@@ -125,7 +131,7 @@ export class MapComponent extends eui.Component {
let
pet
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
let
pet
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
);
// pet.visible = false;
// pet.visible = false;
// this.petBodyGroup.addChild(pet);
// this.petBodyGroup.addChild(pet);
this
.
addChild
(
pet
)
//
this.addChild(pet)
resolev
(
pet
)
resolev
(
pet
)
},
(
error
)
=>
{
},
(
error
)
=>
{
reject
(
error
);
reject
(
error
);
...
...
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