From 86cf4668389871bc055b6d65c23c4525f6a2f859 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Tue, 10 Jun 2025 19:43:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=BD=98=ED=85=90=EC=B8=A0=20=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20-=20=EC=83=88=EB=A1=9C=EC=9A=B4=20=EC=BD=98?= =?UTF-8?q?=ED=85=90=EC=B8=A0,=20=ED=81=90=EB=A0=88=EC=9D=B4=EC=85=98,=20?= =?UTF-8?q?=EC=B1=84=EB=84=90=EB=B3=84=20=EC=9D=B8=EA=B8=B0=20=EC=BD=98?= =?UTF-8?q?=ED=85=90=EC=B8=A0,=20=EC=8B=9C=EB=A6=AC=EC=A6=88=20=EC=83=81?= =?UTF-8?q?=EC=84=B8,=20=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=B1=84=EB=84=90=20=EC=BD=98=ED=85=90=EC=B8=A0=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20-=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=20=EA=B0=80=EB=8A=A5=20=EC=97=AC=EB=B6=80=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Content/ContentListItemView.swift | 12 ++++- .../Content/Main/ContentMainItemView.swift | 11 ++++- .../Main/GetAudioContentMainResponse.swift | 2 + .../ContentMainTabRankContentView.swift | 3 ++ .../Content/ContentMainTagCurationView.swift | 44 ++++++++++++------- .../Main/V2/ContentByChannelView.swift | 26 ++++++++--- .../Main/V2/ContentMainCurationViewV2.swift | 9 ++-- .../Main/V2/ContentMainNewContentViewV2.swift | 9 ++-- .../Content/SeriesContentListItemView.swift | 35 ++++++++++----- .../Detail/GetSeriesContentListResponse.swift | 1 + .../Series/Detail/SeriesDetailHomeView.swift | 12 +++-- .../Profile/GetCreatorProfileResponse.swift | 1 + .../Profile/UserProfileContentView.swift | 3 +- 13 files changed, 122 insertions(+), 46 deletions(-) diff --git a/SodaLive/Sources/Content/ContentListItemView.swift b/SodaLive/Sources/Content/ContentListItemView.swift index 9f62f61..ca78a71 100644 --- a/SodaLive/Sources/Content/ContentListItemView.swift +++ b/SodaLive/Sources/Content/ContentListItemView.swift @@ -51,6 +51,15 @@ struct ContentListItemView: View { .background(Color(hex: "222222")) .cornerRadius(2.6) + if item.isPointAvailable { + Text("포인트") + .font(.custom(Font.medium.rawValue, size: 8)) + .foregroundColor(.white) + .padding(2.6) + .background(Color(hex: "7849bc")) + .cornerRadius(2.6) + } + if item.isPin { Image("ic_pin") .resizable() @@ -162,7 +171,8 @@ struct ContentListItemView_Previews: PreviewProvider { isScheduledToOpen: true, isRented: false, isOwned: false, - isSoldOut: true + isSoldOut: true, + isPointAvailable: true ) ) } diff --git a/SodaLive/Sources/Content/Main/ContentMainItemView.swift b/SodaLive/Sources/Content/Main/ContentMainItemView.swift index f482c86..792b8d4 100644 --- a/SodaLive/Sources/Content/Main/ContentMainItemView.swift +++ b/SodaLive/Sources/Content/Main/ContentMainItemView.swift @@ -14,7 +14,7 @@ struct ContentMainItemView: View { var body: some View { VStack(alignment: .leading, spacing: 8) { - ZStack(alignment: .topLeading) { + ZStack(alignment: .topTrailing) { KFImage(URL(string: item.coverImageUrl)) .cancelOnDisappear(true) .downsampling( @@ -27,6 +27,12 @@ struct ContentMainItemView: View { .scaledToFill() .frame(width: 133.3, height: 133.3, alignment: .top) .cornerRadius(2.7) + + if item.isPointAvailable { + Image("ic_point") + .padding(.top, 2.7) + .padding(.trailing, 2.7) + } } Text(item.title) @@ -75,7 +81,8 @@ struct ContentMainItemView_Previews: PreviewProvider { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저2", price: 10, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: true ) ) } diff --git a/SodaLive/Sources/Content/Main/GetAudioContentMainResponse.swift b/SodaLive/Sources/Content/Main/GetAudioContentMainResponse.swift index 60b21dd..4d6b45d 100644 --- a/SodaLive/Sources/Content/Main/GetAudioContentMainResponse.swift +++ b/SodaLive/Sources/Content/Main/GetAudioContentMainResponse.swift @@ -33,6 +33,7 @@ struct GetAudioContentRankingItem: Decodable { let duration: String let creatorId: Int let creatorNickname: String + let isPointAvailable: Bool let creatorProfileImageUrl: String } @@ -51,6 +52,7 @@ struct GetAudioContentMainItem: Decodable { let creatorNickname: String let price: Int let duration: String + let isPointAvailable: Bool } struct GetAudioContentCurationResponse: Decodable { diff --git a/SodaLive/Sources/Content/Main/V2/Content/ContentMainTabRankContentView.swift b/SodaLive/Sources/Content/Main/V2/Content/ContentMainTabRankContentView.swift index 3188190..608504f 100644 --- a/SodaLive/Sources/Content/Main/V2/Content/ContentMainTabRankContentView.swift +++ b/SodaLive/Sources/Content/Main/V2/Content/ContentMainTabRankContentView.swift @@ -133,6 +133,7 @@ struct ContentMainTabRankContentView: View { duration: "00:30:20", creatorId: 1, creatorNickname: "유저1", + isPointAvailable: false, creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png" ), GetAudioContentRankingItem( @@ -144,6 +145,7 @@ struct ContentMainTabRankContentView: View { duration: "00:30:20", creatorId: 2, creatorNickname: "유저2", + isPointAvailable: false, creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png" ), GetAudioContentRankingItem( @@ -155,6 +157,7 @@ struct ContentMainTabRankContentView: View { duration: "00:30:20", creatorId: 3, creatorNickname: "유저3", + isPointAvailable: true, creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png" ) ] diff --git a/SodaLive/Sources/Content/Main/V2/Content/ContentMainTagCurationView.swift b/SodaLive/Sources/Content/Main/V2/Content/ContentMainTagCurationView.swift index 8002259..058ea7e 100644 --- a/SodaLive/Sources/Content/Main/V2/Content/ContentMainTagCurationView.swift +++ b/SodaLive/Sources/Content/Main/V2/Content/ContentMainTagCurationView.swift @@ -91,18 +91,28 @@ struct ContentMainTagCurationContentView: View { var body: some View { VStack(alignment: .leading, spacing: 8) { ZStack(alignment: .bottom) { - KFImage(URL(string: item.coverImageUrl)) - .cancelOnDisappear(true) - .downsampling( - size: CGSize( - width: itemWidth, - height: itemWidth + ZStack(alignment: .topTrailing) { + KFImage(URL(string: item.coverImageUrl)) + .cancelOnDisappear(true) + .downsampling( + size: CGSize( + width: itemWidth, + height: itemWidth + ) ) - ) - .resizable() - .scaledToFill() - .frame(width: itemWidth, height: itemWidth, alignment: .top) - .cornerRadius(2.7) + .resizable() + .scaledToFill() + .frame(width: itemWidth, height: itemWidth, alignment: .top) + .cornerRadius(2.7) + + if item.isPointAvailable { + Image("ic_point") + .resizable() + .frame(width: 20, height: 20) + .padding(.top, 2.7) + .padding(.trailing, 2.7) + } + } VStack(spacing: 0) { Spacer() @@ -193,7 +203,8 @@ struct ContentMainTagCurationContentView: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저1", price: 100, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: true ), GetAudioContentMainItem( contentId: 2, @@ -203,7 +214,8 @@ struct ContentMainTagCurationContentView: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저2", price: 0, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: false ), GetAudioContentMainItem( contentId: 3, @@ -213,7 +225,8 @@ struct ContentMainTagCurationContentView: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저3", price: 1000, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: false ), GetAudioContentMainItem( contentId: 4, @@ -223,7 +236,8 @@ struct ContentMainTagCurationContentView: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저3", price: 50000, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: false ) ], selectTag: { _ in } diff --git a/SodaLive/Sources/Content/Main/V2/ContentByChannelView.swift b/SodaLive/Sources/Content/Main/V2/ContentByChannelView.swift index 839149e..55855e6 100644 --- a/SodaLive/Sources/Content/Main/V2/ContentByChannelView.swift +++ b/SodaLive/Sources/Content/Main/V2/ContentByChannelView.swift @@ -57,13 +57,21 @@ struct ContentByChannelView: View { VStack(alignment: .leading, spacing: 8) { ZStack(alignment:.bottom) { GeometryReader { geometry in - KFImage(URL(string: content.coverImageUrl)) - .cancelOnDisappear(true) - .resizable() - .scaledToFill() - .frame(width: geometry.size.width, height: geometry.size.width) - .clipShape(RoundedRectangle(cornerRadius: 5.3)) - .clipped() + ZStack(alignment: .topTrailing) { + KFImage(URL(string: content.coverImageUrl)) + .cancelOnDisappear(true) + .resizable() + .scaledToFill() + .frame(width: geometry.size.width, height: geometry.size.width) + .clipShape(RoundedRectangle(cornerRadius: 5.3)) + .clipped() + + if content.isPointAvailable { + Image("ic_point") + .padding(.top, 2.7) + .padding(.trailing, 2.7) + } + } } .aspectRatio(1, contentMode: .fit) @@ -168,6 +176,7 @@ struct ContentByChannelView: View { duration: "00:30:20", creatorId: 1, creatorNickname: "유저1", + isPointAvailable: true, creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png" ), GetAudioContentRankingItem( @@ -179,6 +188,7 @@ struct ContentByChannelView: View { duration: "00:30:20", creatorId: 1, creatorNickname: "유저1", + isPointAvailable: false, creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png" ), GetAudioContentRankingItem( @@ -190,6 +200,7 @@ struct ContentByChannelView: View { duration: "00:30:20", creatorId: 1, creatorNickname: "유저1", + isPointAvailable: false, creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png" ), GetAudioContentRankingItem( @@ -201,6 +212,7 @@ struct ContentByChannelView: View { duration: "00:30:20", creatorId: 1, creatorNickname: "유저1", + isPointAvailable: false, creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png" ) ] diff --git a/SodaLive/Sources/Content/Main/V2/ContentMainCurationViewV2.swift b/SodaLive/Sources/Content/Main/V2/ContentMainCurationViewV2.swift index 1aaa3da..25d1614 100644 --- a/SodaLive/Sources/Content/Main/V2/ContentMainCurationViewV2.swift +++ b/SodaLive/Sources/Content/Main/V2/ContentMainCurationViewV2.swift @@ -58,7 +58,8 @@ struct ContentMainCurationItemViewV2: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저1", price: 10, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: true ), GetAudioContentMainItem( contentId: 2, @@ -68,7 +69,8 @@ struct ContentMainCurationItemViewV2: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저2", price: 10, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: false ), GetAudioContentMainItem( contentId: 3, @@ -78,7 +80,8 @@ struct ContentMainCurationItemViewV2: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저3", price: 10, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: false ) ] ) diff --git a/SodaLive/Sources/Content/Main/V2/ContentMainNewContentViewV2.swift b/SodaLive/Sources/Content/Main/V2/ContentMainNewContentViewV2.swift index fcb63c0..b0e44e4 100644 --- a/SodaLive/Sources/Content/Main/V2/ContentMainNewContentViewV2.swift +++ b/SodaLive/Sources/Content/Main/V2/ContentMainNewContentViewV2.swift @@ -72,7 +72,8 @@ struct ContentMainNewContentViewV2: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저1", price: 10, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: false ), GetAudioContentMainItem( contentId: 2, @@ -82,7 +83,8 @@ struct ContentMainNewContentViewV2: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저2", price: 10, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: false ), GetAudioContentMainItem( contentId: 3, @@ -92,7 +94,8 @@ struct ContentMainNewContentViewV2: View { creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "유저3", price: 10, - duration: "00:00:30" + duration: "00:00:30", + isPointAvailable: false ) ], selectTheme: { _ in } diff --git a/SodaLive/Sources/Content/Series/Content/SeriesContentListItemView.swift b/SodaLive/Sources/Content/Series/Content/SeriesContentListItemView.swift index f3458cd..50263ab 100644 --- a/SodaLive/Sources/Content/Series/Content/SeriesContentListItemView.swift +++ b/SodaLive/Sources/Content/Series/Content/SeriesContentListItemView.swift @@ -24,12 +24,23 @@ struct SeriesContentListItemView: View { .cornerRadius(5.3) VStack(alignment: .leading, spacing: 2.7) { - Text(item.duration) - .font(.custom(Font.medium.rawValue, size: 10)) - .foregroundColor(Color.gray77) - .padding(2.7) - .background(Color.gray22) - .cornerRadius(2.6) + HStack(spacing: 8) { + Text(item.duration) + .font(.custom(Font.medium.rawValue, size: 10)) + .foregroundColor(Color.gray77) + .padding(2.7) + .background(Color.gray22) + .cornerRadius(2.6) + + if item.isPointAvailable { + Text("포인트") + .font(.custom(Font.medium.rawValue, size: 8)) + .foregroundColor(.white) + .padding(2.6) + .background(Color(hex: "7849bc")) + .cornerRadius(2.6) + } + } Text(item.title) .font(.custom(Font.medium.rawValue, size: 12)) @@ -91,7 +102,8 @@ struct SeriesContentListItemView: View { duration: "00:14:59", price: 0, isRented: false, - isOwned: false + isOwned: false, + isPointAvailable: true ) ) } @@ -106,7 +118,8 @@ struct SeriesContentListItemView: View { duration: "00:14:59", price: 100, isRented: false, - isOwned: false + isOwned: false, + isPointAvailable: true ) ) } @@ -121,7 +134,8 @@ struct SeriesContentListItemView: View { duration: "00:14:59", price: 200, isRented: true, - isOwned: false + isOwned: false, + isPointAvailable: true ) ) } @@ -136,7 +150,8 @@ struct SeriesContentListItemView: View { duration: "00:14:59", price: 300, isRented: false, - isOwned: true + isOwned: true, + isPointAvailable: true ) ) } diff --git a/SodaLive/Sources/Content/Series/Detail/GetSeriesContentListResponse.swift b/SodaLive/Sources/Content/Series/Detail/GetSeriesContentListResponse.swift index d5a1e35..6c7743a 100644 --- a/SodaLive/Sources/Content/Series/Detail/GetSeriesContentListResponse.swift +++ b/SodaLive/Sources/Content/Series/Detail/GetSeriesContentListResponse.swift @@ -21,4 +21,5 @@ struct GetSeriesContentListItem: Decodable { let price: Int let isRented: Bool let isOwned: Bool + let isPointAvailable: Bool } diff --git a/SodaLive/Sources/Content/Series/Detail/SeriesDetailHomeView.swift b/SodaLive/Sources/Content/Series/Detail/SeriesDetailHomeView.swift index 1dd28f3..a87bae3 100644 --- a/SodaLive/Sources/Content/Series/Detail/SeriesDetailHomeView.swift +++ b/SodaLive/Sources/Content/Series/Detail/SeriesDetailHomeView.swift @@ -72,7 +72,8 @@ struct SeriesDetailHomeView: View { duration: "00:14:59", price: 0, isRented: false, - isOwned: false + isOwned: false, + isPointAvailable: true ), GetSeriesContentListItem( contentId: 2, @@ -82,7 +83,8 @@ struct SeriesDetailHomeView: View { duration: "00:14:59", price: 100, isRented: false, - isOwned: false + isOwned: false, + isPointAvailable: true ), GetSeriesContentListItem( contentId: 3, @@ -92,7 +94,8 @@ struct SeriesDetailHomeView: View { duration: "00:14:59", price: 100, isRented: true, - isOwned: false + isOwned: false, + isPointAvailable: true ), GetSeriesContentListItem( contentId: 4, @@ -102,7 +105,8 @@ struct SeriesDetailHomeView: View { duration: "00:14:59", price: 100, isRented: false, - isOwned: true + isOwned: true, + isPointAvailable: true ) ] ) diff --git a/SodaLive/Sources/Explorer/Profile/GetCreatorProfileResponse.swift b/SodaLive/Sources/Explorer/Profile/GetCreatorProfileResponse.swift index e51cbe7..d67498f 100644 --- a/SodaLive/Sources/Explorer/Profile/GetCreatorProfileResponse.swift +++ b/SodaLive/Sources/Explorer/Profile/GetCreatorProfileResponse.swift @@ -87,6 +87,7 @@ struct GetAudioContentListItem: Decodable { let isRented: Bool let isOwned: Bool let isSoldOut: Bool + let isPointAvailable: Bool } struct GetCreatorActivitySummary: Decodable { diff --git a/SodaLive/Sources/Explorer/Profile/UserProfileContentView.swift b/SodaLive/Sources/Explorer/Profile/UserProfileContentView.swift index 2145799..2d858d6 100644 --- a/SodaLive/Sources/Explorer/Profile/UserProfileContentView.swift +++ b/SodaLive/Sources/Explorer/Profile/UserProfileContentView.swift @@ -77,7 +77,8 @@ struct UserProfileContentView_Previews: PreviewProvider { isScheduledToOpen: false, isRented: false, isOwned: false, - isSoldOut: false + isSoldOut: false, + isPointAvailable: true ) ] )