parent
5fc0f1789a
commit
9533e97f89
|
@ -219,7 +219,7 @@ struct ContentCreateView: View {
|
||||||
VStack(spacing: 13.3) {
|
VStack(spacing: 13.3) {
|
||||||
Text("소장 설정")
|
Text("소장 설정")
|
||||||
.font(.custom(Font.bold.rawValue, size: 16.7))
|
.font(.custom(Font.bold.rawValue, size: 16.7))
|
||||||
.foregroundColor(Color(hex: "eeeeee"))
|
.foregroundColor(Color.grayee)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
|
||||||
HStack(spacing: 13.3) {
|
HStack(spacing: 13.3) {
|
||||||
|
@ -241,7 +241,7 @@ struct ContentCreateView: View {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
Text(viewModel.isOnlyRental ? "대여 가격" : "소장 가격")
|
Text(viewModel.isOnlyRental ? "대여 가격" : "소장 가격")
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||||
.foregroundColor(Color(hex: "d2d2d2"))
|
.foregroundColor(Color.grayd2)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
|
||||||
HStack(spacing: 0) {
|
HStack(spacing: 0) {
|
||||||
|
@ -249,7 +249,7 @@ struct ContentCreateView: View {
|
||||||
.autocapitalization(.none)
|
.autocapitalization(.none)
|
||||||
.disableAutocorrection(true)
|
.disableAutocorrection(true)
|
||||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||||
.foregroundColor(Color(hex: "eeeeee"))
|
.foregroundColor(Color.grayee)
|
||||||
.cornerRadius(6.7)
|
.cornerRadius(6.7)
|
||||||
.keyboardType(.numberPad)
|
.keyboardType(.numberPad)
|
||||||
.padding(.trailing, 10)
|
.padding(.trailing, 10)
|
||||||
|
@ -258,16 +258,16 @@ struct ContentCreateView: View {
|
||||||
|
|
||||||
Text("캔")
|
Text("캔")
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||||
.foregroundColor(Color(hex: "777777"))
|
.foregroundColor(Color.gray77)
|
||||||
}
|
}
|
||||||
.padding(.vertical, 17)
|
.padding(.vertical, 17)
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
.background(Color(hex: "222222"))
|
.background(Color.gray22)
|
||||||
.cornerRadius(5.3)
|
.cornerRadius(5.3)
|
||||||
.padding(.top, 5.3)
|
.padding(.top, 5.3)
|
||||||
|
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.foregroundColor(Color(hex: "232323"))
|
.foregroundColor(Color.gray23)
|
||||||
.frame(height: 1)
|
.frame(height: 1)
|
||||||
.padding(.top, 11)
|
.padding(.top, 11)
|
||||||
|
|
||||||
|
@ -289,6 +289,44 @@ struct ContentCreateView: View {
|
||||||
}
|
}
|
||||||
.padding(.top, 26.7)
|
.padding(.top, 26.7)
|
||||||
|
|
||||||
|
if viewModel.price > 0 && !viewModel.isOnlyRental {
|
||||||
|
VStack(spacing: 13.3) {
|
||||||
|
Text("한정판 설정")
|
||||||
|
.font(.custom(Font.bold.rawValue, size: 16.7))
|
||||||
|
.foregroundColor(Color.grayee)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
|
||||||
|
HStack(spacing: 13.3) {
|
||||||
|
SelectButtonView(title: "무제한", isChecked: !viewModel.isLimited) {
|
||||||
|
if viewModel.isLimited {
|
||||||
|
viewModel.isLimited = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectButtonView(title: "한정판", isChecked: viewModel.isLimited) {
|
||||||
|
if !viewModel.isLimited {
|
||||||
|
viewModel.isLimited = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if viewModel.isLimited {
|
||||||
|
TextField("한정판 개수를 입력하세요", text: $viewModel.limitedString)
|
||||||
|
.autocapitalization(.none)
|
||||||
|
.disableAutocorrection(true)
|
||||||
|
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||||
|
.foregroundColor(Color.grayee)
|
||||||
|
.cornerRadius(6.7)
|
||||||
|
.keyboardType(.numberPad)
|
||||||
|
.padding(.vertical, 17)
|
||||||
|
.padding(.horizontal, 13.3)
|
||||||
|
.background(Color.gray22)
|
||||||
|
.cornerRadius(5.3)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding(.top, 26.7)
|
||||||
|
}
|
||||||
|
|
||||||
VStack(spacing: 13.3) {
|
VStack(spacing: 13.3) {
|
||||||
Text("미리듣기")
|
Text("미리듣기")
|
||||||
.font(.custom(Font.bold.rawValue, size: 16.7))
|
.font(.custom(Font.bold.rawValue, size: 16.7))
|
||||||
|
|
|
@ -55,15 +55,48 @@ final class ContentCreateViewModel: ObservableObject {
|
||||||
didSet {
|
didSet {
|
||||||
if isFree {
|
if isFree {
|
||||||
priceString = "0"
|
priceString = "0"
|
||||||
|
isLimited = false
|
||||||
isOnlyRental = false
|
isOnlyRental = false
|
||||||
isGeneratePreview = true
|
isGeneratePreview = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Published var isOnlyRental = false
|
@Published var isOnlyRental = false {
|
||||||
|
didSet {
|
||||||
|
if isOnlyRental {
|
||||||
|
isLimited = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@Published var isGeneratePreview = true
|
@Published var isGeneratePreview = true
|
||||||
|
|
||||||
|
@Published var isLimited = false {
|
||||||
|
didSet {
|
||||||
|
if !isLimited {
|
||||||
|
limitedString = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Published var limited: Int? = nil {
|
||||||
|
didSet {
|
||||||
|
if let limited = limited, limited <= 0 {
|
||||||
|
limitedString = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Published var limitedString: String = "" {
|
||||||
|
didSet {
|
||||||
|
if limitedString == "" {
|
||||||
|
limited = nil
|
||||||
|
} else {
|
||||||
|
limited = Int(limitedString)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Published var previewStartTime: String = ""
|
@Published var previewStartTime: String = ""
|
||||||
@Published var previewEndTime: String = ""
|
@Published var previewEndTime: String = ""
|
||||||
@Published var releaseDateString: String = Date().convertDateFormat(dateFormat: "yyyy.MM.dd")
|
@Published var releaseDateString: String = Date().convertDateFormat(dateFormat: "yyyy.MM.dd")
|
||||||
|
@ -92,6 +125,7 @@ final class ContentCreateViewModel: ObservableObject {
|
||||||
detail: detail,
|
detail: detail,
|
||||||
tags: hashtags,
|
tags: hashtags,
|
||||||
price: price,
|
price: price,
|
||||||
|
limited: limited,
|
||||||
releaseDate: isActiveReservation ? "\(releaseDate.convertDateFormat(dateFormat: "yyyy-MM-dd")) \(releaseTime.convertDateFormat(dateFormat: "HH:mm"))" : nil,
|
releaseDate: isActiveReservation ? "\(releaseDate.convertDateFormat(dateFormat: "yyyy-MM-dd")) \(releaseTime.convertDateFormat(dateFormat: "HH:mm"))" : nil,
|
||||||
timezone: TimeZone.current.identifier,
|
timezone: TimeZone.current.identifier,
|
||||||
themeId: theme!.id,
|
themeId: theme!.id,
|
||||||
|
|
|
@ -12,6 +12,7 @@ struct CreateAudioContentRequest: Encodable {
|
||||||
let detail: String
|
let detail: String
|
||||||
let tags: String
|
let tags: String
|
||||||
let price: Int
|
let price: Int
|
||||||
|
let limited: Int?
|
||||||
let releaseDate: String?
|
let releaseDate: String?
|
||||||
let timezone: String
|
let timezone: String
|
||||||
let themeId: Int
|
let themeId: Int
|
||||||
|
|
Loading…
Reference in New Issue