From 4d731367405f28198c09d456f56e151a79c0e226 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 27 Mar 2024 17:54:01 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=98=ED=85=90=EC=B8=A0=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20-=20=ED=95=9C=EC=A0=95=ED=8C=90=EC=9D=B8=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EB=8C=80=EC=97=AC/=EC=86=8C=EC=9E=A5=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EB=8B=A4=EC=9D=B4=EC=96=BC=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EB=A5=BC=20=EC=83=9D=EB=9E=B5=ED=95=98=EA=B3=A0=20?= =?UTF-8?q?=EB=B0=94=EB=A1=9C=20=EA=B5=AC=EB=A7=A4=ED=99=95=EC=9D=B8=20?= =?UTF-8?q?=EB=8B=A4=EC=9D=B4=EC=96=BC=EB=A1=9C=EA=B7=B8=EA=B0=80=20?= =?UTF-8?q?=EB=82=98=EC=98=A4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20-?= =?UTF-8?q?=20=ED=95=9C=EC=A0=95=ED=8C=90=EC=9D=B4=20=EB=A7=A4=EC=A7=84?= =?UTF-8?q?=EB=90=9C=20=EA=B2=BD=EC=9A=B0=20=EA=B5=AC=EB=A7=A4=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EB=B9=84=ED=99=9C=EC=84=B1=ED=99=94=20=EB=B0=8F=20?= =?UTF-8?q?'=ED=95=B4=EB=8B=B9=20=EC=BD=98=ED=85=90=EC=B8=A0=EA=B0=80=20?= =?UTF-8?q?=EB=A7=A4=EC=A7=84=EB=90=98=EC=97=88=EC=8A=B5=EB=8B=88=EB=8B=A4?= =?UTF-8?q?.'=20=EB=AC=B8=EA=B5=AC=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Detail/ContentDetailPurchaseButton.swift | 2 +- .../Content/Detail/ContentDetailView.swift | 27 ++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift b/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift index 4937f8e..143aba8 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift @@ -33,7 +33,7 @@ struct ContentDetailPurchaseButton: View { } .frame(maxWidth: .infinity) .frame(height: 48.7) - .background(Color(hex: "9970ff")) + .background(Color.button) .cornerRadius(5.3) .padding(.top, 18.3) } diff --git a/SodaLive/Sources/Content/Detail/ContentDetailView.swift b/SodaLive/Sources/Content/Detail/ContentDetailView.swift index 4830ea6..4a19e0f 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailView.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailView.swift @@ -107,10 +107,29 @@ struct ContentDetailView: View { !audioContent.existOrdered && audioContent.orderType == nil && audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) { - ContentDetailPurchaseButton(price: audioContent.price, isOnlyRental: audioContent.isOnlyRental) - .contentShape(Rectangle()) - .padding(.horizontal, 13.3) - .onTapGesture { isShowOrderView = true } + if let _ = audioContent.totalContentCount, let remainingContentCount = audioContent.remainingContentCount, remainingContentCount <= 0 { + Text("해당 콘텐츠가 매진되었습니다.") + .font(.custom(Font.bold.rawValue, size: 13.3)) + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 48.7) + .background(Color(hex: "525252")) + .cornerRadius(5.3) + .padding(.top, 18.3) + .padding(.horizontal, 13.3) + } else { + ContentDetailPurchaseButton(price: audioContent.price, isOnlyRental: audioContent.isOnlyRental) + .contentShape(Rectangle()) + .padding(.horizontal, 13.3) + .onTapGesture { + if let _ = audioContent.totalContentCount, let _ = audioContent.remainingContentCount { + viewModel.orderType = .KEEP + isShowOrderConfirmView = true + } else { + isShowOrderView = true + } + } + } } if audioContent.isCommentAvailable {