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
379a8d7d
Commit
379a8d7d
authored
Aug 29, 2019
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
ed16e598
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
2361 additions
and
2 deletions
+2361
-2
Main_20190828111819.ts
.history/egret/src/Main_20190828111819.ts
+222
-0
Main_20190828112015.ts
.history/egret/src/Main_20190828112015.ts
+221
-0
Main_20190828113516.ts
.history/egret/src/Main_20190828113516.ts
+221
-0
QuestListPanel_20190828111113.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111113.ts
+115
-0
QuestListPanel_20190828111330.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111330.ts
+115
-0
QuestListPanel_20190828111337.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111337.ts
+115
-0
QuestListPanel_20190828111523.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111523.ts
+115
-0
QuestListPanel_20190828111550.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111550.ts
+115
-0
QuestListPanel_20190828111652.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111652.ts
+115
-0
QuestListPanel_20190828111659.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111659.ts
+115
-0
QuestListPanel_20190828111712.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111712.ts
+115
-0
QuestListPanel_20190828111736.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111736.ts
+115
-0
QuestListPanel_20190828111924.ts
...egret/src/QuestListPanel/QuestListPanel_20190828111924.ts
+118
-0
StartScene_20190828113949.ts
.history/egret/src/startScene/StartScene_20190828113949.ts
+174
-0
StartScene_20190828114204.ts
.history/egret/src/startScene/StartScene_20190828114204.ts
+176
-0
StartScene_20190828164233.ts
.history/egret/src/startScene/StartScene_20190828164233.ts
+176
-0
Main.ts
egret/src/Main.ts
+1
-1
QuestListPanel.ts
egret/src/QuestListPanel/QuestListPanel.ts
+4
-1
StartScene.ts
egret/src/startScene/StartScene.ts
+13
-0
No files found.
.history/egret/src/Main_20190
719140236
.ts
→
.history/egret/src/Main_20190
828111819
.ts
View file @
379a8d7d
import
{
SignInScene
}
from
'./signInPanel/SignInSceneSkin'
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
Msg
from
"./alert/Msg"
;
import
AssetAdapter
from
"./AssetAdapter"
;
import
AssetAdapter
from
"./AssetAdapter"
;
import
PanelCtrl
from
"./ctrls/panelCtrl"
;
import
PanelCtrl
from
"./ctrls/panelCtrl"
;
import
SceneCtrl
from
"./ctrls/sceneCtrl"
;
import
SceneCtrl
from
"./ctrls/sceneCtrl"
;
...
@@ -12,26 +10,23 @@ import { ModuleTypes } from "./types/sceneTypes";
...
@@ -12,26 +10,23 @@ import { ModuleTypes } from "./types/sceneTypes";
import
{
getResPath
}
from
"./utils"
;
import
{
getResPath
}
from
"./utils"
;
import
layers
from
"./views/layers"
;
import
layers
from
"./views/layers"
;
import
MainScene
from
'./mainScene/MainScene'
;
import
MainScene
from
'./mainScene/MainScene'
;
import
MyGoldCoinPanel
from
"./myGoldCoinPanel/MyGoldCoinPanel"
;
import
EarnGoldCoinPanel
from
"./earnGoldCoinPanel/EarnGoldCoinPanel"
;
import
TourPanel
from
"./tourPanel/TourPanel"
;
import
{
PetIndexData
}
from
"../libs/tw/data/pet/PetIndexData"
;
import
{
PetIndexData
}
from
"../libs/tw/data/pet/PetIndexData"
;
import
AdoptePanel
from
"./adoptePanel/AdoptePanel"
;
import
MsgPanel
from
"./msgPanel/MsgPanel"
;
import
MsgPanel
from
"./msgPanel/MsgPanel"
;
import
AlbumPanel
from
"./albumPanel/AlbumPanel"
;
import
RewardPanel
from
"./rewardPanel/RewardPanel"
;
import
{
PropPanel
}
from
'./propPanel/PropPanel'
;
import
AlbumInfoPanel
from
'./albumPanel/AlbumInfoPanel'
;
import
SharePanel
from
'./sharePanel/SharePanel'
;
import
SharePanel
from
'./sharePanel/SharePanel'
;
import
{
Buried
}
from
'../libs/tw/util/Buried'
;
import
{
Buried
}
from
'../libs/tw/util/Buried'
;
import
GuidePanel
from
'./guidePanel/GuidePanel'
;
import
LoadingScene
from
'./loadingScene/loadingScene'
;
import
{
GuidePrizePanel
}
from
'./guidePrizePanel/GuidePrizePanel'
;
import
{
GDispatcher
}
from
'../libs/tc/util/GDispatcher'
;
import
{
ExMainScene
}
from
'./mainScene/ExMainScene'
;
import
StartScene1
from
'./startScene/StartScene'
;
import
{
SignInPanel
}
from
'./signInPanel/SignInPanelSkin'
;
import
DogShowPanel
from
'./dogShowPanel/DogShowPanel'
;
import
{
SignInPrizePanel
}
from
'./signInPanel/SignInPrziePanelSkin'
;
import
ShopPanel
from
'./shopPanel/ShopPanel'
;
import
{
ExtraPrizePanel
}
from
'./extraPrizePanel/ExtraPrizePanel'
;
import
TeamScene
from
'./teamScene/TeamScene'
;
import
UpPrizePanel
from
'./upPrizePanel/upPrizePanel'
;
import
TopLayerCtrl
from
'./ctrls/topLayerCtrl'
;
import
UpNoPrizePanel
from
'./upNoPrizePanel/UpNoPrizePanel'
;
import
ToastPanel
from
'./toastPanel/ToastPanel'
;
import
{
NetName
}
from
"../libs/tw/enum/NetName"
;
import
JoinPanel
from
"./joinPanel/JoinPanel"
;
import
Share2Panel
from
"./share2Panel/Share2Panel"
;
import
QuestListPanel
from
"./QuestListPanel/QuestListPanel"
;
import
StartScene_xcj
from
"./startScene/StartScene_xcj"
;
class
Main
extends
eui
.
UILayer
{
class
Main
extends
eui
.
UILayer
{
protected
createChildren
():
void
{
protected
createChildren
():
void
{
...
@@ -66,22 +61,29 @@ class Main extends eui.UILayer {
...
@@ -66,22 +61,29 @@ class Main extends eui.UILayer {
Loading
.
init
(
layers
.
topLayer
);
Loading
.
init
(
layers
.
topLayer
);
PanelCtrl
.
instance
.
init
(
layers
.
popupLayer
);
PanelCtrl
.
instance
.
init
(
layers
.
popupLayer
);
SceneCtrl
.
instance
.
init
(
layers
.
sceneLayer
);
SceneCtrl
.
instance
.
init
(
layers
.
sceneLayer
);
TopLayerCtrl
.
instance
.
init
(
layers
.
topLayer
);
Buried
.
init
();
Buried
.
init
();
this
.
stage
.
scaleMode
=
egret
.
StageScaleMode
.
FIXED_WIDTH
;
this
.
stage
.
scaleMode
=
egret
.
StageScaleMode
.
FIXED_WIDTH
;
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
ADOPTE_PANEL
,
AdoptePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
EXTRA_PRIZE_PANEL
,
ExtraPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
MSG_PANEL
,
MsgPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
MSG_PANEL
,
MsgPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SIGN_IN_PANEL
,
SignInPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SIGN_IN_PRIZE_PANEL
,
SignInPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
GUIDE_PRIZE_PANEL
,
GuidePrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
UPNO_PRIZE_PANEL
,
UpNoPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
UPPRIZE_PANEL
,
UpPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
RULE_PANEL
,
RulePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
RULE_PANEL
,
RulePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
EARN_GOLD_COIN_PANEL
,
EarnGoldCoinPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
DOG_SHOW_PANEL
,
DogShowPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
GUIDE_PANEL
,
GuidePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHOP_PANEL
,
ShopPanel
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
MAIN_SCENE
,
ExMainScene
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHARE_PANEL
,
SharePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
JOIN_PANEL
,
JoinPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHARE2_PANEL
,
Share2Panel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
QUEST_LIST_PANEL
,
QuestListPanel
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
LOADING_SCENE
,
LoadingScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
MAIN_SCENE
,
MainScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
START_SCENE
,
StartScene1
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
TEAM_SCENE
,
TeamScene
);
TopLayerCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
TOAST_PANEL
,
ToastPanel
);
this
.
runGame
().
catch
(
e
=>
{
this
.
runGame
().
catch
(
e
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
...
@@ -128,39 +130,91 @@ class Main extends eui.UILayer {
...
@@ -128,39 +130,91 @@ class Main extends eui.UILayer {
*/
*/
protected
createGameScene
():
void
{
protected
createGameScene
():
void
{
//获取签到信息
//获取签到信息
NetManager
.
ins
.
getS
ignInfo
(()
=>
{
NetManager
.
ins
.
getS
hareCode
(()
=>
{
NetManager
.
ins
.
getPetInfo
(()
=>
{
this
.
getGameRes
();
this
.
getGameRes
();
this
.
doShare
()
},
DataManager
.
ins
.
petIndexData
.
activityId
);
},
window
[
"CFG"
].
activityId
,
"hdtool"
)
},
window
[
'signActivityId'
]);
}
doShare
()
{
var
shareData
=
{
title
:
'飞船登陆汪星球!超多萌宠可爱来袭!'
,
//标题
desc
:
'谁家汪更可爱?'
,
//描述
link
:
`https://activity-6.m.duiba.com.cn/customShare/share?id=2921&ShareCode=
${
DataManager
.
ins
.
getData
(
NetName
.
GET_SHARECODE
).
shareCode
}
`
,
//链接
imgUrl
:
'https://yun.duiba.com.cn/db_games/activity/yjyc/share.jpg'
,
//图片
}
window
[
"invokeWX"
](
shareData
)
}
}
//加载游戏中的资源
//加载游戏中的资源
private
async
getGameRes
(){
private
async
getGameRes
()
{
//还没有宠物,先播放介绍文字
//还没有宠物,先播放介绍文字
if
(
!
DataManager
.
ins
.
petHomeInfoData
.
petId
)
{
// if (!DataManager.ins.petHomeInfoData.petId) {
await
RES
.
loadGroup
(
'adopte_panel'
);
// await RES.loadGroup('adopte_panel');
await
RES
.
getResAsync
(
'adopteBg_jpg'
);
// // await RES.getResAsync('adopteBg_jpg');
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
ADOPTE_PANEL
);
// PanelCtrl.instance.show(ModuleTypes.ADOPTE_PANEL);
await
RES
.
loadGroup
(
'guide_component'
);
// await RES.loadGroup('guide_component');
}
else
{
//已经有宠物了,进入游戏场景
// } else {//已经有宠物了,进入游戏场景
await
RES
.
loadGroup
(
'main_scene'
);
// await RES.loadGroup('main_scene');
await
RES
.
getResAsync
(
'bgday_jpg'
);
// // await RES.getResAsync('bgday_jpg');
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAIN_SCENE
);
// SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
}
// }
await
RES
.
loadGroup
(
'loading_scene'
);
await
RES
.
getResAsync
(
'lodingBg_jpg'
);
await
RES
.
getResAsync
(
'loadingIconMc_json'
);
await
RES
.
getResAsync
(
'loadingIconMc_png'
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
LOADING_SCENE
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
5
]);
await
RES
.
loadGroup
(
'common'
);
await
RES
.
getResAsync
(
'startBg_jpg'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
10
]);
await
RES
.
loadGroup
(
'start_scene'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
15
]);
await
RES
.
loadGroup
(
'dog_component'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
35
]);
await
RES
.
getResAsync
(
'main_star_an_json'
);
await
RES
.
getResAsync
(
'main_star_an_png'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
65
]);
await
RES
.
loadGroup
(
'main_scene'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
85
]);
await
RES
.
getResAsync
(
'main_Bg_jpg'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
100
]);
//延时加载
await
RES
.
loadGroup
(
'msg_panel'
);
await
RES
.
getResAsync
(
'msgBg0_png'
);
await
RES
.
getResAsync
(
'msgBg1_png'
);
await
RES
.
getResAsync
(
'msgBg2_png'
);
await
RES
.
getResAsync
(
'msgBg3_png'
);
// await RES.getResAsync('dShowBg_png');
await
RES
.
loadGroup
(
'dogShow_panel'
);
await
RES
.
loadGroup
(
'shop_panel'
);
await
RES
.
getResAsync
(
'team_bg_jpg'
);
await
RES
.
loadGroup
(
'team_scene'
);
await
RES
.
getResAsync
(
'shareBg_jpg'
);
await
RES
.
loadGroup
(
'share_panel'
);
//加载组
//加载组
await
RES
.
loadGroup
(
'signIn_prize_panel'
);
//
await RES.loadGroup('signIn_prize_panel');
await
RES
.
loadGroup
(
'signIn_panel'
);
//
await RES.loadGroup('signIn_panel');
await
RES
.
loadGroup
(
'extra_prize_panel'
);
//
await RES.loadGroup('extra_prize_panel');
await
RES
.
loadGroup
(
'upPrize_panel'
);
//
await RES.loadGroup('upPrize_panel');
await
RES
.
loadGroup
(
'upNoPrize_panel'
);
//
await RES.loadGroup('upNoPrize_panel');
await
RES
.
loadGroup
(
'earnGold_panel'
);
//
await RES.loadGroup('earnGold_panel');
await
RES
.
loadGroup
(
'guide_panel'
);
//
await RES.loadGroup('guide_panel');
//加载图片
//
//
加载图片
await
RES
.
getResAsync
(
'gamerule_jpg'
);
//
await RES.getResAsync('gamerule_jpg');
await
RES
.
getResAsync
(
'guideBg_jpg'
);
//
await RES.getResAsync('guideBg_jpg');
}
}
}
}
...
...
.history/egret/src/Main_20190
719151119
.ts
→
.history/egret/src/Main_20190
828112015
.ts
View file @
379a8d7d
import
{
SignInScene
}
from
'./signInPanel/SignInSceneSkin'
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
Msg
from
"./alert/Msg"
;
import
AssetAdapter
from
"./AssetAdapter"
;
import
AssetAdapter
from
"./AssetAdapter"
;
import
PanelCtrl
from
"./ctrls/panelCtrl"
;
import
PanelCtrl
from
"./ctrls/panelCtrl"
;
import
SceneCtrl
from
"./ctrls/sceneCtrl"
;
import
SceneCtrl
from
"./ctrls/sceneCtrl"
;
...
@@ -12,26 +10,23 @@ import { ModuleTypes } from "./types/sceneTypes";
...
@@ -12,26 +10,23 @@ import { ModuleTypes } from "./types/sceneTypes";
import
{
getResPath
}
from
"./utils"
;
import
{
getResPath
}
from
"./utils"
;
import
layers
from
"./views/layers"
;
import
layers
from
"./views/layers"
;
import
MainScene
from
'./mainScene/MainScene'
;
import
MainScene
from
'./mainScene/MainScene'
;
import
MyGoldCoinPanel
from
"./myGoldCoinPanel/MyGoldCoinPanel"
;
import
EarnGoldCoinPanel
from
"./earnGoldCoinPanel/EarnGoldCoinPanel"
;
import
TourPanel
from
"./tourPanel/TourPanel"
;
import
{
PetIndexData
}
from
"../libs/tw/data/pet/PetIndexData"
;
import
{
PetIndexData
}
from
"../libs/tw/data/pet/PetIndexData"
;
import
AdoptePanel
from
"./adoptePanel/AdoptePanel"
;
import
MsgPanel
from
"./msgPanel/MsgPanel"
;
import
MsgPanel
from
"./msgPanel/MsgPanel"
;
import
AlbumPanel
from
"./albumPanel/AlbumPanel"
;
import
RewardPanel
from
"./rewardPanel/RewardPanel"
;
import
{
PropPanel
}
from
'./propPanel/PropPanel'
;
import
AlbumInfoPanel
from
'./albumPanel/AlbumInfoPanel'
;
import
SharePanel
from
'./sharePanel/SharePanel'
;
import
SharePanel
from
'./sharePanel/SharePanel'
;
import
{
Buried
}
from
'../libs/tw/util/Buried'
;
import
{
Buried
}
from
'../libs/tw/util/Buried'
;
import
GuidePanel
from
'./guidePanel/GuidePanel'
;
import
LoadingScene
from
'./loadingScene/loadingScene'
;
import
{
GuidePrizePanel
}
from
'./guidePrizePanel/GuidePrizePanel'
;
import
{
GDispatcher
}
from
'../libs/tc/util/GDispatcher'
;
import
{
ExMainScene
}
from
'./mainScene/ExMainScene'
;
import
StartScene1
from
'./startScene/StartScene'
;
import
{
SignInPanel
}
from
'./signInPanel/SignInPanelSkin'
;
import
DogShowPanel
from
'./dogShowPanel/DogShowPanel'
;
import
{
SignInPrizePanel
}
from
'./signInPanel/SignInPrziePanelSkin'
;
import
ShopPanel
from
'./shopPanel/ShopPanel'
;
import
{
ExtraPrizePanel
}
from
'./extraPrizePanel/ExtraPrizePanel'
;
import
TeamScene
from
'./teamScene/TeamScene'
;
import
UpPrizePanel
from
'./upPrizePanel/upPrizePanel'
;
import
TopLayerCtrl
from
'./ctrls/topLayerCtrl'
;
import
UpNoPrizePanel
from
'./upNoPrizePanel/UpNoPrizePanel'
;
import
ToastPanel
from
'./toastPanel/ToastPanel'
;
import
{
NetName
}
from
"../libs/tw/enum/NetName"
;
import
JoinPanel
from
"./joinPanel/JoinPanel"
;
import
Share2Panel
from
"./share2Panel/Share2Panel"
;
import
QuestListPanel
from
"./QuestListPanel/QuestListPanel"
;
import
StartScene_xcj
from
"./startScene/StartScene_xcj"
;
class
Main
extends
eui
.
UILayer
{
class
Main
extends
eui
.
UILayer
{
protected
createChildren
():
void
{
protected
createChildren
():
void
{
...
@@ -66,22 +61,28 @@ class Main extends eui.UILayer {
...
@@ -66,22 +61,28 @@ class Main extends eui.UILayer {
Loading
.
init
(
layers
.
topLayer
);
Loading
.
init
(
layers
.
topLayer
);
PanelCtrl
.
instance
.
init
(
layers
.
popupLayer
);
PanelCtrl
.
instance
.
init
(
layers
.
popupLayer
);
SceneCtrl
.
instance
.
init
(
layers
.
sceneLayer
);
SceneCtrl
.
instance
.
init
(
layers
.
sceneLayer
);
TopLayerCtrl
.
instance
.
init
(
layers
.
topLayer
);
Buried
.
init
();
Buried
.
init
();
this
.
stage
.
scaleMode
=
egret
.
StageScaleMode
.
FIXED_WIDTH
;
this
.
stage
.
scaleMode
=
egret
.
StageScaleMode
.
FIXED_WIDTH
;
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
ADOPTE_PANEL
,
AdoptePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
EXTRA_PRIZE_PANEL
,
ExtraPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
MSG_PANEL
,
MsgPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
MSG_PANEL
,
MsgPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SIGN_IN_PANEL
,
SignInPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SIGN_IN_PRIZE_PANEL
,
SignInPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
GUIDE_PRIZE_PANEL
,
GuidePrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
UPNO_PRIZE_PANEL
,
UpNoPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
UPPRIZE_PANEL
,
UpPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
RULE_PANEL
,
RulePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
RULE_PANEL
,
RulePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
EARN_GOLD_COIN_PANEL
,
EarnGoldCoinPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
DOG_SHOW_PANEL
,
DogShowPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
GUIDE_PANEL
,
GuidePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHOP_PANEL
,
ShopPanel
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
MAIN_SCENE
,
ExMainScene
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHARE_PANEL
,
SharePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
JOIN_PANEL
,
JoinPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHARE2_PANEL
,
Share2Panel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
QUEST_LIST_PANEL
,
QuestListPanel
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
LOADING_SCENE
,
LoadingScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
MAIN_SCENE
,
MainScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
START_SCENE
,
StartScene_xcj
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
TEAM_SCENE
,
TeamScene
);
TopLayerCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
TOAST_PANEL
,
ToastPanel
);
this
.
runGame
().
catch
(
e
=>
{
this
.
runGame
().
catch
(
e
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
...
@@ -128,39 +129,91 @@ class Main extends eui.UILayer {
...
@@ -128,39 +129,91 @@ class Main extends eui.UILayer {
*/
*/
protected
createGameScene
():
void
{
protected
createGameScene
():
void
{
//获取签到信息
//获取签到信息
NetManager
.
ins
.
getS
ignInfo
(()
=>
{
NetManager
.
ins
.
getS
hareCode
(()
=>
{
NetManager
.
ins
.
getPetInfo
(()
=>
{
this
.
getGameRes
();
this
.
getGameRes
();
this
.
doShare
()
},
DataManager
.
ins
.
petIndexData
.
activityId
);
},
window
[
"CFG"
].
activityId
,
"hdtool"
)
},
window
[
'signActivityId'
]);
}
doShare
()
{
var
shareData
=
{
title
:
'飞船登陆汪星球!超多萌宠可爱来袭!'
,
//标题
desc
:
'谁家汪更可爱?'
,
//描述
link
:
`https://activity-6.m.duiba.com.cn/customShare/share?id=2921&ShareCode=
${
DataManager
.
ins
.
getData
(
NetName
.
GET_SHARECODE
).
shareCode
}
`
,
//链接
imgUrl
:
'https://yun.duiba.com.cn/db_games/activity/yjyc/share.jpg'
,
//图片
}
window
[
"invokeWX"
](
shareData
)
}
}
//加载游戏中的资源
//加载游戏中的资源
private
async
getGameRes
(){
private
async
getGameRes
()
{
//还没有宠物,先播放介绍文字
//还没有宠物,先播放介绍文字
if
(
!
DataManager
.
ins
.
petHomeInfoData
.
petId
)
{
// if (!DataManager.ins.petHomeInfoData.petId) {
await
RES
.
loadGroup
(
'adopte_panel'
);
// await RES.loadGroup('adopte_panel');
// await RES.getResAsync('adopteBg_jpg');
// // await RES.getResAsync('adopteBg_jpg');
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
ADOPTE_PANEL
);
// PanelCtrl.instance.show(ModuleTypes.ADOPTE_PANEL);
await
RES
.
loadGroup
(
'guide_component'
);
// await RES.loadGroup('guide_component');
}
else
{
//已经有宠物了,进入游戏场景
// } else {//已经有宠物了,进入游戏场景
await
RES
.
loadGroup
(
'main_scene'
);
// await RES.loadGroup('main_scene');
// await RES.getResAsync('bgday_jpg');
// // await RES.getResAsync('bgday_jpg');
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAIN_SCENE
);
// SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
}
// }
await
RES
.
loadGroup
(
'loading_scene'
);
await
RES
.
getResAsync
(
'lodingBg_jpg'
);
await
RES
.
getResAsync
(
'loadingIconMc_json'
);
await
RES
.
getResAsync
(
'loadingIconMc_png'
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
LOADING_SCENE
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
5
]);
await
RES
.
loadGroup
(
'common'
);
await
RES
.
getResAsync
(
'startBg_jpg'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
10
]);
await
RES
.
loadGroup
(
'start_scene'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
15
]);
await
RES
.
loadGroup
(
'dog_component'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
35
]);
await
RES
.
getResAsync
(
'main_star_an_json'
);
await
RES
.
getResAsync
(
'main_star_an_png'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
65
]);
await
RES
.
loadGroup
(
'main_scene'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
85
]);
await
RES
.
getResAsync
(
'main_Bg_jpg'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
100
]);
//延时加载
await
RES
.
loadGroup
(
'msg_panel'
);
await
RES
.
getResAsync
(
'msgBg0_png'
);
await
RES
.
getResAsync
(
'msgBg1_png'
);
await
RES
.
getResAsync
(
'msgBg2_png'
);
await
RES
.
getResAsync
(
'msgBg3_png'
);
// await RES.getResAsync('dShowBg_png');
await
RES
.
loadGroup
(
'dogShow_panel'
);
await
RES
.
loadGroup
(
'shop_panel'
);
await
RES
.
getResAsync
(
'team_bg_jpg'
);
await
RES
.
loadGroup
(
'team_scene'
);
await
RES
.
getResAsync
(
'shareBg_jpg'
);
await
RES
.
loadGroup
(
'share_panel'
);
//加载组
//加载组
await
RES
.
loadGroup
(
'signIn_prize_panel'
);
//
await RES.loadGroup('signIn_prize_panel');
await
RES
.
loadGroup
(
'signIn_panel'
);
//
await RES.loadGroup('signIn_panel');
await
RES
.
loadGroup
(
'extra_prize_panel'
);
//
await RES.loadGroup('extra_prize_panel');
await
RES
.
loadGroup
(
'upPrize_panel'
);
//
await RES.loadGroup('upPrize_panel');
await
RES
.
loadGroup
(
'upNoPrize_panel'
);
//
await RES.loadGroup('upNoPrize_panel');
await
RES
.
loadGroup
(
'earnGold_panel'
);
//
await RES.loadGroup('earnGold_panel');
await
RES
.
loadGroup
(
'guide_panel'
);
//
await RES.loadGroup('guide_panel');
//加载图片
//
//
加载图片
await
RES
.
getResAsync
(
'gamerule_jpg'
);
//
await RES.getResAsync('gamerule_jpg');
await
RES
.
getResAsync
(
'guideBg_jpg'
);
//
await RES.getResAsync('guideBg_jpg');
}
}
}
}
...
...
.history/egret/src/Main_20190
719154915
.ts
→
.history/egret/src/Main_20190
828113516
.ts
View file @
379a8d7d
import
{
SignInScene
}
from
'./signInPanel/SignInSceneSkin'
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
Msg
from
"./alert/Msg"
;
import
AssetAdapter
from
"./AssetAdapter"
;
import
AssetAdapter
from
"./AssetAdapter"
;
import
PanelCtrl
from
"./ctrls/panelCtrl"
;
import
PanelCtrl
from
"./ctrls/panelCtrl"
;
import
SceneCtrl
from
"./ctrls/sceneCtrl"
;
import
SceneCtrl
from
"./ctrls/sceneCtrl"
;
...
@@ -12,25 +10,23 @@ import { ModuleTypes } from "./types/sceneTypes";
...
@@ -12,25 +10,23 @@ import { ModuleTypes } from "./types/sceneTypes";
import
{
getResPath
}
from
"./utils"
;
import
{
getResPath
}
from
"./utils"
;
import
layers
from
"./views/layers"
;
import
layers
from
"./views/layers"
;
import
MainScene
from
'./mainScene/MainScene'
;
import
MainScene
from
'./mainScene/MainScene'
;
import
MyGoldCoinPanel
from
"./myGoldCoinPanel/MyGoldCoinPanel"
;
import
EarnGoldCoinPanel
from
"./earnGoldCoinPanel/EarnGoldCoinPanel"
;
import
TourPanel
from
"./tourPanel/TourPanel"
;
import
{
PetIndexData
}
from
"../libs/tw/data/pet/PetIndexData"
;
import
{
PetIndexData
}
from
"../libs/tw/data/pet/PetIndexData"
;
import
AdoptePanel
from
"./adoptePanel/AdoptePanel"
;
import
MsgPanel
from
"./msgPanel/MsgPanel"
;
import
MsgPanel
from
"./msgPanel/MsgPanel"
;
import
AlbumPanel
from
"./albumPanel/AlbumPanel"
;
import
RewardPanel
from
"./rewardPanel/RewardPanel"
;
import
{
PropPanel
}
from
'./propPanel/PropPanel'
;
import
AlbumInfoPanel
from
'./albumPanel/AlbumInfoPanel'
;
import
SharePanel
from
'./sharePanel/SharePanel'
;
import
SharePanel
from
'./sharePanel/SharePanel'
;
import
{
Buried
}
from
'../libs/tw/util/Buried'
;
import
{
Buried
}
from
'../libs/tw/util/Buried'
;
import
GuidePanel
from
'./guidePanel/GuidePanel'
;
import
LoadingScene
from
'./loadingScene/loadingScene'
;
import
{
GuidePrizePanel
}
from
'./guidePrizePanel/GuidePrizePanel'
;
import
{
GDispatcher
}
from
'../libs/tc/util/GDispatcher'
;
import
{
SignInPanel
}
from
'./signInPanel/SignInPanelSkin'
;
import
StartScene1
from
'./startScene/StartScene'
;
import
{
SignInPrizePanel
}
from
'./signInPanel/SignInPrziePanelSkin'
;
import
DogShowPanel
from
'./dogShowPanel/DogShowPanel'
;
import
{
ExtraPrizePanel
}
from
'./extraPrizePanel/ExtraPrizePanel'
;
import
ShopPanel
from
'./shopPanel/ShopPanel'
;
import
UpPrizePanel
from
'./upPrizePanel/upPrizePanel'
;
import
TeamScene
from
'./teamScene/TeamScene'
;
import
UpNoPrizePanel
from
'./upNoPrizePanel/UpNoPrizePanel'
;
import
TopLayerCtrl
from
'./ctrls/topLayerCtrl'
;
import
ToastPanel
from
'./toastPanel/ToastPanel'
;
import
{
NetName
}
from
"../libs/tw/enum/NetName"
;
import
JoinPanel
from
"./joinPanel/JoinPanel"
;
import
Share2Panel
from
"./share2Panel/Share2Panel"
;
import
QuestListPanel
from
"./QuestListPanel/QuestListPanel"
;
import
StartScene_xcj
from
"./startScene/StartScene_xcj"
;
class
Main
extends
eui
.
UILayer
{
class
Main
extends
eui
.
UILayer
{
protected
createChildren
():
void
{
protected
createChildren
():
void
{
...
@@ -65,22 +61,28 @@ class Main extends eui.UILayer {
...
@@ -65,22 +61,28 @@ class Main extends eui.UILayer {
Loading
.
init
(
layers
.
topLayer
);
Loading
.
init
(
layers
.
topLayer
);
PanelCtrl
.
instance
.
init
(
layers
.
popupLayer
);
PanelCtrl
.
instance
.
init
(
layers
.
popupLayer
);
SceneCtrl
.
instance
.
init
(
layers
.
sceneLayer
);
SceneCtrl
.
instance
.
init
(
layers
.
sceneLayer
);
TopLayerCtrl
.
instance
.
init
(
layers
.
topLayer
);
Buried
.
init
();
Buried
.
init
();
this
.
stage
.
scaleMode
=
egret
.
StageScaleMode
.
FIXED_WIDTH
;
this
.
stage
.
scaleMode
=
egret
.
StageScaleMode
.
FIXED_WIDTH
;
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
ADOPTE_PANEL
,
AdoptePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
EXTRA_PRIZE_PANEL
,
ExtraPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
MSG_PANEL
,
MsgPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
MSG_PANEL
,
MsgPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SIGN_IN_PANEL
,
SignInPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SIGN_IN_PRIZE_PANEL
,
SignInPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
GUIDE_PRIZE_PANEL
,
GuidePrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
UPNO_PRIZE_PANEL
,
UpNoPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
UPPRIZE_PANEL
,
UpPrizePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
RULE_PANEL
,
RulePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
RULE_PANEL
,
RulePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
EARN_GOLD_COIN_PANEL
,
EarnGoldCoinPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
DOG_SHOW_PANEL
,
DogShowPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
GUIDE_PANEL
,
GuidePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHOP_PANEL
,
ShopPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHARE_PANEL
,
SharePanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
JOIN_PANEL
,
JoinPanel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
SHARE2_PANEL
,
Share2Panel
);
PanelCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
QUEST_LIST_PANEL
,
QuestListPanel
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
LOADING_SCENE
,
LoadingScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
MAIN_SCENE
,
MainScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
MAIN_SCENE
,
MainScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
START_SCENE
,
StartScene1
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
TEAM_SCENE
,
TeamScene
);
TopLayerCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
TOAST_PANEL
,
ToastPanel
);
this
.
runGame
().
catch
(
e
=>
{
this
.
runGame
().
catch
(
e
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
...
@@ -127,39 +129,91 @@ class Main extends eui.UILayer {
...
@@ -127,39 +129,91 @@ class Main extends eui.UILayer {
*/
*/
protected
createGameScene
():
void
{
protected
createGameScene
():
void
{
//获取签到信息
//获取签到信息
NetManager
.
ins
.
getS
ignInfo
(()
=>
{
NetManager
.
ins
.
getS
hareCode
(()
=>
{
NetManager
.
ins
.
getPetInfo
(()
=>
{
this
.
getGameRes
();
this
.
getGameRes
();
this
.
doShare
()
},
DataManager
.
ins
.
petIndexData
.
activityId
);
},
window
[
"CFG"
].
activityId
,
"hdtool"
)
},
window
[
'signActivityId'
]);
}
doShare
()
{
var
shareData
=
{
title
:
'飞船登陆汪星球!超多萌宠可爱来袭!'
,
//标题
desc
:
'谁家汪更可爱?'
,
//描述
link
:
`https://activity-6.m.duiba.com.cn/customShare/share?id=2921&ShareCode=
${
DataManager
.
ins
.
getData
(
NetName
.
GET_SHARECODE
).
shareCode
}
`
,
//链接
imgUrl
:
'https://yun.duiba.com.cn/db_games/activity/yjyc/share.jpg'
,
//图片
}
window
[
"invokeWX"
](
shareData
)
}
}
//加载游戏中的资源
//加载游戏中的资源
private
async
getGameRes
(){
private
async
getGameRes
()
{
//还没有宠物,先播放介绍文字
//还没有宠物,先播放介绍文字
if
(
!
DataManager
.
ins
.
petHomeInfoData
.
petId
)
{
// if (!DataManager.ins.petHomeInfoData.petId) {
await
RES
.
loadGroup
(
'adopte_panel'
);
// await RES.loadGroup('adopte_panel');
// await RES.getResAsync('adopteBg_jpg');
// // await RES.getResAsync('adopteBg_jpg');
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
ADOPTE_PANEL
);
// PanelCtrl.instance.show(ModuleTypes.ADOPTE_PANEL);
await
RES
.
loadGroup
(
'guide_component'
);
// await RES.loadGroup('guide_component');
}
else
{
//已经有宠物了,进入游戏场景
// } else {//已经有宠物了,进入游戏场景
await
RES
.
loadGroup
(
'main_scene'
);
// await RES.loadGroup('main_scene');
// await RES.getResAsync('bgday_jpg');
// // await RES.getResAsync('bgday_jpg');
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAIN_SCENE
);
// SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
}
// }
await
RES
.
loadGroup
(
'loading_scene'
);
await
RES
.
getResAsync
(
'lodingBg_jpg'
);
await
RES
.
getResAsync
(
'loadingIconMc_json'
);
await
RES
.
getResAsync
(
'loadingIconMc_png'
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
LOADING_SCENE
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
5
]);
await
RES
.
loadGroup
(
'common'
);
await
RES
.
getResAsync
(
'startBg_jpg'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
10
]);
await
RES
.
loadGroup
(
'start_scene'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
15
]);
await
RES
.
loadGroup
(
'dog_component'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
35
]);
await
RES
.
getResAsync
(
'main_star_an_json'
);
await
RES
.
getResAsync
(
'main_star_an_png'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
65
]);
await
RES
.
loadGroup
(
'main_scene'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
85
]);
await
RES
.
getResAsync
(
'main_Bg_jpg'
);
GDispatcher
.
dispatchEvent
(
'progress'
,
[
100
]);
//延时加载
await
RES
.
loadGroup
(
'msg_panel'
);
await
RES
.
getResAsync
(
'msgBg0_png'
);
await
RES
.
getResAsync
(
'msgBg1_png'
);
await
RES
.
getResAsync
(
'msgBg2_png'
);
await
RES
.
getResAsync
(
'msgBg3_png'
);
// await RES.getResAsync('dShowBg_png');
await
RES
.
loadGroup
(
'dogShow_panel'
);
await
RES
.
loadGroup
(
'shop_panel'
);
await
RES
.
getResAsync
(
'team_bg_jpg'
);
await
RES
.
loadGroup
(
'team_scene'
);
await
RES
.
getResAsync
(
'shareBg_jpg'
);
await
RES
.
loadGroup
(
'share_panel'
);
//加载组
//加载组
await
RES
.
loadGroup
(
'signIn_prize_panel'
);
//
await RES.loadGroup('signIn_prize_panel');
await
RES
.
loadGroup
(
'signIn_panel'
);
//
await RES.loadGroup('signIn_panel');
await
RES
.
loadGroup
(
'extra_prize_panel'
);
//
await RES.loadGroup('extra_prize_panel');
await
RES
.
loadGroup
(
'upPrize_panel'
);
//
await RES.loadGroup('upPrize_panel');
await
RES
.
loadGroup
(
'upNoPrize_panel'
);
//
await RES.loadGroup('upNoPrize_panel');
await
RES
.
loadGroup
(
'earnGold_panel'
);
//
await RES.loadGroup('earnGold_panel');
await
RES
.
loadGroup
(
'guide_panel'
);
//
await RES.loadGroup('guide_panel');
//加载图片
//
//
加载图片
await
RES
.
getResAsync
(
'gamerule_jpg'
);
//
await RES.getResAsync('gamerule_jpg');
await
RES
.
getResAsync
(
'guideBg_jpg'
);
//
await RES.getResAsync('guideBg_jpg');
}
}
}
}
...
...
.history/egret/src/QuestListPanel/QuestListPanel_20190828111113.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
protected
async
preLoadRes
()
{
return
RES
.
loadGroup
(
this
.
groupName
);
}
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111330.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
async
preLoadRes
()
{
return
RES
.
loadGroup
(
this
.
groupName
);
}
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111337.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
protected
async
preLoadRes
()
{
return
RES
.
loadGroup
(
this
.
groupName
);
}
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111523.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
/* protected async preLoadRes() {
return RES.loadGroup(this.groupName);
} */
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111550.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
protected
async
preLoadRes
()
{
return
RES
.
loadGroup
(
this
.
groupName
);
}
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111652.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
/* protected async preLoadRes() {
return RES.loadGroup(this.groupName);
} */
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111659.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
protected
async
preLoadRes
()
{
return
RES
.
loadGroup
(
this
.
groupName
);
}
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111712.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
/* protected async preLoadRes() {
return RES.loadGroup(this.groupName);
} */
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111736.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
protected
async
preLoadRes
()
{
return
RES
.
loadGroup
(
this
.
groupName
);
}
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/QuestListPanel/QuestListPanel_20190828111924.ts
0 → 100644
View file @
379a8d7d
import
Panel
from
"../views/Panel"
;
import
{
MUtils
}
from
"../MUtils"
;
export
default
class
QuestListPanel
extends
Panel
{
public
get
skinKey
()
{
return
"QuestListPanel"
}
public
get
groupName
()
{
return
"quest_list"
}
public
progressVisit
:
eui
.
ProgressBar
;
public
btnDo0
:
eui
.
Button
;
public
btnDo1
:
eui
.
Button
;
public
btnDo2
:
eui
.
Button
;
public
btnDo3
:
eui
.
Button
;
public
btnDo4
:
eui
.
Button
;
/* private btnTexTodo: egret.Texture = null;
private btnTexDoing: egret.Texture = null;
private btnTexDone: egret.Texture = null; */
constructor
(
data
?:
any
)
{
super
(
data
);
}
start
(
data
?:
any
)
{
super
.
start
(
data
);
}
protected
async
preLoadRes
()
{
await
RES
.
loadGroup
(
this
.
groupName
);
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
async
initEvents
()
{
super
.
initEvents
();
this
.
questMap
[
"0"
]
=
new
Quest
(
this
.
btnDo0
,
1
,
()
=>
{
console
.
warn
(
"去完成首次到访"
);
});
this
.
questMap
[
"1"
]
=
new
Quest
(
this
.
btnDo1
,
0
,
()
=>
{
console
.
warn
(
"去完成个人中心签到"
);
});
this
.
questMap
[
"2"
]
=
new
Quest
(
this
.
btnDo2
,
3
,
()
=>
{
console
.
warn
(
"去完成每日分享"
);
});
this
.
questMap
[
"3"
]
=
new
Quest
(
this
.
btnDo3
,
2
,
()
=>
{
console
.
warn
(
"去完成收藏歌曲"
);
});
this
.
questMap
[
"4"
]
=
new
Quest
(
this
.
btnDo4
,
1
,
()
=>
{
console
.
warn
(
"去完成收听歌曲"
);
});
}
private
questMap
=
{};
removeEvents
():
void
{
super
.
removeEvents
();
}
}
class
Quest
{
constructor
(
button
:
eui
.
Button
,
statusCode
:
number
,
todoCallback
:
()
=>
void
)
{
this
.
button
=
button
;
this
.
statusCode
=
statusCode
;
this
.
todoCallback
=
todoCallback
;
button
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onClickBtn
,
this
);
}
private
button
:
eui
.
Button
=
null
;
private
_statusCode
:
number
=
0
;
public
set
statusCode
(
v
:
number
)
{
switch
(
v
)
{
case
0
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_todo_png"
);
break
;
case
1
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_doing_png"
);
break
;
case
2
:
this
.
button
.
enabled
=
false
;
this
.
setButtonImage
(
"quest_list_btn_done_png"
)
break
;
case
3
:
this
.
button
.
enabled
=
true
;
this
.
setButtonImage
(
"quest_list_btn_receive_png"
)
break
;
default
:
break
;
}
this
.
_statusCode
=
v
;
}
public
get
statusCode
()
{
return
this
.
_statusCode
;
}
private
setButtonImage
(
name
:
string
)
{
MUtils
.
setButtonImage
(
this
.
button
,
RES
.
getRes
(
name
));
}
private
todoCallback
:
()
=>
void
=
null
;
private
onClickBtn
()
{
switch
(
this
.
statusCode
)
{
case
0
:
//去进行
console
.
log
(
"去进行"
);
this
.
todoCallback
();
break
;
case
3
:
//可领取
console
.
log
(
"可领取"
);
break
;
default
:
break
;
}
}
}
\ No newline at end of file
.history/egret/src/startScene/StartScene_20190828113949.ts
0 → 100644
View file @
379a8d7d
import
{
DataManager
}
from
'./../../libs/tw/manager/DataManager'
;
import
{
ModuleTypes
}
from
'./../types/sceneTypes'
;
import
Scene
from
"../views/Scene"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
SceneCtrl
from
'../ctrls/sceneCtrl'
;
import
{
NetManager
}
from
'../../libs/tw/manager/NetManager'
;
import
Loading
from
'../loading/Loading'
;
import
{
Buried
}
from
'../../libs/tw/util/Buried'
;
import
{
GCache
}
from
'../../libs/tc/util/GCache'
;
export
default
class
StartScene1
extends
Scene
{
public
mainbg
:
eui
.
Image
;
// 用于控制全局音乐是否播放和音乐按钮状态
public
static
isPlayMusic
:
boolean
=
true
;
public
get
skinKey
()
{
return
'StartScene'
}
public
get
groupName
()
{
return
'start_scene'
}
constructor
(
data
?)
{
super
(
data
);
//95fcf3
}
initEvents
()
{
super
.
initEvents
();
// this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this);
//this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this);
// this.prizeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_prizeBtn, this);
// this.musicBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTap_musicBtn, this);
}
removeEvents
()
{
super
.
removeEvents
();
// this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this);
//this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this);
// this.prizeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_prizeBtn, this);
// this.musicBtn.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTap_musicBtn, this);
}
start
(
data
?)
{
super
.
start
(
data
);
this
.
percentHeight
=
100
;
}
private
bgtexture
:
egret
.
Texture
;
protected
async
preLoadRes
()
{
//加载背景并设置背景图片
this
.
bgtexture
=
await
RES
.
getResAsync
(
'startBg_jpg'
);
// console.log('载背景并设置背景图片mainscene');
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
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
();
}
this
.
sleep
(
1000
)
console
.
log
(
"test"
)
}
async
sleep
(
time
){
return
new
Promise
(
resolev
=>
{
setTimeout
(
resolev
,
time
)
})
}
private
onLoad
():
void
{
this
.
initUI
();
}
private
initUI
():
void
{
// egret.Tween.get(this.startBtn, {loop:true})
// .to({scaleX:1.05, scaleY:1.05}, 150)
// .to({scaleX:0.9, scaleY:0.9}, 150)
// .to({scaleX:1.05, scaleY:1.05}, 150)
// .to({scaleX:0.9, scaleY:0.9}, 150).wait(500);
}
private
onTap_ruleBtn
():
void
{
console
.
log
(
'点击rule'
);
// PanelCtrl.instance.btnDelay(this.ruleBtn);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
RULE_PANEL
);
}
private
onTap_startBtn
():
void
{
// PanelCtrl.instance.btnDelay(this.startBtn);
NetManager
.
ins
.
getHome
((
succuss
)
=>
{
if
(
!
succuss
)
{
return
;
}
this
.
showMainScene
();
},
this
.
getQueryString
(
"dailyMark"
),
window
[
"CFG"
].
activityId
)
}
private
async
showMainScene
()
{
await
RES
.
loadGroup
(
'msg_panel'
);
await
RES
.
getResAsync
(
'msgBg0_png'
);
await
RES
.
getResAsync
(
'msgBg1_png'
);
await
RES
.
getResAsync
(
'msgBg2_png'
);
await
RES
.
getResAsync
(
'msgBg3_png'
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAIN_SCENE
);
}
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
};
private
onTap_prizeBtn
():
void
{
console
.
log
(
'点击prizeBtn'
);
// PanelCtrl.instance.btnDelay(this.prizeBtn);
window
.
location
.
href
=
this
.
gotoRecord
();
//window["recordUrl"];
}
//获取我的奖品
private
gotoRecord
():
string
{
let
recordUrl
:
string
;
let
oaId
:
number
;
if
(
DataManager
.
ins
.
customCfgData
)
{
oaId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
recordUrl
=
DataManager
.
ins
.
customCfgData
.
recordUrl
;
}
else
{
oaId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
recordUrl
=
window
[
'recordUrl'
];
}
if
(
recordUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
recordUrl
+=
'&origins='
+
oaId
+
'00'
;
}
else
{
recordUrl
+=
'?origins='
+
oaId
+
'00'
;
}
// recordUrl += ',' + (window['plugId'] ? window['plugId'] : 4500) + '01';
// for(let i = 0; i < window['plugIdArr'].length; i++){
// recordUrl += ',' + window['plugIdArr'][i] + '01';
// }
return
recordUrl
;
}
//循环播放动画
private
playAnimation
(
target
:
egret
.
tween
.
TweenGroup
,
isLoop
:
boolean
=
true
):
void
{
if
(
isLoop
)
{
for
(
var
key
in
target
.
items
)
{
target
.
items
[
key
].
props
=
{
loop
:
true
};
}
}
target
.
play
();
}
}
.history/egret/src/startScene/StartScene_20190828114204.ts
0 → 100644
View file @
379a8d7d
import
{
DataManager
}
from
'./../../libs/tw/manager/DataManager'
;
import
{
ModuleTypes
}
from
'./../types/sceneTypes'
;
import
Scene
from
"../views/Scene"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
SceneCtrl
from
'../ctrls/sceneCtrl'
;
import
{
NetManager
}
from
'../../libs/tw/manager/NetManager'
;
import
Loading
from
'../loading/Loading'
;
import
{
Buried
}
from
'../../libs/tw/util/Buried'
;
import
{
GCache
}
from
'../../libs/tc/util/GCache'
;
export
default
class
StartScene1
extends
Scene
{
public
mainbg
:
eui
.
Image
;
// 用于控制全局音乐是否播放和音乐按钮状态
public
static
isPlayMusic
:
boolean
=
true
;
public
get
skinKey
()
{
return
'StartScene'
}
public
get
groupName
()
{
return
'start_scene'
}
constructor
(
data
?)
{
super
(
data
);
//95fcf3
}
initEvents
()
{
super
.
initEvents
();
// this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this);
//this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this);
// this.prizeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_prizeBtn, this);
// this.musicBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTap_musicBtn, this);
}
removeEvents
()
{
super
.
removeEvents
();
// this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this);
//this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this);
// this.prizeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_prizeBtn, this);
// this.musicBtn.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTap_musicBtn, this);
}
start
(
data
?)
{
super
.
start
(
data
);
this
.
percentHeight
=
100
;
}
private
bgtexture
:
egret
.
Texture
;
protected
async
preLoadRes
()
{
//加载背景并设置背景图片
this
.
bgtexture
=
await
RES
.
getResAsync
(
'startBg_jpg'
);
await
this
.
sleep
(
10000
)
// console.log('载背景并设置背景图片mainscene');
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
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
();
}
console
.
log
(
"test"
)
}
async
sleep
(
time
){
return
new
Promise
(
resolev
=>
{
setTimeout
(
resolev
,
time
)
})
}
private
onLoad
():
void
{
this
.
initUI
();
}
private
initUI
():
void
{
// egret.Tween.get(this.startBtn, {loop:true})
// .to({scaleX:1.05, scaleY:1.05}, 150)
// .to({scaleX:0.9, scaleY:0.9}, 150)
// .to({scaleX:1.05, scaleY:1.05}, 150)
// .to({scaleX:0.9, scaleY:0.9}, 150).wait(500);
}
private
onTap_ruleBtn
():
void
{
console
.
log
(
'点击rule'
);
// PanelCtrl.instance.btnDelay(this.ruleBtn);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
RULE_PANEL
);
}
private
onTap_startBtn
():
void
{
// PanelCtrl.instance.btnDelay(this.startBtn);
NetManager
.
ins
.
getHome
((
succuss
)
=>
{
if
(
!
succuss
)
{
return
;
}
this
.
showMainScene
();
},
this
.
getQueryString
(
"dailyMark"
),
window
[
"CFG"
].
activityId
)
}
private
async
showMainScene
()
{
await
RES
.
loadGroup
(
'msg_panel'
);
await
RES
.
getResAsync
(
'msgBg0_png'
);
await
RES
.
getResAsync
(
'msgBg1_png'
);
await
RES
.
getResAsync
(
'msgBg2_png'
);
await
RES
.
getResAsync
(
'msgBg3_png'
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAIN_SCENE
);
}
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
};
private
onTap_prizeBtn
():
void
{
console
.
log
(
'点击prizeBtn'
);
// PanelCtrl.instance.btnDelay(this.prizeBtn);
window
.
location
.
href
=
this
.
gotoRecord
();
//window["recordUrl"];
}
//获取我的奖品
private
gotoRecord
():
string
{
let
recordUrl
:
string
;
let
oaId
:
number
;
if
(
DataManager
.
ins
.
customCfgData
)
{
oaId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
recordUrl
=
DataManager
.
ins
.
customCfgData
.
recordUrl
;
}
else
{
oaId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
recordUrl
=
window
[
'recordUrl'
];
}
if
(
recordUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
recordUrl
+=
'&origins='
+
oaId
+
'00'
;
}
else
{
recordUrl
+=
'?origins='
+
oaId
+
'00'
;
}
// recordUrl += ',' + (window['plugId'] ? window['plugId'] : 4500) + '01';
// for(let i = 0; i < window['plugIdArr'].length; i++){
// recordUrl += ',' + window['plugIdArr'][i] + '01';
// }
return
recordUrl
;
}
//循环播放动画
private
playAnimation
(
target
:
egret
.
tween
.
TweenGroup
,
isLoop
:
boolean
=
true
):
void
{
if
(
isLoop
)
{
for
(
var
key
in
target
.
items
)
{
target
.
items
[
key
].
props
=
{
loop
:
true
};
}
}
target
.
play
();
}
}
.history/egret/src/startScene/StartScene_20190828164233.ts
0 → 100644
View file @
379a8d7d
import
{
DataManager
}
from
'./../../libs/tw/manager/DataManager'
;
import
{
ModuleTypes
}
from
'./../types/sceneTypes'
;
import
Scene
from
"../views/Scene"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
SceneCtrl
from
'../ctrls/sceneCtrl'
;
import
{
NetManager
}
from
'../../libs/tw/manager/NetManager'
;
import
Loading
from
'../loading/Loading'
;
import
{
Buried
}
from
'../../libs/tw/util/Buried'
;
import
{
GCache
}
from
'../../libs/tc/util/GCache'
;
export
default
class
StartScene1
extends
Scene
{
public
mainbg
:
eui
.
Image
;
// 用于控制全局音乐是否播放和音乐按钮状态
public
static
isPlayMusic
:
boolean
=
true
;
public
get
skinKey
()
{
return
'StartScene'
}
public
get
groupName
()
{
return
'start_scene'
}
constructor
(
data
?)
{
super
(
data
);
//95fcf3
}
initEvents
()
{
super
.
initEvents
();
// this.ruleBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this);
//this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this);
// this.prizeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_prizeBtn, this);
// this.musicBtn.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTap_musicBtn, this);
}
removeEvents
()
{
super
.
removeEvents
();
// this.ruleBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_ruleBtn, this);
//this.startBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_startBtn, this);
// this.prizeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_prizeBtn, this);
// this.musicBtn.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTap_musicBtn, this);
}
start
(
data
?)
{
super
.
start
(
data
);
this
.
percentHeight
=
100
;
}
private
bgtexture
:
egret
.
Texture
;
protected
async
preLoadRes
()
{
//加载背景并设置背景图片
this
.
bgtexture
=
await
RES
.
getResAsync
(
'startBg_jpg'
);
// await this.sleep(10000)
// console.log('载背景并设置背景图片mainscene');
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
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
();
}
console
.
log
(
"test"
)
}
async
sleep
(
time
){
return
new
Promise
(
resolev
=>
{
setTimeout
(
resolev
,
time
)
})
}
private
onLoad
():
void
{
this
.
initUI
();
}
private
initUI
():
void
{
// egret.Tween.get(this.startBtn, {loop:true})
// .to({scaleX:1.05, scaleY:1.05}, 150)
// .to({scaleX:0.9, scaleY:0.9}, 150)
// .to({scaleX:1.05, scaleY:1.05}, 150)
// .to({scaleX:0.9, scaleY:0.9}, 150).wait(500);
}
private
onTap_ruleBtn
():
void
{
console
.
log
(
'点击rule'
);
// PanelCtrl.instance.btnDelay(this.ruleBtn);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
RULE_PANEL
);
}
private
onTap_startBtn
():
void
{
// PanelCtrl.instance.btnDelay(this.startBtn);
NetManager
.
ins
.
getHome
((
succuss
)
=>
{
if
(
!
succuss
)
{
return
;
}
this
.
showMainScene
();
},
this
.
getQueryString
(
"dailyMark"
),
window
[
"CFG"
].
activityId
)
}
private
async
showMainScene
()
{
await
RES
.
loadGroup
(
'msg_panel'
);
await
RES
.
getResAsync
(
'msgBg0_png'
);
await
RES
.
getResAsync
(
'msgBg1_png'
);
await
RES
.
getResAsync
(
'msgBg2_png'
);
await
RES
.
getResAsync
(
'msgBg3_png'
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAIN_SCENE
);
}
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
};
private
onTap_prizeBtn
():
void
{
console
.
log
(
'点击prizeBtn'
);
// PanelCtrl.instance.btnDelay(this.prizeBtn);
window
.
location
.
href
=
this
.
gotoRecord
();
//window["recordUrl"];
}
//获取我的奖品
private
gotoRecord
():
string
{
let
recordUrl
:
string
;
let
oaId
:
number
;
if
(
DataManager
.
ins
.
customCfgData
)
{
oaId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
recordUrl
=
DataManager
.
ins
.
customCfgData
.
recordUrl
;
}
else
{
oaId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
recordUrl
=
window
[
'recordUrl'
];
}
if
(
recordUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
recordUrl
+=
'&origins='
+
oaId
+
'00'
;
}
else
{
recordUrl
+=
'?origins='
+
oaId
+
'00'
;
}
// recordUrl += ',' + (window['plugId'] ? window['plugId'] : 4500) + '01';
// for(let i = 0; i < window['plugIdArr'].length; i++){
// recordUrl += ',' + window['plugIdArr'][i] + '01';
// }
return
recordUrl
;
}
//循环播放动画
private
playAnimation
(
target
:
egret
.
tween
.
TweenGroup
,
isLoop
:
boolean
=
true
):
void
{
if
(
isLoop
)
{
for
(
var
key
in
target
.
items
)
{
target
.
items
[
key
].
props
=
{
loop
:
true
};
}
}
target
.
play
();
}
}
egret/src/Main.ts
View file @
379a8d7d
...
@@ -78,7 +78,7 @@ class Main extends eui.UILayer {
...
@@ -78,7 +78,7 @@ class Main extends eui.UILayer {
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
LOADING_SCENE
,
LoadingScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
LOADING_SCENE
,
LoadingScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
MAIN_SCENE
,
MainScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
MAIN_SCENE
,
MainScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
START_SCENE
,
StartScene
_xcj
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
START_SCENE
,
StartScene
1
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
TEAM_SCENE
,
TeamScene
);
SceneCtrl
.
instance
.
registerSceneClass
(
ModuleTypes
.
TEAM_SCENE
,
TeamScene
);
...
...
egret/src/QuestListPanel/QuestListPanel.ts
View file @
379a8d7d
...
@@ -25,7 +25,10 @@ export default class QuestListPanel extends Panel {
...
@@ -25,7 +25,10 @@ export default class QuestListPanel extends Panel {
}
}
protected
async
preLoadRes
()
{
protected
async
preLoadRes
()
{
return
RES
.
loadGroup
(
this
.
groupName
);
await
RES
.
loadGroup
(
this
.
groupName
);
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
}
async
initEvents
()
{
async
initEvents
()
{
...
...
egret/src/startScene/StartScene.ts
View file @
379a8d7d
...
@@ -47,10 +47,14 @@ export default class StartScene1 extends Scene {
...
@@ -47,10 +47,14 @@ export default class StartScene1 extends Scene {
protected
async
preLoadRes
()
{
protected
async
preLoadRes
()
{
//加载背景并设置背景图片
//加载背景并设置背景图片
this
.
bgtexture
=
await
RES
.
getResAsync
(
'startBg_jpg'
);
this
.
bgtexture
=
await
RES
.
getResAsync
(
'startBg_jpg'
);
// await this.sleep(10000)
// console.log('载背景并设置背景图片mainscene');
// console.log('载背景并设置背景图片mainscene');
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
resolve
();
});
});
}
}
protected
onSkinComplete
():
void
{
protected
onSkinComplete
():
void
{
...
@@ -62,6 +66,15 @@ export default class StartScene1 extends Scene {
...
@@ -62,6 +66,15 @@ export default class StartScene1 extends Scene {
if
(
this
.
stage
)
{
if
(
this
.
stage
)
{
this
.
onLoad
();
this
.
onLoad
();
}
}
console
.
log
(
"test"
)
}
async
sleep
(
time
){
return
new
Promise
(
resolev
=>
{
setTimeout
(
resolev
,
time
)
})
}
}
private
onLoad
():
void
{
private
onLoad
():
void
{
...
...
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