diff --git a/src/pages/subscription/Subscription.jsx b/src/pages/subscription/Subscription.jsx index a1ae586..5aedf87 100644 --- a/src/pages/subscription/Subscription.jsx +++ b/src/pages/subscription/Subscription.jsx @@ -741,6 +741,7 @@ function AnnouncementsTab() { function MatchesTab() { const [items, setItems] = useState([]); const [total, setTotal] = useState(0); + const [myPoints, setMyPoints] = useState(null); const [page, setPage] = useState(1); const [refreshing, setRefreshing] = useState(false); const [loading, setLoading] = useState(true); @@ -753,6 +754,7 @@ function MatchesTab() { const data = await apiGet(`/api/realestate/matches?page=${page}&size=${size}`); setItems(data.items || []); setTotal(data.total || 0); + if (data.my_points) setMyPoints(data.my_points); } catch (e) { console.error('Matches load error:', e); setItems([]); @@ -789,9 +791,20 @@ function MatchesTab() { return (
-

- 총 {total}건의 매칭 결과 -

+
+

+ 총 {total}건의 매칭 결과 +

+ {myPoints && ( + = 60 ? '#34d399' : myPoints.total >= 40 ? '#f59e0b' : '#f87171', + background: myPoints.total >= 60 ? 'rgba(52,211,153,0.1)' : myPoints.total >= 40 ? 'rgba(245,158,11,0.1)' : 'rgba(248,113,113,0.1)', + fontWeight: 700, fontSize: 12, + }}> + 내 가점 {myPoints.total}/{myPoints.max_total} + + )} +
-
-
= 70 ? '#34d399' : (match.match_score ?? 0) >= 40 ? '#f59e0b' : '#f87171', - lineHeight: 1, - }}> - {match.match_score ?? '-'} -
-
- 매칭 점수 +
+
+
= 70 ? '#34d399' : (match.match_score ?? 0) >= 40 ? '#f59e0b' : '#f87171', + lineHeight: 1, + }}> + {match.match_score ?? '-'} +
+
+ 매칭 점수 +
+ {myPoints && ( +
= 50 ? 'rgba(52,211,153,0.1)' : 'rgba(248,113,113,0.1)', + color: myPoints.total >= 50 ? '#34d399' : '#f87171', + fontWeight: 600, whiteSpace: 'nowrap', + }}> + 가점 {myPoints.total}점 +
+ )}
))} @@ -985,7 +1010,53 @@ function ProfileTab() { if (loading) return
불러오는 중...
; + const pts = profile.subscription_points; + return ( +
+ {/* 가점 카드 */} + {pts && pts.total > 0 && ( +
+
+
+

청약 가점

+

내 가점 현황

+
+
= 60 ? '#34d399' : pts.total >= 40 ? '#f59e0b' : '#f87171', + lineHeight: 1, + }}> + {pts.total} / {pts.max_total} +
+
+
+ {[ + { label: '무주택기간', data: pts.homeless_duration, color: '#00d4ff' }, + { label: '부양가족 수', data: pts.dependents, color: '#8b5cf6' }, + { label: '청약통장 가입기간', data: pts.subscription_period, color: '#f59e0b' }, + ].map(({ label, data, color }) => ( +
+
+ {label} + + {data.score} + / {data.max} + +
+
+
+
+ {data.detail} +
+ ))} +
+
+ )} +
@@ -1198,6 +1269,7 @@ function ProfileTab() {
+
); }