

240821 박세훈 대시보드에서 로드맵 문제, 지문, 단어장 이동 시 learning_id값 전달
@f7c4cd080769fe19478ec6959c82a036c7a9fe0f
--- client/views/pages/AppStore.js
+++ client/views/pages/AppStore.js
... | ... | @@ -1,4 +1,4 @@ |
1 |
-import { createStore } from 'vuex'; |
|
1 |
+import { createStore } from "vuex"; |
|
2 | 2 |
|
3 | 3 |
export default createStore({ |
4 | 4 |
state: { |
... | ... | @@ -9,16 +9,17 @@ |
9 | 9 |
schdlId: null, |
10 | 10 |
bookId: null, |
11 | 11 |
unitId: null, |
12 |
+ learningId: null, |
|
12 | 13 |
}, |
13 | 14 |
getters: { |
14 | 15 |
isLoggedIn(state) { |
15 |
- return !!state.token; |
|
16 |
+ return !!state.token; |
|
16 | 17 |
}, |
17 | 18 |
getUserInfo(state) { |
18 | 19 |
return { |
19 | 20 |
userId: state.userId, |
20 | 21 |
authcd: state.authcd, |
21 |
- }; |
|
22 |
+ }; |
|
22 | 23 |
}, |
23 | 24 |
getStdId(state) { |
24 | 25 |
return state.stdId; |
... | ... | @@ -32,6 +33,9 @@ |
32 | 33 |
getUnitId(state) { |
33 | 34 |
return state.unitId; |
34 | 35 |
}, |
36 |
+ getLearningId(state) { |
|
37 |
+ return state.learningId; |
|
38 |
+ }, |
|
35 | 39 |
}, |
36 | 40 |
mutations: { |
37 | 41 |
setToken(state, token) { |
... | ... | @@ -39,18 +43,19 @@ |
39 | 43 |
}, |
40 | 44 |
clearToken(state) { |
41 | 45 |
state.token = null; |
42 |
- state.userId = null; |
|
46 |
+ state.userId = null; |
|
43 | 47 |
state.authcd = null; |
44 | 48 |
state.stdId = null; |
45 | 49 |
state.schdlId = null; |
46 | 50 |
state.bookId = null; |
47 | 51 |
state.unitId = null; |
52 |
+ state.learningId = null; |
|
48 | 53 |
}, |
49 | 54 |
setUser(state, userId) { |
50 |
- state.userId = userId; |
|
55 |
+ state.userId = userId; |
|
51 | 56 |
}, |
52 | 57 |
setAuthcd(state, authcd) { |
53 |
- state.authcd = authcd; |
|
58 |
+ state.authcd = authcd; |
|
54 | 59 |
}, |
55 | 60 |
setStdId(state, stdId) { |
56 | 61 |
state.stdId = stdId; |
... | ... | @@ -63,40 +68,46 @@ |
63 | 68 |
}, |
64 | 69 |
setUnitId(state, unitId) { |
65 | 70 |
state.unitId = unitId; |
66 |
- } |
|
71 |
+ }, |
|
72 |
+ setLearningId(state, learningId) { |
|
73 |
+ state.learningId = learningId; |
|
74 |
+ }, |
|
67 | 75 |
}, |
68 | 76 |
actions: { |
69 | 77 |
login({ commit }, token) { |
70 |
- commit('setToken', token); |
|
71 |
- localStorage.setItem('token', token); |
|
78 |
+ commit("setToken", token); |
|
79 |
+ localStorage.setItem("token", token); |
|
72 | 80 |
}, |
73 | 81 |
logout({ commit }) { |
74 |
- commit('clearToken'); |
|
75 |
- localStorage.removeItem('token'); |
|
82 |
+ commit("clearToken"); |
|
83 |
+ localStorage.removeItem("token"); |
|
76 | 84 |
}, |
77 | 85 |
updateStdId({ commit }, payload) { |
78 | 86 |
return new Promise((resolve) => { |
79 |
- commit('setStdId', payload); |
|
87 |
+ commit("setStdId", payload); |
|
80 | 88 |
resolve(); |
81 | 89 |
}); |
82 | 90 |
}, |
83 | 91 |
updateSchdlId({ commit }, payload) { |
84 | 92 |
return new Promise((resolve) => { |
85 |
- commit('setSchdlId', payload); |
|
93 |
+ commit("setSchdlId", payload); |
|
86 | 94 |
resolve(); |
87 | 95 |
}); |
88 | 96 |
}, |
89 | 97 |
updateBookId({ commit }, payload) { |
90 | 98 |
return new Promise((resolve) => { |
91 |
- commit('setBookId', payload); |
|
99 |
+ commit("setBookId", payload); |
|
92 | 100 |
resolve(); |
93 | 101 |
}); |
94 | 102 |
}, |
95 | 103 |
updateUnitId({ commit }, payload) { |
96 | 104 |
return new Promise((resolve) => { |
97 |
- commit('setUnitId', payload); |
|
105 |
+ commit("setUnitId", payload); |
|
98 | 106 |
resolve(); |
99 | 107 |
}); |
100 |
- } |
|
101 |
- } |
|
108 |
+ }, |
|
109 |
+ updateLearningId({ commit }, learningId) { |
|
110 |
+ commit("setLearningId", learningId); |
|
111 |
+ }, |
|
112 |
+ }, |
|
102 | 113 |
}); |
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -1,1021 +1,755 @@ |
1 | 1 |
<template> |
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 |
- /> |
|
24 |
- </div> |
|
25 |
- <div class="rcon flex justify-end mb5"> |
|
26 |
- <div class="race-btn" @click="goToPage('Chapter1')"> |
|
27 |
- <div class="rabbit-running"> |
|
28 |
- <img |
|
29 |
- src="../../../resources/img/img09_s.png" |
|
30 |
- alt="" |
|
31 |
- :style="{ display: rabbitPos[1] ? 'block' : 'none' }" |
|
32 |
- /> |
|
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> |
|
33 | 10 |
</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="item.imgSrc1" |
|
43 |
- :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }" |
|
44 |
- /> |
|
45 |
- <img |
|
46 |
- :src="item.imgSrc2" |
|
47 |
- :style="{ display: rabbitCompl[1] ? 'block' : 'none' }" |
|
48 |
- /> |
|
49 |
- </button> |
|
50 |
- <p>{{ labeledItems[0] }}</p> |
|
51 |
- </div> |
|
52 |
- <div class="race-btn" @click="goToPage('Chapter2')"> |
|
53 |
- <div class="rabbit-running"> |
|
54 |
- <img |
|
55 |
- src="../../../resources/img/img09_s.png" |
|
56 |
- alt="" |
|
57 |
- :style="{ display: rabbitPos[2] ? 'block' : 'none' }" |
|
58 |
- /> |
|
59 |
- </div> |
|
60 |
- <button |
|
61 |
- class="popTxt" |
|
62 |
- v-for="(item, index) in items" |
|
63 |
- :key="index" |
|
64 |
- @click="toggleImage(index)" |
|
65 |
- data-num="2" |
|
66 |
- > |
|
67 |
- <img |
|
68 |
- :src="item.imgSrc1" |
|
69 |
- :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }" |
|
70 |
- /> |
|
71 |
- <img |
|
72 |
- :src="item.imgSrc2" |
|
73 |
- :style="{ display: rabbitCompl[2] ? 'block' : 'none' }" |
|
74 |
- /> |
|
75 |
- </button> |
|
76 |
- <p>{{ labeledItems[1] }}</p> |
|
77 |
- </div> |
|
78 |
- </div> |
|
79 |
- <div class="lcon flex justify-between mb5"> |
|
80 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
81 |
- <div class="rabbit-running"> |
|
82 |
- <img |
|
83 |
- src="../../../resources/img/img09_s.png" |
|
84 |
- alt="" |
|
85 |
- :style="{ display: rabbitPos[7] ? 'block' : 'none' }" |
|
86 |
- /> |
|
87 |
- </div> |
|
88 |
- <button |
|
89 |
- class="popTxt" |
|
90 |
- v-for="(item, index) in items" |
|
91 |
- :key="index" |
|
92 |
- @click="toggleImage(index)" |
|
93 |
- data-num="7" |
|
94 |
- > |
|
95 |
- <img |
|
96 |
- :src="item.imgSrc1" |
|
97 |
- :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }" |
|
98 |
- /> |
|
99 |
- <img |
|
100 |
- :src="item.imgSrc2" |
|
101 |
- :style="{ display: rabbitCompl[7] ? 'block' : 'none' }" |
|
102 |
- /> |
|
103 |
- </button> |
|
104 |
- <p>{{ labeledItems[6] }}</p> |
|
105 |
- </div> |
|
106 |
- <div class="race-btn" @click="goToPage('Chapter6')"> |
|
107 |
- <div class="rabbit-running"> |
|
108 |
- <img |
|
109 |
- src="../../../resources/img/img09_s.png" |
|
110 |
- alt="" |
|
111 |
- :style="{ display: rabbitPos[6] ? 'block' : 'none' }" |
|
112 |
- /> |
|
113 |
- </div> |
|
114 |
- <button |
|
115 |
- class="popTxt" |
|
116 |
- v-for="(item, index) in items" |
|
117 |
- :key="index" |
|
118 |
- @click="toggleImage(index)" |
|
119 |
- data-num="6" |
|
120 |
- > |
|
121 |
- <img |
|
122 |
- :src="item.imgSrc1" |
|
123 |
- :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }" |
|
124 |
- /> |
|
125 |
- <img |
|
126 |
- :src="item.imgSrc2" |
|
127 |
- :style="{ display: rabbitCompl[6] ? 'block' : 'none' }" |
|
128 |
- /> |
|
129 |
- </button> |
|
130 |
- <p>{{ labeledItems[5] }}</p> |
|
131 |
- </div> |
|
132 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
133 |
- <div class="rabbit-running"> |
|
134 |
- <img |
|
135 |
- src="../../../resources/img/img09_s.png" |
|
136 |
- alt="" |
|
137 |
- :style="{ display: rabbitPos[5] ? 'block' : 'none' }" |
|
138 |
- /> |
|
139 |
- </div> |
|
140 |
- <button |
|
141 |
- class="popTxt" |
|
142 |
- v-for="(item, index) in items" |
|
143 |
- :key="index" |
|
144 |
- @click="toggleImage(index)" |
|
145 |
- data-num="5" |
|
146 |
- > |
|
147 |
- <img |
|
148 |
- :src="item.imgSrc1" |
|
149 |
- :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }" |
|
150 |
- /> |
|
151 |
- <img |
|
152 |
- :src="item.imgSrc2" |
|
153 |
- :style="{ display: rabbitCompl[5] ? 'block' : 'none' }" |
|
154 |
- /> |
|
155 |
- </button> |
|
156 |
- <p>{{ labeledItems[4] }}</p> |
|
157 |
- </div> |
|
158 |
- <div class="race-btn" @click="goToPage('Chapter2_7')"> |
|
159 |
- <div class="rabbit-running"> |
|
160 |
- <img |
|
161 |
- src="../../../resources/img/img09_s.png" |
|
162 |
- alt="" |
|
163 |
- :style="{ display: rabbitPos[4] ? 'block' : 'none' }" |
|
164 |
- /> |
|
165 |
- </div> |
|
166 |
- <button |
|
167 |
- class="popTxt" |
|
168 |
- v-for="(item, index) in items" |
|
169 |
- :key="index" |
|
170 |
- @click="toggleImage(index)" |
|
171 |
- data-num="4" |
|
172 |
- > |
|
173 |
- <img |
|
174 |
- :src="item.imgSrc1" |
|
175 |
- :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }" |
|
176 |
- /> |
|
177 |
- <img |
|
178 |
- :src="item.imgSrc2" |
|
179 |
- :style="{ display: rabbitCompl[4] ? 'block' : 'none' }" |
|
180 |
- /> |
|
181 |
- </button> |
|
182 |
- <p>{{ labeledItems[3] }}</p> |
|
183 |
- </div> |
|
184 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
185 |
- <div class="rabbit-running"> |
|
186 |
- <img |
|
187 |
- src="../../../resources/img/img09_s.png" |
|
188 |
- alt="" |
|
189 |
- :style="{ display: rabbitPos[3] ? 'block' : 'none' }" |
|
190 |
- /> |
|
191 |
- </div> |
|
192 |
- <button |
|
193 |
- class="popTxt" |
|
194 |
- v-for="(item, index) in items" |
|
195 |
- :key="index" |
|
196 |
- @click="toggleImage(index)" |
|
197 |
- data-num="3" |
|
198 |
- > |
|
199 |
- <img |
|
200 |
- :src="item.imgSrc1" |
|
201 |
- :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }" |
|
202 |
- /> |
|
203 |
- <img |
|
204 |
- :src="item.imgSrc2" |
|
205 |
- :style="{ display: rabbitCompl[3] ? 'block' : 'none' }" |
|
206 |
- /> |
|
207 |
- </button> |
|
208 |
- <p>{{ labeledItems[2] }}</p> |
|
209 |
- </div> |
|
210 |
- </div> |
|
211 |
- <div class="rcon flex"> |
|
212 |
- <div class="race-btn" @click="goToPage('Chapter8')"> |
|
213 |
- <div class="rabbit-running"> |
|
214 |
- <img |
|
215 |
- src="../../../resources/img/img09_s.png" |
|
216 |
- alt="" |
|
217 |
- :style="{ display: rabbitPos[8] ? 'block' : 'none' }" |
|
218 |
- /> |
|
219 |
- </div> |
|
220 |
- <button |
|
221 |
- class="popTxt" |
|
222 |
- v-for="(item, index) in items" |
|
223 |
- :key="index" |
|
224 |
- @click="toggleImage(index)" |
|
225 |
- data-num="8" |
|
226 |
- > |
|
227 |
- <img |
|
228 |
- :src="item.imgSrc3" |
|
229 |
- :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }" |
|
230 |
- /> |
|
231 |
- <img |
|
232 |
- :src="item.imgSrc4" |
|
233 |
- :style="{ display: rabbitCompl[8] ? 'block' : 'none' }" |
|
234 |
- /> |
|
235 |
- </button> |
|
236 |
- <p class="long">{{ labeledItems[7] }}</p> |
|
237 |
- </div> |
|
238 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
239 |
- <div class="rabbit-running"> |
|
240 |
- <img |
|
241 |
- src="../../../resources/img/img09_s.png" |
|
242 |
- alt="" |
|
243 |
- :style="{ display: rabbitPos[9] ? 'block' : 'none' }" |
|
244 |
- /> |
|
245 |
- </div> |
|
246 |
- <button |
|
247 |
- class="popTxt" |
|
248 |
- v-for="(item, index) in items" |
|
249 |
- :key="index" |
|
250 |
- @click="toggleImage(index)" |
|
251 |
- data-num="9" |
|
252 |
- > |
|
253 |
- <img |
|
254 |
- :src="item.imgSrc1" |
|
255 |
- :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }" |
|
256 |
- /> |
|
257 |
- <img |
|
258 |
- :src="item.imgSrc2" |
|
259 |
- :style="{ display: rabbitCompl[9] ? 'block' : 'none' }" |
|
260 |
- /> |
|
261 |
- </button> |
|
262 |
- <p>{{ labeledItems[8] }}</p> |
|
263 |
- </div> |
|
264 |
- <div class="race-btn" @click="goToPage('Chapter10')"> |
|
265 |
- <div class="rabbit-running"> |
|
266 |
- <img |
|
267 |
- src="../../../resources/img/img09_s.png" |
|
268 |
- alt="" |
|
269 |
- :style="{ display: rabbitPos[10] ? 'block' : 'none' }" |
|
270 |
- /> |
|
271 |
- </div> |
|
272 |
- <button |
|
273 |
- class="popTxt" |
|
274 |
- v-for="(item, index) in items" |
|
275 |
- :key="index" |
|
276 |
- @click="toggleImage(index)" |
|
277 |
- data-num="10" |
|
278 |
- > |
|
279 |
- <img |
|
280 |
- :src="item.imgSrc1" |
|
281 |
- :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }" |
|
282 |
- /> |
|
283 |
- <img |
|
284 |
- :src="item.imgSrc2" |
|
285 |
- :style="{ display: rabbitCompl[10] ? 'block' : 'none' }" |
|
286 |
- /> |
|
287 |
- </button> |
|
288 |
- <p>{{ labeledItems[9] }}</p> |
|
289 |
- </div> |
|
11 |
+ <div class="race-box"> |
|
290 | 12 |
|
291 |
- <div class="race-btn" @click="goToPage('Chapter2_8')"> |
|
292 |
- <div class="rabbit-running"> |
|
293 |
- <img |
|
294 |
- src="../../../resources/img/img09_s.png" |
|
295 |
- alt="" |
|
296 |
- :style="{ display: rabbitPos[11] ? 'block' : 'none' }" |
|
297 |
- /> |
|
298 |
- </div> |
|
299 |
- <button |
|
300 |
- class="popTxt" |
|
301 |
- v-for="(item, index) in items" |
|
302 |
- :key="index" |
|
303 |
- @click="toggleImageAndShowPopup(index, '11')" |
|
304 |
- data-num="11" |
|
305 |
- > |
|
306 |
- <img |
|
307 |
- :src="item.imgSrc3" |
|
308 |
- :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }" |
|
309 |
- /> |
|
310 |
- <img |
|
311 |
- :src="item.imgSrc4" |
|
312 |
- :style="{ display: rabbitCompl[11] ? 'block' : 'none' }" |
|
313 |
- /> |
|
314 |
- </button> |
|
315 |
- <p class="long">{{ labeledItems[10] }}</p> |
|
316 |
- </div> |
|
317 |
- </div> |
|
318 |
- <div class="race-btn"> |
|
319 |
- <div class="rabbit-running" style="display: flex"> |
|
320 |
- <img |
|
321 |
- class="rabbit-end" |
|
322 |
- src="../../../resources/img/img138_72s.png" |
|
323 |
- alt="" |
|
324 |
- :style="{ display: rabbitEnd ? 'block' : 'none' }" |
|
325 |
- /> |
|
326 |
- <img |
|
327 |
- class="fireworks-end" |
|
328 |
- src="../../../resources/img/fireworks.gif" |
|
329 |
- alt="" |
|
330 |
- :style="{ display: rabbitEnd ? 'block' : 'none' }" |
|
331 |
- /> |
|
332 |
- </div> |
|
333 |
- </div> |
|
334 |
- </div> |
|
335 | 13 |
|
336 |
- <!-- 팝업 --> |
|
337 |
- <div v-show="searchOpen2" class="popup-wrap"> |
|
338 |
- <div class="popup-box"> |
|
339 |
- <button |
|
340 |
- type="button" |
|
341 |
- class="popup-close-btn" |
|
342 |
- style="position: absolute; top: 10px; right: 10px" |
|
343 |
- @click="closeModal" |
|
344 |
- > |
|
345 |
- <svg-icon |
|
346 |
- type="mdi" |
|
347 |
- :path="mdiWindowClose" |
|
348 |
- class="close-btn" |
|
349 |
- ></svg-icon> |
|
350 |
- </button> |
|
14 |
+ <div class="rabbit-start"><img src="../../../resources/img/img09_s.png" alt="" |
|
15 |
+ :style="{ display: rabbitPos[0] ? 'block' : 'none' }"></div> |
|
16 |
+ <div class="rcon flex justify-end mb5"> |
|
17 |
+ <div class="race-btn" @click="[goToPage('Chapter1'), storeLearningId(labeledItems[0].learning_id)]"> |
|
351 | 18 |
|
352 |
- <div class="mb30 text-ct"> |
|
353 |
- <p class="title1 mb20">1단원이 끝났습니다!</p> |
|
354 |
- <p class="title1"> |
|
355 |
- <em class="yellow">기념사진</em>을 촬영하러 가요 |
|
356 |
- </p> |
|
357 |
- </div> |
|
358 |
- <div class="flex justify-center"> |
|
359 |
- <button |
|
360 |
- type="button" |
|
361 |
- title="사진촬영" |
|
362 |
- class="new-btn" |
|
363 |
- @click="openCameraModal" |
|
364 |
- > |
|
365 |
- 사진 촬영 |
|
366 |
- </button> |
|
367 |
- </div> |
|
368 |
- </div> |
|
369 |
- </div> |
|
370 |
- <!-- 카메라 모달 --> |
|
371 |
- <article v-show="showCameraModal" class="popup-wrap"> |
|
372 |
- <div class="popup-box" style="top: 500px; left: 500px"> |
|
373 |
- <div class="flex mb10 justify-between"> |
|
374 |
- <p class="popup-title">사진 촬영</p> |
|
375 |
- <button type="button" class="popup-close-btn" @click="closeModal"> |
|
376 |
- <svg-icon |
|
377 |
- type="mdi" |
|
378 |
- :path="mdiWindowClose" |
|
379 |
- class="close-btn" |
|
380 |
- ></svg-icon> |
|
381 |
- </button> |
|
382 |
- </div> |
|
383 |
- <div class="box"> |
|
384 |
- <div style="width: 100%"> |
|
385 |
- <div id="container" ref="container"> |
|
386 |
- <video |
|
387 |
- v-if="!photoTaken" |
|
388 |
- autoplay="true" |
|
389 |
- ref="modalVideoElement" |
|
390 |
- class="mirrored" |
|
391 |
- @canplay="onVideoLoaded" |
|
392 |
- style="position: absolute" |
|
393 |
- ></video> |
|
394 |
- <img |
|
395 |
- src="../../../resources/img/camera-rabbit.png" |
|
396 |
- class="camera-rabbit" |
|
397 |
- style="position: absolute" |
|
398 |
- /> |
|
399 |
- <canvas ref="canvas" style="pointer-events: none"></canvas> |
|
400 |
- </div> |
|
19 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
20 |
+ :style="{ display: rabbitPos[1] ? 'block' : 'none' }"></div> |
|
21 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
22 |
+ data-num="1"> |
|
23 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }"> |
|
24 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[1] ? 'block' : 'none' }"> |
|
25 |
+ </button> |
|
26 |
+ <p>{{ labeledItems[0].label }}</p> |
|
27 |
+ </div> |
|
28 |
+ <div class="race-btn" @click="[goToPage('Chapter2'), storeLearningId(labeledItems[1].learning_id)]"> |
|
29 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
30 |
+ :style="{ display: rabbitPos[2] ? 'block' : 'none' }"></div> |
|
31 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
32 |
+ data-num="2"> |
|
33 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }"> |
|
34 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[2] ? 'block' : 'none' }"> |
|
35 |
+ </button> |
|
36 |
+ <p>{{ labeledItems[1].label }}</p> |
|
37 |
+ </div> |
|
38 |
+ </div> |
|
39 |
+ <div class="lcon flex justify-between mb5"> |
|
40 |
+ <div class="race-btn" |
|
41 |
+ @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[6].learning_id)]"> |
|
42 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
43 |
+ :style="{ display: rabbitPos[7] ? 'block' : 'none' }"></div> |
|
44 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
45 |
+ data-num="7"> |
|
46 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }"> |
|
47 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[7] ? 'block' : 'none' }"> |
|
48 |
+ </button> |
|
49 |
+ <p>{{ labeledItems[6].label }}</p> |
|
50 |
+ </div> |
|
51 |
+ <div class="race-btn" @click="[goToPage('Chapter6'), storeLearningId(labeledItems[5].learning_id)]"> |
|
52 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
53 |
+ :style="{ display: rabbitPos[6] ? 'block' : 'none' }"></div> |
|
54 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
55 |
+ data-num="6"> |
|
56 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }"> |
|
57 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[6] ? 'block' : 'none' }"> |
|
58 |
+ </button> |
|
59 |
+ <p>{{ labeledItems[5].label }}</p> |
|
60 |
+ </div> |
|
61 |
+ <div class="race-btn" |
|
62 |
+ @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[4].learning_id)]"> |
|
63 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
64 |
+ :style="{ display: rabbitPos[5] ? 'block' : 'none' }"></div> |
|
65 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
66 |
+ data-num="5"> |
|
67 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }"> |
|
68 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[5] ? 'block' : 'none' }"> |
|
69 |
+ </button> |
|
70 |
+ <p>{{ labeledItems[4].label }}</p> |
|
71 |
+ </div> |
|
72 |
+ <div class="race-btn" |
|
73 |
+ @click="[goToPage('Chapter2_7'), storeLearningId(labeledItems[3].learning_id)]"> |
|
74 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
75 |
+ :style="{ display: rabbitPos[4] ? 'block' : 'none' }"></div> |
|
76 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
77 |
+ data-num="4"> |
|
78 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }"> |
|
79 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[4] ? 'block' : 'none' }"> |
|
80 |
+ </button> |
|
81 |
+ <p>{{ labeledItems[3].label }}</p> |
|
82 |
+ </div> |
|
83 |
+ <div class="race-btn" |
|
84 |
+ @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[2].learning_id)]"> |
|
85 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
86 |
+ :style="{ display: rabbitPos[3] ? 'block' : 'none' }"></div> |
|
87 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
88 |
+ data-num="3"> |
|
89 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }"> |
|
90 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[3] ? 'block' : 'none' }"> |
|
91 |
+ </button> |
|
92 |
+ <p>{{ labeledItems[2].label }}</p> |
|
93 |
+ </div> |
|
94 |
+ </div> |
|
95 |
+ <div class="rcon flex"> |
|
96 |
+ <div class="race-btn" @click="[goToPage('Chapter8'), storeLearningId(labeledItems[7].learning_id)]"> |
|
97 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
98 |
+ :style="{ display: rabbitPos[8] ? 'block' : 'none' }"></div> |
|
99 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
100 |
+ data-num="8"> |
|
101 |
+ <img :src="item.imgSrc3" :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }"> |
|
102 |
+ <img :src="item.imgSrc4" :style="{ display: rabbitCompl[8] ? 'block' : 'none' }"> |
|
103 |
+ </button> |
|
104 |
+ <p class="long">{{ labeledItems[7].label }}</p> |
|
105 |
+ </div> |
|
106 |
+ <div class="race-btn" |
|
107 |
+ @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[8].learning_id)]"> |
|
108 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
109 |
+ :style="{ display: rabbitPos[9] ? 'block' : 'none' }"></div> |
|
110 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
111 |
+ data-num="9"> |
|
112 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }"> |
|
113 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[9] ? 'block' : 'none' }"> |
|
114 |
+ </button> |
|
115 |
+ <p>{{ labeledItems[8].label }}</p> |
|
116 |
+ </div> |
|
117 |
+ <div class="race-btn" |
|
118 |
+ @click="[goToPage('Chapter10'), storeLearningId(labeledItems[9].learning_id)]"> |
|
119 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
120 |
+ :style="{ display: rabbitPos[10] ? 'block' : 'none' }"></div> |
|
121 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" |
|
122 |
+ data-num="10"> |
|
123 |
+ <img :src="item.imgSrc1" :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }"> |
|
124 |
+ <img :src="item.imgSrc2" :style="{ display: rabbitCompl[10] ? 'block' : 'none' }"> |
|
125 |
+ </button> |
|
126 |
+ <p>{{ labeledItems[9].label }}</p> |
|
127 |
+ </div> |
|
128 |
+ |
|
129 |
+ <div class="race-btn" |
|
130 |
+ @click="[goToPage('Chapter2_8'), storeLearningId(labeledItems[10].learning_id)]"> |
|
131 |
+ <div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
|
132 |
+ :style="{ display: rabbitPos[11] ? 'block' : 'none' }"></div> |
|
133 |
+ <button class="popTxt" v-for="(item, index) in items" :key="index" |
|
134 |
+ @click="toggleImageAndShowPopup(index, '11')" data-num="11"> |
|
135 |
+ <img :src="item.imgSrc3" :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }"> |
|
136 |
+ <img :src="item.imgSrc4" :style="{ display: rabbitCompl[11] ? 'block' : 'none' }"> |
|
137 |
+ </button> |
|
138 |
+ <p class="long">{{ labeledItems[10].label }}</p> |
|
139 |
+ </div> |
|
140 |
+ </div> |
|
141 |
+ <div class="race-btn"> |
|
142 |
+ <div class="rabbit-running" style=" display: flex;"><img class="rabbit-end" |
|
143 |
+ src="../../../resources/img/img138_72s.png" alt="" |
|
144 |
+ :style="{ display: rabbitEnd ? 'block' : 'none' }"> |
|
145 |
+ <img class="fireworks-end" src="../../../resources/img/fireworks.gif" alt="" |
|
146 |
+ :style="{ display: rabbitEnd ? 'block' : 'none' }"> |
|
147 |
+ </div> |
|
148 |
+ </div> |
|
401 | 149 |
</div> |
402 |
- </div> |
|
403 |
- <div class="flex justify-center mt20"> |
|
404 |
- <button class="new-btn" @click="takePhoto">사진 찍기</button> |
|
405 |
- </div> |
|
150 |
+ |
|
151 |
+ <!-- 팝업 --> |
|
152 |
+ <div v-show="searchOpen2" class="popup-wrap"> |
|
153 |
+ <div class="popup-box"> |
|
154 |
+ <button type="button" class="popup-close-btn" style="position:absolute; top:10px; right: 10px;" |
|
155 |
+ @click="closeModal"> |
|
156 |
+ <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
157 |
+ </button> |
|
158 |
+ |
|
159 |
+ <div class="mb30 text-ct"> |
|
160 |
+ <p class="title1 mb20">1단원이 끝났습니다!</p> |
|
161 |
+ <p class="title1"><em class="yellow">기념사진</em>을 촬영하러 가요</p> |
|
162 |
+ </div> |
|
163 |
+ <div class="flex justify-center"> |
|
164 |
+ <button type="button" title="사진촬영" class="new-btn" @click="openCameraModal"> |
|
165 |
+ 사진 촬영 |
|
166 |
+ </button> |
|
167 |
+ </div> |
|
168 |
+ </div> |
|
169 |
+ </div> |
|
170 |
+ <!-- 카메라 모달 --> |
|
171 |
+ <article v-show="showCameraModal" class="popup-wrap"> |
|
172 |
+ <div class="popup-box" style="top: 500px; left:500px"> |
|
173 |
+ <div class="flex mb10 justify-between"> |
|
174 |
+ <p class="popup-title">사진 촬영</p>ㄹ |
|
175 |
+ <button type="button" class="popup-close-btn" @click="closeModal"> |
|
176 |
+ <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
177 |
+ </button> |
|
178 |
+ </div> |
|
179 |
+ <div class="box"> |
|
180 |
+ <div style="width: 100%;"> |
|
181 |
+ <div id="container" ref="container"> |
|
182 |
+ <video v-if="!photoTaken" autoplay="true" ref="modalVideoElement" class="mirrored" |
|
183 |
+ @canplay="onVideoLoaded" style="position: absolute;"> |
|
184 |
+ </video> |
|
185 |
+ <img src="../../../resources/img/camera-rabbit.png" class="camera-rabbit" |
|
186 |
+ style="position: absolute; "> |
|
187 |
+ <canvas ref="canvas" style="pointer-events: none;"></canvas> |
|
188 |
+ </div> |
|
189 |
+ </div> |
|
190 |
+ </div> |
|
191 |
+ <div class="flex justify-center mt20"> |
|
192 |
+ <button class="new-btn" @click="takePhoto">사진 찍기</button> |
|
193 |
+ </div> |
|
194 |
+ </div> |
|
195 |
+ </article> |
|
406 | 196 |
</div> |
407 |
- </article> |
|
197 |
+ |
|
198 |
+ |
|
199 |
+ |
|
200 |
+ <div class="complete-wrap myphoto"> |
|
201 |
+ <button class="login-btn mt10" type="submit" style="width: 100%;" @click="finishSchedule"><img |
|
202 |
+ src="../../../resources/img/btn07_s.png" alt="" style="width: 100%; height: 100px;"> |
|
203 |
+ <p>학습 종료하기</p> |
|
204 |
+ </button> |
|
205 |
+ <h2 class="mb40 mt10">이 단원을 끝낸 친구들</h2> |
|
206 |
+ |
|
207 |
+ <article class="flex-column"> |
|
208 |
+ <div class="flex-row"> |
|
209 |
+ <div class="flex" style="gap: 5px; flex-wrap: wrap;"> |
|
210 |
+ <div v-for="(image, index) in images" :key="image.fileId" @click="buttonSearch(image)" |
|
211 |
+ class="photo" style="margin-bottom: 5px;"> |
|
212 |
+ <img :src="image.url" :alt="image.fileNm" reloadable="true" style="height: 100%;" /> |
|
213 |
+ </div> |
|
214 |
+ </div> |
|
215 |
+ </div> |
|
216 |
+ </article> |
|
217 |
+ <article class="popup-wrap" v-show="searchOpen"> |
|
218 |
+ <div class="popup-box "> |
|
219 |
+ <div class="flex mb10 justify-between"> |
|
220 |
+ <p class="popup-title">알림</p> |
|
221 |
+ <button type="button" class="popup-close-btn" @click="closeModal"> |
|
222 |
+ <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
223 |
+ </button> |
|
224 |
+ </div> |
|
225 |
+ <div class="box"> |
|
226 |
+ <div style="width: 910px;"><img src="../../../resources/img/img140_747s.png" alt=""></div> |
|
227 |
+ </div> |
|
228 |
+ <div class="flex justify-between mt20"> |
|
229 |
+ <div class="text flex"> |
|
230 |
+ <p class="title2 date ml30">2024-08-06</p> |
|
231 |
+ <span class=" title1 ml30">1단원을 마친 <em class="yellow">가나다</em>친구</span> |
|
232 |
+ </div> |
|
233 |
+ <div class="title2 flex align-center" style="gap: 10px;"><svg-icon type="mdi" :path="mdiHeart" |
|
234 |
+ style="color: #FFBA08;"></svg-icon> |
|
235 |
+ <p><em class="yellow">1</em></p> |
|
236 |
+ </div> |
|
237 |
+ </div> |
|
238 |
+ </div> |
|
239 |
+ </article> |
|
240 |
+ </div> |
|
408 | 241 |
</div> |
409 |
- |
|
410 |
- <div class="complete-wrap myphoto"> |
|
411 |
- <button |
|
412 |
- class="login-btn mt10" |
|
413 |
- type="submit" |
|
414 |
- style="width: 100%" |
|
415 |
- @click="finishSchedule" |
|
416 |
- > |
|
417 |
- <img |
|
418 |
- src="../../../resources/img/btn07_s.png" |
|
419 |
- alt="" |
|
420 |
- style="width: 100%; height: 100px" |
|
421 |
- /> |
|
422 |
- <p>학습 종료하기</p> |
|
423 |
- </button> |
|
424 |
- <h2 class="mb40 mt10">이 단원을 끝낸 친구들</h2> |
|
425 |
- |
|
426 |
- <article class="flex-column"> |
|
427 |
- <div class="flex-row"> |
|
428 |
- <div class="flex" style="gap: 5px; flex-wrap: wrap"> |
|
429 |
- <div |
|
430 |
- v-for="(image, index) in images" |
|
431 |
- :key="image.fileId" |
|
432 |
- @click="buttonSearch(image)" |
|
433 |
- class="photo" |
|
434 |
- style="margin-bottom: 5px" |
|
435 |
- > |
|
436 |
- <img |
|
437 |
- :src="image.url" |
|
438 |
- :alt="image.fileNm" |
|
439 |
- reloadable="true" |
|
440 |
- style="height: 100%" |
|
441 |
- /> |
|
442 |
- </div> |
|
443 |
- </div> |
|
444 |
- </div> |
|
445 |
- </article> |
|
446 |
- <article class="popup-wrap" v-show="searchOpen"> |
|
447 |
- <div class="popup-box"> |
|
448 |
- <div class="flex mb10 justify-between"> |
|
449 |
- <p class="popup-title">알림</p> |
|
450 |
- <button type="button" class="popup-close-btn" @click="closeModal"> |
|
451 |
- <svg-icon |
|
452 |
- type="mdi" |
|
453 |
- :path="mdiWindowClose" |
|
454 |
- class="close-btn" |
|
455 |
- ></svg-icon> |
|
456 |
- </button> |
|
457 |
- </div> |
|
458 |
- <div class="box"> |
|
459 |
- <div style="width: 910px"> |
|
460 |
- <img src="../../../resources/img/img140_747s.png" alt="" /> |
|
461 |
- </div> |
|
462 |
- </div> |
|
463 |
- <div class="flex justify-between mt20"> |
|
464 |
- <div class="text flex"> |
|
465 |
- <p class="title2 date ml30">2024-08-06</p> |
|
466 |
- <span class="title1 ml30" |
|
467 |
- >1단원을 마친 <em class="yellow">가나다</em>친구</span |
|
468 |
- > |
|
469 |
- </div> |
|
470 |
- <div class="title2 flex align-center" style="gap: 10px"> |
|
471 |
- <svg-icon |
|
472 |
- type="mdi" |
|
473 |
- :path="mdiHeart" |
|
474 |
- style="color: #ffba08" |
|
475 |
- ></svg-icon> |
|
476 |
- <p><em class="yellow">1</em></p> |
|
477 |
- </div> |
|
478 |
- </div> |
|
479 |
- </div> |
|
480 |
- </article> |
|
481 |
- </div> |
|
482 |
- </div> |
|
483 | 242 |
</template> |
484 | 243 |
|
485 | 244 |
<script> |
486 |
-import SvgIcon from "@jamescoyle/vue-icon"; |
|
487 |
-import { mdiMagnify, mdiHeart, mdiWindowClose } from "@mdi/js"; |
|
488 |
-import axios from "axios"; |
|
489 |
-import { mapGetters } from "vuex"; |
|
245 |
+import SvgIcon from '@jamescoyle/vue-icon'; |
|
246 |
+import { mdiMagnify, mdiHeart, mdiWindowClose } from '@mdi/js'; |
|
247 |
+import axios from 'axios'; |
|
248 |
+import { mapGetters } from 'vuex'; |
|
249 |
+import { mapActions } from "vuex"; |
|
490 | 250 |
|
491 | 251 |
export default { |
492 |
- data() { |
|
493 |
- return { |
|
494 |
- items: [ |
|
495 |
- { |
|
496 |
- imgSrc1: "client/resources/img/img11_1_s.png", |
|
497 |
- imgSrc2: "client/resources/img/img12_1_s.png", |
|
498 |
- imgSrc3: "client/resources/img/img11_2_s.png", |
|
499 |
- imgSrc4: "client/resources/img/img12_2_s.png", |
|
500 |
- isSecondImageVisible: false, |
|
501 |
- }, |
|
502 |
- ], |
|
503 |
- mdiMagnify: mdiMagnify, |
|
504 |
- mdiWindowClose: mdiWindowClose, |
|
505 |
- mdiHeart: mdiHeart, |
|
506 |
- showModal: false, |
|
507 |
- searchOpen: false, // 사진 상세보기 모달창 |
|
508 |
- searchOpen2: false, // 단원 마친 후, 사진 촬영 여부 선택 모달창 |
|
509 |
- showCameraModal: false, // 카메라 모달창 |
|
510 |
- photoTaken: false, |
|
511 |
- photo: null, //캡쳐 사진 |
|
512 |
- stream: null, |
|
252 |
+ data() { |
|
253 |
+ return { |
|
254 |
+ items: [ |
|
255 |
+ { |
|
256 |
+ imgSrc1: 'client/resources/img/img11_1_s.png', |
|
257 |
+ imgSrc2: 'client/resources/img/img12_1_s.png', |
|
258 |
+ imgSrc3: 'client/resources/img/img11_2_s.png', |
|
259 |
+ imgSrc4: 'client/resources/img/img12_2_s.png', |
|
260 |
+ isSecondImageVisible: false |
|
261 |
+ }, |
|
262 |
+ ], |
|
263 |
+ mdiMagnify: mdiMagnify, |
|
264 |
+ mdiWindowClose: mdiWindowClose, |
|
265 |
+ mdiHeart: mdiHeart, |
|
266 |
+ showModal: false, |
|
267 |
+ searchOpen: false, // 사진 상세보기 모달창 |
|
268 |
+ searchOpen2: false, // 단원 마친 후, 사진 촬영 여부 선택 모달창 |
|
269 |
+ showCameraModal: false, // 카메라 모달창 |
|
270 |
+ photoTaken: false, |
|
271 |
+ photo: null, //캡쳐 사진 |
|
272 |
+ stream: null, |
|
513 | 273 |
|
514 |
- roadmapData: [], |
|
515 |
- labeledItems: [], |
|
516 | 274 |
|
517 |
- problemCounter: 0, |
|
518 |
- wordCounter: 0, |
|
519 |
- textCounter: 0, |
|
520 |
- evalCounter: 0, |
|
521 |
- book_id: null, |
|
522 |
- unit_id: null, |
|
275 |
+ roadmapData: [], |
|
276 |
+ labeledItems: [], |
|
523 | 277 |
|
524 |
- schedules: [], |
|
525 |
- nowSchedule: "", |
|
526 |
- state: "", |
|
527 |
- rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
528 |
- rabbitCompl: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
529 |
- rabbitEnd: false, |
|
278 |
+ problemCounter: 0, |
|
279 |
+ wordCounter: 0, |
|
280 |
+ textCounter: 0, |
|
281 |
+ evalCounter: 0, |
|
282 |
+ book_id: null, |
|
283 |
+ unit_id: null, |
|
530 | 284 |
|
531 |
- titleUnitName: "", |
|
532 |
- titleBookName: "", |
|
285 |
+ schedules: [], |
|
286 |
+ nowSchedule: "", |
|
287 |
+ state: '', |
|
288 |
+ rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
289 |
+ rabbitCompl: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
290 |
+ rabbitEnd: false, |
|
533 | 291 |
|
534 |
- images: [], |
|
535 |
- unit_id: "", |
|
536 |
- book_id: "", |
|
537 |
- }; |
|
538 |
- }, |
|
539 |
- methods: { |
|
540 |
- checkAndFetchData() { |
|
541 |
- console.log("받은 Book ID:", this.getBookId); |
|
542 |
- console.log("받은 Unit ID:", this.getUnitId); |
|
543 |
- const book_id = this.getBookId; |
|
544 |
- const unit_id = this.getUnitId; |
|
292 |
+ titleUnitName: "", |
|
293 |
+ titleBookName: "", |
|
545 | 294 |
|
546 |
- if (!book_id || !unit_id) { |
|
547 |
- console.error("book_id 또는 unit_id가 설정되지 않았습니다."); |
|
548 |
- return; |
|
549 |
- } |
|
550 |
- this.fetchImage(unit_id); |
|
551 |
- this.fetchSchedule(unit_id, book_id); |
|
552 |
- this.fetchRoadmapData(unit_id, book_id); |
|
553 |
- this.fetchRabbit(); |
|
554 |
- |
|
555 |
- this.unit_id = unit_id; |
|
556 |
- this.book_id = book_id; |
|
557 |
- |
|
558 |
- if (this.$route.query.reCapture == "true") { |
|
559 |
- this.openCameraModal(); |
|
560 |
- } |
|
561 |
- }, |
|
562 |
- |
|
563 |
- //은진 |
|
564 |
- async findFile(file_mng_id) { |
|
565 |
- try { |
|
566 |
- const res = await axios({ |
|
567 |
- url: "/file/find.json", |
|
568 |
- method: "post", |
|
569 |
- headers: { |
|
570 |
- "Content-Type": "application/json; charset=UTF-8", |
|
571 |
- }, |
|
572 |
- data: { |
|
573 |
- file_mng_id: file_mng_id, |
|
574 |
- }, |
|
575 |
- }); |
|
576 |
- return res.data.list[0]; |
|
577 |
- } catch (error) { |
|
578 |
- console.log("result - error : ", error); |
|
579 |
- return null; |
|
580 |
- } |
|
581 |
- }, |
|
582 |
- fetchImage(unit_id) { |
|
583 |
- axios({ |
|
584 |
- url: "/photo/photoUnitList.json", |
|
585 |
- method: "post", |
|
586 |
- headers: { |
|
587 |
- "Content-Type": "application/json; charset=UTF-8", |
|
588 |
- }, |
|
589 |
- data: { |
|
590 |
- unitId: unit_id, |
|
591 |
- sclsId: "1", |
|
592 |
- }, |
|
593 |
- }) |
|
594 |
- .then((response) => { |
|
595 |
- this.file_mng_id = response.data; |
|
596 |
- |
|
597 |
- const findFilePromises = this.file_mng_id.map((id) => |
|
598 |
- this.findFile(id.file_mng_id) |
|
599 |
- ); |
|
600 |
- |
|
601 |
- return Promise.all(findFilePromises); |
|
602 |
- }) |
|
603 |
- .then((fileResults) => { |
|
604 |
- // Format file results to include image URL |
|
605 |
- this.images = fileResults |
|
606 |
- .map((file) => { |
|
607 |
- if (file) { |
|
608 |
- return { |
|
609 |
- url: "http://localhost:9080/" + `${file.fileRpath}`, |
|
610 |
- fileId: file.fileId, |
|
611 |
- fileNm: file.fileNm, |
|
612 |
- // Add any other properties you need here |
|
613 |
- }; |
|
614 |
- } |
|
615 |
- return null; |
|
616 |
- }) |
|
617 |
- .filter((image) => image !== null); |
|
618 |
- }) |
|
619 |
- .catch((error) => { |
|
620 |
- console.error("Error fetching images:", error); |
|
621 |
- }); |
|
622 |
- }, |
|
623 |
- goToPageImg(page) { |
|
624 |
- const canvas = document.querySelector("canvas"); |
|
625 |
- const dataURL = canvas.toDataURL("image/png"); |
|
626 |
- |
|
627 |
- this.$router.push({ |
|
628 |
- name: page, |
|
629 |
- query: { image: encodeURIComponent(dataURL) }, |
|
630 |
- }); |
|
631 |
- }, |
|
632 |
- |
|
633 |
- fetchRabbit() { |
|
634 |
- for (var i = 0; i < 12; i++) { |
|
635 |
- this.rabbitPos[i] = false; |
|
636 |
- } |
|
637 |
- |
|
638 |
- if (this.$route.query.value) { |
|
639 |
- this.rabbitPos[parseInt(this.$route.query.value, 10) + 1] = true; |
|
640 |
- for (var i = 0; i < this.$route.query.value; i++) { |
|
641 |
- this.rabbitCompl[i + 1] = true; |
|
295 |
+ images: [], |
|
296 |
+ unit_id: "", |
|
297 |
+ book_id: "", |
|
642 | 298 |
} |
643 |
- |
|
644 |
- if (this.$route.query.value === "11") { |
|
645 |
- this.rabbitEnd = true; |
|
646 |
- setTimeout(() => { |
|
647 |
- this.searchOpen2 = true; |
|
648 |
- }, 1000); |
|
649 |
- } |
|
650 |
- } else this.rabbitPos[0] = true; |
|
651 | 299 |
}, |
652 |
- fetchSchedule(unit_id, book_id) { |
|
653 |
- axios({ |
|
654 |
- url: "/schedule/selectSchedule.json", |
|
655 |
- method: "post", |
|
656 |
- headers: { |
|
657 |
- "Content-Type": "application/json; charset=UTF-8", |
|
658 |
- }, |
|
659 |
- data: { |
|
660 |
- stdId: "2", |
|
661 |
- }, |
|
662 |
- }) |
|
663 |
- .then((response) => { |
|
664 |
- this.schedules = response.data; |
|
300 |
+ methods: { |
|
301 |
+ checkAndFetchData() { |
|
302 |
+ console.log("받은 Book ID:", this.getBookId); |
|
303 |
+ console.log("받은 Unit ID:", this.getUnitId); |
|
304 |
+ const book_id = this.getBookId; |
|
305 |
+ const unit_id = this.getUnitId; |
|
665 | 306 |
|
666 |
- if (this.schedules.length == 0) { |
|
667 |
- this.state = "notRegistered"; |
|
668 |
- } else { |
|
669 |
- const allFinished = this.schedules.every( |
|
670 |
- (schedule) => schedule.finish === "T" |
|
671 |
- ); |
|
672 |
- if (allFinished) { |
|
673 |
- this.state = "finish"; |
|
674 |
- } else { |
|
675 |
- this.nowSchedule = this.schedules.find( |
|
676 |
- (schedule) => |
|
677 |
- schedule.finish === null || schedule.finish === "F" |
|
678 |
- ); |
|
679 |
- if (this.nowSchedule) { |
|
680 |
- this.fetchRoadmapData(unit_id, book_id); |
|
681 |
- this.state = "studying"; |
|
682 |
- } else { |
|
683 |
- this.state = "notRegistered"; |
|
684 |
- } |
|
307 |
+ if (!book_id || !unit_id) { |
|
308 |
+ console.error("book_id 또는 unit_id가 설정되지 않았습니다."); |
|
309 |
+ return; |
|
685 | 310 |
} |
686 |
- } |
|
687 |
- }) |
|
688 |
- .catch((error) => { |
|
689 |
- console.error("Error fetching roadmap data:", error); |
|
690 |
- }); |
|
691 |
- }, |
|
692 |
- finishSchedule() { |
|
693 |
- axios({ |
|
694 |
- url: "/schedule/scheduleUpdate.json", |
|
695 |
- method: "post", |
|
696 |
- headers: { |
|
697 |
- "Content-Type": "application/json; charset=UTF-8", |
|
311 |
+ this.fetchImage(unit_id); |
|
312 |
+ this.fetchSchedule(unit_id, book_id); |
|
313 |
+ this.fetchRoadmapData(unit_id, book_id); |
|
314 |
+ this.fetchRabbit(); |
|
315 |
+ |
|
316 |
+ this.unit_id = unit_id |
|
317 |
+ this.book_id = book_id |
|
318 |
+ |
|
319 |
+ if (this.$route.query.reCapture == 'true') { |
|
320 |
+ this.openCameraModal() |
|
321 |
+ } |
|
698 | 322 |
}, |
699 |
- data: { |
|
700 |
- scheduleId: this.nowSchedule.schdl_id, |
|
701 |
- finish: "T", |
|
323 |
+ |
|
324 |
+ //은진 |
|
325 |
+ async findFile(file_mng_id) { |
|
326 |
+ try { |
|
327 |
+ const res = await axios({ |
|
328 |
+ url: "/file/find.json", |
|
329 |
+ method: "post", |
|
330 |
+ headers: { |
|
331 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
332 |
+ }, |
|
333 |
+ data: { |
|
334 |
+ file_mng_id: file_mng_id, |
|
335 |
+ }, |
|
336 |
+ }); |
|
337 |
+ return res.data.list[0]; |
|
338 |
+ } catch (error) { |
|
339 |
+ console.log("result - error : ", error); |
|
340 |
+ return null; |
|
341 |
+ } |
|
702 | 342 |
}, |
703 |
- }) |
|
704 |
- .then((response) => { |
|
705 |
- const nextSchedule = this.schedules.find( |
|
706 |
- (schedule) => schedule.schdl_id > this.nowSchedule.schdl_id |
|
707 |
- ); |
|
708 |
- alert("학습을 완료했습니다!"); |
|
343 |
+ fetchImage(unit_id) { |
|
344 |
+ axios({ |
|
345 |
+ url: "/photo/photoUnitList.json", |
|
346 |
+ method: "post", |
|
347 |
+ headers: { |
|
348 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
349 |
+ }, |
|
350 |
+ data: { |
|
351 |
+ unitId: unit_id, |
|
352 |
+ sclsId: "1" |
|
353 |
+ } |
|
354 |
+ }) |
|
355 |
+ .then(response => { |
|
356 |
+ this.file_mng_id = response.data; |
|
709 | 357 |
|
710 |
- if (nextSchedule) { |
|
711 |
- this.nowSchedule = nextSchedule; |
|
712 |
- this.fetchSchedule(nextSchedule.unit_id, nextSchedule.book_id); |
|
713 |
- this.fetchRoadmapData(nextSchedule.unit_id, nextSchedule.book_id); |
|
714 |
- this.$router.push({ |
|
715 |
- name: "Dashboard", |
|
716 |
- query: { |
|
717 |
- unit_id: nextSchedule.unit_id, |
|
718 |
- book_id: nextSchedule.book_id, |
|
719 |
- }, |
|
720 |
- }); |
|
721 |
- } else { |
|
722 |
- alert("모든 학습을 완료했습니다!"); |
|
723 |
- this.state = "finish"; |
|
724 |
- } |
|
725 |
- }) |
|
726 |
- .catch((error) => { |
|
727 |
- console.error("Error updating schedule:", error); |
|
728 |
- }); |
|
729 |
- }, |
|
730 |
- fetchRoadmapData(unit_id, book_id) { |
|
731 |
- axios({ |
|
732 |
- url: "/unitLearning/find.json", |
|
733 |
- method: "post", |
|
734 |
- headers: { |
|
735 |
- "Content-Type": "application/json; charset=UTF-8", |
|
358 |
+ const findFilePromises = this.file_mng_id.map(id => |
|
359 |
+ this.findFile(id.file_mng_id) |
|
360 |
+ ); |
|
361 |
+ |
|
362 |
+ return Promise.all(findFilePromises); |
|
363 |
+ }) |
|
364 |
+ .then(fileResults => { |
|
365 |
+ // Format file results to include image URL |
|
366 |
+ this.images = fileResults.map(file => { |
|
367 |
+ if (file) { |
|
368 |
+ return { |
|
369 |
+ url: "http://localhost:9080/" + `${file.fileRpath}`, |
|
370 |
+ fileId: file.fileId, |
|
371 |
+ fileNm: file.fileNm, |
|
372 |
+ // Add any other properties you need here |
|
373 |
+ }; |
|
374 |
+ } |
|
375 |
+ return null; |
|
376 |
+ }).filter(image => image !== null); |
|
377 |
+ }) |
|
378 |
+ .catch(error => { |
|
379 |
+ console.error("Error fetching images:", error); |
|
380 |
+ }); |
|
736 | 381 |
}, |
737 |
- data: { |
|
738 |
- unit_id: unit_id, |
|
739 |
- book_id: book_id, |
|
382 |
+ goToPageImg(page) { |
|
383 |
+ const canvas = document.querySelector('canvas'); |
|
384 |
+ const dataURL = canvas.toDataURL('image/png'); |
|
385 |
+ |
|
386 |
+ this.$router.push({ name: page, query: { image: encodeURIComponent(dataURL) } }); |
|
740 | 387 |
}, |
741 |
- }) |
|
742 |
- .then((response) => { |
|
743 |
- if (response.data.length != 0) { |
|
744 |
- this.roadmapData = response.data; |
|
745 |
- this.titleUnitName = this.roadmapData[0].unit_nm; |
|
746 |
- this.titleBookName = this.roadmapData[0].book_nm; |
|
747 |
- this.labeledItems = this.processedRoadmap; |
|
748 |
- } else { |
|
749 |
- this.state = "noProblem"; |
|
750 |
- } |
|
751 |
- }) |
|
752 |
- .catch((error) => { |
|
753 |
- this.state = "noProblem"; |
|
754 |
- console.error("Error fetching roadmap data:", error); |
|
755 |
- }); |
|
756 |
- }, |
|
757 |
- toggleImage(index) { |
|
758 |
- this.items[index].isSecondImageVisible = |
|
759 |
- !this.items[index].isSecondImageVisible; |
|
760 |
- }, |
|
761 |
- ShowPopup() { |
|
762 |
- this.searchOpen2 = true; // 촬영 여부 묻는 모달창 열기 |
|
763 |
- }, |
|
764 |
- goToPage(page) { |
|
765 |
- const { unit_id, book_id } = this.$route.query; |
|
766 |
- this.$router.push({ name: page, query: { unit_id, book_id } }); |
|
767 |
- }, |
|
768 |
- openCameraModal() { |
|
769 |
- this.closeModal(); |
|
770 | 388 |
|
771 |
- this.showCameraModal = true; |
|
772 |
- navigator.mediaDevices |
|
773 |
- .getUserMedia({ video: true }) |
|
774 |
- .then((stream) => { |
|
775 |
- const modalVideo = this.$refs.modalVideoElement; |
|
776 |
- modalVideo.srcObject = stream; |
|
777 |
- this.stream = stream; |
|
778 |
- }) |
|
779 |
- .catch((error) => { |
|
780 |
- console.log("error>>>>>>>>", error); |
|
781 |
- alert("웹캠이 필요한 기능입니다!"); |
|
782 |
- this.closeModal(); // 모달창을 닫음 |
|
783 |
- }); |
|
389 |
+ fetchRabbit() { |
|
390 |
+ for (var i = 0; i < 12; i++) { |
|
391 |
+ this.rabbitPos[i] = false |
|
392 |
+ } |
|
393 |
+ |
|
394 |
+ if (this.$route.query.value) { |
|
395 |
+ this.rabbitPos[parseInt(this.$route.query.value, 10) + 1] = true |
|
396 |
+ for (var i = 0; i < this.$route.query.value; i++) { |
|
397 |
+ this.rabbitCompl[i + 1] = true |
|
398 |
+ } |
|
399 |
+ |
|
400 |
+ if (this.$route.query.value === '11') { |
|
401 |
+ this.rabbitEnd = true; |
|
402 |
+ setTimeout(() => { |
|
403 |
+ this.searchOpen2 = true; |
|
404 |
+ }, 1000); |
|
405 |
+ } |
|
406 |
+ |
|
407 |
+ } |
|
408 |
+ else |
|
409 |
+ this.rabbitPos[0] = true |
|
410 |
+ }, |
|
411 |
+ fetchSchedule(unit_id, book_id) { |
|
412 |
+ axios({ |
|
413 |
+ url: "/schedule/selectSchedule.json", |
|
414 |
+ method: "post", |
|
415 |
+ headers: { |
|
416 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
417 |
+ }, |
|
418 |
+ data: { |
|
419 |
+ stdId: "2", |
|
420 |
+ } |
|
421 |
+ }).then(response => { |
|
422 |
+ this.schedules = response.data; |
|
423 |
+ |
|
424 |
+ if (this.schedules.length == 0) { |
|
425 |
+ this.state = 'notRegistered'; |
|
426 |
+ } else { |
|
427 |
+ const allFinished = this.schedules.every(schedule => schedule.finish === "T"); |
|
428 |
+ if (allFinished) { |
|
429 |
+ this.state = 'finish'; |
|
430 |
+ } else { |
|
431 |
+ this.nowSchedule = this.schedules.find(schedule => schedule.finish === null || schedule.finish === "F"); |
|
432 |
+ if (this.nowSchedule) { |
|
433 |
+ this.fetchRoadmapData(unit_id, book_id); |
|
434 |
+ this.state = 'studying'; |
|
435 |
+ } else { |
|
436 |
+ this.state = 'notRegistered'; |
|
437 |
+ } |
|
438 |
+ } |
|
439 |
+ } |
|
440 |
+ }) |
|
441 |
+ .catch(error => { |
|
442 |
+ console.error("Error fetching roadmap data:", error); |
|
443 |
+ }); |
|
444 |
+ }, |
|
445 |
+ finishSchedule() { |
|
446 |
+ axios({ |
|
447 |
+ url: "/schedule/scheduleUpdate.json", |
|
448 |
+ method: "post", |
|
449 |
+ headers: { |
|
450 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
451 |
+ }, |
|
452 |
+ data: { |
|
453 |
+ scheduleId: this.nowSchedule.schdl_id, |
|
454 |
+ finish: "T" |
|
455 |
+ } |
|
456 |
+ }) |
|
457 |
+ .then(response => { |
|
458 |
+ const nextSchedule = this.schedules.find(schedule => schedule.schdl_id > this.nowSchedule.schdl_id); |
|
459 |
+ alert("학습을 완료했습니다!"); |
|
460 |
+ |
|
461 |
+ if (nextSchedule) { |
|
462 |
+ this.nowSchedule = nextSchedule; |
|
463 |
+ this.fetchSchedule(nextSchedule.unit_id, nextSchedule.book_id); |
|
464 |
+ this.fetchRoadmapData(nextSchedule.unit_id, nextSchedule.book_id); |
|
465 |
+ this.$router.push({ name: 'Dashboard', query: { unit_id: nextSchedule.unit_id, book_id: nextSchedule.book_id } }); |
|
466 |
+ } else { |
|
467 |
+ alert("모든 학습을 완료했습니다!"); |
|
468 |
+ this.state = 'finish'; |
|
469 |
+ } |
|
470 |
+ }) |
|
471 |
+ .catch(error => { |
|
472 |
+ console.error("Error updating schedule:", error); |
|
473 |
+ }); |
|
474 |
+ }, |
|
475 |
+ fetchRoadmapData(unit_id, book_id) { |
|
476 |
+ axios({ |
|
477 |
+ url: "/unitLearning/find.json", |
|
478 |
+ method: "post", |
|
479 |
+ headers: { |
|
480 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
481 |
+ }, |
|
482 |
+ data: { |
|
483 |
+ unit_id: unit_id, |
|
484 |
+ book_id: book_id |
|
485 |
+ } |
|
486 |
+ }) |
|
487 |
+ .then(response => { |
|
488 |
+ if (response.data.length != 0) { |
|
489 |
+ this.roadmapData = response.data; |
|
490 |
+ this.titleUnitName = this.roadmapData[0].unit_nm |
|
491 |
+ this.titleBookName = this.roadmapData[0].book_nm |
|
492 |
+ this.labeledItems = this.processedRoadmap; |
|
493 |
+ } else { |
|
494 |
+ this.state = "noProblem" |
|
495 |
+ } |
|
496 |
+ }) |
|
497 |
+ .catch(error => { |
|
498 |
+ this.state = "noProblem" |
|
499 |
+ console.error("Error fetching roadmap data:", error); |
|
500 |
+ }); |
|
501 |
+ }, |
|
502 |
+ toggleImage(index) { |
|
503 |
+ this.items[index].isSecondImageVisible = !this.items[index].isSecondImageVisible; |
|
504 |
+ }, |
|
505 |
+ ShowPopup() { |
|
506 |
+ this.searchOpen2 = true; // 촬영 여부 묻는 모달창 열기 |
|
507 |
+ }, |
|
508 |
+ goToPage(page) { |
|
509 |
+ // const { unit_id, book_id } = this.$route.query; |
|
510 |
+ // this.$router.push({ name: page, query: { unit_id, book_id } }); |
|
511 |
+ this.$router.push({ name: page }); |
|
512 |
+ }, |
|
513 |
+ storeLearningId(learningId) { |
|
514 |
+ // console.log(learningId) |
|
515 |
+ this.$store.dispatch('updateLearningId', learningId); |
|
516 |
+ // console.log(this.$store.getters.getLearningId) |
|
517 |
+ }, |
|
518 |
+ openCameraModal() { |
|
519 |
+ this.closeModal(); |
|
520 |
+ |
|
521 |
+ this.showCameraModal = true; |
|
522 |
+ navigator.mediaDevices.getUserMedia({ video: true }) |
|
523 |
+ .then(stream => { |
|
524 |
+ const modalVideo = this.$refs.modalVideoElement; |
|
525 |
+ modalVideo.srcObject = stream; |
|
526 |
+ this.stream = stream; |
|
527 |
+ }) |
|
528 |
+ .catch(error => { |
|
529 |
+ console.log("error>>>>>>>>", error); |
|
530 |
+ }); |
|
531 |
+ }, |
|
532 |
+ closeModal() { //웹캠 및 모든 팝업 닫기 |
|
533 |
+ // this.showModal = false; |
|
534 |
+ this.searchOpen = false; |
|
535 |
+ this.searchOpen2 = false; |
|
536 |
+ this.showCameraModal = false; |
|
537 |
+ this.photoTaken = false; |
|
538 |
+ this.photo = null; |
|
539 |
+ |
|
540 |
+ //스트림 종료 |
|
541 |
+ if (this.stream) { |
|
542 |
+ let tracks = this.stream.getTracks(); |
|
543 |
+ tracks.forEach(track => track.stop()); |
|
544 |
+ this.stream = null; |
|
545 |
+ } |
|
546 |
+ }, |
|
547 |
+ |
|
548 |
+ onVideoLoaded() { |
|
549 |
+ const video = this.$refs.modalVideoElement; |
|
550 |
+ const canvas = this.$refs.canvas; |
|
551 |
+ const ctx = canvas.getContext('2d'); |
|
552 |
+ |
|
553 |
+ canvas.width = video.videoWidth; |
|
554 |
+ canvas.height = video.videoHeight; |
|
555 |
+ }, takePhoto() { |
|
556 |
+ const video = this.$refs.modalVideoElement; |
|
557 |
+ const canvas = this.$refs.canvas; |
|
558 |
+ const ctx = canvas.getContext('2d'); |
|
559 |
+ |
|
560 |
+ ctx.save(); // 현재 상태 저장 |
|
561 |
+ |
|
562 |
+ // 캔버스 좌우 반전 |
|
563 |
+ ctx.scale(-1, 1); |
|
564 |
+ ctx.drawImage(video, -canvas.width, 0, canvas.width, canvas.height); |
|
565 |
+ |
|
566 |
+ ctx.restore(); |
|
567 |
+ |
|
568 |
+ const overlayImg = new Image(); |
|
569 |
+ overlayImg.src = 'client/resources/img/camera-rabbit.png'; |
|
570 |
+ overlayImg.onload = () => { |
|
571 |
+ const overlayWidth = canvas.width * 0.4; |
|
572 |
+ const overlayHeight = (overlayImg.height / overlayImg.width) * overlayWidth; |
|
573 |
+ const overlayX = canvas.width - overlayWidth; |
|
574 |
+ const overlayY = canvas.height - overlayHeight; |
|
575 |
+ |
|
576 |
+ // 오버레이 이미지 그리기 |
|
577 |
+ ctx.drawImage(overlayImg, overlayX, overlayY, overlayWidth, overlayHeight); |
|
578 |
+ |
|
579 |
+ // 사진 저장 함수 호출 |
|
580 |
+ const dataURL = canvas.toDataURL('image/png'); |
|
581 |
+ this.$router.push({ name: 'PhotoEdit', query: { image: encodeURIComponent(dataURL), unit_id: this.unit_id, book_id: this.book_id } }); |
|
582 |
+ }; |
|
583 |
+ }, |
|
584 |
+ |
|
585 |
+ |
|
586 |
+ |
|
587 |
+ buttonSearch() { |
|
588 |
+ this.searchOpen = true; |
|
589 |
+ }, |
|
590 |
+ buttonSearch2() { |
|
591 |
+ this.searchOpen2 = true; |
|
592 |
+ }, |
|
593 |
+ closeBtn() { |
|
594 |
+ this.searchOpen = false; |
|
595 |
+ }, |
|
784 | 596 |
}, |
785 |
- closeModal() { |
|
786 |
- //웹캠 및 모든 팝업 닫기 |
|
787 |
- // this.showModal = false; |
|
788 |
- this.searchOpen = false; |
|
789 |
- this.searchOpen2 = false; |
|
790 |
- this.showCameraModal = false; |
|
791 |
- this.photoTaken = false; |
|
792 |
- this.photo = null; |
|
793 |
- |
|
794 |
- //스트림 종료 |
|
795 |
- if (this.stream) { |
|
796 |
- let tracks = this.stream.getTracks(); |
|
797 |
- tracks.forEach((track) => track.stop()); |
|
798 |
- this.stream = null; |
|
799 |
- } |
|
597 |
+ components: { |
|
598 |
+ SvgIcon, |
|
800 | 599 |
}, |
801 |
- |
|
802 |
- onVideoLoaded() { |
|
803 |
- const video = this.$refs.modalVideoElement; |
|
804 |
- const canvas = this.$refs.canvas; |
|
805 |
- const ctx = canvas.getContext("2d"); |
|
806 |
- |
|
807 |
- canvas.width = video.videoWidth; |
|
808 |
- canvas.height = video.videoHeight; |
|
600 |
+ mounted() { |
|
601 |
+ console.log('main mounted'); |
|
602 |
+ this.checkAndFetchData(); |
|
603 |
+ // const { book_id, unit_id } = this.$route.query; |
|
809 | 604 |
}, |
810 |
- takePhoto() { |
|
811 |
- const video = this.$refs.modalVideoElement; |
|
812 |
- const canvas = this.$refs.canvas; |
|
813 |
- const ctx = canvas.getContext("2d"); |
|
814 |
- |
|
815 |
- ctx.save(); // 현재 상태 저장 |
|
816 |
- |
|
817 |
- // 캔버스 좌우 반전 |
|
818 |
- ctx.scale(-1, 1); |
|
819 |
- ctx.drawImage(video, -canvas.width, 0, canvas.width, canvas.height); |
|
820 |
- |
|
821 |
- ctx.restore(); |
|
822 |
- |
|
823 |
- const overlayImg = new Image(); |
|
824 |
- overlayImg.src = "client/resources/img/camera-rabbit.png"; |
|
825 |
- overlayImg.onload = () => { |
|
826 |
- const overlayWidth = canvas.width * 0.4; |
|
827 |
- const overlayHeight = |
|
828 |
- (overlayImg.height / overlayImg.width) * overlayWidth; |
|
829 |
- const overlayX = canvas.width - overlayWidth; |
|
830 |
- const overlayY = canvas.height - overlayHeight; |
|
831 |
- |
|
832 |
- // 오버레이 이미지 그리기 |
|
833 |
- ctx.drawImage( |
|
834 |
- overlayImg, |
|
835 |
- overlayX, |
|
836 |
- overlayY, |
|
837 |
- overlayWidth, |
|
838 |
- overlayHeight |
|
839 |
- ); |
|
840 |
- |
|
841 |
- // 사진 저장 함수 호출 |
|
842 |
- const dataURL = canvas.toDataURL("image/png"); |
|
843 |
- this.$router.push({ |
|
844 |
- name: "PhotoEdit", |
|
845 |
- query: { |
|
846 |
- image: encodeURIComponent(dataURL), |
|
847 |
- unit_id: this.unit_id, |
|
848 |
- book_id: this.book_id, |
|
849 |
- }, |
|
850 |
- }); |
|
851 |
- }; |
|
852 |
- }, |
|
853 |
- |
|
854 |
- buttonSearch() { |
|
855 |
- this.searchOpen = true; |
|
856 |
- }, |
|
857 |
- buttonSearch2() { |
|
858 |
- this.searchOpen2 = true; |
|
859 |
- }, |
|
860 |
- closeBtn() { |
|
861 |
- this.searchOpen = false; |
|
862 |
- }, |
|
863 |
- }, |
|
864 |
- components: { |
|
865 |
- SvgIcon, |
|
866 |
- }, |
|
867 |
- mounted() { |
|
868 |
- console.log("main mounted"); |
|
869 |
- this.checkAndFetchData(); |
|
870 |
- // const { book_id, unit_id } = this.$route.query; |
|
871 |
- }, |
|
872 |
- watch: { |
|
873 |
- getBookId(newBookId) { |
|
874 |
- this.checkAndFetchData(); |
|
875 |
- }, |
|
876 |
- getUnitId(newUnitId) { |
|
877 |
- this.checkAndFetchData(); |
|
878 |
- }, |
|
879 |
- }, |
|
880 |
- computed: { |
|
881 |
- ...mapGetters(["getBookId", "getUnitId"]), |
|
882 |
- |
|
883 |
- processedRoadmap() { |
|
884 |
- let problemCounter = 0; |
|
885 |
- let wordCounter = 0; |
|
886 |
- let textCounter = 0; |
|
887 |
- let evalCounter = 0; |
|
888 |
- |
|
889 |
- return this.roadmapData.map((item) => { |
|
890 |
- if (item.wd_book_id !== null) { |
|
891 |
- wordCounter++; |
|
892 |
- return `단어장${wordCounter}`; |
|
893 |
- } else if (item.text_id !== null) { |
|
894 |
- textCounter++; |
|
895 |
- return `지문${textCounter}`; |
|
896 |
- } else if (item.eval_id !== null) { |
|
897 |
- evalCounter++; |
|
898 |
- return evalCounter === 1 ? "중간평가" : "최종평가"; |
|
899 |
- } else { |
|
900 |
- problemCounter++; |
|
901 |
- return `문제${problemCounter}`; |
|
605 |
+ watch: { |
|
606 |
+ getBookId(newBookId) { |
|
607 |
+ this.checkAndFetchData(); |
|
608 |
+ }, |
|
609 |
+ getUnitId(newUnitId) { |
|
610 |
+ this.checkAndFetchData(); |
|
902 | 611 |
} |
903 |
- }); |
|
904 | 612 |
}, |
905 |
- }, |
|
906 |
- beforeDestroy() { |
|
907 |
- // 컴포넌트가 파괴되기 전에 리스너 제거 |
|
908 |
- window.removeEventListener("resize", this.updateCanvasRect); |
|
909 |
- this.$refs.canvas.removeEventListener("click", this.handleCanvasClick); |
|
910 |
- }, |
|
911 |
-}; |
|
613 |
+ computed: { |
|
614 |
+ ...mapGetters(['getBookId', 'getUnitId']), |
|
615 |
+ |
|
616 |
+ processedRoadmap() { |
|
617 |
+ let problemCounter = 0; |
|
618 |
+ let wordCounter = 0; |
|
619 |
+ let textCounter = 0; |
|
620 |
+ let evalCounter = 0; |
|
621 |
+ |
|
622 |
+ return this.roadmapData.map(item => { |
|
623 |
+ if (item.wd_cnt_id !== null) { |
|
624 |
+ wordCounter++; |
|
625 |
+ return { label: `단어장${wordCounter}`, learning_id: item.learning_id }; |
|
626 |
+ } else if (item.text_id !== null) { |
|
627 |
+ textCounter++; |
|
628 |
+ return { label: `지문${textCounter}`, learning_id: item.learning_id }; |
|
629 |
+ } else if (item.eval_id !== null) { |
|
630 |
+ evalCounter++; |
|
631 |
+ return { label: evalCounter === 1 ? '중간평가' : '최종평가', learning_id: item.learning_id }; |
|
632 |
+ } else { |
|
633 |
+ problemCounter++; |
|
634 |
+ return { label: `문제${problemCounter}`, learning_id: item.learning_id }; |
|
635 |
+ } |
|
636 |
+ }); |
|
637 |
+ } |
|
638 |
+ }, |
|
639 |
+ beforeDestroy() { |
|
640 |
+ // 컴포넌트가 파괴되기 전에 리스너 제거 |
|
641 |
+ window.removeEventListener('resize', this.updateCanvasRect); |
|
642 |
+ this.$refs.canvas.removeEventListener('click', this.handleCanvasClick); |
|
643 |
+ } |
|
644 |
+} |
|
912 | 645 |
</script> |
913 | 646 |
|
914 | 647 |
<style scoped> |
915 | 648 |
.body { |
916 |
- width: 1435px; |
|
917 |
- height: auto; |
|
918 |
- margin: 0 auto; |
|
649 |
+ width: 1435px; |
|
650 |
+ height: auto; |
|
651 |
+ margin: 0 auto; |
|
919 | 652 |
} |
920 | 653 |
|
921 | 654 |
#container { |
922 |
- position: relative; |
|
923 |
- margin: auto; |
|
924 |
- border: 10px #333 solid; |
|
925 |
- display: flex; |
|
926 |
- justify-content: center; |
|
927 |
- align-items: center; |
|
928 |
- z-index: 100; |
|
655 |
+ position: relative; |
|
656 |
+ margin: auto; |
|
657 |
+ border: 10px #333 solid; |
|
658 |
+ display: flex; |
|
659 |
+ justify-content: center; |
|
660 |
+ align-items: center; |
|
661 |
+ z-index: 100; |
|
929 | 662 |
} |
930 | 663 |
|
931 | 664 |
video { |
932 |
- width: 100%; |
|
933 |
- height: 100%; |
|
934 |
- background-color: #666; |
|
665 |
+ width: 100%; |
|
666 |
+ height: auto; |
|
667 |
+ background-color: #666; |
|
935 | 668 |
} |
936 | 669 |
|
937 | 670 |
.mirrored { |
938 |
- transform: scaleX(-1); |
|
671 |
+ transform: scaleX(-1); |
|
939 | 672 |
} |
940 | 673 |
|
941 | 674 |
.new-btn:disabled { |
942 |
- background-color: #fff3d7; |
|
943 |
- cursor: not-allowed; |
|
675 |
+ background-color: #FFF3D7; |
|
676 |
+ cursor: not-allowed; |
|
944 | 677 |
} |
945 | 678 |
|
946 | 679 |
.sticker { |
947 |
- position: absolute; |
|
948 |
- cursor: move; |
|
680 |
+ position: absolute; |
|
681 |
+ cursor: move; |
|
949 | 682 |
} |
950 | 683 |
|
951 | 684 |
.sticker-handle { |
952 |
- width: 15px; |
|
953 |
- height: 15px; |
|
954 |
- background: rgba(255, 255, 255, 0.521); |
|
955 |
- position: absolute; |
|
956 |
- bottom: 0; |
|
957 |
- right: 0; |
|
958 |
- cursor: nwse-resize; |
|
959 |
- font-size: 13px; |
|
960 |
- font-weight: bolder; |
|
961 |
- color: rgb(63, 63, 63); |
|
685 |
+ width: 15px; |
|
686 |
+ height: 15px; |
|
687 |
+ background: rgba(255, 255, 255, 0.521); |
|
688 |
+ position: absolute; |
|
689 |
+ bottom: 0; |
|
690 |
+ right: 0; |
|
691 |
+ cursor: nwse-resize; |
|
692 |
+ font-size: 13px; |
|
693 |
+ font-weight: bolder; |
|
694 |
+ color: rgb(63, 63, 63); |
|
962 | 695 |
} |
963 | 696 |
|
964 | 697 |
.sticker-delete { |
965 |
- position: absolute; |
|
966 |
- top: 0; |
|
967 |
- right: 0; |
|
968 |
- background: rgba(255, 0, 0, 0.425); |
|
969 |
- color: white; |
|
970 |
- padding: 5px; |
|
971 |
- cursor: pointer; |
|
698 |
+ position: absolute; |
|
699 |
+ top: 0; |
|
700 |
+ right: 0; |
|
701 |
+ background: rgba(255, 0, 0, 0.425); |
|
702 |
+ color: white; |
|
703 |
+ padding: 5px; |
|
704 |
+ cursor: pointer; |
|
972 | 705 |
} |
973 | 706 |
|
974 | 707 |
.toolbar { |
975 |
- display: flex; |
|
976 |
- justify-content: center; |
|
977 |
- margin-top: 10px; |
|
708 |
+ display: flex; |
|
709 |
+ justify-content: center; |
|
710 |
+ margin-top: 10px; |
|
978 | 711 |
} |
979 | 712 |
|
980 | 713 |
.toolbar button { |
981 |
- margin: 5px; |
|
982 |
- padding: 5px 10px; |
|
983 |
- cursor: pointer; |
|
714 |
+ margin: 5px; |
|
715 |
+ padding: 5px 10px; |
|
716 |
+ cursor: pointer; |
|
984 | 717 |
} |
985 | 718 |
|
986 | 719 |
.toolbar input { |
987 |
- margin: 5px; |
|
720 |
+ margin: 5px; |
|
988 | 721 |
} |
989 | 722 |
|
990 | 723 |
.rabbit-end { |
991 |
- cursor: pointer; |
|
992 |
- display: block; |
|
993 |
- position: absolute; |
|
994 |
- bottom: 0px; |
|
995 |
- left: -15px; |
|
996 |
- z-index: 10000; |
|
724 |
+ cursor: pointer; |
|
725 |
+ display: block; |
|
726 |
+ position: absolute; |
|
727 |
+ bottom: 0px; |
|
728 |
+ left: -15px; |
|
729 |
+ z-index: 10000; |
|
997 | 730 |
} |
998 | 731 |
|
999 | 732 |
.rabbit-running { |
1000 |
- position: absolute; |
|
1001 |
- bottom: 40px; |
|
1002 |
- right: 110px; |
|
1003 |
- z-index: 10000; |
|
1004 |
- transform: scaleX(-1); |
|
1005 |
- transition: all 0.5s ease-in-out; |
|
733 |
+ position: absolute; |
|
734 |
+ bottom: 40px; |
|
735 |
+ right: 110px; |
|
736 |
+ z-index: 10000; |
|
737 |
+ transform: scaleX(-1); |
|
738 |
+ transition: all 0.5s ease-in-out; |
|
1006 | 739 |
} |
1007 | 740 |
|
1008 | 741 |
.fireworks-end { |
1009 |
- position: absolute; |
|
1010 |
- bottom: 70px; |
|
1011 |
- left: -40px; |
|
1012 |
- width: 20rem; |
|
742 |
+ position: absolute; |
|
743 |
+ bottom: 70px; |
|
744 |
+ left: -40px; |
|
745 |
+ width: 20rem; |
|
1013 | 746 |
} |
1014 | 747 |
|
748 |
+ |
|
1015 | 749 |
.camera-rabbit { |
1016 |
- position: absolute; |
|
1017 |
- right: 0; |
|
1018 |
- bottom: 0; |
|
1019 |
- width: 40%; |
|
750 |
+ position: absolute; |
|
751 |
+ right: 0; |
|
752 |
+ bottom: 0; |
|
753 |
+ width: 40%; |
|
1020 | 754 |
} |
1021 |
-</style> |
|
755 |
+</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?