Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qiaqia_qx
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
邱旭
qiaqia_qx
Commits
2e56a2ce
Commit
2e56a2ce
authored
Jun 08, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ExchangePanel
parent
3112aa83
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
136 additions
and
49 deletions
+136
-49
workspace.xml
.idea/workspace.xml
+41
-27
exchange_bg.png
resource/exchangePanel/exchange_bg.png
+0
-0
exchange_btn_dis.png
resource/exchangePanel/exchange_btn_dis.png
+0
-0
exchange_btn_en.png
resource/exchangePanel/exchange_btn_en.png
+0
-0
res.json
resource/res.json
+4
-0
ResJson.ts
src/ResJson.ts
+4
-0
ExRecordPanel.ts
src/panels/ExRecordPanel.ts
+2
-4
ExchangePanel.ts
src/panels/ExchangePanel.ts
+31
-5
ShopPanel.ts
src/panels/ShopPanel.ts
+50
-9
TaskPanel.ts
src/panels/TaskPanel.ts
+2
-2
WareHousePanel.ts
src/panels/WareHousePanel.ts
+2
-2
No files found.
.idea/workspace.xml
View file @
2e56a2ce
This diff is collapsed.
Click to expand it.
resource/exchangePanel/exchange_bg.png
0 → 100644
View file @
2e56a2ce
9.64 KB
resource/exchangePanel/exchange_btn_dis.png
0 → 100644
View file @
2e56a2ce
4.32 KB
resource/exchangePanel/exchange_btn_en.png
0 → 100644
View file @
2e56a2ce
3.99 KB
resource/res.json
View file @
2e56a2ce
...
@@ -84,6 +84,10 @@
...
@@ -84,6 +84,10 @@
"keys"
:
"exSuccessPanel_bg.png,exSuccessPanel_btn.png"
,
"keys"
:
"exSuccessPanel_bg.png,exSuccessPanel_btn.png"
,
"name"
:
"exSuccessPanel"
"name"
:
"exSuccessPanel"
},
},
{
"keys"
:
"exchange_bg.png,exchange_btn_dis.png,exchange_btn_en.png"
,
"name"
:
"exchangePanel"
},
{
{
"keys"
:
"btn_仓库.png,btn_兑换记录.png,btn_商店.png,btn_规则.png,btn_领水滴.png,game_bg.jpg,广告.png,用户_bg.png,用户_头像.png,用户_水.png,田_初始.png,田_种植.png,田_选择.png,种植框_bg.png,种植框_left.png,种植框_right.png,种植框_山核桃.png,种植框_开心果.png,种植框_板栗.png,种植框_瓜子.png,种植框_腰果.png,种植框_花生.png,种植框_袋子.png,进度_bg.png,进度_fill.png"
,
"keys"
:
"btn_仓库.png,btn_兑换记录.png,btn_商店.png,btn_规则.png,btn_领水滴.png,game_bg.jpg,广告.png,用户_bg.png,用户_头像.png,用户_水.png,田_初始.png,田_种植.png,田_选择.png,种植框_bg.png,种植框_left.png,种植框_right.png,种植框_山核桃.png,种植框_开心果.png,种植框_板栗.png,种植框_瓜子.png,种植框_腰果.png,种植框_花生.png,种植框_袋子.png,进度_bg.png,进度_fill.png"
,
"name"
:
"gameScene"
"name"
:
"gameScene"
...
...
src/ResJson.ts
View file @
2e56a2ce
...
@@ -84,6 +84,10 @@ export const ResJson = {
...
@@ -84,6 +84,10 @@ export const ResJson = {
"keys"
:
"exSuccessPanel_bg.png,exSuccessPanel_btn.png"
,
"keys"
:
"exSuccessPanel_bg.png,exSuccessPanel_btn.png"
,
"name"
:
"exSuccessPanel"
"name"
:
"exSuccessPanel"
},
},
{
"keys"
:
"exchange_bg.png,exchange_btn_dis.png,exchange_btn_en.png"
,
"name"
:
"exchangePanel"
},
{
{
"keys"
:
"btn_仓库.png,btn_兑换记录.png,btn_商店.png,btn_规则.png,btn_领水滴.png,game_bg.jpg,广告.png,用户_bg.png,用户_头像.png,用户_水.png,田_初始.png,田_种植.png,田_选择.png,种植框_bg.png,种植框_left.png,种植框_right.png,种植框_山核桃.png,种植框_开心果.png,种植框_板栗.png,种植框_瓜子.png,种植框_腰果.png,种植框_花生.png,种植框_袋子.png,进度_bg.png,进度_fill.png"
,
"keys"
:
"btn_仓库.png,btn_兑换记录.png,btn_商店.png,btn_规则.png,btn_领水滴.png,game_bg.jpg,广告.png,用户_bg.png,用户_头像.png,用户_水.png,田_初始.png,田_种植.png,田_选择.png,种植框_bg.png,种植框_left.png,种植框_right.png,种植框_山核桃.png,种植框_开心果.png,种植框_板栗.png,种植框_瓜子.png,种植框_腰果.png,种植框_花生.png,种植框_袋子.png,进度_bg.png,进度_fill.png"
,
"name"
:
"gameScene"
"name"
:
"gameScene"
...
...
src/panels/ExRecordPanel.ts
View file @
2e56a2ce
...
@@ -67,7 +67,7 @@ export default class ExRecordPanel extends Panel {
...
@@ -67,7 +67,7 @@ export default class ExRecordPanel extends Panel {
public
showAni
()
{
public
showAni
()
{
if
(
this
.
isShowing
)
return
;
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
this
.
isShowing
=
true
;
this
.
y
=
this
.
height
+
layers
.
stageOffsetY
*
2
+
100
;
this
.
y
=
1624
-
layers
.
stageOffsetY
+
100
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
100
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
100
;
Tween
.
get
(
this
)
Tween
.
get
(
this
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
...
@@ -78,7 +78,7 @@ export default class ExRecordPanel extends Panel {
...
@@ -78,7 +78,7 @@ export default class ExRecordPanel extends Panel {
public
hideAni
()
{
public
hideAni
()
{
return
Tween
.
get
(
this
)
return
Tween
.
get
(
this
)
.
to
({
y
:
this
.
height
+
layers
.
stageOffsetY
*
2
+
100
},
500
,
Ease
.
quartOut
);
.
to
({
y
:
1624
-
layers
.
stageOffsetY
+
100
},
500
,
Ease
.
quartOut
);
}
}
public
hidePanel
()
{
public
hidePanel
()
{
...
@@ -133,8 +133,6 @@ class RecordItem extends Container implements IScrollListItem {
...
@@ -133,8 +133,6 @@ class RecordItem extends Container implements IScrollListItem {
this
.
prizeDate
=
this
.
addChild
(
Tool
.
getText
(
''
,
22
,
'#999999'
));
this
.
prizeDate
=
this
.
addChild
(
Tool
.
getText
(
''
,
22
,
'#999999'
));
this
.
prizeDate
.
position
.
set
(
176
,
91
);
this
.
prizeDate
.
position
.
set
(
176
,
91
);
}
}
}
}
src/panels/ExchangePanel.ts
View file @
2e56a2ce
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
Tool
}
from
"../Tools"
;
import
{
Tool
}
from
"../Tools"
;
import
Sprite
=
FYGE
.
Sprite
;
import
Sprite
=
FYGE
.
Sprite
;
import
{
Graphics
,
Texture
}
from
"fyge"
;
export
class
ExchangePanel
extends
Panel
{
export
class
ExchangePanel
extends
Panel
{
get
groupNames
()
{
get
groupNames
()
{
return
[
"exchangePanel"
];
return
[
"exchangePanel"
];
}
}
closeBtn
:
Sprite
;
private
closeBtn
:
Sprite
;
private
btn
:
Sprite
;
initUi
()
{
initUi
()
{
this
.
addChild
(
Tool
.
getSprite
(
"
rul
e_bg.png"
));
this
.
addChild
(
Tool
.
getSprite
(
"
exchang
e_bg.png"
));
this
.
closeBtn
=
this
.
addChild
(
Tool
.
getSprite
(
'closeBtn.png'
));
this
.
closeBtn
=
this
.
addChild
(
Tool
.
getSprite
(
'closeBtn.png'
));
this
.
closeBtn
.
position
.
set
(
600
,
350
);
this
.
closeBtn
.
position
.
set
(
570
,
634
);
this
.
closeBtn
.
height
=
this
.
closeBtn
.
width
=
44
;
console
.
log
(
'ExchangePanel'
,
this
.
data
);
const
nameLabel
=
this
.
addChild
(
Tool
.
getText
(
this
.
data
.
prizeName
,
26
,
'#ffffff'
));
nameLabel
.
position
.
set
((
this
.
width
-
nameLabel
.
textWidth
)
/
2
,
710
);
const
prizeImg
=
this
.
addChild
(
new
Sprite
());
prizeImg
.
texture
=
Texture
.
fromUrl
(
this
.
data
.
prizeImg
);
// prizeImg.texture.addEventListener('update', () => {
prizeImg
.
position
.
set
((
this
.
width
-
143
)
/
2
,
523
);
prizeImg
.
width
=
prizeImg
.
height
=
143
;
// });
const
imgMask
=
this
.
addChild
(
new
Graphics
());
imgMask
.
position
.
set
((
this
.
width
-
143
)
/
2
,
523
);
imgMask
.
drawCircle
(
71.5
,
71.5
,
71.5
);
prizeImg
.
mask
=
imgMask
;
this
.
btn
=
this
.
addChild
(
Tool
.
getSprite
(
this
.
data
.
count
>
0
?
'exchange_btn_en.png'
:
'exchange_btn_dis.png'
)
);
this
.
btn
.
position
.
set
((
this
.
width
-
this
.
btn
.
width
)
/
2
,
876
);
}
}
start
(
data
)
{
start
(
data
)
{
...
...
src/panels/ShopPanel.ts
View file @
2e56a2ce
...
@@ -9,7 +9,10 @@ import ScrollList = FYGE.ScrollList;
...
@@ -9,7 +9,10 @@ import ScrollList = FYGE.ScrollList;
import
Texture
=
FYGE
.
Texture
;
import
Texture
=
FYGE
.
Texture
;
import
Graphics
=
FYGE
.
Graphics
;
import
Graphics
=
FYGE
.
Graphics
;
import
TextField
=
FYGE
.
TextField
;
import
TextField
=
FYGE
.
TextField
;
import
{
Ease
}
from
"fyge"
;
import
{
Ease
,
MouseEvent
}
from
"fyge"
;
import
panelCtrl
from
"../../module/ctrls/panelCtrl"
;
import
PanelCtrl
from
"../../module/ctrls/panelCtrl"
;
import
{
ExchangePanel
}
from
"./ExchangePanel"
;
export
default
class
ShopPanel
extends
Panel
{
export
default
class
ShopPanel
extends
Panel
{
get
groupNames
()
{
get
groupNames
()
{
...
@@ -32,7 +35,36 @@ export default class ShopPanel extends Panel {
...
@@ -32,7 +35,36 @@ export default class ShopPanel extends Panel {
this
.
scroll
=
this
.
addChild
(
new
ScrollList
(
ShopItem
,
635
,
227
,
635
,
830
));
this
.
scroll
=
this
.
addChild
(
new
ScrollList
(
ShopItem
,
635
,
227
,
635
,
830
));
this
.
scroll
.
position
.
set
((
this
.
width
-
this
.
scroll
.
width
)
/
2
,
210
);
this
.
scroll
.
position
.
set
((
this
.
width
-
this
.
scroll
.
width
)
/
2
,
210
);
this
.
scroll
.
updateData
([
this
.
scroll
.
updateData
([
1
,
2
,
3
,
4
,
5
,
6
{
prizeName
:
'恰恰免单'
,
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
count
:
0
,
},
{
prizeName
:
'恰恰-50元加价卷'
,
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
count
:
1000
,
},
{
prizeName
:
'恰恰-100元加价卷'
,
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
count
:
10000
,
},
{
prizeName
:
'恰恰-1折卷'
,
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
count
:
10000
,
},
{
prizeName
:
'恰恰-5折卷'
,
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
count
:
5000
,
},
{
prizeName
:
'恰恰-9折卷'
,
prizeImg
:
'https://source.unsplash.com/user/erondu/116x116'
,
count
:
1000
,
},
]);
]);
}
}
...
@@ -40,7 +72,7 @@ export default class ShopPanel extends Panel {
...
@@ -40,7 +72,7 @@ export default class ShopPanel extends Panel {
public
showAni
()
{
public
showAni
()
{
if
(
this
.
isShowing
)
return
;
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
this
.
isShowing
=
true
;
this
.
y
=
this
.
height
+
layers
.
stageOffsetY
*
2
+
100
;
this
.
y
=
1624
-
layers
.
stageOffsetY
+
100
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
100
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
100
;
Tween
.
get
(
this
)
Tween
.
get
(
this
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
...
@@ -51,7 +83,7 @@ export default class ShopPanel extends Panel {
...
@@ -51,7 +83,7 @@ export default class ShopPanel extends Panel {
public
hideAni
()
{
public
hideAni
()
{
return
Tween
.
get
(
this
)
return
Tween
.
get
(
this
)
.
to
({
y
:
this
.
height
+
layers
.
stageOffsetY
*
2
+
100
},
500
,
Ease
.
quartOut
);
.
to
({
y
:
1624
-
layers
.
stageOffsetY
+
100
},
500
,
Ease
.
quartOut
);
}
}
public
hidePanel
()
{
public
hidePanel
()
{
...
@@ -86,6 +118,18 @@ class ShopItem extends Container implements IScrollListItem {
...
@@ -86,6 +118,18 @@ class ShopItem extends Container implements IScrollListItem {
public
initData
(
id
:
number
,
data
:
any
):
void
{
public
initData
(
id
:
number
,
data
:
any
):
void
{
if
(
!
data
)
return
;
if
(
!
data
)
return
;
this
.
data
=
data
;
this
.
itemName
.
text
=
data
.
prizeName
;
this
.
itemImg
.
texture
=
Texture
.
fromUrl
(
data
.
prizeImg
);
this
.
itemNum
.
text
=
(
data
.
count
<=
0
)
?
'来晚一步,抢光了'
:
`剩余
${
data
.
count
}
份`
;
this
.
itemNum
.
position
.
set
((
this
.
width
-
this
.
itemNum
.
textWidth
)
/
2
,
176
);
this
.
itemMask
.
visible
=
(
data
.
count
<=
0
);
this
.
removeAllEventListener
();
(
data
.
count
>
0
)
&&
this
.
addEventListener
(
MouseEvent
.
CLICK
,
()
=>
{
PanelCtrl
.
instance
.
show
(
ExchangePanel
,
this
.
data
);
});
}
}
constructor
()
{
constructor
()
{
...
@@ -94,7 +138,6 @@ class ShopItem extends Container implements IScrollListItem {
...
@@ -94,7 +138,6 @@ class ShopItem extends Container implements IScrollListItem {
this
.
itemImg
=
this
.
addChild
(
new
Sprite
());
this
.
itemImg
=
this
.
addChild
(
new
Sprite
());
this
.
itemImg
.
position
.
set
(
35
,
26
);
this
.
itemImg
.
position
.
set
(
35
,
26
);
this
.
itemImg
.
texture
=
Texture
.
fromUrl
(
'https://source.unsplash.com/user/erondu/116x116'
);
const
mask
=
this
.
addChild
(
new
Graphics
());
const
mask
=
this
.
addChild
(
new
Graphics
());
mask
.
drawCircle
(
92
,
83
,
58
);
mask
.
drawCircle
(
92
,
83
,
58
);
...
@@ -103,13 +146,11 @@ class ShopItem extends Container implements IScrollListItem {
...
@@ -103,13 +146,11 @@ class ShopItem extends Container implements IScrollListItem {
this
.
itemMask
=
this
.
addChild
(
Tool
.
getSprite
(
'shop_mask.png'
));
this
.
itemMask
=
this
.
addChild
(
Tool
.
getSprite
(
'shop_mask.png'
));
this
.
itemMask
.
visible
=
false
;
this
.
itemMask
.
visible
=
false
;
this
.
itemName
=
this
.
addChild
(
Tool
.
getText
(
'
恰恰50元抵扣卷
'
,
26
,
'#4a4a4a'
));
this
.
itemName
=
this
.
addChild
(
Tool
.
getText
(
''
,
26
,
'#4a4a4a'
));
this
.
itemName
.
position
.
set
(
185
,
24
);
this
.
itemName
.
position
.
set
(
185
,
24
);
this
.
itemNum
=
this
.
addChild
(
Tool
.
getText
(
'剩余
800
0份'
,
18
,
'#f94c2a'
));
this
.
itemNum
=
this
.
addChild
(
Tool
.
getText
(
'剩余0份'
,
18
,
'#f94c2a'
));
this
.
itemNum
.
position
.
set
((
this
.
width
-
this
.
itemNum
.
textWidth
)
/
2
,
176
);
this
.
itemNum
.
position
.
set
((
this
.
width
-
this
.
itemNum
.
textWidth
)
/
2
,
176
);
}
}
}
}
src/panels/TaskPanel.ts
View file @
2e56a2ce
...
@@ -81,7 +81,7 @@ export default class TaskPanel extends Panel {
...
@@ -81,7 +81,7 @@ export default class TaskPanel extends Panel {
public
showAni
()
{
public
showAni
()
{
if
(
this
.
isShowing
)
return
;
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
this
.
isShowing
=
true
;
this
.
y
=
this
.
height
+
layers
.
stageOffsetY
*
2
+
100
;
this
.
y
=
1624
-
layers
.
stageOffsetY
+
100
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
100
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
100
;
Tween
.
get
(
this
)
Tween
.
get
(
this
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
...
@@ -92,7 +92,7 @@ export default class TaskPanel extends Panel {
...
@@ -92,7 +92,7 @@ export default class TaskPanel extends Panel {
public
hideAni
()
{
public
hideAni
()
{
return
Tween
.
get
(
this
)
return
Tween
.
get
(
this
)
.
to
({
y
:
this
.
height
+
layers
.
stageOffsetY
*
2
+
100
},
500
,
Ease
.
quartOut
);
.
to
({
y
:
1624
-
layers
.
stageOffsetY
+
100
},
500
,
Ease
.
quartOut
);
}
}
public
hidePanel
()
{
public
hidePanel
()
{
...
...
src/panels/WareHousePanel.ts
View file @
2e56a2ce
...
@@ -46,7 +46,7 @@ export default class WareHousePanel extends Panel {
...
@@ -46,7 +46,7 @@ export default class WareHousePanel extends Panel {
public
showAni
()
{
public
showAni
()
{
if
(
this
.
isShowing
)
return
;
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
this
.
isShowing
=
true
;
this
.
y
=
this
.
height
+
layers
.
stageOffsetY
*
2
+
100
;
this
.
y
=
1624
-
layers
.
stageOffsetY
+
100
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
100
;
const
_y
=
1624
-
this
.
height
-
layers
.
stageOffsetY
+
50
+
100
;
Tween
.
get
(
this
)
Tween
.
get
(
this
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
.
to
({
y
:
_y
},
500
,
Ease
.
quartOut
)
...
@@ -57,7 +57,7 @@ export default class WareHousePanel extends Panel {
...
@@ -57,7 +57,7 @@ export default class WareHousePanel extends Panel {
public
hideAni
()
{
public
hideAni
()
{
return
Tween
.
get
(
this
)
return
Tween
.
get
(
this
)
.
to
({
y
:
this
.
height
+
layers
.
stageOffsetY
*
2
+
100
},
500
,
Ease
.
quartOut
);
.
to
({
y
:
1624
-
layers
.
stageOffsetY
+
100
},
500
,
Ease
.
quartOut
);
}
}
public
hidePanel
()
{
public
hidePanel
()
{
...
...
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