jichoi / lms_front star
홍아랑 홍아랑 2024-08-23
240823 홍아랑 정다정 지문, 단어장 첫페이지 이전 버튼 숨기기 추가
@fd9b1dc20ca84e345119c96b80e824012e2ddeef
client/views/pages/main/Chapter/Chapter1_2.vue
--- client/views/pages/main/Chapter/Chapter1_2.vue
+++ client/views/pages/main/Chapter/Chapter1_2.vue
@@ -18,7 +18,11 @@
       <button class="completeBtn" @click="complete">학습 종료</button>
     </div>
     <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="goToPage('Chapter1_1')">
+      <div
+        class="pre-btn"
+        style="visibility: hidden"
+        @click="goToPage('Chapter1_1')"
+      >
         <img src="../../../../resources/img/left.png" alt="" />
       </div>
       <div class="content title-box">
client/views/pages/main/Chapter/Chapter1_3.vue
--- client/views/pages/main/Chapter/Chapter1_3.vue
+++ client/views/pages/main/Chapter/Chapter1_3.vue
@@ -18,7 +18,11 @@
       <button class="completeBtn" @click="complete">학습 종료</button>
     </div>
     <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="goToPage('Chapter1_2')">
+      <div
+        class="pre-btn"
+        style="visibility: hidden"
+        @click="goToPage('Chapter1_2')"
+      >
         <img src="../../../../resources/img/left.png" alt="" />
       </div>
       <div class="content title-box">
client/views/pages/main/Chapter/Chapter2.vue
--- client/views/pages/main/Chapter/Chapter2.vue
+++ client/views/pages/main/Chapter/Chapter2.vue
@@ -18,8 +18,12 @@
       <button class="completeBtn" @click="complete">학습 종료</button>
     </div>
     <div class="flex justify-between align-center">
-    
-      <div class="pre-btn" @click="goToPage('Chapter1_3')"> <!-- @click="goToPrevPage" -->
+      <!-- <div class="pre-btn" @click="goToPage('Chapter1_3')"> @click="goToPrevPage" -->
+      <div
+        class="pre-btn"
+        :style="{ visibility: hiddenState ? 'hidden' : 'visible' }"
+        @click="goToPrevPage"
+      >
         <img src="../../../../resources/img/left.png" alt="" />
       </div>
       <div class="content title-box">
@@ -31,14 +35,14 @@
         <div class="flex justify-center">
           <div class="vocaGroup">
             <div
-              v-for="(word) in wordList"
+              v-for="word in wordList"
               :key="word.wdId"
               class="flex justify-between mb80 word-item"
             >
               <article class="flex align-center">
                 <div class="imgGroup mr30">
                   <img
-                    :src= word.fileRpath
+                    :src="word.fileRpath"
                     data-num="1"
                     style="width: 200px"
                   />
@@ -71,11 +75,11 @@
                 </div>
               </article>
             </div>
-
           </div>
         </div>
       </div>
-      <div class="next-btn" @click="goToPage('Chapter2_3')"> <!-- @click="goToNextPage" -->
+      <div class="next-btn" @click="goToPage('Chapter2_3')">
+        <!-- @click="goToNextPage" -->
         <img src="../../../../resources/img/right.png" alt="" />
       </div>
     </div>
@@ -83,7 +87,7 @@
 </template>
 
 <script>
-import axios from 'axios';
+import axios from "axios";
 
 export default {
   data() {
@@ -95,14 +99,20 @@
       currentWdBkIndex: 0, // 현재 단어장 인덱스
       wdBookTypeIdState: "", // 이동할 페이지 타입 id
       wordBookType: "", // 이동할 페이지
+
+      hiddenState: false,
     };
   },
   methods: {
     pageSetting() {
       this.currentWdBkIndex = this.$store.getters.getCurrentWdBkIndex; // 현재 단어장 인덱스
       this.wdBookIdList = this.$store.getters.getWdBookIdList; // 단어컨텐츠의 단어장 id 리스트
-      this.wdBookId = this.$store.getters.getWdBookIdList[this.currentWdBkIndex] // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id
+      this.wdBookId =
+        this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id
 
+      if (this.currentWdBkIndex - 1 < 0) {
+        this.hiddenState = true;
+      }
       // this.fetchWordList();
     },
 
@@ -120,7 +130,10 @@
             file_mng_id: word.fileMngId,
           });
 
