Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
063c86e8
Commit
063c86e8
authored
Aug 22, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
aeb79820
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
29 deletions
+68
-29
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+30
-12
MainScene.ts
egret/src/mainScene/MainScene.ts
+19
-13
ElementType.ts
egret/src/something/enum/ElementType.ts
+7
-0
ScoreProgress.ts
egret/src/something/uis/ScoreProgress.ts
+12
-4
No files found.
egret/libs/tw/manager/NetManager.ts
View file @
063c86e8
...
...
@@ -430,8 +430,17 @@ export class NetManager extends ABNetManager {
};
this
.
send
(
net
);
}
hc_submit
(
callback
:
Function
,
gamedata
,
score
?):
void
{
/**
*
* @param callback
* @param orderId 订单id,来自doJoin,,DataManager.ins.getData("hc_doJoin").data
* @param score 关卡
* @param gameData json带分数和通关元素
* @param submitToken token,来自getNgameStartStatus,,DataManager.ins.getData("getNgameStartStatus").data.submitToken
*/
hc_submit
(
callback
:
Function
,
orderId
:
number
,
score
:
number
,
gameData
:
string
,
submitToken
:
string
):
void
{
const
sign
=
this
.
createSgin
(
orderId
,
score
,
gameData
,
submitToken
);
NetName
.
CUSTOM_DO_JOIN
const
net
:
INetData
=
{
name
:
'hc_submit'
,
uri
:
'/hdtool/happyclear/submit'
,
...
...
@@ -439,10 +448,12 @@ export class NetManager extends ABNetManager {
dataType
:
'json'
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
gameData
:
gamedata
,
gameData
:
gameData
,
sign
:
sign
,
dynamicData
:
JSON
.
stringify
([]),
detect
:
window
[
'detect'
],
deviceSessionId
:
window
[
'_device_session_id'
],
score
:
score
score
:
score
,
},
hideMsg
:
true
,
callback
:
callback
...
...
@@ -464,6 +475,13 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
}
/**
*
* @param callback
* @param orderId DataManager.ins.getData("doJoin").data,或hc_doJoin
* @param pollingCheck
* @param pollingCount
*/
getOrderStatus
(
callback
:
Function
,
orderId
:
number
,
pollingCheck
?:
Function
,
pollingCount
=
10
):
void
{
const
param
:
any
=
{
orderId
:
orderId
...
...
@@ -814,19 +832,19 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
}
public
hc_exchange
(
callback
:
Function
,
category
:
number
,
propType
?:
number
):
void
{
const
d
:
any
=
{
const
d
:
any
=
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
category
:
category
};
if
(
propType
)
{
d
.
propType
=
propType
;
if
(
propType
)
{
d
.
propType
=
propType
;
}
const
net
:
INetData
=
{
name
:
'hc_exchange'
,
uri
:
'/customActivity/happyclear/exchange'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
d
,
param
:
d
,
callback
:
callback
};
this
.
send
(
net
);
...
...
@@ -970,11 +988,11 @@ export class NetManager extends ABNetManager {
this
.
getToken
(
net
);
}
public
hc_doJoin
(
callback
:
Function
,
score
:
number
,
detect
,
deviceSessionId
):
void
{
public
hc_doJoin
(
callback
:
Function
,
score
:
number
,
detect
,
deviceSessionId
):
void
{
const
param
:
any
=
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
activityType
:
'hdtool'
,
score
:
score
,
score
:
score
,
consumerId
:
window
[
'CFG'
].
consumerId
,
detect
:
window
[
'detect'
],
deviceSessionId
:
window
[
'_device_session_id'
]
...
...
egret/src/mainScene/MainScene.ts
View file @
063c86e8
...
...
@@ -9,7 +9,7 @@ import { Lattice } from '../something/class/Lattice';
import
{
Pool
}
from
'../something/Pool'
;
import
{
RecoverName
}
from
'../something/enum/RecoverName'
;
import
{
Element
}
from
'../something/class/Element'
;
import
{
ElementType
,
submitTran
}
from
'../something/enum/ElementType'
;
import
{
ElementType
,
submitTran
,
codeMsgs
}
from
'../something/enum/ElementType'
;
import
{
EffectType
}
from
'../something/enum/EffectType'
;
import
{
BoomAni
}
from
'../something/anis/BoomAni'
;
import
{
IceAni
}
from
'../something/anis/IceAni'
;
...
...
@@ -87,6 +87,8 @@ export default class MainScene extends Scene {
get
skinKey
()
{
return
'Main'
}
exposure
chapterData
:
ChapterData
;
//关数
chapter
:
number
//所有的格子数组
lattices
:
Lattice
[];
//最后一行的行数
...
...
@@ -192,11 +194,11 @@ export default class MainScene extends Scene {
//初始化索引信息
Tool
.
init
();
//第几关
//
var
chapter = (data && data.chapter) ? data.chapter : 1;
var
chapter
=
20
this
.
chapterTxt
.
text
=
"第"
+
chapter
+
"关"
;
//
this.
chapter = (data && data.chapter) ? data.chapter : 1;
this
.
chapter
=
20
;
this
.
chapterTxt
.
text
=
"第"
+
this
.
chapter
+
"关"
;
//关卡数据
this
.
chapterData
=
Chapters
[
chapter
];
this
.
chapterData
=
Chapters
[
this
.
chapter
];
this
.
initUi
();
this
.
initSvgas
();
//先禁掉事件
...
...
@@ -236,10 +238,10 @@ export default class MainScene extends Scene {
//引导提示
if
(
chapter
<=
5
)
{
if
(
this
.
chapter
<=
5
)
{
Loading
.
instace
.
show
()
let
g
=
new
GuideMsg
();
g
.
init
(
chapter
,
()
=>
{
g
.
init
(
this
.
chapter
,
()
=>
{
Loading
.
instace
.
hide
()
this
.
addChild
(
g
);
this
.
enableMouseEvt
(
true
);
...
...
@@ -2034,9 +2036,8 @@ export default class MainScene extends Scene {
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NO_PRIZE_PANEL
);
}
},
DataManager
.
ins
.
getData
(
NetName
.
CUSTOM_DO_JOIN
).
data
,
()
=>
{
return
DataManager
.
ins
.
getData
(
NetName
.
CUSTOM_ORDER_STATUS
).
code
==
"C000000001"
;
},
10
)
DataManager
.
ins
.
getData
(
"hc_doJoin"
).
data
,
()
=>
{
return
DataManager
.
ins
.
getCustomOrderStatusData
.
code
==
"C000000001"
;
})
}
else
{
Loading
.
instace
.
hide
();
if
(
!
data
)
{
...
...
@@ -2047,14 +2048,19 @@ export default class MainScene extends Scene {
this
.
submit
(
json
);
},
1300
)
}
else
{
//提交失败
showToast
(
"提交失败"
)
//提交失败,根据错误码显示错误信息
var
txt
=
codeMsgs
[
data
.
code
]
||
"提交失败"
;
showToast
(
txt
);
setTimeout
(()
=>
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
MAP_SCENE
);
},
1300
)
}
}
},
json
)
},
DataManager
.
ins
.
getData
(
"hc_doJoin"
).
data
,
this
.
chapter
,
json
,
DataManager
.
ins
.
getData
(
"getNgameStartStatus"
).
data
.
submitToken
)
}
/**
...
...
egret/src/something/enum/ElementType.ts
View file @
063c86e8
...
...
@@ -11,6 +11,13 @@ export enum ElementType {
LOLLIPOP
,
//棒棒糖6
ICE
,
//冰块7
}
export
const
codeMsgs
=
{
"E1002090011"
:
"用户关卡记录异常"
,
"E1002090012"
:
"暂不能挑战此关卡"
,
"E1002090015"
:
"关卡目标未完成"
,
"E1002090016"
:
"游戏数据提交异常"
,
"E1002090017"
:
"游戏关卡配置异常或关卡暂未开放"
,
}
//提交时候的对应字段字段,分数额外,字段是1
export
const
submitTran
=
{
0
:
4
,
...
...
egret/src/something/uis/ScoreProgress.ts
View file @
063c86e8
...
...
@@ -45,18 +45,26 @@ export class ScoreProgress {
}
}
w
=
(
663
-
595
)
*
scale
+
595
;
if
(
this
.
star3
.
source
!=
"lightedStar_png"
)
this
.
star3
.
source
=
"lightedStar_png"
;
if
(
this
.
star3
.
source
!=
"lightedStar_png"
)
{
this
.
star3
.
source
=
"lightedStar_png"
;
this
.
starCount
=
3
;
};
}
else
if
(
value
>=
this
.
starScores
[
1
])
{
scale
=
(
value
-
this
.
starScores
[
1
])
/
(
this
.
starScores
[
2
]
-
this
.
starScores
[
1
]);
w
=
(
595
-
522
)
*
scale
+
522
;
if
(
this
.
star2
.
source
!=
"lightedStar_png"
)
this
.
star2
.
source
=
"lightedStar_png"
;
if
(
this
.
star2
.
source
!=
"lightedStar_png"
)
{
this
.
star2
.
source
=
"lightedStar_png"
;
this
.
starCount
=
2
;
};
}
else
if
(
value
>=
this
.
starScores
[
0
])
{
scale
=
(
value
-
this
.
starScores
[
0
])
/
(
this
.
starScores
[
1
]
-
this
.
starScores
[
0
]);
w
=
(
522
-
446
)
*
scale
+
446
;
if
(
this
.
star1
.
source
!=
"lightedStar_png"
)
this
.
star1
.
source
=
"lightedStar_png"
;
if
(
this
.
star1
.
source
!=
"lightedStar_png"
)
{
this
.
star1
.
source
=
"lightedStar_png"
;
this
.
starCount
=
1
;
};
}
else
{
scale
=
value
/
this
.
starScores
[
0
];
w
=
(
446
-
188
)
*
scale
+
188
;
...
...
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