Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSAPP2502
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
SSAPP2502
Commits
8a9ca99c
Commit
8a9ca99c
authored
Aug 20, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 调整滚动触发条件从5个改为4个未回答题目
parent
4986a39a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
SSAPP2502.fire
assets/SSAPP2502/scene/SSAPP2502.fire
+1
-1
SSAPP2502.ts
assets/SSAPP2502/scene/SSAPP2502.ts
+15
-8
No files found.
assets/SSAPP2502/scene/SSAPP2502.fire
View file @
8a9ca99c
...
...
@@ -5980,7 +5980,7 @@
"__id__": 145
}
],
"_active":
fals
e,
"_active":
tru
e,
"_components": [],
"_prefab": null,
"_opacity": 255,
...
...
assets/SSAPP2502/scene/SSAPP2502.ts
View file @
8a9ca99c
...
...
@@ -311,10 +311,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 重置滚动状态
this
.
layout
.
x
=
0
;
this
.
scrollDistance
=
0
;
this
.
needScroll
=
unansweredQuestions
.
length
>
5
;
// 如果有超过5
个未回答题目,启用滚动
this
.
needScroll
=
unansweredQuestions
.
length
>
4
;
// 如果有超过4
个未回答题目,启用滚动
// 初始化数据队列
const
initialVisibleCount
=
Math
.
min
(
5
,
unansweredQuestions
.
length
);
// 如果剩余题目小于等于4个,显示所有剩余题目;否则显示5个
const
initialVisibleCount
=
unansweredQuestions
.
length
<=
4
?
unansweredQuestions
.
length
:
Math
.
min
(
5
,
unansweredQuestions
.
length
);
const
visibleData
=
unansweredQuestions
.
slice
(
0
,
initialVisibleCount
);
this
.
pendingCandyData
=
unansweredQuestions
.
slice
(
initialVisibleCount
);
...
...
@@ -352,8 +353,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
return
;
}
// 如果未回答题目数量小于
5
,停止滚动并重新刷新列表
if
(
unansweredQuestions
.
length
<
5
)
{
// 如果未回答题目数量小于
等于4
,停止滚动并重新刷新列表
if
(
unansweredQuestions
.
length
<
=
4
)
{
this
.
needScroll
=
false
;
// 停止滚动
// 重新显示页面
this
.
showPage
();
...
...
@@ -375,7 +376,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
activeNodes
.
push
(
candyNode
);
// 如果有足够的节点,启用滚动
if
(
this
.
activeNodes
.
length
>
5
)
{
if
(
this
.
activeNodes
.
length
>
4
)
{
this
.
needScroll
=
true
;
}
}
...
...
@@ -533,8 +534,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
return
;
}
// 如果未回答题目数量小于
5
,设置不滚动
if
(
unansweredQuestions
.
length
<
5
)
{
// 如果未回答题目数量小于
等于4
,设置不滚动
if
(
unansweredQuestions
.
length
<
=
4
)
{
this
.
needScroll
=
false
;
}
...
...
@@ -850,7 +851,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 更新滚动状态,根据剩余未回答题目数量决定是否继续滚动
this
.
needScroll
=
this
.
activeNodes
.
length
>
5
||
this
.
pendingCandyData
.
length
>
0
;
this
.
needScroll
=
this
.
activeNodes
.
length
>
4
||
this
.
pendingCandyData
.
length
>
0
;
}
/**
...
...
@@ -897,6 +898,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
{
if
(
this
.
pendingCandyData
.
length
==
0
)
{
let
unansweredQuestions
=
this
.
getUnansweredQuestions
();
// 如果未回答题目数量小于等于4,停止滚动并重新刷新列表
if
(
unansweredQuestions
.
length
<=
4
)
{
this
.
needScroll
=
false
;
// 停止滚动
this
.
showPage
();
// 重新显示页面
return
;
}
this
.
pendingCandyData
=
unansweredQuestions
.
concat
();
}
this
.
addCount
++
;
...
...
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