Blame view
src/pages/Dashboard/ChapterInfo.vue
6.52 KB
fe15ee8b4
|
1 2 |
<template> <div> |
6f7cf8cf5
|
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<!-- LOADER --> <div class="loader" v-if="showLoader"> <v-progress-circular indeterminate color="white"></v-progress-circular> </div> <!-- SNACKBAR --> <v-snackbar :timeout="timeout" :top="y === 'top'" :right="x === 'right'" :vertical="mode === 'vertical'" v-model="snackbar" :color="snackbarColor" > {{ text }} <v-spacer></v-spacer> <v-btn flat text @click="snackbar = false">X</v-btn> </v-snackbar> |
fe15ee8b4
|
21 |
<v-container class="pt-0"> |
375b62cd1
|
22 |
<v-layout row wrap class="mt-1"> |
fe15ee8b4
|
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
<v-flex xs8> <!-- CHAPTER INFO --> <div class="title side-bar-color font-weight-bold">{{chapter.chapters[0].chapterName}}</div> <div class="subheading grey--text lighten-1">{{chapter.chapters[0].description}}</div> <div v-for="(point,index) in chapter.chapters[0].chapterPoints" :key="index" class="ml-2 mt-2" > <span class="subheading grey--text lighten-1">{{index +1}}. {{point}}</span> </div> <!-- ACTIVITIES --> <div class="mt-5"> <v-icon>library_books</v-icon> <span class="subheading font-weight-bold">Activities</span> </div> <!-- OTHER OPTIONS --> <div class="mt-5"> |
06d0b6533
|
41 42 43 44 45 46 47 48 49 50 51 |
<ul class="subheading"> <!-- LIVE ONLINE CLASSES --> <div> <v-btn flat class="px-4"> <li @click="$router.push({name: 'Live Online Class', query: {chapterId: $route.query.selectedChapterId, chapterName: chapter.chapters[0].chapterName, courseId: $route.query.courseId, classId: localStorage.getItem('parentClassId') } })" >Live online classes</li> </v-btn> </div> <!-- OPEN PDF IN NEW TAB --> <div> |
2d3a8e9c3
|
52 53 54 55 56 |
<a :href="chapter.chapters[0].pdfFileUrl" target="_blank" style="text-decoration: none!important;" > |
06d0b6533
|
57 58 59 |
<v-btn flat class="px-4"> <li>Open PDF</li> </v-btn> |
2d3a8e9c3
|
60 |
</a> |
06d0b6533
|
61 |
</div> |
2d3a8e9c3
|
62 |
<!-- <li> |
ac24ec07a
|
63 64 65 66 67 |
<v-btn flat>HSP Interactive content</v-btn> </li> <li> <v-btn flat>Assessment</v-btn> </li>--> |
fe15ee8b4
|
68 69 |
</ul> </div> |
0e5675ffe
|
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
<!-- SELECT CHAPTERS --> <v-layout row class="mt-5"> <!-- PREVIOUS CHAPTER --> <v-flex style="cursor: pointer;" class="subheading font-weight-bold text-xs-left" v-if="indexSelectedChapter > 0" @click="showSelectedChapter('back')" > <v-icon class="black--text" style="position:relative; top: 4px;">chevron_left</v-icon> {{chapterNames[indexSelectedChapter - 1]}} </v-flex> <v-spacer></v-spacer> <!-- NEXT CHAPTER --> <v-flex style="cursor: pointer;" class="subheading font-weight-bold text-xs-right" v-if="indexSelectedChapter < chapterNames.length -1" @click="showSelectedChapter('forward')" > |
fe15ee8b4
|
90 91 |
{{chapterNames[indexSelectedChapter + 1]}} <v-icon class="black--text" style="position:relative; top: 4px;">chevron_right</v-icon> |
0e5675ffe
|
92 93 |
</v-flex> </v-layout> |
fe15ee8b4
|
94 95 96 97 98 99 |
<!-- <v-flex class="text-xs-right mt-5" v-else> <span class="subheading font-weight-bold">Return to chapter one</span> </v-flex>--> </v-flex> <v-spacer></v-spacer> |
e91641fe5
|
100 |
<!-- COURSES SIDE BAR- positioned to the right of the page --> |
375b62cd1
|
101 |
<v-flex md3> |
fe15ee8b4
|
102 |
<v-card class="elevation-0 card-border" height="100%"> |
e91641fe5
|
103 |
<CoursesSideBar></CoursesSideBar> |
fe15ee8b4
|
104 105 106 107 |
</v-card> </v-flex> </v-layout> </v-container> |
fe15ee8b4
|
108 109 110 111 |
</div> </template> <script> import http from "@/Services/http.js"; |
6f7cf8cf5
|
112 |
import AllApiCalls from "@/Services/AllApiCalls.js"; |
e91641fe5
|
113 |
import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue"; |
fe15ee8b4
|
114 |
export default { |
6f7cf8cf5
|
115 |
mixins: [AllApiCalls], |
e91641fe5
|
116 |
components: { |
860da881d
|
117 |
CoursesSideBar, |
e91641fe5
|
118 |
}, |
fe15ee8b4
|
119 120 |
data() { return { |
6f7cf8cf5
|
121 |
// courseData: [], |
e91641fe5
|
122 |
localStorage: localStorage, |
fe15ee8b4
|
123 124 125 126 127 |
showLoader: false, chapter: { chapters: [{}] }, chapterNames: [], chapterIds: [], selectedChapterId: "", |
2d3a8e9c3
|
128 |
indexSelectedChapter: "", |
860da881d
|
129 |
pdfLink: "", |
fe15ee8b4
|
130 131 132 |
}; }, methods: { |
0e5675ffe
|
133 134 135 136 137 138 139 140 141 142 143 |
showSelectedChapter(newChapter) { if (newChapter == "forward") { this.indexSelectedChapter += 1; this.selectedChapterId = this.chapterIds[this.indexSelectedChapter]; this.getParticularChapterDetail(); } if (newChapter == "back") { this.indexSelectedChapter -= 1; this.selectedChapterId = this.chapterIds[this.indexSelectedChapter]; this.getParticularChapterDetail(); } |
fe15ee8b4
|
144 145 146 147 148 149 |
}, getParticularChapterDetail() { http() .get("/getParticularChapterDetail", { params: { courseDetailId: this.$route.query.courseDetailId, |
860da881d
|
150 151 |
chapterId: this.selectedChapterId, }, |
fe15ee8b4
|
152 |
}) |
860da881d
|
153 |
.then((response) => { |
fe15ee8b4
|
154 |
this.chapter = response.data.data; |
fe15ee8b4
|
155 156 |
this.showLoader = false; }) |
860da881d
|
157 158 |
.catch((err) => { // console.log("err in getParticularChapterDetail====>", err); |
fe15ee8b4
|
159 |
this.showLoader = false; |
860da881d
|
160 161 162 |
this.snackbar = true; this.color = "error"; this.text = error.response.data.message; |
fe15ee8b4
|
163 |
}); |
860da881d
|
164 |
}, |
fe15ee8b4
|
165 166 167 168 169 170 |
}, // computed:{ // nextChapterIndex(){ // } // } |
6f7cf8cf5
|
171 |
async created() { |
860da881d
|
172 |
// console.log("route query - ", this.$route.query); |
fe15ee8b4
|
173 |
|
e91641fe5
|
174 |
this.selectedChapterId = this.$route.query.selectedChapterId; |
fe15ee8b4
|
175 176 177 178 179 |
/* set chapterNames array */ this.chapterNames = Object.keys(this.$route.query); this.chapterNames.pop(); this.chapterNames.pop(); |
e91641fe5
|
180 |
this.chapterNames.pop(); |
fe15ee8b4
|
181 182 183 184 185 |
/* set chapter Ids */ this.chapterIds = Object.values(this.$route.query); this.chapterIds.pop(); this.chapterIds.pop(); |
e91641fe5
|
186 |
this.chapterIds.pop(); |
860da881d
|
187 188 |
this.indexSelectedChapter = this.chapterIds.findIndex((id) => { |
fe15ee8b4
|
189 190 |
return id == this.selectedChapterId; }); |
fe15ee8b4
|
191 192 |
/* get chapter clicked on using the id */ |
6f7cf8cf5
|
193 |
await this.getParticularChapterDetail(this.selectedChapterId); |
860da881d
|
194 |
}, |
fe15ee8b4
|
195 196 197 198 199 200 201 202 203 204 205 206 |
}; </script> <style scoped> .side-bar-color { color: #827bfa !important; /* border-top-right-radius: 74px !important; */ } .card-border { border: 1px #bdbdbd solid; border-radius: 3px; } </style> |