Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
babycare_xiaoxiao
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
王剑峰
babycare_xiaoxiao
Commits
09c58fc1
Commit
09c58fc1
authored
Jul 22, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Success Panel Effect!
parent
b6293615
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
228 additions
and
30 deletions
+228
-30
workspace.xml
.idea/workspace.xml
+40
-27
babycare.getIndex.json
mock/miniTb/babycare.getIndex.json
+16
-1
prizePanel.png
resource/PrizePanel/prizePanel.png
+0
-0
prizePanelBtn.png
resource/PrizePanel/prizePanelBtn.png
+0
-0
res.json
resource/res.json
+4
-0
ResJson.ts
src/ResJson.ts
+4
-0
SkinJson.ts
src/SkinJson.ts
+65
-0
TaoBaoNet.ts
src/TaoBaoNet.ts
+3
-0
PrizePanel.ts
src/panels/PrizePanel.ts
+91
-0
MapScene.ts
src/scene/map/MapScene.ts
+5
-2
No files found.
.idea/workspace.xml
View file @
09c58fc1
This diff is collapsed.
Click to expand it.
mock/miniTb/babycare.getIndex.json
View file @
09c58fc1
...
...
@@ -128,6 +128,21 @@
"sendAwardType"
:
"prize"
}
],
"isFristLogin"
:
false
"isFristLogin"
:
false
,
"topAward"
:
{
"image"
:
"https://img.alicdn.com/imgextra/i1/2275046294/O1CN01TrcMYF1wMhRuCphHI_!!2275046294-2-miniprogram.png"
,
"level"
:
90
,
"drawStatus"
:
1
,
"openId"
:
"AAHuCvE-ALiIWXYsJuTb5S4W"
,
"createDay"
:
"2020/07/14"
,
"avatar"
:
"sdfwerwerwer"
,
"type"
:
3
,
"prizeId"
:
"5f08084e0cb7338a0a377c8d"
,
"activityId"
:
"5f08084ec3ad3494b9201c0e"
,
"ename"
:
""
,
"userNick"
:
"wmmmmm"
,
"name"
:
"90关奖品4"
,
"_id"
:
"AAHuCvE-ALiIWXYsJuTb5S4W1594715684002"
}
}
}
resource/PrizePanel/prizePanel.png
0 → 100644
View file @
09c58fc1
144 KB
resource/PrizePanel/prizePanelBtn.png
0 → 100644
View file @
09c58fc1
16.1 KB
resource/res.json
View file @
09c58fc1
...
...
@@ -32,6 +32,10 @@
"keys"
:
"步数耗尽Bg.png,步数耗尽复活.png,步数耗尽结束按钮.png"
,
"name"
:
"NoStepPanel"
},
{
"keys"
:
"prizePanel.png,prizePanelBtn.png"
,
"name"
:
"PrizePanel"
},
{
"keys"
:
"活动规则背景.png"
,
"name"
:
"RulePanel"
...
...
src/ResJson.ts
View file @
09c58fc1
...
...
@@ -32,6 +32,10 @@ export const ResJson = {
"keys"
:
"步数耗尽Bg.png,步数耗尽复活.png,步数耗尽结束按钮.png"
,
"name"
:
"NoStepPanel"
},
{
"keys"
:
"prizePanel.png,prizePanelBtn.png"
,
"name"
:
"PrizePanel"
},
{
"keys"
:
"活动规则背景.png"
,
"name"
:
"RulePanel"
...
...
src/SkinJson.ts
View file @
09c58fc1
...
...
@@ -720,6 +720,71 @@ export const SkinJson = {
}
]
},
{
"name"
:
"PrizePanel"
,
"x"
:
0
,
"y"
:
0
,
"type"
:
"container"
,
"children"
:
[
{
"name"
:
"背景"
,
"x"
:
55
,
"y"
:
376
,
"alpha"
:
1
,
"type"
:
"sprite"
,
"props"
:
{
"source"
:
"prizePanel.png"
}
},
{
"name"
:
"关闭按钮"
,
"x"
:
631
,
"y"
:
500
,
"alpha"
:
1
,
"type"
:
"button"
,
"props"
:
{
"tUp"
:
"关闭按钮.png"
},
"id"
:
"closeBtn"
},
{
"name"
:
"文案"
,
"x"
:
203
,
"y"
:
650
,
"alpha"
:
1
,
"type"
:
"text"
,
"props"
:
{
"text"
:
"恭喜获得XX奖品"
,
"size"
:
34
,
"fillColor"
:
"#df5942"
,
"textAlpha"
:
1
},
"id"
:
"prizeTxt"
},
{
"name"
:
"prizeImg"
,
"x"
:
250
,
"y"
:
732
,
"alpha"
:
1
,
"type"
:
"sprite"
,
"props"
:
{
"source"
:
""
},
"id"
:
"prizeImg"
},
{
"name"
:
"立即领取"
,
"x"
:
163
,
"y"
:
1002
,
"alpha"
:
1
,
"type"
:
"button"
,
"props"
:
{
"tUp"
:
"prizePanelBtn.png"
},
"id"
:
"prizeBtn"
}
]
},
{
"name"
:
"TaskPanel"
,
"x"
:
0
,
...
...
src/TaoBaoNet.ts
View file @
09c58fc1
...
...
@@ -15,6 +15,9 @@ export enum TbNetName {
*/
getIndex
=
"babycare.getIndex"
,
// 领取权益奖励
receiveEnamePrize
=
"babycare.receiveEnamePrize"
,
/**
* 活动基本信息
...
...
src/panels/PrizePanel.ts
0 → 100644
View file @
09c58fc1
import
{
Panel
}
from
"../../module/views/Panel"
;
import
TextField
=
FYGE
.
TextField
;
import
Button
=
FYGE
.
Button
;
import
Sprite
=
FYGE
.
Sprite
;
import
TEXT_ALIGN
=
FYGE
.
TEXT_ALIGN
;
import
Texture
=
FYGE
.
Texture
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
{
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
import
{
showToast
}
from
"../../module/ctrls"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
Tools
}
from
"../Tools"
;
export
class
PrizePanel
extends
Panel
{
get
groupNames
()
{
return
[
"PrizePanel"
]
}
get
skinName
()
{
return
"PrizePanel"
}
closeBtn
:
Button
;
prizeTxt
:
TextField
;
prizeImg
:
Sprite
;
prizeBtn
:
Button
;
initUi
()
{
this
.
prizeTxt
.
textAlign
=
TEXT_ALIGN
.
CENTER
;
this
.
prizeTxt
.
textWidth
=
750
;
this
.
prizeTxt
.
x
=
0
;
this
.
prizeTxt
.
text
=
`恭喜获得
${
this
.
data
.
name
}
`
;
this
.
prizeImg
.
anchorTexture
.
x
=
0.5
;
this
.
prizeImg
.
x
=
375
;
this
.
prizeImg
.
texture
=
Texture
.
fromUrl
(
this
.
data
.
image
);
}
start
(
data
)
{
super
.
start
();
}
private
clickPrizeBtn
(){
this
.
btnDelay
(
this
.
prizeBtn
);
switch
(
this
.
data
.
type
)
{
case
1
:
// 权益
sendTbNet
(
TbNetName
.
receiveEnamePrize
,
{
id
:
this
.
data
.
id
},
(
success
,
res
)
=>
{
if
(
!
success
||
!
res
)
{
showToast
(
'奖品发放失败
\
n请前往我的奖品处进行处理'
);
this
.
hidePanel
();
return
;
}
if
(
res
.
data
)
{
showToast
(
'奖品发放成功
\
n请前往我的奖品处查看'
);
}
else
{
showToast
(
'奖品发放失败
\
n请前往我的奖品处进行处理'
);
}
this
.
hidePanel
();
},
true
);
break
;
case
3
:
// 实物
sendTbNet
(
TbNetName
.
getUserAddress
,
{
prizeId
:
this
.
data
.
id
},
(
success
,
res
)
=>
{
if
(
!
success
)
{
// showToast('奖品发放失败\n请前往我的奖品处进行处理');
return
;
}
showToast
(
'奖品发放成功
\
n请前往我的奖品处查看'
);
this
.
hidePanel
();
},
true
);
break
;
case
2
:
// 积分
case
5
:
// 谢谢参与
this
.
hidePanel
();
break
;
}
}
initEvents
()
{
super
.
initEvents
();
this
.
prizeBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
clickPrizeBtn
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
this
.
prizeBtn
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
clickPrizeBtn
,
this
);
}
}
src/scene/map/MapScene.ts
View file @
09c58fc1
...
...
@@ -15,6 +15,7 @@ import Tween = FYGE.Tween;
import
Ease
=
FYGE
.
Ease
;
import
{
showPanel
}
from
"../../../module/ctrls"
;
import
{
FreePowerPanel
}
from
"../../panels/FreePowerPanel"
;
import
{
PrizePanel
}
from
"../../panels/PrizePanel"
;
export
class
MapScene
extends
Scene
{
private
mapContainer
:
Container
=
null
;
...
...
@@ -52,12 +53,14 @@ export class MapScene extends Scene {
this
.
initMap
();
this
.
updateMapCheck
();
// showPanel(SuccessNoPrizePanel)
if
(
Tools
.
gameData
.
loginAddPower
&&
!
Tools
.
gameData
.
isFristLogin
)
{
showPanel
(
FreePowerPanel
);
Tools
.
gameData
.
loginAddPower
=
false
;
}
if
(
Tools
.
gameData
.
topAward
)
{
showPanel
(
PrizePanel
,
Tools
.
gameData
.
topAward
);
}
}
private
updateMapCheck
()
{
...
...
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