jichoi / lms_front star
woals 2024-08-23
240823 권민수 단어장 아직 학습완료 적용안된 페이지 적용
@f54e18ce8bf27ef7ad453baa5fcf380cf2058024
client/views/pages/main/Chapter/Chapter2.vue
--- client/views/pages/main/Chapter/Chapter2.vue
+++ client/views/pages/main/Chapter/Chapter2.vue
@@ -100,6 +100,7 @@
       wordBookType: "", // 이동할 페이지
 
       hiddenState: false,
+      seq: this.$store.getters.seqNum,
     };
   },
   methods: {
@@ -194,6 +195,7 @@
     async goToNextPage() {
       if (this.currentWdBkIndex + 1 >= this.wdBookIdList.length) {
         alert("단어장 마지막 페이지 입니다");
+        this.complete();
       } else {
         this.currentWdBkIndex++;
         this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex);
@@ -245,6 +247,14 @@
         console.error(`Audio element with ID ${audioId} not found.`);
       }
     },
+
+    complete() {
+      const { unit_id, book_id } = this.$route.query;
+      this.$router.push({
+        name: "Dashboard",
+        query: { value: this.seq, unit_id, book_id },
+      });
+    },
   },
   mounted() {
     console.log("챕터2 단어장 마운트 완료");
client/views/pages/main/Chapter/Chapter2_3.vue
--- client/views/pages/main/Chapter/Chapter2_3.vue
+++ client/views/pages/main/Chapter/Chapter2_3.vue
@@ -191,6 +191,7 @@
     async goToNextPage() {
       if (this.currentWdBkIndex + 1 >= this.wdBookIdList.length) {
         alert("단어장 마지막 페이지 입니다");
+        this.complete();
       } else {
         this.currentWdBkIndex++;
         this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex);
@@ -237,15 +238,18 @@
         query: { value: this.seq, unit_id, book_id },
       });
     },
+
     goToPage(page) {
       this.$router.push({ name: page });
     },
+
     updateContent(index) {
       this.selectedIndex = index;
       this.currentCon = this.items[index].con;
       console.log(this.currentCon.imgSrc);
       this.startTimer();
     },
+
     startTimer() {
       if (this.intervalId) {
         clearInterval(this.intervalId);
@@ -259,6 +263,7 @@
         }
       }, 1000);
     },
+
     // 녹음 시작/중지 토글
     async toggleRecording() {
       if (this.isRecording) {
@@ -269,6 +274,7 @@
         await this.startRecording(); // 녹음 중이 아니면 녹음 시작
       }
     },
+
     // 녹음 시작
     async startRecording() {
       this.audioChunks = []; // 오디오 초기화
Add a comment
List