Skip to content

Commit 1876e8f

Browse files
authored
#614 홈 화면 이주의 보너스 문제 수정 (#732)
* #614 홈 화면 이주의 보너스 문제 수정 - 이주의 보너스 문제 -> 이번주의 보너스 문제 - 카드 상단 띠 제거 * #614 그림자 금빛 -> 검은색 그림자 금빛 -> 검은색
1 parent 76d9f49 commit 1876e8f

1 file changed

Lines changed: 22 additions & 31 deletions

File tree

frontend/src/pages/oj/views/home/HomeWeeklyServices.vue

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<div class="weekly-wrap">
33
<div class="outer-card">
44
<div class="section-header">
5-
<span class="section-title">이주의 보너스 문제</span>
5+
<span class="section-title">이번주의 보너스 문제</span>
66
<span class="double-badge">
7-
이주의 보너스 문제를 해결하면 점수의 2배를 줘요
7+
해결하면 점수를 2배로 받을 수 있어요
88
</span>
99
</div>
1010

@@ -13,26 +13,29 @@
1313
v-for="(problem, index) in problems"
1414
:key="problem._id"
1515
class="card"
16-
:class="CARD_COLORS[index % 3].cardClass"
1716
@click="enterProblem(problem._id)"
1817
>
1918
<div class="card-top">
2019
<div class="card-meta">
20+
<span class="badge b-bonus">점수 2배</span>
2121
<span class="badge b-cat">{{
22-
FIELD_MAP[problem.field].value
22+
(FIELD_MAP[problem.field] || {}).value
2323
}}</span>
2424
<span
2525
class="badge"
2626
:class="difficultyBadgeClass(problem.difficulty)"
2727
>
28-
{{ DIFFICULTY_MAP[problem.difficulty].value }}
28+
{{ (DIFFICULTY_MAP[problem.difficulty] || {}).value }}
2929
</span>
3030
</div>
3131
<span class="num">{{ String(index + 1).padStart(2, "0") }}</span>
3232
</div>
3333
<p class="card-title">{{ problem.title }}</p>
3434
<div class="card-tags">
35-
<span v-for="tag in problem.tags.slice(0, 2)" :key="tag" class="tag"
35+
<span
36+
v-for="tag in (problem.tags || []).slice(0, 2)"
37+
:key="tag"
38+
class="tag"
3639
>#{{ tag }}</span
3740
>
3841
</div>
@@ -52,12 +55,6 @@ import api from "@oj/api"
5255
import { mapActions } from "vuex"
5356
import { FIELD_MAP, DIFFICULTY_MAP } from "../../../../utils/constants"
5457
55-
const CARD_COLORS = [
56-
{ cardClass: "c1" },
57-
{ cardClass: "c2" },
58-
{ cardClass: "c3" },
59-
]
60-
6158
export default {
6259
name: "HomeWeeklyServices",
6360
computed: {
@@ -67,19 +64,19 @@ export default {
6764
DIFFICULTY_MAP() {
6865
return DIFFICULTY_MAP
6966
},
70-
CARD_COLORS() {
71-
return CARD_COLORS
72-
},
7367
},
7468
data() {
7569
return {
7670
problems: [],
7771
}
7872
},
7973
mounted() {
80-
api.getHomeBonusProblem().then((res) => {
81-
this.problems = res.data.data.slice(0, 3)
82-
})
74+
api
75+
.getHomeBonusProblem()
76+
.then((res) => {
77+
this.problems = (res.data.data || []).slice(0, 3)
78+
})
79+
.catch(() => {})
8380
},
8481
methods: {
8582
...mapActions(["changeProblemSolvingState"]),
@@ -187,25 +184,14 @@ export default {
187184
gap: 10px;
188185
cursor: pointer;
189186
background: #ffffff;
190-
border: 1px solid #ebebf0;
191-
border-top-width: 4px;
187+
border: 1px solid #f2e2bb;
192188
transition:
193189
transform 0.16s,
194190
box-shadow 0.16s;
195191
196192
&:hover {
197193
transform: translateY(-3px);
198-
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
199-
}
200-
201-
&.c1 {
202-
border-top-color: #e24b4a;
203-
}
204-
&.c2 {
205-
border-top-color: #f5a623;
206-
}
207-
&.c3 {
208-
border-top-color: #1d9e75;
194+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
209195
}
210196
}
211197
@@ -228,6 +214,11 @@ export default {
228214
padding: 3px 10px;
229215
border-radius: 99px;
230216
217+
&.b-bonus {
218+
background: #f59e0b;
219+
color: #fff;
220+
font-weight: 700;
221+
}
231222
&.b-cat {
232223
background: #eeedfe;
233224
color: #3c3489;

0 commit comments

Comments
 (0)