视图修改、接口修改

This commit is contained in:
2025-10-28 19:04:35 +08:00
parent 98c73632bd
commit c5c134fbb3
96 changed files with 7122 additions and 4194 deletions

View File

@@ -3,16 +3,17 @@
v-if="courseId"
:course-id="courseId"
:show-back-button="true"
back-button-text="返回课程列表"
back-button-text="返回"
@back="handleBack"
@start-learning="handleStartLearning"
/>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { computed, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { CourseDetail } from '@/views/public/course/components';
import { courseApi } from '@/apis/study';
defineOptions({
name: 'CourseDetailView'
@@ -27,6 +28,10 @@ const courseId = computed(() => route.query.courseId as string || '');
function handleBack() {
router.back();
}
onMounted(() => {
// 调用接口更新浏览记录
courseApi.incrementViewCount(courseId.value);
});
// 开始学习课程
function handleStartLearning(courseId: string, chapterIndex: number, nodeIndex: number) {