web-学习

This commit is contained in:
2025-10-24 18:28:35 +08:00
parent 8968409b2d
commit bc84bd82cc
16 changed files with 1090 additions and 239 deletions

View File

@@ -4,6 +4,7 @@
:course-id="courseId"
:chapter-index="chapterIndex"
:node-index="nodeIndex"
:back-button-text="taskId ? '返回任务详情' : '返回课程详情'"
@back="handleBack"
/>
</template>
@@ -24,15 +25,27 @@ const route = useRoute();
const courseId = computed(() => route.query.courseId as string || '');
const chapterIndex = computed(() => parseInt(route.query.chapterIndex as string) || 0);
const nodeIndex = computed(() => parseInt(route.query.nodeIndex as string) || 0);
const taskId = computed(() => route.query.taskId as string || '');
// 返回到课程详情
// 返回到上一
function handleBack() {
router.push({
path: '/study-plan/course-detail',
query: {
courseId: courseId.value
}
});
// 如果有 taskId返回任务详情页
if (taskId.value) {
router.push({
path: '/study-plan/task-detail',
query: {
taskId: taskId.value
}
});
} else {
// 否则返回课程详情页
router.push({
path: '/study-plan/course-detail',
query: {
courseId: courseId.value
}
});
}
}
</script>