fix: Fixed UI and API for course page
This commit is contained in:
parent
fed9adbc77
commit
c011b08699
@ -1,45 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<TopSection v-bind:title="program.program_name" v-bind:description="program.description">
|
<TopSection v-bind:title="course.course_name" v-bind:description="course.description">
|
||||||
</TopSection>
|
</TopSection>
|
||||||
<CardList :title="'Courses'" :description="''" :sectionType="'section-padding section-bg'">
|
<CardList :title="'Courses'" :description="''" :sectionType="'section-padding section-bg'">
|
||||||
<CourseCard slot="card-list-slot" v-for="course in courseData" :course="course" :program_name="program_name" :key="course.name"/>
|
<TopicCard slot="card-list-slot" v-for="topic in topicData" :topic="topic" :course="course.course_name" :program_name="program_name" :key="topic.name"/>
|
||||||
</CardList>
|
</CardList>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import TopSection from "../components/TopSection.vue"
|
import TopSection from "../components/TopSection.vue"
|
||||||
import CardList from "../components/CardList.vue"
|
import CardList from "../components/CardList.vue"
|
||||||
import CourseCard from "../components/CourseCard.vue"
|
import TopicCard from "../components/TopicCard.vue"
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['program_name'],
|
props: ['program_name','course_name'],
|
||||||
name: "CoursePage",
|
name: "CoursePage",
|
||||||
components: {
|
components: {
|
||||||
TopSection,
|
TopSection,
|
||||||
CardList,
|
CardList,
|
||||||
CourseCard
|
TopicCard
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
program: {},
|
course: {},
|
||||||
courseData: [],
|
topicData: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getProgramDetails().then(data => this.program = data);
|
this.getCourseDetails().then(data => this.course = data);
|
||||||
this.getCourses().then(data => this.courseData = data);
|
this.getTopics().then(data => this.topicData = data);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getProgramDetails() {
|
getCourseDetails() {
|
||||||
return lms.call('get_program_details', {
|
return lms.call('get_course_details', {
|
||||||
program_name: this.program_name
|
course_name: this.course_name
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getCourses() {
|
getTopics() {
|
||||||
return lms.call('get_courses', {
|
return lms.call('get_topics', {
|
||||||
program_name: this.program_name
|
course_name: this.course_name
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user