
--- client/views/pages/AppStore.js
+++ client/views/pages/AppStore.js
... | ... | @@ -2,244 +2,260 @@ |
2 | 2 |
|
3 | 3 |
// Local storage에 상태를 저장하는 함수 |
4 | 4 |
function saveStateToLocalStorage(state) { |
5 |
- localStorage.setItem('vuexState', JSON.stringify(state)); |
|
5 |
+ localStorage.setItem("vuexState", JSON.stringify(state)); |
|
6 | 6 |
} |
7 | 7 |
|
8 | 8 |
// Local storage에서 상태를 불러오는 함수 |
9 | 9 |
function loadStateFromLocalStorage() { |
10 |
- const savedState = localStorage.getItem('vuexState'); |
|
11 |
- if (savedState) { |
|
12 |
- return JSON.parse(savedState); |
|
13 |
- } |
|
14 |
- return { |
|
15 |
- token: null, |
|
16 |
- userId: null, |
|
17 |
- authcd: null, |
|
18 |
- stdId: null, |
|
19 |
- schdlId: null, |
|
20 |
- bookId: null, |
|
21 |
- unitId: null, |
|
22 |
- unitNm: null, |
|
23 |
- LearningId: null, |
|
10 |
+ const savedState = localStorage.getItem("vuexState"); |
|
11 |
+ if (savedState) { |
|
12 |
+ return JSON.parse(savedState); |
|
13 |
+ } |
|
14 |
+ return { |
|
15 |
+ token: null, |
|
16 |
+ userId: null, |
|
17 |
+ authcd: null, |
|
18 |
+ stdId: null, |
|
19 |
+ schdlId: null, |
|
20 |
+ bookId: null, |
|
21 |
+ unitId: null, |
|
22 |
+ unitNm: null, |
|
23 |
+ LearningId: null, |
|
24 | 24 |
|
25 |
- // 문제 |
|
26 |
- currentLearningIds: [], |
|
27 |
- prblmTypeId: null, |
|
28 |
- currentLabel: null, |
|
29 |
- currentProblemIndex: 0, |
|
30 |
- allProblems: [], |
|
25 |
+ // 문제 |
|
26 |
+ currentLearningIds: [], |
|
27 |
+ prblmTypeId: null, |
|
28 |
+ currentLabel: null, |
|
29 |
+ currentProblemIndex: 0, |
|
30 |
+ allProblems: [], |
|
31 | 31 |
|
32 |
- // 단어장 |
|
33 |
- textId: null, |
|
34 |
- wdBookIdList: [], |
|
35 |
- currentWdBkIndex: 0, |
|
36 |
- }; |
|
32 |
+ // 단어장 |
|
33 |
+ textId: null, |
|
34 |
+ wdBookIdList: [], |
|
35 |
+ currentWdBkIndex: 0, |
|
36 |
+ |
|
37 |
+ // 순서 |
|
38 |
+ seqNum: null, |
|
39 |
+ }; |
|
37 | 40 |
} |
38 | 41 |
|
39 |
- |
|
40 | 42 |
export default createStore({ |
41 |
- state: loadStateFromLocalStorage(), |
|
42 |
- getters: { |
|
43 |
- getUserInfo(state) { |
|
44 |
- return { |
|
45 |
- userId: state.userId, |
|
46 |
- userNm: state.userNm, |
|
47 |
- authcd: state.authcd, |
|
48 |
- }; |
|
49 |
- }, |
|
50 |
- getStdId(state) { |
|
51 |
- return state.stdId; |
|
52 |
- }, |
|
53 |
- getSchdlId(state) { |
|
54 |
- return state.schdlId; |
|
55 |
- }, |
|
56 |
- getBookId(state) { |
|
57 |
- return state.bookId; |
|
58 |
- }, |
|
59 |
- getUnitId(state) { |
|
60 |
- return state.unitId; |
|
61 |
- }, |
|
62 |
- getLearningId(state) { |
|
63 |
- return state.learningId; |
|
64 |
- }, |
|
65 |
- getTextId(state) { |
|
66 |
- return state.textId; |
|
67 |
- }, |
|
68 |
- |
|
69 |
- // 문제 |
|
70 |
- currentLearningId(state) { |
|
71 |
- return state.currentLearningIds[state.currentProblemIndex]; |
|
72 |
- }, |
|
73 |
- currentLabel: (state) => state.currentLabel, |
|
74 |
- currentProblemIndex: (state) => state.currentProblemIndex, |
|
75 |
- prblmTypeId: (state) => state.prblmTypeId, |
|
76 |
- getAllProblems(state) { |
|
77 |
- return state.allProblems; |
|
78 |
- }, |
|
79 |
- |
|
80 |
- // 단어장 |
|
81 |
- getWdBookIdList(state) { |
|
82 |
- return state.wdBookIdList; |
|
83 |
- }, |
|
84 |
- getCurrentWdBkIndex: (state) => state.currentWdBkIndex, |
|
43 |
+ state: loadStateFromLocalStorage(), |
|
44 |
+ getters: { |
|
45 |
+ getUserInfo(state) { |
|
46 |
+ return { |
|
47 |
+ userId: state.userId, |
|
48 |
+ userNm: state.userNm, |
|
49 |
+ authcd: state.authcd, |
|
50 |
+ }; |
|
85 | 51 |
}, |
86 |
- mutations: { |
|
87 |
- setToken(state, token) { |
|
88 |
- state.token = token; |
|
89 |
- }, |
|
90 |
- clearToken(state) { |
|
91 |
- state.token = null; |
|
92 |
- state.userId = null; |
|
93 |
- state.userNm = null; |
|
94 |
- state.authcd = null; |
|
95 |
- state.stdId = null; |
|
96 |
- state.schdlId = null; |
|
97 |
- state.bookId = null; |
|
98 |
- state.unitId = null; |
|
99 |
- state.learningId = null; |
|
100 |
- saveStateToLocalStorage(state); |
|
101 |
- }, |
|
102 |
- setUser(state, userId) { |
|
103 |
- state.userId = userId; |
|
104 |
- saveStateToLocalStorage(state); |
|
105 |
- }, |
|
106 |
- setUserNm(state, userNm) { |
|
107 |
- state.userNm = userNm; |
|
108 |
- saveStateToLocalStorage(state); |
|
109 |
- }, |
|
110 |
- setAuthcd(state, authcd) { |
|
111 |
- state.authcd = authcd; |
|
112 |
- saveStateToLocalStorage(state); |
|
113 |
- }, |
|
114 |
- setStdId(state, stdId) { |
|
115 |
- state.stdId = stdId; |
|
116 |
- saveStateToLocalStorage(state); |
|
117 |
- }, |
|
118 |
- setSchdlId(state, schdlId) { |
|
119 |
- state.schdlId = schdlId; |
|
120 |
- saveStateToLocalStorage(state); |
|
121 |
- }, |
|
122 |
- setBookId(state, bookId) { |
|
123 |
- state.bookId = bookId; |
|
124 |
- saveStateToLocalStorage(state); |
|
125 |
- }, |
|
126 |
- setUnitId(state, unitId) { |
|
127 |
- state.unitId = unitId; |
|
128 |
- saveStateToLocalStorage(state); |
|
129 |
- }, |
|
130 |
- setLearningId(state, learningId) { |
|
131 |
- state.learningId = learningId; |
|
132 |
- saveStateToLocalStorage(state); |
|
133 |
- }, |
|
134 |
- setTextId(state, textId) { |
|
135 |
- state.textId = textId; |
|
136 |
- saveStateToLocalStorage(state); |
|
137 |
- }, |
|
138 |
- |
|
139 |
- // 문제 |
|
140 |
- setLearningData(state, payload) { |
|
141 |
- state.currentLearningIds = payload.learning_id; // Array of IDs |
|
142 |
- state.currentLabel = payload.label; |
|
143 |
- state.currentProblemIndex = 0; // Reset to the first problem |
|
144 |
- state.prblmTypeId = payload.prblmTypeId; |
|
145 |
- saveStateToLocalStorage(state); |
|
146 |
- }, |
|
147 |
- incrementProblemIndex(state) { |
|
148 |
- if (state.currentProblemIndex < state.currentLearningIds.length - 1) { |
|
149 |
- state.currentProblemIndex++; |
|
150 |
- saveStateToLocalStorage(state); |
|
151 |
- } |
|
152 |
- }, |
|
153 |
- decrementProblemIndex(state) { |
|
154 |
- if (state.currentProblemIndex > 0) { |
|
155 |
- state.currentProblemIndex--; |
|
156 |
- saveStateToLocalStorage(state); |
|
157 |
- } |
|
158 |
- }, |
|
159 |
- saveOrUpdateProblem(state, problemData) { |
|
160 |
- const existingProblemIndex = state.allProblems.findIndex( |
|
161 |
- problem => problem.prblmNumber === problemData.prblmNumber |
|
162 |
- ); |
|
163 |
- |
|
164 |
- if (existingProblemIndex !== -1) { |
|
165 |
- // 문제 데이터 업데이트 |
|
166 |
- state.allProblems[existingProblemIndex] = problemData; |
|
167 |
- } else { |
|
168 |
- // 새로운 문제 추가 |
|
169 |
- state.allProblems.push(problemData); |
|
170 |
- } |
|
171 |
- }, |
|
172 |
- |
|
173 |
- // 단어장 |
|
174 |
- setWdBookIdList(state, wdBookIdList) { |
|
175 |
- state.wdBookIdList = wdBookIdList; |
|
176 |
- saveStateToLocalStorage(state); |
|
177 |
- }, |
|
178 |
- setCurrentWdBkIndex(state, currentWdBkIndex) { |
|
179 |
- state.currentWdBkIndex = currentWdBkIndex; |
|
180 |
- saveStateToLocalStorage(state); |
|
181 |
- } |
|
52 |
+ getStdId(state) { |
|
53 |
+ return state.stdId; |
|
182 | 54 |
}, |
183 |
- actions: { |
|
184 |
- login({ commit }, token) { |
|
185 |
- commit("setToken", token); |
|
186 |
- localStorage.setItem("token", token); |
|
187 |
- }, |
|
188 |
- logout({ commit }) { |
|
189 |
- commit("clearToken"); |
|
190 |
- localStorage.removeItem("token"); |
|
191 |
- }, |
|
192 |
- updateStdId({ commit }, payload) { |
|
193 |
- return new Promise((resolve) => { |
|
194 |
- commit("setStdId", payload); |
|
195 |
- resolve(); |
|
196 |
- }); |
|
197 |
- }, |
|
198 |
- updateSchdlId({ commit }, payload) { |
|
199 |
- return new Promise((resolve) => { |
|
200 |
- commit("setSchdlId", payload); |
|
201 |
- resolve(); |
|
202 |
- }); |
|
203 |
- }, |
|
204 |
- updateBookId({ commit }, payload) { |
|
205 |
- return new Promise((resolve) => { |
|
206 |
- commit("setBookId", payload); |
|
207 |
- resolve(); |
|
208 |
- }); |
|
209 |
- }, |
|
210 |
- updateUnitId({ commit }, payload) { |
|
211 |
- return new Promise((resolve) => { |
|
212 |
- commit("setUnitId", payload); |
|
213 |
- resolve(); |
|
214 |
- }); |
|
215 |
- }, |
|
216 |
- updateLearningId({ commit }, learningId) { |
|
217 |
- commit("setLearningId", learningId); |
|
218 |
- }, |
|
219 |
- updateLearningData({ commit }, payload) { |
|
220 |
- commit("setLearningData", payload); |
|
221 |
- }, |
|
222 |
- updateTextId({ commit }, textId) { |
|
223 |
- commit("setTextId", textId); |
|
224 |
- }, |
|
225 |
- |
|
226 |
- // 문제 |
|
227 |
- goToNextProblem({ commit }) { |
|
228 |
- commit("incrementProblemIndex"); |
|
229 |
- }, |
|
230 |
- goToPreviousProblem({ commit }) { |
|
231 |
- commit("decrementProblemIndex"); |
|
232 |
- }, |
|
233 |
- saveProblemData({ commit }, problemData) { |
|
234 |
- commit('saveOrUpdateProblem', problemData); |
|
235 |
- }, |
|
236 |
- |
|
237 |
- // 단어장 |
|
238 |
- updateWdBookIdList({ commit }, wdBookIdList) { |
|
239 |
- commit('setWdBookIdList', wdBookIdList); |
|
240 |
- }, |
|
241 |
- updateCurrentWdBkIndex({ commit }, currentWdBkIndex) { |
|
242 |
- commit('setCurrentWdBkIndex', currentWdBkIndex); |
|
243 |
- } |
|
55 |
+ getSchdlId(state) { |
|
56 |
+ return state.schdlId; |
|
244 | 57 |
}, |
58 |
+ getBookId(state) { |
|
59 |
+ return state.bookId; |
|
60 |
+ }, |
|
61 |
+ getUnitId(state) { |
|
62 |
+ return state.unitId; |
|
63 |
+ }, |
|
64 |
+ getLearningId(state) { |
|
65 |
+ return state.learningId; |
|
66 |
+ }, |
|
67 |
+ getTextId(state) { |
|
68 |
+ return state.textId; |
|
69 |
+ }, |
|
70 |
+ |
|
71 |
+ // 문제 |
|
72 |
+ currentLearningId(state) { |
|
73 |
+ return state.currentLearningIds[state.currentProblemIndex]; |
|
74 |
+ }, |
|
75 |
+ currentLabel: (state) => state.currentLabel, |
|
76 |
+ currentProblemIndex: (state) => state.currentProblemIndex, |
|
77 |
+ seqNum: (state) => state.seqNum, |
|
78 |
+ prblmTypeId: (state) => state.prblmTypeId, |
|
79 |
+ getAllProblems(state) { |
|
80 |
+ return state.allProblems; |
|
81 |
+ }, |
|
82 |
+ |
|
83 |
+ // 단어장 |
|
84 |
+ getWdBookIdList(state) { |
|
85 |
+ return state.wdBookIdList; |
|
86 |
+ }, |
|
87 |
+ getCurrentWdBkIndex: (state) => state.currentWdBkIndex, |
|
88 |
+ }, |
|
89 |
+ mutations: { |
|
90 |
+ setToken(state, token) { |
|
91 |
+ state.token = token; |
|
92 |
+ }, |
|
93 |
+ clearToken(state) { |
|
94 |
+ state.token = null; |
|
95 |
+ state.userId = null; |
|
96 |
+ state.userNm = null; |
|
97 |
+ state.authcd = null; |
|
98 |
+ state.stdId = null; |
|
99 |
+ state.schdlId = null; |
|
100 |
+ state.bookId = null; |
|
101 |
+ state.unitId = null; |
|
102 |
+ state.learningId = null; |
|
103 |
+ saveStateToLocalStorage(state); |
|
104 |
+ }, |
|
105 |
+ setUser(state, userId) { |
|
106 |
+ state.userId = userId; |
|
107 |
+ saveStateToLocalStorage(state); |
|
108 |
+ }, |
|
109 |
+ setUserNm(state, userNm) { |
|
110 |
+ state.userNm = userNm; |
|
111 |
+ saveStateToLocalStorage(state); |
|
112 |
+ }, |
|
113 |
+ setAuthcd(state, authcd) { |
|
114 |
+ state.authcd = authcd; |
|
115 |
+ saveStateToLocalStorage(state); |
|
116 |
+ }, |
|
117 |
+ setStdId(state, stdId) { |
|
118 |
+ state.stdId = stdId; |
|
119 |
+ saveStateToLocalStorage(state); |
|
120 |
+ }, |
|
121 |
+ setSchdlId(state, schdlId) { |
|
122 |
+ state.schdlId = schdlId; |
|
123 |
+ saveStateToLocalStorage(state); |
|
124 |
+ }, |
|
125 |
+ setBookId(state, bookId) { |
|
126 |
+ state.bookId = bookId; |
|
127 |
+ saveStateToLocalStorage(state); |
|
128 |
+ }, |
|
129 |
+ setUnitId(state, unitId) { |
|
130 |
+ state.unitId = unitId; |
|
131 |
+ saveStateToLocalStorage(state); |
|
132 |
+ }, |
|
133 |
+ setLearningId(state, learningId) { |
|
134 |
+ state.learningId = learningId; |
|
135 |
+ saveStateToLocalStorage(state); |
|
136 |
+ }, |
|
137 |
+ setTextId(state, textId) { |
|
138 |
+ state.textId = textId; |
|
139 |
+ saveStateToLocalStorage(state); |
|
140 |
+ }, |
|
141 |
+ |
|
142 |
+ // 순서 |
|
143 |
+ // setSeqNum(state, seqNum) { |
|
144 |
+ // state.seqNum = seqNum; |
|
145 |
+ // saveStateToLocalStorage(state); |
|
146 |
+ // }, |
|
147 |
+ |
|
148 |
+ // 문제 |
|
149 |
+ setLearningData(state, payload) { |
|
150 |
+ state.currentLearningIds = payload.learning_id; // Array of IDs |
|
151 |
+ state.currentLabel = payload.label; |
|
152 |
+ state.currentProblemIndex = 0; // Reset to the first problem |
|
153 |
+ state.prblmTypeId = payload.prblmTypeId; |
|
154 |
+ // 순서 |
|
155 |
+ state.seqNum = payload.seqNum; |
|
156 |
+ saveStateToLocalStorage(state); |
|
157 |
+ }, |
|
158 |
+ incrementProblemIndex(state) { |
|
159 |
+ if (state.currentProblemIndex < state.currentLearningIds.length - 1) { |
|
160 |
+ state.currentProblemIndex++; |
|
161 |
+ saveStateToLocalStorage(state); |
|
162 |
+ } |
|
163 |
+ }, |
|
164 |
+ decrementProblemIndex(state) { |
|
165 |
+ if (state.currentProblemIndex > 0) { |
|
166 |
+ state.currentProblemIndex--; |
|
167 |
+ saveStateToLocalStorage(state); |
|
168 |
+ } |
|
169 |
+ }, |
|
170 |
+ saveOrUpdateProblem(state, problemData) { |
|
171 |
+ const existingProblemIndex = state.allProblems.findIndex( |
|
172 |
+ (problem) => problem.prblmNumber === problemData.prblmNumber |
|
173 |
+ ); |
|
174 |
+ |
|
175 |
+ if (existingProblemIndex !== -1) { |
|
176 |
+ // 문제 데이터 업데이트 |
|
177 |
+ state.allProblems[existingProblemIndex] = problemData; |
|
178 |
+ } else { |
|
179 |
+ // 새로운 문제 추가 |
|
180 |
+ state.allProblems.push(problemData); |
|
181 |
+ } |
|
182 |
+ }, |
|
183 |
+ |
|
184 |
+ // 단어장 |
|
185 |
+ setWdBookIdList(state, wdBookIdList) { |
|
186 |
+ state.wdBookIdList = wdBookIdList; |
|
187 |
+ saveStateToLocalStorage(state); |
|
188 |
+ }, |
|
189 |
+ setCurrentWdBkIndex(state, currentWdBkIndex) { |
|
190 |
+ state.currentWdBkIndex = currentWdBkIndex; |
|
191 |
+ saveStateToLocalStorage(state); |
|
192 |
+ }, |
|
193 |
+ }, |
|
194 |
+ actions: { |
|
195 |
+ login({ commit }, token) { |
|
196 |
+ commit("setToken", token); |
|
197 |
+ localStorage.setItem("token", token); |
|
198 |
+ }, |
|
199 |
+ logout({ commit }) { |
|
200 |
+ commit("clearToken"); |
|
201 |
+ localStorage.removeItem("token"); |
|
202 |
+ }, |
|
203 |
+ updateStdId({ commit }, payload) { |
|
204 |
+ return new Promise((resolve) => { |
|
205 |
+ commit("setStdId", payload); |
|
206 |
+ resolve(); |
|
207 |
+ }); |
|
208 |
+ }, |
|
209 |
+ updateSchdlId({ commit }, payload) { |
|
210 |
+ return new Promise((resolve) => { |
|
211 |
+ commit("setSchdlId", payload); |
|
212 |
+ resolve(); |
|
213 |
+ }); |
|
214 |
+ }, |
|
215 |
+ updateBookId({ commit }, payload) { |
|
216 |
+ return new Promise((resolve) => { |
|
217 |
+ commit("setBookId", payload); |
|
218 |
+ resolve(); |
|
219 |
+ }); |
|
220 |
+ }, |
|
221 |
+ updateUnitId({ commit }, payload) { |
|
222 |
+ return new Promise((resolve) => { |
|
223 |
+ commit("setUnitId", payload); |
|
224 |
+ resolve(); |
|
225 |
+ }); |
|
226 |
+ }, |
|
227 |
+ updateLearningId({ commit }, learningId) { |
|
228 |
+ commit("setLearningId", learningId); |
|
229 |
+ }, |
|
230 |
+ updateLearningData({ commit }, payload) { |
|
231 |
+ commit("setLearningData", payload); |
|
232 |
+ }, |
|
233 |
+ updateTextId({ commit }, textId) { |
|
234 |
+ commit("setTextId", textId); |
|
235 |
+ }, |
|
236 |
+ |
|
237 |
+ // 문제 |
|
238 |
+ goToNextProblem({ commit }) { |
|
239 |
+ commit("incrementProblemIndex"); |
|
240 |
+ }, |
|
241 |
+ goToPreviousProblem({ commit }) { |
|
242 |
+ commit("decrementProblemIndex"); |
|
243 |
+ }, |
|
244 |
+ saveProblemData({ commit }, problemData) { |
|
245 |
+ commit("saveOrUpdateProblem", problemData); |
|
246 |
+ }, |
|
247 |
+ |
|
248 |
+ // 단어장 |
|
249 |
+ updateWdBookIdList({ commit }, wdBookIdList) { |
|
250 |
+ commit("setWdBookIdList", wdBookIdList); |
|
251 |
+ }, |
|
252 |
+ updateCurrentWdBkIndex({ commit }, currentWdBkIndex) { |
|
253 |
+ commit("setCurrentWdBkIndex", currentWdBkIndex); |
|
254 |
+ }, |
|
255 |
+ |
|
256 |
+ // 순서 |
|
257 |
+ // updateSeqNum({ commit }) { |
|
258 |
+ // commit("setSeqNum", seqNum); |
|
259 |
+ // }, |
|
260 |
+ }, |
|
245 | 261 |
}); |
--- client/views/pages/main/Chapter/Chapter1_2.vue
+++ client/views/pages/main/Chapter/Chapter1_2.vue
... | ... | @@ -1,157 +1,188 @@ |
1 | 1 |
<template> |
2 |
- <div id="Chapter1_2" class="content-wrap"> |
|
3 |
- <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
- <router-link to="/MyPlan.page"> |
|
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 |
- </router-link> |
|
2 |
+ <div id="Chapter1_2" class="content-wrap"> |
|
3 |
+ <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
+ <router-link to="/MyPlan.page"> |
|
5 |
+ <div class="logo mb25"> |
|
6 |
+ <img src="../../../../resources/img/logo2.png" alt="" /> |
|
7 | 7 |
</div> |
8 |
- <div class="title-box mb25 flex align-center mt40" style="justify-content: space-between"> |
|
9 |
- <div> |
|
10 |
- <span class="title mr40">1. Hello WORLD</span> |
|
11 |
- <span class="subtitle">my name is dd</span> |
|
12 |
- </div> |
|
13 |
- <button class="completeBtn" @click="complete">학습 종료</button> |
|
14 |
- </div> |
|
15 |
- <div class="flex justify-between align-center"> |
|
16 |
- <div class="pre-btn" @click="goToPage('Chapter1_1')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
17 |
- <div class="content title-box"> |
|
18 |
- <p class="title mt25 title-bg">step1. Hello WORLD</p> |
|
19 |
- <div class="flex justify-center"> |
|
20 |
- <div class="readGroup"> |
|
21 |
- <h4>각 인물들의 대화를 집중해서 읽어보세요</h4> |
|
22 |
- <div> |
|
23 |
- <div class="textbox"> |
|
24 |
- <article v-for="(line, index) in combinedLines" :key="index" :class="['flex', 'align-start', 'mb10', { 'justify-end': index % 2 !== 0 }]"> |
|
25 |
- <div v-if="index % 2 === 0" class="icon mr40"> |
|
26 |
- <img src="../../../../resources/img/img37_s.png" alt="" /> |
|
27 |
- <p class="name">{{ speakerA_name }}</p> |
|
28 |
- </div> |
|
29 |
- <p v-if="index % 2 === 0" class="read">{{ line }}</p> |
|
30 |
- |
|
31 |
- <p v-if="index % 2 !== 0" class="read mr40">{{ line }}</p> |
|
32 |
- <div v-if="index % 2 !== 0" class="icon"> |
|
33 |
- <img src="../../../../resources/img/img37_s.png" alt="" /> |
|
34 |
- <p class="name">{{ speakerB_name }}</p> |
|
35 |
- </div> |
|
36 |
- </article> |
|
37 |
- </div> |
|
38 |
- </div> |
|
39 |
- </div> |
|
40 |
- </div> |
|
41 |
- </div> |
|
42 |
- <div class="next-btn" @click="goToPage('Chapter1_3')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
43 |
- </div> |
|
44 |
- <TextToImage /> |
|
8 |
+ </router-link> |
|
45 | 9 |
</div> |
10 |
+ <div |
|
11 |
+ class="title-box mb25 flex align-center mt40" |
|
12 |
+ style="justify-content: space-between" |
|
13 |
+ > |
|
14 |
+ <div> |
|
15 |
+ <span class="title mr40">1. Hello WORLD</span> |
|
16 |
+ <span class="subtitle">my name is dd</span> |
|
17 |
+ </div> |
|
18 |
+ <button class="completeBtn" @click="complete">학습 종료</button> |
|
19 |
+ </div> |
|
20 |
+ <div class="flex justify-between align-center"> |
|
21 |
+ <div class="pre-btn" @click="goToPage('Chapter1_1')"> |
|
22 |
+ <img src="../../../../resources/img/left.png" alt="" /> |
|
23 |
+ </div> |
|
24 |
+ <div class="content title-box"> |
|
25 |
+ <p class="title mt25 title-bg">step1. Hello WORLD</p> |
|
26 |
+ <div class="flex justify-center"> |
|
27 |
+ <div class="readGroup"> |
|
28 |
+ <h4>각 인물들의 대화를 집중해서 읽어보세요</h4> |
|
29 |
+ <div> |
|
30 |
+ <div class="textbox"> |
|
31 |
+ <article |
|
32 |
+ v-for="(line, index) in combinedLines" |
|
33 |
+ :key="index" |
|
34 |
+ :class="[ |
|
35 |
+ 'flex', |
|
36 |
+ 'align-start', |
|
37 |
+ 'mb10', |
|
38 |
+ { 'justify-end': index % 2 !== 0 }, |
|
39 |
+ ]" |
|
40 |
+ > |
|
41 |
+ <div v-if="index % 2 === 0" class="icon mr40"> |
|
42 |
+ <img src="../../../../resources/img/img37_s.png" alt="" /> |
|
43 |
+ <p class="name">{{ speakerA_name }}</p> |
|
44 |
+ </div> |
|
45 |
+ <p v-if="index % 2 === 0" class="read">{{ line }}</p> |
|
46 |
+ |
|
47 |
+ <p v-if="index % 2 !== 0" class="read mr40">{{ line }}</p> |
|
48 |
+ <div v-if="index % 2 !== 0" class="icon"> |
|
49 |
+ <img src="../../../../resources/img/img37_s.png" alt="" /> |
|
50 |
+ <p class="name">{{ speakerB_name }}</p> |
|
51 |
+ </div> |
|
52 |
+ </article> |
|
53 |
+ </div> |
|
54 |
+ </div> |
|
55 |
+ </div> |
|
56 |
+ </div> |
|
57 |
+ </div> |
|
58 |
+ <div class="next-btn" @click="goToNextPage"> |
|
59 |
+ <img src="../../../../resources/img/right.png" alt="" /> |
|
60 |
+ </div> |
|
61 |
+ </div> |
|
62 |
+ <TextToImage /> |
|
63 |
+ </div> |
|
46 | 64 |
</template> |
47 | 65 |
|
48 | 66 |
<script> |
49 | 67 |
import TextToImage from "../../../component/TextToImage.vue"; |
50 | 68 |
import axios from "axios"; |
51 | 69 |
export default { |
52 |
- data() { |
|
53 |
- return { |
|
54 |
- text_data: null, // 받아온 지문 정보 |
|
55 |
- speakerA_name: null, |
|
56 |
- speakerB_name: null, |
|
57 |
- speakerA: [], |
|
58 |
- speakerB: [], |
|
59 |
- }; |
|
60 |
- }, |
|
61 |
- methods: { |
|
62 |
- complete() { |
|
63 |
- const { unit_id, book_id } = this.$route.query; |
|
64 |
- this.$router.push({ name: "Dashboard", query: { value: 1, unit_id, book_id } }); |
|
65 |
- }, |
|
66 |
- goToPage(page) { |
|
67 |
- this.$router.push({ name: page }); |
|
68 |
- }, |
|
69 |
- // 대화 지문 API |
|
70 |
- async fetchText() { |
|
71 |
- axios({ |
|
72 |
- url: "/text/selectOneText.json", |
|
73 |
- method: "post", |
|
74 |
- headers: { |
|
75 |
- "Content-Type": "application/json; charset=UTF-8", |
|
76 |
- }, |
|
77 |
- data: { |
|
78 |
- textId: this.textId, |
|
79 |
- }, |
|
80 |
- }) |
|
81 |
- .then((response) => { |
|
82 |
- this.text_data = response.data[0].text_cnt; |
|
83 |
- this.splitConversation(); |
|
84 |
- }) |
|
85 |
- .catch((err) => { |
|
86 |
- console.log("지문 에러 : ", err); |
|
87 |
- }); |
|
88 |
- }, |
|
89 |
- // 대화 지문 split |
|
90 |
- splitConversation() { |
|
91 |
- const lines = this.text_data.split("/"); |
|
92 |
- const speakers = {}; |
|
70 |
+ data() { |
|
71 |
+ return { |
|
72 |
+ text_data: null, // 받아온 지문 정보 |
|
73 |
+ speakerA_name: null, |
|
74 |
+ speakerB_name: null, |
|
75 |
+ speakerA: [], |
|
76 |
+ speakerB: [], |
|
93 | 77 |
|
94 |
- lines.forEach((line) => { |
|
95 |
- const [speaker, message] = line.trim().split(":"); |
|
96 |
- |
|
97 |
- if (!speakers.speakerA_name && !speakers.speakerB_name) { |
|
98 |
- // 첫 번째 발화자를 speakerA_name으로 설정 |
|
99 |
- speakers.speakerA_name = speaker.trim(); |
|
100 |
- this.speakerA.push(message.trim()); |
|
101 |
- } else if (speakers.speakerA_name && !speakers.speakerB_name && speakers.speakerA_name !== speaker.trim()) { |
|
102 |
- // 두 번째 발화자를 speakerB_name으로 설정 |
|
103 |
- speakers.speakerB_name = speaker.trim(); |
|
104 |
- this.speakerB.push(message.trim()); |
|
105 |
- } else if (speaker.trim() === speakers.speakerA_name) { |
|
106 |
- // speakerA_name에 내용 추가 |
|
107 |
- this.speakerA.push(message.trim()); |
|
108 |
- } else if (speaker.trim() === speakers.speakerB_name) { |
|
109 |
- // speakerB_name에 내용 추가 |
|
110 |
- this.speakerB.push(message.trim()); |
|
111 |
- } |
|
112 |
- }); |
|
113 |
- |
|
114 |
- this.speakerA_name = speakers.speakerA_name; |
|
115 |
- this.speakerB_name = speakers.speakerB_name; |
|
78 |
+ seq: this.$store.getters.seqNum, |
|
79 |
+ }; |
|
80 |
+ }, |
|
81 |
+ methods: { |
|
82 |
+ complete() { |
|
83 |
+ const { unit_id, book_id } = this.$route.query; |
|
84 |
+ this.$router.push({ |
|
85 |
+ name: "Dashboard", |
|
86 |
+ query: { value: this.seq, unit_id, book_id }, |
|
87 |
+ }); |
|
88 |
+ }, |
|
89 |
+ goToPage(page) { |
|
90 |
+ this.$router.push({ name: page }); |
|
91 |
+ }, |
|
92 |
+ goToNextPage() { |
|
93 |
+ alert("지문 학습 완료"); |
|
94 |
+ this.complete(); |
|
95 |
+ }, |
|
96 |
+ // 대화 지문 API |
|
97 |
+ async fetchText() { |
|
98 |
+ axios({ |
|
99 |
+ url: "/text/selectOneText.json", |
|
100 |
+ method: "post", |
|
101 |
+ headers: { |
|
102 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
116 | 103 |
}, |
117 |
- }, |
|
118 |
- watch: {}, |
|
119 |
- computed: { |
|
120 |
- textId() { |
|
121 |
- //console.log("지문 화면 아이디 : ", this.$store.getters.getTextId); |
|
122 |
- return this.$store.getters.getTextId; |
|
104 |
+ data: { |
|
105 |
+ textId: this.textId, |
|
123 | 106 |
}, |
124 |
- combinedLines() { |
|
125 |
- const maxLength = Math.max(this.speakerA.length, this.speakerB.length); |
|
126 |
- const lines = []; |
|
107 |
+ }) |
|
108 |
+ .then((response) => { |
|
109 |
+ this.text_data = response.data[0].text_cnt; |
|
110 |
+ this.splitConversation(); |
|
111 |
+ }) |
|
112 |
+ .catch((err) => { |
|
113 |
+ console.log("지문 에러 : ", err); |
|
114 |
+ }); |
|
115 |
+ }, |
|
116 |
+ // 대화 지문 split |
|
117 |
+ splitConversation() { |
|
118 |
+ const lines = this.text_data.split("/"); |
|
119 |
+ const speakers = {}; |
|
127 | 120 |
|
128 |
- for (let i = 0; i < maxLength; i++) { |
|
129 |
- if (i < this.speakerA.length) { |
|
130 |
- lines.push(this.speakerA[i]); |
|
131 |
- } |
|
132 |
- if (i < this.speakerB.length) { |
|
133 |
- lines.push(this.speakerB[i]); |
|
134 |
- } |
|
135 |
- } |
|
136 |
- return lines; |
|
137 |
- }, |
|
121 |
+ lines.forEach((line) => { |
|
122 |
+ const [speaker, message] = line.trim().split(":"); |
|
123 |
+ |
|
124 |
+ if (!speakers.speakerA_name && !speakers.speakerB_name) { |
|
125 |
+ // 첫 번째 발화자를 speakerA_name으로 설정 |
|
126 |
+ speakers.speakerA_name = speaker.trim(); |
|
127 |
+ this.speakerA.push(message.trim()); |
|
128 |
+ } else if ( |
|
129 |
+ speakers.speakerA_name && |
|
130 |
+ !speakers.speakerB_name && |
|
131 |
+ speakers.speakerA_name !== speaker.trim() |
|
132 |
+ ) { |
|
133 |
+ // 두 번째 발화자를 speakerB_name으로 설정 |
|
134 |
+ speakers.speakerB_name = speaker.trim(); |
|
135 |
+ this.speakerB.push(message.trim()); |
|
136 |
+ } else if (speaker.trim() === speakers.speakerA_name) { |
|
137 |
+ // speakerA_name에 내용 추가 |
|
138 |
+ this.speakerA.push(message.trim()); |
|
139 |
+ } else if (speaker.trim() === speakers.speakerB_name) { |
|
140 |
+ // speakerB_name에 내용 추가 |
|
141 |
+ this.speakerB.push(message.trim()); |
|
142 |
+ } |
|
143 |
+ }); |
|
144 |
+ |
|
145 |
+ this.speakerA_name = speakers.speakerA_name; |
|
146 |
+ this.speakerB_name = speakers.speakerB_name; |
|
138 | 147 |
}, |
139 |
- components: { |
|
140 |
- TextToImage: TextToImage, |
|
148 |
+ }, |
|
149 |
+ watch: {}, |
|
150 |
+ computed: { |
|
151 |
+ textId() { |
|
152 |
+ //console.log("지문 화면 아이디 : ", this.$store.getters.getTextId); |
|
153 |
+ return this.$store.getters.getTextId; |
|
141 | 154 |
}, |
142 |
- mounted() { |
|
143 |
- this.fetchText(); |
|
155 |
+ combinedLines() { |
|
156 |
+ const maxLength = Math.max(this.speakerA.length, this.speakerB.length); |
|
157 |
+ const lines = []; |
|
158 |
+ |
|
159 |
+ for (let i = 0; i < maxLength; i++) { |
|
160 |
+ if (i < this.speakerA.length) { |
|
161 |
+ lines.push(this.speakerA[i]); |
|
162 |
+ } |
|
163 |
+ if (i < this.speakerB.length) { |
|
164 |
+ lines.push(this.speakerB[i]); |
|
165 |
+ } |
|
166 |
+ } |
|
167 |
+ return lines; |
|
144 | 168 |
}, |
169 |
+ }, |
|
170 |
+ components: { |
|
171 |
+ TextToImage: TextToImage, |
|
172 |
+ }, |
|
173 |
+ mounted() { |
|
174 |
+ this.fetchText(); |
|
175 |
+ }, |
|
145 | 176 |
}; |
146 | 177 |
</script> |
147 | 178 |
|
148 | 179 |
<style> |
149 | 180 |
.completeBtn { |
150 |
- margin-right: 100px; |
|
151 |
- background-color: #ffba08; |
|
152 |
- padding: 10px 30px; |
|
153 |
- border-radius: 10px; |
|
154 |
- font-size: 28px; |
|
155 |
- font-family: "ONEMobilePOPOTF"; |
|
181 |
+ margin-right: 100px; |
|
182 |
+ background-color: #ffba08; |
|
183 |
+ padding: 10px 30px; |
|
184 |
+ border-radius: 10px; |
|
185 |
+ font-size: 28px; |
|
186 |
+ font-family: "ONEMobilePOPOTF"; |
|
156 | 187 |
} |
157 | 188 |
</style> |
--- client/views/pages/main/Chapter/Chapter1_3.vue
+++ client/views/pages/main/Chapter/Chapter1_3.vue
... | ... | @@ -1,104 +1,121 @@ |
1 | 1 |
<template> |
2 |
- <div id="Chapter1" class="content-wrap"> |
|
3 |
- <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
- <router-link to="/MyPlan.page"> |
|
5 |
- <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt="" /></div> |
|
6 |
- </router-link> |
|
2 |
+ <div id="Chapter1" class="content-wrap"> |
|
3 |
+ <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
+ <router-link to="/MyPlan.page"> |
|
5 |
+ <div class="logo mb25"> |
|
6 |
+ <img src="../../../../resources/img/logo2.png" alt="" /> |
|
7 | 7 |
</div> |
8 |
- <div class="title-box mb25 flex align-center mt40" style="justify-content: space-between"> |
|
9 |
- <div> |
|
10 |
- <span class="title mr40">1. Hello WORLD</span> |
|
11 |
- <span class="subtitle">my name is dd</span> |
|
12 |
- </div> |
|
13 |
- <button class="completeBtn" @click="complete">학습 종료</button> |
|
14 |
- </div> |
|
15 |
- <div class="flex justify-between align-center"> |
|
16 |
- <div class="pre-btn" @click="goToPage('Chapter1_2')"><img src="../../../../resources/img/left.png" alt="" /></div> |
|
17 |
- <div class="content title-box"> |
|
18 |
- <div class="listenGroup"> |
|
19 |
- <p class="title mt25 title-bg">step1. Hello WORLD</p> |
|
20 |
- <!-- |
|
8 |
+ </router-link> |
|
9 |
+ </div> |
|
10 |
+ <div |
|
11 |
+ class="title-box mb25 flex align-center mt40" |
|
12 |
+ style="justify-content: space-between" |
|
13 |
+ > |
|
14 |
+ <div> |
|
15 |
+ <span class="title mr40">1. Hello WORLD</span> |
|
16 |
+ <span class="subtitle">my name is dd</span> |
|
17 |
+ </div> |
|
18 |
+ <button class="completeBtn" @click="complete">학습 종료</button> |
|
19 |
+ </div> |
|
20 |
+ <div class="flex justify-between align-center"> |
|
21 |
+ <div class="pre-btn" @click="goToPage('Chapter1_2')"> |
|
22 |
+ <img src="../../../../resources/img/left.png" alt="" /> |
|
23 |
+ </div> |
|
24 |
+ <div class="content title-box"> |
|
25 |
+ <div class="listenGroup"> |
|
26 |
+ <p class="title mt25 title-bg">step1. Hello WORLD</p> |
|
27 |
+ <!-- |
|
21 | 28 |
<img class="bg" src="../../../../resources/img/img39_s.png" data-num="1" /> |
22 | 29 |
--> |
23 |
- <img class="bg" :src="img_src" /> |
|
24 |
- </div> |
|
25 |
- </div> |
|
26 |
- <div class="next-btn" @click="goToPage('Chapter2')"><img src="../../../../resources/img/right.png" alt="" /></div> |
|
30 |
+ <img class="bg" :src="img_src" /> |
|
27 | 31 |
</div> |
28 |
- <TextToImage /> |
|
32 |
+ </div> |
|
33 |
+ <div class="next-btn" @click="goToNextPage"> |
|
34 |
+ <img src="../../../../resources/img/right.png" alt="" /> |
|
35 |
+ </div> |
|
29 | 36 |
</div> |
37 |
+ <TextToImage /> |
|
38 |
+ </div> |
|
30 | 39 |
</template> |
31 | 40 |
|
32 | 41 |
<script> |
33 | 42 |
import TextToImage from "../../../component/TextToImage.vue"; |
34 | 43 |
import axios from "axios"; |
35 | 44 |
export default { |
36 |
- data() { |
|
37 |
- return { |
|
38 |
- text_data: null, |
|
39 |
- img_src: null, |
|
40 |
- }; |
|
45 |
+ data() { |
|
46 |
+ return { |
|
47 |
+ text_data: null, |
|
48 |
+ img_src: null, |
|
49 |
+ seq: this.$store.getters.seqNum, |
|
50 |
+ }; |
|
51 |
+ }, |
|
52 |
+ methods: { |
|
53 |
+ complete() { |
|
54 |
+ const { unit_id, book_id } = this.$route.query; |
|
55 |
+ this.$router.push({ |
|
56 |
+ name: "Dashboard", |
|
57 |
+ query: { value: this.seq, unit_id, book_id }, |
|
58 |
+ }); |
|
41 | 59 |
}, |
42 |
- methods: { |
|
43 |
- complete() { |
|
44 |
- const { unit_id, book_id } = this.$route.query; |
|
45 |
- this.$router.push({ name: "Dashboard", query: { value: 1, unit_id, book_id } }); |
|
46 |
- }, |
|
47 |
- goToPage(page) { |
|
48 |
- this.$router.push({ name: page }); |
|
49 |
- }, |
|
50 |
- // 지문 API |
|
51 |
- async fetchText() { |
|
52 |
- axios({ |
|
53 |
- url: "/text/selectOneText.json", |
|
54 |
- method: "post", |
|
55 |
- headers: { |
|
56 |
- "Content-Type": "application/json; charset=UTF-8", |
|
57 |
- }, |
|
58 |
- data: { |
|
59 |
- textId: this.textId, |
|
60 |
- }, |
|
61 |
- }) |
|
62 |
- .then((response) => { |
|
63 |
- this.text_data = response.data[0]; |
|
64 |
- console.log("지문 데이터 : ", this.text_data); |
|
65 |
- this.img_src = this.fetchImage(this.text_data.file_rpath); |
|
66 |
- }) |
|
67 |
- .catch((err) => { |
|
68 |
- console.log("지문 에러 : ", err); |
|
69 |
- }); |
|
70 |
- }, |
|
71 |
- // 이미지 불러오기 |
|
72 |
- fetchImage(fileRpath) { |
|
73 |
- return "http://165.229.169.113:9080/" + fileRpath; |
|
74 |
- }, |
|
60 |
+ goToPage(page) { |
|
61 |
+ this.$router.push({ name: page }); |
|
75 | 62 |
}, |
76 |
- watch: {}, |
|
77 |
- computed: { |
|
78 |
- textId() { |
|
79 |
- //console.log("지문 화면 아이디 : ", this.$store.getters.getTextId); |
|
80 |
- return this.$store.getters.getTextId; |
|
63 |
+ goToNextPage() { |
|
64 |
+ alert("지문 학습 완료"); |
|
65 |
+ this.complete(); |
|
66 |
+ }, |
|
67 |
+ // 지문 API |
|
68 |
+ async fetchText() { |
|
69 |
+ axios({ |
|
70 |
+ url: "/text/selectOneText.json", |
|
71 |
+ method: "post", |
|
72 |
+ headers: { |
|
73 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
81 | 74 |
}, |
75 |
+ data: { |
|
76 |
+ textId: this.textId, |
|
77 |
+ }, |
|
78 |
+ }) |
|
79 |
+ .then((response) => { |
|
80 |
+ this.text_data = response.data[0]; |
|
81 |
+ console.log("지문 데이터 : ", this.text_data); |
|
82 |
+ this.img_src = this.fetchImage(this.text_data.file_rpath); |
|
83 |
+ }) |
|
84 |
+ .catch((err) => { |
|
85 |
+ console.log("지문 에러 : ", err); |
|
86 |
+ }); |
|
82 | 87 |
}, |
83 |
- components: { |
|
84 |
- TextToImage: TextToImage, |
|
88 |
+ // 이미지 불러오기 |
|
89 |
+ fetchImage(fileRpath) { |
|
90 |
+ return "http://165.229.169.113:9080/" + fileRpath; |
|
85 | 91 |
}, |
86 |
- mounted() { |
|
87 |
- this.fetchText(); |
|
92 |
+ }, |
|
93 |
+ watch: {}, |
|
94 |
+ computed: { |
|
95 |
+ textId() { |
|
96 |
+ //console.log("지문 화면 아이디 : ", this.$store.getters.getTextId); |
|
97 |
+ return this.$store.getters.getTextId; |
|
88 | 98 |
}, |
99 |
+ }, |
|
100 |
+ components: { |
|
101 |
+ TextToImage: TextToImage, |
|
102 |
+ }, |
|
103 |
+ mounted() { |
|
104 |
+ this.fetchText(); |
|
105 |
+ }, |
|
89 | 106 |
}; |
90 | 107 |
</script> |
91 | 108 |
<style scoped> |
92 | 109 |
.listenGroup .textbox { |
93 |
- width: 900px; |
|
110 |
+ width: 900px; |
|
94 | 111 |
} |
95 | 112 |
|
96 | 113 |
.completeBtn { |
97 |
- margin-right: 100px; |
|
98 |
- background-color: #ffba08; |
|
99 |
- padding: 10px 30px; |
|
100 |
- border-radius: 10px; |
|
101 |
- font-size: 28px; |
|
102 |
- font-family: "ONEMobilePOPOTF"; |
|
114 |
+ margin-right: 100px; |
|
115 |
+ background-color: #ffba08; |
|
116 |
+ padding: 10px 30px; |
|
117 |
+ border-radius: 10px; |
|
118 |
+ font-size: 28px; |
|
119 |
+ font-family: "ONEMobilePOPOTF"; |
|
103 | 120 |
} |
104 | 121 |
</style> |
--- client/views/pages/main/Chapter/Chapter2_10.vue
+++ client/views/pages/main/Chapter/Chapter2_10.vue
... | ... | @@ -126,6 +126,8 @@ |
126 | 126 |
problemData: [], |
127 | 127 |
// problemArr: [], |
128 | 128 |
answerArr: [], |
129 |
+ |
|
130 |
+ seq: this.$store.getters.seqNum, |
|
129 | 131 |
}; |
130 | 132 |
}, |
131 | 133 |
methods: { |
... | ... | @@ -133,7 +135,7 @@ |
133 | 135 |
const { unit_id, book_id } = this.$route.query; |
134 | 136 |
this.$router.push({ |
135 | 137 |
name: "Dashboard", |
136 |
- query: { value: 3, unit_id, book_id }, |
|
138 |
+ query: { value: this.seq, unit_id, book_id }, |
|
137 | 139 |
}); |
138 | 140 |
}, |
139 | 141 |
goToPage(page) { |
... | ... | @@ -170,7 +172,9 @@ |
170 | 172 |
this.goToPage(this.problemType); |
171 | 173 |
} else { |
172 | 174 |
// 마지막 문제면 이동 |
173 |
- this.goToPage("Chapter4"); |
|
175 |
+ // this.goToPage("Chapter4"); |
|
176 |
+ alert("문제 학습 완료"); |
|
177 |
+ this.complete(); |
|
174 | 178 |
} |
175 | 179 |
}, |
176 | 180 |
previousProblem() { |
--- client/views/pages/main/Chapter/Chapter2_11.vue
+++ client/views/pages/main/Chapter/Chapter2_11.vue
... | ... | @@ -103,6 +103,8 @@ |
103 | 103 |
prblm_id: [], |
104 | 104 |
unit_id: null, |
105 | 105 |
dataList: [], |
106 |
+ |
|
107 |
+ seq: this.$store.getters.seqNum, |
|
106 | 108 |
}; |
107 | 109 |
}, |
108 | 110 |
methods: { |
... | ... | @@ -110,7 +112,7 @@ |
110 | 112 |
const { unit_id, book_id } = this.$route.query; |
111 | 113 |
this.$router.push({ |
112 | 114 |
name: "Dashboard", |
113 |
- query: { value: 3, unit_id, book_id }, |
|
115 |
+ query: { value: this.seq, unit_id, book_id }, |
|
114 | 116 |
}); |
115 | 117 |
}, |
116 | 118 |
goToPage(page) { |
... | ... | @@ -190,7 +192,9 @@ |
190 | 192 |
this.goToPage(this.problemType); |
191 | 193 |
} else { |
192 | 194 |
// 마지막 문제면 이동 |
193 |
- this.goToPage("Chapter4"); |
|
195 |
+ // this.goToPage("Chapter4"); |
|
196 |
+ alert("문제 학습 완료"); |
|
197 |
+ this.complete(); |
|
194 | 198 |
} |
195 | 199 |
}, |
196 | 200 |
previousProblem() { |
--- client/views/pages/main/Chapter/Chapter2_13.vue
+++ client/views/pages/main/Chapter/Chapter2_13.vue
... | ... | @@ -145,6 +145,8 @@ |
145 | 145 |
problemData: [], |
146 | 146 |
// problemArr: [], |
147 | 147 |
answerArr: [], |
148 |
+ |
|
149 |
+ seq: this.$store.getters.seqNum, |
|
148 | 150 |
}; |
149 | 151 |
}, |
150 | 152 |
methods: { |
... | ... | @@ -152,7 +154,7 @@ |
152 | 154 |
const { unit_id, book_id } = this.$route.query; |
153 | 155 |
this.$router.push({ |
154 | 156 |
name: "Dashboard", |
155 |
- query: { value: 3, unit_id, book_id }, |
|
157 |
+ query: { value: this.seq, unit_id, book_id }, |
|
156 | 158 |
}); |
157 | 159 |
}, |
158 | 160 |
goToPage(page) { |
... | ... | @@ -200,7 +202,9 @@ |
200 | 202 |
this.goToPage(this.problemType); |
201 | 203 |
} else { |
202 | 204 |
// 마지막 문제면 이동 |
203 |
- this.goToPage("Chapter4"); |
|
205 |
+ // this.goToPage("Chapter4"); |
|
206 |
+ alert("문제 학습 완료"); |
|
207 |
+ this.complete(); |
|
204 | 208 |
} |
205 | 209 |
}, |
206 | 210 |
previousProblem() { |
--- client/views/pages/main/Chapter/Chapter2_2.vue
+++ client/views/pages/main/Chapter/Chapter2_2.vue
... | ... | @@ -45,7 +45,9 @@ |
45 | 45 |
<button class="popTxt" v-for="(item, index) in items" :key="index"> |
46 | 46 |
<div class="listenGroup"> |
47 | 47 |
<img :src="item.imgSrc1" /> |
48 |
- <p class="textbox"><img :src="item.imgSrc" style="height: 150px;"/></p> |
|
48 |
+ <p class="textbox"> |
|
49 |
+ <img :src="item.imgSrc" style="height: 150px" /> |
|
50 |
+ </p> |
|
49 | 51 |
</div> |
50 | 52 |
<div |
51 | 53 |
class="listenGroup" |
... | ... | @@ -68,7 +70,7 @@ |
68 | 70 |
</template> |
69 | 71 |
|
70 | 72 |
<script> |
71 |
-import axios from 'axios'; |
|
73 |
+import axios from "axios"; |
|
72 | 74 |
|
73 | 75 |
export default { |
74 | 76 |
data() { |
... | ... | @@ -82,13 +84,16 @@ |
82 | 84 |
currentWdBkIndex: 0, // 현재 단어장 인덱스 |
83 | 85 |
wdBookTypeIdState: "", // 이동할 페이지 타입 id |
84 | 86 |
wordBookType: "", // 이동할 페이지 |
87 |
+ |
|
88 |
+ seq: this.$store.getters.seqNum, |
|
85 | 89 |
}; |
86 | 90 |
}, |
87 | 91 |
methods: { |
88 | 92 |
pageSetting() { |
89 | 93 |
this.currentWdBkIndex = this.$store.getters.getCurrentWdBkIndex; // 현재 단어장 인덱스 |
90 | 94 |
this.wdBookIdList = this.$store.getters.getWdBookIdList; // 단어컨텐츠의 단어장 id 리스트 |
91 |
- this.wdBookId = this.$store.getters.getWdBookIdList[this.currentWdBkIndex] // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id |
|
95 |
+ this.wdBookId = |
|
96 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id |
|
92 | 97 |
console.log(this.wdBookId); |
93 | 98 |
|
94 | 99 |
this.fetchWordList(); |
... | ... | @@ -96,7 +101,7 @@ |
96 | 101 |
|
97 | 102 |
async fetchWordList() { |
98 | 103 |
try { |
99 |
- const response = await axios.post('/word/getWordsByBookId.json', { |
|
104 |
+ const response = await axios.post("/word/getWordsByBookId.json", { |
|
100 | 105 |
wdBookId: this.wdBookId, |
101 | 106 |
}); |
102 | 107 |
|
... | ... | @@ -108,7 +113,10 @@ |
108 | 113 |
file_mng_id: word.fileMngId, |
109 | 114 |
}); |
110 | 115 |
|
111 |
- const fileRpath = fileResponse.data.list.length > 0 ? fileResponse.data.list[0].fileRpath : null; |
|
116 |
+ const fileRpath = |
|
117 |
+ fileResponse.data.list.length > 0 |
|
118 |
+ ? fileResponse.data.list[0].fileRpath |
|
119 |
+ : null; |
|
112 | 120 |
console.log("각 단어의 fileRpath: ", fileRpath); |
113 | 121 |
|
114 | 122 |
// items 배열에 새로운 항목 추가 |
... | ... | @@ -116,16 +124,15 @@ |
116 | 124 |
imgSrc1: "client/resources/img/img49_s.png", |
117 | 125 |
imgSrc2: "client/resources/img/img50_s.png", |
118 | 126 |
imgSrc: "http://165.229.169.113:9080/" + fileRpath, // 받아온 fileRpath로 이미지 설정 |
119 |
- isSecondImageVisible: false, |
|
127 |
+ isSecondImageVisible: false, |
|
120 | 128 |
title: word.wdNm, |
121 | 129 |
}); |
122 | 130 |
}); |
123 | 131 |
|
124 | 132 |
// 모든 요청이 완료될 때까지 대기 |
125 | 133 |
await Promise.all(requests); |
126 |
- |
|
127 | 134 |
} catch (error) { |
128 |
- console.error('단어 목록을 불러오는 중 오류 발생:', error); |
|
135 |
+ console.error("단어 목록을 불러오는 중 오류 발생:", error); |
|
129 | 136 |
} |
130 | 137 |
}, |
131 | 138 |
|
... | ... | @@ -134,38 +141,39 @@ |
134 | 141 |
alert("단어장 첫번째 페이지 입니다"); |
135 | 142 |
} else { |
136 | 143 |
this.currentWdBkIndex--; |
137 |
- this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex); |
|
144 |
+ this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex); |
|
138 | 145 |
|
139 | 146 |
try { |
140 | 147 |
const response = await axios.post("/wordbook/find.json", { |
141 |
- wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex] |
|
148 |
+ wdBookId: |
|
149 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex], |
|
142 | 150 |
}); |
143 | 151 |
this.wdBookTypeIdState = response.data.wdBookTypeId; |
144 | 152 |
console.log("이전 단어장 타입 id: ", this.wdBookTypeIdState); |
145 | 153 |
|
146 | 154 |
switch (this.wdBookTypeIdState) { |
147 | 155 |
case "1": |
148 |
- this.wordBookType = "Chapter2"; |
|
149 |
- break; |
|
156 |
+ this.wordBookType = "Chapter2"; |
|
157 |
+ break; |
|
150 | 158 |
case "2": |
151 |
- this.wordBookType = "Chapter2_3"; |
|
152 |
- break; |
|
159 |
+ this.wordBookType = "Chapter2_3"; |
|
160 |
+ break; |
|
153 | 161 |
case "3": |
154 |
- this.wordBookType = "Chapter2_2"; |
|
155 |
- break; |
|
162 |
+ this.wordBookType = "Chapter2_2"; |
|
163 |
+ break; |
|
156 | 164 |
case "4": |
157 |
- this.wordBookType = "Chapter2_9"; |
|
158 |
- break; |
|
165 |
+ this.wordBookType = "Chapter2_9"; |
|
166 |
+ break; |
|
159 | 167 |
case "5": |
160 |
- this.wordBookType = "Chapter2_4"; |
|
161 |
- break; |
|
168 |
+ this.wordBookType = "Chapter2_4"; |
|
169 |
+ break; |
|
162 | 170 |
default: |
163 |
- this.wordBookType = null; |
|
171 |
+ this.wordBookType = null; |
|
164 | 172 |
} |
165 |
- |
|
166 |
- this.goToPage(this.wordBookType); |
|
173 |
+ |
|
174 |
+ this.goToPage(this.wordBookType); |
|
167 | 175 |
} catch (error) { |
168 |
- console.error('단어장 정보 불러오는 중 오류 발생:', error); |
|
176 |
+ console.error("단어장 정보 불러오는 중 오류 발생:", error); |
|
169 | 177 |
} |
170 | 178 |
} |
171 | 179 |
}, |
... | ... | @@ -173,48 +181,54 @@ |
173 | 181 |
async goToNextPage() { |
174 | 182 |
if (this.currentWdBkIndex + 1 >= this.wdBookIdList.length) { |
175 | 183 |
alert("단어장 마지막 페이지 입니다"); |
184 |
+ this.complete(); |
|
176 | 185 |
} else { |
177 | 186 |
this.currentWdBkIndex++; |
178 |
- this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex); |
|
187 |
+ this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex); |
|
179 | 188 |
|
180 | 189 |
try { |
181 | 190 |
const response = await axios.post("/wordbook/find.json", { |
182 |
- wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex] |
|
191 |
+ wdBookId: |
|
192 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex], |
|
183 | 193 |
}); |
184 | 194 |
this.wdBookTypeIdState = response.data.wdBookTypeId; |
185 | 195 |
console.log("다음 단어장 타입 id: ", this.wdBookTypeIdState); |
186 | 196 |
|
187 | 197 |
switch (this.wdBookTypeIdState) { |
188 | 198 |
case "1": |
189 |
- this.wordBookType = "Chapter2"; |
|
190 |
- break; |
|
199 |
+ this.wordBookType = "Chapter2"; |
|
200 |
+ break; |
|
191 | 201 |
case "2": |
192 |
- this.wordBookType = "Chapter2_3"; |
|
193 |
- break; |
|
202 |
+ this.wordBookType = "Chapter2_3"; |
|
203 |
+ break; |
|
194 | 204 |
case "3": |
195 |
- this.wordBookType = "Chapter2_2"; |
|
196 |
- break; |
|
205 |
+ this.wordBookType = "Chapter2_2"; |
|
206 |
+ break; |
|
197 | 207 |
case "4": |
198 |
- this.wordBookType = "Chapter2_9"; |
|
199 |
- break; |
|
208 |
+ this.wordBookType = "Chapter2_9"; |
|
209 |
+ break; |
|
200 | 210 |
case "5": |
201 |
- this.wordBookType = "Chapter2_4"; |
|
202 |
- break; |
|
211 |
+ this.wordBookType = "Chapter2_4"; |
|
212 |
+ break; |
|
203 | 213 |
default: |
204 |
- this.wordBookType = null; |
|
214 |
+ this.wordBookType = null; |
|
205 | 215 |
} |
206 |
- |
|
207 |
- this.goToPage(this.wordBookType); |
|
216 |
+ |
|
217 |
+ this.goToPage(this.wordBookType); |
|
208 | 218 |
} catch (error) { |
209 |
- console.error('단어장 정보 불러오는 중 오류 발생:', error); |
|
219 |
+ console.error("단어장 정보 불러오는 중 오류 발생:", error); |
|
210 | 220 |
} |
211 | 221 |
} |
212 | 222 |
}, |
213 | 223 |
|
214 | 224 |
complete() { |
215 | 225 |
const { unit_id, book_id } = this.$route.query; |
216 |
- this.$router.push({ name: 'Dashboard', query: { value: 2, unit_id, book_id } }); |
|
226 |
+ this.$router.push({ |
|
227 |
+ name: "Dashboard", |
|
228 |
+ query: { value: this.seq, unit_id, book_id }, |
|
229 |
+ }); |
|
217 | 230 |
}, |
231 |
+ |
|
218 | 232 |
goToPage(page) { |
219 | 233 |
this.$router.push({ name: page }); |
220 | 234 |
}, |
--- client/views/pages/main/Chapter/Chapter2_3.vue
+++ client/views/pages/main/Chapter/Chapter2_3.vue
... | ... | @@ -1,412 +1,437 @@ |
1 | 1 |
<template> |
2 |
- <div id="Chapter2_2" class="content-wrap"> |
|
3 |
- <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
- <router-link to="/MyPlan.page"> |
|
5 |
- <div class="logo mb25"> |
|
6 |
- <img src="../../../../resources/img/logo2.png" alt="" /> |
|
7 |
- </div> |
|
8 |
- </router-link> |
|
2 |
+ <div id="Chapter2_2" class="content-wrap"> |
|
3 |
+ <div style="margin: 30px 0px 50px; width: 20%"> |
|
4 |
+ <router-link to="/MyPlan.page"> |
|
5 |
+ <div class="logo mb25"> |
|
6 |
+ <img src="../../../../resources/img/logo2.png" alt="" /> |
|
9 | 7 |
</div> |
10 |
- <div class="title-box mb25 flex align-center mt40" style="justify-content: space-between"> |
|
11 |
- <div> |
|
12 |
- <span class="title mr40">1. Hello WORLD</span> |
|
13 |
- <span class="subtitle">my name is dd</span> |
|
14 |
- </div> |
|
15 |
- <button class="completeBtn" @click="complete">학습 종료</button> |
|
16 |
- </div> |
|
17 |
- <div class="flex justify-between align-center"> |
|
18 |
- <div class="pre-btn" @click="goToPage('Chapter2')"> <!-- @click="goToPrevPage" --> |
|
19 |
- <img src="../../../../resources/img/left.png" alt="" /> |
|
20 |
- </div> |
|
21 |
- <div class="content title-box"> |
|
22 |
- <p class="subtitle2"></p> |
|
23 |
- <p class="title mt25 title-bg">STEP 2 - 단어로 공부하는 영어</p> |
|
24 |
- <div class="flex align-center mb30"> |
|
25 |
- <p class="subtitle2 mr20">다음을 듣고 따라 말하세요.</p> |
|
26 |
- <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
27 |
- </button> --> |
|
28 |
- </div> |
|
29 |
- |
|
30 |
- <div class="imgGroup box23"> |
|
31 |
- <div class="con"> |
|
32 |
- <img :src="currentCon.imgSrc" alt="" style="height: 150px;"/> |
|
33 |
- <p class="title3"> |
|
34 |
- <em class="yellow">{{ currentCon.titleEm }}</em |
|
35 |
- >{{ currentCon.title }} |
|
36 |
- </p> |
|
37 |
- <div class="flex align-center justify-center mt10"> |
|
38 |
- <p class="yellow-box-big">{{ currentCon.boxText }}</p> |
|
39 |
- <span class="subtitle3">{{ currentCon.subtitle }}</span> |
|
40 |
- </div> |
|
41 |
- <div class="flex justify-center"> |
|
42 |
- <div class="btnGroup mt50 flex justify-between"> |
|
43 |
- <button |
|
44 |
- class="popTxt" |
|
45 |
- v-for="(item, index) in items" |
|
46 |
- :key="index" |
|
47 |
- @click="updateContent(index)" |
|
48 |
- :class="{ active: selectedIndex === index }" |
|
49 |
- > |
|
50 |
- <img :src="item.imgSrc1" /> |
|
51 |
- <img :src="item.imgSrc2" v-if="selectedIndex === index" style="display: block" /> |
|
52 |
- </button> |
|
53 |
- </div> |
|
54 |
- </div> |
|
55 |
- </div> |
|
56 |
- |
|
57 |
- <div class="flex justify-center"> |
|
58 |
- <div class="readGroup"> |
|
59 |
- <section> |
|
60 |
- <div class="imgGroup flex justify-center"> |
|
61 |
- <!-- 녹음 버튼 --> |
|
62 |
- <div :class="['mic-btn', { notRecording: !isRecording }]" @click="toggleRecording"> |
|
63 |
- <img src="../../../../resources/img/btn11_s.png" alt="" /> |
|
64 |
- </div> |
|
65 |
- </div> |
|
66 |
- <article> |
|
67 |
- <p ref="speakText" class="speakText mb25">위의 버튼을 누른 후 단어를 말해보세요!</p> |
|
68 |
- </article> |
|
69 |
- </section> |
|
70 |
- </div> |
|
71 |
- </div> |
|
72 |
- </div> |
|
73 |
- </div> |
|
74 |
- <div class="next-btn" @click="goToPage('Chapter2_2')"> <!-- @click="goToNextPage" --> |
|
75 |
- <img src="../../../../resources/img/right.png" alt="" /> |
|
76 |
- </div> |
|
77 |
- </div> |
|
8 |
+ </router-link> |
|
78 | 9 |
</div> |
10 |
+ <div |
|
11 |
+ class="title-box mb25 flex align-center mt40" |
|
12 |
+ style="justify-content: space-between" |
|
13 |
+ > |
|
14 |
+ <div> |
|
15 |
+ <span class="title mr40">1. Hello WORLD</span> |
|
16 |
+ <span class="subtitle">my name is dd</span> |
|
17 |
+ </div> |
|
18 |
+ <button class="completeBtn" @click="complete">학습 종료</button> |
|
19 |
+ </div> |
|
20 |
+ <div class="flex justify-between align-center"> |
|
21 |
+ <div class="pre-btn" @click="goToPage('Chapter2')"> |
|
22 |
+ <!-- @click="goToPrevPage" --> |
|
23 |
+ <img src="../../../../resources/img/left.png" alt="" /> |
|
24 |
+ </div> |
|
25 |
+ <div class="content title-box"> |
|
26 |
+ <p class="subtitle2"></p> |
|
27 |
+ <p class="title mt25 title-bg">STEP 2 - 단어로 공부하는 영어</p> |
|
28 |
+ <div class="flex align-center mb30"> |
|
29 |
+ <p class="subtitle2 mr20">다음을 듣고 따라 말하세요.</p> |
|
30 |
+ <!-- <button><img src="../../../../resources/img/btn10_s.png" alt=""> |
|
31 |
+ </button> --> |
|
32 |
+ </div> |
|
33 |
+ |
|
34 |
+ <div class="imgGroup box23"> |
|
35 |
+ <div class="con"> |
|
36 |
+ <img :src="currentCon.imgSrc" alt="" style="height: 150px" /> |
|
37 |
+ <p class="title3"> |
|
38 |
+ <em class="yellow">{{ currentCon.titleEm }}</em |
|
39 |
+ >{{ currentCon.title }} |
|
40 |
+ </p> |
|
41 |
+ <div class="flex align-center justify-center mt10"> |
|
42 |
+ <p class="yellow-box-big">{{ currentCon.boxText }}</p> |
|
43 |
+ <span class="subtitle3">{{ currentCon.subtitle }}</span> |
|
44 |
+ </div> |
|
45 |
+ <div class="flex justify-center"> |
|
46 |
+ <div class="btnGroup mt50 flex justify-between"> |
|
47 |
+ <button |
|
48 |
+ class="popTxt" |
|
49 |
+ v-for="(item, index) in items" |
|
50 |
+ :key="index" |
|
51 |
+ @click="updateContent(index)" |
|
52 |
+ :class="{ active: selectedIndex === index }" |
|
53 |
+ > |
|
54 |
+ <img :src="item.imgSrc1" /> |
|
55 |
+ <img |
|
56 |
+ :src="item.imgSrc2" |
|
57 |
+ v-if="selectedIndex === index" |
|
58 |
+ style="display: block" |
|
59 |
+ /> |
|
60 |
+ </button> |
|
61 |
+ </div> |
|
62 |
+ </div> |
|
63 |
+ </div> |
|
64 |
+ |
|
65 |
+ <div class="flex justify-center"> |
|
66 |
+ <div class="readGroup"> |
|
67 |
+ <section> |
|
68 |
+ <div class="imgGroup flex justify-center"> |
|
69 |
+ <!-- 녹음 버튼 --> |
|
70 |
+ <div |
|
71 |
+ :class="['mic-btn', { notRecording: !isRecording }]" |
|
72 |
+ @click="toggleRecording" |
|
73 |
+ > |
|
74 |
+ <img src="../../../../resources/img/btn11_s.png" alt="" /> |
|
75 |
+ </div> |
|
76 |
+ </div> |
|
77 |
+ <article> |
|
78 |
+ <p ref="speakText" class="speakText mb25"> |
|
79 |
+ 위의 버튼을 누른 후 단어를 말해보세요! |
|
80 |
+ </p> |
|
81 |
+ </article> |
|
82 |
+ </section> |
|
83 |
+ </div> |
|
84 |
+ </div> |
|
85 |
+ </div> |
|
86 |
+ </div> |
|
87 |
+ <div class="next-btn" @click="goToNextPage"> |
|
88 |
+ <!-- @click="goToNextPage" --> |
|
89 |
+ <img src="../../../../resources/img/right.png" alt="" /> |
|
90 |
+ </div> |
|
91 |
+ </div> |
|
92 |
+ </div> |
|
79 | 93 |
</template> |
80 | 94 |
|
81 | 95 |
<script> |
82 |
-import axios from 'axios'; |
|
83 |
-import { mdiStop } from '@mdi/js'; |
|
96 |
+import axios from "axios"; |
|
97 |
+import { mdiStop } from "@mdi/js"; |
|
84 | 98 |
export default { |
85 |
- data() { |
|
86 |
- return { |
|
87 |
- items: [], |
|
88 |
- currentCon: { |
|
89 |
- imgSrc: '', |
|
90 |
- titleEm: '', |
|
91 |
- title: '', |
|
92 |
- boxText: '명', |
|
93 |
- subtitle: '', |
|
94 |
- }, |
|
95 |
- selectedIndex: 0, |
|
96 |
- timer: '00', |
|
97 |
- intervalId: null, |
|
99 |
+ data() { |
|
100 |
+ return { |
|
101 |
+ items: [], |
|
102 |
+ currentCon: { |
|
103 |
+ imgSrc: "", |
|
104 |
+ titleEm: "", |
|
105 |
+ title: "", |
|
106 |
+ boxText: "명", |
|
107 |
+ subtitle: "", |
|
108 |
+ }, |
|
109 |
+ selectedIndex: 0, |
|
110 |
+ timer: "00", |
|
111 |
+ intervalId: null, |
|
98 | 112 |
|
99 |
- isRecording: false, // 녹음 중 여부 |
|
100 |
- mediaRecorder: null, |
|
101 |
- audioChunks: [], // 녹음된 오디오 데이터 |
|
102 |
- audioBlob: null, // 오디오 Blob 객체 |
|
103 |
- stream: null, // MediaStream 객체 |
|
113 |
+ isRecording: false, // 녹음 중 여부 |
|
114 |
+ mediaRecorder: null, |
|
115 |
+ audioChunks: [], // 녹음된 오디오 데이터 |
|
116 |
+ audioBlob: null, // 오디오 Blob 객체 |
|
117 |
+ stream: null, // MediaStream 객체 |
|
104 | 118 |
|
105 |
- path: mdiStop, |
|
106 |
- nowWord: 'cloud', |
|
119 |
+ path: mdiStop, |
|
120 |
+ nowWord: "cloud", |
|
107 | 121 |
|
108 |
- wdBookId: "WORD_BOOK_000000000000043", |
|
109 |
- wdBookIdList: [], // 단어 컨텐츠의 단어장 id 리스트 |
|
110 |
- currentWdBkIndex: 0, // 현재 단어장 인덱스 |
|
111 |
- wdBookTypeIdState: "", // 이동할 페이지 타입 id |
|
112 |
- wordBookType: "", // 이동할 페이지 |
|
113 |
- }; |
|
122 |
+ wdBookId: "WORD_BOOK_000000000000043", |
|
123 |
+ wdBookIdList: [], // 단어 컨텐츠의 단어장 id 리스트 |
|
124 |
+ currentWdBkIndex: 0, // 현재 단어장 인덱스 |
|
125 |
+ wdBookTypeIdState: "", // 이동할 페이지 타입 id |
|
126 |
+ wordBookType: "", // 이동할 페이지 |
|
127 |
+ |
|
128 |
+ seq: this.$store.getters.seqNum, |
|
129 |
+ }; |
|
130 |
+ }, |
|
131 |
+ methods: { |
|
132 |
+ pageSetting() { |
|
133 |
+ this.currentWdBkIndex = this.$store.getters.getCurrentWdBkIndex; // 현재 단어장 인덱스 |
|
134 |
+ this.wdBookIdList = this.$store.getters.getWdBookIdList; // 단어컨텐츠의 단어장 id 리스트 |
|
135 |
+ this.wdBookId = |
|
136 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id |
|
137 |
+ |
|
138 |
+ // this.fetchWordList(); |
|
114 | 139 |
}, |
115 |
- methods: { |
|
116 |
- pageSetting() { |
|
117 |
- this.currentWdBkIndex = this.$store.getters.getCurrentWdBkIndex; // 현재 단어장 인덱스 |
|
118 |
- this.wdBookIdList = this.$store.getters.getWdBookIdList; // 단어컨텐츠의 단어장 id 리스트 |
|
119 |
- this.wdBookId = this.$store.getters.getWdBookIdList[this.currentWdBkIndex] // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id |
|
120 | 140 |
|
121 |
- // this.fetchWordList(); |
|
122 |
- }, |
|
141 |
+ async goToPrevPage() { |
|
142 |
+ if (this.currentWdBkIndex - 1 < 0) { |
|
143 |
+ alert("단어장 첫번째 페이지 입니다"); |
|
144 |
+ } else { |
|
145 |
+ this.currentWdBkIndex--; |
|
146 |
+ this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex); |
|
123 | 147 |
|
124 |
- async goToPrevPage() { |
|
125 |
- if (this.currentWdBkIndex - 1 < 0) { |
|
126 |
- alert("단어장 첫번째 페이지 입니다"); |
|
127 |
- } else { |
|
128 |
- this.currentWdBkIndex--; |
|
129 |
- this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex); |
|
148 |
+ try { |
|
149 |
+ const response = await axios.post("/wordbook/find.json", { |
|
150 |
+ wdBookId: |
|
151 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex], |
|
152 |
+ }); |
|
153 |
+ this.wdBookTypeIdState = response.data.wdBookTypeId; |
|
154 |
+ console.log("이전 단어장 타입 id: ", this.wdBookTypeIdState); |
|
130 | 155 |
|
131 |
- try { |
|
132 |
- const response = await axios.post("/wordbook/find.json", { |
|
133 |
- wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex] |
|
134 |
- }); |
|
135 |
- this.wdBookTypeIdState = response.data.wdBookTypeId; |
|
136 |
- console.log("이전 단어장 타입 id: ", this.wdBookTypeIdState); |
|
156 |
+ switch (this.wdBookTypeIdState) { |
|
157 |
+ case "1": |
|
158 |
+ this.wordBookType = "Chapter2"; |
|
159 |
+ break; |
|
160 |
+ case "2": |
|
161 |
+ this.wordBookType = "Chapter2_3"; |
|
162 |
+ break; |
|
163 |
+ case "3": |
|
164 |
+ this.wordBookType = "Chapter2_2"; |
|
165 |
+ break; |
|
166 |
+ case "4": |
|
167 |
+ this.wordBookType = "Chapter2_9"; |
|
168 |
+ break; |
|
169 |
+ case "5": |
|
170 |
+ this.wordBookType = "Chapter2_4"; |
|
171 |
+ break; |
|
172 |
+ default: |
|
173 |
+ this.wordBookType = null; |
|
174 |
+ } |
|
137 | 175 |
|
138 |
- switch (this.wdBookTypeIdState) { |
|
139 |
- case "1": |
|
140 |
- this.wordBookType = "Chapter2"; |
|
141 |
- break; |
|
142 |
- case "2": |
|
143 |
- this.wordBookType = "Chapter2_3"; |
|
144 |
- break; |
|
145 |
- case "3": |
|
146 |
- this.wordBookType = "Chapter2_2"; |
|
147 |
- break; |
|
148 |
- case "4": |
|
149 |
- this.wordBookType = "Chapter2_9"; |
|
150 |
- break; |
|
151 |
- case "5": |
|
152 |
- this.wordBookType = "Chapter2_4"; |
|
153 |
- break; |
|
154 |
- default: |
|
155 |
- this.wordBookType = null; |
|
156 |
- } |
|
157 |
- |
|
158 |
- this.goToPage(this.wordBookType); |
|
159 |
- } catch (error) { |
|
160 |
- console.error('단어장 정보 불러오는 중 오류 발생:', error); |
|
161 |
- } |
|
162 |
- } |
|
163 |
- }, |
|
164 |
- |
|
165 |
- async goToNextPage() { |
|
166 |
- if (this.currentWdBkIndex + 1 >= this.wdBookIdList.length) { |
|
167 |
- alert("단어장 마지막 페이지 입니다"); |
|
168 |
- } else { |
|
169 |
- this.currentWdBkIndex++; |
|
170 |
- this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex); |
|
171 |
- |
|
172 |
- try { |
|
173 |
- const response = await axios.post("/wordbook/find.json", { |
|
174 |
- wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex] |
|
175 |
- }); |
|
176 |
- this.wdBookTypeIdState = response.data.wdBookTypeId; |
|
177 |
- console.log("다음 단어장 타입 id: ", this.wdBookTypeIdState); |
|
178 |
- |
|
179 |
- switch (this.wdBookTypeIdState) { |
|
180 |
- case "1": |
|
181 |
- this.wordBookType = "Chapter2"; |
|
182 |
- break; |
|
183 |
- case "2": |
|
184 |
- this.wordBookType = "Chapter2_3"; |
|
185 |
- break; |
|
186 |
- case "3": |
|
187 |
- this.wordBookType = "Chapter2_2"; |
|
188 |
- break; |
|
189 |
- case "4": |
|
190 |
- this.wordBookType = "Chapter2_9"; |
|
191 |
- break; |
|
192 |
- case "5": |
|
193 |
- this.wordBookType = "Chapter2_4"; |
|
194 |
- break; |
|
195 |
- default: |
|
196 |
- this.wordBookType = null; |
|
197 |
- } |
|
198 |
- |
|
199 |
- this.goToPage(this.wordBookType); |
|
200 |
- } catch (error) { |
|
201 |
- console.error('단어장 정보 불러오는 중 오류 발생:', error); |
|
202 |
- } |
|
203 |
- } |
|
204 |
- }, |
|
205 |
- |
|
206 |
- complete() { |
|
207 |
- const { unit_id, book_id } = this.$route.query; |
|
208 |
- this.$router.push({ name: 'Dashboard', query: { value: 2, unit_id, book_id } }); |
|
209 |
- }, |
|
210 |
- goToPage(page) { |
|
211 |
- this.$router.push({ name: page }); |
|
212 |
- }, |
|
213 |
- updateContent(index) { |
|
214 |
- this.selectedIndex = index; |
|
215 |
- this.currentCon = this.items[index].con; |
|
216 |
- console.log(this.currentCon.imgSrc); |
|
217 |
- this.startTimer(); |
|
218 |
- }, |
|
219 |
- startTimer() { |
|
220 |
- if (this.intervalId) { |
|
221 |
- clearInterval(this.intervalId); |
|
222 |
- } |
|
223 |
- this.timer = 5; |
|
224 |
- this.intervalId = setInterval(() => { |
|
225 |
- if (this.timer > 0) { |
|
226 |
- this.timer--; |
|
227 |
- } else { |
|
228 |
- clearInterval(this.intervalId); |
|
229 |
- } |
|
230 |
- }, 1000); |
|
231 |
- }, |
|
232 |
- // 녹음 시작/중지 토글 |
|
233 |
- async toggleRecording() { |
|
234 |
- if (this.isRecording) { |
|
235 |
- console.log('녹음 그만!'); |
|
236 |
- this.stopRecording(); // 녹음 중이면 중지 |
|
237 |
- } else { |
|
238 |
- console.log('녹음 시작!'); |
|
239 |
- await this.startRecording(); // 녹음 중이 아니면 녹음 시작 |
|
240 |
- } |
|
241 |
- }, |
|
242 |
- // 녹음 시작 |
|
243 |
- async startRecording() { |
|
244 |
- this.audioChunks = []; // 오디오 초기화 |
|
245 |
- this.stream = await navigator.mediaDevices.getUserMedia({ audio: true }); |
|
246 |
- this.mediaRecorder = new MediaRecorder(this.stream); |
|
247 |
- this.mediaRecorder.ondataavailable = (event) => { |
|
248 |
- this.audioChunks.push(event.data); // 녹음 데이터 저장 |
|
249 |
- }; |
|
250 |
- this.mediaRecorder.onstop = () => { |
|
251 |
- this.audioBlob = new Blob(this.audioChunks, { type: 'audio/wav' }); |
|
252 |
- |
|
253 |
- /******************************/ |
|
254 |
- // this.audioURL = URL.createObjectURL(this.audioBlob); // 오디오 URL 생성 |
|
255 |
- // console.log('Audio URL:', this.audioURL); |
|
256 |
- /******************************/ |
|
257 |
- |
|
258 |
- console.log('Recorded Audio Blob:', this.audioBlob); // 콘솔에 Blob 확인 |
|
259 |
- this.sendAudioToServer(); // 서버로 오디오 전송 |
|
260 |
- }; |
|
261 |
- this.mediaRecorder.start(); // 녹음 시작 |
|
262 |
- this.isRecording = true; // 녹음 상태 변경 |
|
263 |
- }, |
|
264 |
- |
|
265 |
- // 녹음 중지 |
|
266 |
- stopRecording() { |
|
267 |
- this.mediaRecorder.stop(); // 녹음 중단 |
|
268 |
- |
|
269 |
- if (this.stream) { |
|
270 |
- this.stream.getTracks().forEach((track) => track.stop()); // 스트림의 모든 트랙 중지 |
|
271 |
- } |
|
272 |
- |
|
273 |
- this.isRecording = false; // 녹음 상태 변경 |
|
274 |
- }, |
|
275 |
- |
|
276 |
- // 오디오 전송 |
|
277 |
- async sendAudioToServer() { |
|
278 |
- const formData = new FormData(); |
|
279 |
- formData.append('file', this.audioBlob, 'recording.wav'); |
|
280 |
- try { |
|
281 |
- const response = await axios.post('/api/speechToText.json', formData, { |
|
282 |
- headers: { |
|
283 |
- 'Content-Type': 'multipart/form-data', |
|
284 |
- }, |
|
285 |
- }); |
|
286 |
- |
|
287 |
- this.transcription = response.data.trim().toLowerCase(); |
|
288 |
- this.nowWord = this.nowWord.toLowerCase(); |
|
289 |
- |
|
290 |
- console.log('지금 단어: ', this.nowWord); |
|
291 |
- console.log('녹음 결과: ', this.transcription); |
|
292 |
- |
|
293 |
- if (this.transcription === this.nowWord) { |
|
294 |
- this.$refs.speakText.innerText = '정답입니다! 잘했어요'; |
|
295 |
- } else { |
|
296 |
- this.$refs.speakText.innerText = '다시 말해보세요!'; |
|
297 |
- } |
|
298 |
- } catch (error) { |
|
299 |
- console.log('파일 전송 실패: ', error); |
|
300 |
- } |
|
301 |
- }, |
|
302 |
- |
|
303 |
- // 단어 리스트를 서버에서 받아와 items에 적용하는 메서드 |
|
304 |
- async fetchWordList() { |
|
305 |
- try { |
|
306 |
- const response = await axios.post('/word/getWordsByBookId.json', { |
|
307 |
- wdBookId: this.wdBookId, |
|
308 |
- }); |
|
309 |
- |
|
310 |
- this.wordList = response.data; |
|
311 |
- |
|
312 |
- const requests = this.wordList.map(async (word, index) => { |
|
313 |
- // fileRpath를 받아오기 위한 요청 |
|
314 |
- const fileResponse = await axios.post('/file/find.json', { |
|
315 |
- file_mng_id: word.fileMngId, |
|
316 |
- }); |
|
317 |
- |
|
318 |
- // fileResponse.data.list에서 fileRpath 값을 추출하여 imgSrc에 설정 |
|
319 |
- const fileRpath = fileResponse.data.list.length > 0 ? fileResponse.data.list[0].fileRpath : null; |
|
320 |
- const imgSrc = fileRpath ? `http://165.229.169.113:9080/${fileRpath}` : ''; |
|
321 |
- |
|
322 |
- return { |
|
323 |
- imgSrc1: `client/resources/img/img53_${6 + index}_35s.png`, |
|
324 |
- imgSrc2: `client/resources/img/img53_${1 + index}_35s.png`, |
|
325 |
- con: { |
|
326 |
- imgSrc, // fileRpath를 imgSrc에 설정 |
|
327 |
- titleEm: word.wdNm.charAt(0), // 단어의 첫 글자 |
|
328 |
- title: word.wdNm.slice(1), // 단어의 나머지 부분 |
|
329 |
- boxText: '명', |
|
330 |
- subtitle: word.wdMnng, // 단어의 의미 |
|
331 |
- }, |
|
332 |
- }; |
|
333 |
- }); |
|
334 |
- |
|
335 |
- // 모든 요청이 완료될 때까지 대기 |
|
336 |
- this.items = await Promise.all(requests); |
|
337 |
- |
|
338 |
- // items 리스트의 첫 번째 항목을 currentCon에 설정 |
|
339 |
- if (this.items.length > 0) { |
|
340 |
- this.currentCon = this.items[0].con; |
|
341 |
- this.nowWord = this.currentCon.titleEm + this.currentCon.title; |
|
342 |
- } |
|
343 |
- |
|
344 |
- } catch (error) { |
|
345 |
- console.error('단어 목록을 불러오는 중 오류 발생:', error); |
|
346 |
- } |
|
347 |
- }, |
|
348 |
- |
|
349 |
- }, |
|
350 |
- watch: { |
|
351 |
- transcription: null, // 서버에서 받아온 텍스트 결과 |
|
352 |
- currentCon: { |
|
353 |
- handler(newValue) { |
|
354 |
- // Update nowWord when currentCon changes |
|
355 |
- this.nowWord = newValue.titleEm + newValue.title; |
|
356 |
- }, |
|
357 |
- deep: true, // Watch for deep changes in currentCon |
|
358 |
- }, |
|
359 |
- }, |
|
360 |
- mounted() { |
|
361 |
- // this.pageSetting(); |
|
362 |
- this.fetchWordList(); |
|
363 |
- }, |
|
364 |
- beforeDestroy() { |
|
365 |
- if (this.intervalId) { |
|
366 |
- clearInterval(this.intervalId); |
|
176 |
+ this.goToPage(this.wordBookType); |
|
177 |
+ } catch (error) { |
|
178 |
+ console.error("단어장 정보 불러오는 중 오류 발생:", error); |
|
367 | 179 |
} |
180 |
+ } |
|
368 | 181 |
}, |
182 |
+ |
|
183 |
+ async goToNextPage() { |
|
184 |
+ if (this.currentWdBkIndex + 1 >= this.wdBookIdList.length) { |
|
185 |
+ alert("단어장 마지막 페이지 입니다"); |
|
186 |
+ } else { |
|
187 |
+ this.currentWdBkIndex++; |
|
188 |
+ this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex); |
|
189 |
+ |
|
190 |
+ try { |
|
191 |
+ const response = await axios.post("/wordbook/find.json", { |
|
192 |
+ wdBookId: |
|
193 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex], |
|
194 |
+ }); |
|
195 |
+ this.wdBookTypeIdState = response.data.wdBookTypeId; |
|
196 |
+ console.log("다음 단어장 타입 id: ", this.wdBookTypeIdState); |
|
197 |
+ |
|
198 |
+ switch (this.wdBookTypeIdState) { |
|
199 |
+ case "1": |
|
200 |
+ this.wordBookType = "Chapter2"; |
|
201 |
+ break; |
|
202 |
+ case "2": |
|
203 |
+ this.wordBookType = "Chapter2_3"; |
|
204 |
+ break; |
|
205 |
+ case "3": |
|
206 |
+ this.wordBookType = "Chapter2_2"; |
|
207 |
+ break; |
|
208 |
+ case "4": |
|
209 |
+ this.wordBookType = "Chapter2_9"; |
|
210 |
+ break; |
|
211 |
+ case "5": |
|
212 |
+ this.wordBookType = "Chapter2_4"; |
|
213 |
+ break; |
|
214 |
+ default: |
|
215 |
+ this.wordBookType = null; |
|
216 |
+ } |
|
217 |
+ |
|
218 |
+ this.goToPage(this.wordBookType); |
|
219 |
+ } catch (error) { |
|
220 |
+ console.error("단어장 정보 불러오는 중 오류 발생:", error); |
|
221 |
+ } |
|
222 |
+ } |
|
223 |
+ }, |
|
224 |
+ |
|
225 |
+ complete() { |
|
226 |
+ const { unit_id, book_id } = this.$route.query; |
|
227 |
+ this.$router.push({ |
|
228 |
+ name: "Dashboard", |
|
229 |
+ query: { value: this.seq, unit_id, book_id }, |
|
230 |
+ }); |
|
231 |
+ }, |
|
232 |
+ goToPage(page) { |
|
233 |
+ this.$router.push({ name: page }); |
|
234 |
+ }, |
|
235 |
+ updateContent(index) { |
|
236 |
+ this.selectedIndex = index; |
|
237 |
+ this.currentCon = this.items[index].con; |
|
238 |
+ console.log(this.currentCon.imgSrc); |
|
239 |
+ this.startTimer(); |
|
240 |
+ }, |
|
241 |
+ startTimer() { |
|
242 |
+ if (this.intervalId) { |
|
243 |
+ clearInterval(this.intervalId); |
|
244 |
+ } |
|
245 |
+ this.timer = 5; |
|
246 |
+ this.intervalId = setInterval(() => { |
|
247 |
+ if (this.timer > 0) { |
|
248 |
+ this.timer--; |
|
249 |
+ } else { |
|
250 |
+ clearInterval(this.intervalId); |
|
251 |
+ } |
|
252 |
+ }, 1000); |
|
253 |
+ }, |
|
254 |
+ // 녹음 시작/중지 토글 |
|
255 |
+ async toggleRecording() { |
|
256 |
+ if (this.isRecording) { |
|
257 |
+ console.log("녹음 그만!"); |
|
258 |
+ this.stopRecording(); // 녹음 중이면 중지 |
|
259 |
+ } else { |
|
260 |
+ console.log("녹음 시작!"); |
|
261 |
+ await this.startRecording(); // 녹음 중이 아니면 녹음 시작 |
|
262 |
+ } |
|
263 |
+ }, |
|
264 |
+ // 녹음 시작 |
|
265 |
+ async startRecording() { |
|
266 |
+ this.audioChunks = []; // 오디오 초기화 |
|
267 |
+ this.stream = await navigator.mediaDevices.getUserMedia({ audio: true }); |
|
268 |
+ this.mediaRecorder = new MediaRecorder(this.stream); |
|
269 |
+ this.mediaRecorder.ondataavailable = (event) => { |
|
270 |
+ this.audioChunks.push(event.data); // 녹음 데이터 저장 |
|
271 |
+ }; |
|
272 |
+ this.mediaRecorder.onstop = () => { |
|
273 |
+ this.audioBlob = new Blob(this.audioChunks, { type: "audio/wav" }); |
|
274 |
+ |
|
275 |
+ /******************************/ |
|
276 |
+ // this.audioURL = URL.createObjectURL(this.audioBlob); // 오디오 URL 생성 |
|
277 |
+ // console.log('Audio URL:', this.audioURL); |
|
278 |
+ /******************************/ |
|
279 |
+ |
|
280 |
+ console.log("Recorded Audio Blob:", this.audioBlob); // 콘솔에 Blob 확인 |
|
281 |
+ this.sendAudioToServer(); // 서버로 오디오 전송 |
|
282 |
+ }; |
|
283 |
+ this.mediaRecorder.start(); // 녹음 시작 |
|
284 |
+ this.isRecording = true; // 녹음 상태 변경 |
|
285 |
+ }, |
|
286 |
+ |
|
287 |
+ // 녹음 중지 |
|
288 |
+ stopRecording() { |
|
289 |
+ this.mediaRecorder.stop(); // 녹음 중단 |
|
290 |
+ |
|
291 |
+ if (this.stream) { |
|
292 |
+ this.stream.getTracks().forEach((track) => track.stop()); // 스트림의 모든 트랙 중지 |
|
293 |
+ } |
|
294 |
+ |
|
295 |
+ this.isRecording = false; // 녹음 상태 변경 |
|
296 |
+ }, |
|
297 |
+ |
|
298 |
+ // 오디오 전송 |
|
299 |
+ async sendAudioToServer() { |
|
300 |
+ const formData = new FormData(); |
|
301 |
+ formData.append("file", this.audioBlob, "recording.wav"); |
|
302 |
+ try { |
|
303 |
+ const response = await axios.post("/api/speechToText.json", formData, { |
|
304 |
+ headers: { |
|
305 |
+ "Content-Type": "multipart/form-data", |
|
306 |
+ }, |
|
307 |
+ }); |
|
308 |
+ |
|
309 |
+ this.transcription = response.data.trim().toLowerCase(); |
|
310 |
+ this.nowWord = this.nowWord.toLowerCase(); |
|
311 |
+ |
|
312 |
+ console.log("지금 단어: ", this.nowWord); |
|
313 |
+ console.log("녹음 결과: ", this.transcription); |
|
314 |
+ |
|
315 |
+ if (this.transcription === this.nowWord) { |
|
316 |
+ this.$refs.speakText.innerText = "정답입니다! 잘했어요"; |
|
317 |
+ } else { |
|
318 |
+ this.$refs.speakText.innerText = "다시 말해보세요!"; |
|
319 |
+ } |
|
320 |
+ } catch (error) { |
|
321 |
+ console.log("파일 전송 실패: ", error); |
|
322 |
+ } |
|
323 |
+ }, |
|
324 |
+ |
|
325 |
+ // 단어 리스트를 서버에서 받아와 items에 적용하는 메서드 |
|
326 |
+ async fetchWordList() { |
|
327 |
+ try { |
|
328 |
+ const response = await axios.post("/word/getWordsByBookId.json", { |
|
329 |
+ wdBookId: this.wdBookId, |
|
330 |
+ }); |
|
331 |
+ |
|
332 |
+ this.wordList = response.data; |
|
333 |
+ |
|
334 |
+ const requests = this.wordList.map(async (word, index) => { |
|
335 |
+ // fileRpath를 받아오기 위한 요청 |
|
336 |
+ const fileResponse = await axios.post("/file/find.json", { |
|
337 |
+ file_mng_id: word.fileMngId, |
|
338 |
+ }); |
|
339 |
+ |
|
340 |
+ // fileResponse.data.list에서 fileRpath 값을 추출하여 imgSrc에 설정 |
|
341 |
+ const fileRpath = |
|
342 |
+ fileResponse.data.list.length > 0 |
|
343 |
+ ? fileResponse.data.list[0].fileRpath |
|
344 |
+ : null; |
|
345 |
+ const imgSrc = fileRpath |
|
346 |
+ ? `http://165.229.169.113:9080/${fileRpath}` |
|
347 |
+ : ""; |
|
348 |
+ |
|
349 |
+ return { |
|
350 |
+ imgSrc1: `client/resources/img/img53_${6 + index}_35s.png`, |
|
351 |
+ imgSrc2: `client/resources/img/img53_${1 + index}_35s.png`, |
|
352 |
+ con: { |
|
353 |
+ imgSrc, // fileRpath를 imgSrc에 설정 |
|
354 |
+ titleEm: word.wdNm.charAt(0), // 단어의 첫 글자 |
|
355 |
+ title: word.wdNm.slice(1), // 단어의 나머지 부분 |
|
356 |
+ boxText: "명", |
|
357 |
+ subtitle: word.wdMnng, // 단어의 의미 |
|
358 |
+ }, |
|
359 |
+ }; |
|
360 |
+ }); |
|
361 |
+ |
|
362 |
+ // 모든 요청이 완료될 때까지 대기 |
|
363 |
+ this.items = await Promise.all(requests); |
|
364 |
+ |
|
365 |
+ // items 리스트의 첫 번째 항목을 currentCon에 설정 |
|
366 |
+ if (this.items.length > 0) { |
|
367 |
+ this.currentCon = this.items[0].con; |
|
368 |
+ this.nowWord = this.currentCon.titleEm + this.currentCon.title; |
|
369 |
+ } |
|
370 |
+ } catch (error) { |
|
371 |
+ console.error("단어 목록을 불러오는 중 오류 발생:", error); |
|
372 |
+ } |
|
373 |
+ }, |
|
374 |
+ }, |
|
375 |
+ watch: { |
|
376 |
+ transcription: null, // 서버에서 받아온 텍스트 결과 |
|
377 |
+ currentCon: { |
|
378 |
+ handler(newValue) { |
|
379 |
+ // Update nowWord when currentCon changes |
|
380 |
+ this.nowWord = newValue.titleEm + newValue.title; |
|
381 |
+ }, |
|
382 |
+ deep: true, // Watch for deep changes in currentCon |
|
383 |
+ }, |
|
384 |
+ }, |
|
385 |
+ mounted() { |
|
386 |
+ // this.pageSetting(); |
|
387 |
+ this.fetchWordList(); |
|
388 |
+ }, |
|
389 |
+ beforeDestroy() { |
|
390 |
+ if (this.intervalId) { |
|
391 |
+ clearInterval(this.intervalId); |
|
392 |
+ } |
|
393 |
+ }, |
|
369 | 394 |
}; |
370 | 395 |
</script> |
371 | 396 |
|
372 | 397 |
<style scoped> |
373 | 398 |
.popTxt img { |
374 |
- position: absolute; |
|
375 |
- top: 0; |
|
376 |
- left: 0; |
|
399 |
+ position: absolute; |
|
400 |
+ top: 0; |
|
401 |
+ left: 0; |
|
377 | 402 |
} |
378 | 403 |
|
379 | 404 |
.box23 { |
380 |
- display: flex; |
|
381 |
- align-items: center; |
|
382 |
- gap: 80px; |
|
383 |
- justify-content: center; |
|
405 |
+ display: flex; |
|
406 |
+ align-items: center; |
|
407 |
+ gap: 80px; |
|
408 |
+ justify-content: center; |
|
384 | 409 |
} |
385 | 410 |
|
386 | 411 |
.mic-btn { |
387 |
- cursor: pointer; |
|
412 |
+ cursor: pointer; |
|
388 | 413 |
} |
389 | 414 |
|
390 | 415 |
.mic-btn.notRecording { |
391 |
- background-image: none; |
|
392 |
- cursor: pointer; |
|
416 |
+ background-image: none; |
|
417 |
+ cursor: pointer; |
|
393 | 418 |
} |
394 | 419 |
|
395 | 420 |
.speakText { |
396 |
- background-color: #fff8e9; |
|
397 |
- border: 0; |
|
421 |
+ background-color: #fff8e9; |
|
422 |
+ border: 0; |
|
398 | 423 |
} |
399 | 424 |
|
400 | 425 |
.speakText span { |
401 |
- font-size: 28px; |
|
426 |
+ font-size: 28px; |
|
402 | 427 |
} |
403 | 428 |
|
404 | 429 |
.completeBtn { |
405 |
- margin-right: 100px; |
|
406 |
- background-color: #ffba08; |
|
407 |
- padding: 10px 30px; |
|
408 |
- border-radius: 10px; |
|
409 |
- font-size: 28px; |
|
410 |
- font-family: 'ONEMobilePOPOTF'; |
|
430 |
+ margin-right: 100px; |
|
431 |
+ background-color: #ffba08; |
|
432 |
+ padding: 10px 30px; |
|
433 |
+ border-radius: 10px; |
|
434 |
+ font-size: 28px; |
|
435 |
+ font-family: "ONEMobilePOPOTF"; |
|
411 | 436 |
} |
412 | 437 |
</style> |
--- client/views/pages/main/Chapter/Chapter2_4.vue
+++ client/views/pages/main/Chapter/Chapter2_4.vue
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 |
/> |
48 | 48 |
<div class="textbox"> |
49 | 49 |
<div style="height: 80%; line-height: 200px"> |
50 |
- <img :src="item.imgSrc" alt="" style="width: 120px;" /> |
|
50 |
+ <img :src="item.imgSrc" alt="" style="width: 120px" /> |
|
51 | 51 |
</div> |
52 | 52 |
<p class="subtitle3" style="height: 20%">{{ item.title }}</p> |
53 | 53 |
</div> |
... | ... | @@ -90,20 +90,23 @@ |
90 | 90 |
currentWdBkIndex: 0, // 현재 단어장 인덱스 |
91 | 91 |
wdBookTypeIdState: "", // 이동할 페이지 타입 id |
92 | 92 |
wordBookType: "", // 이동할 페이지 |
93 |
+ |
|
94 |
+ seq: this.$store.getters.seqNum, |
|
93 | 95 |
}; |
94 | 96 |
}, |
95 | 97 |
methods: { |
96 | 98 |
pageSetting() { |
97 | 99 |
this.currentWdBkIndex = this.$store.getters.getCurrentWdBkIndex; // 현재 단어장 인덱스 |
98 | 100 |
this.wdBookIdList = this.$store.getters.getWdBookIdList; // 단어컨텐츠의 단어장 id 리스트 |
99 |
- this.wdBookId = this.$store.getters.getWdBookIdList[this.currentWdBkIndex] // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id |
|
101 |
+ this.wdBookId = |
|
102 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id |
|
100 | 103 |
|
101 | 104 |
this.fetchWordList(); |
102 | 105 |
}, |
103 |
- |
|
106 |
+ |
|
104 | 107 |
async fetchWordList() { |
105 | 108 |
try { |
106 |
- const response = await axios.post('/word/getWordsByBookId.json', { |
|
109 |
+ const response = await axios.post("/word/getWordsByBookId.json", { |
|
107 | 110 |
wdBookId: this.wdBookId, |
108 | 111 |
}); |
109 | 112 |
|
... | ... | @@ -115,7 +118,10 @@ |
115 | 118 |
file_mng_id: word.fileMngId, |
116 | 119 |
}); |
117 | 120 |
|
118 |
- const fileRpath = fileResponse.data.list.length > 0 ? fileResponse.data.list[0].fileRpath : null; |
|
121 |
+ const fileRpath = |
|
122 |
+ fileResponse.data.list.length > 0 |
|
123 |
+ ? fileResponse.data.list[0].fileRpath |
|
124 |
+ : null; |
|
119 | 125 |
console.log("각 단어의 fileRpath: ", fileRpath); |
120 | 126 |
|
121 | 127 |
// items 배열에 새로운 항목 추가 |
... | ... | @@ -129,9 +135,8 @@ |
129 | 135 |
|
130 | 136 |
// 모든 요청이 완료될 때까지 대기 |
131 | 137 |
await Promise.all(requests); |
132 |
- |
|
133 | 138 |
} catch (error) { |
134 |
- console.error('단어 목록을 불러오는 중 오류 발생:', error); |
|
139 |
+ console.error("단어 목록을 불러오는 중 오류 발생:", error); |
|
135 | 140 |
} |
136 | 141 |
}, |
137 | 142 |
|
... | ... | @@ -140,38 +145,39 @@ |
140 | 145 |
alert("단어장 첫번째 페이지 입니다"); |
141 | 146 |
} else { |
142 | 147 |
this.currentWdBkIndex--; |
143 |
- this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex); |
|
148 |
+ this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex); |
|
144 | 149 |
|
145 | 150 |
try { |
146 | 151 |
const response = await axios.post("/wordbook/find.json", { |
147 |
- wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex] |
|
152 |
+ wdBookId: |
|
153 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex], |
|
148 | 154 |
}); |
149 | 155 |
this.wdBookTypeIdState = response.data.wdBookTypeId; |
150 | 156 |
console.log("이전 단어장 타입 id: ", this.wdBookTypeIdState); |
151 | 157 |
|
152 | 158 |
switch (this.wdBookTypeIdState) { |
153 | 159 |
case "1": |
154 |
- this.wordBookType = "Chapter2"; |
|
155 |
- break; |
|
160 |
+ this.wordBookType = "Chapter2"; |
|
161 |
+ break; |
|
156 | 162 |
case "2": |
157 |
- this.wordBookType = "Chapter2_3"; |
|
158 |
- break; |
|
163 |
+ this.wordBookType = "Chapter2_3"; |
|
164 |
+ break; |
|
159 | 165 |
case "3": |
160 |
- this.wordBookType = "Chapter2_2"; |
|
161 |
- break; |
|
166 |
+ this.wordBookType = "Chapter2_2"; |
|
167 |
+ break; |
|
162 | 168 |
case "4": |
163 |
- this.wordBookType = "Chapter2_9"; |
|
164 |
- break; |
|
169 |
+ this.wordBookType = "Chapter2_9"; |
|
170 |
+ break; |
|
165 | 171 |
case "5": |
166 |
- this.wordBookType = "Chapter2_4"; |
|
167 |
- break; |
|
172 |
+ this.wordBookType = "Chapter2_4"; |
|
173 |
+ break; |
|
168 | 174 |
default: |
169 |
- this.wordBookType = null; |
|
175 |
+ this.wordBookType = null; |
|
170 | 176 |
} |
171 |
- |
|
172 |
- this.goToPage(this.wordBookType); |
|
177 |
+ |
|
178 |
+ this.goToPage(this.wordBookType); |
|
173 | 179 |
} catch (error) { |
174 |
- console.error('단어장 정보 불러오는 중 오류 발생:', error); |
|
180 |
+ console.error("단어장 정보 불러오는 중 오류 발생:", error); |
|
175 | 181 |
} |
176 | 182 |
} |
177 | 183 |
}, |
... | ... | @@ -179,48 +185,54 @@ |
179 | 185 |
async goToNextPage() { |
180 | 186 |
if (this.currentWdBkIndex + 1 >= this.wdBookIdList.length) { |
181 | 187 |
alert("단어장 마지막 페이지 입니다"); |
188 |
+ this.complete(); |
|
182 | 189 |
} else { |
183 | 190 |
this.currentWdBkIndex++; |
184 |
- this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex); |
|
191 |
+ this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex); |
|
185 | 192 |
|
186 | 193 |
try { |
187 | 194 |
const response = await axios.post("/wordbook/find.json", { |
188 |
- wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex] |
|
195 |
+ wdBookId: |
|
196 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex], |
|
189 | 197 |
}); |
190 | 198 |
this.wdBookTypeIdState = response.data.wdBookTypeId; |
191 | 199 |
console.log("다음 단어장 타입 id: ", this.wdBookTypeIdState); |
192 | 200 |
|
193 | 201 |
switch (this.wdBookTypeIdState) { |
194 | 202 |
case "1": |
195 |
- this.wordBookType = "Chapter2"; |
|
196 |
- break; |
|
203 |
+ this.wordBookType = "Chapter2"; |
|
204 |
+ break; |
|
197 | 205 |
case "2": |
198 |
- this.wordBookType = "Chapter2_3"; |
|
199 |
- break; |
|
206 |
+ this.wordBookType = "Chapter2_3"; |
|
207 |
+ break; |
|
200 | 208 |
case "3": |
201 |
- this.wordBookType = "Chapter2_2"; |
|
202 |
- break; |
|
209 |
+ this.wordBookType = "Chapter2_2"; |
|
210 |
+ break; |
|
203 | 211 |
case "4": |
204 |
- this.wordBookType = "Chapter2_9"; |
|
205 |
- break; |
|
212 |
+ this.wordBookType = "Chapter2_9"; |
|
213 |
+ break; |
|
206 | 214 |
case "5": |
207 |
- this.wordBookType = "Chapter2_4"; |
|
208 |
- break; |
|
215 |
+ this.wordBookType = "Chapter2_4"; |
|
216 |
+ break; |
|
209 | 217 |
default: |
210 |
- this.wordBookType = null; |
|
218 |
+ this.wordBookType = null; |
|
211 | 219 |
} |
212 |
- |
|
213 |
- this.goToPage(this.wordBookType); |
|
220 |
+ |
|
221 |
+ this.goToPage(this.wordBookType); |
|
214 | 222 |
} catch (error) { |
215 |
- console.error('단어장 정보 불러오는 중 오류 발생:', error); |
|
223 |
+ console.error("단어장 정보 불러오는 중 오류 발생:", error); |
|
216 | 224 |
} |
217 | 225 |
} |
218 | 226 |
}, |
219 | 227 |
|
220 | 228 |
complete() { |
221 | 229 |
const { unit_id, book_id } = this.$route.query; |
222 |
- this.$router.push({ name: 'Dashboard', query: { value: 2, unit_id, book_id } }); |
|
230 |
+ this.$router.push({ |
|
231 |
+ name: "Dashboard", |
|
232 |
+ query: { value: this.seq, unit_id, book_id }, |
|
233 |
+ }); |
|
223 | 234 |
}, |
235 |
+ |
|
224 | 236 |
goToPage(page) { |
225 | 237 |
this.$router.push({ name: page }); |
226 | 238 |
}, |
--- client/views/pages/main/Chapter/Chapter2_5.vue
+++ client/views/pages/main/Chapter/Chapter2_5.vue
... | ... | @@ -7,14 +7,15 @@ |
7 | 7 |
</div> |
8 | 8 |
</router-link> |
9 | 9 |
</div> |
10 |
- <div class="title-box mb25 flex align-center mt40" style=" |
|
11 |
- justify-content: space-between; |
|
12 |
-"> |
|
10 |
+ <div |
|
11 |
+ class="title-box mb25 flex align-center mt40" |
|
12 |
+ style="justify-content: space-between" |
|
13 |
+ > |
|
13 | 14 |
<div> |
14 | 15 |
<span class="title mr40">1. Hello WORLD</span> |
15 | 16 |
<span class="subtitle">my name is dd</span> |
16 | 17 |
</div> |
17 |
- <button class="completeBtn" @click="complete"> 학습 종료 </button> |
|
18 |
+ <button class="completeBtn" @click="complete">학습 종료</button> |
|
18 | 19 |
</div> |
19 | 20 |
<div class="flex justify-between align-center"> |
20 | 21 |
<div class="pre-btn" @click="previousProblem()"> |
... | ... | @@ -38,7 +39,12 @@ |
38 | 39 |
<!-- <p class="title1 mb40" style="color: #464749;">The sun rises in the east and sets in the west. It is very hot during summer.</p> |
39 | 40 |
<img src="../../../../resources/img/img65_37s.png" alt=""> --> |
40 | 41 |
|
41 |
- <img class="exampleImg" :src="imgUrl" reloadable="true" alt="example img" /> |
|
42 |
+ <img |
|
43 |
+ class="exampleImg" |
|
44 |
+ :src="imgUrl" |
|
45 |
+ reloadable="true" |
|
46 |
+ alt="example img" |
|
47 |
+ /> |
|
42 | 48 |
|
43 | 49 |
<!-- 정답 칸 --> |
44 | 50 |
<div class="dropGroup flex align-center justify-center mt30"> |
... | ... | @@ -46,10 +52,22 @@ |
46 | 52 |
|
47 | 53 |
<!-- 드롭 가능한 영역 --> |
48 | 54 |
<div class="dropContainer" id="targetContainer"> |
49 |
- <div v-for="(slot, index) in answerLength" :key="index" class="dropSlot" @dragover.prevent |
|
50 |
- @drop="onDrop($event, index)"> |
|
51 |
- <div class="dropSlot-inner" draggable="true" @dragstart="onDragStart($event, userAnswer[index], index)"> |
|
52 |
- <img src="../../../../resources/img/img64_37s.png" alt="answer slot" /> |
|
55 |
+ <div |
|
56 |
+ v-for="(slot, index) in answerLength" |
|
57 |
+ :key="index" |
|
58 |
+ class="dropSlot" |
|
59 |
+ @dragover.prevent |
|
60 |
+ @drop="onDrop($event, index)" |
|
61 |
+ > |
|
62 |
+ <div |
|
63 |
+ class="dropSlot-inner" |
|
64 |
+ draggable="true" |
|
65 |
+ @dragstart="onDragStart($event, userAnswer[index], index)" |
|
66 |
+ > |
|
67 |
+ <img |
|
68 |
+ src="../../../../resources/img/img64_37s.png" |
|
69 |
+ alt="answer slot" |
|
70 |
+ /> |
|
53 | 71 |
<div v-if="userAnswer[index]" class="dropped-char"> |
54 | 72 |
{{ userAnswer[index].toUpperCase() }} |
55 | 73 |
</div> |
... | ... | @@ -62,9 +80,16 @@ |
62 | 80 |
|
63 | 81 |
<!-- 드래그 가능한 버튼 --> |
64 | 82 |
<div class="dragGroup mt40" id="sourceContainer"> |
65 |
- <button v-for="(char, index) in choiceCharacters" :key="index" draggable="true" |
|
66 |
- @dragstart="onDragStart($event, char)"> |
|
67 |
- <img src="../../../../resources/img/img63_37s_2.png" alt="drag letter" /> |
|
83 |
+ <button |
|
84 |
+ v-for="(char, index) in choiceCharacters" |
|
85 |
+ :key="index" |
|
86 |
+ draggable="true" |
|
87 |
+ @dragstart="onDragStart($event, char)" |
|
88 |
+ > |
|
89 |
+ <img |
|
90 |
+ src="../../../../resources/img/img63_37s_2.png" |
|
91 |
+ alt="drag letter" |
|
92 |
+ /> |
|
68 | 93 |
<p>{{ char.toUpperCase() }}</p> |
69 | 94 |
</button> |
70 | 95 |
</div> |
... | ... | @@ -96,14 +121,18 @@ |
96 | 121 |
prblm_id: [], |
97 | 122 |
unit_id: null, |
98 | 123 |
dataList: [], |
124 |
+ |
|
125 |
+ seq: this.$store.getters.seqNum, |
|
99 | 126 |
}; |
100 | 127 |
}, |
101 |
- computed: { |
|
102 |
- }, |
|
128 |
+ computed: {}, |
|
103 | 129 |
methods: { |
104 | 130 |
complete() { |
105 | 131 |
const { unit_id, book_id } = this.$route.query; |
106 |
- this.$router.push({ name: 'Dashboard', query: { value: 3, unit_id, book_id } }); |
|
132 |
+ this.$router.push({ |
|
133 |
+ name: "Dashboard", |
|
134 |
+ query: { value: this.seq, unit_id, book_id }, |
|
135 |
+ }); |
|
107 | 136 |
}, |
108 | 137 |
goToPage(page) { |
109 | 138 |
this.$router.push({ name: page }); |
... | ... | @@ -124,7 +153,7 @@ |
124 | 153 |
if (this.userAnswer[index] === "") { |
125 | 154 |
this.userAnswer.splice(index, 1, this.draggedChar); |
126 | 155 |
const charIndex = this.choiceCharacters.indexOf(this.draggedChar); |
127 |
- console.log(charIndex) |
|
156 |
+ console.log(charIndex); |
|
128 | 157 |
if (charIndex > -1) { |
129 | 158 |
this.choiceCharacters.splice(charIndex, 1); // 드래그한 문자를 choice에서 제거 |
130 | 159 |
} |
... | ... | @@ -155,20 +184,24 @@ |
155 | 184 |
const prblmId = this.currentLearningId.prblm_id; |
156 | 185 |
|
157 | 186 |
try { |
158 |
- const res = await axios.post("problem/problemInfo.json", { |
|
159 |
- prblmId: prblmId, |
|
160 |
- }, { |
|
161 |
- headers: { |
|
162 |
- "Content-Type": "application/json; charset=UTF-8", |
|
187 |
+ const res = await axios.post( |
|
188 |
+ "problem/problemInfo.json", |
|
189 |
+ { |
|
190 |
+ prblmId: prblmId, |
|
163 | 191 |
}, |
164 |
- }); |
|
192 |
+ { |
|
193 |
+ headers: { |
|
194 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
195 |
+ }, |
|
196 |
+ } |
|
197 |
+ ); |
|
165 | 198 |
|
166 | 199 |
console.log("problem - response : ", res.data); |
167 | 200 |
this.dataList = res.data.problem; |
168 | 201 |
this.problemDetail = res.data.problemDetail[0]; |
169 | 202 |
this.example = this.dataList.prblmExpln; |
170 | 203 |
this.answer = this.problemDetail.prblmDtlExpln; |
171 |
- this.choice = this.answer ? this.shuffleString(this.answer) : ''; |
|
204 |
+ this.choice = this.answer ? this.shuffleString(this.answer) : ""; |
|
172 | 205 |
this.splitExample(); |
173 | 206 |
this.initializeUserAnswer(); |
174 | 207 |
this.choiceCharacters = this.choice.split(""); |
... | ... | @@ -185,22 +218,26 @@ |
185 | 218 |
} |
186 | 219 |
}, |
187 | 220 |
shuffleString(string) { |
188 |
- const array = string.split(''); |
|
221 |
+ const array = string.split(""); |
|
189 | 222 |
for (let i = array.length - 1; i > 0; i--) { |
190 | 223 |
const j = Math.floor(Math.random() * (i + 1)); |
191 | 224 |
[array[i], array[j]] = [array[j], array[i]]; |
192 | 225 |
} |
193 |
- return array.join(''); |
|
226 |
+ return array.join(""); |
|
194 | 227 |
}, |
195 | 228 |
async findFile(file_mng_id) { |
196 | 229 |
try { |
197 |
- const res = await axios.post("/file/find.json", { |
|
198 |
- file_mng_id: file_mng_id, |
|
199 |
- }, { |
|
200 |
- headers: { |
|
201 |
- "Content-Type": "application/json; charset=UTF-8", |
|
230 |
+ const res = await axios.post( |
|
231 |
+ "/file/find.json", |
|
232 |
+ { |
|
233 |
+ file_mng_id: file_mng_id, |
|
202 | 234 |
}, |
203 |
- }); |
|
235 |
+ { |
|
236 |
+ headers: { |
|
237 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
238 |
+ }, |
|
239 |
+ } |
|
240 |
+ ); |
|
204 | 241 |
return res.data.list[0]; |
205 | 242 |
} catch (error) { |
206 | 243 |
console.log("result - error : ", error); |
... | ... | @@ -211,21 +248,26 @@ |
211 | 248 |
const problemData = { |
212 | 249 |
prblmImfo: this.currentLearningId, |
213 | 250 |
prblmNumber: this.currentProblemIndex, |
214 |
- prblmAns: this.selectedButton |
|
215 |
- } |
|
216 |
- this.$store.dispatch('saveProblemData', problemData); |
|
217 |
- if (this.currentProblemIndex < this.$store.state.currentLearningIds.length - 1) { |
|
218 |
- this.$store.dispatch('goToNextProblem'); |
|
251 |
+ prblmAns: this.selectedButton, |
|
252 |
+ }; |
|
253 |
+ this.$store.dispatch("saveProblemData", problemData); |
|
254 |
+ if ( |
|
255 |
+ this.currentProblemIndex < |
|
256 |
+ this.$store.state.currentLearningIds.length - 1 |
|
257 |
+ ) { |
|
258 |
+ this.$store.dispatch("goToNextProblem"); |
|
219 | 259 |
this.handleProblemDetail(this.currentLearningId); |
220 | 260 |
this.goToPage(this.problemType); |
221 | 261 |
} else { |
222 | 262 |
// 마지막 문제면 이동 |
223 |
- this.goToPage("Chapter4") |
|
263 |
+ // this.goToPage("Chapter4"); |
|
264 |
+ alert("문제 학습 완료"); |
|
265 |
+ this.complete(); |
|
224 | 266 |
} |
225 | 267 |
}, |
226 | 268 |
previousProblem() { |
227 | 269 |
if (this.currentProblemIndex > 0) { |
228 |
- this.$store.dispatch('goToPreviousProblem'); |
|
270 |
+ this.$store.dispatch("goToPreviousProblem"); |
|
229 | 271 |
this.handleProblemDetail(this.currentLearningId); |
230 | 272 |
this.goToPage(this.problemType); |
231 | 273 |
} |
... | ... | @@ -295,17 +337,17 @@ |
295 | 337 |
}, |
296 | 338 |
isPreviousButtonDisabled() { |
297 | 339 |
return this.currentProblemIndex === 0; |
298 |
- } |
|
340 |
+ }, |
|
299 | 341 |
}, |
300 | 342 |
created() { |
301 |
- console.log('Current Learning ID:', this.currentLearningId); |
|
302 |
- console.log('Current Label:', this.currentLabel); |
|
303 |
- console.log('Current Problem Index:', this.currentProblemIndex); |
|
343 |
+ console.log("Current Learning ID:", this.currentLearningId); |
|
344 |
+ console.log("Current Label:", this.currentLabel); |
|
345 |
+ console.log("Current Problem Index:", this.currentProblemIndex); |
|
304 | 346 |
|
305 | 347 |
// Fetch or process the current problem based on `currentLearningId` |
306 | 348 |
}, |
307 | 349 |
mounted() { |
308 |
- this.getProblem() |
|
350 |
+ this.getProblem(); |
|
309 | 351 |
}, |
310 | 352 |
}; |
311 | 353 |
</script> |
... | ... | @@ -379,6 +421,6 @@ |
379 | 421 |
padding: 10px 30px; |
380 | 422 |
border-radius: 10px; |
381 | 423 |
font-size: 28px; |
382 |
- font-family: 'ONEMobilePOPOTF'; |
|
424 |
+ font-family: "ONEMobilePOPOTF"; |
|
383 | 425 |
} |
384 | 426 |
</style> |
--- client/views/pages/main/Chapter/Chapter2_6.vue
+++ client/views/pages/main/Chapter/Chapter2_6.vue
... | ... | @@ -141,6 +141,8 @@ |
141 | 141 |
prblm_id: [], |
142 | 142 |
problemData: [], |
143 | 143 |
answerArr: [], |
144 |
+ |
|
145 |
+ seq: this.$store.getters.seqNum, |
|
144 | 146 |
}; |
145 | 147 |
}, |
146 | 148 |
methods: { |
... | ... | @@ -148,7 +150,7 @@ |
148 | 150 |
const { unit_id, book_id } = this.$route.query; |
149 | 151 |
this.$router.push({ |
150 | 152 |
name: "Dashboard", |
151 |
- query: { value: 3, unit_id, book_id }, |
|
153 |
+ query: { value: this.seq, unit_id, book_id }, |
|
152 | 154 |
}); |
153 | 155 |
}, |
154 | 156 |
goToPage(page) { |
... | ... | @@ -236,7 +238,9 @@ |
236 | 238 |
this.goToPage(this.problemType); |
237 | 239 |
} else { |
238 | 240 |
// 마지막 문제면 이동 |
239 |
- this.goToPage("Chapter4"); |
|
241 |
+ // this.goToPage("Chapter4"); |
|
242 |
+ alert("문제 학습 완료"); |
|
243 |
+ this.complete(); |
|
240 | 244 |
} |
241 | 245 |
}, |
242 | 246 |
previousProblem() { |
--- client/views/pages/main/Chapter/Chapter2_7.vue
+++ client/views/pages/main/Chapter/Chapter2_7.vue
... | ... | @@ -116,6 +116,8 @@ |
116 | 116 |
problemData: [], |
117 | 117 |
problemArr: [], |
118 | 118 |
answerArr: [], |
119 |
+ |
|
120 |
+ seq: this.$store.getters.seqNum, |
|
119 | 121 |
}; |
120 | 122 |
}, |
121 | 123 |
methods: { |
... | ... | @@ -123,7 +125,7 @@ |
123 | 125 |
const { unit_id, book_id } = this.$route.query; |
124 | 126 |
this.$router.push({ |
125 | 127 |
name: "Dashboard", |
126 |
- query: { value: 4, unit_id, book_id }, |
|
128 |
+ query: { value: this.seq, unit_id, book_id }, |
|
127 | 129 |
}); |
128 | 130 |
}, |
129 | 131 |
goToPage(page) { |
... | ... | @@ -228,7 +230,9 @@ |
228 | 230 |
this.goToPage(this.problemType); |
229 | 231 |
} else { |
230 | 232 |
// 마지막 문제면 이동 |
231 |
- this.goToPage("Chapter4"); |
|
233 |
+ // this.goToPage("Chapter4"); |
|
234 |
+ alert("문제 학습 완료"); |
|
235 |
+ this.complete(); |
|
232 | 236 |
} |
233 | 237 |
}, |
234 | 238 |
previousProblem() { |
--- client/views/pages/main/Chapter/Chapter2_8.vue
+++ client/views/pages/main/Chapter/Chapter2_8.vue
... | ... | @@ -118,6 +118,7 @@ |
118 | 118 |
answerArr: [], |
119 | 119 |
|
120 | 120 |
// prblmArr: [], |
121 |
+ seq: this.$store.getters.seqNum, |
|
121 | 122 |
}; |
122 | 123 |
}, |
123 | 124 |
methods: { |
... | ... | @@ -125,7 +126,7 @@ |
125 | 126 |
const { unit_id, book_id } = this.$route.query; |
126 | 127 |
this.$router.push({ |
127 | 128 |
name: "Dashboard", |
128 |
- query: { value: 11, unit_id, book_id }, |
|
129 |
+ query: { value: this.seq, unit_id, book_id }, |
|
129 | 130 |
}); |
130 | 131 |
}, |
131 | 132 |
goToPage(page) { |
... | ... | @@ -199,7 +200,10 @@ |
199 | 200 |
this.goToPage(this.problemType); |
200 | 201 |
} else { |
201 | 202 |
// 마지막 문제면 이동 |
202 |
- this.goToPage("Chapter4"); |
|
203 |
+ // this.goToPage("Chapter4"); |
|
204 |
+ alert("문제 학습 완료"); |
|
205 |
+ this.complete(); |
|
206 |
+ // this.goToPage("Dashboard"); |
|
203 | 207 |
} |
204 | 208 |
}, |
205 | 209 |
previousProblem() { |
--- client/views/pages/main/Chapter/Chapter2_9.vue
+++ client/views/pages/main/Chapter/Chapter2_9.vue
... | ... | @@ -45,14 +45,14 @@ |
45 | 45 |
/> |
46 | 46 |
<div class="vocaGroup"> |
47 | 47 |
<div |
48 |
- v-for="(word) in wordList" |
|
48 |
+ v-for="word in wordList" |
|
49 | 49 |
:key="word.wdId" |
50 | 50 |
class="flex justify-between mb80 word-item" |
51 | 51 |
> |
52 | 52 |
<article class="flex align-center"> |
53 | 53 |
<div class="imgGroup mr30"> |
54 | 54 |
<img |
55 |
- :src= word.fileRpath |
|
55 |
+ :src="word.fileRpath" |
|
56 | 56 |
data-num="1" |
57 | 57 |
class="ink" |
58 | 58 |
style="width: 150px" |
... | ... | @@ -124,7 +124,7 @@ |
124 | 124 |
</template> |
125 | 125 |
|
126 | 126 |
<script> |
127 |
-import axios from 'axios'; |
|
127 |
+import axios from "axios"; |
|
128 | 128 |
|
129 | 129 |
export default { |
130 | 130 |
data() { |
... | ... | @@ -137,17 +137,20 @@ |
137 | 137 |
currentWdBkIndex: 0, // 현재 단어장 인덱스 |
138 | 138 |
wdBookTypeIdState: "", // 이동할 페이지 타입 id |
139 | 139 |
wordBookType: "", // 이동할 페이지 |
140 |
+ |
|
141 |
+ seq: this.$store.getters.seqNum, |
|
140 | 142 |
}; |
141 | 143 |
}, |
142 | 144 |
methods: { |
143 | 145 |
pageSetting() { |
144 | 146 |
this.currentWdBkIndex = this.$store.getters.getCurrentWdBkIndex; // 현재 단어장 인덱스 |
145 | 147 |
this.wdBookIdList = this.$store.getters.getWdBookIdList; // 단어컨텐츠의 단어장 id 리스트 |
146 |
- this.wdBookId = this.$store.getters.getWdBookIdList[this.currentWdBkIndex] // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id |
|
148 |
+ this.wdBookId = |
|
149 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex]; // 현재 단어장 콘텐츠 인덱스에 대한 단어장 id |
|
147 | 150 |
|
148 | 151 |
this.fetchWordList(); |
149 | 152 |
}, |
150 |
- |
|
153 |
+ |
|
151 | 154 |
async fetchWordList() { |
152 | 155 |
try { |
153 | 156 |
const response = await axios.post("/word/getWordsByBookId.json", { |
... | ... | @@ -162,7 +165,10 @@ |
162 | 165 |
file_mng_id: word.fileMngId, |
163 | 166 |
}); |
164 | 167 |
|
165 |
- const fileRpath = fileResponse.data.list.length > 0 ? fileResponse.data.list[0].fileRpath : null; |
|
168 |
+ const fileRpath = |
|
169 |
+ fileResponse.data.list.length > 0 |
|
170 |
+ ? fileResponse.data.list[0].fileRpath |
|
171 |
+ : null; |
|
166 | 172 |
console.log("각 단어의 fileRpath: ", fileRpath); |
167 | 173 |
|
168 | 174 |
word.fileRpath = "http://165.229.169.113:9080/" + fileRpath; // fileRpath 값을 해당 객체에 추가 |
... | ... | @@ -179,44 +185,44 @@ |
179 | 185 |
} |
180 | 186 |
}, |
181 | 187 |
|
182 |
- |
|
183 | 188 |
async goToPrevPage() { |
184 | 189 |
if (this.currentWdBkIndex - 1 < 0) { |
185 | 190 |
alert("단어장 첫번째 페이지 입니다"); |
186 | 191 |
} else { |
187 | 192 |
this.currentWdBkIndex--; |
188 |
- this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex); |
|
193 |
+ this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex); |
|
189 | 194 |
|
190 | 195 |
try { |
191 | 196 |
const response = await axios.post("/wordbook/find.json", { |
192 |
- wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex] |
|
197 |
+ wdBookId: |
|
198 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex], |
|
193 | 199 |
}); |
194 | 200 |
this.wdBookTypeIdState = response.data.wdBookTypeId; |
195 | 201 |
console.log("이전 단어장 타입 id: ", this.wdBookTypeIdState); |
196 | 202 |
|
197 | 203 |
switch (this.wdBookTypeIdState) { |
198 | 204 |
case "1": |
199 |
- this.wordBookType = "Chapter2"; |
|
200 |
- break; |
|
205 |
+ this.wordBookType = "Chapter2"; |
|
206 |
+ break; |
|
201 | 207 |
case "2": |
202 |
- this.wordBookType = "Chapter2_3"; |
|
203 |
- break; |
|
208 |
+ this.wordBookType = "Chapter2_3"; |
|
209 |
+ break; |
|
204 | 210 |
case "3": |
205 |
- this.wordBookType = "Chapter2_2"; |
|
206 |
- break; |
|
211 |
+ this.wordBookType = "Chapter2_2"; |
|
212 |
+ break; |
|
207 | 213 |
case "4": |
208 |
- this.wordBookType = "Chapter2_9"; |
|
209 |
- break; |
|
214 |
+ this.wordBookType = "Chapter2_9"; |
|
215 |
+ break; |
|
210 | 216 |
case "5": |
211 |
- this.wordBookType = "Chapter2_4"; |
|
212 |
- break; |
|
217 |
+ this.wordBookType = "Chapter2_4"; |
|
218 |
+ break; |
|
213 | 219 |
default: |
214 |
- this.wordBookType = null; |
|
220 |
+ this.wordBookType = null; |
|
215 | 221 |
} |
216 |
- |
|
217 |
- this.goToPage(this.wordBookType); |
|
222 |
+ |
|
223 |
+ this.goToPage(this.wordBookType); |
|
218 | 224 |
} catch (error) { |
219 |
- console.error('단어장 정보 불러오는 중 오류 발생:', error); |
|
225 |
+ console.error("단어장 정보 불러오는 중 오류 발생:", error); |
|
220 | 226 |
} |
221 | 227 |
} |
222 | 228 |
}, |
... | ... | @@ -224,47 +230,52 @@ |
224 | 230 |
async goToNextPage() { |
225 | 231 |
if (this.currentWdBkIndex + 1 >= this.wdBookIdList.length) { |
226 | 232 |
alert("단어장 마지막 페이지 입니다"); |
233 |
+ this.complete(); |
|
227 | 234 |
} else { |
228 | 235 |
this.currentWdBkIndex++; |
229 |
- this.$store.dispatch('updateCurrentWdBkIndex', this.currentWdBkIndex); |
|
236 |
+ this.$store.dispatch("updateCurrentWdBkIndex", this.currentWdBkIndex); |
|
230 | 237 |
|
231 | 238 |
try { |
232 | 239 |
const response = await axios.post("/wordbook/find.json", { |
233 |
- wdBookId: this.$store.getters.getWdBookIdList[this.currentWdBkIndex] |
|
240 |
+ wdBookId: |
|
241 |
+ this.$store.getters.getWdBookIdList[this.currentWdBkIndex], |
|
234 | 242 |
}); |
235 | 243 |
this.wdBookTypeIdState = response.data.wdBookTypeId; |
236 | 244 |
console.log("다음 단어장 타입 id: ", this.wdBookTypeIdState); |
237 | 245 |
|
238 | 246 |
switch (this.wdBookTypeIdState) { |
239 | 247 |
case "1": |
240 |
- this.wordBookType = "Chapter2"; |
|
241 |
- break; |
|
248 |
+ this.wordBookType = "Chapter2"; |
|
249 |
+ break; |
|
242 | 250 |
case "2": |
243 |
- this.wordBookType = "Chapter2_3"; |
|
244 |
- break; |
|
251 |
+ this.wordBookType = "Chapter2_3"; |
|
252 |
+ break; |
|
245 | 253 |
case "3": |
246 |
- this.wordBookType = "Chapter2_2"; |
|
247 |
- break; |
|
254 |
+ this.wordBookType = "Chapter2_2"; |
|
255 |
+ break; |
|
248 | 256 |
case "4": |
249 |
- this.wordBookType = "Chapter2_9"; |
|
250 |
- break; |
|
257 |
+ this.wordBookType = "Chapter2_9"; |
|
258 |
+ break; |
|
251 | 259 |
case "5": |
252 |
- this.wordBookType = "Chapter2_4"; |
|
253 |
- break; |
|
260 |
+ this.wordBookType = "Chapter2_4"; |
|
261 |
+ break; |
|
254 | 262 |
default: |
255 |
- this.wordBookType = null; |
|
263 |
+ this.wordBookType = null; |
|
256 | 264 |
} |
257 |
- |
|
258 |
- this.goToPage(this.wordBookType); |
|
265 |
+ |
|
266 |
+ this.goToPage(this.wordBookType); |
|
259 | 267 |
} catch (error) { |
260 |
- console.error('단어장 정보 불러오는 중 오류 발생:', error); |
|
268 |
+ console.error("단어장 정보 불러오는 중 오류 발생:", error); |
|
261 | 269 |
} |
262 | 270 |
} |
263 | 271 |
}, |
264 | 272 |
|
265 | 273 |
complete() { |
266 | 274 |
const { unit_id, book_id } = this.$route.query; |
267 |
- this.$router.push({ name: 'Dashboard', query: { value: 2, unit_id, book_id } }); |
|
275 |
+ this.$router.push({ |
|
276 |
+ name: "Dashboard", |
|
277 |
+ query: { value: this.seq, unit_id, book_id }, |
|
278 |
+ }); |
|
268 | 279 |
}, |
269 | 280 |
goToPage(page) { |
270 | 281 |
this.$router.push({ name: page }); |
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -1,219 +1,626 @@ |
1 | 1 |
<template> |
2 |
- <p class="title1" v-if="state === 'finish'">오늘 공부를 다했어요! 너무 고생했어요!</p> |
|
3 |
- <p class="title1" v-else-if="state === 'notRegistered'">지금은 학습 루트가 등록이 안됐어요! 학습 일정에서 학습루트를 등록해볼까요?</p> |
|
4 |
- <p class="title1" v-else-if="state === 'noProblem'">교재에 등록된 문제가 없습니다.</p> |
|
5 |
- <div v-else class="main"> |
|
6 |
- <div class="race-wrap"> |
|
7 |
- <div class="title-box"> |
|
8 |
- <p class="title" style="margin-top: 7rem">{{ titleUnitName }}</p> |
|
9 |
- <p class="subtitle">{{ titleBookName }}</p> |
|
10 |
- </div> |
|
11 |
- <div class="race-box"> |
|
12 |
- <div class="rabbit-start"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[0] ? 'block' : 'none' }" /></div> |
|
13 |
- <div class="rcon flex justify-end mb5"> |
|
14 |
- <div class="race-btn" @click="[storeLearningId(labeledItems[0])]"> |
|
15 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[1] ? 'block' : 'none' }" /></div> |
|
16 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="1"> |
|
17 |
- <img :src="labeledItems[0].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }" /> |
|
18 |
- <img :src="labeledItems[0].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[1] ? 'block' : 'none' }" /> |
|
19 |
- </button> |
|
20 |
- <p>{{ labeledItems[0].label }}</p> |
|
21 |
- </div> |
|
22 |
- <div class="race-btn" @click="[storeLearningId(labeledItems[1])]"> |
|
23 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[2] ? 'block' : 'none' }" /></div> |
|
24 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="2"> |
|
25 |
- <img :src="labeledItems[1].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }" /> |
|
26 |
- <img :src="labeledItems[1].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[2] ? 'block' : 'none' }" /> |
|
27 |
- </button> |
|
28 |
- <p>{{ labeledItems[1].label }}</p> |
|
29 |
- </div> |
|
30 |
- </div> |
|
31 |
- <div class="lcon flex justify-between mb5"> |
|
32 |
- <div class="race-btn" @click="[storeLearningId(labeledItems[6])]"> |
|
33 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[7] ? 'block' : 'none' }" /></div> |
|
34 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="7"> |
|
35 |
- <img :src="labeledItems[6].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }" /> |
|
36 |
- <img :src="labeledItems[6].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[7] ? 'block' : 'none' }" /> |
|
37 |
- </button> |
|
38 |
- <p>{{ labeledItems[6].label }}</p> |
|
39 |
- </div> |
|
40 |
- <div class="race-btn" @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[5].learning_id)]"> |
|
41 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[6] ? 'block' : 'none' }" /></div> |
|
42 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="6"> |
|
43 |
- <img :src="labeledItems[5].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }" /> |
|
44 |
- <img :src="labeledItems[5].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[6] ? 'block' : 'none' }" /> |
|
45 |
- </button> |
|
46 |
- <p>{{ labeledItems[5].label }}</p> |
|
47 |
- </div> |
|
48 |
- <div class="race-btn" @click="[storeLearningId(labeledItems[4])]"> |
|
49 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[5] ? 'block' : 'none' }" /></div> |
|
50 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="5"> |
|
51 |
- <img :src="labeledItems[4].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }" /> |
|
52 |
- <img :src="labeledItems[4].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[5] ? 'block' : 'none' }" /> |
|
53 |
- </button> |
|
54 |
- <p>{{ labeledItems[4].label }}</p> |
|
55 |
- </div> |
|
56 |
- <div class="race-btn" @click="[storeLearningId(labeledItems[3])]"> |
|
57 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[4] ? 'block' : 'none' }" /></div> |
|
58 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="4"> |
|
59 |
- <img :src="labeledItems[3].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }" /> |
|
60 |
- <img :src="labeledItems[3].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[4] ? 'block' : 'none' }" /> |
|
61 |
- </button> |
|
62 |
- <p>{{ labeledItems[3].label }}</p> |
|
63 |
- </div> |
|
64 |
- <div class="race-btn" @click="[storeLearningId(labeledItems[2])]"> |
|
65 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[3] ? 'block' : 'none' }" /></div> |
|
66 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="3"> |
|
67 |
- <img :src="labeledItems[2].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }" /> |
|
68 |
- <img :src="labeledItems[2].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[3] ? 'block' : 'none' }" /> |
|
69 |
- </button> |
|
70 |
- <p>{{ labeledItems[2].label }}</p> |
|
71 |
- </div> |
|
72 |
- </div> |
|
73 |
- <div class="rcon flex"> |
|
74 |
- <div class="race-btn" @click="[goToPage('Chapter8'), storeLearningId(labeledItems[7].learning_id)]"> |
|
75 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[8] ? 'block' : 'none' }" /></div> |
|
76 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="8"> |
|
77 |
- <img :src="labeledItems[7].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }" /> |
|
78 |
- <img :src="labeledItems[7].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[8] ? 'block' : 'none' }" /> |
|
79 |
- </button> |
|
80 |
- <p class="long">{{ labeledItems[7].label }}</p> |
|
81 |
- </div> |
|
82 |
- <div class="race-btn" @click="[storeLearningId(labeledItems[8])]"> |
|
83 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[9] ? 'block' : 'none' }" /></div> |
|
84 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="9"> |
|
85 |
- <img :src="labeledItems[8].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }" /> |
|
86 |
- <img :src="labeledItems[8].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[9] ? 'block' : 'none' }" /> |
|
87 |
- </button> |
|
88 |
- <p>{{ labeledItems[8].label }}</p> |
|
89 |
- </div> |
|
90 |
- <div class="race-btn" @click="[goToPage('Chapter10'), storeLearningId(labeledItems[9].learning_id)]"> |
|
91 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[10] ? 'block' : 'none' }" /></div> |
|
92 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="10"> |
|
93 |
- <img :src="labeledItems[9].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }" /> |
|
94 |
- <img :src="labeledItems[9].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[10] ? 'block' : 'none' }" /> |
|
95 |
- </button> |
|
96 |
- <p>{{ labeledItems[9].label }}</p> |
|
97 |
- </div> |
|
98 |
- |
|
99 |
- <div class="race-btn" @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[10].learning_id)]"> |
|
100 |
- <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[11] ? 'block' : 'none' }" /></div> |
|
101 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImageAndShowPopup(index, '11')" data-num="11"> |
|
102 |
- <img :src="labeledItems[10].label.length >= 4 ? item.imgSrc3 : item.imgSrc1" :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }" /> |
|
103 |
- <img :src="labeledItems[10].label.length >= 4 ? item.imgSrc4 : item.imgSrc2" :style="{ display: rabbitCompl[11] ? 'block' : 'none' }" /> |
|
104 |
- </button> |
|
105 |
- <p class="long">{{ labeledItems[10].label }}</p> |
|
106 |
- </div> |
|
107 |
- </div> |
|
108 |
- <div class="race-btn"> |
|
109 |
- <div class="rabbit-running" style="display: flex"> |
|
110 |
- <img class="rabbit-end" src="../../../resources/img/img138_72s.png" alt="" :style="{ display: rabbitEnd ? 'block' : 'none' }" /> |
|
111 |
- <img class="fireworks-end" src="../../../resources/img/fireworks.gif" alt="" :style="{ display: rabbitEnd ? 'block' : 'none' }" /> |
|
112 |
- </div> |
|
113 |
- </div> |
|
114 |
- </div> |
|
115 |
- |
|
116 |
- <!-- 팝업 --> |
|
117 |
- <div v-show="searchOpen2" class="popup-wrap"> |
|
118 |
- <div class="popup-box"> |
|
119 |
- <button type="button" class="popup-close-btn" style="position: absolute; top: 10px; right: 10px" @click="closeModal"> |
|
120 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
121 |
- </button> |
|
122 |
- |
|
123 |
- <div class="mb30 text-ct"> |
|
124 |
- <p class="title1 mb20">1단원이 끝났습니다!</p> |
|
125 |
- <p class="title1"><em class="yellow">기념사진</em>을 촬영하러 가요</p> |
|
126 |
- </div> |
|
127 |
- <div class="flex justify-center"> |
|
128 |
- <button type="button" title="사진촬영" class="new-btn" @click="openCameraModal">사진 촬영</button> |
|
129 |
- </div> |
|
130 |
- </div> |
|
131 |
- </div> |
|
132 |
- <!-- 카메라 모달 --> |
|
133 |
- <article v-show="showCameraModal" class="popup-wrap"> |
|
134 |
- <div class="popup-box" style="top: 500px; left: 500px"> |
|
135 |
- <div class="flex mb10 justify-between"> |
|
136 |
- <p class="popup-title">사진 촬영</p> |
|
137 |
- <button type="button" class="popup-close-btn" @click="closeModal"> |
|
138 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
139 |
- </button> |
|
140 |
- </div> |
|
141 |
- <div class="box"> |
|
142 |
- <div style="width: 100%"> |
|
143 |
- <div id="container" ref="container"> |
|
144 |
- <video v-if="!photoTaken" autoplay="true" ref="modalVideoElement" class="mirrored" @canplay="onVideoLoaded" style="position: absolute; height: 100%"></video> |
|
145 |
- <img src="../../../resources/img/camera-rabbit.png" class="camera-rabbit" style="position: absolute" /> |
|
146 |
- <canvas ref="canvas" style="pointer-events: none"></canvas> |
|
147 |
- </div> |
|
148 |
- </div> |
|
149 |
- </div> |
|
150 |
- <div class="flex justify-center mt20"> |
|
151 |
- <button class="new-btn" @click="takePhoto">사진 찍기</button> |
|
152 |
- </div> |
|
153 |
- </div> |
|
154 |
- </article> |
|
2 |
+ <p class="title1" v-if="state === 'finish'"> |
|
3 |
+ 오늘 공부를 다했어요! 너무 고생했어요! |
|
4 |
+ </p> |
|
5 |
+ <p class="title1" v-else-if="state === 'notRegistered'"> |
|
6 |
+ 지금은 학습 루트가 등록이 안됐어요! 학습 일정에서 학습루트를 등록해볼까요? |
|
7 |
+ </p> |
|
8 |
+ <p class="title1" v-else-if="state === 'noProblem'"> |
|
9 |
+ 교재에 등록된 문제가 없습니다. |
|
10 |
+ </p> |
|
11 |
+ <div v-else class="main"> |
|
12 |
+ <div class="race-wrap"> |
|
13 |
+ <div class="title-box"> |
|
14 |
+ <p class="title" style="margin-top: 7rem">{{ titleUnitName }}</p> |
|
15 |
+ <p class="subtitle">{{ titleBookName }}</p> |
|
16 |
+ </div> |
|
17 |
+ <div class="race-box"> |
|
18 |
+ <div class="rabbit-start"> |
|
19 |
+ <img |
|
20 |
+ src="../../../resources/img/img09_s.png" |
|
21 |
+ alt="" |
|
22 |
+ :style="{ display: rabbitPos[0] ? 'block' : 'none' }" |
|
23 |
+ /> |
|
155 | 24 |
</div> |
156 |
- |
|
157 |
- <div class="complete-wrap myphoto"> |
|
158 |
- <button class="login-btn mt10" type="submit" style="width: 100%" @click="finishSchedule"> |
|
159 |
- <img src="../../../resources/img/btn07_s.png" alt="" style="width: 100%; height: 100px" /> |
|
160 |
- <p>학습 종료하기</p> |
|
25 |
+ <div class="rcon flex justify-end mb5"> |
|
26 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[0])]"> |
|
27 |
+ <div class="rabbit-running"> |
|
28 |
+ <img |
|
29 |
+ src="../../../resources/img/img09_s.png" |
|
30 |
+ alt="" |
|
31 |
+ :style="{ display: rabbitPos[1] ? 'block' : 'none' }" |
|
32 |
+ /> |
|
33 |
+ </div> |
|
34 |
+ <button |
|
35 |
+ class="popTxt" |
|
36 |
+ v-for="(item, index) in items" |
|
37 |
+ :key="index" |
|
38 |
+ @click="toggleImage(index)" |
|
39 |
+ data-num="1" |
|
40 |
+ > |
|
41 |
+ <img |
|
42 |
+ :src=" |
|
43 |
+ labeledItems[0].label.length >= 4 |
|
44 |
+ ? item.imgSrc3 |
|
45 |
+ : item.imgSrc1 |
|
46 |
+ " |
|
47 |
+ :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }" |
|
48 |
+ /> |
|
49 |
+ <img |
|
50 |
+ :src=" |
|
51 |
+ labeledItems[0].label.length >= 4 |
|
52 |
+ ? item.imgSrc4 |
|
53 |
+ : item.imgSrc2 |
|
54 |
+ " |
|
55 |
+ :style="{ display: rabbitCompl[1] ? 'block' : 'none' }" |
|
56 |
+ /> |
|
161 | 57 |
</button> |
162 |
- <h2 class="mb40 mt10">이 단원을 끝낸 친구들</h2> |
|
163 |
- |
|
164 |
- <article class="flex-column"> |
|
165 |
- <div class="flex-row"> |
|
166 |
- <div class="flex" style="gap: 5px; flex-wrap: wrap"> |
|
167 |
- <div v-for="(image, index) in images" :key="image.fileId" @click="buttonSearch(image)" class="photo" style="margin-bottom: 5px"> |
|
168 |
- <img :src="image.url" :alt="image.fileNm" reloadable="true" style="height: 100%" /> |
|
169 |
- </div> |
|
170 |
- </div> |
|
171 |
- </div> |
|
172 |
- </article> |
|
173 |
- <article class="popup-wrap" v-show="searchOpen"> |
|
174 |
- <div class="popup-box" style="top: 50%"> |
|
175 |
- <div class="flex mb10 justify-between"> |
|
176 |
- <button type="button" class="popup-close-btn" @click="closeModal"> |
|
177 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
178 |
- </button> |
|
179 |
- </div> |
|
180 |
- <div class="box"> |
|
181 |
- <div style="width: 910px; height: 680px"> |
|
182 |
- <img :src="selectedImage.image" alt="Image" @error="onImageError" reloadable="true" /> |
|
183 |
- </div> |
|
184 |
- </div> |
|
185 |
- <div class="flex justify-between mt20"> |
|
186 |
- <div class="text flex"> |
|
187 |
- <p class="title2 date ml30">{{ selectedImage.date }}</p> |
|
188 |
- <span class="title1 ml30" |
|
189 |
- >{{ selectedImage.unit }}을 마친 <em class="yellow">{{ selectedImage.name }}</em |
|
190 |
- >친구</span |
|
191 |
- > |
|
192 |
- </div> |
|
193 |
- <div class="title2 flex align-center" style="gap: 10px"> |
|
194 |
- <svg-icon |
|
195 |
- v-if="!isHeartFilled" |
|
196 |
- type="mdi" |
|
197 |
- :path="mdiHeartOutline" |
|
198 |
- @click="toggleHeart(selectedImage.heart, selectedImage.fileMngId)" |
|
199 |
- style="color: #ffba08; cursor: pointer" |
|
200 |
- ></svg-icon> |
|
201 |
- <svg-icon |
|
202 |
- v-if="isHeartFilled" |
|
203 |
- type="mdi" |
|
204 |
- :path="mdiHeart" |
|
205 |
- @click="toggleHeart(selectedImage.heart, selectedImage.fileMngId)" |
|
206 |
- style="color: #ffba08; cursor: pointer" |
|
207 |
- ></svg-icon> |
|
208 |
- <p> |
|
209 |
- <em class="yellow">{{ selectedImage.heart }}</em> |
|
210 |
- </p> |
|
211 |
- </div> |
|
212 |
- </div> |
|
213 |
- </div> |
|
214 |
- </article> |
|
58 |
+ <p>{{ labeledItems[0].label }}</p> |
|
59 |
+ </div> |
|
60 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[1])]"> |
|
61 |
+ <div class="rabbit-running"> |
|
62 |
+ <img |
|
63 |
+ src="../../../resources/img/img09_s.png" |
|
64 |
+ alt="" |
|
65 |
+ :style="{ display: rabbitPos[2] ? 'block' : 'none' }" |
|
66 |
+ /> |
|
67 |
+ </div> |
|
68 |
+ <button |
|
69 |
+ class="popTxt" |
|
70 |
+ v-for="(item, index) in items" |
|
71 |
+ :key="index" |
|
72 |
+ @click="toggleImage(index)" |
|
73 |
+ data-num="2" |
|
74 |
+ > |
|
75 |
+ <img |
|
76 |
+ :src=" |
|
77 |
+ labeledItems[1].label.length >= 4 |
|
78 |
+ ? item.imgSrc3 |
|
79 |
+ : item.imgSrc1 |
|
80 |
+ " |
|
81 |
+ :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }" |
|
82 |
+ /> |
|
83 |
+ <img |
|
84 |
+ :src=" |
|
85 |
+ labeledItems[1].label.length >= 4 |
|
86 |
+ ? item.imgSrc4 |
|
87 |
+ : item.imgSrc2 |
|
88 |
+ " |
|
89 |
+ :style="{ display: rabbitCompl[2] ? 'block' : 'none' }" |
|
90 |
+ /> |
|
91 |
+ </button> |
|
92 |
+ <p>{{ labeledItems[1].label }}</p> |
|
93 |
+ </div> |
|
215 | 94 |
</div> |
95 |
+ <div class="lcon flex justify-between mb5"> |
|
96 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[6])]"> |
|
97 |
+ <div class="rabbit-running"> |
|
98 |
+ <img |
|
99 |
+ src="../../../resources/img/img09_s.png" |
|
100 |
+ alt="" |
|
101 |
+ :style="{ display: rabbitPos[7] ? 'block' : 'none' }" |
|
102 |
+ /> |
|
103 |
+ </div> |
|
104 |
+ <button |
|
105 |
+ class="popTxt" |
|
106 |
+ v-for="(item, index) in items" |
|
107 |
+ :key="index" |
|
108 |
+ @click="toggleImage(index)" |
|
109 |
+ data-num="7" |
|
110 |
+ > |
|
111 |
+ <img |
|
112 |
+ :src=" |
|
113 |
+ labeledItems[6].label.length >= 4 |
|
114 |
+ ? item.imgSrc3 |
|
115 |
+ : item.imgSrc1 |
|
116 |
+ " |
|
117 |
+ :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }" |
|
118 |
+ /> |
|
119 |
+ <img |
|
120 |
+ :src=" |
|
121 |
+ labeledItems[6].label.length >= 4 |
|
122 |
+ ? item.imgSrc4 |
|
123 |
+ : item.imgSrc2 |
|
124 |
+ " |
|
125 |
+ :style="{ display: rabbitCompl[7] ? 'block' : 'none' }" |
|
126 |
+ /> |
|
127 |
+ </button> |
|
128 |
+ <p>{{ labeledItems[6].label }}</p> |
|
129 |
+ </div> |
|
130 |
+ <div |
|
131 |
+ class="race-btn" |
|
132 |
+ @click=" |
|
133 |
+ [ |
|
134 |
+ goToPage('Chapter2_8'), |
|
135 |
+ storeLearningId(labeledItems[5].learning_id), |
|
136 |
+ ] |
|
137 |
+ " |
|
138 |
+ > |
|
139 |
+ <div class="rabbit-running"> |
|
140 |
+ <img |
|
141 |
+ src="../../../resources/img/img09_s.png" |
|
142 |
+ alt="" |
|
143 |
+ :style="{ display: rabbitPos[6] ? 'block' : 'none' }" |
|
144 |
+ /> |
|
145 |
+ </div> |
|
146 |
+ <button |
|
147 |
+ class="popTxt" |
|
148 |
+ v-for="(item, index) in items" |
|
149 |
+ :key="index" |
|
150 |
+ @click="toggleImage(index)" |
|
151 |
+ data-num="6" |
|
152 |
+ > |
|
153 |
+ <img |
|
154 |
+ :src=" |
|
155 |
+ labeledItems[5].label.length >= 4 |
|
156 |
+ ? item.imgSrc3 |
|
157 |
+ : item.imgSrc1 |
|
158 |
+ " |
|
159 |
+ :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }" |
|
160 |
+ /> |
|
161 |
+ <img |
|
162 |
+ :src=" |
|
163 |
+ labeledItems[5].label.length >= 4 |
|
164 |
+ ? item.imgSrc4 |
|
165 |
+ : item.imgSrc2 |
|
166 |
+ " |
|
167 |
+ :style="{ display: rabbitCompl[6] ? 'block' : 'none' }" |
|
168 |
+ /> |
|
169 |
+ </button> |
|
170 |
+ <p>{{ labeledItems[5].label }}</p> |
|
171 |
+ </div> |
|
172 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[4])]"> |
|
173 |
+ <div class="rabbit-running"> |
|
174 |
+ <img |
|
175 |
+ src="../../../resources/img/img09_s.png" |
|
176 |
+ alt="" |
|
177 |
+ :style="{ display: rabbitPos[5] ? 'block' : 'none' }" |
|
178 |
+ /> |
|
179 |
+ </div> |
|
180 |
+ <button |
|
181 |
+ class="popTxt" |
|
182 |
+ v-for="(item, index) in items" |
|
183 |
+ :key="index" |
|
184 |
+ @click="toggleImage(index)" |
|
185 |
+ data-num="5" |
|
186 |
+ > |
|
187 |
+ <img |
|
188 |
+ :src=" |
|
189 |
+ labeledItems[4].label.length >= 4 |
|
190 |
+ ? item.imgSrc3 |
|
191 |
+ : item.imgSrc1 |
|
192 |
+ " |
|
193 |
+ :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }" |
|
194 |
+ /> |
|
195 |
+ <img |
|
196 |
+ :src=" |
|
197 |
+ labeledItems[4].label.length >= 4 |
|
198 |
+ ? item.imgSrc4 |
|
199 |
+ : item.imgSrc2 |
|
200 |
+ " |
|
201 |
+ :style="{ display: rabbitCompl[5] ? 'block' : 'none' }" |
|
202 |
+ /> |
|
203 |
+ </button> |
|
204 |
+ <p>{{ labeledItems[4].label }}</p> |
|
205 |
+ </div> |
|
206 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[3])]"> |
|
207 |
+ <div class="rabbit-running"> |
|
208 |
+ <img |
|
209 |
+ src="../../../resources/img/img09_s.png" |
|
210 |
+ alt="" |
|
211 |
+ :style="{ display: rabbitPos[4] ? 'block' : 'none' }" |
|
212 |
+ /> |
|
213 |
+ </div> |
|
214 |
+ <button |
|
215 |
+ class="popTxt" |
|
216 |
+ v-for="(item, index) in items" |
|
217 |
+ :key="index" |
|
218 |
+ @click="toggleImage(index)" |
|
219 |
+ data-num="4" |
|
220 |
+ > |
|
221 |
+ <img |
|
222 |
+ :src=" |
|
223 |
+ labeledItems[3].label.length >= 4 |
|
224 |
+ ? item.imgSrc3 |
|
225 |
+ : item.imgSrc1 |
|
226 |
+ " |
|
227 |
+ :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }" |
|
228 |
+ /> |
|
229 |
+ <img |
|
230 |
+ :src=" |
|
231 |
+ labeledItems[3].label.length >= 4 |
|
232 |
+ ? item.imgSrc4 |
|
233 |
+ : item.imgSrc2 |
|
234 |
+ " |
|
235 |
+ :style="{ display: rabbitCompl[4] ? 'block' : 'none' }" |
|
236 |
+ /> |
|
237 |
+ </button> |
|
238 |
+ <p>{{ labeledItems[3].label }}</p> |
|
239 |
+ </div> |
|
240 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[2])]"> |
|
241 |
+ <div class="rabbit-running"> |
|
242 |
+ <img |
|
243 |
+ src="../../../resources/img/img09_s.png" |
|
244 |
+ alt="" |
|
245 |
+ :style="{ display: rabbitPos[3] ? 'block' : 'none' }" |
|
246 |
+ /> |
|
247 |
+ </div> |
|
248 |
+ <button |
|
249 |
+ class="popTxt" |
|
250 |
+ v-for="(item, index) in items" |
|
251 |
+ :key="index" |
|
252 |
+ @click="toggleImage(index)" |
|
253 |
+ data-num="3" |
|
254 |
+ > |
|
255 |
+ <img |
|
256 |
+ :src=" |
|
257 |
+ labeledItems[2].label.length >= 4 |
|
258 |
+ ? item.imgSrc3 |
|
259 |
+ : item.imgSrc1 |
|
260 |
+ " |
|
261 |
+ :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }" |
|
262 |
+ /> |
|
263 |
+ <img |
|
264 |
+ :src=" |
|
265 |
+ labeledItems[2].label.length >= 4 |
|
266 |
+ ? item.imgSrc4 |
|
267 |
+ : item.imgSrc2 |
|
268 |
+ " |
|
269 |
+ :style="{ display: rabbitCompl[3] ? 'block' : 'none' }" |
|
270 |
+ /> |
|
271 |
+ </button> |
|
272 |
+ <p>{{ labeledItems[2].label }}</p> |
|
273 |
+ </div> |
|
274 |
+ </div> |
|
275 |
+ <div class="rcon flex"> |
|
276 |
+ <div |
|
277 |
+ class="race-btn" |
|
278 |
+ @click=" |
|
279 |
+ [ |
|
280 |
+ goToPage('Chapter8'), |
|
281 |
+ storeLearningId(labeledItems[7].learning_id), |
|
282 |
+ ] |
|
283 |
+ " |
|
284 |
+ > |
|
285 |
+ <div class="rabbit-running"> |
|
286 |
+ <img |
|
287 |
+ src="../../../resources/img/img09_s.png" |
|
288 |
+ alt="" |
|
289 |
+ :style="{ display: rabbitPos[8] ? 'block' : 'none' }" |
|
290 |
+ /> |
|
291 |
+ </div> |
|
292 |
+ <button |
|
293 |
+ class="popTxt" |
|
294 |
+ v-for="(item, index) in items" |
|
295 |
+ :key="index" |
|
296 |
+ @click="toggleImage(index)" |
|
297 |
+ data-num="8" |
|
298 |
+ > |
|
299 |
+ <img |
|
300 |
+ :src=" |
|
301 |
+ labeledItems[7].label.length >= 4 |
|
302 |
+ ? item.imgSrc3 |
|
303 |
+ : item.imgSrc1 |
|
304 |
+ " |
|
305 |
+ :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }" |
|
306 |
+ /> |
|
307 |
+ <img |
|
308 |
+ :src=" |
|
309 |
+ labeledItems[7].label.length >= 4 |
|
310 |
+ ? item.imgSrc4 |
|
311 |
+ : item.imgSrc2 |
|
312 |
+ " |
|
313 |
+ :style="{ display: rabbitCompl[8] ? 'block' : 'none' }" |
|
314 |
+ /> |
|
315 |
+ </button> |
|
316 |
+ <p class="long">{{ labeledItems[7].label }}</p> |
|
317 |
+ </div> |
|
318 |
+ <div class="race-btn" @click="[storeLearningId(labeledItems[8])]"> |
|
319 |
+ <div class="rabbit-running"> |
|
320 |
+ <img |
|
321 |
+ src="../../../resources/img/img09_s.png" |
|
322 |
+ alt="" |
|
323 |
+ :style="{ display: rabbitPos[9] ? 'block' : 'none' }" |
|
324 |
+ /> |
|
325 |
+ </div> |
|
326 |
+ <button |
|
327 |
+ class="popTxt" |
|
328 |
+ v-for="(item, index) in items" |
|
329 |
+ :key="index" |
|
330 |
+ @click="toggleImage(index)" |
|
331 |
+ data-num="9" |
|
332 |
+ > |
|
333 |
+ <img |
|
334 |
+ :src=" |
|
335 |
+ labeledItems[8].label.length >= 4 |
|
336 |
+ ? item.imgSrc3 |
|
337 |
+ : item.imgSrc1 |
|
338 |
+ " |
|
339 |
+ :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }" |
|
340 |
+ /> |
|
341 |
+ <img |
|
342 |
+ :src=" |
|
343 |
+ labeledItems[8].label.length >= 4 |
|
344 |
+ ? item.imgSrc4 |
|
345 |
+ : item.imgSrc2 |
|
346 |
+ " |
|
347 |
+ :style="{ display: rabbitCompl[9] ? 'block' : 'none' }" |
|
348 |
+ /> |
|
349 |
+ </button> |
|
350 |
+ <p>{{ labeledItems[8].label }}</p> |
|
351 |
+ </div> |
|
352 |
+ <div |
|
353 |
+ class="race-btn" |
|
354 |
+ @click=" |
|
355 |
+ [ |
|
356 |
+ goToPage('Chapter10'), |
|
357 |
+ storeLearningId(labeledItems[9].learning_id), |
|
358 |
+ ] |
|
359 |
+ " |
|
360 |
+ > |
|
361 |
+ <div class="rabbit-running"> |
|
362 |
+ <img |
|
363 |
+ src="../../../resources/img/img09_s.png" |
|
364 |
+ alt="" |
|
365 |
+ :style="{ display: rabbitPos[10] ? 'block' : 'none' }" |
|
366 |
+ /> |
|
367 |
+ </div> |
|
368 |
+ <button |
|
369 |
+ class="popTxt" |
|
370 |
+ v-for="(item, index) in items" |
|
371 |
+ :key="index" |
|
372 |
+ @click="toggleImage(index)" |
|
373 |
+ data-num="10" |
|
374 |
+ > |
|
375 |
+ <img |
|
376 |
+ :src=" |
|
377 |
+ labeledItems[9].label.length >= 4 |
|
378 |
+ ? item.imgSrc3 |
|
379 |
+ : item.imgSrc1 |
|
380 |
+ " |
|
381 |
+ :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }" |
|
382 |
+ /> |
|
383 |
+ <img |
|
384 |
+ :src=" |
|
385 |
+ labeledItems[9].label.length >= 4 |
|
386 |
+ ? item.imgSrc4 |
|
387 |
+ : item.imgSrc2 |
|
388 |
+ " |
|
389 |
+ :style="{ display: rabbitCompl[10] ? 'block' : 'none' }" |
|
390 |
+ /> |
|
391 |
+ </button> |
|
392 |
+ <p>{{ labeledItems[9].label }}</p> |
|
393 |
+ </div> |
|
394 |
+ |
|
395 |
+ <div |
|
396 |
+ class="race-btn" |
|
397 |
+ @click=" |
|
398 |
+ [ |
|
399 |
+ goToPage('Chapter2_8'), |
|
400 |
+ storeLearningId(labeledItems[10].learning_id), |
|
401 |
+ ] |
|
402 |
+ " |
|
403 |
+ > |
|
404 |
+ <div class="rabbit-running"> |
|
405 |
+ <img |
|
406 |
+ src="../../../resources/img/img09_s.png" |
|
407 |
+ alt="" |
|
408 |
+ :style="{ display: rabbitPos[11] ? 'block' : 'none' }" |
|
409 |
+ /> |
|
410 |
+ </div> |
|
411 |
+ <button |
|
412 |
+ class="popTxt" |
|
413 |
+ v-for="(item, index) in items" |
|
414 |
+ :key="index" |
|
415 |
+ @click="toggleImageAndShowPopup(index, '11')" |
|
416 |
+ data-num="11" |
|
417 |
+ > |
|
418 |
+ <img |
|
419 |
+ :src=" |
|
420 |
+ labeledItems[10].label.length >= 4 |
|
421 |
+ ? item.imgSrc3 |
|
422 |
+ : item.imgSrc1 |
|
423 |
+ " |
|
424 |
+ :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }" |
|
425 |
+ /> |
|
426 |
+ <img |
|
427 |
+ :src=" |
|
428 |
+ labeledItems[10].label.length >= 4 |
|
429 |
+ ? item.imgSrc4 |
|
430 |
+ : item.imgSrc2 |
|
431 |
+ " |
|
432 |
+ :style="{ display: rabbitCompl[11] ? 'block' : 'none' }" |
|
433 |
+ /> |
|
434 |
+ </button> |
|
435 |
+ <p class="long">{{ labeledItems[10].label }}</p> |
|
436 |
+ </div> |
|
437 |
+ </div> |
|
438 |
+ <div class="race-btn"> |
|
439 |
+ <div class="rabbit-running" style="display: flex"> |
|
440 |
+ <img |
|
441 |
+ class="rabbit-end" |
|
442 |
+ src="../../../resources/img/img138_72s.png" |
|
443 |
+ alt="" |
|
444 |
+ :style="{ display: rabbitEnd ? 'block' : 'none' }" |
|
445 |
+ /> |
|
446 |
+ <img |
|
447 |
+ class="fireworks-end" |
|
448 |
+ src="../../../resources/img/fireworks.gif" |
|
449 |
+ alt="" |
|
450 |
+ :style="{ display: rabbitEnd ? 'block' : 'none' }" |
|
451 |
+ /> |
|
452 |
+ </div> |
|
453 |
+ </div> |
|
454 |
+ </div> |
|
455 |
+ |
|
456 |
+ <!-- 팝업 --> |
|
457 |
+ <div v-show="searchOpen2" class="popup-wrap"> |
|
458 |
+ <div class="popup-box"> |
|
459 |
+ <button |
|
460 |
+ type="button" |
|
461 |
+ class="popup-close-btn" |
|
462 |
+ style="position: absolute; top: 10px; right: 10px" |
|
463 |
+ @click="closeModal" |
|
464 |
+ > |
|
465 |
+ <svg-icon |
|
466 |
+ type="mdi" |
|
467 |
+ :path="mdiWindowClose" |
|
468 |
+ class="close-btn" |
|
469 |
+ ></svg-icon> |
|
470 |
+ </button> |
|
471 |
+ |
|
472 |
+ <div class="mb30 text-ct"> |
|
473 |
+ <p class="title1 mb20">1단원이 끝났습니다!</p> |
|
474 |
+ <p class="title1"> |
|
475 |
+ <em class="yellow">기념사진</em>을 촬영하러 가요 |
|
476 |
+ </p> |
|
477 |
+ </div> |
|
478 |
+ <div class="flex justify-center"> |
|
479 |
+ <button |
|
480 |
+ type="button" |
|
481 |
+ title="사진촬영" |
|
482 |
+ class="new-btn" |
|
483 |
+ @click="openCameraModal" |
|
484 |
+ > |
|
485 |
+ 사진 촬영 |
|
486 |
+ </button> |
|
487 |
+ </div> |
|
488 |
+ </div> |
|
489 |
+ </div> |
|
490 |
+ <!-- 카메라 모달 --> |
|
491 |
+ <article v-show="showCameraModal" class="popup-wrap"> |
|
492 |
+ <div class="popup-box" style="top: 500px; left: 500px"> |
|
493 |
+ <div class="flex mb10 justify-between"> |
|
494 |
+ <p class="popup-title">사진 촬영</p> |
|
495 |
+ <button type="button" class="popup-close-btn" @click="closeModal"> |
|
496 |
+ <svg-icon |
|
497 |
+ type="mdi" |
|
498 |
+ :path="mdiWindowClose" |
|
499 |
+ class="close-btn" |
|
500 |
+ ></svg-icon> |
|
501 |
+ </button> |
|
502 |
+ </div> |
|
503 |
+ <div class="box"> |
|
504 |
+ <div style="width: 100%"> |
|
505 |
+ <div id="container" ref="container"> |
|
506 |
+ <video |
|
507 |
+ v-if="!photoTaken" |
|
508 |
+ autoplay="true" |
|
509 |
+ ref="modalVideoElement" |
|
510 |
+ class="mirrored" |
|
511 |
+ @canplay="onVideoLoaded" |
|
512 |
+ style="position: absolute; height: 100%" |
|
513 |
+ ></video> |
|
514 |
+ <img |
|
515 |
+ src="../../../resources/img/camera-rabbit.png" |
|
516 |
+ class="camera-rabbit" |
|
517 |
+ style="position: absolute" |
|
518 |
+ /> |
|
519 |
+ <canvas ref="canvas" style="pointer-events: none"></canvas> |
|
520 |
+ </div> |
|
521 |
+ </div> |
|
522 |
+ </div> |
|
523 |
+ <div class="flex justify-center mt20"> |
|
524 |
+ <button class="new-btn" @click="takePhoto">사진 찍기</button> |
|
525 |
+ </div> |
|
526 |
+ </div> |
|
527 |
+ </article> |
|
216 | 528 |
</div> |
529 |
+ |
|
530 |
+ <div class="complete-wrap myphoto"> |
|
531 |
+ <button |
|
532 |
+ class="login-btn mt10" |
|
533 |
+ type="submit" |
|
534 |
+ style="width: 100%" |
|
535 |
+ @click="finishSchedule" |
|
536 |
+ > |
|
537 |
+ <img |
|
538 |
+ src="../../../resources/img/btn07_s.png" |
|
539 |
+ alt="" |
|
540 |
+ style="width: 100%; height: 100px" |
|
541 |
+ /> |
|
542 |
+ <p>학습 종료하기</p> |
|
543 |
+ </button> |
|
544 |
+ <h2 class="mb40 mt10">이 단원을 끝낸 친구들</h2> |
|
545 |
+ |
|
546 |
+ <article class="flex-column"> |
|
547 |
+ <div class="flex-row"> |
|
548 |
+ <div class="flex" style="gap: 5px; flex-wrap: wrap"> |
|
549 |
+ <div |
|
550 |
+ v-for="(image, index) in images" |
|
551 |
+ :key="image.fileId" |
|
552 |
+ @click="buttonSearch(image)" |
|
553 |
+ class="photo" |
|
554 |
+ style="margin-bottom: 5px" |
|
555 |
+ > |
|
556 |
+ <img |
|
557 |
+ :src="image.url" |
|
558 |
+ :alt="image.fileNm" |
|
559 |
+ reloadable="true" |
|
560 |
+ style="height: 100%" |
|
561 |
+ /> |
|
562 |
+ </div> |
|
563 |
+ </div> |
|
564 |
+ </div> |
|
565 |
+ </article> |
|
566 |
+ <article class="popup-wrap" v-show="searchOpen"> |
|
567 |
+ <div class="popup-box" style="top: 50%"> |
|
568 |
+ <div class="flex mb10 justify-between"> |
|
569 |
+ <button type="button" class="popup-close-btn" @click="closeModal"> |
|
570 |
+ <svg-icon |
|
571 |
+ type="mdi" |
|
572 |
+ :path="mdiWindowClose" |
|
573 |
+ class="close-btn" |
|
574 |
+ ></svg-icon> |
|
575 |
+ </button> |
|
576 |
+ </div> |
|
577 |
+ <div class="box"> |
|
578 |
+ <div style="width: 910px; height: 680px"> |
|
579 |
+ <img |
|
580 |
+ :src="selectedImage.image" |
|
581 |
+ alt="Image" |
|
582 |
+ @error="onImageError" |
|
583 |
+ reloadable="true" |
|
584 |
+ /> |
|
585 |
+ </div> |
|
586 |
+ </div> |
|
587 |
+ <div class="flex justify-between mt20"> |
|
588 |
+ <div class="text flex"> |
|
589 |
+ <p class="title2 date ml30">{{ selectedImage.date }}</p> |
|
590 |
+ <span class="title1 ml30" |
|
591 |
+ >{{ selectedImage.unit }}을 마친 |
|
592 |
+ <em class="yellow">{{ selectedImage.name }}</em |
|
593 |
+ >친구</span |
|
594 |
+ > |
|
595 |
+ </div> |
|
596 |
+ <div class="title2 flex align-center" style="gap: 10px"> |
|
597 |
+ <svg-icon |
|
598 |
+ v-if="!isHeartFilled" |
|
599 |
+ type="mdi" |
|
600 |
+ :path="mdiHeartOutline" |
|
601 |
+ @click=" |
|
602 |
+ toggleHeart(selectedImage.heart, selectedImage.fileMngId) |
|
603 |
+ " |
|
604 |
+ style="color: #ffba08; cursor: pointer" |
|
605 |
+ ></svg-icon> |
|
606 |
+ <svg-icon |
|
607 |
+ v-if="isHeartFilled" |
|
608 |
+ type="mdi" |
|
609 |
+ :path="mdiHeart" |
|
610 |
+ @click=" |
|
611 |
+ toggleHeart(selectedImage.heart, selectedImage.fileMngId) |
|
612 |
+ " |
|
613 |
+ style="color: #ffba08; cursor: pointer" |
|
614 |
+ ></svg-icon> |
|
615 |
+ <p> |
|
616 |
+ <em class="yellow">{{ selectedImage.heart }}</em> |
|
617 |
+ </p> |
|
618 |
+ </div> |
|
619 |
+ </div> |
|
620 |
+ </div> |
|
621 |
+ </article> |
|
622 |
+ </div> |
|
623 |
+ </div> |
|
217 | 624 |
</template> |
218 | 625 |
|
219 | 626 |
<script> |
... | ... | @@ -227,726 +634,781 @@ |
227 | 634 |
import { mapActions } from "vuex"; |
228 | 635 |
|
229 | 636 |
export default { |
230 |
- data() { |
|
231 |
- return { |
|
232 |
- items: [ |
|
233 |
- { |
|
234 |
- imgSrc1: "client/resources/img/img11_1_s.png", |
|
235 |
- imgSrc2: "client/resources/img/img12_1_s.png", |
|
236 |
- imgSrc3: "client/resources/img/img11_2_s.png", |
|
237 |
- imgSrc4: "client/resources/img/img12_2_s.png", |
|
238 |
- isSecondImageVisible: false, |
|
239 |
- }, |
|
240 |
- ], |
|
241 |
- mdiMagnify: mdiMagnify, |
|
242 |
- mdiWindowClose: mdiWindowClose, |
|
243 |
- mdiHeart: mdiHeart, |
|
244 |
- mdiHeartOutline: mdiHeartOutline, |
|
245 |
- showModal: false, |
|
246 |
- searchOpen: false, // 사진 상세보기 모달창 |
|
247 |
- searchOpen2: false, // 단원 마친 후, 사진 촬영 여부 선택 모달창 |
|
248 |
- showCameraModal: false, // 카메라 모달창 |
|
249 |
- photoTaken: false, |
|
250 |
- photo: null, //캡쳐 사진 |
|
251 |
- stream: null, |
|
637 |
+ data() { |
|
638 |
+ return { |
|
639 |
+ items: [ |
|
640 |
+ { |
|
641 |
+ imgSrc1: "client/resources/img/img11_1_s.png", |
|
642 |
+ imgSrc2: "client/resources/img/img12_1_s.png", |
|
643 |
+ imgSrc3: "client/resources/img/img11_2_s.png", |
|
644 |
+ imgSrc4: "client/resources/img/img12_2_s.png", |
|
645 |
+ isSecondImageVisible: false, |
|
646 |
+ }, |
|
647 |
+ ], |
|
648 |
+ mdiMagnify: mdiMagnify, |
|
649 |
+ mdiWindowClose: mdiWindowClose, |
|
650 |
+ mdiHeart: mdiHeart, |
|
651 |
+ mdiHeartOutline: mdiHeartOutline, |
|
652 |
+ showModal: false, |
|
653 |
+ searchOpen: false, // 사진 상세보기 모달창 |
|
654 |
+ searchOpen2: false, // 단원 마친 후, 사진 촬영 여부 선택 모달창 |
|
655 |
+ showCameraModal: false, // 카메라 모달창 |
|
656 |
+ photoTaken: false, |
|
657 |
+ photo: null, //캡쳐 사진 |
|
658 |
+ stream: null, |
|
252 | 659 |
|
253 |
- roadmapData: [], |
|
254 |
- labeledItems: [], |
|
660 |
+ roadmapData: [], |
|
661 |
+ labeledItems: [], |
|
255 | 662 |
|
256 |
- problemCounter: 0, |
|
257 |
- wordCounter: 0, |
|
258 |
- textCounter: 0, |
|
259 |
- evalCounter: 0, |
|
260 |
- book_id: null, |
|
261 |
- unit_id: null, |
|
663 |
+ problemCounter: 0, |
|
664 |
+ wordCounter: 0, |
|
665 |
+ textCounter: 0, |
|
666 |
+ evalCounter: 0, |
|
667 |
+ book_id: null, |
|
668 |
+ unit_id: null, |
|
262 | 669 |
|
263 |
- schedules: [], |
|
264 |
- nowSchedule: "", |
|
265 |
- state: "", |
|
266 |
- rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
267 |
- rabbitCompl: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
268 |
- rabbitEnd: false, |
|
670 |
+ schedules: [], |
|
671 |
+ nowSchedule: "", |
|
672 |
+ state: "", |
|
673 |
+ rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
674 |
+ rabbitCompl: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
675 |
+ rabbitEnd: false, |
|
269 | 676 |
|
270 |
- titleUnitName: "", |
|
271 |
- titleBookName: "", |
|
677 |
+ titleUnitName: "", |
|
678 |
+ titleBookName: "", |
|
272 | 679 |
|
273 |
- images: [], |
|
680 |
+ images: [], |
|
274 | 681 |
|
275 |
- selectedImage: [ |
|
276 |
- { |
|
277 |
- image: "", |
|
278 |
- unit: "", |
|
279 |
- date: "", |
|
280 |
- name: "", |
|
281 |
- heart: "", |
|
282 |
- fileMngId: "", |
|
283 |
- }, |
|
284 |
- ], |
|
682 |
+ selectedImage: [ |
|
683 |
+ { |
|
684 |
+ image: "", |
|
685 |
+ unit: "", |
|
686 |
+ date: "", |
|
687 |
+ name: "", |
|
688 |
+ heart: "", |
|
689 |
+ fileMngId: "", |
|
690 |
+ }, |
|
691 |
+ ], |
|
285 | 692 |
|
286 |
- isHeartFilled: false, // 하트가 채워졌는지 여부 |
|
693 |
+ isHeartFilled: false, // 하트가 채워졌는지 여부 |
|
287 | 694 |
|
288 |
- problemType: null, |
|
289 |
- wordBookType: null, |
|
290 |
- wordContentList: [], |
|
291 |
- }; |
|
695 |
+ problemType: null, |
|
696 |
+ wordBookType: null, |
|
697 |
+ wordContentList: [], |
|
698 |
+ }; |
|
699 |
+ }, |
|
700 |
+ methods: { |
|
701 |
+ toggleHeart(heart, fileMngId) { |
|
702 |
+ this.isHeartFilled = !this.isHeartFilled; // 하트 상태 토글 |
|
703 |
+ |
|
704 |
+ if (this.isHeartFilled) var calHeart = heart + 1; |
|
705 |
+ else var calHeart = heart - 1; |
|
706 |
+ |
|
707 |
+ // 하트 수를 증가시키기 위한 API 요청 |
|
708 |
+ axios |
|
709 |
+ .post("/photo/likeUpdate.json", { |
|
710 |
+ likeData: calHeart, |
|
711 |
+ fileMngId: fileMngId, |
|
712 |
+ }) |
|
713 |
+ .then((response) => { |
|
714 |
+ this.selectedImage.heart = calHeart; |
|
715 |
+ }) |
|
716 |
+ .catch((error) => { |
|
717 |
+ console.error("Error updating heart:", error); |
|
718 |
+ }); |
|
292 | 719 |
}, |
293 |
- methods: { |
|
294 |
- toggleHeart(heart, fileMngId) { |
|
295 |
- this.isHeartFilled = !this.isHeartFilled; // 하트 상태 토글 |
|
720 |
+ checkAndFetchData() { |
|
721 |
+ console.log("받은 Book ID:", this.getBookId); |
|
722 |
+ console.log("받은 Unit ID:", this.getUnitId); |
|
723 |
+ const book_id = this.getBookId; |
|
724 |
+ const unit_id = this.getUnitId; |
|
296 | 725 |
|
297 |
- if (this.isHeartFilled) var calHeart = heart + 1; |
|
298 |
- else var calHeart = heart - 1; |
|
726 |
+ if (!book_id || !unit_id) { |
|
727 |
+ console.error("book_id 또는 unit_id가 설정되지 않았습니다."); |
|
728 |
+ return; |
|
729 |
+ } |
|
730 |
+ this.fetchImage(unit_id); |
|
731 |
+ this.fetchSchedule(unit_id, book_id); |
|
732 |
+ this.fetchRoadmapData(unit_id, book_id); |
|
733 |
+ this.fetchRabbit(); |
|
299 | 734 |
|
300 |
- // 하트 수를 증가시키기 위한 API 요청 |
|
301 |
- axios |
|
302 |
- .post("/photo/likeUpdate.json", { |
|
303 |
- likeData: calHeart, |
|
304 |
- fileMngId: fileMngId, |
|
305 |
- }) |
|
306 |
- .then((response) => { |
|
307 |
- this.selectedImage.heart = calHeart; |
|
308 |
- }) |
|
309 |
- .catch((error) => { |
|
310 |
- console.error("Error updating heart:", error); |
|
311 |
- }); |
|
735 |
+ this.unit_id = unit_id; |
|
736 |
+ this.book_id = book_id; |
|
737 |
+ |
|
738 |
+ if (this.$route.query.reCapture == "true") { |
|
739 |
+ this.openCameraModal(); |
|
740 |
+ } |
|
741 |
+ |
|
742 |
+ this.searchStdId(); |
|
743 |
+ }, |
|
744 |
+ |
|
745 |
+ //은진 |
|
746 |
+ buttonSearch(image) { |
|
747 |
+ this.isHeartFilled = false; |
|
748 |
+ this.selectedImage.name = image.stdId; |
|
749 |
+ this.selectedImage.image = image.url; |
|
750 |
+ this.selectedImage.unit = this.titleUnitName; |
|
751 |
+ this.selectedImage.date = image.fileRegDate.split(" ")[0]; |
|
752 |
+ this.selectedImage.heart = image.likeData; |
|
753 |
+ this.selectedImage.fileMngId = image.fileMngId; |
|
754 |
+ this.searchOpen = true; |
|
755 |
+ }, |
|
756 |
+ fetchImage(unit_id) { |
|
757 |
+ axios({ |
|
758 |
+ url: "/photo/photoUnitList.json", |
|
759 |
+ method: "post", |
|
760 |
+ headers: { |
|
761 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
312 | 762 |
}, |
313 |
- checkAndFetchData() { |
|
314 |
- console.log("받은 Book ID:", this.getBookId); |
|
315 |
- console.log("받은 Unit ID:", this.getUnitId); |
|
316 |
- const book_id = this.getBookId; |
|
317 |
- const unit_id = this.getUnitId; |
|
318 |
- |
|
319 |
- if (!book_id || !unit_id) { |
|
320 |
- console.error("book_id 또는 unit_id가 설정되지 않았습니다."); |
|
321 |
- return; |
|
322 |
- } |
|
323 |
- this.fetchImage(unit_id); |
|
324 |
- this.fetchSchedule(unit_id, book_id); |
|
325 |
- this.fetchRoadmapData(unit_id, book_id); |
|
326 |
- this.fetchRabbit(); |
|
327 |
- |
|
328 |
- this.unit_id = unit_id; |
|
329 |
- this.book_id = book_id; |
|
330 |
- |
|
331 |
- if (this.$route.query.reCapture == "true") { |
|
332 |
- this.openCameraModal(); |
|
333 |
- } |
|
334 |
- |
|
335 |
- this.searchStdId(); |
|
763 |
+ data: { |
|
764 |
+ unitId: unit_id, |
|
765 |
+ sclsId: "1", |
|
336 | 766 |
}, |
767 |
+ }) |
|
768 |
+ .then((response) => { |
|
769 |
+ this.file = response.data; |
|
337 | 770 |
|
338 |
- //은진 |
|
339 |
- buttonSearch(image) { |
|
340 |
- this.isHeartFilled = false; |
|
341 |
- this.selectedImage.name = image.stdId; |
|
342 |
- this.selectedImage.image = image.url; |
|
343 |
- this.selectedImage.unit = this.titleUnitName; |
|
344 |
- this.selectedImage.date = image.fileRegDate.split(" ")[0]; |
|
345 |
- this.selectedImage.heart = image.likeData; |
|
346 |
- this.selectedImage.fileMngId = image.fileMngId; |
|
347 |
- this.searchOpen = true; |
|
348 |
- }, |
|
349 |
- fetchImage(unit_id) { |
|
350 |
- axios({ |
|
351 |
- url: "/photo/photoUnitList.json", |
|
352 |
- method: "post", |
|
353 |
- headers: { |
|
354 |
- "Content-Type": "application/json; charset=UTF-8", |
|
355 |
- }, |
|
356 |
- data: { |
|
357 |
- unitId: unit_id, |
|
358 |
- sclsId: "1", |
|
359 |
- }, |
|
771 |
+ const findFilePromises = this.file.map((f) => |
|
772 |
+ this.findFile(f.file_mng_id) |
|
773 |
+ ); |
|
774 |
+ |
|
775 |
+ return Promise.all(findFilePromises); |
|
776 |
+ }) |
|
777 |
+ .then((fileResults) => { |
|
778 |
+ this.images = this.file |
|
779 |
+ .map((file, index) => { |
|
780 |
+ const result = fileResults[index]; |
|
781 |
+ if (result) { |
|
782 |
+ return { |
|
783 |
+ url: "http://165.229.169.113:9080/" + `${result.fileRpath}`, |
|
784 |
+ fileId: result.fileId, |
|
785 |
+ fileNm: result.fileNm, |
|
786 |
+ fileRegDate: result.regDt, |
|
787 |
+ likeData: file.like_data, |
|
788 |
+ stdId: file.user_nm, |
|
789 |
+ fileMngId: result.fileMngId, |
|
790 |
+ }; |
|
791 |
+ } |
|
792 |
+ return null; |
|
360 | 793 |
}) |
361 |
- .then((response) => { |
|
362 |
- this.file = response.data; |
|
794 |
+ .filter((image) => image !== null); |
|
795 |
+ }) |
|
796 |
+ .catch((error) => { |
|
797 |
+ console.error("Error fetching images:", error); |
|
798 |
+ }); |
|
799 |
+ }, |
|
800 |
+ async findFile(file_mng_id) { |
|
801 |
+ try { |
|
802 |
+ const res = await axios({ |
|
803 |
+ url: "/file/find.json", |
|
804 |
+ method: "post", |
|
805 |
+ headers: { |
|
806 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
807 |
+ }, |
|
808 |
+ data: { |
|
809 |
+ file_mng_id: file_mng_id, |
|
810 |
+ }, |
|
811 |
+ }); |
|
812 |
+ return res.data.list[0]; |
|
813 |
+ } catch (error) { |
|
814 |
+ console.log("result - error : ", error); |
|
815 |
+ return null; |
|
816 |
+ } |
|
817 |
+ }, |
|
818 |
+ goToPageImg(page) { |
|
819 |
+ const canvas = document.querySelector("canvas"); |
|
820 |
+ const dataURL = canvas.toDataURL("image/png"); |
|
363 | 821 |
|
364 |
- const findFilePromises = this.file.map((f) => this.findFile(f.file_mng_id)); |
|
822 |
+ this.$router.push({ |
|
823 |
+ name: page, |
|
824 |
+ query: { image: encodeURIComponent(dataURL) }, |
|
825 |
+ }); |
|
826 |
+ }, |
|
365 | 827 |
|
366 |
- return Promise.all(findFilePromises); |
|
367 |
- }) |
|
368 |
- .then((fileResults) => { |
|
369 |
- this.images = this.file |
|
370 |
- .map((file, index) => { |
|
371 |
- const result = fileResults[index]; |
|
372 |
- if (result) { |
|
373 |
- return { |
|
374 |
- url: "http://165.229.169.113:9080/" + `${result.fileRpath}`, |
|
375 |
- fileId: result.fileId, |
|
376 |
- fileNm: result.fileNm, |
|
377 |
- fileRegDate: result.regDt, |
|
378 |
- likeData: file.like_data, |
|
379 |
- stdId: file.user_nm, |
|
380 |
- fileMngId: result.fileMngId, |
|
381 |
- }; |
|
382 |
- } |
|
383 |
- return null; |
|
384 |
- }) |
|
385 |
- .filter((image) => image !== null); |
|
386 |
- }) |
|
387 |
- .catch((error) => { |
|
388 |
- console.error("Error fetching images:", error); |
|
389 |
- }); |
|
390 |
- }, |
|
391 |
- async findFile(file_mng_id) { |
|
392 |
- try { |
|
393 |
- const res = await axios({ |
|
394 |
- url: "/file/find.json", |
|
395 |
- method: "post", |
|
396 |
- headers: { |
|
397 |
- "Content-Type": "application/json; charset=UTF-8", |
|
398 |
- }, |
|
399 |
- data: { |
|
400 |
- file_mng_id: file_mng_id, |
|
401 |
- }, |
|
402 |
- }); |
|
403 |
- return res.data.list[0]; |
|
404 |
- } catch (error) { |
|
405 |
- console.log("result - error : ", error); |
|
406 |
- return null; |
|
407 |
- } |
|
408 |
- }, |
|
409 |
- goToPageImg(page) { |
|
410 |
- const canvas = document.querySelector("canvas"); |
|
411 |
- const dataURL = canvas.toDataURL("image/png"); |
|
828 |
+ fetchRabbit() { |
|
829 |
+ for (var i = 0; i < 12; i++) { |
|
830 |
+ this.rabbitPos[i] = false; |
|
831 |
+ } |
|
412 | 832 |
|
413 |
- this.$router.push({ name: page, query: { image: encodeURIComponent(dataURL) } }); |
|
414 |
- }, |
|
833 |
+ if (this.$route.query.value) { |
|
834 |
+ this.rabbitPos[parseInt(this.$route.query.value, 10) + 1] = true; |
|
835 |
+ for (var i = 0; i < this.$route.query.value; i++) { |
|
836 |
+ this.rabbitCompl[i + 1] = true; |
|
837 |
+ } |
|
415 | 838 |
|
416 |
- fetchRabbit() { |
|
417 |
- for (var i = 0; i < 12; i++) { |
|
418 |
- this.rabbitPos[i] = false; |
|
419 |
- } |
|
420 |
- |
|
421 |
- if (this.$route.query.value) { |
|
422 |
- this.rabbitPos[parseInt(this.$route.query.value, 10) + 1] = true; |
|
423 |
- for (var i = 0; i < this.$route.query.value; i++) { |
|
424 |
- this.rabbitCompl[i + 1] = true; |
|
425 |
- } |
|
426 |
- |
|
427 |
- if (this.$route.query.value === "11") { |
|
428 |
- this.rabbitEnd = true; |
|
429 |
- setTimeout(() => { |
|
430 |
- this.searchOpen2 = true; |
|
431 |
- }, 1000); |
|
432 |
- } |
|
433 |
- } else this.rabbitPos[0] = true; |
|
434 |
- }, |
|
435 |
- fetchSchedule(unit_id, book_id) { |
|
436 |
- axios({ |
|
437 |
- url: "/schedule/selectSchedule.json", |
|
438 |
- method: "post", |
|
439 |
- headers: { |
|
440 |
- "Content-Type": "application/json; charset=UTF-8", |
|
441 |
- }, |
|
442 |
- data: { |
|
443 |
- stdId: "2", |
|
444 |
- }, |
|
445 |
- }) |
|
446 |
- .then((response) => { |
|
447 |
- this.schedules = response.data; |
|
448 |
- |
|
449 |
- if (this.schedules.length == 0) { |
|
450 |
- this.state = "notRegistered"; |
|
451 |
- } else { |
|
452 |
- const allFinished = this.schedules.every((schedule) => schedule.finish === "T"); |
|
453 |
- if (allFinished) { |
|
454 |
- this.state = "finish"; |
|
455 |
- } else { |
|
456 |
- this.nowSchedule = this.schedules.find((schedule) => schedule.finish === null || schedule.finish === "F"); |
|
457 |
- if (this.nowSchedule) { |
|
458 |
- this.fetchRoadmapData(unit_id, book_id); |
|
459 |
- this.state = "studying"; |
|
460 |
- } else { |
|
461 |
- this.state = "notRegistered"; |
|
462 |
- } |
|
463 |
- } |
|
464 |
- } |
|
465 |
- }) |
|
466 |
- .catch((error) => { |
|
467 |
- console.error("Error fetching roadmap data:", error); |
|
468 |
- }); |
|
469 |
- }, |
|
470 |
- finishSchedule() { |
|
471 |
- axios({ |
|
472 |
- url: "/schedule/scheduleUpdate.json", |
|
473 |
- method: "post", |
|
474 |
- headers: { |
|
475 |
- "Content-Type": "application/json; charset=UTF-8", |
|
476 |
- }, |
|
477 |
- data: { |
|
478 |
- scheduleId: this.nowSchedule.schdl_id, |
|
479 |
- finish: "T", |
|
480 |
- }, |
|
481 |
- }) |
|
482 |
- .then((response) => { |
|
483 |
- const nextSchedule = this.schedules.find((schedule) => schedule.schdl_id > this.nowSchedule.schdl_id); |
|
484 |
- alert("학습을 완료했습니다!"); |
|
485 |
- |
|
486 |
- if (nextSchedule) { |
|
487 |
- this.nowSchedule = nextSchedule; |
|
488 |
- this.fetchSchedule(nextSchedule.unit_id, nextSchedule.book_id); |
|
489 |
- this.fetchRoadmapData(nextSchedule.unit_id, nextSchedule.book_id); |
|
490 |
- this.$router.push({ name: "Dashboard", query: { unit_id: nextSchedule.unit_id, book_id: nextSchedule.book_id } }); |
|
491 |
- } else { |
|
492 |
- alert("모든 학습을 완료했습니다!"); |
|
493 |
- this.state = "finish"; |
|
494 |
- } |
|
495 |
- }) |
|
496 |
- .catch((error) => { |
|
497 |
- console.error("Error updating schedule:", error); |
|
498 |
- }); |
|
499 |
- }, |
|
500 |
- fetchRoadmapData(unit_id, book_id) { |
|
501 |
- axios({ |
|
502 |
- url: "/unitLearning/find.json", |
|
503 |
- method: "post", |
|
504 |
- headers: { |
|
505 |
- "Content-Type": "application/json; charset=UTF-8", |
|
506 |
- }, |
|
507 |
- data: { |
|
508 |
- unit_id: unit_id, |
|
509 |
- book_id: book_id, |
|
510 |
- }, |
|
511 |
- }) |
|
512 |
- .then((response) => { |
|
513 |
- if (response.data.length != 0) { |
|
514 |
- this.roadmapData = response.data; |
|
515 |
- this.titleUnitName = this.roadmapData[0].unit_nm; |
|
516 |
- this.titleBookName = this.roadmapData[0].book_nm; |
|
517 |
- this.labeledItems = this.processedRoadmap; |
|
518 |
- } else { |
|
519 |
- this.state = "noProblem"; |
|
520 |
- } |
|
521 |
- }) |
|
522 |
- .catch((error) => { |
|
523 |
- this.state = "noProblem"; |
|
524 |
- console.error("Error fetching roadmap data:", error); |
|
525 |
- }); |
|
526 |
- }, |
|
527 |
- toggleImage(index) { |
|
528 |
- this.items[index].isSecondImageVisible = !this.items[index].isSecondImageVisible; |
|
529 |
- }, |
|
530 |
- ShowPopup() { |
|
531 |
- this.searchOpen2 = true; // 촬영 여부 묻는 모달창 열기 |
|
532 |
- }, |
|
533 |
- goToPage(page) { |
|
534 |
- // const { unit_id, book_id } = this.$route.query; |
|
535 |
- // this.$router.push({ name: page, query: { unit_id, book_id } }); |
|
536 |
- this.$router.push({ name: page }); |
|
537 |
- }, |
|
538 |
- storeLearningId(labeledItems) { |
|
539 |
- this.$store.dispatch("updateLearningData", labeledItems); |
|
540 |
- this.$store.dispatch("updateLearningId", labeledItems.learning_id); // 단어장에 사용중.. |
|
541 |
- console.log("레이블된 아이템: ", labeledItems); |
|
542 |
- if (labeledItems.label.startsWith("문제")) { |
|
543 |
- this.handleProblemDetail(this.$store.getters.currentLearningId); |
|
544 |
- this.goToPage(this.problemType); |
|
545 |
- } else if (labeledItems.label.startsWith("단어장")) { |
|
546 |
- this.handleWordBookContent(this.$store.getters.getLearningId); |
|
547 |
- } |
|
548 |
- |
|
549 |
- if (labeledItems.label.startsWith("지문")) { |
|
550 |
- //console.log("지문 아이디 : ", labeledItems.learning_id); |
|
551 |
- this.$store.dispatch("updateTextId", labeledItems.learning_id); |
|
552 |
- this.fetchTextType(labeledItems.learning_id); |
|
553 |
- } |
|
554 |
- }, |
|
555 |
- handleWordBookContent(item) { |
|
556 |
- console.log("처리할 단어장 콘텐츠 id: ", item); |
|
557 |
- |
|
558 |
- // 단어장 ID 가져오기 |
|
559 |
- axios |
|
560 |
- .post("/wordContent/selectWordContent.json", { |
|
561 |
- wordContentId: item, |
|
562 |
- }) |
|
563 |
- .then((response) => { |
|
564 |
- this.wordContentList = response.data; |
|
565 |
- |
|
566 |
- this.$store.dispatch('updateWdBookIdList', this.wordContentList.map(content => content.wd_book_id)); |
|
567 |
- this.$store.dispatch('updateCurrentWdBkIndex', 0); |
|
568 |
- console.log("저장한 단어장 id 리스트: ", this.$store.getters.getWdBookIdList); |
|
569 |
- |
|
570 |
- // 단어장 ID 리스트에서 첫 번째 단어장 ID를 사용 |
|
571 |
- const wdBookId = this.wordContentList[0].wd_book_id; |
|
572 |
- |
|
573 |
- // 단어장 정보 가져오기 |
|
574 |
- return axios.post("/wordbook/find.json", { |
|
575 |
- wdBookId: wdBookId, |
|
576 |
- }); |
|
577 |
- }) |
|
578 |
- .then((response) => { |
|
579 |
- const wordbookData = response.data; |
|
580 |
- |
|
581 |
- // 단어장 타입에 따라 페이지 설정 |
|
582 |
- if (wordbookData && wordbookData.wdBookTypeId) { |
|
583 |
- switch (wordbookData.wdBookTypeId) { |
|
584 |
- case "1": |
|
585 |
- this.wordBookType = "Chapter2"; |
|
586 |
- break; |
|
587 |
- case "2": |
|
588 |
- this.wordBookType = "Chapter2_3"; |
|
589 |
- break; |
|
590 |
- case "3": |
|
591 |
- this.wordBookType = "Chapter2_2"; |
|
592 |
- break; |
|
593 |
- case "4": |
|
594 |
- this.wordBookType = "Chapter2_9"; |
|
595 |
- break; |
|
596 |
- case "5": |
|
597 |
- this.wordBookType = "Chapter2_4"; |
|
598 |
- break; |
|
599 |
- default: |
|
600 |
- this.wordBookType = null; |
|
601 |
- } |
|
602 |
- } else { |
|
603 |
- console.error("wdBookTypeId가 없습니다."); |
|
604 |
- this.wordBookType = null; |
|
605 |
- } |
|
606 |
- |
|
607 |
- console.log("현재 단어장 타입: ", this.wordBookType); |
|
608 |
- this.goToPage(this.wordBookType); |
|
609 |
- }) |
|
610 |
- .catch((error) => { |
|
611 |
- console.error("단어장 정보를 불러오는 중 오류 발생:", error); |
|
612 |
- this.wordBookType = null; |
|
613 |
- }); |
|
614 |
- }, |
|
615 |
- // 지문 type 불러오기 |
|
616 |
- fetchTextType(text_id) { |
|
617 |
- axios({ |
|
618 |
- url: "/text/selectOneText.json", |
|
619 |
- method: "post", |
|
620 |
- headers: { |
|
621 |
- "Content-Type": "application/json; charset=UTF-8", |
|
622 |
- }, |
|
623 |
- data: { |
|
624 |
- textId: text_id, |
|
625 |
- }, |
|
626 |
- }) |
|
627 |
- .then((response) => { |
|
628 |
- const text_type_id = response.data[0].text_type_id; |
|
629 |
- // console.log("지문 유형 아이디 : ", text_type_id); |
|
630 |
- if (text_type_id === "2") { |
|
631 |
- this.goToPage("Chapter1_2"); |
|
632 |
- } else if (text_type_id === "3") { |
|
633 |
- this.goToPage("Chapter1_3"); |
|
634 |
- } |
|
635 |
- }) |
|
636 |
- .catch((err) => { |
|
637 |
- console.log("지문 에러 : ", err); |
|
638 |
- }); |
|
639 |
- }, |
|
640 |
- handleProblemDetail(item) { |
|
641 |
- if (item.prblm_type_id === "prblm_type_001") { |
|
642 |
- this.problemType = "Chapter3"; |
|
643 |
- } else if (item.prblm_type_id === "prblm_type_002") { |
|
644 |
- this.problemType = "Chapter3_1"; |
|
645 |
- } else if (item.prblm_type_id === "prblm_type_003") { |
|
646 |
- this.problemType = "Chapter3_2"; |
|
647 |
- } else if (item.prblm_type_id === "prblm_type_004") { |
|
648 |
- this.problemType = "Chapter3_3"; |
|
649 |
- } else if (item.prblm_type_id === "prblm_type_005") { |
|
650 |
- this.problemType = "Chapter3_3_1"; |
|
651 |
- } else if (item.prblm_type_id === "prblm_type_006") { |
|
652 |
- this.problemType = "Chapter3_4"; |
|
653 |
- } else if (item.prblm_type_id === "prblm_type_007") { |
|
654 |
- this.problemType = "Chapter3_5"; |
|
655 |
- } else if (item.prblm_type_id === "prblm_type_008") { |
|
656 |
- this.problemType = "Chapter3_6"; |
|
657 |
- } else if (item.prblm_type_id === "prblm_type_009") { |
|
658 |
- this.problemType = "Chapter3_7"; |
|
659 |
- } else if (item.prblm_type_id === "prblm_type_010") { |
|
660 |
- this.problemType = "Chapter3_8"; |
|
661 |
- } else if (item.prblm_type_id === "prblm_type_011") { |
|
662 |
- this.problemType = "Chapter3_9"; |
|
663 |
- } else if (item.prblm_type_id === "prblm_type_012") { |
|
664 |
- this.problemType = "Chapter3_10"; |
|
665 |
- } else if (item.prblm_type_id === "prblm_type_013") { |
|
666 |
- this.problemType = "Chapter3_11"; |
|
667 |
- } else if (item.prblm_type_id === "prblm_type_014") { |
|
668 |
- this.problemType = "Chapter3_12"; |
|
669 |
- } else if (item.prblm_type_id === "prblm_type_015") { |
|
670 |
- this.problemType = "Chapter3_13"; |
|
671 |
- } else if (item.prblm_type_id === "prblm_type_016") { |
|
672 |
- this.problemType = "Chapter3_14"; |
|
673 |
- } else if (item.prblm_type_id === "prblm_type_017") { |
|
674 |
- this.problemType = "Chapter3_15"; |
|
675 |
- } else if (item.prblm_type_id === "prblm_type_018") { |
|
676 |
- this.problemType = "Chapter2_8"; |
|
677 |
- } else if (item.prblm_type_id === "prblm_type_019") { |
|
678 |
- this.problemType = "Chapter2_7"; |
|
679 |
- } else if (item.prblm_type_id === "prblm_type_020") { |
|
680 |
- this.problemType = "Chapter2_5"; |
|
681 |
- } else if (item.prblm_type_id === "prblm_type_021") { |
|
682 |
- this.problemType = "Chapter2_6"; |
|
683 |
- } else if (item.prblm_type_id === "prblm_type_022") { |
|
684 |
- this.problemType = "Chapter2_10"; |
|
685 |
- } else if (item.prblm_type_id === "prblm_type_023") { |
|
686 |
- this.problemType = "Chapter2_11"; |
|
687 |
- } else if (item.prblm_type_id === "prblm_type_024") { |
|
688 |
- this.problemType = "Chapter2_13"; |
|
689 |
- } |
|
690 |
- }, |
|
691 |
- openCameraModal() { |
|
692 |
- this.closeModal(); |
|
693 |
- |
|
694 |
- this.showCameraModal = true; |
|
695 |
- navigator.mediaDevices |
|
696 |
- .getUserMedia({ video: true }) |
|
697 |
- .then((stream) => { |
|
698 |
- const modalVideo = this.$refs.modalVideoElement; |
|
699 |
- modalVideo.srcObject = stream; |
|
700 |
- this.stream = stream; |
|
701 |
- }) |
|
702 |
- .catch((error) => { |
|
703 |
- console.log("error>>>>>>>>", error); |
|
704 |
- alert("웹캠이 필요한 기능입니다!"); |
|
705 |
- this.closeModal(); // 모달창을 닫음 |
|
706 |
- }); |
|
707 |
- }, |
|
708 |
- closeModal() { |
|
709 |
- this.searchOpen = false; |
|
710 |
- this.searchOpen2 = false; |
|
711 |
- this.showCameraModal = false; |
|
712 |
- this.photoTaken = false; |
|
713 |
- this.photo = null; |
|
714 |
- |
|
715 |
- //스트림 종료 |
|
716 |
- if (this.stream) { |
|
717 |
- let tracks = this.stream.getTracks(); |
|
718 |
- tracks.forEach((track) => track.stop()); |
|
719 |
- this.stream = null; |
|
720 |
- } |
|
721 |
- }, |
|
722 |
- |
|
723 |
- onVideoLoaded() { |
|
724 |
- const video = this.$refs.modalVideoElement; |
|
725 |
- const canvas = this.$refs.canvas; |
|
726 |
- const ctx = canvas.getContext("2d"); |
|
727 |
- |
|
728 |
- canvas.width = video.videoWidth; |
|
729 |
- canvas.height = video.videoHeight; |
|
730 |
- }, |
|
731 |
- takePhoto() { |
|
732 |
- const video = this.$refs.modalVideoElement; |
|
733 |
- const canvas = this.$refs.canvas; |
|
734 |
- const ctx = canvas.getContext("2d"); |
|
735 |
- |
|
736 |
- ctx.save(); // 현재 상태 저장 |
|
737 |
- |
|
738 |
- // 캔버스 좌우 반전 |
|
739 |
- ctx.scale(-1, 1); |
|
740 |
- ctx.drawImage(video, -canvas.width, 0, canvas.width, canvas.height); |
|
741 |
- |
|
742 |
- ctx.restore(); |
|
743 |
- |
|
744 |
- const overlayImg = new Image(); |
|
745 |
- overlayImg.src = "client/resources/img/camera-rabbit.png"; |
|
746 |
- overlayImg.onload = () => { |
|
747 |
- const overlayWidth = canvas.width * 0.4; |
|
748 |
- const overlayHeight = (overlayImg.height / overlayImg.width) * overlayWidth; |
|
749 |
- const overlayX = canvas.width - overlayWidth; |
|
750 |
- const overlayY = canvas.height - overlayHeight; |
|
751 |
- |
|
752 |
- // 오버레이 이미지 그리기 |
|
753 |
- ctx.drawImage(overlayImg, overlayX, overlayY, overlayWidth, overlayHeight); |
|
754 |
- |
|
755 |
- // 사진 저장 함수 호출 |
|
756 |
- const dataURL = canvas.toDataURL("image/png"); |
|
757 |
- this.$router.push({ name: "PhotoEdit", query: { image: encodeURIComponent(dataURL), unit_id: this.unit_id, book_id: this.book_id } }); |
|
758 |
- }; |
|
759 |
- }, |
|
760 |
- |
|
761 |
- buttonSearch2() { |
|
839 |
+ if (this.$route.query.value === "11") { |
|
840 |
+ this.rabbitEnd = true; |
|
841 |
+ setTimeout(() => { |
|
762 | 842 |
this.searchOpen2 = true; |
763 |
- }, |
|
764 |
- closeBtn() { |
|
765 |
- this.searchOpen = false; |
|
766 |
- }, |
|
767 |
- |
|
768 |
- // 유저 아이디를 unit 아이디를 통해 가져오기 |
|
769 |
- searchStdId() { |
|
770 |
- const userInfo = this.$store.getters.getUserInfo; |
|
771 |
- axios({ |
|
772 |
- url: "/userclass/searchStdId.json", |
|
773 |
- method: "post", |
|
774 |
- headers: { |
|
775 |
- "Content-Type": "application/json; charset=UTF-8", |
|
776 |
- }, |
|
777 |
- data: { |
|
778 |
- userId: userInfo.userId, |
|
779 |
- unitId: this.unit_id, |
|
780 |
- }, |
|
781 |
- }) |
|
782 |
- .then((response) => { |
|
783 |
- this.$store.commit('setStdId', response.data); |
|
784 |
- }) |
|
785 |
- .catch((err) => { |
|
786 |
- console.log("지문 에러 : ", err); |
|
787 |
- }); |
|
788 |
- }, |
|
789 |
- |
|
843 |
+ }, 1000); |
|
844 |
+ } |
|
845 |
+ } else this.rabbitPos[0] = true; |
|
790 | 846 |
}, |
791 |
- components: { |
|
792 |
- SvgIcon, |
|
793 |
- }, |
|
794 |
- mounted() { |
|
795 |
- console.log("main mounted"); |
|
796 |
- this.checkAndFetchData(); |
|
797 |
- // const { book_id, unit_id } = this.$route.query; |
|
798 |
- }, |
|
799 |
- watch: { |
|
800 |
- getBookId(newBookId) { |
|
801 |
- this.checkAndFetchData(); |
|
847 |
+ fetchSchedule(unit_id, book_id) { |
|
848 |
+ axios({ |
|
849 |
+ url: "/schedule/selectSchedule.json", |
|
850 |
+ method: "post", |
|
851 |
+ headers: { |
|
852 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
802 | 853 |
}, |
803 |
- getUnitId(newUnitId) { |
|
804 |
- this.checkAndFetchData(); |
|
854 |
+ data: { |
|
855 |
+ stdId: "2", |
|
805 | 856 |
}, |
857 |
+ }) |
|
858 |
+ .then((response) => { |
|
859 |
+ this.schedules = response.data; |
|
860 |
+ |
|
861 |
+ if (this.schedules.length == 0) { |
|
862 |
+ this.state = "notRegistered"; |
|
863 |
+ } else { |
|
864 |
+ const allFinished = this.schedules.every( |
|
865 |
+ (schedule) => schedule.finish === "T" |
|
866 |
+ ); |
|
867 |
+ if (allFinished) { |
|
868 |
+ this.state = "finish"; |
|
869 |
+ } else { |
|
870 |
+ this.nowSchedule = this.schedules.find( |
|
871 |
+ (schedule) => |
|
872 |
+ schedule.finish === null || schedule.finish === "F" |
|
873 |
+ ); |
|
874 |
+ if (this.nowSchedule) { |
|
875 |
+ this.fetchRoadmapData(unit_id, book_id); |
|
876 |
+ this.state = "studying"; |
|
877 |
+ } else { |
|
878 |
+ this.state = "notRegistered"; |
|
879 |
+ } |
|
880 |
+ } |
|
881 |
+ } |
|
882 |
+ }) |
|
883 |
+ .catch((error) => { |
|
884 |
+ console.error("Error fetching roadmap data:", error); |
|
885 |
+ }); |
|
806 | 886 |
}, |
807 |
- computed: { |
|
808 |
- ...mapGetters(["getBookId", "getUnitId"]), |
|
887 |
+ finishSchedule() { |
|
888 |
+ axios({ |
|
889 |
+ url: "/schedule/scheduleUpdate.json", |
|
890 |
+ method: "post", |
|
891 |
+ headers: { |
|
892 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
893 |
+ }, |
|
894 |
+ data: { |
|
895 |
+ scheduleId: this.nowSchedule.schdl_id, |
|
896 |
+ finish: "T", |
|
897 |
+ }, |
|
898 |
+ }) |
|
899 |
+ .then((response) => { |
|
900 |
+ const nextSchedule = this.schedules.find( |
|
901 |
+ (schedule) => schedule.schdl_id > this.nowSchedule.schdl_id |
|
902 |
+ ); |
|
903 |
+ alert("학습을 완료했습니다!"); |
|
809 | 904 |
|
810 |
- processedRoadmap() { |
|
811 |
- let problemCounter = 0; |
|
812 |
- let wordCounter = 0; |
|
813 |
- let textCounter = 0; |
|
814 |
- let evalCounter = 0; |
|
815 |
- |
|
816 |
- return this.roadmapData.map((item) => { |
|
817 |
- if (item.wd_cnt_id !== null) { |
|
818 |
- wordCounter++; |
|
819 |
- return { label: `단어장${wordCounter}`, learning_id: item.wd_cnt_id }; |
|
820 |
- } else if (item.text_id !== null) { |
|
821 |
- textCounter++; |
|
822 |
- return { label: `지문${textCounter}`, learning_id: item.text_id }; |
|
823 |
- } else if (item.eval_id !== null) { |
|
824 |
- evalCounter++; |
|
825 |
- return { label: evalCounter === 1 ? "중간평가" : "최종평가", learning_id: item.eval_id }; |
|
826 |
- } else { |
|
827 |
- problemCounter++; |
|
828 |
- return { label: `문제${problemCounter}`, learning_id: item.prblm_id }; |
|
829 |
- } |
|
905 |
+ if (nextSchedule) { |
|
906 |
+ this.nowSchedule = nextSchedule; |
|
907 |
+ this.fetchSchedule(nextSchedule.unit_id, nextSchedule.book_id); |
|
908 |
+ this.fetchRoadmapData(nextSchedule.unit_id, nextSchedule.book_id); |
|
909 |
+ this.$router.push({ |
|
910 |
+ name: "Dashboard", |
|
911 |
+ query: { |
|
912 |
+ unit_id: nextSchedule.unit_id, |
|
913 |
+ book_id: nextSchedule.book_id, |
|
914 |
+ }, |
|
830 | 915 |
}); |
916 |
+ } else { |
|
917 |
+ alert("모든 학습을 완료했습니다!"); |
|
918 |
+ this.state = "finish"; |
|
919 |
+ } |
|
920 |
+ }) |
|
921 |
+ .catch((error) => { |
|
922 |
+ console.error("Error updating schedule:", error); |
|
923 |
+ }); |
|
924 |
+ }, |
|
925 |
+ fetchRoadmapData(unit_id, book_id) { |
|
926 |
+ axios({ |
|
927 |
+ url: "/unitLearning/find.json", |
|
928 |
+ method: "post", |
|
929 |
+ headers: { |
|
930 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
831 | 931 |
}, |
932 |
+ data: { |
|
933 |
+ unit_id: unit_id, |
|
934 |
+ book_id: book_id, |
|
935 |
+ }, |
|
936 |
+ }) |
|
937 |
+ .then((response) => { |
|
938 |
+ if (response.data.length != 0) { |
|
939 |
+ this.roadmapData = response.data; |
|
940 |
+ this.titleUnitName = this.roadmapData[0].unit_nm; |
|
941 |
+ this.titleBookName = this.roadmapData[0].book_nm; |
|
942 |
+ this.labeledItems = this.processedRoadmap; |
|
943 |
+ } else { |
|
944 |
+ this.state = "noProblem"; |
|
945 |
+ } |
|
946 |
+ }) |
|
947 |
+ .catch((error) => { |
|
948 |
+ this.state = "noProblem"; |
|
949 |
+ console.error("Error fetching roadmap data:", error); |
|
950 |
+ }); |
|
832 | 951 |
}, |
833 |
- beforeDestroy() { |
|
834 |
- // 컴포넌트가 파괴되기 전에 리스너 제거 |
|
835 |
- window.removeEventListener("resize", this.updateCanvasRect); |
|
836 |
- this.$refs.canvas.removeEventListener("click", this.handleCanvasClick); |
|
952 |
+ toggleImage(index) { |
|
953 |
+ this.items[index].isSecondImageVisible = |
|
954 |
+ !this.items[index].isSecondImageVisible; |
|
837 | 955 |
}, |
956 |
+ ShowPopup() { |
|
957 |
+ this.searchOpen2 = true; // 촬영 여부 묻는 모달창 열기 |
|
958 |
+ }, |
|
959 |
+ goToPage(page) { |
|
960 |
+ // const { unit_id, book_id } = this.$route.query; |
|
961 |
+ // this.$router.push({ name: page, query: { unit_id, book_id } }); |
|
962 |
+ this.$router.push({ name: page }); |
|
963 |
+ }, |
|
964 |
+ storeLearningId(labeledItems) { |
|
965 |
+ this.$store.dispatch("updateLearningData", labeledItems); |
|
966 |
+ this.$store.dispatch("updateLearningId", labeledItems.learning_id); // 단어장에 사용중.. |
|
967 |
+ |
|
968 |
+ console.log("레이블된 아이템: ", labeledItems); |
|
969 |
+ if (labeledItems.label.startsWith("문제")) { |
|
970 |
+ this.handleProblemDetail(this.$store.getters.currentLearningId); |
|
971 |
+ this.goToPage(this.problemType); |
|
972 |
+ } else if (labeledItems.label.startsWith("단어장")) { |
|
973 |
+ this.handleWordBookContent(this.$store.getters.getLearningId); |
|
974 |
+ } |
|
975 |
+ |
|
976 |
+ if (labeledItems.label.startsWith("지문")) { |
|
977 |
+ //console.log("지문 아이디 : ", labeledItems.learning_id); |
|
978 |
+ this.$store.dispatch("updateTextId", labeledItems.learning_id); |
|
979 |
+ this.fetchTextType(labeledItems.learning_id); |
|
980 |
+ } |
|
981 |
+ }, |
|
982 |
+ handleWordBookContent(item) { |
|
983 |
+ console.log("처리할 단어장 콘텐츠 id: ", item); |
|
984 |
+ |
|
985 |
+ // 단어장 ID 가져오기 |
|
986 |
+ axios |
|
987 |
+ .post("/wordContent/selectWordContent.json", { |
|
988 |
+ wordContentId: item, |
|
989 |
+ }) |
|
990 |
+ .then((response) => { |
|
991 |
+ this.wordContentList = response.data; |
|
992 |
+ |
|
993 |
+ this.$store.dispatch( |
|
994 |
+ "updateWdBookIdList", |
|
995 |
+ this.wordContentList.map((content) => content.wd_book_id) |
|
996 |
+ ); |
|
997 |
+ this.$store.dispatch("updateCurrentWdBkIndex", 0); |
|
998 |
+ console.log( |
|
999 |
+ "저장한 단어장 id 리스트: ", |
|
1000 |
+ this.$store.getters.getWdBookIdList |
|
1001 |
+ ); |
|
1002 |
+ |
|
1003 |
+ // 단어장 ID 리스트에서 첫 번째 단어장 ID를 사용 |
|
1004 |
+ const wdBookId = this.wordContentList[0].wd_book_id; |
|
1005 |
+ |
|
1006 |
+ // 단어장 정보 가져오기 |
|
1007 |
+ return axios.post("/wordbook/find.json", { |
|
1008 |
+ wdBookId: wdBookId, |
|
1009 |
+ }); |
|
1010 |
+ }) |
|
1011 |
+ .then((response) => { |
|
1012 |
+ const wordbookData = response.data; |
|
1013 |
+ |
|
1014 |
+ // 단어장 타입에 따라 페이지 설정 |
|
1015 |
+ if (wordbookData && wordbookData.wdBookTypeId) { |
|
1016 |
+ switch (wordbookData.wdBookTypeId) { |
|
1017 |
+ case "1": |
|
1018 |
+ this.wordBookType = "Chapter2"; |
|
1019 |
+ break; |
|
1020 |
+ case "2": |
|
1021 |
+ this.wordBookType = "Chapter2_3"; |
|
1022 |
+ break; |
|
1023 |
+ case "3": |
|
1024 |
+ this.wordBookType = "Chapter2_2"; |
|
1025 |
+ break; |
|
1026 |
+ case "4": |
|
1027 |
+ this.wordBookType = "Chapter2_9"; |
|
1028 |
+ break; |
|
1029 |
+ case "5": |
|
1030 |
+ this.wordBookType = "Chapter2_4"; |
|
1031 |
+ break; |
|
1032 |
+ default: |
|
1033 |
+ this.wordBookType = null; |
|
1034 |
+ } |
|
1035 |
+ } else { |
|
1036 |
+ console.error("wdBookTypeId가 없습니다."); |
|
1037 |
+ this.wordBookType = null; |
|
1038 |
+ } |
|
1039 |
+ |
|
1040 |
+ console.log("현재 단어장 타입: ", this.wordBookType); |
|
1041 |
+ this.goToPage(this.wordBookType); |
|
1042 |
+ }) |
|
1043 |
+ .catch((error) => { |
|
1044 |
+ console.error("단어장 정보를 불러오는 중 오류 발생:", error); |
|
1045 |
+ this.wordBookType = null; |
|
1046 |
+ }); |
|
1047 |
+ }, |
|
1048 |
+ // 지문 type 불러오기 |
|
1049 |
+ fetchTextType(text_id) { |
|
1050 |
+ axios({ |
|
1051 |
+ url: "/text/selectOneText.json", |
|
1052 |
+ method: "post", |
|
1053 |
+ headers: { |
|
1054 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
1055 |
+ }, |
|
1056 |
+ data: { |
|
1057 |
+ textId: text_id, |
|
1058 |
+ }, |
|
1059 |
+ }) |
|
1060 |
+ .then((response) => { |
|
1061 |
+ const text_type_id = response.data[0].text_type_id; |
|
1062 |
+ // console.log("지문 유형 아이디 : ", text_type_id); |
|
1063 |
+ if (text_type_id === "2") { |
|
1064 |
+ this.goToPage("Chapter1_2"); |
|
1065 |
+ } else if (text_type_id === "3") { |
|
1066 |
+ this.goToPage("Chapter1_3"); |
|
1067 |
+ } |
|
1068 |
+ }) |
|
1069 |
+ .catch((err) => { |
|
1070 |
+ console.log("지문 에러 : ", err); |
|
1071 |
+ }); |
|
1072 |
+ }, |
|
1073 |
+ handleProblemDetail(item) { |
|
1074 |
+ if (item.prblm_type_id === "prblm_type_001") { |
|
1075 |
+ this.problemType = "Chapter3"; |
|
1076 |
+ } else if (item.prblm_type_id === "prblm_type_002") { |
|
1077 |
+ this.problemType = "Chapter3_1"; |
|
1078 |
+ } else if (item.prblm_type_id === "prblm_type_003") { |
|
1079 |
+ this.problemType = "Chapter3_2"; |
|
1080 |
+ } else if (item.prblm_type_id === "prblm_type_004") { |
|
1081 |
+ this.problemType = "Chapter3_3"; |
|
1082 |
+ } else if (item.prblm_type_id === "prblm_type_005") { |
|
1083 |
+ this.problemType = "Chapter3_3_1"; |
|
1084 |
+ } else if (item.prblm_type_id === "prblm_type_006") { |
|
1085 |
+ this.problemType = "Chapter3_4"; |
|
1086 |
+ } else if (item.prblm_type_id === "prblm_type_007") { |
|
1087 |
+ this.problemType = "Chapter3_5"; |
|
1088 |
+ } else if (item.prblm_type_id === "prblm_type_008") { |
|
1089 |
+ this.problemType = "Chapter3_6"; |
|
1090 |
+ } else if (item.prblm_type_id === "prblm_type_009") { |
|
1091 |
+ this.problemType = "Chapter3_7"; |
|
1092 |
+ } else if (item.prblm_type_id === "prblm_type_010") { |
|
1093 |
+ this.problemType = "Chapter3_8"; |
|
1094 |
+ } else if (item.prblm_type_id === "prblm_type_011") { |
|
1095 |
+ this.problemType = "Chapter3_9"; |
|
1096 |
+ } else if (item.prblm_type_id === "prblm_type_012") { |
|
1097 |
+ this.problemType = "Chapter3_10"; |
|
1098 |
+ } else if (item.prblm_type_id === "prblm_type_013") { |
|
1099 |
+ this.problemType = "Chapter3_11"; |
|
1100 |
+ } else if (item.prblm_type_id === "prblm_type_014") { |
|
1101 |
+ this.problemType = "Chapter3_12"; |
|
1102 |
+ } else if (item.prblm_type_id === "prblm_type_015") { |
|
1103 |
+ this.problemType = "Chapter3_13"; |
|
1104 |
+ } else if (item.prblm_type_id === "prblm_type_016") { |
|
1105 |
+ this.problemType = "Chapter3_14"; |
|
1106 |
+ } else if (item.prblm_type_id === "prblm_type_017") { |
|
1107 |
+ this.problemType = "Chapter3_15"; |
|
1108 |
+ } else if (item.prblm_type_id === "prblm_type_018") { |
|
1109 |
+ this.problemType = "Chapter2_8"; |
|
1110 |
+ } else if (item.prblm_type_id === "prblm_type_019") { |
|
1111 |
+ this.problemType = "Chapter2_7"; |
|
1112 |
+ } else if (item.prblm_type_id === "prblm_type_020") { |
|
1113 |
+ this.problemType = "Chapter2_5"; |
|
1114 |
+ } else if (item.prblm_type_id === "prblm_type_021") { |
|
1115 |
+ this.problemType = "Chapter2_6"; |
|
1116 |
+ } else if (item.prblm_type_id === "prblm_type_022") { |
|
1117 |
+ this.problemType = "Chapter2_10"; |
|
1118 |
+ } else if (item.prblm_type_id === "prblm_type_023") { |
|
1119 |
+ this.problemType = "Chapter2_11"; |
|
1120 |
+ } else if (item.prblm_type_id === "prblm_type_024") { |
|
1121 |
+ this.problemType = "Chapter2_13"; |
|
1122 |
+ } |
|
1123 |
+ }, |
|
1124 |
+ openCameraModal() { |
|
1125 |
+ this.closeModal(); |
|
1126 |
+ |
|
1127 |
+ this.showCameraModal = true; |
|
1128 |
+ navigator.mediaDevices |
|
1129 |
+ .getUserMedia({ video: true }) |
|
1130 |
+ .then((stream) => { |
|
1131 |
+ const modalVideo = this.$refs.modalVideoElement; |
|
1132 |
+ modalVideo.srcObject = stream; |
|
1133 |
+ this.stream = stream; |
|
1134 |
+ }) |
|
1135 |
+ .catch((error) => { |
|
1136 |
+ console.log("error>>>>>>>>", error); |
|
1137 |
+ alert("웹캠이 필요한 기능입니다!"); |
|
1138 |
+ this.closeModal(); // 모달창을 닫음 |
|
1139 |
+ }); |
|
1140 |
+ }, |
|
1141 |
+ closeModal() { |
|
1142 |
+ this.searchOpen = false; |
|
1143 |
+ this.searchOpen2 = false; |
|
1144 |
+ this.showCameraModal = false; |
|
1145 |
+ this.photoTaken = false; |
|
1146 |
+ this.photo = null; |
|
1147 |
+ |
|
1148 |
+ //스트림 종료 |
|
1149 |
+ if (this.stream) { |
|
1150 |
+ let tracks = this.stream.getTracks(); |
|
1151 |
+ tracks.forEach((track) => track.stop()); |
|
1152 |
+ this.stream = null; |
|
1153 |
+ } |
|
1154 |
+ }, |
|
1155 |
+ |
|
1156 |
+ onVideoLoaded() { |
|
1157 |
+ const video = this.$refs.modalVideoElement; |
|
1158 |
+ const canvas = this.$refs.canvas; |
|
1159 |
+ const ctx = canvas.getContext("2d"); |
|
1160 |
+ |
|
1161 |
+ canvas.width = video.videoWidth; |
|
1162 |
+ canvas.height = video.videoHeight; |
|
1163 |
+ }, |
|
1164 |
+ takePhoto() { |
|
1165 |
+ const video = this.$refs.modalVideoElement; |
|
1166 |
+ const canvas = this.$refs.canvas; |
|
1167 |
+ const ctx = canvas.getContext("2d"); |
|
1168 |
+ |
|
1169 |
+ ctx.save(); // 현재 상태 저장 |
|
1170 |
+ |
|
1171 |
+ // 캔버스 좌우 반전 |
|
1172 |
+ ctx.scale(-1, 1); |
|
1173 |
+ ctx.drawImage(video, -canvas.width, 0, canvas.width, canvas.height); |
|
1174 |
+ |
|
1175 |
+ ctx.restore(); |
|
1176 |
+ |
|
1177 |
+ const overlayImg = new Image(); |
|
1178 |
+ overlayImg.src = "client/resources/img/camera-rabbit.png"; |
|
1179 |
+ overlayImg.onload = () => { |
|
1180 |
+ const overlayWidth = canvas.width * 0.4; |
|
1181 |
+ const overlayHeight = |
|
1182 |
+ (overlayImg.height / overlayImg.width) * overlayWidth; |
|
1183 |
+ const overlayX = canvas.width - overlayWidth; |
|
1184 |
+ const overlayY = canvas.height - overlayHeight; |
|
1185 |
+ |
|
1186 |
+ // 오버레이 이미지 그리기 |
|
1187 |
+ ctx.drawImage( |
|
1188 |
+ overlayImg, |
|
1189 |
+ overlayX, |
|
1190 |
+ overlayY, |
|
1191 |
+ overlayWidth, |
|
1192 |
+ overlayHeight |
|
1193 |
+ ); |
|
1194 |
+ |
|
1195 |
+ // 사진 저장 함수 호출 |
|
1196 |
+ const dataURL = canvas.toDataURL("image/png"); |
|
1197 |
+ this.$router.push({ |
|
1198 |
+ name: "PhotoEdit", |
|
1199 |
+ query: { |
|
1200 |
+ image: encodeURIComponent(dataURL), |
|
1201 |
+ unit_id: this.unit_id, |
|
1202 |
+ book_id: this.book_id, |
|
1203 |
+ }, |
|
1204 |
+ }); |
|
1205 |
+ }; |
|
1206 |
+ }, |
|
1207 |
+ |
|
1208 |
+ buttonSearch2() { |
|
1209 |
+ this.searchOpen2 = true; |
|
1210 |
+ }, |
|
1211 |
+ closeBtn() { |
|
1212 |
+ this.searchOpen = false; |
|
1213 |
+ }, |
|
1214 |
+ |
|
1215 |
+ // 유저 아이디를 unit 아이디를 통해 가져오기 |
|
1216 |
+ searchStdId() { |
|
1217 |
+ const userInfo = this.$store.getters.getUserInfo; |
|
1218 |
+ axios({ |
|
1219 |
+ url: "/userclass/searchStdId.json", |
|
1220 |
+ method: "post", |
|
1221 |
+ headers: { |
|
1222 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
1223 |
+ }, |
|
1224 |
+ data: { |
|
1225 |
+ userId: userInfo.userId, |
|
1226 |
+ unitId: this.unit_id, |
|
1227 |
+ }, |
|
1228 |
+ }) |
|
1229 |
+ .then((response) => { |
|
1230 |
+ this.$store.commit("setStdId", response.data); |
|
1231 |
+ }) |
|
1232 |
+ .catch((err) => { |
|
1233 |
+ console.log("지문 에러 : ", err); |
|
1234 |
+ }); |
|
1235 |
+ }, |
|
1236 |
+ }, |
|
1237 |
+ components: { |
|
1238 |
+ SvgIcon, |
|
1239 |
+ }, |
|
1240 |
+ mounted() { |
|
1241 |
+ console.log("main mounted"); |
|
1242 |
+ this.checkAndFetchData(); |
|
1243 |
+ // const { book_id, unit_id } = this.$route.query; |
|
1244 |
+ }, |
|
1245 |
+ watch: { |
|
1246 |
+ getBookId(newBookId) { |
|
1247 |
+ this.checkAndFetchData(); |
|
1248 |
+ }, |
|
1249 |
+ getUnitId(newUnitId) { |
|
1250 |
+ this.checkAndFetchData(); |
|
1251 |
+ }, |
|
1252 |
+ }, |
|
1253 |
+ computed: { |
|
1254 |
+ ...mapGetters(["getBookId", "getUnitId"]), |
|
1255 |
+ |
|
1256 |
+ processedRoadmap() { |
|
1257 |
+ let problemCounter = 0; |
|
1258 |
+ let wordCounter = 0; |
|
1259 |
+ let textCounter = 0; |
|
1260 |
+ let evalCounter = 0; |
|
1261 |
+ |
|
1262 |
+ return this.roadmapData.map((item) => { |
|
1263 |
+ if (item.wd_cnt_id !== null) { |
|
1264 |
+ wordCounter++; |
|
1265 |
+ return { |
|
1266 |
+ label: `단어장${wordCounter}`, |
|
1267 |
+ learning_id: item.wd_cnt_id, |
|
1268 |
+ seqNum: item.seq, |
|
1269 |
+ }; |
|
1270 |
+ } else if (item.text_id !== null) { |
|
1271 |
+ textCounter++; |
|
1272 |
+ return { |
|
1273 |
+ label: `지문${textCounter}`, |
|
1274 |
+ learning_id: item.text_id, |
|
1275 |
+ seqNum: item.seq, |
|
1276 |
+ }; |
|
1277 |
+ } else if (item.eval_id !== null) { |
|
1278 |
+ evalCounter++; |
|
1279 |
+ return { |
|
1280 |
+ label: evalCounter === 1 ? "중간평가" : "최종평가", |
|
1281 |
+ learning_id: item.eval_id, |
|
1282 |
+ seqNum: item.seq, |
|
1283 |
+ }; |
|
1284 |
+ } else { |
|
1285 |
+ problemCounter++; |
|
1286 |
+ return { |
|
1287 |
+ label: `문제${problemCounter}`, |
|
1288 |
+ learning_id: item.prblm_id, |
|
1289 |
+ seqNum: item.seq, |
|
1290 |
+ }; |
|
1291 |
+ } |
|
1292 |
+ }); |
|
1293 |
+ }, |
|
1294 |
+ }, |
|
1295 |
+ beforeDestroy() { |
|
1296 |
+ // 컴포넌트가 파괴되기 전에 리스너 제거 |
|
1297 |
+ window.removeEventListener("resize", this.updateCanvasRect); |
|
1298 |
+ this.$refs.canvas.removeEventListener("click", this.handleCanvasClick); |
|
1299 |
+ }, |
|
838 | 1300 |
}; |
839 | 1301 |
</script> |
840 | 1302 |
|
841 | 1303 |
<style scoped> |
842 | 1304 |
.body { |
843 |
- width: 1435px; |
|
844 |
- height: auto; |
|
845 |
- margin: 0 auto; |
|
1305 |
+ width: 1435px; |
|
1306 |
+ height: auto; |
|
1307 |
+ margin: 0 auto; |
|
846 | 1308 |
} |
847 | 1309 |
|
848 | 1310 |
#container { |
849 |
- position: relative; |
|
850 |
- margin: auto; |
|
851 |
- border: 10px #333 solid; |
|
852 |
- display: flex; |
|
853 |
- justify-content: center; |
|
854 |
- align-items: center; |
|
855 |
- z-index: 100; |
|
1311 |
+ position: relative; |
|
1312 |
+ margin: auto; |
|
1313 |
+ border: 10px #333 solid; |
|
1314 |
+ display: flex; |
|
1315 |
+ justify-content: center; |
|
1316 |
+ align-items: center; |
|
1317 |
+ z-index: 100; |
|
856 | 1318 |
} |
857 | 1319 |
|
858 | 1320 |
video { |
859 |
- width: 100%; |
|
860 |
- height: auto; |
|
861 |
- background-color: #666; |
|
1321 |
+ width: 100%; |
|
1322 |
+ height: auto; |
|
1323 |
+ background-color: #666; |
|
862 | 1324 |
} |
863 | 1325 |
|
864 | 1326 |
.mirrored { |
865 |
- transform: scaleX(-1); |
|
1327 |
+ transform: scaleX(-1); |
|
866 | 1328 |
} |
867 | 1329 |
|
868 | 1330 |
.new-btn:disabled { |
869 |
- background-color: #fff3d7; |
|
870 |
- cursor: not-allowed; |
|
1331 |
+ background-color: #fff3d7; |
|
1332 |
+ cursor: not-allowed; |
|
871 | 1333 |
} |
872 | 1334 |
|
873 | 1335 |
.sticker { |
874 |
- position: absolute; |
|
875 |
- cursor: move; |
|
1336 |
+ position: absolute; |
|
1337 |
+ cursor: move; |
|
876 | 1338 |
} |
877 | 1339 |
|
878 | 1340 |
.sticker-handle { |
879 |
- width: 15px; |
|
880 |
- height: 15px; |
|
881 |
- background: rgba(255, 255, 255, 0.521); |
|
882 |
- position: absolute; |
|
883 |
- bottom: 0; |
|
884 |
- right: 0; |
|
885 |
- cursor: nwse-resize; |
|
886 |
- font-size: 13px; |
|
887 |
- font-weight: bolder; |
|
888 |
- color: rgb(63, 63, 63); |
|
1341 |
+ width: 15px; |
|
1342 |
+ height: 15px; |
|
1343 |
+ background: rgba(255, 255, 255, 0.521); |
|
1344 |
+ position: absolute; |
|
1345 |
+ bottom: 0; |
|
1346 |
+ right: 0; |
|
1347 |
+ cursor: nwse-resize; |
|
1348 |
+ font-size: 13px; |
|
1349 |
+ font-weight: bolder; |
|
1350 |
+ color: rgb(63, 63, 63); |
|
889 | 1351 |
} |
890 | 1352 |
|
891 | 1353 |
.sticker-delete { |
892 |
- position: absolute; |
|
893 |
- top: 0; |
|
894 |
- right: 0; |
|
895 |
- background: rgba(255, 0, 0, 0.425); |
|
896 |
- color: white; |
|
897 |
- padding: 5px; |
|
898 |
- cursor: pointer; |
|
1354 |
+ position: absolute; |
|
1355 |
+ top: 0; |
|
1356 |
+ right: 0; |
|
1357 |
+ background: rgba(255, 0, 0, 0.425); |
|
1358 |
+ color: white; |
|
1359 |
+ padding: 5px; |
|
1360 |
+ cursor: pointer; |
|
899 | 1361 |
} |
900 | 1362 |
|
901 | 1363 |
.toolbar { |
902 |
- display: flex; |
|
903 |
- justify-content: center; |
|
904 |
- margin-top: 10px; |
|
1364 |
+ display: flex; |
|
1365 |
+ justify-content: center; |
|
1366 |
+ margin-top: 10px; |
|
905 | 1367 |
} |
906 | 1368 |
|
907 | 1369 |
.toolbar button { |
908 |
- margin: 5px; |
|
909 |
- padding: 5px 10px; |
|
910 |
- cursor: pointer; |
|
1370 |
+ margin: 5px; |
|
1371 |
+ padding: 5px 10px; |
|
1372 |
+ cursor: pointer; |
|
911 | 1373 |
} |
912 | 1374 |
|
913 | 1375 |
.toolbar input { |
914 |
- margin: 5px; |
|
1376 |
+ margin: 5px; |
|
915 | 1377 |
} |
916 | 1378 |
|
917 | 1379 |
.rabbit-end { |
918 |
- cursor: pointer; |
|
919 |
- display: block; |
|
920 |
- position: absolute; |
|
921 |
- bottom: 0px; |
|
922 |
- left: -15px; |
|
923 |
- z-index: 10000; |
|
1380 |
+ cursor: pointer; |
|
1381 |
+ display: block; |
|
1382 |
+ position: absolute; |
|
1383 |
+ bottom: 0px; |
|
1384 |
+ left: -15px; |
|
1385 |
+ z-index: 10000; |
|
924 | 1386 |
} |
925 | 1387 |
|
926 | 1388 |
.rabbit-running { |
927 |
- position: absolute; |
|
928 |
- bottom: 40px; |
|
929 |
- right: 110px; |
|
930 |
- z-index: 10000; |
|
931 |
- transform: scaleX(-1); |
|
932 |
- transition: all 0.5s ease-in-out; |
|
1389 |
+ position: absolute; |
|
1390 |
+ bottom: 40px; |
|
1391 |
+ right: 110px; |
|
1392 |
+ z-index: 10000; |
|
1393 |
+ transform: scaleX(-1); |
|
1394 |
+ transition: all 0.5s ease-in-out; |
|
933 | 1395 |
} |
934 | 1396 |
|
935 | 1397 |
.fireworks-end { |
936 |
- position: absolute; |
|
937 |
- bottom: 70px; |
|
938 |
- left: -40px; |
|
939 |
- width: 20rem; |
|
1398 |
+ position: absolute; |
|
1399 |
+ bottom: 70px; |
|
1400 |
+ left: -40px; |
|
1401 |
+ width: 20rem; |
|
940 | 1402 |
} |
941 | 1403 |
|
942 | 1404 |
.camera-rabbit { |
943 |
- position: absolute; |
|
944 |
- right: 0; |
|
945 |
- bottom: 0; |
|
946 |
- width: 40%; |
|
1405 |
+ position: absolute; |
|
1406 |
+ right: 0; |
|
1407 |
+ bottom: 0; |
|
1408 |
+ width: 40%; |
|
947 | 1409 |
} |
948 | 1410 |
|
949 | 1411 |
.race-btn p { |
950 |
- width: auto; |
|
1412 |
+ width: auto; |
|
951 | 1413 |
} |
952 | 1414 |
</style> |
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?