오디션 메인

- 페이지 추가
This commit is contained in:
Yu Sung
2025-01-06 14:34:42 +09:00
parent 5c3bf18d27
commit 3d8817275c
6 changed files with 303 additions and 1 deletions

View File

@@ -8,8 +8,86 @@
import SwiftUI
struct AuditionView: View {
@StateObject var viewModel = AuditionViewModel()
var body: some View {
Text("오디션")
BaseView(isLoading: $viewModel.isLoading) {
VStack(spacing: 0) {
HomeNavigationBar(title: "오디션") {}
ScrollView(.vertical, showsIndicators: false) {
LazyVStack(alignment: .leading, spacing: 16.7) {
ForEach(0..<viewModel.auditionList.count, id: \.self) {
let item = viewModel.auditionList[$0]
if $0 == 0 && !item.isOff {
VStack(alignment: .leading, spacing: 16.7) {
HStack(spacing: 0) {
Text("오디션")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(Color.grayee)
Text(" ON")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(Color.mainRed)
Spacer()
Text("\(viewModel.inProgressCount)")
.font(.custom(Font.medium.rawValue, size: 11.3))
.foregroundColor(Color.graybb)
}
AuditionItemView(item: item)
}
} else if $0 == viewModel.firstIsOffIndex {
VStack(alignment: .leading, spacing: 0) {
Color.gray23
.frame(maxWidth: .infinity)
.frame(height: 6.7)
.padding(.top, 13.3)
HStack(spacing: 0) {
Text("오디션")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(Color.grayee)
Text(" OFF")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(Color.graybb)
Spacer()
Text("\(viewModel.completedCount)")
.font(.custom(Font.medium.rawValue, size: 11.3))
.foregroundColor(Color.graybb)
}
.padding(.top, 30)
AuditionItemView(item: item)
.padding(.top, 16.7)
}
} else {
AuditionItemView(item: item)
}
if $0 == viewModel.auditionList.count - 1 {
Color.clear
.frame(height: 0)
.onAppear {
viewModel.getAuditionList()
}
}
}
}
.padding(.horizontal, 13.3)
}
}
.onAppear {
viewModel.getAuditionList()
}
}
}
}