-          const fileRpath = fileResponse.data.list.length > 0 ? fileResponse.data.list[0].fileRpath : null;
+          const fileRpath =
+            fileResponse.data.list.length > 0
+              ? fileResponse.data.list[0].fileRpath
+              : null;
           console.log("각 단어의 fileRpath: ", fileRpath);
 
           word.fileRpath = "http://165.229.169.113:9080/" + fileRpath; // fileRpath 값을 해당 객체에 추가
@@ -142,38 +155,39 @@
         alert("단어장 첫번째 페이지 입니다");
       } else {
         this.currentWdBkIndex--;
-        this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex);
+        this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex);
 
         try {
           const response = await axios.post("/wordbook/find.json", {
-            wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex]
+            wdBookId:
+              this.$store.getters.getWdBookIdList[this.currentWdBkIndex],
           });
           this.wdBookTypeIdState = response.data.wdBookTypeId;
           console.log("이전 단어장 타입 id: ", this.wdBookTypeIdState);
 
           switch (this.wdBookTypeIdState) {
             case "1":
-                this.wordBookType = "Chapter2";
-                break;
+              this.wordBookType = "Chapter2";
+              break;
             case "2":
-                this.wordBookType = "Chapter2_3";
-                break;
+              this.wordBookType = "Chapter2_3";
+              break;
             case "3":
-                this.wordBookType = "Chapter2_2";
-                break;
+              this.wordBookType = "Chapter2_2";
+              break;
             case "4":
-                this.wordBookType = "Chapter2_9";
-                break;
+              this.wordBookType = "Chapter2_9";
+              break;
             case "5":
-                this.wordBookType = "Chapter2_4";
-                break;
+              this.wordBookType = "Chapter2_4";
+              break;
             default:
-                this.wordBookType = null;
+              this.wordBookType = null;
           }
-          
-          this.goToPage(this.wordBookType); 
+
+          this.goToPage(this.wordBookType);
         } catch (error) {
-          console.error('단어장 정보 불러오는 중 오류 발생:', error);
+          console.error("단어장 정보 불러오는 중 오류 발생:", error);
         }
       }
     },
@@ -183,38 +197,39 @@
         alert("단어장 마지막 페이지 입니다");
       } else {
         this.currentWdBkIndex++;
-        this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex);
+        this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex);
 
         try {
           const response = await axios.post("/wordbook/find.json", {
-            wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex]
+            wdBookId:
+              this.$store.getters.getWdBookIdList[this.currentWdBkIndex],
           });
           this.wdBookTypeIdState = response.data.wdBookTypeId;
           console.log("다음 단어장 타입 id: ", this.wdBookTypeIdState);
 
           switch (this.wdBookTypeIdState) {
             case "1":
-                this.wordBookType = "Chapter2";
-                break;
+              this.wordBookType = "Chapter2";
+              break;
             case "2":
-                this.wordBookType = "Chapter2_3";
-                break;
+              this.wordBookType = "Chapter2_3";
+              break;
             case "3":
-                this.wordBookType = "Chapter2_2";
-                break;
+              this.wordBookType = "Chapter2_2";
+              break;
             case "4":
-                this.wordBookType = "Chapter2_9";
-                break;
+              this.wordBookType = "Chapter2_9";
+              break;
             case "5":
-                this.wordBookType = "Chapter2_4";
-                break;
+              this.wordBookType = "Chapter2_4";
+              break;
             default:
-                this.wordBookType = null;
+              this.wordBookType = null;
           }
-          
-          this.goToPage(this.wordBookType); 
+
+          this.goToPage(this.wordBookType);
         } catch (error) {
-          console.error('단어장 정보 불러오는 중 오류 발생:', error);
+          console.error("단어장 정보 불러오는 중 오류 발생:", error);
         }
       }
     },
@@ -231,7 +246,6 @@
         console.error(`Audio element with ID ${audioId} not found.`);
       }
     },
-
   },
   mounted() {
     console.log("챕터2 단어장 마운트 완료");
@@ -239,7 +253,6 @@
     this.fetchWordList();
   },
 };
-
 </script>
 
 <style scoped>
