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
d32811cf
Commit
d32811cf
authored
Aug 20, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
421fe41c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
4 deletions
+41
-4
ShopSkin.exml
egret/resource/skins/ShopSkin.exml
+3
-3
ShopPanel.ts
egret/src/panels/ShopPanel.ts
+38
-1
No files found.
egret/resource/skins/ShopSkin.exml
View file @
d32811cf
...
...
@@ -10,7 +10,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"buyBtn
1
"
label=
""
x=
"444"
y=
"356"
>
<e:Button
id=
"buyBtn
2
"
label=
""
x=
"444"
y=
"356"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"按钮 副本_png"
source.down=
"按钮 副本_png"
source.disabled=
"按钮 副本_png"
/>
...
...
@@ -18,7 +18,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"buyBtn
3"
label=
""
x=
"444"
y=
"634
"
>
<e:Button
id=
"buyBtn
1"
label=
""
x=
"444"
y=
"498
"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"按钮 副本_png"
source.down=
"按钮 副本_png"
source.disabled=
"按钮 副本_png"
/>
...
...
@@ -26,7 +26,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"buyBtn
2"
label=
""
x=
"444"
y=
"498
"
>
<e:Button
id=
"buyBtn
3"
label=
""
x=
"444"
y=
"634
"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"按钮 副本_png"
source.down=
"按钮 副本_png"
source.disabled=
"按钮 副本_png"
/>
...
...
egret/src/panels/ShopPanel.ts
View file @
d32811cf
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
PropType
from
"../PropType"
;
export
default
class
ShopPanel
extends
Panel
{
buyBtn1
:
eui
.
Button
;
buyBtn3
:
eui
.
Button
;
buyBtn2
:
eui
.
Button
;
start
(
data
)
{
super
.
start
();
this
[
'buyBtn1'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onBuy1
,
this
);
this
[
'buyBtn2'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onBuy2
,
this
);
this
[
'buyBtn3'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onBuy3
,
this
);
}
onBuy1
(){
this
.
buyBtn1
.
enabled
=
false
;
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
this
.
buyBtn1
.
enabled
=
true
;
if
(
success
)
{
}
},
2
,
PropType
.
HAMMER
);
//兑换道具
}
onBuy2
(){
this
.
buyBtn2
.
enabled
=
false
;
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
this
.
buyBtn2
.
enabled
=
true
;
if
(
success
)
{
}
},
2
,
PropType
.
BOOM
);
//兑换道具
}
onBuy3
(){
this
.
buyBtn3
.
enabled
=
false
;
NetManager
.
ins
.
hc_exchange
((
success
)
=>
{
this
.
buyBtn3
.
enabled
=
true
;
if
(
success
)
{
}
},
2
,
PropType
.
CHANCE_NUM
);
//兑换道具
}
get
skinKey
()
{
return
'Shop'
}
...
...
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