

240822 박세훈 문제 타입 별 페이지 연결
@c4333249f0ae86a5f85079aa31dd79010dab7deb
--- client/views/pages/AppStore.js
+++ client/views/pages/AppStore.js
... | ... | @@ -10,7 +10,8 @@ |
10 | 10 |
bookId: null, |
11 | 11 |
unitId: null, |
12 | 12 |
LearningId: null, |
13 |
- currentLearningIds: [], // Stores multiple learning_ids (prblm_id) |
|
13 |
+ currentLearningIds: [], |
|
14 |
+ prblmTypeId: null, |
|
14 | 15 |
currentLabel: null, |
15 | 16 |
currentProblemIndex: 0, |
16 | 17 |
}, |
... | ... | @@ -43,7 +44,8 @@ |
43 | 44 |
return state.currentLearningIds[state.currentProblemIndex]; |
44 | 45 |
}, |
45 | 46 |
currentLabel: state => state.currentLabel, |
46 |
- currentProblemIndex: state => state.currentProblemIndex |
|
47 |
+ currentProblemIndex: state => state.currentProblemIndex, |
|
48 |
+ prblmTypeId: state => state.prblmTypeId, |
|
47 | 49 |
}, |
48 | 50 |
mutations: { |
49 | 51 |
setToken(state, token) { |
... | ... | @@ -84,6 +86,7 @@ |
84 | 86 |
state.currentLearningIds = payload.learning_id; // Array of IDs |
85 | 87 |
state.currentLabel = payload.label; |
86 | 88 |
state.currentProblemIndex = 0; // Reset to the first problem |
89 |
+ state.prblmTypeId = payload.prblmTypeId; |
|
87 | 90 |
}, |
88 | 91 |
incrementProblemIndex(state) { |
89 | 92 |
if (state.currentProblemIndex < state.currentLearningIds.length - 1) { |
--- client/views/pages/main/Chapter/Chapter3_1.vue
+++ client/views/pages/main/Chapter/Chapter3_1.vue
... | ... | @@ -50,8 +50,7 @@ |
50 | 50 |
</div> |
51 | 51 |
<button class="submit-button" @click="handleSubmit()">제출하기</button> |
52 | 52 |
</div> |
53 |
- <div class="next-btn" @click="[goToPage('Chapter3_2'), nextProblem()]"><img |
|
54 |
- src="../../../../resources/img/right.png" alt="" /> |
|
53 |
+ <div class="next-btn" @click="[nextProblem()]"><img src="../../../../resources/img/right.png" alt="" /> |
|
55 | 54 |
</div> |
56 | 55 |
</div> |
57 | 56 |
</div> |
... | ... | @@ -69,7 +68,7 @@ |
69 | 68 |
}, |
70 | 69 |
methods: { |
71 | 70 |
goToPage(page) { |
72 |
- // this.$router.push({ name: page }); |
|
71 |
+ this.$router.push({ name: page }); |
|
73 | 72 |
}, |
74 | 73 |
startTimer() { |
75 | 74 |
if (this.intervalId) { |
... | ... | @@ -93,11 +92,39 @@ |
93 | 92 |
}, |
94 | 93 |
nextProblem() { |
95 | 94 |
this.$store.dispatch('goToNextProblem') |
96 |
- console.log('Current Problem Index:', this.currentProblemIndex); |
|
95 |
+ console.log('Current Learning ID:', this.currentLearningId); |
|
96 |
+ this.handleProblemDetail(this.currentLearningId) |
|
97 |
+ this.goToPage(this.problemType) |
|
97 | 98 |
}, |
98 | 99 |
previousProblem() { |
99 | 100 |
this.$store.dispatch('goToPreviousProblem'); |
100 |
- } |
|
101 |
+ }, |
|
102 |
+ |
|
103 |
+ handleProblemDetail(item) { |
|
104 |
+ if (item.prblm_type_id === "prblm_type_001") { |
|
105 |
+ this.problemType = "Chapter3"; |
|
106 |
+ } else if (item.prblm_type_id === "prblm_type_002") { |
|
107 |
+ this.problemType = "Chapter3_1"; |
|
108 |
+ } else if (item.prblm_type_id === "prblm_type_003") { |
|
109 |
+ this.problemType = "Chapter3_2"; |
|
110 |
+ } else if (item.prblm_type_id === "prblm_type_004") { |
|
111 |
+ this.problemType = "Chapter3_3"; |
|
112 |
+ } else if (item.prblm_type_id === "prblm_type_005") { |
|
113 |
+ this.problemType = "Chapter3_3_1"; |
|
114 |
+ } else if (item.prblm_type_id === "prblm_type_006") { |
|
115 |
+ this.problemType = "Chapter3_4"; |
|
116 |
+ } else if (item.prblm_type_id === "prblm_type_007") { |
|
117 |
+ this.problemType = "Chapter3_5"; |
|
118 |
+ } else if (item.prblm_type_id === "prblm_type_008") { |
|
119 |
+ this.problemType = "Chapter3_6"; |
|
120 |
+ } else if (item.prblm_type_id === "prblm_type_009") { |
|
121 |
+ this.problemType = "Chapter3_7"; |
|
122 |
+ } else if (item.prblm_type_id === "prblm_type_010") { |
|
123 |
+ this.problemType = "Chapter3_8"; |
|
124 |
+ } else if (item.prblm_type_id === "prblm_type_011") { |
|
125 |
+ this.problemType = "Chapter3_9"; |
|
126 |
+ } |
|
127 |
+ }, |
|
101 | 128 |
}, |
102 | 129 |
watch: {}, |
103 | 130 |
computed: { |
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 |
</div> |
42 | 42 |
</div> |
43 | 43 |
<div class="lcon flex justify-between mb5"> |
44 |
- <div class="race-btn" @click="[storeLearningId(labeledItems[6]), viewDetail(item)]"> |
|
44 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[6])]"> |
|
45 | 45 |
<div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
46 | 46 |
:style="{ display: rabbitPos[7] ? 'block' : 'none' }"></div> |
47 | 47 |
<button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
... | ... | @@ -592,46 +592,59 @@ |
592 | 592 |
storeLearningId(labeledItems) { |
593 | 593 |
this.$store.dispatch('updateLearningData', labeledItems) |
594 | 594 |
if (labeledItems.label === "문제3") { |
595 |
- axios({ |
|
596 |
- url: "problem/problemInfo.json", |
|
597 |
- method: "post", |
|
598 |
- headers: { |
|
599 |
- "Content-Type": "application/json; charset=UTF-8", |
|
600 |
- }, |
|
601 |
- data: { |
|
602 |
- prblmId: this.$store.getters.currentLearningId.prblm_id, |
|
603 |
- }, |
|
604 |
- }) |
|
605 |
- .then(response => { |
|
606 |
- this.handleProblemDetail(response.data.problem); |
|
607 |
- this.goToPage(this.problemType); |
|
608 |
- }) |
|
595 |
+ this.handleProblemDetail(this.$store.getters.currentLearningId) |
|
596 |
+ this.goToPage(this.problemType) |
|
609 | 597 |
} |
610 | 598 |
}, |
611 | 599 |
handleProblemDetail(item) { |
612 |
- console.log(item); |
|
613 |
- if (item.prblmTypeId === "prblm_type_001") { |
|
600 |
+ if (item.prblm_type_id === "prblm_type_001") { |
|
614 | 601 |
this.problemType = "Chapter3"; |
615 |
- } else if (item.prblmTypeId === "prblm_type_002") { |
|
602 |
+ } else if (item.prblm_type_id === "prblm_type_002") { |
|
616 | 603 |
this.problemType = "Chapter3_1"; |
617 |
- } else if (item.prblmTypeId === "prblm_type_003") { |
|
604 |
+ } else if (item.prblm_type_id === "prblm_type_003") { |
|
618 | 605 |
this.problemType = "Chapter3_2"; |
619 |
- } else if (item.prblmTypeId === "prblm_type_004") { |
|
606 |
+ } else if (item.prblm_type_id === "prblm_type_004") { |
|
620 | 607 |
this.problemType = "Chapter3_3"; |
621 |
- } else if (item.prblmTypeId === "prblm_type_005") { |
|
608 |
+ } else if (item.prblm_type_id === "prblm_type_005") { |
|
622 | 609 |
this.problemType = "Chapter3_3_1"; |
623 |
- } else if (item.prblmTypeId === "prblm_type_006") { |
|
610 |
+ } else if (item.prblm_type_id === "prblm_type_006") { |
|
624 | 611 |
this.problemType = "Chapter3_4"; |
625 |
- } else if (item.prblmTypeId === "prblm_type_007") { |
|
612 |
+ } else if (item.prblm_type_id === "prblm_type_007") { |
|
626 | 613 |
this.problemType = "Chapter3_5"; |
627 |
- } else if (item.prblmTypeId === "prblm_type_008") { |
|
614 |
+ } else if (item.prblm_type_id === "prblm_type_008") { |
|
628 | 615 |
this.problemType = "Chapter3_6"; |
629 |
- } else if (item.prblmTypeId === "prblm_type_009") { |
|
616 |
+ } else if (item.prblm_type_id === "prblm_type_009") { |
|
630 | 617 |
this.problemType = "Chapter3_7"; |
631 |
- } else if (item.prblmTypeId === "prblm_type_010") { |
|
618 |
+ } else if (item.prblm_type_id === "prblm_type_010") { |
|
632 | 619 |
this.problemType = "Chapter3_8"; |
633 |
- } else if (item.prblmTypeId === "prblm_type_011") { |
|
620 |
+ } else if (item.prblm_type_id === "prblm_type_011") { |
|
634 | 621 |
this.problemType = "Chapter3_9"; |
622 |
+ } else if (item.prblm_type_id === "prblm_type_012") { |
|
623 |
+ this.problemType = "Chapter3_10"; |
|
624 |
+ } else if (item.prblm_type_id === "prblm_type_013") { |
|
625 |
+ this.problemType = "Chapter3_11"; |
|
626 |
+ } else if (item.prblm_type_id === "prblm_type_014") { |
|
627 |
+ this.problemType = "Chapter3_12"; |
|
628 |
+ } else if (item.prblm_type_id === "prblm_type_015") { |
|
629 |
+ this.problemType = "Chapter3_13"; |
|
630 |
+ } else if (item.prblm_type_id === "prblm_type_016") { |
|
631 |
+ this.problemType = "Chapter3_14"; |
|
632 |
+ } else if (item.prblm_type_id === "prblm_type_017") { |
|
633 |
+ this.problemType = "Chapter3_15"; |
|
634 |
+ } else if (item.prblm_type_id === "prblm_type_018") { |
|
635 |
+ this.problemType = "Chapter2_8"; |
|
636 |
+ } else if (item.prblm_type_id === "prblm_type_019") { |
|
637 |
+ this.problemType = "Chapter2_7"; |
|
638 |
+ } else if (item.prblm_type_id === "prblm_type_020") { |
|
639 |
+ this.problemType = "Chapter2_5"; |
|
640 |
+ } else if (item.prblm_type_id === "prblm_type_021") { |
|
641 |
+ this.problemType = "Chapter2_6"; |
|
642 |
+ } else if (item.prblm_type_id === "prblm_type_022") { |
|
643 |
+ this.problemType = "Chapter2_10"; |
|
644 |
+ } else if (item.prblm_type_id === "prblm_type_023") { |
|
645 |
+ this.problemType = "Chapter2_11"; |
|
646 |
+ } else if (item.prblm_type_id === "prblm_type_024") { |
|
647 |
+ this.problemType = "Chapter2_13"; |
|
635 | 648 |
} |
636 | 649 |
}, |
637 | 650 |
openCameraModal() { |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?