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
ed57f269
Commit
ed57f269
authored
Nov 25, 2019
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
35b3a58e
Changes
34
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
330 additions
and
217 deletions
+330
-217
.DS_Store
.DS_Store
+0
-0
build.js
build.js
+11
-1
.DS_Store
egret/.DS_Store
+0
-0
index.html
egret/index.html
+153
-154
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+5
-7
.DS_Store
egret/resource/.DS_Store
+0
-0
creditsTip_panel.tmproject
egret/resource/TextureMerger/creditsTip_panel.tmproject
+0
-1
hbNoPrize.tmproject
egret/resource/TextureMerger/hbNoPrize.tmproject
+1
-0
hbPrize.tmproject
egret/resource/TextureMerger/hbPrize.tmproject
+1
-0
hbRainGame.tmproject
egret/resource/TextureMerger/hbRainGame.tmproject
+1
-0
index_scene.tmproject
egret/resource/TextureMerger/index_scene.tmproject
+1
-0
noMore_panel.tmproject
egret/resource/TextureMerger/noMore_panel.tmproject
+0
-1
noNetWork.tmproject
egret/resource/TextureMerger/noNetWork.tmproject
+1
-0
noPrize_panel.tmproject
egret/resource/TextureMerger/noPrize_panel.tmproject
+0
-1
noTimes_panel.tmproject
egret/resource/TextureMerger/noTimes_panel.tmproject
+0
-1
preload.tmproject
egret/resource/TextureMerger/preload.tmproject
+0
-1
prize_panel.tmproject
egret/resource/TextureMerger/prize_panel.tmproject
+0
-1
start_scene.tmproject
egret/resource/TextureMerger/start_scene.tmproject
+0
-1
.DS_Store
egret/resource/assets/.DS_Store
+0
-0
.DS_Store
egret/resource/assets/noNetWork_panel/.DS_Store
+0
-0
noNetWork_bg.png
egret/resource/assets/noNetWork_panel/noNetWork_bg.png
+0
-0
noNetWork_ok.png
egret/resource/assets/noNetWork_panel/noNetWork_ok.png
+0
-0
default.res.json
egret/resource/default.res.json
+14
-0
default.thm.json
egret/resource/default.thm.json
+19
-16
NoNetWorkPanelSkin.exml
egret/resource/skins/NoNetWorkPanelSkin.exml
+20
-0
MyExmlPlugin.ts
egret/scripts/MyExmlPlugin.ts
+2
-1
Main.ts
egret/src/Main.ts
+2
-3
NoNetWorkPanel.ts
egret/src/Panels/NoNetWorkPanel.ts
+45
-0
RulePanel.ts
egret/src/Panels/RulePanel/RulePanel.ts
+1
-1
NetConst.ts
egret/src/comm/NetConst.ts
+11
-10
onNotSuccess.ts
egret/src/comm/onNotSuccess.ts
+8
-3
IndexScene.ts
egret/src/indexScene/IndexScene.ts
+32
-14
sceneTypes.ts
egret/src/types/sceneTypes.ts
+1
-0
package.json
package.json
+1
-0
No files found.
.DS_Store
View file @
ed57f269
No preview for this file type
build.js
View file @
ed57f269
...
@@ -14,4 +14,14 @@ if (cmd === 'build' && process.argv[3] === 'prod') {
...
@@ -14,4 +14,14 @@ if (cmd === 'build' && process.argv[3] === 'prod') {
if
(
process
.
argv
[
4
]
===
'exml'
)
if
(
process
.
argv
[
4
]
===
'exml'
)
cmd
=
'buildProdEXML'
;
cmd
=
'buildProdEXML'
;
}
}
build
[
cmd
](
'egret'
);
\ No newline at end of file
else
if
(
cmd
===
'build'
&&
process
.
argv
[
3
]
===
'prod2'
)
{
// if (cmd === 'build' && remain[1] === 'prod') {
cmd
=
'notinypng'
;
if
(
process
.
argv
[
4
]
===
'ts'
)
cmd
=
'buildProdTS'
;
if
(
process
.
argv
[
4
]
===
'exml'
)
cmd
=
'buildProdEXML'
;
}
build
[
cmd
](
'egret'
);
console
.
log
();
\ No newline at end of file
egret/.DS_Store
View file @
ed57f269
No preview for this file type
egret/index.html
View file @
ed57f269
This diff is collapsed.
Click to expand it.
egret/libs/tw/manager/NetManager.ts
View file @
ed57f269
...
@@ -325,7 +325,7 @@ export class NetManager extends ABNetManager {
...
@@ -325,7 +325,7 @@ export class NetManager extends ABNetManager {
callback
:
callback
,
callback
:
callback
,
pollingCount
:
pollingCount
,
pollingCount
:
pollingCount
,
pollingCheck
:
pollingCheck
,
pollingCheck
:
pollingCheck
,
hideMsg
:
true
,
//
hideMsg:true,
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
...
@@ -729,13 +729,11 @@ export class NetManager extends ABNetManager {
...
@@ -729,13 +729,11 @@ export class NetManager extends ABNetManager {
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
IQIYI_ELEMENT
,
name
:
NetName
.
IQIYI_ELEMENT
,
uri
:
'/hdtool/recon/ajaxElement'
,
uri
:
'/hdtool/recon/ajaxElement'
,
type
:
'
pos
t'
,
type
:
'
ge
t'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
{
param
:
{
hdType
:
DataManager
.
ins
.
customCfgData
.
hdType
,
duibaId
:
DataManager
.
ins
.
customCfgData
.
hdToolId
,
hdToolId
:
DataManager
.
ins
.
customCfgData
.
hdToolId
,
activityId
:
DataManager
.
ins
.
customCfgData
.
oaId
,
actId
:
DataManager
.
ins
.
customCfgData
.
actId
,
preview
:
DataManager
.
ins
.
customCfgData
.
preview
},
},
callback
:
callback
callback
:
callback
};
};
...
@@ -780,7 +778,7 @@ export class NetManager extends ABNetManager {
...
@@ -780,7 +778,7 @@ export class NetManager extends ABNetManager {
dataType
:
'json'
,
dataType
:
'json'
,
param
:
param
,
param
:
param
,
callback
:
callback
,
callback
:
callback
,
hideMsg
:
tru
e
,
// hideMsg:fals
e,
};
};
this
.
getToken
(
net
);
this
.
getToken
(
net
);
}
}
...
...
egret/resource/.DS_Store
View file @
ed57f269
No preview for this file type
egret/resource/TextureMerger/creditsTip_panel.tmproject
deleted
100644 → 0
View file @
35b3a58e
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"creditsTip_panel","version":5,"files":["../assets/creditsTip_panel/creditsTip_bg.png","../assets/creditsTip_panel/creditsTip_btn.png"]}
\ No newline at end of file
egret/resource/TextureMerger/hbNoPrize.tmproject
0 → 100644
View file @
ed57f269
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"hbNoPrize","version":5,"files":["../assets/hbNoPrize/hbNoPrize_share_tips.png","../assets/hbNoPrize/hbNoPrize_share_btn.png","../assets/hbNoPrize/hbNoPrize_ok_btn.png","../assets/hbNoPrize/hbNoPrize_bg.png"]}
\ No newline at end of file
egret/resource/TextureMerger/hbPrize.tmproject
0 → 100644
View file @
ed57f269
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"hbPrize","version":5,"files":["../assets/hbPrize/hbPrize_bg.png","../assets/hbPrize/hbPrize_item_bg.png","../assets/hbPrize/hbPrize_item_line.png","../assets/hbPrize/hbPrize_ok_btn.png","../assets/hbPrize/hbPrize_share_btn.png","../assets/hbPrize/hbPrize_share_tips.png"]}
\ No newline at end of file
egret/resource/TextureMerger/hbRainGame.tmproject
0 → 100644
View file @
ed57f269
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"hbRainGame","version":5,"files":["../assets/hbGame/hbGame_tips.png","../assets/hbGame/hbGame_hongbao.png","../assets/hbGame/hbGame_hongbao_effect.png","../assets/hbGame/hbGame_bg.png","../assets/hbGame/hbGame_3.png","../assets/hbGame/hbGame_2.png","../assets/hbGame/hbGame_1.png"]}
\ No newline at end of file
egret/resource/TextureMerger/index_scene.tmproject
0 → 100644
View file @
ed57f269
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"index_scene","version":5,"files":["../assets/index_scene/index_bg.png","../assets/index_scene/index_again_btn.png","../assets/index_scene/index_hongbao.png","../assets/index_scene/index_myprize_btn.png","../assets/index_scene/index_panel_bg.png","../assets/index_scene/index_rule_btn.png","../assets/index_scene/index_tips_cuting.png","../assets/index_scene/index_tips_raining.png","../assets/index_scene/index_hongbao_current.png","../assets/index_scene/index_start_btn.png","../assets/index_scene/index_disable_btn.png"]}
\ No newline at end of file
egret/resource/TextureMerger/noMore_panel.tmproject
deleted
100644 → 0
View file @
35b3a58e
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"noMore_panel","version":5,"files":["../assets/noMore_panel/noMore_bg.png"]}
\ No newline at end of file
egret/resource/TextureMerger/noNetWork.tmproject
0 → 100644
View file @
ed57f269
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"noNetWork","version":5,"files":["../assets/noNetWork_panel/noNetWork_bg.png","../assets/noNetWork_panel/noNetWork_ok.png"]}
\ No newline at end of file
egret/resource/TextureMerger/noPrize_panel.tmproject
deleted
100644 → 0
View file @
35b3a58e
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"noPrize_panel","version":5,"files":["../assets/noPrize_panel/noPrize_bg.png"]}
\ No newline at end of file
egret/resource/TextureMerger/noTimes_panel.tmproject
deleted
100644 → 0
View file @
35b3a58e
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"noTimes_panel","version":5,"files":["../assets/noTimes_panel/noTimes_bg.png"]}
\ No newline at end of file
egret/resource/TextureMerger/preload.tmproject
deleted
100644 → 0
View file @
35b3a58e
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["../assets/common/closeBtn.png","../assets/start_scene/start_atc_btn.png","../assets/start_scene/start_myPrize_btn.png"]}
\ No newline at end of file
egret/resource/TextureMerger/prize_panel.tmproject
deleted
100644 → 0
View file @
35b3a58e
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"prize_panel","version":5,"files":["../assets/prize_panel/prize_bg.png","../assets/prize_panel/prize_btn.png"]}
\ No newline at end of file
egret/resource/TextureMerger/start_scene.tmproject
deleted
100644 → 0
View file @
35b3a58e
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"start_scene","version":5,"files":["../assets/start_scene/start_bg.png","../assets/start_scene/start_btn.png","../assets/start_scene/start_panel_bg.png","../assets/start_scene/start_panel.png","../assets/start_scene/start_atc_btn.png","../assets/start_scene/start_myPrize_btn.png"]}
\ No newline at end of file
egret/resource/assets/.DS_Store
View file @
ed57f269
No preview for this file type
egret/resource/assets/noNetWork_panel/.DS_Store
0 → 100644
View file @
ed57f269
File added
egret/resource/assets/noNetWork_panel/noNetWork_bg.png
0 → 100644
View file @
ed57f269
61.1 KB
egret/resource/assets/noNetWork_panel/noNetWork_ok.png
0 → 100644
View file @
ed57f269
15.7 KB
egret/resource/default.res.json
View file @
ed57f269
...
@@ -31,6 +31,10 @@
...
@@ -31,6 +31,10 @@
{
{
"keys"
:
"hbNoPrize_share_tips_png,hbNoPrize_share_btn_png,hbNoPrize_ok_btn_png,hbNoPrize_bg_png"
,
"keys"
:
"hbNoPrize_share_tips_png,hbNoPrize_share_btn_png,hbNoPrize_ok_btn_png,hbNoPrize_bg_png"
,
"name"
:
"hbNoPrize"
"name"
:
"hbNoPrize"
},
{
"keys"
:
"noNetWork_bg_png,noNetWork_ok_png"
,
"name"
:
"noNetWork"
}
}
],
],
"resources"
:
[
"resources"
:
[
...
@@ -213,6 +217,16 @@
...
@@ -213,6 +217,16 @@
"url"
:
"assets/index_scene/index_disable_btn.png"
,
"url"
:
"assets/index_scene/index_disable_btn.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"index_disable_btn_png"
"name"
:
"index_disable_btn_png"
},
{
"url"
:
"assets/noNetWork_panel/noNetWork_bg.png"
,
"type"
:
"image"
,
"name"
:
"noNetWork_bg_png"
},
{
"url"
:
"assets/noNetWork_panel/noNetWork_ok.png"
,
"type"
:
"image"
,
"name"
:
"noNetWork_ok_png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/default.thm.json
View file @
ed57f269
{
{
"skins"
:
{},
"skins"
:
{},
"autoGenerateExmlsList"
:
true
,
"autoGenerateExmlsList"
:
true
,
"exmls"
:
[
"exmls"
:
[
"resource/skins/LoadingSceneSkin.exml"
,
"resource/skins/HbGameSkin.exml"
,
"resource/skins/LoadingSkin.exml"
,
"resource/skins/HbNoPrizeSkin.exml"
,
"resource/skins/HbGameSkin.exml"
,
"resource/skins/HbPrizeItemSkin.exml"
,
"resource/skins/HbPrizeSkin.exml"
,
"resource/skins/HbPrizeSkin.exml"
,
"resource/skins/HbNoPrizeSkin.exml"
,
"resource/skins/HbPrize_backSkin.exml"
,
"resource/skins/IndexSceneSkin.exml"
,
"resource/skins/IndexSceneSkin.exml"
,
"resource/skins/HbPrizeItemSkin.exml"
,
"resource/skins/LoadingSceneSkin.exml"
,
"resource/skins/ToastPanelSkin.exml"
,
"resource/skins/LoadingSkin.exml"
,
"resource/skins/ui/IconButtonSkin.exml"
,
"resource/skins/NoNetWorkPanelSkin.exml"
,
"resource/skins/ui/ProgressBarSkin.exml"
,
"resource/skins/RulePanelSkin.exml"
,
"resource/skins/ui/TimeProgressBarSkin.exml"
"resource/skins/ToastPanelSkin.exml"
,
],
"resource/skins/ui/IconButtonSkin.exml"
,
"path"
:
"resource/default.thm.json"
"resource/skins/ui/ProgressBarSkin.exml"
,
"resource/skins/ui/TimeProgressBarSkin.exml"
],
"path"
:
"resource/default.thm.json"
}
}
\ No newline at end of file
egret/resource/skins/NoNetWorkPanelSkin.exml
0 → 100644
View file @
ed57f269
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"CreditsTip"
width=
"750"
height=
"1335"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
y=
"205"
source=
"noNetWork_bg_png"
horizontalCenter=
"0"
/>
<e:Button
id=
"ok_btn"
label=
""
y=
"703"
scaleX=
"1"
scaleY=
"1"
anchorOffsetY=
"0"
anchorOffsetX=
"0"
horizontalCenter=
"0"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"noNetWork_ok_png"
source.down=
"noNetWork_ok_png"
source.disabled=
"noNetWork_ok_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"closeBtn"
label=
""
x=
"603"
y=
"274"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeBtn_png"
source.down=
"closeBtn_png"
source.disabled=
"closeBtn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
.33" anchorOffsetX="9.33" anchorOffsetY="25.33"/>
</e:Skin>
\ No newline at end of file
egret/scripts/MyExmlPlugin.ts
View file @
ed57f269
...
@@ -14,7 +14,8 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
...
@@ -14,7 +14,8 @@ export class MyExmlPlugin extends ExmlPlugin2 implements plugins.Command {
'msgBg1.png'
,
'msgBg1.png'
,
'msgBg2.png'
,
'msgBg2.png'
,
'msgBg3.png'
,
'msgBg3.png'
,
'main_star_an.png'
'main_star_an.png'
,
'cutTimeFont.png'
,
];
];
if
(
excludes
.
indexOf
(
file
.
basename
)
!=
-
1
)
{
if
(
excludes
.
indexOf
(
file
.
basename
)
!=
-
1
)
{
return
file
;
return
file
;
...
...
egret/src/Main.ts
View file @
ed57f269
...
@@ -21,9 +21,7 @@ import IndexScene from "./indexScene/IndexScene";
...
@@ -21,9 +21,7 @@ import IndexScene from "./indexScene/IndexScene";
import
HbPrize
from
"./HongbaoRain/HbPrize"
;
import
HbPrize
from
"./HongbaoRain/HbPrize"
;
import
HbNoPrize
from
"./HongbaoRain/HbNoPrize"
;
import
HbNoPrize
from
"./HongbaoRain/HbNoPrize"
;
import
HbGame
from
"./HongbaoRain/HbGame"
;
import
HbGame
from
"./HongbaoRain/HbGame"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
NoNetWorkPanel
from
"./Panels/NoNetWorkPanel"
;
import
{
ABNetManager
}
from
"../libs/tc/manager/ABNetManager"
;
import
{
showToast
}
from
"./comm/UtilsConst"
;
//////
//////
...
@@ -67,6 +65,7 @@ class Main extends eui.UILayer {
...
@@ -67,6 +65,7 @@ class Main extends eui.UILayer {
[
ModuleTypes
.
RULE_PANEL
,
RulePanel
],
[
ModuleTypes
.
RULE_PANEL
,
RulePanel
],
[
ModuleTypes
.
HBPRIZE_PANEL
,
HbPrize
],
[
ModuleTypes
.
HBPRIZE_PANEL
,
HbPrize
],
[
ModuleTypes
.
HBNOPRIZE_PANEL
,
HbNoPrize
],
[
ModuleTypes
.
HBNOPRIZE_PANEL
,
HbNoPrize
],
[
ModuleTypes
.
NO_NETWORK_PANEL
,
NoNetWorkPanel
],
]);
]);
TopLayerCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
TOAST_PANEL
,
ToastPanel
);
TopLayerCtrl
.
instance
.
registerPanelClass
(
ModuleTypes
.
TOAST_PANEL
,
ToastPanel
);
...
...
egret/src/Panels/NoNetWorkPanel.ts
0 → 100644
View file @
ed57f269
import
Panel
from
"../views/Panel"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
export
default
class
NoNetWorkPanel
extends
Panel
{
public
closeBtn
:
eui
.
Button
;
public
ok_btn
:
eui
.
Button
;
constructor
(
data
?)
{
super
();
}
start
()
{
super
.
start
();
this
.
onLoad
();
}
protected
getTapEvts
():
any
[]
{
return
super
.
getTapEvts
().
concat
([
[
this
.
ok_btn
,
this
.
onTouchClose
,
this
],
[
this
.
closeBtn
,
this
.
onTouchClose
,
this
],
])
}
// onTouchClose(): any {
// // SceneCtrl.instance.change(ModuleTypes.INDEX_SCENE);
// return super.onTouchClose();
// }
protected
onLoad
():
void
{
this
.
initUI
();
}
private
initUI
():
void
{
}
public
get
skinKey
()
{
return
'NoNetWorkPanel'
;
}
get
groupName
()
{
return
'noNetWork'
;
}
}
\ No newline at end of file
egret/src/Panels/RulePanel/RulePanel.ts
View file @
ed57f269
...
@@ -8,7 +8,7 @@ export default class RulePanel extends Panel {
...
@@ -8,7 +8,7 @@ export default class RulePanel extends Panel {
public
ruleLabel
:
eui
.
Label
;
public
ruleLabel
:
eui
.
Label
;
public
get
skinKey
()
{
return
'RulePanel'
}
public
get
skinKey
()
{
return
'RulePanel'
}
public
get
groupName
()
{
return
'prize_panel'
}
//
public get groupName() { return 'prize_panel' }
constructor
(
data
?)
{
constructor
(
data
?)
{
super
(
data
);
super
(
data
);
...
...
egret/src/comm/NetConst.ts
View file @
ed57f269
...
@@ -15,17 +15,18 @@ export const JoinGame = function() {
...
@@ -15,17 +15,18 @@ export const JoinGame = function() {
reject
(
res
);
reject
(
res
);
return
;
return
;
}
}
resolve
(
res
);
const
data
=
res
.
data
;
const
data
=
res
.
data
;
NetManager
.
ins
.
getStartStatus
((
success
,
res
)
=>
{
//
NetManager.ins.getStartStatus((success, res) => {
// Loading.instace.hide();
//
// Loading.instace.hide();
if
(
!
success
)
{
//
if(!success) {
reject
(
res
);
//
reject(res);
return
;
//
return;
}
//
}
resolve
(
res
);
//
resolve(res);
},
data
,
(
res
)
=>
{
//
}, data, (res) => {
return
res
.
code
!=
"0000000000"
;
//
return res.code != "0000000000";
},
10
);
//
}, 10);
});
});
});
});
};
};
...
...
egret/src/comm/onNotSuccess.ts
View file @
ed57f269
import
{
Data
}
from
"../../libs/tw/data/Data"
;
import
{
Data
}
from
"../../libs/tw/data/Data"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
showToast
}
from
"./UtilsConst"
;
import
{
showToast
}
from
"./UtilsConst"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
export
const
onNotSuccess
=
function
(
data
?:
Data
,
netname
?:
NetName
)
{
export
const
onNotSuccess
=
function
(
data
?:
Data
,
netname
?:
NetName
)
{
if
(
!
data
)
{
if
(
!
data
)
{
showToast
(
'网络异常
\
n请隔一段时间再尝试'
);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NO_NETWORK_PANEL
);
// showToast('网络异常\n请隔一段时间再尝试');
return
;
return
;
}
}
if
(
data
.
code
==
'E999999999'
)
{
//系统级别错误 系统异常,\n请刷新后重试。
if
(
data
.
code
==
'E999999999'
)
{
//系统级别错误 系统异常,\n请刷新后重试。
showToast
(
'网络异常
\
n请隔一段时间再尝试'
);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NO_NETWORK_PANEL
);
// showToast('网络异常\n请隔一段时间再尝试');
}
else
if
(
data
.
code
==
'E100201001'
)
{
}
else
if
(
data
.
code
==
'E100201001'
)
{
showToast
(
'请登录后重试。'
);
showToast
(
'请登录后重试。'
);
}
else
if
(
data
.
code
==
'E100201007'
)
{
}
else
if
(
data
.
code
==
'E100201007'
)
{
...
@@ -16,7 +20,8 @@ export const onNotSuccess = function(data?: Data, netname?: NetName) {
...
@@ -16,7 +20,8 @@ export const onNotSuccess = function(data?: Data, netname?: NetName) {
}
else
if
(
data
.
code
==
'E100202007'
||
data
.
code
==
'E100202008'
||
data
.
code
==
'E100202009'
||
data
.
code
==
'E100202010'
)
{
}
else
if
(
data
.
code
==
'E100202007'
||
data
.
code
==
'E100202008'
||
data
.
code
==
'E100202009'
||
data
.
code
==
'E100202010'
)
{
showToast
(
'对不起 您的今日游戏次数已达上限 明天再来吧~'
);
showToast
(
'对不起 您的今日游戏次数已达上限 明天再来吧~'
);
}
else
{
//其他异常
}
else
{
//其他异常
showToast
(
'网络异常
\
n请隔一段时间再尝试'
);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NO_NETWORK_PANEL
);
// showToast('网络异常\n请隔一段时间再尝试');
}
}
};
};
\ No newline at end of file
egret/src/indexScene/IndexScene.ts
View file @
ed57f269
import
Scene
from
"../views/Scene"
;
import
Scene
from
"../views/Scene"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
{
JoinGame
}
from
"../comm/NetConst"
;
import
{
gotoRecord
,
showToast
}
from
"../comm/UtilsConst"
;
import
{
gotoRecord
,
showToast
}
from
"../comm/UtilsConst"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
CutTimer
from
"../comm/CutTimer"
;
import
CutTimer
from
"../comm/CutTimer"
;
import
Utils
from
"../comm/Utils"
;
import
Utils
from
"../comm/Utils"
;
import
tr
=
egret
.
sys
.
tr
;
import
{
getlogItem
}
from
"../getlogItem"
;
import
{
getlogItem
}
from
"../getlogItem"
;
import
{
Data
}
from
"../../libs/tw/data/Data"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
HtmlTextParser
}
from
"../../libs/tc/util/HtmlTextParser"
;
import
{
HtmlTextParser
}
from
"../../libs/tc/util/HtmlTextParser"
;
...
@@ -34,7 +31,7 @@ export default class IndexScene extends Scene {
...
@@ -34,7 +31,7 @@ export default class IndexScene extends Scene {
}
}
public
get
groupName
()
{
public
get
groupName
()
{
return
'index'
return
'index
_scene
'
}
}
constructor
(
data
?)
{
constructor
(
data
?)
{
...
@@ -53,7 +50,8 @@ export default class IndexScene extends Scene {
...
@@ -53,7 +50,8 @@ export default class IndexScene extends Scene {
private
onTouchTap
(
e
:
egret
.
TouchEvent
)
{
private
onTouchTap
(
e
:
egret
.
TouchEvent
)
{
switch
(
e
.
target
)
{
switch
(
e
.
target
)
{
case
this
.
btn
:
// 开始按钮,再次开始按钮
case
this
.
btn
:
// 开始按钮,再次开始按钮
const
extra
=
DataManager
.
ins
.
getData
(
NetName
.
IQIYI_ELEMENT
).
data
;
const
data
=
DataManager
.
ins
.
getData
(
NetName
.
IQIYI_ELEMENT
).
data
;
const
extra
=
data
.
extra
;
extra
.
shared
?
NetManager
.
ins
.
clickLog
(
getlogItem
(
34
))
:
NetManager
.
ins
.
clickLog
(
getlogItem
(
21
));
extra
.
shared
?
NetManager
.
ins
.
clickLog
(
getlogItem
(
34
))
:
NetManager
.
ins
.
clickLog
(
getlogItem
(
21
));
this
.
btn
.
touchEnabled
=
false
;
this
.
btn
.
touchEnabled
=
false
;
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
HBGAME_SCENE
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
HBGAME_SCENE
);
...
@@ -94,7 +92,7 @@ export default class IndexScene extends Scene {
...
@@ -94,7 +92,7 @@ export default class IndexScene extends Scene {
private
initUI
():
void
{
private
initUI
():
void
{
this
.
scroller
.
height
=
this
.
width
/
window
.
innerWidth
*
window
.
innerHeight
;
this
.
scroller
.
height
=
this
.
width
/
window
.
innerWidth
*
window
.
innerHeight
;
let
_str
=
`
今日还剩</spen><u><font color="#72f8fd">
${
window
[
'hbTips'
]}
</font></u>次免费抽奖机会
`
;
let
_str
=
`
抢</spen><u><font color="#72f8fd">
${
window
[
'hbTips'
]}
</font></u>元现金红包
`
;
this
.
hbLabel
.
textFlow
=
new
HtmlTextParser
().
parse
(
_str
);
this
.
hbLabel
.
textFlow
=
new
HtmlTextParser
().
parse
(
_str
);
this
.
setMidGroup
();
this
.
setMidGroup
();
this
.
ajaxElement
();
this
.
ajaxElement
();
...
@@ -120,7 +118,20 @@ export default class IndexScene extends Scene {
...
@@ -120,7 +118,20 @@ export default class IndexScene extends Scene {
private
ajaxElement
()
{
private
ajaxElement
()
{
NetManager
.
ins
.
iqiyiAjaxElement
((
success
,
res
)
=>
{
NetManager
.
ins
.
iqiyiAjaxElement
((
success
,
res
)
=>
{
if
(
!
success
)
{
// 设置红包
for
(
let
i
=
1
;
i
<
4
;
i
++
)
{
this
[
`hongbao
${
i
}
`
].
source
=
'index_hongbao_png'
;
this
[
`label
${
i
}
`
].
alpha
=
0.8
;
}
if
(
!
success
||
!
res
||
!
res
.
data
||
!
res
.
data
.
extra
){
this
.
btn
.
visible
=
true
;
this
.
btn
.
source
=
'index_disable_btn_png'
;
this
.
btn
.
touchEnabled
=
false
;
this
.
btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap
,
this
);
this
.
btn
.
y
=
9
;
this
.
cutLabel
.
visible
=
false
;
this
.
tipsLabel
.
visible
=
false
;
return
;
return
;
}
}
// console.log(res);
// console.log(res);
...
@@ -153,8 +164,20 @@ export default class IndexScene extends Scene {
...
@@ -153,8 +164,20 @@ export default class IndexScene extends Scene {
this
.
tipsLabel
.
visible
=
false
;
this
.
tipsLabel
.
visible
=
false
;
}
else
{
}
else
{
this
.
tipsLabel
.
y
=
5
;
this
.
tipsLabel
.
y
=
5
;
this
.
tipsLabel
.
text
=
`距离下一场开始还剩`
;
switch
(
true
)
{
this
.
btn
.
visible
=
false
;
case
(
currentTimeSlot
==
1
||
currentTimeSlot
==
2
):
this
.
tipsLabel
.
text
=
`距离第一场开始还剩`
;
break
;
case
(
currentTimeSlot
==
4
):
this
.
tipsLabel
.
text
=
`距离第二场开始还剩`
;
break
;
case
(
currentTimeSlot
==
6
):
this
.
tipsLabel
.
text
=
`距离第三场开始还剩`
;
break
;
default
:
this
.
tipsLabel
.
text
=
`距离第一场开始还剩`
;
break
;
}
this
.
cutLabel
.
visible
=
true
;
this
.
cutLabel
.
visible
=
true
;
this
.
tips_img
.
source
=
'index_tips_cuting_png'
;
this
.
tips_img
.
source
=
'index_tips_cuting_png'
;
_label
=
this
.
cutLabel
;
_label
=
this
.
cutLabel
;
...
@@ -173,11 +196,6 @@ export default class IndexScene extends Scene {
...
@@ -173,11 +196,6 @@ export default class IndexScene extends Scene {
this
.
cutTimer
.
start
(
nextTimestamp
-
timestamp
+
3000
);
this
.
cutTimer
.
start
(
nextTimestamp
-
timestamp
+
3000
);
}
}
// 设置红包
for
(
let
i
=
1
;
i
<
4
;
i
++
)
{
this
[
`hongbao
${
i
}
`
].
source
=
'index_hongbao_png'
;
this
[
`label
${
i
}
`
].
alpha
=
0.8
;
}
let
_hbData
=
{
3
:
'1'
,
5
:
'2'
,
7
:
'3'
};
let
_hbData
=
{
3
:
'1'
,
5
:
'2'
,
7
:
'3'
};
if
(
Utils
.
isInArray
(
currentTimeSlot
,
canGameArr
)
&&
extra
.
joinCount
>
0
)
{
if
(
Utils
.
isInArray
(
currentTimeSlot
,
canGameArr
)
&&
extra
.
joinCount
>
0
)
{
this
[
`hongbao
${
_hbData
[
currentTimeSlot
]}
`
].
source
=
'index_hongbao_current_png'
;
this
[
`hongbao
${
_hbData
[
currentTimeSlot
]}
`
].
source
=
'index_hongbao_current_png'
;
...
...
egret/src/types/sceneTypes.ts
View file @
ed57f269
...
@@ -16,5 +16,6 @@ export enum ModuleTypes {
...
@@ -16,5 +16,6 @@ export enum ModuleTypes {
HBPRIZE_PANEL
,
HBPRIZE_PANEL
,
HBNOPRIZE_PANEL
,
HBNOPRIZE_PANEL
,
RULE_PANEL
,
RULE_PANEL
,
NO_NETWORK_PANEL
,
}
}
\ No newline at end of file
package.json
View file @
ed57f269
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
"scripts"
:
{
"scripts"
:
{
"dev"
:
"node build.js dev"
,
"dev"
:
"node build.js dev"
,
"build"
:
"node build.js build prod"
,
"build"
:
"node build.js build prod"
,
"build2"
:
"node build.js build prod2"
,
"buildTS"
:
"node build.js build prod ts"
,
"buildTS"
:
"node build.js build prod ts"
,
"buildExml"
:
"node build.js build prod exml"
,
"buildExml"
:
"node build.js build prod exml"
,
"backup"
:
"node build.js backup"
,
"backup"
:
"node build.js backup"
,
...
...
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