Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hzlh-beautifulFunFestival-snake-20241222
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
hzlh-beautifulFunFestival-snake-20241222
Commits
43600382
Commit
43600382
authored
Dec 25, 2024
by
俞嘉婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 奖品不足5个时 居中不轮播
parent
a335936e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1122 additions
and
617 deletions
+1122
-617
runMainPage.scene
...ake-20241222/assets/Bundles/runMainPage/runMainPage.scene
+1079
-605
runMainPage.ts
...ake-20241222/assets/Scripts/Scenes/runMain/runMainPage.ts
+35
-12
index.do.json
...e-20241222/preview-template/mock/branch_tcs/index.do.json
+8
-0
No files found.
hzlh-beautifulFunFestival-snake-20241222/assets/Bundles/runMainPage/runMainPage.scene
View file @
43600382
This diff is collapsed.
Click to expand it.
hzlh-beautifulFunFestival-snake-20241222/assets/Scripts/Scenes/runMain/runMainPage.ts
View file @
43600382
import
{
_decorator
,
AudioClip
,
Button
,
Component
,
Label
,
Nod
e
}
from
'cc'
;
import
{
get
ProjectId
,
get
WebData
,
LOG_TYPE
,
sendLog
,
sendWebNet
,
WebNetName
}
from
'../../Utils/WebNet/WebNet'
;
import
{
changeScene
,
showPanel
,
showToast
}
from
'../../../Module/UIFast'
;
import
{
_decorator
,
AudioClip
,
Button
,
Component
,
instantiate
,
Label
,
Node
,
Prefab
,
SpriteFram
e
}
from
'cc'
;
import
{
getWebData
,
LOG_TYPE
,
sendLog
,
sendWebNet
,
WebNetName
}
from
'../../Utils/WebNet/WebNet'
;
import
{
showPanel
,
showToast
}
from
'../../../Module/UIFast'
;
import
Scene
from
'../../../Module/Scene'
;
import
{
runGamePage
}
from
'../runGamePage'
;
import
{
TaskPanel
}
from
'../../Panels/TaskPanel/TaskPanel'
;
import
RulePanel
from
'../../Panels/RulePanel'
;
import
store
from
'../../store/store'
;
...
...
@@ -38,6 +37,13 @@ export class runMainPage extends Scene {
@
property
(
Node
)
taskBtn
:
Node
=
null
;
// 奖品列表(小于等于4个)
@
property
(
Node
)
prizeList4Num
:
Node
=
null
;
// 奖品列表(大于4个)
@
property
(
Node
)
prizeListMore
:
Node
=
null
;
// 奖品轮播盒子
@
property
(
VList
)
prizeListBox
:
VList
=
null
;
...
...
@@ -47,6 +53,9 @@ export class runMainPage extends Scene {
@
property
(
Node
)
guide1
:
Node
=
null
;
@
property
(
Prefab
)
prizeItemPrefab
:
Prefab
=
null
;
// 主按钮 高亮态
@
property
(
SpriteFrame
)
mainBtnSF
:
SpriteFrame
=
null
;
// 主按钮 置灰态
...
...
@@ -76,7 +85,7 @@ export class runMainPage extends Scene {
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
tcs_Index
);
if
(
success
)
{
this
.
startLab
.
string
=
`剩余次数:
${
data
.
remainJoinNum
||
0
}
`
// 主按钮置灰处理
// 主按钮置灰处理
this
.
startBtn
.
getChildByName
(
"runmainbtn"
).
getComponent
(
Sprite
).
spriteFrame
=
data
.
remainJoinNum
>
0
?
this
.
mainBtnSF
:
this
.
mainBtnGreySF
;
// 新手引导1
if
(
data
.
alreadyGuide
==
0
)
{
...
...
@@ -87,13 +96,27 @@ export class runMainPage extends Scene {
if
(
data
.
offlineNewAssist
&&
data
.
offlineNewAssist
>
0
)
{
showToast
(
`一共有
${
data
.
offlineNewAssist
}
位好友助力,快去任务面板领取奖励次数吧~`
)
}
const
updateItem
=
(
node
,
data
)
=>
{
node
.
getChildByPath
(
"prizeImgMask/prizeImg"
)
.
getComponent
(
Sprite
).
spriteFrame
=
data
.
prizeImage
;
};
// this.prizeListBox.node.removeAllChildren();
// this.prizeListBox.node.destroyAllChildren();
this
.
prizeListBox
.
init
(
data
.
prizeShow
,
updateItem
);
// 处理奖品列表展示
if
(
data
.
prizeShow
?.
length
<=
4
)
{
this
.
prizeList4Num
.
active
=
true
;
this
.
prizeListMore
.
active
=
false
;
data
.
prizeShow
.
forEach
((
item
,
index
)
=>
{
const
itemr
=
instantiate
(
this
.
prizeItemPrefab
)
itemr
.
getChildByPath
(
"prizeImgMask/prizeImg"
)
.
getComponent
(
Sprite
).
spriteFrame
=
item
.
prizeImage
;
this
.
prizeList4Num
.
getChildByName
(
"prizeListLess"
).
addChild
(
itemr
)
})
}
else
{
const
updateItem
=
(
node
,
data
)
=>
{
node
.
getChildByPath
(
"prizeImgMask/prizeImg"
)
.
getComponent
(
Sprite
).
spriteFrame
=
data
.
prizeImage
;
};
// this.prizeListBox.node.removeAllChildren();
// this.prizeListBox.node.destroyAllChildren();
this
.
prizeList4Num
.
active
=
false
;
this
.
prizeListMore
.
active
=
true
;
this
.
prizeListBox
.
init
(
data
.
prizeShow
,
updateItem
);
}
}
}
...
...
hzlh-beautifulFunFestival-snake-20241222/preview-template/mock/branch_tcs/index.do.json
View file @
43600382
...
...
@@ -19,6 +19,14 @@
"prizeName"
:
"奖品名称3"
,
"prizeImage"
:
"//yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
},
{
"prizeName"
:
"奖品名称3"
,
"prizeImage"
:
"//yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
},
{
"prizeName"
:
"奖品名称3"
,
"prizeImage"
:
"//yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg"
},
{
"prizeName"
:
"奖品名称4"
,
"prizeImage"
:
"//yun.duiba.com.cn/polaris/taibao.eb7c402c7c60ef8d4e42cf8d2cb4c4d5f2b5be20.png"
...
...
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