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
b2e95b2d
Commit
b2e95b2d
authored
Dec 16, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fb7314ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
28 deletions
+49
-28
MapScene.ts
egret/src/mapScene/MapScene.ts
+2
-2
BloodPanel.ts
egret/src/panels/BloodPanel.ts
+6
-2
BloodPanel2.ts
egret/src/panels/BloodPanel2.ts
+37
-23
exchange.json
mock/happyclear/exchange.json
+4
-1
No files found.
egret/src/mapScene/MapScene.ts
View file @
b2e95b2d
...
@@ -1020,9 +1020,9 @@ export default class MapScene extends Scene {
...
@@ -1020,9 +1020,9 @@ export default class MapScene extends Scene {
onTap_bloodBtn
()
{
onTap_bloodBtn
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
2
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
2
));
if
(
getHomeData
().
remainEnargy
>
0
)
if
(
getHomeData
().
remainEnargy
>
0
)
PanelCtrl
.
instance
.
show
(
'bloodPanel'
)
PanelCtrl
.
instance
.
show
(
'bloodPanel'
)
;
else
else
PanelCtrl
.
instance
.
show
(
'blood2Panel'
)
PanelCtrl
.
instance
.
show
(
'blood2Panel'
)
;
}
}
setGray
(
order
:
number
)
{
setGray
(
order
:
number
)
{
...
...
egret/src/panels/BloodPanel.ts
View file @
b2e95b2d
...
@@ -71,7 +71,7 @@ export default class BloodPanel extends Panel {
...
@@ -71,7 +71,7 @@ export default class BloodPanel extends Panel {
onTapBuy
()
{
onTapBuy
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
30
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
30
));
this
[
'buyBtn'
].
enabled
=
false
;
this
[
'buyBtn'
].
enabled
=
false
;
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
NetManager
.
ins
.
hc_exchange
((
success
,
res
)
=>
{
this
[
'buyBtn'
].
enabled
=
true
;
this
[
'buyBtn'
].
enabled
=
true
;
if
(
success
)
{
if
(
success
)
{
showToast
(
'兑换成功'
);
showToast
(
'兑换成功'
);
...
@@ -81,7 +81,11 @@ export default class BloodPanel extends Panel {
...
@@ -81,7 +81,11 @@ export default class BloodPanel extends Panel {
SceneCtrl
.
instance
.
updateScene
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
},
window
[
'collectRuleId'
]);
}
else
{
}
else
{
PanelCtrl
.
instance
.
show
(
'shopTip'
,
{
from
:
'bloodPanel'
,
data
:
null
});
if
(
res
.
code
==
'600005'
)
{
showToast
(
'体力已满,快去闯关吧'
);
}
else
{
PanelCtrl
.
instance
.
show
(
'shopTip'
,
{
from
:
'bloodPanel'
,
data
:
null
});
}
}
}
},
1
);
},
1
);
}
}
...
...
egret/src/panels/BloodPanel2.ts
View file @
b2e95b2d
...
@@ -11,46 +11,48 @@ import { getlogItem } from "../Main";
...
@@ -11,46 +11,48 @@ import { getlogItem } from "../Main";
import
CountDown
from
"../mapScene/CountDown"
;
import
CountDown
from
"../mapScene/CountDown"
;
import
{
showShare
}
from
"../shareCtrl"
;
import
{
showShare
}
from
"../shareCtrl"
;
import
BloodPanel
from
"./BloodPanel"
;
import
BloodPanel
from
"./BloodPanel"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
export
default
class
BloodPanel2
extends
Panel
{
export
default
class
BloodPanel2
extends
Panel
{
start
(
data
)
{
start
(
data
)
{
super
.
start
();
super
.
start
();
this
.
updateData
();
this
.
updateData
();
this
.
showlog
();
this
.
showlog
();
this
[
'price1Txt'
].
text
=
`
${
window
[
'price1'
]}
个元宝=1个体力值`
;
this
[
'price1Txt'
].
text
=
`
${
window
[
'price1'
]}
个元宝=1个体力值`
;
}
}
showlog
(){
showlog
()
{
NetManager
.
ins
.
showLog
(
getlogItem
(
3
));
NetManager
.
ins
.
showLog
(
getlogItem
(
3
));
NetManager
.
ins
.
showLog
(
getlogItem
(
4
));
NetManager
.
ins
.
showLog
(
getlogItem
(
4
));
}
}
private
_countDown
:
CountDown
;
private
_countDown
:
CountDown
;
private
updateData
()
{
private
updateData
()
{
if
(
this
.
_countDown
==
null
)
{
if
(
this
.
_countDown
==
null
)
{
this
.
_countDown
=
new
CountDown
(
this
[
'countdownTxt'
],
(
str
)
=>
`距离下一次体力补给时间:
${
str
}
`
);
this
.
_countDown
=
new
CountDown
(
this
[
'countdownTxt'
],
(
str
)
=>
`距离下一次体力补给时间:
${
str
}
`
);
}
}
const
homeData
=
getHomeData
();
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
const
data
=
getHomeData
();
const
data
=
getHomeData
();
this
[
'invitTxt'
].
text
=
`(已领
${
data
.
askForEnergy
}
/
${
BloodPanel
.
MAX
}
)`
;
this
[
'invitTxt'
].
text
=
`(已领
${
data
.
askForEnergy
}
/
${
BloodPanel
.
MAX
}
)`
;
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
this
[
'inviteBtn2'
].
visible
=
true
;
this
[
'inviteBtn2'
].
visible
=
true
;
}
}
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
this
.
_countDown
.
stop
();
this
.
_countDown
.
stop
();
this
[
'countdownTxt'
].
visible
=
false
;
this
[
'countdownTxt'
].
visible
=
false
;
}
else
{
}
else
{
this
[
'countdownTxt'
].
visible
=
true
;
this
[
'countdownTxt'
].
visible
=
true
;
const
left
=
data
.
refectionCountdown
-
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
const
left
=
data
.
refectionCountdown
-
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
this
.
_countDown
.
reset
(
left
);
this
.
_countDown
.
reset
(
left
);
}
}
}
}
updateTimerView
(){
updateTimerView
()
{
this
.
updateData
();
this
.
updateData
();
}
}
...
@@ -64,48 +66,60 @@ this['price1Txt'].text =`${ window['price1']}个元宝=1个体力值`;
...
@@ -64,48 +66,60 @@ this['price1Txt'].text =`${ window['price1']}个元宝=1个体力值`;
onTapBuy
()
{
onTapBuy
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
3
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
3
));
this
[
'buyBtn'
].
enabled
=
false
;
this
[
'buyBtn'
].
enabled
=
false
;
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
NetManager
.
ins
.
hc_exchange
((
success
,
res
)
=>
{
this
[
'buyBtn'
].
enabled
=
true
;
this
[
'buyBtn'
].
enabled
=
true
;
if
(
success
)
{
if
(
success
)
{
showToast
(
'兑换成功'
);
showToast
(
'兑换成功'
);
NetManager
.
ins
.
hc_home
(()
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
this
.
updateData
();
updateMainTimer
();
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
},
window
[
'collectRuleId'
]);
}
else
{
if
(
res
.
code
==
'600005'
)
{
showToast
(
'体力已满,快去闯关吧'
);
}
else
{
PanelCtrl
.
instance
.
show
(
'shopTip'
,
{
from
:
'blood2Panel'
,
data
:
null
});
}
}
}
},
1
);
},
1
);
}
}
onTapInvite
()
{
onTapInvite
()
{
if
(
iswx
())
{
if
(
iswx
())
{
getShareUrl
(
this
.
stage
);
getShareUrl
(
this
.
stage
);
}
else
}
else
showShare
(
1
);
showShare
(
1
);
NetManager
.
ins
.
clickLog
(
getlogItem
(
4
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
4
));
const
data
=
getHomeData
();
const
data
=
getHomeData
();
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
showToast
(
'对不起,索要体力的机会已经用完了~'
);
showToast
(
'对不起,索要体力的机会已经用完了~'
);
return
;
return
;
}
}
this
[
'inviteBtn'
].
enabled
=
false
;
this
[
'inviteBtn'
].
enabled
=
false
;
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
this
[
'inviteBtn'
].
enabled
=
true
;
this
[
'inviteBtn'
].
enabled
=
true
;
if
(
success
)
{
if
(
success
)
{
}
}
NetManager
.
ins
.
hc_home
(()
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
this
.
updateData
();
updateMainTimer
();
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功~'
);
showToast
(
'分享成功~'
);
});
});
})
})
}
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
get
skinKey
()
{
return
'Blood2'
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
get
skinKey
()
{
return
'Blood2'
}
}
}
\ No newline at end of file
mock/happyclear/exchange.json
View file @
b2e95b2d
{
{
"success"
:
false
"success"
:
false
,
"code"
:
"600005"
,
"data"
:
null
,
"desc"
:
"sss"
}
}
\ No newline at end of file
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