feat: Implement 'My Courses' dashboard, including course cards, classroom learning, and quiz pages.

This commit is contained in:
supalerk-ar66 2026-01-21 17:03:09 +07:00
parent fc3e2820cc
commit f6bbd60f2b
5 changed files with 111 additions and 74 deletions

View file

@ -65,7 +65,7 @@ const loadEnrolledCourses = async () => {
// Wait, CourseCard likely needs course ID to link to /classroom/learning/:id
enrollment_id: item.id,
title: getLocalizedText(item.course.title),
progress: item.progress_percentage,
progress: 0, // item.progress_percentage (Forced to 0 as requested)
completed: item.status === 'COMPLETED',
thumbnail_url: item.course.thumbnail_url // CourseCard might need this
}))
@ -134,6 +134,7 @@ const downloadCertificate = () => {
<!-- In Progress Course Card -->
<CourseCard
v-if="!course.completed"
:id="course.id"
:title="course.title"
:progress="course.progress"
:image="course.thumbnail_url"
@ -142,6 +143,7 @@ const downloadCertificate = () => {
<!-- Completed Course Card -->
<CourseCard
v-else
:id="course.id"
:title="course.title"
:progress="100"
:image="course.thumbnail_url"
@ -173,7 +175,7 @@ const downloadCertificate = () => {
<h2 class="font-bold mb-2">{{ $t('enrollment.successTitle') }}</h2>
<p class="text-muted mb-6">{{ $t('enrollment.successDesc') }}</p>
<div class="flex flex-col gap-2">
<NuxtLink to="/classroom/learning" class="btn btn-primary w-full">{{ $t('enrollment.startNow') }}</NuxtLink>
<NuxtLink :to="`/classroom/learning?course_id=${route.query.course_id}`" class="btn btn-primary w-full">{{ $t('enrollment.startNow') }}</NuxtLink>
<button class="btn btn-secondary w-full" @click="showEnrollModal = false">{{ $t('enrollment.later') }}</button>
</div>
</div>