视图路径修改

This commit is contained in:
2025-10-27 17:29:25 +08:00
parent 5fa4e1cd42
commit 0033ac10ec
69 changed files with 162 additions and 1199 deletions

View File

@@ -0,0 +1,48 @@
<template>
<CourseDetail
v-if="courseId"
:course-id="courseId"
:show-back-button="true"
back-button-text="返回课程列表"
@back="handleBack"
@start-learning="handleStartLearning"
/>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { CourseDetail } from '@/views/public/course/components';
defineOptions({
name: 'CourseDetailView'
});
const router = useRouter();
const route = useRoute();
const courseId = computed(() => route.query.courseId as string || '');
// 返回上一页
function handleBack() {
router.back();
}
// 开始学习课程
function handleStartLearning(courseId: string, chapterIndex: number, nodeIndex: number) {
// 跳转到课程学习页面
router.push({
path: '/study-plan/course-study',
query: {
courseId,
chapterIndex: chapterIndex.toString(),
nodeIndex: nodeIndex.toString()
}
});
}
</script>
<style lang="scss" scoped>
</style>