Commit 4c649a43 authored by 李维's avatar 李维

修改最后一课跳转关系,先弹出提示,再提示全部完成

parent cb1d4966
...@@ -270,16 +270,14 @@ export default class MiddleLayerClass extends middleLayerBase { ...@@ -270,16 +270,14 @@ export default class MiddleLayerClass extends middleLayerBase {
}); });
} else { } else {
const lastCurse = this.crossArray[this.crossArray.length - 1]; const lastCurse = this.crossArray[this.crossArray.length - 1];
// 课件完成的庆祝画面
this.showFinish();
if (this.courseItem.course_id != lastCurse.id) { if (this.courseItem.course_id != lastCurse.id) {
// 课件完成的庆祝画面
this.showFinish();
// 上报解锁下一关 // 上报解锁下一关
const currentIndex = this.crossArray.findIndex(item => item.id == this.courseItem.course_id); const currentIndex = this.crossArray.findIndex(item => item.id == this.courseItem.course_id);
const nextCourse = this.crossArray[currentIndex + 1]; const nextCourse = this.crossArray[currentIndex + 1];
this.unlockNext(nextCourse.id); this.unlockNext(nextCourse.id);
} else { } else {
// 所有课件都完成的庆祝动画
this.showAllFinish();
// 上报一个本节课完成 // 上报一个本节课完成
this.callNetworkApiPost(`/api/kyxq/v1/user/saveend`, { this.callNetworkApiPost(`/api/kyxq/v1/user/saveend`, {
syllabus_id: lastCurse.pid, syllabus_id: lastCurse.pid,
...@@ -352,7 +350,14 @@ export default class MiddleLayerClass extends middleLayerBase { ...@@ -352,7 +350,14 @@ export default class MiddleLayerClass extends middleLayerBase {
nextBtn.on("touchstart", () => { nextBtn.on("touchstart", () => {
hideFinish(); hideFinish();
this.goNextCross(); const lastCurse = this.crossArray[this.crossArray.length - 1];
if (this.courseItem.course_id != lastCurse.id) {
// 如果当前课件不是最后一关 - 自动跳转到最后一关
this.goNextCross();
} else {
// 如果当前课件是最后一关 - 播放全部完成动画
this.showAllFinish();
}
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment