오디션, 오디션 캐릭터
- 모집완료이면 터치되지 않도록 수정
This commit is contained in:
@@ -84,6 +84,43 @@ struct AuditionRoleDetailView: View {
|
||||
.foregroundColor(Color.grayee)
|
||||
.padding(.top, 15)
|
||||
} else {
|
||||
HStack(spacing: 0) {
|
||||
Text("참여자")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.graybb)
|
||||
|
||||
Text("\(viewModel.totalCount)")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.button)
|
||||
.padding(.leading, 2.3)
|
||||
|
||||
Text("명")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.graybb)
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("최신순")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(
|
||||
viewModel.sortType == .NEWEST ? Color.button : Color.graybb
|
||||
)
|
||||
.onTapGesture {
|
||||
viewModel.setSortType(sortType: .NEWEST)
|
||||
}
|
||||
|
||||
Text("좋아요순")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(
|
||||
viewModel.sortType == .LIKES ? Color.button : Color.graybb
|
||||
)
|
||||
.onTapGesture {
|
||||
viewModel.setSortType(sortType: .LIKES)
|
||||
}
|
||||
.padding(.leading, 13.3)
|
||||
}
|
||||
.padding(.top, 15)
|
||||
|
||||
VStack(spacing: 5.3) {
|
||||
ForEach(0..<viewModel.applicantList.count, id: \.self) {
|
||||
let applicant = viewModel.applicantList[$0]
|
||||
|
@@ -24,11 +24,9 @@ final class AuditionRoleDetailViewModel: ObservableObject {
|
||||
@Published var name = "보이스온"
|
||||
@Published var auditionRoleDetail: GetAuditionRoleDetailResponse? = nil
|
||||
|
||||
@Published var sortType = AuditionApplicantSortType.NEWEST {
|
||||
@Published private (set) var sortType = AuditionApplicantSortType.NEWEST {
|
||||
didSet {
|
||||
page = 1
|
||||
isLast = false
|
||||
getAuditionRoleDetail()
|
||||
refreshApplicantList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +55,12 @@ final class AuditionRoleDetailViewModel: ObservableObject {
|
||||
|
||||
var onFailure: () -> Void = {}
|
||||
|
||||
func setSortType(sortType: AuditionApplicantSortType) {
|
||||
if self.sortType != sortType {
|
||||
self.sortType = sortType
|
||||
}
|
||||
}
|
||||
|
||||
func getAuditionRoleDetail() {
|
||||
isLoading = true
|
||||
|
||||
@@ -237,13 +241,8 @@ final class AuditionRoleDetailViewModel: ObservableObject {
|
||||
self.phoneNumber = ""
|
||||
self.fileName = ""
|
||||
self.soundData = nil
|
||||
self.applicantList = []
|
||||
self.totalCount = 0
|
||||
|
||||
self.page = 1
|
||||
self.isLast = false
|
||||
self.getAuditionRoleDetail()
|
||||
|
||||
self.refreshApplicantList()
|
||||
onSuccess()
|
||||
} else {
|
||||
if let message = decoded.message {
|
||||
@@ -323,6 +322,14 @@ final class AuditionRoleDetailViewModel: ObservableObject {
|
||||
.store(in: &subscription)
|
||||
}
|
||||
|
||||
private func refreshApplicantList() {
|
||||
self.page = 1
|
||||
self.isLast = false
|
||||
self.totalCount = 0
|
||||
self.applicantList = []
|
||||
self.getAuditionApplicantList()
|
||||
}
|
||||
|
||||
func deleteAllRecordingFilesWithNamePrefix(_ prefix: String) {
|
||||
let fileManager = FileManager.default
|
||||
let documentsURL = getDocumentsDirectory()
|
||||
|
Reference in New Issue
Block a user