

240812 김건택 MyPage 포토북 랭킹 수정
@287f4786b5d94747f3c691e0ad77912f13cc6d1a
--- client/views/pages/main/MyPage.vue
+++ client/views/pages/main/MyPage.vue
... | ... | @@ -98,7 +98,7 @@ |
98 | 98 |
</div> |
99 | 99 |
<div class="box " style="gap: 10px;"> |
100 | 100 |
<div><img src="../../../resources/img/img196_12p.png" alt=""></div> |
101 |
- <P class="title2 mt10">현재 30명 중 <em class="blue">2등</em>입니다.</P> |
|
101 |
+ <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="blue">{{ rank }}등</em>입니다.</P> |
|
102 | 102 |
</div> |
103 | 103 |
</div> |
104 | 104 |
<div class="textbook book-navy"> |
... | ... | @@ -121,11 +121,15 @@ |
121 | 121 |
import { mdiMagnify, } from '@mdi/js'; |
122 | 122 |
import { mdilArrowRight } from '@mdi/light-js'; |
123 | 123 |
import ProgressBar from '../../component/ProgressBar.vue'; |
124 |
+import axios from "axios"; |
|
124 | 125 |
|
125 | 126 |
|
126 | 127 |
export default { |
127 | 128 |
data() { |
128 | 129 |
return { |
130 |
+ stdCount : 0, |
|
131 |
+ rank: 0, |
|
132 |
+ |
|
129 | 133 |
mdiMagnify: mdiMagnify, |
130 | 134 |
mdilArrowRight: mdilArrowRight, |
131 | 135 |
timer: "00:00", |
... | ... | @@ -133,6 +137,51 @@ |
133 | 137 |
} |
134 | 138 |
}, |
135 | 139 |
methods: { |
140 |
+ classStdCount: function () { |
|
141 |
+ const vm = this; |
|
142 |
+ axios({ |
|
143 |
+ url: "/userclass/classStdCount.json", |
|
144 |
+ method: "post", |
|
145 |
+ headers:{ |
|
146 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
147 |
+ }, |
|
148 |
+ data: { |
|
149 |
+ sclsId:"1" |
|
150 |
+ } |
|
151 |
+ }) |
|
152 |
+ .then(function (response) { |
|
153 |
+ console.log("classStdCount - response : ", response.data); |
|
154 |
+ vm.stdCount = response.data; |
|
155 |
+ }) |
|
156 |
+ .catch(function (error) { |
|
157 |
+ console.log("classStdCount - error : ", error); |
|
158 |
+ alert("반 학생 수 조회에 오류가 발생했습니다."); |
|
159 |
+ }); |
|
160 |
+ }, |
|
161 |
+ |
|
162 |
+ photoRankByLikeData: function () { |
|
163 |
+ const vm = this; |
|
164 |
+ axios({ |
|
165 |
+ url: "/photo/photoRankByLikeData.json", |
|
166 |
+ method: "post", |
|
167 |
+ headers:{ |
|
168 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
169 |
+ }, |
|
170 |
+ data: { |
|
171 |
+ sclsId:"1", |
|
172 |
+ stdId:"1" |
|
173 |
+ } |
|
174 |
+ }) |
|
175 |
+ .then(function (response) { |
|
176 |
+ console.log("Rank - response : ", response.data); |
|
177 |
+ vm.rank = response.data; |
|
178 |
+ }) |
|
179 |
+ .catch(function (error) { |
|
180 |
+ console.log("Rank - error : ", error); |
|
181 |
+ alert("학생 사진 랭킹 조회에 오류가 발생했습니다."); |
|
182 |
+ }); |
|
183 |
+ }, |
|
184 |
+ |
|
136 | 185 |
goToPage(page) { |
137 | 186 |
this.$router.push({ name: page }); |
138 | 187 |
}, |
... | ... | @@ -168,6 +217,8 @@ |
168 | 217 |
}, |
169 | 218 |
mounted() { |
170 | 219 |
console.log('Main2 mounted'); |
220 |
+ this.classStdCount(); |
|
221 |
+ this.photoRankByLikeData(); |
|
171 | 222 |
} |
172 | 223 |
} |
173 | 224 |
</script> |
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?