client/views/pages/main/Chapter/Chapter2_2.vue
--- client/views/pages/main/Chapter/Chapter2_2.vue
+++ client/views/pages/main/Chapter/Chapter2_2.vue
@@ -18,7 +18,12 @@
       <button class="completeBtn" @click="complete">학습 종료</button>
     </div>
     <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="goToPrevPage">
+      <div
+        class="pre-btn"
+        :style="{ visibility: hiddenState ? 'hidden' : 'visible' }"
+        @click="goToPrevPage"
+      >
+        >
         <img src="../../../../resources/img/left.png" alt="" />
       </div>
       <div class="content title-box">
@@ -86,6 +91,7 @@
       wordBookType: "", // 이동할 페이지
 
       seq: this.$store.getters.seqNum,
+      hiddenState: false,
     };
   },
   methods: {
@@ -96,6 +102,10 @@
         this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id
       console.log(this.wdBookId);
 
+      if (this.currentWdBkIndex - 1 < 0) {
+        this.hiddenState = true;
+      }
+
       this.fetchWordList();
     },
 
client/views/pages/main/Chapter/Chapter2_3.vue
--- client/views/pages/main/Chapter/Chapter2_3.vue
+++ client/views/pages/main/Chapter/Chapter2_3.vue
@@ -18,7 +18,11 @@
       <button class="completeBtn" @click="complete">학습 종료</button>
     </div>
     <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="goToPage('Chapter2')">
+      <div
+        class="pre-btn"
+        :style="{ visibility: hiddenState ? 'hidden' : 'visible' }"
+        @click="goToPrevPage"
+      >
         <!-- @click="goToPrevPage" -->
         <img src="../../../../resources/img/left.png" alt="" />
       </div>
@@ -126,6 +130,7 @@
       wordBookType: "", // 이동할 페이지
 
       seq: this.$store.getters.seqNum,
+      hiddenState: false,
     };
   },
   methods: {
@@ -135,6 +140,9 @@
       this.wdBookId =
         this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id
 
+      if (this.currentWdBkIndex - 1 < 0) {
+        this.hiddenState = true;
+      }
       // this.fetchWordList();
     },
 
client/views/pages/main/Chapter/Chapter2_4.vue
--- client/views/pages/main/Chapter/Chapter2_4.vue
+++ client/views/pages/main/Chapter/Chapter2_4.vue
@@ -18,7 +18,11 @@
       <button class="completeBtn" @click="complete">학습 종료</button>
     </div>
     <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="goToPrevPage">
+      <div
+        class="pre-btn"
+        :style="{ visibility: hiddenState ? 'hidden' : 'visible' }"
+        @click="goToPrevPage"
+      >
         <img src="../../../../resources/img/left.png" alt="" />
       </div>
       <div class="content title-box">
@@ -92,6 +96,8 @@
       wordBookType: "", // 이동할 페이지
 
       seq: this.$store.getters.seqNum,
+
+      hiddenState: false,
     };
   },
   methods: {
@@ -101,6 +107,10 @@
       this.wdBookId =
         this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id
 
+      if (this.currentWdBkIndex - 1 < 0) {
+        this.hiddenState = true;
+      }
+
       this.fetchWordList();
     },
 
client/views/pages/main/Chapter/Chapter2_9.vue
--- client/views/pages/main/Chapter/Chapter2_9.vue
+++ client/views/pages/main/Chapter/Chapter2_9.vue
@@ -18,7 +18,11 @@
       <button class="completeBtn" @click="complete">학습 종료</button>
     </div>
     <div class="flex justify-between align-center">
-      <div class="pre-btn" @click="goToPrevPage">
+      <div
+        class="pre-btn"
+        :style="{ visibility: hiddenState ? 'hidden' : 'visible' }"
+        @click="goToPrevPage"
+      >
         <img src="../../../../resources/img/left.png" alt="" />
       </div>
       <div class="content title-box">
@@ -139,6 +143,8 @@
       wordBookType: "", // 이동할 페이지
 
       seq: this.$store.getters.seqNum,
+
+      hiddenState: false,
     };
   },
   methods: {
@@ -148,6 +154,10 @@
       this.wdBookId =
         this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id
 
+      if (this.currentWdBkIndex - 1 < 0) {
+        this.hiddenState = true;
+      }
+
       this.fetchWordList();
     },
 
Add a comment
List