feat: 포인트 내역 UI 추가
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// GetPointRewardStatusResponse.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 5/20/25.
|
||||
//
|
||||
|
||||
struct GetPointRewardStatusResponse: Decodable, Hashable {
|
||||
let rewardPoint: String
|
||||
let date: String
|
||||
let method: String
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// PointRewardStatusView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 5/20/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct PointRewardStatusView: View {
|
||||
|
||||
@StateObject var viewModel = PointStatusViewModel()
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
VStack(spacing: 13.3) {
|
||||
ForEach(viewModel.rewardStatusItems, id: \.self) { item in
|
||||
PointRewardStatusItemView(item: item)
|
||||
}
|
||||
}
|
||||
.padding(.top, 13.3)
|
||||
|
||||
if viewModel.isLoading {
|
||||
LoadingView()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.getPointRewardStatus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct PointRewardStatusItemView: View {
|
||||
|
||||
let item: GetPointRewardStatusResponse
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 0) {
|
||||
VStack(alignment: .leading, spacing: 6.7) {
|
||||
Text(item.rewardPoint)
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(.grayee)
|
||||
|
||||
Text(item.date)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(.gray77)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
Text(item.method)
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(.grayee)
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
.padding(.vertical, 16)
|
||||
.background(Color.gray11)
|
||||
.cornerRadius(16.7)
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
PointRewardStatusView()
|
||||
}
|
||||
Reference in New Issue
Block a user