From 578b9b9089db289e5e1ac9e33a0d4104354414c0 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Thu, 28 Mar 2024 01:36:04 +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=B4=20?= =?UTF-8?q?=EB=A7=A4=EC=A7=84=EB=90=9C=20=EA=B2=BD=EC=9A=B0=20Player=20?= =?UTF-8?q?=EA=B0=80=EC=9A=B4=EB=8D=B0=20Sold=20Out=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContentDetailInfoLimitedEditionView.swift | 15 +++++++++++++-- .../Content/Detail/ContentDetailPlayView.swift | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift b/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift index d94951d..a01ce27 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift @@ -36,6 +36,17 @@ struct ContentDetailInfoLimitedEditionView: View { .font(.custom(Font.medium.rawValue, size: 13.3)) .foregroundColor(Color.grayd2) .padding(.leading, 2.3) + } else if (remainingContentCount <= 0) { + Text("Sold Out") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color.grayd2) + .padding(.horizontal, 5.3) + .padding(.vertical, 3.3) + .overlay( + RoundedRectangle(cornerRadius: 2.6) + .stroke(lineWidth: 1) + .foregroundColor(Color.grayd2) + ) } else { Text("잔여수량") .font(.custom(Font.medium.rawValue, size: 13.3)) @@ -59,7 +70,7 @@ struct ContentDetailInfoLimitedEditionView: View { #Preview { ContentDetailInfoLimitedEditionView( totalContentCount: 10, - remainingContentCount: 3, - orderSequence: 5 + remainingContentCount: 0, + orderSequence: nil ) } diff --git a/SodaLive/Sources/Content/Detail/ContentDetailPlayView.swift b/SodaLive/Sources/Content/Detail/ContentDetailPlayView.swift index 09df67a..7de22ee 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailPlayView.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailPlayView.swift @@ -35,7 +35,17 @@ struct ContentDetailPlayView: View { ) .cornerRadius(10.7, corners: [.topLeft, .topRight]) - if audioContent.releaseDate == nil && !isAlertPreview || (isAlertPreview && audioContent.isActivePreview) { + if let _ = audioContent.totalContentCount, let remainingContentCount = audioContent.remainingContentCount, remainingContentCount <= 0, audioContent.creator.creatorId != UserDefaults.int(forKey: .userId), !isShowPreviewAlert { + Text("Sold Out") + .font(.custom(Font.bold.rawValue, size: 36.7)) + .foregroundColor(.white) + .frame( + width: screenSize().width - 26.7, + height: screenSize().width - 26.7, + alignment: .center + ) + .background(Color.black.opacity(0.6)) + } else if audioContent.releaseDate == nil && !isAlertPreview || (audioContent.isActivePreview && !audioContent.contentUrl.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty) { Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play") .onTapGesture { if isPlaying() { @@ -56,7 +66,7 @@ struct ContentDetailPlayView: View { isShowPreviewAlert = true } } - } else { + } else if audioContent.releaseDate == nil { Text("해당 콘텐츠는 크리에이터의 요청으로\n미리듣기를 제공하지 않습니다.") .font(.custom(Font.medium.rawValue, size: 16.7)) .foregroundColor(Color.grayee)