Compare commits

..

No commits in common. "68675ebfe841a44f9acae7cbeb4a60542fedf2dc" and "115a30a7b604cdc1f3f19fb80d5662c13d35fea6" have entirely different histories.

18 changed files with 112 additions and 202 deletions

View File

@ -194,7 +194,7 @@ struct ContentCreateView: View {
.padding(.top, 26.7) .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))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
@ -214,30 +214,8 @@ struct ContentCreateView: View {
} }
if !viewModel.isFree { if !viewModel.isFree {
VStack(spacing: 13.3) {
Text("소장 설정")
.font(.custom(Font.bold.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
.frame(maxWidth: .infinity, alignment: .leading)
HStack(spacing: 13.3) {
SelectButtonView(title: "소장/대여", isChecked: !viewModel.isOnlyRental) {
if viewModel.isOnlyRental {
viewModel.isOnlyRental = false
}
}
SelectButtonView(title: "대여만", isChecked: viewModel.isOnlyRental) {
if !viewModel.isOnlyRental {
viewModel.isOnlyRental = true
}
}
}
}
.padding(.top, 13.3)
VStack(spacing: 0) { VStack(spacing: 0) {
Text(viewModel.isOnlyRental ? "대여 가격" : "소장 가격") Text("소장가격")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2")) .foregroundColor(Color(hex: "d2d2d2"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
@ -269,7 +247,7 @@ struct ContentCreateView: View {
.frame(height: 1) .frame(height: 1)
.padding(.top, 11) .padding(.top, 11)
Text("※ 이용기간 대여 (15일) | 소장 (서비스종료시까지)") Text("※ 이용기간 대여 (7일) | 소장 (서비스종료시까지)")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
@ -343,62 +321,60 @@ struct ContentCreateView: View {
.padding(.top, 26.7) .padding(.top, 26.7)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
if !viewModel.isFree { VStack(spacing: 10) {
VStack(spacing: 10) { Text("미리듣기 시간 설정")
Text("미리듣기 시간 설정") .font(.custom(Font.bold.rawValue, size: 16.7))
.font(.custom(Font.bold.rawValue, size: 16.7)) .foregroundColor(Color(hex: "eeeeee"))
.foregroundColor(Color(hex: "eeeeee")) .frame(maxWidth: .infinity, alignment: .leading)
.frame(maxWidth: .infinity, alignment: .leading)
Text("미리듣기 시간을 직접 설정하지 않으면 콘텐츠 앞부분 30초가 자동으로 설정됩니다. 미리듣기의 시간제한은 없습니다.") Text("미리듣기 시간을 직접 설정하지 않으면 콘텐츠 앞부분 30초가 자동으로 설정됩니다. 미리듣기의 시간제한은 없습니다.")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
HStack(spacing: 13.3) { HStack(spacing: 13.3) {
VStack(spacing: 5.3) { VStack(spacing: 5.3) {
Text("시작 시간") Text("시작 시간")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2")) .foregroundColor(Color(hex: "d2d2d2"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
TextField("00:00:00", text: $viewModel.previewStartTime) TextField("00:00:00", text: $viewModel.previewStartTime)
.autocapitalization(.none) .autocapitalization(.none)
.disableAutocorrection(true) .disableAutocorrection(true)
.font(.custom(Font.bold.rawValue, size: 14.6)) .font(.custom(Font.bold.rawValue, size: 14.6))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))
.padding(.vertical, 16.7) .padding(.vertical, 16.7)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
.background(Color(hex: "222222")) .background(Color(hex: "222222"))
.cornerRadius(6.7) .cornerRadius(6.7)
.keyboardType(.default) .keyboardType(.default)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
} }
VStack(spacing: 5.3) { VStack(spacing: 5.3) {
Text("종료 시간") Text("종료 시간")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2")) .foregroundColor(Color(hex: "d2d2d2"))
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
TextField("00:00:30", text: $viewModel.previewEndTime) TextField("00:00:30", text: $viewModel.previewEndTime)
.autocapitalization(.none) .autocapitalization(.none)
.disableAutocorrection(true) .disableAutocorrection(true)
.font(.custom(Font.bold.rawValue, size: 14.6)) .font(.custom(Font.bold.rawValue, size: 14.6))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color(hex: "777777"))
.padding(.vertical, 16.7) .padding(.vertical, 16.7)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
.background(Color(hex: "222222")) .background(Color(hex: "222222"))
.cornerRadius(6.7) .cornerRadius(6.7)
.keyboardType(.default) .keyboardType(.default)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
}
} }
.padding(.top, 3.3)
} }
.padding(.top, 26.7) .padding(.top, 3.3)
.padding(.horizontal, 13.3)
} }
.padding(.top, 26.7)
.padding(.horizontal, 13.3)
VStack(spacing: 0) { VStack(spacing: 0) {
HStack(alignment: .top, spacing: 0) { HStack(alignment: .top, spacing: 0) {

View File

@ -54,13 +54,10 @@ final class ContentCreateViewModel: ObservableObject {
didSet { didSet {
if isFree { if isFree {
priceString = "0" priceString = "0"
isOnlyRental = false
} }
} }
} }
@Published var isOnlyRental = false
@Published var previewStartTime: String = "" @Published var previewStartTime: String = ""
@Published var previewEndTime: String = "" @Published var previewEndTime: String = ""
@ -77,7 +74,6 @@ final class ContentCreateViewModel: ObservableObject {
price: price, price: price,
themeId: theme!.id, themeId: theme!.id,
isAdult: isAdult, isAdult: isAdult,
isOnlyRental: isOnlyRental,
isCommentAvailable: isAvailableComment, isCommentAvailable: isAvailableComment,
previewStartTime: previewStartTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewStartTime : nil, previewStartTime: previewStartTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewStartTime : nil,
previewEndTime: previewEndTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewEndTime : nil previewEndTime: previewEndTime.trimmingCharacters(in: .whitespacesAndNewlines).count > 0 ? previewEndTime : nil

View File

@ -14,7 +14,6 @@ struct CreateAudioContentRequest: Encodable {
let price: Int let price: Int
let themeId: Int let themeId: Int
let isAdult: Bool let isAdult: Bool
let isOnlyRental: Bool
let isCommentAvailable: Bool let isCommentAvailable: Bool
let previewStartTime: String? let previewStartTime: String?
let previewEndTime: String? let previewEndTime: String?

View File

@ -10,7 +10,6 @@ import SwiftUI
struct ContentDetailPurchaseButton: View { struct ContentDetailPurchaseButton: View {
let price: Int let price: Int
let isOnlyRental: Bool
var body: some View { var body: some View {
HStack(spacing: 0) { HStack(spacing: 0) {
@ -27,7 +26,7 @@ struct ContentDetailPurchaseButton: View {
.font(.custom(Font.light.rawValue, size: 12)) .font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white) .foregroundColor(.white)
Text(isOnlyRental ? " 대여하기" : " 구매하기") Text(" 구매하기")
.font(.custom(Font.bold.rawValue, size: 14.7)) .font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(.white) .foregroundColor(.white)
} }

View File

@ -91,7 +91,7 @@ struct ContentDetailView: View {
!audioContent.existOrdered && !audioContent.existOrdered &&
audioContent.orderType == nil && audioContent.orderType == nil &&
audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) { audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) {
ContentDetailPurchaseButton(price: audioContent.price, isOnlyRental: audioContent.isOnlyRental) ContentDetailPurchaseButton(price: audioContent.price)
.contentShape(Rectangle()) .contentShape(Rectangle())
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
.onTapGesture { isShowOrderView = true } .onTapGesture { isShowOrderView = true }
@ -161,7 +161,6 @@ struct ContentDetailView: View {
ContentOrderDialogView( ContentOrderDialogView(
isShowing: $isShowOrderView, isShowing: $isShowOrderView,
price: audioContent.price, price: audioContent.price,
isOnlyRental: audioContent.isOnlyRental,
onTapPurchase: { onTapPurchase: {
viewModel.orderType = $0 viewModel.orderType = $0
isShowOrderConfirmView = true isShowOrderConfirmView = true
@ -187,7 +186,6 @@ struct ContentDetailView: View {
isShowing: $isShowOrderConfirmView, isShowing: $isShowOrderConfirmView,
audioContent: audioContent, audioContent: audioContent,
orderType: orderType, orderType: orderType,
isOnlyRental: audioContent.isOnlyRental,
onClickConfirm: { onClickConfirm: {
viewModel.order(orderType: orderType) viewModel.order(orderType: orderType)
} }

View File

@ -298,7 +298,7 @@ final class ContentDetailViewModel: ObservableObject {
if decoded.success { if decoded.success {
self.orderType = nil self.orderType = nil
self.errorMessage = orderType == .RENTAL ? "대여가 완료되었습니다." : "구매가 완료되었습니다." self.errorMessage = "구매가 완료되었습니다."
self.isShowPopup = true self.isShowPopup = true
self.getAudioContentDetail() self.getAudioContentDetail()
ContentPlayManager.shared.conditionalStopAudio(contentId: contentId) ContentPlayManager.shared.conditionalStopAudio(contentId: contentId)

View File

@ -14,7 +14,6 @@ struct ContentOrderConfirmDialogView: View {
let audioContent: GetAudioContentDetailResponse let audioContent: GetAudioContentDetailResponse
let orderType: OrderType let orderType: OrderType
let isOnlyRental: Bool
let onClickConfirm: () -> Void let onClickConfirm: () -> Void
var body: some View { var body: some View {
@ -91,15 +90,9 @@ struct ContentOrderConfirmDialogView: View {
.resizable() .resizable()
.frame(width: 16.7, height: 16.7) .frame(width: 16.7, height: 16.7)
if orderType == .RENTAL { Text("\(orderType == .RENTAL ? Int(ceil(Double(audioContent.price) * 0.6)) : audioContent.price)")
Text("\(isOnlyRental ? audioContent.price : Int(ceil(Double(audioContent.price) * 0.6)))") .font(.custom(Font.bold.rawValue, size: 13.3))
.font(.custom(Font.bold.rawValue, size: 13.3)) .foregroundColor(Color(hex: "eeeeee"))
.foregroundColor(Color(hex: "eeeeee"))
} else {
Text("\(audioContent.price)")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
}
Spacer() Spacer()
} }

View File

@ -12,7 +12,6 @@ struct ContentOrderDialogView: View {
@Binding var isShowing: Bool @Binding var isShowing: Bool
let price: Int let price: Int
let isOnlyRental: Bool
let onTapPurchase: (OrderType) -> Void let onTapPurchase: (OrderType) -> Void
var body: some View { var body: some View {
@ -32,7 +31,7 @@ struct ContentOrderDialogView: View {
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(.white) .foregroundColor(.white)
Text("(이용기간 15일)") Text("(이용기간 7일)")
.font(.custom(Font.light.rawValue, size: 12)) .font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white) .foregroundColor(.white)
} }
@ -44,7 +43,7 @@ struct ContentOrderDialogView: View {
.resizable() .resizable()
.frame(width: 16.7, height: 16.7) .frame(width: 16.7, height: 16.7)
Text(isOnlyRental ? "\(price)" : "\(Int(ceil(Double(price) * 0.6)))") Text("\(Int(ceil(Double(price) * 0.6)))")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
} }
@ -58,37 +57,35 @@ struct ContentOrderDialogView: View {
} }
} }
if !isOnlyRental { HStack(spacing: 0) {
HStack(spacing: 0) { VStack(alignment: .leading, spacing: 5.3) {
VStack(alignment: .leading, spacing: 5.3) { Text("소장")
Text("소장") .font(.custom(Font.bold.rawValue, size: 13.3))
.font(.custom(Font.bold.rawValue, size: 13.3)) .foregroundColor(.white)
.foregroundColor(.white)
Text("(서비스 종료시까지)") Text("(서비스 종료시까지)")
.font(.custom(Font.light.rawValue, size: 12)) .font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white) .foregroundColor(.white)
} }
Spacer() Spacer()
HStack(spacing: 8) { HStack(spacing: 8) {
Image("ic_can") Image("ic_can")
.resizable() .resizable()
.frame(width: 16.7, height: 16.7) .frame(width: 16.7, height: 16.7)
Text("\(price)") Text("\(price)")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
} }
.padding(.vertical, 8) .padding(.vertical, 8)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
.background(Color(hex: "9970ff")) .background(Color(hex: "9970ff"))
.cornerRadius(5.3) .cornerRadius(5.3)
.onTapGesture { .onTapGesture {
onTapPurchase(.KEEP) onTapPurchase(.KEEP)
isShowing = false isShowing = false
}
} }
} }
} }

View File

@ -19,7 +19,6 @@ struct GetAudioContentDetailResponse: Decodable {
let duration: String let duration: String
let isAdult: Bool let isAdult: Bool
let isMosaic: Bool let isMosaic: Bool
let isOnlyRental: Bool
let existOrdered: Bool let existOrdered: Bool
let orderType: OrderType? let orderType: OrderType?
let remainingTime: String? let remainingTime: String?

View File

@ -57,6 +57,7 @@ struct ContentMainItemView_Previews: PreviewProvider {
contentId: 2, contentId: 2,
coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
title: "ㅓ처랴햐햫햐햐", title: "ㅓ처랴햐햫햐햐",
isAdult: true,
creatorId: 8, creatorId: 8,
creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
creatorNickname: "유저2" creatorNickname: "유저2"

View File

@ -48,6 +48,7 @@ struct ContentMainMyStashView_Previews: PreviewProvider {
contentId: 1, contentId: 1,
coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
title: "테스트", title: "테스트",
isAdult: false,
creatorId: 7, creatorId: 7,
creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
creatorNickname: "유저1" creatorNickname: "유저1"

View File

@ -55,6 +55,7 @@ struct ContentMainNewContentView_Previews: PreviewProvider {
contentId: 1, contentId: 1,
coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
title: "테스트", title: "테스트",
isAdult: false,
creatorId: 7, creatorId: 7,
creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
creatorNickname: "유저1" creatorNickname: "유저1"

View File

@ -44,6 +44,7 @@ struct GetAudioContentMainItem: Decodable {
let contentId: Int let contentId: Int
let coverImageUrl: String let coverImageUrl: String
let title: String let title: String
let isAdult: Bool
let creatorId: Int let creatorId: Int
let creatorProfileImageUrl: String let creatorProfileImageUrl: String
let creatorNickname: String let creatorNickname: String

View File

@ -784,28 +784,26 @@ struct LiveRoomView: View {
viewModel.isShowDonationRankingPopup = true viewModel.isShowDonationRankingPopup = true
} }
if liveRoomInfo.creatorId == UserDefaults.int(forKey: .userId) { HStack(spacing: 0) {
HStack(spacing: 0) { Text("참여자")
Text("참여자") .font(.custom(Font.medium.rawValue, size: 12))
.font(.custom(Font.medium.rawValue, size: 12)) .foregroundColor(Color(hex: "bbbbbb"))
.foregroundColor(Color(hex: "bbbbbb"))
Text("\(liveRoomInfo.participantsCount)") Text("\(liveRoomInfo.participantsCount)")
.font(.custom(Font.medium.rawValue, size: 12)) .font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "9970ff")) .foregroundColor(Color(hex: "9970ff"))
.padding(.leading, 6.7) .padding(.leading, 6.7)
} }
.padding(.horizontal, 11.5) .padding(.horizontal, 11.5)
.padding(.vertical, 7.3) .padding(.vertical, 7.3)
.overlay( .overlay(
RoundedRectangle(cornerRadius: 12.8) RoundedRectangle(cornerRadius: 12.8)
.strokeBorder(lineWidth: 1) .strokeBorder(lineWidth: 1)
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color(hex: "eeeeee"))
) )
.contentShape(Rectangle()) .contentShape(Rectangle())
.onTapGesture { .onTapGesture {
viewModel.isShowProfileList = true viewModel.isShowProfileList = true
}
} }
} }
.padding(.top, 13.3) .padding(.top, 13.3)

View File

@ -147,33 +147,6 @@ struct CanPgPaymentView: View {
.frame(width: screenSize().width - 26.7) .frame(width: screenSize().width - 26.7)
.padding(.top, 16.7) .padding(.top, 16.7)
HStack(spacing: 13.3) {
Text("휴대폰 결제")
.font(.custom( viewModel.paymentMethod == .phone ? Font.bold.rawValue : Font.medium.rawValue, size: 16.7))
.foregroundColor(Color(hex: viewModel.paymentMethod == .phone ? "9970ff" : "eeeeee"))
.frame(width: (screenSize().width - 40) / 2)
.padding(.vertical, 16.7)
.background(
Color(hex: viewModel.paymentMethod == .phone ? "9970ff" : "232323")
.opacity(viewModel.paymentMethod == .phone ? 0.3 : 1)
)
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(lineWidth: 1)
.foregroundColor(Color(hex: viewModel.paymentMethod == .phone ? "9970ff" : "777777"))
)
.onTapGesture {
if viewModel.paymentMethod != .phone {
viewModel.paymentMethod = .phone
}
}
Spacer()
}
.frame(width: screenSize().width - 26.7)
.padding(.top, 16.7)
HStack(spacing: 6.7) { HStack(spacing: 6.7) {
Image(viewModel.isTermsAgree ? "btn_select_checked" : "btn_select_normal") Image(viewModel.isTermsAgree ? "btn_select_checked" : "btn_select_normal")
.resizable() .resizable()

View File

@ -13,7 +13,6 @@ import Bootpay
enum PaymentMethod: String { enum PaymentMethod: String {
case card = "디지털카드" case card = "디지털카드"
case bank = "디지털계좌이체" case bank = "디지털계좌이체"
case phone = "휴대폰"
} }
final class CanPgPaymentViewModel: ObservableObject { final class CanPgPaymentViewModel: ObservableObject {

View File

@ -33,24 +33,6 @@ struct OrderListAllView: View {
.frame(height: 50) .frame(height: 50)
.background(Color.black) .background(Color.black)
HStack(spacing: 0) {
Text("")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
Text("\(viewModel.totalCount)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "dd4500"))
Text("")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
Spacer()
}
.padding(.horizontal, 13.3)
.padding(.top, 13.3)
ScrollViewReader { reader in ScrollViewReader { reader in
ScrollView(.vertical, showsIndicators: false) { ScrollView(.vertical, showsIndicators: false) {
LazyVStack(spacing: 10.7) { LazyVStack(spacing: 10.7) {

View File

@ -18,7 +18,6 @@ final class OrderListAllViewModel: ObservableObject {
@Published var isLoading = false @Published var isLoading = false
@Published var orderList = [GetAudioContentOrderListItem]() @Published var orderList = [GetAudioContentOrderListItem]()
@Published var totalCount = 0
@Published var scrollToTop = false @Published var scrollToTop = false
var page = 1 var page = 1
@ -50,8 +49,6 @@ final class OrderListAllViewModel: ObservableObject {
self.scrollToTop.toggle() self.scrollToTop.toggle()
} }
self.totalCount = data.totalCount
if !data.items.isEmpty { if !data.items.isEmpty {
page += 1 page += 1
self.orderList.append(contentsOf: data.items) self.orderList.append(contentsOf: data.items)