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
6f9889a7
Commit
6f9889a7
authored
Sep 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
24df9bcf
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
310 additions
and
91 deletions
+310
-91
MainBase.ts
egret/libs/new_wx/MainBase.ts
+6
-2
blood2按钮 副本.png
egret/resource/assets/blood2/blood2按钮 副本.png
+0
-0
blood2按钮 副本1.png
egret/resource/assets/blood2/blood2按钮 副本1.png
+0
-0
default.res.json
egret/resource/default.res.json
+14
-0
default.thm.json
egret/resource/default.thm.json
+44
-42
Blood2Skin.exml
egret/resource/skins/Blood2Skin.exml
+34
-0
BloodSkin.exml
egret/resource/skins/BloodSkin.exml
+2
-2
ExchangeSkin.exml
egret/resource/skins/ExchangeSkin.exml
+27
-0
PropType.ts
egret/src/PropType.ts
+2
-1
CountDown.ts
egret/src/mapScene/CountDown.ts
+1
-0
MapScene.ts
egret/src/mapScene/MapScene.ts
+16
-21
BloodPanel.ts
egret/src/panels/BloodPanel.ts
+8
-7
BloodPanel2.ts
egret/src/panels/BloodPanel2.ts
+110
-0
ExchangePanel.ts
egret/src/panels/ExchangePanel.ts
+39
-0
ShopPanel.ts
egret/src/panels/ShopPanel.ts
+2
-11
StartPanel.ts
egret/src/panels/StartPanel.ts
+1
-1
home.json
mock/happyclear/home.json
+4
-4
No files found.
egret/libs/new_wx/MainBase.ts
View file @
6f9889a7
...
@@ -37,6 +37,8 @@ import { ModuleTypes } from "./types/sceneTypes";
...
@@ -37,6 +37,8 @@ import { ModuleTypes } from "./types/sceneTypes";
import
layers
from
"./views/layers"
;
import
layers
from
"./views/layers"
;
import
SignPrizePanel
from
"../../src/panels/SignPrizePanel"
;
import
SignPrizePanel
from
"../../src/panels/SignPrizePanel"
;
import
{
BLOOD_NUMS_MAX
}
from
"../../src/getHomeData"
;
import
{
BLOOD_NUMS_MAX
}
from
"../../src/getHomeData"
;
import
BloodPanel2
from
"../../src/panels/BloodPanel2"
;
import
ExchangePanel
from
"../../src/panels/ExchangePanel"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
constructor
()
{
...
@@ -55,12 +57,14 @@ export default class MainBase extends eui.UILayer {
...
@@ -55,12 +57,14 @@ export default class MainBase extends eui.UILayer {
[
ModuleTypes
.
PRIZE_PANEL
,
{
cls
:
PrizePanel
}],
[
ModuleTypes
.
PRIZE_PANEL
,
{
cls
:
PrizePanel
}],
[
ModuleTypes
.
NO_PRIZE_PANEL
,
{
cls
:
NoPrizePanel
}],
[
ModuleTypes
.
NO_PRIZE_PANEL
,
{
cls
:
NoPrizePanel
}],
[
'bloodPanel'
,
{
cls
:
BloodPanel
}],
[
'bloodPanel'
,
{
cls
:
BloodPanel
}],
[
'blood2Panel'
,
{
cls
:
BloodPanel2
}],
[
'GoldPanel'
,
{
cls
:
GoldPanel
}],
[
'GoldPanel'
,
{
cls
:
GoldPanel
}],
[
'Shop'
,
{
cls
:
ShopPanel
}],
[
'Shop'
,
{
cls
:
ShopPanel
}],
[
'StartPanel'
,
{
cls
:
StartPanel
}],
[
'StartPanel'
,
{
cls
:
StartPanel
}],
[
'Buy1'
,
{
cls
:
Buy1Panel
}],
[
'Buy1'
,
{
cls
:
Buy1Panel
}],
[
'Buy2'
,
{
cls
:
Buy2Panel
}],
[
'Buy2'
,
{
cls
:
Buy2Panel
}],
[
'Buy3'
,
{
cls
:
Buy3Panel
}],
[
'Buy3'
,
{
cls
:
Buy3Panel
}],
[
'ExchangePanel'
,
{
cls
:
ExchangePanel
}],
[
'failed'
,
{
cls
:
FailedPanel
}],
[
'failed'
,
{
cls
:
FailedPanel
}],
[
'quit'
,
{
cls
:
QuitPanel
}],
[
'quit'
,
{
cls
:
QuitPanel
}],
[
'box'
,
{
cls
:
BoxPanel
}],
[
'box'
,
{
cls
:
BoxPanel
}],
...
@@ -317,10 +321,10 @@ timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, () => {
...
@@ -317,10 +321,10 @@ timer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, () => {
//更新bloodpanel和mapscene
//更新bloodpanel和mapscene
const
currentScene
=
SceneCtrl
.
instance
.
currentScene
;
const
currentScene
=
SceneCtrl
.
instance
.
currentScene
;
if
(
currentScene
&&
currentScene
[
'updateTimerView'
])
if
(
currentScene
&&
currentScene
[
'updateTimerView'
])
currentScene
[
'updateTimerView'
];
currentScene
[
'updateTimerView'
]
()
;
const
current
=
PanelCtrl
.
instance
.
_current
;
const
current
=
PanelCtrl
.
instance
.
_current
;
if
(
current
&&
current
[
'updateTimerView'
])
if
(
current
&&
current
[
'updateTimerView'
])
current
[
'updateTimerView'
];
current
[
'updateTimerView'
]
()
;
},
window
[
'collectRuleId'
]);
},
window
[
'collectRuleId'
]);
},
this
)
},
this
)
export
const
mainTimer
=
timer
;
export
const
mainTimer
=
timer
;
...
...
egret/resource/assets/blood2/blood2按钮 副本.png
0 → 100644
View file @
6f9889a7
11.3 KB
egret/resource/assets/blood2/blood2按钮 副本1.png
0 → 100644
View file @
6f9889a7
11.6 KB
egret/resource/default.res.json
View file @
6f9889a7
...
@@ -71,6 +71,10 @@
...
@@ -71,6 +71,10 @@
{
{
"keys"
:
"startpanel通关条件_png,startpanel数量_png,startpanel数量 副本 3_png,startpanel目标33_png,startpanel目标3_png,startpanel按钮_png,startpanel_ice1_png,startpanel_ele6_png,startpanel_block2_png"
,
"keys"
:
"startpanel通关条件_png,startpanel数量_png,startpanel数量 副本 3_png,startpanel目标33_png,startpanel目标3_png,startpanel按钮_png,startpanel_ice1_png,startpanel_ele6_png,startpanel_block2_png"
,
"name"
:
"startpanel"
"name"
:
"startpanel"
},
{
"keys"
:
"blood2按钮 副本1_png,blood2按钮 副本_png"
,
"name"
:
"blood2"
}
}
],
],
"resources"
:
[
"resources"
:
[
...
@@ -1698,6 +1702,16 @@
...
@@ -1698,6 +1702,16 @@
"url"
:
"assets/mainScene/stepAni10.png"
,
"url"
:
"assets/mainScene/stepAni10.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"stepAni10_png"
"name"
:
"stepAni10_png"
},
{
"url"
:
"assets/blood2/blood2按钮 副本1.png"
,
"type"
:
"image"
,
"name"
:
"blood2按钮 副本1_png"
},
{
"url"
:
"assets/blood2/blood2按钮 副本.png"
,
"type"
:
"image"
,
"name"
:
"blood2按钮 副本_png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/default.thm.json
View file @
6f9889a7
{
{
"skins"
:
{},
"skins"
:
{},
"autoGenerateExmlsList"
:
true
,
"autoGenerateExmlsList"
:
true
,
"exmls"
:
[
"exmls"
:
[
"resource/skins/SignSkin.exml"
,
"resource/skins/SignSkin.exml"
,
"resource/skins/SignPrizeSkin.exml"
,
"resource/skins/SignPrizeSkin.exml"
,
"resource/skins/AlertSkin.exml"
,
"resource/skins/AlertSkin.exml"
,
"resource/skins/BloodSkin.exml"
,
"resource/skins/BloodSkin.exml"
,
"resource/skins/Box2Skin.exml"
,
"resource/skins/Blood2Skin.exml"
,
"resource/skins/BoxSkin.exml"
,
"resource/skins/Box2Skin.exml"
,
"resource/skins/Buy1Skin.exml"
,
"resource/skins/BoxSkin.exml"
,
"resource/skins/Buy2Skin.exml"
,
"resource/skins/Buy1Skin.exml"
,
"resource/skins/Buy3Skin.exml"
,
"resource/skins/Buy2Skin.exml"
,
"resource/skins/FailSkin.exml"
,
"resource/skins/Buy3Skin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/ExchangeSkin.exml"
,
"resource/skins/Main2Skin.exml"
,
"resource/skins/FailSkin.exml"
,
"resource/skins/MapBottomSkin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/MapRepeatSkin.exml"
,
"resource/skins/Main2Skin.exml"
,
"resource/skins/MapSkin.exml"
,
"resource/skins/MapBottomSkin.exml"
,
"resource/skins/MapTopSkin.exml"
,
"resource/skins/MapRepeatSkin.exml"
,
"resource/skins/NoPrizeSkin.exml"
,
"resource/skins/MapSkin.exml"
,
"resource/skins/OptionItemSkin.exml"
,
"resource/skins/MapTopSkin.exml"
,
"resource/skins/OptionsSkin.exml"
,
"resource/skins/NoPrizeSkin.exml"
,
"resource/skins/PlaySkin.exml"
,
"resource/skins/OptionItemSkin.exml"
,
"resource/skins/Prize2Skin.exml"
,
"resource/skins/OptionsSkin.exml"
,
"resource/skins/PrizeSkin.exml"
,
"resource/skins/PlaySkin.exml"
,
"resource/skins/QuitSkin.exml"
,
"resource/skins/Prize2Skin.exml"
,
"resource/skins/RankItemSkin.exml"
,
"resource/skins/PrizeSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/QuitSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/RankItemSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/ShowOffSkin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
"resource/skins/StartPanelSkin.exml"
,
"resource/skins/ShowOffSkin.exml"
,
"resource/skins/StartSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/TargetItemSkin.exml"
,
"resource/skins/StartPanelSkin.exml"
,
"resource/skins/ToastSkin.exml"
,
"resource/skins/StartSkin.exml"
,
"resource/skins/VScrollBarSkin.exml"
"resource/skins/TargetItemSkin.exml"
,
],
"resource/skins/ToastSkin.exml"
,
"path"
:
"resource/default.thm.json"
"resource/skins/VScrollBarSkin.exml"
],
"path"
:
"resource/default.thm.json"
}
}
\ No newline at end of file
egret/resource/skins/Blood2Skin.exml
0 → 100644
View file @
6f9889a7
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"Blood2Skin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
y=
"46"
horizontalCenter=
"0"
source=
"blood体力补济站_png"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"614"
y=
"241"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"buyBtn"
label=
""
x=
"433"
y=
"522"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"blood按钮 副本_png"
source.down=
"blood按钮 副本_png"
source.disabled=
"blood按钮 副本_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"inviteBtn"
label=
""
x=
"433"
y=
"661"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"blood按钮 副本1_png"
source.down=
"blood按钮 副本1_png"
source.disabled=
"blood按钮 副本1_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label
id=
"bloodTxt"
text=
"你的可用体力值为:5"
y=
"306"
horizontalCenter=
"0"
textColor=
"0xe2701b"
/>
<e:Label
id=
"countdownTxt"
text=
"距离下一次体力补给时间:"
y=
"772"
textColor=
"0xE2701B"
size=
"24"
width=
"509"
horizontalCenter=
"0"
verticalAlign=
"middle"
textAlign=
"center"
/>
<e:Label
text=
"使用元宝购买"
y=
"524"
textColor=
"0x821818"
size=
"27"
x=
"228"
/>
<e:Label
text=
"分享好友获得体力"
y=
"663"
textColor=
"0x821818"
size=
"27"
x=
"225.92"
/>
<e:Label
id=
"invitTxt"
text=
"(已领0/1)"
y=
"699"
textColor=
"0x821818"
size=
"27"
x=
"232"
/>
<e:Label
id=
"price1Txt"
text=
"20"
y=
"565"
textColor=
"0x821818"
x=
"274"
size=
"27"
/>
</e:Skin>
\ No newline at end of file
egret/resource/skins/BloodSkin.exml
View file @
6f9889a7
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Button
id=
"resumeBtn"
label=
""
y=
"
78
7"
horizontalCenter=
"0"
>
<e:Button
id=
"resumeBtn"
label=
""
y=
"
81
7"
horizontalCenter=
"0"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"blood按钮_png"
source.down=
"blood按钮_png"
source.disabled=
"blood按钮_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"blood按钮_png"
source.down=
"blood按钮_png"
source.disabled=
"blood按钮_png"
/>
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Label
id=
"bloodTxt"
text=
"你的可用体力值为:5"
y=
"306"
horizontalCenter=
"0"
textColor=
"0xe2701b"
/>
<e:Label
id=
"bloodTxt"
text=
"你的可用体力值为:5"
y=
"306"
horizontalCenter=
"0"
textColor=
"0xe2701b"
/>
<e:Label
id=
"
bloodNumTxt"
text=
"5"
y=
"373"
size=
"75"
x=
"358"
textColor=
"0xffffff
"
/>
<e:Label
id=
"
countdownTxt"
text=
"距离下一次体力补给时间:"
y=
"772"
textColor=
"0xE2701B"
size=
"24"
width=
"509"
horizontalCenter=
"0"
verticalAlign=
"middle"
textAlign=
"center
"
/>
<e:Label
text=
"使用元宝购买"
y=
"524"
textColor=
"0x821818"
size=
"27"
x=
"228"
/>
<e:Label
text=
"使用元宝购买"
y=
"524"
textColor=
"0x821818"
size=
"27"
x=
"228"
/>
<e:Label
text=
"分享好友获得体力"
y=
"663"
textColor=
"0x821818"
size=
"27"
x=
"225.92"
/>
<e:Label
text=
"分享好友获得体力"
y=
"663"
textColor=
"0x821818"
size=
"27"
x=
"225.92"
/>
<e:Label
id=
"invitTxt"
text=
"(已领0/1)"
y=
"699"
textColor=
"0x821818"
size=
"27"
x=
"232"
/>
<e:Label
id=
"invitTxt"
text=
"(已领0/1)"
y=
"699"
textColor=
"0x821818"
size=
"27"
x=
"232"
/>
...
...
egret/resource/skins/ExchangeSkin.exml
0 → 100644
View file @
6f9889a7
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"ExchangeSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<w:Config
id=
"16c984f7919"
/>
<e:Image
y=
"50"
horizontalCenter=
"0"
source=
"购买步数增加_png"
/>
<e:Button
id=
"buyBtn"
label=
""
y=
"589"
horizontalCenter=
"0"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"btn_png"
source.down=
"btn_png"
source.disabled=
"btn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"closeBtn"
label=
""
x=
"614"
y=
"187"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label
id=
"priceTxt"
text=
"-1000"
x=
"350.08"
y=
"617"
bold=
"true"
size=
"44"
touchEnabled=
"false"
/>
<e:Group
y=
"706"
horizontalCenter=
"0"
>
<e:Label
text=
"可使用的元宝:"
x=
"34.88"
y=
"0"
textColor=
"0x885037"
size=
"24"
/>
<e:Label
id=
"moneyTxt"
text=
"00000"
x=
"192.97"
y=
"0"
textColor=
"0x885037"
size=
"24"
/>
<e:Image
source=
"common_yuanbao_png"
x=
"2.93"
y=
"1.04"
/>
</e:Group>
</e:Skin>
\ No newline at end of file
egret/src/PropType.ts
View file @
6f9889a7
enum
PropType
{
enum
PropType
{
BOOM
=
2
,
BOOM
=
2
,
HAMMER
=
3
,
HAMMER
=
3
,
CHANCE_NUM
=
4
CHANCE_NUM
=
4
,
CASH_NUM
=
5
}
}
export
default
PropType
export
default
PropType
\ No newline at end of file
egret/src/mapScene/CountDown.ts
View file @
6f9889a7
...
@@ -44,5 +44,6 @@ export default class CountDown extends egret.EventDispatcher {
...
@@ -44,5 +44,6 @@ export default class CountDown extends egret.EventDispatcher {
this
.
_timer
.
repeatCount
=
repeatCount
;
this
.
_timer
.
repeatCount
=
repeatCount
;
this
.
_timer
.
reset
();
this
.
_timer
.
reset
();
this
.
_timer
.
start
();
this
.
_timer
.
start
();
this
.
updateTxt
();
}
}
}
}
\ No newline at end of file
egret/src/mapScene/MapScene.ts
View file @
6f9889a7
...
@@ -29,7 +29,7 @@ export default class MapScene extends Scene {
...
@@ -29,7 +29,7 @@ export default class MapScene extends Scene {
static
starHash
:
any
=
{};
static
starHash
:
any
=
{};
_data
;
_data
;
async
start
(
data
?)
{
async
start
(
data
?)
{
super
.
start
();
super
.
start
();
if
(
getBgOn
()
&&
MapScene
[
'firstPlayBgTag'
]
==
true
)
{
if
(
getBgOn
()
&&
MapScene
[
'firstPlayBgTag'
]
==
true
)
{
playBg
();
playBg
();
...
@@ -225,7 +225,7 @@ export default class MapScene extends Scene {
...
@@ -225,7 +225,7 @@ export default class MapScene extends Scene {
this
[
'boxiconWrapper'
].
visible
=
homeData
.
canReceiveTreasureBoxNum
>
0
;
this
[
'boxiconWrapper'
].
visible
=
homeData
.
canReceiveTreasureBoxNum
>
0
;
this
[
'totalStarTxt'
].
text
=
`
${
homeData
.
totalStars
}
/
${
homeData
.
nextRangeStarsNum
}
`
;
this
[
'totalStarTxt'
].
text
=
`
${
homeData
.
totalStars
}
/
${
homeData
.
nextRangeStarsNum
}
`
;
this
[
'boxNumsTxt'
].
text
=
`
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
this
[
'boxNumsTxt'
].
text
=
`
${
homeData
.
canReceiveTreasureBoxNum
}
`
;
this
[
'treasureboxBtn'
].
visible
=
!
homeData
.
isGetAllTreasureBox
;
this
[
'treasureboxBtn'
].
visible
=
!
homeData
.
isGetAllTreasureBox
;
}
}
updateScene
()
{
updateScene
()
{
...
@@ -233,7 +233,7 @@ export default class MapScene extends Scene {
...
@@ -233,7 +233,7 @@ export default class MapScene extends Scene {
}
}
updateHomeData
()
{
updateHomeData
()
{
const
homeData
=
getHomeData
();
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`
${
homeData
.
remainEnargy
}
/5`
;
this
[
'goldTxt'
].
text
=
`
${
homeData
.
wealth
}
`
;
this
[
'goldTxt'
].
text
=
`
${
homeData
.
wealth
}
`
;
for
(
let
j
=
1
;
j
<
window
[
'total_level'
];
j
++
)
{
for
(
let
j
=
1
;
j
<
window
[
'total_level'
];
j
++
)
{
...
@@ -261,32 +261,24 @@ export default class MapScene extends Scene {
...
@@ -261,32 +261,24 @@ export default class MapScene extends Scene {
}
}
this
.
updateTimerView
();
this
.
updateTimerView
();
}
}
private
_countDown
:
CountDown
;
private
_countDown
:
CountDown
;
updateTimerView
(){
updateTimerView
()
{
//更新倒计时
//更新倒计时
if
(
this
.
_countDown
==
null
)
{
if
(
this
.
_countDown
==
null
)
{
this
.
_countDown
=
new
CountDown
(
this
[
'countdown'
]);
this
.
_countDown
=
new
CountDown
(
this
[
'countdown'
]);
this
.
_countDown
.
addEventListener
(
egret
.
TimerEvent
.
TIMER_COMPLETE
,
this
.
onTimerComplete
,
this
)
}
}
const
data
=
getHomeData
();
const
data
=
getHomeData
();
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
this
.
_countDown
.
stop
();
this
.
_countDown
.
stop
();
}
else
{
this
[
'countdown'
].
visible
=
false
;
}
else
{
const
left
=
data
.
countdown
-
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
const
left
=
data
.
countdown
-
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
this
.
_countDown
.
reset
(
left
);
this
.
_countDown
.
reset
(
left
);
this
[
'countdown'
].
visible
=
true
;
}
}
}
this
[
'bloodTxt'
].
text
=
`
${
data
.
remainEnargy
}
/5`
;
onTimerComplete
(){
//这里不做操作,等待主倒计时进程的通知
// console.log(1)
// setTimeout(() => {
// this._countDown.reset(6000);
// }, 3000);
}
}
protected
initEvents
()
{
protected
initEvents
()
{
...
@@ -444,7 +436,10 @@ export default class MapScene extends Scene {
...
@@ -444,7 +436,10 @@ export default class MapScene extends Scene {
onTap_bloodBtn
()
{
onTap_bloodBtn
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
2
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
2
));
PanelCtrl
.
instance
.
show
(
'bloodPanel'
)
if
(
getHomeData
().
remainEnargy
>
0
)
PanelCtrl
.
instance
.
show
(
'bloodPanel'
)
else
PanelCtrl
.
instance
.
show
(
'blood2Panel'
)
}
}
setGray
(
order
:
number
)
{
setGray
(
order
:
number
)
{
...
...
egret/src/panels/BloodPanel.ts
View file @
6f9889a7
...
@@ -10,6 +10,7 @@ import { iswx } from "../iswx";
...
@@ -10,6 +10,7 @@ import { iswx } from "../iswx";
import
getShowOffPic
from
"../getShowOffPic"
;
import
getShowOffPic
from
"../getShowOffPic"
;
import
getSharePic
,
{
getShareUrl
}
from
"../getSharePic"
;
import
getSharePic
,
{
getShareUrl
}
from
"../getSharePic"
;
import
CountDown
from
"../mapScene/CountDown"
;
import
CountDown
from
"../mapScene/CountDown"
;
import
{
updateMainTimer
}
from
"../../libs/new_wx/MainBase"
;
export
default
class
BloodPanel
extends
Panel
{
export
default
class
BloodPanel
extends
Panel
{
start
(
data
)
{
start
(
data
)
{
...
@@ -29,8 +30,7 @@ this['price1Txt'].text = window['price1'];
...
@@ -29,8 +30,7 @@ this['price1Txt'].text = window['price1'];
private
_countDown
:
CountDown
;
private
_countDown
:
CountDown
;
private
updateData
()
{
private
updateData
()
{
if
(
this
.
_countDown
==
null
)
{
if
(
this
.
_countDown
==
null
)
{
this
.
_countDown
=
new
CountDown
(
this
[
'countdown'
]);
this
.
_countDown
=
new
CountDown
(
this
[
'countdownTxt'
],(
str
)
=>
`距离下一次体力补给时间:
${
str
}
`
);
this
.
_countDown
.
addEventListener
(
egret
.
TimerEvent
.
TIMER_COMPLETE
,
this
.
onTimerComplete
,
this
)
}
}
const
homeData
=
getHomeData
();
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
...
@@ -42,8 +42,11 @@ this['price1Txt'].text = window['price1'];
...
@@ -42,8 +42,11 @@ this['price1Txt'].text = window['price1'];
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
;
}
else
{
}
else
{
this
.
_countDown
.
reset
(
10
);
this
[
'countdownTxt'
].
visible
=
true
;
const
left
=
data
.
countdown
-
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
this
.
_countDown
.
reset
(
left
);
}
}
}
}
...
@@ -51,10 +54,6 @@ this['price1Txt'].text = window['price1'];
...
@@ -51,10 +54,6 @@ this['price1Txt'].text = window['price1'];
this
.
updateData
();
this
.
updateData
();
}
}
onTimerComplete
(){
//这里不做操作,等待主倒计时进程的通知
}
initEvents
()
{
initEvents
()
{
super
.
initEvents
();
super
.
initEvents
();
this
[
'inviteBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapInvite
,
this
)
this
[
'inviteBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapInvite
,
this
)
...
@@ -70,6 +69,7 @@ this['price1Txt'].text = window['price1'];
...
@@ -70,6 +69,7 @@ this['price1Txt'].text = window['price1'];
showToast
(
'购买成功'
);
showToast
(
'购买成功'
);
NetManager
.
ins
.
hc_home
(()
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
this
.
updateData
();
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
},
window
[
'collectRuleId'
]);
...
@@ -97,6 +97,7 @@ this['price1Txt'].text = window['price1'];
...
@@ -97,6 +97,7 @@ this['price1Txt'].text = window['price1'];
}
}
NetManager
.
ins
.
hc_home
(()
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
this
.
updateData
();
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
wait
(
2000
).
then
(()
=>
{
...
...
egret/src/panels/BloodPanel2.ts
0 → 100644
View file @
6f9889a7
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
getHomeData
,
{
BLOOD_NUMS_MAX
}
from
"../getHomeData"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
import
{
getlogItem
}
from
"../Main"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
{
showShare
}
from
"../shareCtrl"
;
import
{
iswx
}
from
"../iswx"
;
import
getShowOffPic
from
"../getShowOffPic"
;
import
getSharePic
,
{
getShareUrl
}
from
"../getSharePic"
;
import
CountDown
from
"../mapScene/CountDown"
;
import
{
updateMainTimer
}
from
"../../libs/new_wx/MainBase"
;
export
default
class
BloodPanel2
extends
Panel
{
start
(
data
)
{
super
.
start
();
this
.
updateData
();
this
.
showlog
();
this
[
'price1Txt'
].
text
=
window
[
'price1'
];
}
showlog
(){
NetManager
.
ins
.
showLog
(
getlogItem
(
3
));
NetManager
.
ins
.
showLog
(
getlogItem
(
4
));
}
private
_countDown
:
CountDown
;
private
updateData
()
{
if
(
this
.
_countDown
==
null
)
{
this
.
_countDown
=
new
CountDown
(
this
[
'countdownTxt'
],(
str
)
=>
`距离下一次体力补给时间:
${
str
}
`
);
}
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
const
data
=
getHomeData
();
this
[
'invitTxt'
].
text
=
`(已领0/1)`
;
if
(
data
.
askForEnergy
)
this
[
'invitTxt'
].
text
=
`(已领1/1)`
;
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
this
.
_countDown
.
stop
();
this
[
'countdownTxt'
].
visible
=
false
;
}
else
{
this
[
'countdownTxt'
].
visible
=
true
;
const
left
=
data
.
countdown
-
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
this
.
_countDown
.
reset
(
left
);
}
}
updateTimerView
(){
this
.
updateData
();
}
initEvents
()
{
super
.
initEvents
();
this
[
'inviteBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapInvite
,
this
)
this
[
'buyBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapBuy
,
this
)
}
onTapBuy
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
3
));
this
[
'buyBtn'
].
enabled
=
false
;
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
this
[
'buyBtn'
].
enabled
=
true
;
if
(
success
)
{
showToast
(
'购买成功'
);
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
}
},
1
);
}
onTapInvite
()
{
if
(
iswx
())
{
getShareUrl
(
this
.
stage
);
}
else
showShare
(
1
);
NetManager
.
ins
.
clickLog
(
getlogItem
(
4
));
const
data
=
getHomeData
();
if
(
data
.
askForEnergy
)
{
showToast
(
'对不起,已经索要过体力了~'
);
return
;
}
this
[
'inviteBtn'
].
enabled
=
false
;
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
this
[
'inviteBtn'
].
enabled
=
true
;
if
(
success
)
{
this
[
'invitTxt'
].
text
=
`(已领1/1)`
;
}
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功~'
);
});
})
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
get
skinKey
()
{
return
'Blood2'
}
}
\ No newline at end of file
egret/src/panels/ExchangePanel.ts
0 → 100644
View file @
6f9889a7
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
PropType
from
"../PropType"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
import
{
getlogItem
}
from
"../Main"
;
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
import
setGlow
from
"../setGlow"
;
import
getHomeData
from
"../getHomeData"
;
export
default
class
ExchangePanel
extends
Panel
{
start
(
data
)
{
super
.
start
();
this
[
'buyBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
ontap
,
this
);
this
.
showlog
();
this
[
'priceTxt'
].
text
=
'-'
+
window
[
'price5'
];
setGlow
(
this
[
'priceTxt'
],
0x0083e8
,
1
);
this
[
'moneyTxt'
].
text
=
getHomeData
().
wealth
;
}
showlog
()
{
}
buyBtn
:
eui
.
Button
get
skinKey
()
{
return
'Exchange'
}
ontap
()
{
this
.
buyBtn
.
enabled
=
false
;
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
showToast
(
'购买成功!去玩游戏~'
);
this
.
buyBtn
.
enabled
=
true
;
if
(
success
)
{
this
.
hidePanel
();
NetManager
.
ins
.
hc_home
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
}
},
PropType
.
CASH_NUM
);
//兑换道具
}
}
\ No newline at end of file
egret/src/panels/ShopPanel.ts
View file @
6f9889a7
...
@@ -28,18 +28,9 @@ export default class ShopPanel extends Panel {
...
@@ -28,18 +28,9 @@ export default class ShopPanel extends Panel {
}
}
onBuy4
()
{
onBuy4
()
{
console
.
log
(
'4444444'
);
//这里应该是订制接口
// this.buyBtn1.enabled = false;
PanelCtrl
.
instance
.
show
(
'ExchangePanel'
);
// NetManager.ins.hc_exchange((success) => {
// this.buyBtn1.enabled = true;
// if (success) {
// NetManager.ins.hc_home(() => {
// SceneCtrl.instance.updateScene();
// }, window['collectRuleId'])
// }
// }, 2, PropType.HAMMER);//兑换道具
}
}
onBuy1
()
{
onBuy1
()
{
PanelCtrl
.
instance
.
show
(
'Buy1'
);
PanelCtrl
.
instance
.
show
(
'Buy1'
);
...
...
egret/src/panels/StartPanel.ts
View file @
6f9889a7
...
@@ -71,7 +71,7 @@ export default class StartPanel extends Panel {
...
@@ -71,7 +71,7 @@ export default class StartPanel extends Panel {
const
homeData
=
getHomeData
();
const
homeData
=
getHomeData
();
if
(
homeData
.
remainEnargy
<=
0
)
{
if
(
homeData
.
remainEnargy
<=
0
)
{
if
(
homeData
.
askForEnergy
)
{
if
(
homeData
.
askForEnergy
)
{
PanelCtrl
.
instance
.
show
(
'bloodPanel'
);
PanelCtrl
.
instance
.
show
(
'blood
2
Panel'
);
}
else
{
}
else
{
if
(
iswx
())
{
if
(
iswx
())
{
getShareUrl
(
this
.
stage
);
getShareUrl
(
this
.
stage
);
...
...
mock/happyclear/home.json
View file @
6f9889a7
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
"success"
:
true
,
"success"
:
true
,
"code"
:
"0000000000"
,
"code"
:
"0000000000"
,
"desc"
:
"OK"
,
"desc"
:
"OK"
,
"timestamp"
:
15668858110
3
1
,
"timestamp"
:
15668858110
0
1
,
"data"
:
{
"data"
:
{
"countdown"
:
15690
37996
,
"countdown"
:
15690
58731
,
"remainEnargy"
:
4
,
"remainEnargy"
:
5
,
"isGetAllTreasureBox"
:
0
,
"isGetAllTreasureBox"
:
0
,
"wealth"
:
7960
,
"wealth"
:
7960
,
"totalStars"
:
145
,
"totalStars"
:
145
,
...
@@ -156,7 +156,7 @@
...
@@ -156,7 +156,7 @@
}
}
],
],
"askForEnergy"
:
fals
e
,
"askForEnergy"
:
tru
e
,
"canReceiveTreasureBoxNum"
:
10
,
"canReceiveTreasureBoxNum"
:
10
,
"nextRangeStarsNum"
:
150
"nextRangeStarsNum"
:
150
}
}
...
...
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