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
e1844f16
Commit
e1844f16
authored
Jul 03, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
7dab8b87
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
313 additions
and
330 deletions
+313
-330
index.html
egret/index.html
+1
-23
doStart.ts
egret/libs/new_tw/ctrls/doStart.ts
+0
-42
hdGameDoDojoin.ts
egret/libs/new_tw/ctrls/hdGameDoDojoin.ts
+31
-0
submit.ts
egret/libs/new_tw/ctrls/submit.ts
+9
-10
submitAfterDostart.ts
egret/libs/new_tw/ctrls/submitAfterDostart.ts
+0
-14
getCountTxt.ts
egret/libs/new_tw/datas/getCountTxt.ts
+0
-17
getStartBtnEnable.ts
egret/libs/new_tw/datas/getStartBtnEnable.ts
+0
-15
MainBase.ts
egret/libs/new_wx/MainBase.ts
+7
-49
NoPrizePanel.ts
egret/libs/new_wx/components/NoPrizePanel.ts
+1
-22
RulePanel.ts
egret/libs/new_wx/components/RulePanel.ts
+5
-10
CreditsType.ts
egret/libs/tw/data/custom/ajaxElement/CreditsType.ts
+5
-0
IcreditsConf.ts
egret/libs/tw/data/custom/ajaxElement/IcreditsConf.ts
+9
-0
IcreditsConfPrize.ts
egret/libs/tw/data/custom/ajaxElement/IcreditsConfPrize.ts
+6
-0
ReconAjaxElementData.ts
...t/libs/tw/data/custom/ajaxElement/ReconAjaxElementData.ts
+80
-0
DoJoinData.ts
egret/libs/tw/data/custom/doJoin/DoJoinData.ts
+3
-3
DataManager.ts
egret/libs/tw/manager/DataManager.ts
+50
-49
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+73
-15
PlayScene.ts
egret/src/playScene/PlayScene.ts
+14
-15
StartScene.ts
egret/src/startScene/StartScene.ts
+16
-36
doJoin.json
mock/json/doJoin.json
+0
-7
getCredits.json
mock/json/getCredits.json
+2
-2
ajaxElement.json
mock/newGame/ajaxElement.json
+1
-1
No files found.
egret/index.html
View file @
e1844f16
...
@@ -50,29 +50,7 @@
...
@@ -50,29 +50,7 @@
window
[
'renderMode'
]
=
'webgl'
;
window
[
'renderMode'
]
=
'webgl'
;
window
[
'development'
]
=
true
;
window
[
'development'
]
=
true
;
var
gameId
=
1
;
var
gameId
=
1
;
var
CFG
=
{
var
CFG
=
{
"actId"
:
"3335069"
,
"oaId"
:
"3335069"
,
"unitName"
:
"积分"
,
"btnUnitName"
:
"积分"
,
"doJoin"
:
"/hdtool/doJoin?dpm=1.3.1.0&activityId=3335069"
,
"quireOrder"
:
"/hdtool/getOrderStatus"
,
"styleConfig"
:
"/hdtool/getHdtoolConfig"
,
"getElement"
:
"/hdtool/ajaxElement"
,
"getPrizeDetail"
:
"/hdtool/prizeDetail"
,
"ajaxThroughInfo"
:
"/hdtool/ajaxThroughInfo"
,
"throughSubmit"
:
"/hdtool/throughSubmit"
,
"gameGetOrder"
:
"/hdtool/getOrderInfo"
,
"gameSubmit"
:
"/hdtool/gameSubmit"
,
"doSubmit"
:
"/hdtool/submit"
,
"adslotId"
:
""
,
"consumerId"
:
"1"
,
"isNotLoginUser"
:
false
,
"uid"
:
"1"
,
"hdType"
:
"duiba"
,
"hdToolId"
:
"42363"
,
"appType"
:
"credits"
,
"subType"
:
"custom"
,
"directSendCoupon"
:
"false"
,
"ajaxAction"
:
""
,
"recommendQueue"
:
"/recommend/getRecommend"
,
"recommendSkin"
:
"/recommend/getRecommendSkin"
,
"isShowDetail"
:
true
,
"preview"
:
false
,
"from"
:
""
,
"login"
:
"//activity.m.duiba.com.cn/hdtool/login?dpm=1.3.3.0"
,
"flowRedirectUrl"
:
""
,
"flowRedirectTuiaUrl"
:
""
,
"isOpenRecommend"
:
false
,
"getCreditsLink"
:
"http://baidu.com?uid=1&dbnewopen"
,
"appId"
:
"1"
,
"recordUrl"
:
"//activity.m.duiba.com.cn/crecord/record?dbnewopen&dpm=1.3.2.0"
,
"shareDesc"
:
"分享分享文案文案"
,
"entranceDesc"
:
"测试领奖,也可到我的奖品领奖,24小时内有效哦"
,
"isSHowMeat"
:
true
,
"needCouponModal"
:
true
,
"needRecommendModal"
:
true
,
"asyncFiles"
:
[],
"shareAndroidLinkActivity"
:
"http://www.duiba.com.cn"
,
"shareIosLinkActivity"
:
"http://www.iqiyi.com"
,
"appName"
:
"custom"
,
"needShare"
:
true
,
"shareTitle"
:
""
,
"shareSubTitle"
:
""
,
"sharePicUrl"
:
""
,
"shareLink"
:
""
,
"shareAndroidDeeplink"
:
""
,
"shareIOSDeeplink"
:
""
};
appInfo
:
{
"appId"
:
1
,
"earnCreditsUrl"
:
"https://www.baidu.com/"
,
"loginProgram"
:
""
,
"open"
:
false
,
"openLogin"
:
false
},
gameInfo
:
{
"id"
:
1317
,
"oaId"
:
19951
,
"offDate"
:
"2018-04-17 11:00"
,
"openTotalScoreSwitch"
:
false
,
"rankPrize"
:
true
,
"skincontent"
:
""
},
extra
:
{
"embedDomain"
:
"//embedlog.duibatest.com.cn"
},
defenseStrategy
:
{
"scoreUnit"
:
10
}
}
var
recordUrl
=
'record/'
;
var
recordUrl
=
'record/'
;
var
resPath
=
''
;
var
resPath
=
''
;
function
resolve
(
a
)
{
function
resolve
(
a
)
{
...
...
egret/libs/new_tw/ctrls/doStart.ts
deleted
100644 → 0
View file @
7dab8b87
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
{
DataManager
}
from
"../../../libs/tw/manager/DataManager"
;
/**
* 开始游戏
* @param callback
* @param isAgain
* @param credits
* @param customizedType
*/
const
doStart
=
(
callback
:
Function
,
isAgain
=
false
,
credits
?:
number
,
customizedType
?:
number
)
=>
{
if
(
window
[
'requirelogin'
])
{
window
[
'requirelogin'
]();
return
;
}
NetManager
.
ins
.
doStart
((
success
:
boolean
)
=>
{
if
(
success
)
{
getStartOrderStatus
(
callback
,
customizedType
);
}
else
{
callback
(
success
);
}
},
isAgain
,
credits
,
customizedType
);
}
/**
* 查询订单结果
* @param callback
* @param ticketId
* @param customizedType
*/
const
getStartOrderStatus
=
(
callback
:
Function
,
customizedType
?:
number
)
=>
{
NetManager
.
ins
.
getStartStatus
(
callback
,
DataManager
.
ins
.
doStartData
.
ticketId
,
()
=>
{
return
DataManager
.
ins
.
getStartStatusData
.
code
!=
1
;
},
5
,
customizedType
);
}
export
default
doStart
;
\ No newline at end of file
egret/libs/new_tw/ctrls/hdGameDoDojoin.ts
0 → 100644
View file @
e1844f16
import
{
DataManager
}
from
"../../tw/manager/DataManager"
;
import
{
NetManager
}
from
"../../tw/manager/NetManager"
;
const
getHdGameOrderStatus
=
(
callback
:
Function
):
void
=>
{
const
dojoin
=
DataManager
.
ins
.
getData
(
'dojoin'
);
NetManager
.
ins
.
getNgameStartStatus
(
callback
,
dojoin
.
data
,
()
=>
{
const
data
=
DataManager
.
ins
.
getData
(
'getNgameStartStatus'
);
return
data
.
code
==
'C000000001'
;
});
}
/**
* 活动工具类型游戏子类型抽奖
* @param callback
* @param nextStep 下一步做什么,轮询结果或者前置开奖等
*/
const
hdGameDoDojoin
=
(
callback
:
Function
,
collectRuleId
?:
number
):
void
=>
{
if
(
window
[
'uid'
]
==
'not_login'
)
{
window
[
'requirelogin'
]();
return
;
}
NetManager
.
ins
.
doJoin
((
success
:
boolean
)
=>
{
if
(
success
)
{
getHdGameOrderStatus
(
callback
);
}
else
{
callback
(
success
);
}
});
}
export
default
hdGameDoDojoin
\ No newline at end of file
egret/libs/new_tw/ctrls/submit.ts
View file @
e1844f16
...
@@ -23,21 +23,20 @@ const submit = (callback: Function, score: number, checkScore?: boolean, customi
...
@@ -23,21 +23,20 @@ const submit = (callback: Function, score: number, checkScore?: boolean, customi
* @param customizedType 定制类型 1推币机
* @param customizedType 定制类型 1推币机
*/
*/
const
gameSubmitData
=
(
callback
:
Function
,
score
:
number
,
allDynamics
:
IDynamicData
[][],
checkScore
?:
boolean
,
customizedType
?:
number
)
=>
{
const
gameSubmitData
=
(
callback
:
Function
,
score
:
number
,
allDynamics
:
IDynamicData
[][],
checkScore
?:
boolean
,
customizedType
?:
number
)
=>
{
NetManager
.
ins
.
gameSubmit
(
NetManager
.
ins
.
n
gameSubmit
(
(
success
:
boolean
)
=>
{
(
success
:
boolean
)
=>
{
if
(
success
)
{
if
(
success
)
{
get
SubmitResult
(
callback
,
DataManager
.
ins
.
gameSubmitData
.
orderId
);
get
OrderStatus
(
callback
,
DataManager
.
ins
.
getData
(
'dojoin'
).
data
);
}
else
{
}
else
{
callback
(
success
);
callback
(
success
);
}
}
},
},
DataManager
.
ins
.
doStartData
.
ticketId
,
DataManager
.
ins
.
getData
(
'dojoin'
).
data
,
score
,
score
,
'[]'
,
'[]'
,
DataManager
.
ins
.
doStartData
.
submitToken
,
'[]'
,
JSON
.
stringify
(
allDynamics
),
DataManager
.
ins
.
getData
(
'getNgameStartStatus'
).
data
.
submitToken
,
checkScore
,
window
[
'rankId'
]);
customizedType
);
}
}
/**
/**
...
@@ -45,9 +44,9 @@ const gameSubmitData = (callback: Function, score: number, allDynamics: IDynamic
...
@@ -45,9 +44,9 @@ const gameSubmitData = (callback: Function, score: number, allDynamics: IDynamic
* @param callback
* @param callback
* @param orderId
* @param orderId
*/
*/
const
get
SubmitResult
=
(
callback
:
Function
,
orderId
:
number
)
=>
{
const
get
OrderStatus
=
(
callback
:
Function
,
orderId
:
number
)
=>
{
NetManager
.
ins
.
get
SubmitResult
(
callback
,
orderId
,
()
=>
{
NetManager
.
ins
.
get
OrderStatus
(
callback
,
orderId
,
()
=>
{
return
DataManager
.
ins
.
g
ameGetSubmitResultData
.
flag
;
return
DataManager
.
ins
.
g
etData
(
'getOrderStatus'
).
code
==
'C000000001'
;
});
});
}
}
...
...
egret/libs/new_tw/ctrls/submitAfterDostart.ts
deleted
100644 → 0
View file @
7dab8b87
import
doStart
from
"./doStart"
;
import
submit
from
"./submit"
;
const
submitAfterDostart
=
(
cb
,
score
)
=>
{
doStart
(
()
=>
{
setTimeout
(()
=>
{
submit
(
cb
,
score
)
},
200
);
//延迟200ms,这是后端约定
}
)
}
export
default
submitAfterDostart
\ No newline at end of file
egret/libs/new_tw/datas/getCountTxt.ts
deleted
100644 → 0
View file @
7dab8b87
import
{
DataManager
}
from
"../../tw/manager/DataManager"
;
/**
* 剩余次数
* 为了按钮字体的美观,不展示开始游戏之外的文案,非常规状态由业务文案代替展示。
*/
const
getCountTxt
=
()
=>
{
let
txt
:
string
;
if
(
DataManager
.
ins
.
getInfoData
.
status
.
code
!=
0
)
{
txt
=
DataManager
.
ins
.
getInfoData
.
status
.
btnText
;
}
else
{
txt
=
DataManager
.
ins
.
getInfoData
.
status
.
text
;
}
return
txt
;
}
export
default
getCountTxt
;
\ No newline at end of file
egret/libs/new_tw/datas/getStartBtnEnable.ts
deleted
100644 → 0
View file @
7dab8b87
import
{
DataManager
}
from
"../../tw/manager/DataManager"
;
/**
* 开始游戏按钮状态
*/
const
getStartBtnEnable
=
()
=>
{
let
enable
:
boolean
;
if
(
DataManager
.
ins
.
getInfoData
.
status
.
btnDisable
||
DataManager
.
ins
.
getInfoData
.
status
.
code
==
6
)
{
enable
=
false
;
}
else
{
enable
=
true
;
}
return
enable
;
}
export
default
getStartBtnEnable
;
\ No newline at end of file
egret/libs/new_wx/MainBase.ts
View file @
e1844f16
import
PlayScene
from
"../../src/playScene/PlayScene"
;
import
PlayScene
from
"../../src/playScene/PlayScene"
;
import
StartScene
from
"../../src/startScene/StartScene"
;
import
StartScene
from
"../../src/startScene/StartScene"
;
import
getResPath
from
"../new_tc/getResPath"
;
import
getResPath
from
"../new_tc/getResPath"
;
import
{
check_webp_feature
}
from
"../tc/util/GFun"
;
import
{
DataManager
}
from
"../tw/manager/DataManager"
;
import
{
DataManager
}
from
"../tw/manager/DataManager"
;
import
{
NetManager
}
from
"../tw/manager/NetManager"
;
import
{
NetManager
}
from
"../tw/manager/NetManager"
;
import
AssetAdapter
from
"./adapter/AssetAdapter"
;
import
AssetAdapter
from
"./adapter/AssetAdapter"
;
...
@@ -20,14 +19,13 @@ import { ModuleTypes } from "./types/sceneTypes";
...
@@ -20,14 +19,13 @@ import { ModuleTypes } from "./types/sceneTypes";
import
layers
from
"./views/layers"
;
import
layers
from
"./views/layers"
;
import
RelivePanel
from
"../../src/panels/RelivePanel"
;
import
RelivePanel
from
"../../src/panels/RelivePanel"
;
import
NoPrizePanel
from
"./components/NoPrizePanel"
;
import
NoPrizePanel
from
"./components/NoPrizePanel"
;
import
{
Buried
}
from
"../tw/util/Buried"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
constructor
()
{
super
();
super
();
check_webp_feature
();
Loading
.
instace
.
loadImage
();
Loading
.
instace
.
loadImage
();
DataManager
.
ins
.
gameCfgData
=
window
[
'CFG'
];
DataManager
.
ins
.
customCfgData
=
window
[
'CFG'
];
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
gameId
=
window
[
"gameId"
];
this
.
getData
();
this
.
getData
();
}
}
...
@@ -93,7 +91,6 @@ export default class MainBase extends eui.UILayer {
...
@@ -93,7 +91,6 @@ export default class MainBase extends eui.UILayer {
this
.
registerModules
();
this
.
registerModules
();
// this.loadFirstScreen();
Loading
.
instace
.
show
();
Loading
.
instace
.
show
();
RES
.
setMaxLoadingThread
(
10
);
RES
.
setMaxLoadingThread
(
10
);
...
@@ -102,43 +99,6 @@ export default class MainBase extends eui.UILayer {
...
@@ -102,43 +99,6 @@ export default class MainBase extends eui.UILayer {
})
})
}
}
loadAtlas
()
{
// if (!window['development']) {
// loadSpriteSheet().then((spritesheet: egret.SpriteSheet) => {
// Loading.instace.setSpriteSheet(spritesheet);
// const t = Date.now() - window['__startTime__'];
// console.log(`首屏loading显示时间:${t}ms`);
// })
// }
}
// _firstBgLoaded = false;
// loadFirstScreen() {
// this.loadFirstBG((bitmap: egret.Bitmap) => {
// const t = Date.now() - window['__startTime__'];
// console.log(`首屏背景显示时间:${t}ms`);
// layers.addFirstBackground(bitmap);
// this._firstBgLoaded = true;
// this.check();
// });
// }
// loadFirstBG(callback) {
// const onImageLoaded = (e: egret.Event) => {
// const imageLoader: egret.ImageLoader = e.currentTarget;
// const bitmapData: egret.BitmapData = imageLoader.data;
// const texture = new egret.Texture();
// texture._setBitmapData(bitmapData);
// const bitmap = new egret.Bitmap(texture);
// callback(bitmap);
// }
// const imageLoader = new egret.ImageLoader();
// imageLoader.once(egret.Event.COMPLETE, onImageLoaded, this);
// const url = getResPath() + "resource/assets/startScene/startscenebg.jpg";
// // url = getImgURL(url);
// imageLoader.load(url);
// }
private
async
runGame
()
{
private
async
runGame
()
{
await
this
.
loadResource
()
await
this
.
loadResource
()
...
@@ -183,15 +143,13 @@ export default class MainBase extends eui.UILayer {
...
@@ -183,15 +143,13 @@ export default class MainBase extends eui.UILayer {
})
})
}
}
/**
* 创建场景界面
* Create scene interface
*/
// _startSceneReady = false;
protected
createGameScene
()
{
protected
createGameScene
()
{
NetManager
.
ins
.
getInfo
(()
=>
{
NetManager
.
ins
.
ajaxElement
(
async
()
=>
{
Buried
.
init
();
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
);
});
})
}
}
}
}
\ No newline at end of file
egret/libs/new_wx/components/NoPrizePanel.ts
View file @
e1844f16
import
doStart
from
"../../new_tw/ctrls/doStart"
;
import
{
DataManager
}
from
"../../tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../tw/manager/DataManager"
;
import
{
NetManager
}
from
"../../tw/manager/NetManager"
;
import
{
NetManager
}
from
"../../tw/manager/NetManager"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
Loading
from
"./Loading"
;
import
Panel
from
"./Panel"
;
import
Panel
from
"./Panel"
;
export
default
class
NoPrizePanel
extends
Panel
{
export
default
class
NoPrizePanel
extends
Panel
{
start
(
data
)
{
start
(
data
)
{
...
@@ -12,25 +10,6 @@ export default class NoPrizePanel extends Panel {
...
@@ -12,25 +10,6 @@ export default class NoPrizePanel extends Panel {
NetManager
.
ins
.
getInfo
();
NetManager
.
ins
.
getInfo
();
}
}
initEvents
()
{
super
.
initEvents
();
// this['onceAgainBtn'].once(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
}
// onTouchTap() {
// this.closeBtns.forEach(
// btn => { if (btn) btn.touchEnabled = false }
// );
// Loading.instace.show();
// doStart((success) => {
// Loading.instace.hide();
// if (success) {
// this.hidePanel();
// SceneCtrl.instance.change(ModuleTypes.PLAY_SCENE);
// }
// });
// }
onTouchTap_closeBtn
():
any
{
onTouchTap_closeBtn
():
any
{
super
.
onTouchTap_closeBtn
();
super
.
onTouchTap_closeBtn
();
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
);
...
@@ -38,6 +17,6 @@ export default class NoPrizePanel extends Panel {
...
@@ -38,6 +17,6 @@ export default class NoPrizePanel extends Panel {
get
skinKey
()
{
return
'NoPrize'
}
get
skinKey
()
{
return
'NoPrize'
}
protected
get
closeBtns
():
eui
.
Button
[]
{
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
],
this
[
'onceAgainBtn'
]]
return
[
this
[
'closeBtn'
],
this
[
'onceAgainBtn'
]]
}
}
}
}
\ No newline at end of file
egret/libs/new_wx/components/RulePanel.ts
View file @
e1844f16
import
{
DataManager
}
from
"../../tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../tw/manager/DataManager"
;
import
{
NetManager
}
from
"../../tw/manager/NetManager"
;
import
{
HtmlTextParser
}
from
"../HtmlTextParser"
;
import
{
HtmlTextParser
}
from
"../HtmlTextParser"
;
import
Panel
from
"./Panel"
;
import
Panel
from
"./Panel"
;
...
@@ -8,19 +7,15 @@ export default class RulePanel extends Panel {
...
@@ -8,19 +7,15 @@ export default class RulePanel extends Panel {
public
scroller
:
eui
.
Scroller
;
public
scroller
:
eui
.
Scroller
;
start
()
{
start
()
{
super
.
start
();
super
.
start
();
if
(
!
DataManager
.
ins
.
getRuleData
)
NetManager
.
ins
.
getRule
(()
=>
{
this
.
addRule
();
this
.
addRule
();
});
else
this
.
addRule
();
}
}
group
:
eui
.
Group
;
group
:
eui
.
Group
;
private
addRule
()
{
private
addRule
()
{
const
text
=
DataManager
.
ins
.
getRuleData
.
ruleText
;
const
text
=
'<br>'
+
DataManager
.
ins
.
ajaxElementData
.
rule
;
this
.
labContent
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
'<br>'
+
DataManager
.
ins
.
getRuleData
.
ruleT
ext
);
this
.
labContent
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
t
ext
);
}
}
get
skinKey
()
{
return
'Rule'
}
get
skinKey
()
{
return
'Rule'
}
}
}
\ No newline at end of file
egret/libs/tw/data/custom/ajaxElement/CreditsType.ts
0 → 100644
View file @
e1844f16
enum
CreditsType
{
virtual
=
'virtual'
}
export
default
CreditsType
\ No newline at end of file
egret/libs/tw/data/custom/ajaxElement/IcreditsConf.ts
0 → 100644
View file @
e1844f16
import
CreditsType
from
"./CreditsType"
;
import
IcreditsConfPrize
from
"./IcreditsConfPrize"
;
export
default
interface
IcreditsConf
{
creditsDown
:
number
,
creditsUp
:
number
,
creditsType
:
CreditsType
;
prize
:
IcreditsConfPrize
[];
}
egret/libs/tw/data/custom/ajaxElement/IcreditsConfPrize.ts
0 → 100644
View file @
e1844f16
export
default
interface
IcreditsConfPrize
{
img
,
credits
:
number
,
id
:
number
,
title
:
string
}
\ No newline at end of file
egret/libs/tw/data/custom/ajaxElement/ReconAjaxElementData.ts
0 → 100644
View file @
e1844f16
import
{
Data
}
from
"../../Data"
;
import
{
ICustomOptionData
}
from
"./ICustomOptionData"
;
import
{
IElementData
}
from
"./IElementData"
;
import
IcreditsConf
from
"./IcreditsConf"
;
export
class
ReconAjaxElementData
extends
Data
{
/**
* 闯关信息
*/
public
throughCurrent
:
number
;
/**
* 闯关模式
*/
public
throughMode
:
number
;
/**
* 关卡ID
*/
public
throughNum
:
number
;
/**
* 站点位置
*/
public
throughCurrentStep
:
number
;
/**
* 弹层js
*/
public
jsTest
:
string
;
/**
* 弹层css
*/
public
cssTest
:
string
;
/**
* 活动规则
*/
public
rule
:
any
;
/**
* 活动类型
*/
public
type
:
string
;
/**
* 奖项列表
*/
public
options
:
ICustomOptionData
[];
/**
* 页面展示信息
*/
public
element
:
IElementData
;
creditsConf
:
IcreditsConf
;
thanksOpt
:
ICustomOptionData
;
public
update
(
result
:
any
):
void
{
if
(
!
result
)
{
return
;
}
super
.
update
(
result
);
this
.
throughCurrent
=
result
.
throughCurrent
;
this
.
throughMode
=
result
.
throughMode
;
this
.
throughNum
=
result
.
throughNum
;
this
.
throughCurrentStep
=
result
.
throughCurrentStep
;
this
.
jsTest
=
result
.
jsTest
;
this
.
cssTest
=
result
.
cssTest
;
this
.
rule
=
result
.
rule
;
this
.
type
=
result
.
type
;
this
.
options
=
result
.
options
;
this
.
element
=
result
.
element
;
this
.
creditsConf
=
result
.
creditsConf
;
const
thanksList
=
this
.
options
.
filter
(
opt
=>
opt
.
prizeType
==
'thanks'
);
if
(
thanksList
)
this
.
thanksOpt
=
thanksList
[
0
]
}
}
\ No newline at end of file
egret/libs/tw/data/custom/doJoin/DoJoinData.ts
View file @
e1844f16
...
@@ -8,7 +8,7 @@ export class DoJoinData extends Data {
...
@@ -8,7 +8,7 @@ export class DoJoinData extends Data {
/**
/**
* 所需积分
* 所需积分
*/
*/
public
needCredits
:
number
;
//
public needCredits: number;
/**
/**
* 订单ID
* 订单ID
...
@@ -20,7 +20,7 @@ export class DoJoinData extends Data {
...
@@ -20,7 +20,7 @@ export class DoJoinData extends Data {
return
;
return
;
}
}
super
.
update
(
data
);
super
.
update
(
data
);
this
.
needCredits
=
data
.
needCredits
;
//
this.needCredits = data.needCredits;
this
.
orderId
=
data
.
orderId
;
this
.
orderId
=
data
.
data
;
}
}
}
}
\ No newline at end of file
egret/libs/tw/manager/DataManager.ts
View file @
e1844f16
import
{
GetVisitInfoData
}
from
'./../data/pets/GetVisitInfoData'
;
import
{
ABDataManager
}
from
'../../tc/manager/ABDataManager'
;
import
{
GetSummerInfoData
}
from
'./../data/game/getInfo/GetSummerInfoData'
;
import
{
AddTimesForActivityData
}
from
"../data/common/addTimesForActivity/AddTimesForActivityData"
;
import
{
GetReviveCardNumData
}
from
'./../data/game/doRevive/GetReviveCardNumData'
;
import
{
GetCreditsData
}
from
"../data/common/getCredits/GetCreditsData"
;
import
{
DoReviveData
}
from
'./../data/game/doRevive/DoReviveData'
;
import
{
GetRecordData
}
from
'../data/common/GetRecordData'
;
import
{
DoJoinPlugDrawData
}
from
'./../data/plug/doJoinPlugDraw/DoJoinPlugDrawData'
;
import
{
GetRoleData
}
from
"../data/common/getRole/GetRoleData"
;
import
{
NetName
}
from
'./../enum/NetName'
;
import
{
SetRoleData
}
from
"../data/common/setRole/SetRoleData"
;
import
{
QuestionSubmitData
}
from
'./../data/custom/questionSbumit/QuestionSubmitData'
;
import
{
AjaxElementData
}
from
"../data/custom/ajaxElement/AjaxElementData"
;
import
{
GetCollectRuleData
}
from
'./../data/common/getCollectRule/GetCollectRuleData'
;
import
{
ReconAjaxElementData
}
from
'../data/custom/ajaxElement/ReconAjaxElementData'
;
import
{
DatapashData
}
from
'./../data/game/datapash/DatapashData'
;
import
{
AjaxThroughInfoData
}
from
"../data/custom/ajaxThroughInfo/AjaxThroughInfoData"
;
import
{
OpenCollectGoodsPrizeData
}
from
'./../data/common/openCollectGoodsPrize/openCollectGoodsPrizeData'
;
import
{
BeforSubmitData
}
from
'../data/custom/beforSubmit/BeforSubmitData'
;
import
{
TwLang
}
from
"../util/TwLang"
;
import
{
ICustomCfgData
}
from
'../data/custom/cfg/ICustomCfgData'
;
import
{
DoJoinData
}
from
"../data/custom/doJoin/DoJoinData"
;
import
{
GetCustomOrderStatusData
}
from
"../data/custom/doJoin/GetCustomOrderStatusData"
;
import
{
GetOrderInfoData
}
from
"../data/custom/getOrderInfo/GetOrderInfoData"
;
import
{
ThroughSubmitData
}
from
'../data/custom/throughSubmit/ThroughSubmitData'
;
import
{
Data
}
from
'../data/Data'
;
// import { ICustomCfgData } from '..';
import
{
IGameCfgData
}
from
'../data/game/cfg/IGameCfgData'
;
import
{
DoStartData
}
from
"../data/game/doStart/DoStartData"
;
import
{
DoStartData
}
from
"../data/game/doStart/DoStartData"
;
import
{
GetStartStatusData
}
from
"../data/game/doStart/GetStartStatusData"
;
import
{
GetStartStatusData
}
from
"../data/game/doStart/GetStartStatusData"
;
import
{
GetInfoData
}
from
"../data/game/getInfo/GetInfoData"
;
import
{
GetInfoData
}
from
"../data/game/getInfo/GetInfoData"
;
...
@@ -16,52 +23,46 @@ import { GetOptionsData } from "../data/game/getOptions/GetOptionsData";
...
@@ -16,52 +23,46 @@ import { GetOptionsData } from "../data/game/getOptions/GetOptionsData";
import
{
GetRuleData
}
from
"../data/game/getRule/GetRuleData"
;
import
{
GetRuleData
}
from
"../data/game/getRule/GetRuleData"
;
import
{
GetUserTotalScoreData
}
from
"../data/game/getUserTotalScore/GetUserTotalScoreData"
;
import
{
GetUserTotalScoreData
}
from
"../data/game/getUserTotalScore/GetUserTotalScoreData"
;
import
{
GuessPokerData
}
from
"../data/game/guessPoker/GuessPokerData"
;
import
{
GuessPokerData
}
from
"../data/game/guessPoker/GuessPokerData"
;
import
{
GameSubmitData
}
from
"../data/game/submit/GameSubmitData"
;
import
{
RealTimeRankData
}
from
"../data/game/realtimerank/RealTimeRankData"
;
import
{
RealTimeRankData
}
from
"../data/game/realtimerank/RealTimeRankData"
;
import
{
GameSubmitData
}
from
"../data/game/submit/GameSubmitData"
;
import
{
WinRanksData
}
from
"../data/game/winranks/WinRanksData"
;
import
{
WinRanksData
}
from
"../data/game/winranks/WinRanksData"
;
import
{
AjaxElementData
}
from
"../data/custom/ajaxElement/AjaxElementData"
;
import
{
CollectData
}
from
"../data/pet/CollectData"
;
import
{
DoJoinData
}
from
"../data/custom/doJoin/DoJoinData"
;
import
{
GetFoodPilesData
}
from
'../data/pet/GetFoodPilesData'
;
import
{
AjaxThroughInfoData
}
from
"../data/custom/ajaxThroughInfo/AjaxThroughInfoData"
;
import
{
GetRankListData
}
from
'../data/pet/GetRankListData'
;
import
{
GetOrderInfoData
}
from
"../data/custom/getOrderInfo/GetOrderInfoData"
;
import
{
GetToysData
}
from
"../data/pet/GetToysData"
;
import
{
GetCustomOrderStatusData
}
from
"../data/custom/doJoin/GetCustomOrderStatusData"
;
import
{
GetRoleData
}
from
"../data/common/getRole/GetRoleData"
;
import
{
GetCreditsData
}
from
"../data/common/getCredits/GetCreditsData"
;
import
{
AddTimesForActivityData
}
from
"../data/common/addTimesForActivity/AddTimesForActivityData"
;
import
{
SetRoleData
}
from
"../data/common/setRole/SetRoleData"
;
import
{
GameGetSubmitResultData
}
from
'./../data/game/submit/GameGetSubmitResultData'
;
import
{
ThroughSubmitData
}
from
'../data/custom/throughSubmit/ThroughSubmitData'
;
import
{
BeforSubmitData
}
from
'../data/custom/beforSubmit/BeforSubmitData'
;
import
{
PetAdopteData
}
from
"../data/pet/PetAdopteData"
;
import
{
PetAdopteData
}
from
"../data/pet/PetAdopteData"
;
import
{
PetFeedData
}
from
"../data/pet/PetFeedData"
;
import
{
PetFeedData
}
from
"../data/pet/PetFeedData"
;
import
{
PetHomeInfoData
}
from
"../data/pet/PetHomeInfoData"
;
// import { ABDataManager } from 'duiba-tc';
import
{
PetIndexData
}
from
'../data/pet/PetIndexData'
;
import
{
PetStatusData
}
from
"../data/pet/PetStatusData"
;
import
{
PetStatusData
}
from
"../data/pet/PetStatusData"
;
import
{
SignInfoData
}
from
"../data/pet/SignInfoData"
;
import
{
SignInfoData
}
from
"../data/pet/SignInfoData"
;
import
{
PetHomeInfoData
}
from
"../data/pet/PetHomeInfoData"
;
import
{
GetToysData
}
from
"../data/pet/GetToysData"
;
import
{
ToyExchangeData
}
from
"../data/pet/ToyExchangeData"
;
import
{
ToyExchangeData
}
from
"../data/pet/ToyExchangeData"
;
import
{
ToyUseData
}
from
"../data/pet/ToyUseData"
;
import
{
ToyUseData
}
from
"../data/pet/ToyUseData"
;
import
{
CollectData
}
from
"../data/pet/CollectData"
;
import
{
Data
}
from
'../data/Data'
;
import
{
GetPlugOrderStatusData
}
from
'../data/plug/doJoinPlugDraw/GetPlugOrderStatusData'
;
import
{
OptionInfoData
}
from
'../data/plug/optionInfo/OptionInfoData'
;
import
{
UnblockingData
}
from
'../data/plug/unblocking/UnblockingData'
;
import
{
GetPrizeInfoData
}
from
'../data/plug/getPrizeInfo/GetPrizeInfoData'
;
// import { ABDataManager } from 'duiba-tc';
import
{
PetIndexData
}
from
'../data/pet/PetIndexData'
;
// import { ICustomCfgData } from '..';
import
{
IGameCfgData
}
from
'../data/game/cfg/IGameCfgData'
;
import
{
GetRankListData
}
from
'../data/pet/GetRankListData'
;
import
{
GetFoodPilesData
}
from
'../data/pet/GetFoodPilesData'
;
import
{
GetRecordData
}
from
'../data/common/GetRecordData'
;
import
{
UseToyData
}
from
'../data/pets/UseToyData'
;
import
{
GetActToysListData
}
from
'../data/pets/GetActToysListData'
;
import
{
GetActToysListData
}
from
'../data/pets/GetActToysListData'
;
import
{
ToyExchangesData
}
from
'../data/pets/ToyExchangesData'
;
import
{
GetUserToysListData
}
from
'../data/pets/GetUserToysListData'
;
import
{
GetHomeInfoData
}
from
'../data/pets/GetHomeInfoData'
;
import
{
GetHomeInfoData
}
from
'../data/pets/GetHomeInfoData'
;
import
{
GetUserToysListData
}
from
'../data/pets/GetUserToysListData'
;
import
{
PetsIndexData
}
from
'../data/pets/PetsIndexData'
;
import
{
PetsIndexData
}
from
'../data/pets/PetsIndexData'
;
import
{
VisitStatisticsData
}
from
'../data/pets/VisitStatisticsData'
;
import
{
ToyExchangesData
}
from
'../data/pets/ToyExchangesData'
;
import
{
UseToyData
}
from
'../data/pets/UseToyData'
;
import
{
VisitDetailData
}
from
'../data/pets/VisitDetailData'
;
import
{
VisitDetailData
}
from
'../data/pets/VisitDetailData'
;
import
{
ABDataManager
}
from
'../../tc/manager/ABDataManager'
;
import
{
VisitStatisticsData
}
from
'../data/pets/VisitStatisticsData'
;
import
{
ICustomCfgData
}
from
'../data/custom/cfg/ICustomCfgData'
;
import
{
GetPlugOrderStatusData
}
from
'../data/plug/doJoinPlugDraw/GetPlugOrderStatusData'
;
import
{
GetPrizeInfoData
}
from
'../data/plug/getPrizeInfo/GetPrizeInfoData'
;
import
{
OptionInfoData
}
from
'../data/plug/optionInfo/OptionInfoData'
;
import
{
UnblockingData
}
from
'../data/plug/unblocking/UnblockingData'
;
import
{
TwLang
}
from
"../util/TwLang"
;
import
{
GetCollectRuleData
}
from
'./../data/common/getCollectRule/GetCollectRuleData'
;
import
{
OpenCollectGoodsPrizeData
}
from
'./../data/common/openCollectGoodsPrize/openCollectGoodsPrizeData'
;
import
{
QuestionSubmitData
}
from
'./../data/custom/questionSbumit/QuestionSubmitData'
;
import
{
DatapashData
}
from
'./../data/game/datapash/DatapashData'
;
import
{
DoReviveData
}
from
'./../data/game/doRevive/DoReviveData'
;
import
{
GetReviveCardNumData
}
from
'./../data/game/doRevive/GetReviveCardNumData'
;
import
{
GetSummerInfoData
}
from
'./../data/game/getInfo/GetSummerInfoData'
;
import
{
GameGetSubmitResultData
}
from
'./../data/game/submit/GameGetSubmitResultData'
;
import
{
GetVisitInfoData
}
from
'./../data/pets/GetVisitInfoData'
;
import
{
DoJoinPlugDrawData
}
from
'./../data/plug/doJoinPlugDraw/DoJoinPlugDrawData'
;
import
{
NetName
}
from
'./../enum/NetName'
;
/**
/**
*Created by cuiliqiang on 2018/3/8
*Created by cuiliqiang on 2018/3/8
...
@@ -117,7 +118,7 @@ export class DataManager extends ABDataManager {
...
@@ -117,7 +118,7 @@ export class DataManager extends ABDataManager {
private
_doJoinPlugDrawData
:
DoJoinPlugDrawData
;
private
_doJoinPlugDrawData
:
DoJoinPlugDrawData
;
private
_getPlugOrderStatusData
:
GetPlugOrderStatusData
;
private
_getPlugOrderStatusData
:
GetPlugOrderStatusData
;
private
_setRoleData
:
SetRoleData
;
private
_setRoleData
:
SetRoleData
;
private
_ajaxElementData
:
AjaxElementData
;
private
_ajaxElementData
:
Recon
AjaxElementData
;
private
_ajaxThroughInfoData
:
AjaxThroughInfoData
;
private
_ajaxThroughInfoData
:
AjaxThroughInfoData
;
private
_doJoinData
:
DoJoinData
;
private
_doJoinData
:
DoJoinData
;
private
_getCustomOrderStatusData
:
GetCustomOrderStatusData
;
private
_getCustomOrderStatusData
:
GetCustomOrderStatusData
;
...
@@ -342,9 +343,9 @@ export class DataManager extends ABDataManager {
...
@@ -342,9 +343,9 @@ export class DataManager extends ABDataManager {
break
;
break
;
case
NetName
.
CUSTOM_ELEMENT
:
case
NetName
.
CUSTOM_ELEMENT
:
if
(
!
this
.
_ajaxElementData
)
{
if
(
!
this
.
_ajaxElementData
)
{
this
.
_ajaxElementData
=
new
AjaxElementData
();
this
.
_ajaxElementData
=
new
Recon
AjaxElementData
();
}
}
this
.
_ajaxElementData
.
update
(
result
);
this
.
_ajaxElementData
.
update
(
result
.
data
);
data
=
this
.
_ajaxElementData
;
data
=
this
.
_ajaxElementData
;
break
;
break
;
case
NetName
.
CUSTOM_THROUGH_INFO
:
case
NetName
.
CUSTOM_THROUGH_INFO
:
...
@@ -777,7 +778,7 @@ export class DataManager extends ABDataManager {
...
@@ -777,7 +778,7 @@ export class DataManager extends ABDataManager {
/**
/**
* 活动工具基础信息
* 活动工具基础信息
*/
*/
public
get
ajaxElementData
():
AjaxElementData
{
public
get
ajaxElementData
():
Recon
AjaxElementData
{
return
this
.
_ajaxElementData
;
return
this
.
_ajaxElementData
;
}
}
...
...
egret/libs/tw/manager/NetManager.ts
View file @
e1844f16
...
@@ -406,6 +406,48 @@ export class NetManager extends ABNetManager {
...
@@ -406,6 +406,48 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
this
.
send
(
net
);
}
}
ngameSubmit
(
callback
:
Function
,
orderId
:
number
,
score
:
number
,
gameData
:
any
,
dynamicData
:
any
,
submitToken
:
string
,
rankId
?:
number
):
void
{
const
sign
=
this
.
createSgin
(
orderId
,
score
,
gameData
,
submitToken
);
const
param
:
any
=
{
orderId
:
orderId
,
score
:
score
,
gameData
:
gameData
,
sgin
:
sign
,
dynamicData
:
JSON
.
stringify
(
dynamicData
)
};
if
(
rankId
)
{
param
.
rankId
=
rankId
;
}
const
net
:
INetData
=
{
name
:
'ngameSubmit'
,
uri
:
'/hdtool/recon/ngame/ngameSubmit'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
param
,
hideMsg
:
true
,
callback
:
callback
};
this
.
send
(
net
);
}
getOrderStatus
(
callback
:
Function
,
orderId
:
number
,
pollingCheck
?:
Function
,
pollingCount
=
10
):
void
{
const
param
:
any
=
{
orderId
:
orderId
};
const
net
:
INetData
=
{
name
:
'getOrderStatus'
,
uri
:
'/hdtool/recon/getOrderStatus'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
param
,
hideMsg
:
true
,
callback
:
callback
,
pollingCheck
:
pollingCheck
,
pollingCount
:
pollingCount
};
NetManager
.
ins
.
send
(
net
);
}
/**
/**
* 提交游戏数据
* 提交游戏数据
*
*
...
@@ -681,14 +723,12 @@ export class NetManager extends ABNetManager {
...
@@ -681,14 +723,12 @@ export class NetManager extends ABNetManager {
public
ajaxElement
(
callback
:
Function
):
void
{
public
ajaxElement
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
CUSTOM_ELEMENT
,
name
:
NetName
.
CUSTOM_ELEMENT
,
uri
:
window
[
'CFG'
].
getElement
,
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
.
actId
,
actId
:
DataManager
.
ins
.
customCfgData
.
actId
,
preview
:
DataManager
.
ins
.
customCfgData
.
preview
},
},
callback
:
callback
callback
:
callback
};
};
...
@@ -714,21 +754,21 @@ export class NetManager extends ABNetManager {
...
@@ -714,21 +754,21 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
public
doJoin
(
callback
:
Function
,
credits
?:
number
,
collectRuleId
?:
number
):
void
{
* 活动工具抽奖
* @param {number} collectRuleId 集卡规则ID,活动与集卡规则关联才能获得发卡资格
*/
public
doJoin
(
callback
:
Function
,
collectRuleId
?:
number
):
void
{
const
param
:
any
=
{
const
param
:
any
=
{
actId
:
DataManager
.
ins
.
customCfgData
.
actId
,
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
oaId
:
DataManager
.
ins
.
customCfgData
.
oaId
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
};
};
if
(
credits
)
{
param
.
credits
=
credits
;
}
if
(
collectRuleId
)
{
if
(
collectRuleId
)
{
param
.
collectRuleId
=
collectRuleId
;
param
.
collectRuleId
=
collectRuleId
;
}
}
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
CUSTOM_THROUGH_INFO
,
name
:
'dojoin'
,
uri
:
window
[
'CFG'
].
doJoin
,
uri
:
'/hdtool/recon/doJoin'
,
type
:
'post'
,
type
:
'post'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
param
,
param
:
param
,
...
@@ -737,6 +777,24 @@ export class NetManager extends ABNetManager {
...
@@ -737,6 +777,24 @@ export class NetManager extends ABNetManager {
this
.
getToken
(
net
);
this
.
getToken
(
net
);
}
}
public
getNgameStartStatus
(
callback
:
Function
,
orderId
:
number
,
pollingCheck
:
Function
,
pollingCount
=
10
):
void
{
const
param
:
any
=
{
orderId
:
orderId
};
const
net
:
INetData
=
{
name
:
'getNgameStartStatus'
,
uri
:
'/hdtool/recon/ngame/getNgameStartStatus'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
param
,
hideMsg
:
true
,
callback
:
callback
,
pollingCheck
:
pollingCheck
,
pollingCount
:
pollingCount
};
this
.
send
(
net
);
}
/**
/**
* 活动工具查询订单结果
* 活动工具查询订单结果
* @param orderId
* @param orderId
...
...
egret/src/playScene/PlayScene.ts
View file @
e1844f16
import
submit
from
"../../libs/new_tw/ctrls/submit"
;
import
submit
from
"../../libs/new_tw/ctrls/submit"
;
import
Loading
from
"../../libs/new_wx/components/Loading"
;
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
Scene
from
"../../libs/new_wx/components/Scene"
;
import
Scene
from
"../../libs/new_wx/components/Scene"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
showAlertPanel
from
"../../libs/new_wx/ctrls/showAlertPanel"
;
import
{
ModuleTypes
}
from
"../../libs/new_wx/types/sceneTypes"
;
import
{
ModuleTypes
}
from
"../../libs/new_wx/types/sceneTypes"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
Effect
from
"../Effect"
;
import
{
playBg
,
playSound
,
SoundType
,
toggleSound
}
from
"../soundCtrl"
;
import
{
Tween
}
from
"../tween/Tween"
;
import
{
Tween
}
from
"../tween/Tween"
;
import
{
getBlocks
,
resetCounter
}
from
"./blockGen"
;
import
{
createBallItem
}
from
"./factory/createBall"
;
import
{
createBallItem
}
from
"./factory/createBall"
;
import
createCircle
from
"./factory/createCircle"
;
import
createCircle
from
"./factory/createCircle"
;
import
createRegTriangle
from
"./factory/createRegTriangle"
;
import
createRegTriangle
from
"./factory/createRegTriangle"
;
import
createSpecialRegTriangle
from
"./factory/createSpecialRegTriangle"
;
import
createSpecialRegTriangle
from
"./factory/createSpecialRegTriangle"
;
import
createSpeialCircle
from
"./factory/createSpeialCircle"
;
import
createSquare
from
"./factory/createSquare"
;
import
createSquare
from
"./factory/createSquare"
;
import
{
BALL_D
,
LEFT_GROUND
,
RIGHT_GROUND
,
LADDER_START
,
LADDER_END
,
LADDER_H_NUMS
,
LADDER_NUMS
,
ACELE_DELAY
}
from
"./gameconsts"
;
import
{
ACELE_DELAY
,
BALL_D
,
LADDER_NUMS
,
LEFT_GROUND
,
RIGHT_GROUND
}
from
"./gameconsts"
;
import
{
Ball
}
from
"./physics/Ball"
;
import
{
Ball
}
from
"./physics/Ball"
;
import
Body
from
"./physics/Body"
;
import
Body
from
"./physics/Body"
;
import
{
Circle
}
from
"./physics/Circle"
;
import
{
Circle
}
from
"./physics/Circle"
;
import
{
degToRad
,
radToDeg
}
from
"./physics/Const"
;
import
{
degToRad
,
radToDeg
}
from
"./physics/Const"
;
import
{
RegTriangle
}
from
"./physics/RegTriangle"
;
import
{
RegTriangle
}
from
"./physics/RegTriangle"
;
import
Pool
from
"./Pool"
;
import
Pool
from
"./Pool"
;
import
{
isSpecialBody
,
getLadderPosition
,
getLadderHPosition
,
getBounce
,
isSpecialCircle
,
getLadderGap
}
from
"./utils"
;
import
{
getBounce
,
getLadderGap
,
getLadderHPosition
,
getLadderPosition
,
isSpecialBody
,
isSpecialCircle
}
from
"./utils"
;
import
{
getBlocks
,
resetCounter
,
getCounter
}
from
"./blockGen"
;
import
createSpeialCircle
from
"./factory/createSpeialCircle"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
Effect
from
"../Effect"
;
import
{
toggleSound
,
playSound
,
SoundType
,
playBg
}
from
"../soundCtrl"
;
import
Loading
from
"../../libs/new_wx/components/Loading"
;
export
default
class
PlayScene
extends
Scene
{
export
default
class
PlayScene
extends
Scene
{
initEvents
()
{
initEvents
()
{
...
@@ -460,8 +459,8 @@ export default class PlayScene extends Scene {
...
@@ -460,8 +459,8 @@ export default class PlayScene extends Scene {
let
failed
=
false
;
let
failed
=
false
;
blocks
.
forEach
(
block
=>
{
blocks
.
forEach
(
block
=>
{
console
.
log
(
'ladderNums'
,
block
.
ladderNums
)
console
.
log
(
'ladderNums'
,
block
.
ladderNums
)
//
if (block.ladderNums >= 1) {
if
(
block
.
ladderNums
>=
1
)
{
if
(
block
.
ladderNums
>=
9
)
{
//
if (block.ladderNums >= 9) {
failed
=
true
;
failed
=
true
;
}
}
});
});
...
@@ -475,10 +474,10 @@ export default class PlayScene extends Scene {
...
@@ -475,10 +474,10 @@ export default class PlayScene extends Scene {
block
.
ladderNums
++
;
block
.
ladderNums
++
;
if
(
block
.
ladderNums
>=
9
)
{
if
(
block
.
ladderNums
>=
9
)
{
egret
.
Tween
.
get
(
block
.
view
,
{
loop
:
true
})
egret
.
Tween
.
get
(
block
.
view
,
{
loop
:
true
})
.
to
({
alpha
:
0
},
1000
/
6
)
.
to
({
alpha
:
0
},
1000
/
6
)
.
to
({
alpha
:
1
},
1000
/
6
)
.
to
({
alpha
:
1
},
1000
/
6
)
// .to({ rotation: block.view.rotation + 15 }, 1000 / 6)
// .to({ rotation: block.view.rotation + 15 }, 1000 / 6)
// .to({ rotation: block.view.rotation }, 1000 / 6)
// .to({ rotation: block.view.rotation }, 1000 / 6)
// Tween.to(block.view, 10, { useFrame: true, yoyo: true, rotation: block.view.rotation+ })
// Tween.to(block.view, 10, { useFrame: true, yoyo: true, rotation: block.view.rotation+ })
}
}
});
});
...
...
egret/src/startScene/StartScene.ts
View file @
e1844f16
import
getIsIOS
from
"../../libs/new_tc/getIsIOS"
;
import
hdGameDoDojoin
from
"../../libs/new_tw/ctrls/hdGameDoDojoin"
;
import
doStart
from
"../../libs/new_tw/ctrls/doStart"
;
import
getCountTxt
from
"../../libs/new_tw/datas/getCountTxt"
;
import
getStartBtnEnable
from
"../../libs/new_tw/datas/getStartBtnEnable"
;
import
Loading
from
"../../libs/new_wx/components/Loading"
;
import
Loading
from
"../../libs/new_wx/components/Loading"
;
import
Scene
from
"../../libs/new_wx/components/Scene"
;
import
Scene
from
"../../libs/new_wx/components/Scene"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
...
@@ -24,13 +21,10 @@ export default class StartScene extends Scene {
...
@@ -24,13 +21,10 @@ export default class StartScene extends Scene {
exemptionTxt
:
eui
.
Label
;
exemptionTxt
:
eui
.
Label
;
async
start
(
data
?)
{
async
start
(
data
?)
{
this
.
updateCountTxt
();
this
.
startBtn
.
visible
=
false
;
this
.
updateGetInfoView
();
this
.
updateExemptionTxt
();
super
.
start
();
super
.
start
();
egret
.
Tween
.
get
(
this
.
startBtn
,
{
loop
:
true
}).
to
({
scaleX
:.
9
,
scaleY
:.
9
},
150
).
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
getBackOut
(
5
)).
wait
(
600
);
egret
.
Tween
.
get
(
this
.
startBtn
,
{
loop
:
true
}).
to
({
scaleX
:
.
9
,
scaleY
:
.
9
},
150
).
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
getBackOut
(
5
)).
wait
(
600
);
NetManager
.
ins
.
getCredits
(()
=>
{
NetManager
.
ins
.
getCredits
(()
=>
{
this
.
data
.
credit
=
`我的
${
DataManager
.
ins
.
getCreditsData
.
unitName
}
:
${
DataManager
.
ins
.
getCreditsData
.
consumerCredits
}
`
;
this
.
data
.
credit
=
`我的
${
DataManager
.
ins
.
getCreditsData
.
unitName
}
:
${
DataManager
.
ins
.
getCreditsData
.
consumerCredits
}
`
;
...
@@ -44,35 +38,20 @@ export default class StartScene extends Scene {
...
@@ -44,35 +38,20 @@ export default class StartScene extends Scene {
}
}
}
}
private
updateGetInfoView
()
{
updateCountTxt
()
{
if
(
DataManager
.
ins
.
getInfoData
)
{
let
countTxt
=
''
;
this
.
updateStartBtnStatus
();
this
.
updateCountTxt
();
const
{
element
}
=
DataManager
.
ins
.
ajaxElementData
;
if
(
element
.
freeLimit
>
0
)
{
if
(
element
.
status
==
5
)
countTxt
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
if
(
element
.
status
==
7
)
countTxt
=
`剩余免费次数:
${
element
.
freeLimit
}
次`
}
else
{
}
else
{
DataManager
.
ins
.
once
(
'dataUpdate'
,
this
.
updateGetInfoView
,
this
);
countTxt
=
`
${
element
.
needCredits
}${
CFG
.
unitName
}
/次`
}
}
async
updateStartBtnStatus
()
{
if
(
this
.
startBtn
)
{
this
.
startBtn
.
visible
=
true
;
this
.
startBtn
.
enabled
=
getStartBtnEnable
();
}
}
}
updateCountTxt
()
{
this
.
data
.
count
=
`
${
getCountTxt
()}
`
;
}
updateExemptionTxt
()
{
this
.
data
.
count
=
`
${
countTxt
}
`
;
if
(
this
.
exemptionTxt
)
{
if
(
getIsIOS
())
{
this
.
exemptionTxt
.
visible
=
true
;
}
else
{
this
.
exemptionTxt
.
visible
=
false
;
}
}
}
}
initEvents
()
{
initEvents
()
{
...
@@ -93,6 +72,7 @@ export default class StartScene extends Scene {
...
@@ -93,6 +72,7 @@ export default class StartScene extends Scene {
onTap_ruleBtn
(
e
:
egret
.
Event
)
{
onTap_ruleBtn
(
e
:
egret
.
Event
)
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
RULE_PANEL
);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
RULE_PANEL
);
}
}
onTap_htmlRuleBtn
(
e
:
egret
.
Event
)
{
onTap_htmlRuleBtn
(
e
:
egret
.
Event
)
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
HTML_RULE_PANEL
);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
HTML_RULE_PANEL
);
}
}
...
@@ -107,7 +87,7 @@ export default class StartScene extends Scene {
...
@@ -107,7 +87,7 @@ export default class StartScene extends Scene {
async
onTap_startBtn
(
e
?:
egret
.
Event
)
{
async
onTap_startBtn
(
e
?:
egret
.
Event
)
{
this
.
startBtn
.
touchEnabled
=
false
;
this
.
startBtn
.
touchEnabled
=
false
;
Loading
.
instace
.
show
();
Loading
.
instace
.
show
();
doStart
((
success
)
=>
{
hdGameDoDojoin
((
success
)
=>
{
Loading
.
instace
.
hide
();
Loading
.
instace
.
hide
();
this
.
startBtn
.
touchEnabled
=
true
;
this
.
startBtn
.
touchEnabled
=
true
;
if
(
success
)
if
(
success
)
...
...
mock/json/doJoin.json
deleted
100755 → 0
View file @
7dab8b87
{
"needCredits"
:
0
,
"status"
:
1
,
"orderId"
:
"544328581298130001"
,
"success"
:
false
,
"message"
:
"我靠又报错了"
}
\ No newline at end of file
mock/json/getCredits.json
View file @
e1844f16
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"desc"
:
"成功"
,
"desc"
:
"成功"
,
"data"
:
{
"data"
:
{
"unitName"
:
"金币"
,
"unitName"
:
"金币"
,
"credits"
:
"100"
,
"credits"
:
"100"
,
"consumerCredits"
:
100
"consumerCredits"
:
100
}
}
}
}
\ No newline at end of file
mock/newGame/ajaxElement.json
View file @
e1844f16
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
"logo"
:
"//yun1.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png"
,
"logo"
:
"//yun1.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png"
,
"id"
:
15585
"id"
:
15585
}],
}],
"rule"
:
"a
dsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>adsfasdf</br>
"
,
"rule"
:
"a
1<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>aa<br>a
"
,
"type"
:
"hdtool"
,
"type"
:
"hdtool"
,
"element"
:
{
"element"
:
{
"isCreditsTypeOpen"
:
false
,
"isCreditsTypeOpen"
:
false
,
...
...
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