오디션 메인
- 페이지 추가
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user