From 5c15e7d52fe0abc0a068132778dc0ed2ed5ee177 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 27 Mar 2024 01:38:27 +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=20UI=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xcshareddata/swiftpm/Package.resolved | 38 ++++++++--- .../ContentDetailInfoLimitedEditionView.swift | 65 +++++++++++++++++++ .../Detail/ContentDetailInfoView.swift | 8 +++ .../GetAudioContentDetailResponse.swift | 3 + 4 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift diff --git a/SodaLive.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SodaLive.xcworkspace/xcshareddata/swiftpm/Package.resolved index 89afb67..2ad0262 100644 --- a/SodaLive.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/SodaLive.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -36,13 +36,22 @@ "version" : "5.7.1" } }, + { + "identity" : "app-check", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/app-check.git", + "state" : { + "revision" : "3e464dad87dad2d29bb29a97836789bf0f8f67d2", + "version" : "10.18.1" + } + }, { "identity" : "firebase-ios-sdk", "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk.git", "state" : { - "revision" : "df2171b0c6afb9e9d4f7e07669d558c510b9f6be", - "version" : "10.13.0" + "revision" : "be49849dcba96f2b5ee550d4eceb2c0fa27dade4", + "version" : "10.22.1" } }, { @@ -50,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "03b9beee1a61f62d32c521e172e192a1663a5e8b", - "version" : "10.13.0" + "revision" : "482cfa4e5880f0a29f66ecfd60c5a62af28bd1f0", + "version" : "10.22.1" } }, { @@ -59,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleDataTransport.git", "state" : { - "revision" : "aae45a320fd0d11811820335b1eabc8753902a40", - "version" : "9.2.5" + "revision" : "a637d318ae7ae246b02d7305121275bc75ed5565", + "version" : "9.4.0" } }, { @@ -68,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "c38ce365d77b04a9a300c31061c5227589e5597b", - "version" : "7.11.5" + "revision" : "26c898aed8bed13b8a63057ee26500abbbcb8d55", + "version" : "7.13.1" } }, { @@ -77,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/grpc-binary.git", "state" : { - "revision" : "f1b366129d1125be7db83247e003fc333104b569", - "version" : "1.50.2" + "revision" : "a673bc2937fbe886dd1f99c401b01b6d977a9c98", + "version" : "1.49.1" } }, { @@ -90,6 +99,15 @@ "version" : "3.1.1" } }, + { + "identity" : "interop-ios-for-google-sdks", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/interop-ios-for-google-sdks.git", + "state" : { + "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648", + "version" : "100.0.0" + } + }, { "identity" : "kingfisher", "kind" : "remoteSourceControl", diff --git a/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift b/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift new file mode 100644 index 0000000..d94951d --- /dev/null +++ b/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift @@ -0,0 +1,65 @@ +// +// ContentDetailInfoLimitedEditionView.swift +// SodaLive +// +// Created by klaus on 3/27/24. +// + +import SwiftUI + +struct ContentDetailInfoLimitedEditionView: View { + + let totalContentCount: Int + let remainingContentCount: Int + let orderSequence: Int? + + var body: some View { + HStack(spacing: 0) { + Text("한정판") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color.button) + + Spacer() + + if let orderSequence = orderSequence { + Text("\(orderSequence)") + .font(.custom(Font.bold.rawValue, size: 13.3)) + .foregroundColor(Color.button) + .padding(.leading, 5.3) + + Text("/") + .font(.custom(Font.bold.rawValue, size: 13.3)) + .foregroundColor(Color.grayd2) + .padding(.leading, 2.3) + + Text("\(totalContentCount)") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color.grayd2) + .padding(.leading, 2.3) + } else { + Text("잔여수량") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color.grayd2) + + Text("\(remainingContentCount)") + .font(.custom(Font.bold.rawValue, size: 13.3)) + .foregroundColor(Color.button) + .padding(.leading, 5.3) + } + + } + .padding(.vertical, 8) + .padding(.horizontal, 10.3) + .background(Color(hex: "14262d")) + .cornerRadius(5.3) + .padding(.top, 13.3) + } +} + +#Preview { + ContentDetailInfoLimitedEditionView( + totalContentCount: 10, + remainingContentCount: 3, + orderSequence: 5 + ) +} diff --git a/SodaLive/Sources/Content/Detail/ContentDetailInfoView.swift b/SodaLive/Sources/Content/Detail/ContentDetailInfoView.swift index bdc4af0..ca3e6e0 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailInfoView.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailInfoView.swift @@ -142,6 +142,14 @@ struct ContentDetailInfoView: View { } .padding(.top, 13.3) + if let totalContentCount = audioContent.totalContentCount, let remainingContentCount = audioContent.remainingContentCount { + ContentDetailInfoLimitedEditionView( + totalContentCount: totalContentCount, + remainingContentCount: remainingContentCount, + orderSequence: audioContent.orderSequence + ) + } + ZStack { VStack(spacing: 8) { if audioContent.tag.count > 0 { diff --git a/SodaLive/Sources/Content/Detail/GetAudioContentDetailResponse.swift b/SodaLive/Sources/Content/Detail/GetAudioContentDetailResponse.swift index 923566a..7fe75f6 100644 --- a/SodaLive/Sources/Content/Detail/GetAudioContentDetailResponse.swift +++ b/SodaLive/Sources/Content/Detail/GetAudioContentDetailResponse.swift @@ -18,6 +18,9 @@ struct GetAudioContentDetailResponse: Decodable { let price: Int let duration: String let releaseDate: String? + let totalContentCount: Int? + let remainingContentCount: Int? + let orderSequence: Int? let isActivePreview: Bool let isAdult: Bool let isMosaic: Bool