Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_kyxq
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
middleLayer_for_kyxq
Commits
37b9eedc
Commit
37b9eedc
authored
Nov 03, 2023
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 解锁下一关的逻辑
parent
5ab0ff43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
middleLayer.ts
assets/middleLayer_for_kyxq/script/middleLayer.ts
+22
-20
No files found.
assets/middleLayer_for_kyxq/script/middleLayer.ts
View file @
37b9eedc
...
...
@@ -231,37 +231,39 @@ export default class NewClass extends middleLayerBase {
// 覆盖关系
this
.
golds
.
total
-=
this
.
golds
[
this
.
courseItem
.
id
];
}
// 上报金币成绩
this
.
golds
[
this
.
courseItem
.
id
]
=
gold
;
this
.
golds
.
total
+=
gold
;
}
goNextPage
()
{
if
(
this
.
courseIndex
<
this
.
courses
.
length
-
1
)
{
this
.
goTarIndexPage
(
this
.
courseIndex
+
1
);
return
;
}
// 庆祝画面
if
(
this
.
courseIndex
<
this
.
courses
.
length
){
this
.
showFinish
();
}
else
{
this
.
showAllFinish
()
if
(
this
.
courseIndex
<
this
.
courses
.
length
-
1
)
{
// 单页完成的庆祝画面
this
.
showGold
(()
=>
{
this
.
goTarIndexPage
(
this
.
courseIndex
+
1
);
});
}
if
(
this
.
courseIndex
>=
this
.
courses
.
length
){
const
lastCurse
=
this
.
crossArray
[
this
.
crossArray
.
length
-
1
];
if
(
this
.
courseItem
.
course_id
!=
lastCurse
.
id
)
{
// 课件完成的庆祝画面
this
.
showFinish
();
// 上报解锁下一关
const
currentIndex
=
this
.
crossArray
.
findIndex
(
item
=>
item
.
id
==
this
.
courseItem
.
course_id
);
const
nextCourse
=
this
.
crossArray
[
currentIndex
+
1
];
this
.
unlockNext
(
nextCourse
.
id
);
}
else
{
// 所有课件都完成的庆祝动画
this
.
showAllFinish
();
}
}
}
crossArray
=
[];
// 关卡数组
goNextCross
()
{
const
currentid
=
this
.
courseItem
.
course_id
;
let
currentIndex
=
null
;
for
(
let
i
=
0
;
i
<
this
.
crossArray
.
length
;
i
++
)
{
const
item
=
this
.
crossArray
[
i
];
if
(
item
.
id
==
currentid
)
{
currentIndex
=
i
;
break
;
}
}
if
(
currentIndex
!=
null
&&
this
.
crossArray
[
currentIndex
+
1
])
{
const
currentIndex
=
this
.
crossArray
.
findIndex
(
item
=>
item
.
id
==
this
.
courseItem
.
course_id
);
if
(
currentIndex
!=-
1
&&
this
.
crossArray
[
currentIndex
+
1
])
{
this
.
loadOnlineCourseWare
(
this
.
crossArray
[
currentIndex
+
1
].
id
,
null
,
null
);
}
else
{
this
.
showTips
(
`已经是最后一关了`
);
...
...
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