Compare commits

..

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

18 changed files with 112 additions and 202 deletions

View File

@ -214,30 +214,8 @@ struct ContentCreateView: View {
}
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) {
Text(viewModel.isOnlyRental ? "대여 가격" : "소장 가격")
Text("소장가격")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2"))
.frame(maxWidth: .infinity, alignment: .leading)
@ -269,7 +247,7 @@ struct ContentCreateView: View {
.frame(height: 1)
.padding(.top, 11)
Text("※ 이용기간 대여 (15일) | 소장 (서비스종료시까지)")
Text("※ 이용기간 대여 (7일) | 소장 (서비스종료시까지)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777"))
.frame(maxWidth: .infinity, alignment: .leading)
@ -343,7 +321,6 @@ struct ContentCreateView: View {
.padding(.top, 26.7)
.padding(.horizontal, 13.3)
if !viewModel.isFree {
VStack(spacing: 10) {
Text("미리듣기 시간 설정")
.font(.custom(Font.bold.rawValue, size: 16.7))
@ -398,7 +375,6 @@ struct ContentCreateView: View {
}
.padding(.top, 26.7)
.padding(.horizontal, 13.3)
}
VStack(spacing: 0) {
HStack(alignment: .top, spacing: 0) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,6 @@ struct ContentOrderDialogView: View {
@Binding var isShowing: Bool
let price: Int
let isOnlyRental: Bool
let onTapPurchase: (OrderType) -> Void
var body: some View {
@ -32,7 +31,7 @@ struct ContentOrderDialogView: View {
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(.white)
Text("(이용기간 15일)")
Text("(이용기간 7일)")
.font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white)
}
@ -44,7 +43,7 @@ struct ContentOrderDialogView: View {
.resizable()
.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))
.foregroundColor(Color(hex: "eeeeee"))
}
@ -58,7 +57,6 @@ struct ContentOrderDialogView: View {
}
}
if !isOnlyRental {
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 5.3) {
Text("소장")
@ -91,7 +89,6 @@ struct ContentOrderDialogView: View {
}
}
}
}
.padding(24)
.background(Color(hex: "222222"))
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -784,7 +784,6 @@ struct LiveRoomView: View {
viewModel.isShowDonationRankingPopup = true
}
if liveRoomInfo.creatorId == UserDefaults.int(forKey: .userId) {
HStack(spacing: 0) {
Text("참여자")
.font(.custom(Font.medium.rawValue, size: 12))
@ -807,7 +806,6 @@ struct LiveRoomView: View {
viewModel.isShowProfileList = true
}
}
}
.padding(.top, 13.3)
.padding(.horizontal, 13.3)
}

View File

@ -147,33 +147,6 @@ struct CanPgPaymentView: View {
.frame(width: screenSize().width - 26.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) {
Image(viewModel.isTermsAgree ? "btn_select_checked" : "btn_select_normal")
.resizable()

View File

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

View File

@ -33,24 +33,6 @@ struct OrderListAllView: View {
.frame(height: 50)
.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
ScrollView(.vertical, showsIndicators: false) {
LazyVStack(spacing: 10.7) {

View File

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