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
8d4c9546
Commit
8d4c9546
authored
Aug 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4b79e829
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
16 deletions
+49
-16
index.html
egret/index.html
+1
-1
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+14
-0
MapSkin.exml
egret/resource/skins/MapSkin.exml
+1
-1
MapScene.ts
egret/src/mapScene/MapScene.ts
+30
-12
home.json
mock/happyclear/home.json
+1
-1
openTreasureBox.json
mock/happyclear/openTreasureBox.json
+2
-1
No files found.
egret/index.html
View file @
8d4c9546
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<body>
<body>
<div
style=
"margin: auto;width: 100%;height: 100%;"
class=
"egret-player"
data-entry-class=
"Main"
<div
style=
"margin: auto;width: 100%;height: 100%;"
class=
"egret-player"
data-entry-class=
"Main"
data-orientation=
"auto"
data-scale-mode=
"showAll"
data-frame-rate=
"60"
data-content-width=
"750"
data-orientation=
"auto"
data-scale-mode=
"showAll"
data-frame-rate=
"60"
data-content-width=
"750"
data-content-height=
"1624"
data-multi-fingered=
"2"
data-show-fps=
"
tru
e"
data-show-log=
"false"
data-content-height=
"1624"
data-multi-fingered=
"2"
data-show-fps=
"
fals
e"
data-show-log=
"false"
data-show-fps-style=
"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"
>
data-show-fps-style=
"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"
>
</div>
</div>
...
...
egret/libs/tw/manager/NetManager.ts
View file @
8d4c9546
...
@@ -446,6 +446,20 @@ export class NetManager extends ABNetManager {
...
@@ -446,6 +446,20 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
hc_openTreasureBox
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
name
:
'hc_openTreasureBox'
,
uri
:
'/customActivity/happyclear/openTreasureBox'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
},
hideMsg
:
true
,
callback
:
callback
};
this
.
send
(
net
);
}
getOrderStatus
(
callback
:
Function
,
orderId
:
number
,
pollingCheck
?:
Function
,
pollingCount
=
10
):
void
{
getOrderStatus
(
callback
:
Function
,
orderId
:
number
,
pollingCheck
?:
Function
,
pollingCount
=
10
):
void
{
const
param
:
any
=
{
const
param
:
any
=
{
...
...
egret/resource/skins/MapSkin.exml
View file @
8d4c9546
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<e:Label
id=
"totalStarTxt"
text=
"210/210"
x=
"34.68"
verticalAlign=
"middle"
textAlign=
"left"
size=
"24"
verticalCenter=
"1.5"
/>
<e:Label
id=
"totalStarTxt"
text=
"210/210"
x=
"34.68"
verticalAlign=
"middle"
textAlign=
"left"
size=
"24"
verticalCenter=
"1.5"
/>
</e:Group>
</e:Group>
<e:Image
id=
"box"
source=
"宝箱_png"
right=
"34"
verticalCenter=
"3"
anchorOffsetX=
"34"
anchorOffsetY=
"34"
/>
<e:Image
id=
"box"
source=
"宝箱_png"
right=
"34"
verticalCenter=
"3"
anchorOffsetX=
"34"
anchorOffsetY=
"34"
/>
<e:Group
id=
"boxiconWrapper"
x=
"193.68"
y=
"34.86"
>
<e:Group
id=
"boxiconWrapper"
x=
"193.68"
y=
"34.86"
touchEnabled=
"false"
touchChildren=
"false"
>
<e:Image
x=
"8.32"
y=
"0"
source=
"iconbg_png"
/>
<e:Image
x=
"8.32"
y=
"0"
source=
"iconbg_png"
/>
<e:Label
id=
"boxNumsTxt"
text=
"88"
x=
"0"
verticalAlign=
"middle"
textAlign=
"center"
size=
"18"
width=
"46"
y=
"6.14"
/>
<e:Label
id=
"boxNumsTxt"
text=
"88"
x=
"0"
verticalAlign=
"middle"
textAlign=
"center"
size=
"18"
width=
"46"
y=
"6.14"
/>
</e:Group>
</e:Group>
...
...
egret/src/mapScene/MapScene.ts
View file @
8d4c9546
...
@@ -8,6 +8,7 @@ import setGlow from "../setGlow";
...
@@ -8,6 +8,7 @@ import setGlow from "../setGlow";
import
MapBottomPart
from
"./MapBottomPart"
;
import
MapBottomPart
from
"./MapBottomPart"
;
import
MapRpeatPart
from
"./MapRpeatPart"
;
import
MapRpeatPart
from
"./MapRpeatPart"
;
import
MapTopPart
from
"./MapTopPart"
;
import
MapTopPart
from
"./MapTopPart"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
MapScene
extends
Scene
{
export
default
class
MapScene
extends
Scene
{
scrollGroup
:
eui
.
Group
;
scrollGroup
:
eui
.
Group
;
...
@@ -42,8 +43,6 @@ export default class MapScene extends Scene {
...
@@ -42,8 +43,6 @@ export default class MapScene extends Scene {
this
.
scrollGroup
.
addChild
(
data
.
bottom
);
this
.
scrollGroup
.
addChild
(
data
.
bottom
);
data
.
bottom
.
y
=
data
.
top
.
height
+
(
data
.
list
.
length
*
data
.
list
[
0
].
height
);
data
.
bottom
.
y
=
data
.
top
.
height
+
(
data
.
list
.
length
*
data
.
list
[
0
].
height
);
// this.setGray(1);
for
(
const
key
in
MapScene
.
iconHash
)
{
for
(
const
key
in
MapScene
.
iconHash
)
{
const
element
=
MapScene
.
iconHash
[
key
];
const
element
=
MapScene
.
iconHash
[
key
];
element
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
element
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
...
@@ -51,15 +50,9 @@ export default class MapScene extends Scene {
...
@@ -51,15 +50,9 @@ export default class MapScene extends Scene {
NetManager
.
ins
.
clickLog
(
getlogItem
(
19
))
NetManager
.
ins
.
clickLog
(
getlogItem
(
19
))
},
this
)
},
this
)
}
}
// setTimeout(() => {
// PanelCtrl.instance.show('quit');
// // getSharePic(this);
// }, 2000);
this
.
updateHomeData
();
this
.
updateHomeData
();
this
.
showLog
();
this
.
showLog
();
this
.
updateBox
();
}
}
disableIcon
(
level
)
{
disableIcon
(
level
)
{
...
@@ -78,6 +71,13 @@ export default class MapScene extends Scene {
...
@@ -78,6 +71,13 @@ export default class MapScene extends Scene {
NetManager
.
ins
.
showLog
(
getlogItem
(
5
));
NetManager
.
ins
.
showLog
(
getlogItem
(
5
));
}
}
updateBox
()
{
const
homeData
=
getHomeData
();
this
[
'boxiconWrapper'
].
visible
=
homeData
.
canReceiveTreasureBoxNum
>
0
;
this
[
'totalStarTxt'
].
text
=
`
${
homeData
.
totalStarts
}
/
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
this
[
'boxNumsTxt'
].
text
=
`
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
}
updateScene
()
{
updateScene
()
{
this
.
updateHomeData
();
this
.
updateHomeData
();
}
}
...
@@ -85,8 +85,7 @@ export default class MapScene extends Scene {
...
@@ -85,8 +85,7 @@ export default class MapScene extends Scene {
const
homeData
=
getHomeData
();
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`
${
homeData
.
remainEnargy
}
/5`
;
this
[
'bloodTxt'
].
text
=
`
${
homeData
.
remainEnargy
}
/5`
;
this
[
'goldTxt'
].
text
=
`
${
homeData
.
wealth
}
`
;
this
[
'goldTxt'
].
text
=
`
${
homeData
.
wealth
}
`
;
this
[
'totalStarTxt'
].
text
=
`
${
homeData
.
totalStarts
}
/
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
this
[
'boxNumsTxt'
].
text
=
`
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
for
(
let
j
=
0
;
j
<
70
;
j
++
)
{
for
(
let
j
=
0
;
j
<
70
;
j
++
)
{
this
.
disableIcon
(
j
+
1
);
this
.
disableIcon
(
j
+
1
);
}
}
...
@@ -107,7 +106,26 @@ export default class MapScene extends Scene {
...
@@ -107,7 +106,26 @@ export default class MapScene extends Scene {
this
[
'bloodBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_bloodBtn
,
this
)
this
[
'bloodBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_bloodBtn
,
this
)
this
[
'settingBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
toggleSettings
,
this
)
this
[
'settingBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
toggleSettings
,
this
)
this
[
'shopBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shopBtn
,
this
)
this
[
'shopBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_shopBtn
,
this
)
this
[
'questionBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
)
this
[
'questionBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_questionBtn
,
this
);
this
[
'box'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_box
,
this
);
}
onTap_box
()
{
const
data
=
getHomeData
();
if
(
data
.
canReceiveTreasureBoxNum
>
0
)
{
this
[
'box'
].
touchEnabled
=
false
;
NetManager
.
ins
.
hc_openTreasureBox
((
success
)
=>
{
this
[
'box'
].
touchEnabled
=
true
;
if
(
success
)
{
const
boxdata
=
DataManager
.
ins
.
getData
(
'hc_openTreasureBox'
).
data
;
const
homeData
=
DataManager
.
ins
.
getData
(
'hc_home'
).
data
;
homeData
.
canReceiveTreasureBoxNum
=
boxdata
.
canReceiveTreasureBoxNum
;
homeData
.
nextRangeStarsNum
=
boxdata
.
nextRangeStarsNum
;
homeData
.
totalStarts
=
boxdata
.
totalStarts
;
this
.
updateBox
();
}
})
}
}
}
onTap_questionBtn
()
{
onTap_questionBtn
()
{
...
...
mock/happyclear/home.json
View file @
8d4c9546
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"code"
:
"0000000000"
,
"code"
:
"0000000000"
,
"data"
:{
"data"
:{
"askForEnergy"
:
true
,
"askForEnergy"
:
true
,
"canReceiveTreasureBoxNum"
:
23
,
"canReceiveTreasureBoxNum"
:
10
,
"nextRangeStarsNum"
:
10
,
"nextRangeStarsNum"
:
10
,
"remainEnargy"
:
11
,
"remainEnargy"
:
11
,
"remainProp"
:[
"remainProp"
:[
...
...
mock/happyclear/openTreasureBox.json
View file @
8d4c9546
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
"code"
:
"0000000000"
,
"code"
:
"0000000000"
,
"data"
:{
"data"
:{
"canReceiveTreasureBoxNum"
:
2
,
"canReceiveTreasureBoxNum"
:
2
,
"nextRangeStarsNum"
:
25
,
"nextRangeStarsNum"
:
99
,
"totalStarts"
:
0
,
"orderNum"
:
"2323"
"orderNum"
:
"2323"
},
},
"desc"
:
"OK"
,
"desc"
:
"OK"
,
...
...
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