diff --git a/SodaLive/Sources/Content/All/ContentNewAllItemView.swift b/SodaLive/Sources/Content/All/ContentNewAllItemView.swift index a74dec0..edf8a1d 100644 --- a/SodaLive/Sources/Content/All/ContentNewAllItemView.swift +++ b/SodaLive/Sources/Content/All/ContentNewAllItemView.swift @@ -19,11 +19,54 @@ struct ContentNewAllItemView: View { ContentDetailView(contentId: item.contentId) } label: { VStack(alignment: .leading, spacing: 8) { - KFImage(URL(string: item.coverImageUrl)) - .resizable() - .scaledToFill() - .frame(width: width, height: width, alignment: .top) - .cornerRadius(2.7) + ZStack(alignment: .bottom) { + KFImage(URL(string: item.coverImageUrl)) + .resizable() + .scaledToFill() + .frame(width: width, height: width, alignment: .top) + .cornerRadius(2.7) + + VStack(spacing: 0) { + Spacer() + + HStack(spacing: 0) { + HStack(spacing: 2) { + if item.price > 0 { + Image("ic_card_can_gray") + + Text("\(item.price)") + .font(.custom(Font.medium.rawValue, size: 8.3)) + .foregroundColor(Color.white) + } else { + Text("무료") + .font(.custom(Font.medium.rawValue, size: 8.3)) + .foregroundColor(Color.white) + } + } + .padding(3) + .background(Color(hex: "333333").opacity(0.7)) + .cornerRadius(10) + .padding(.leading, 2.7) + .padding(.bottom, 2.7) + + Spacer() + + HStack(spacing: 2) { + Image("ic_card_time_small_gray") + + Text(item.duration) + .font(.custom(Font.medium.rawValue, size: 8.3)) + .foregroundColor(Color.white) + } + .padding(3) + .background(Color(hex: "333333").opacity(0.7)) + .cornerRadius(10) + .padding(.trailing, 2.7) + .padding(.bottom, 2.7) + } + } + } + .frame(width: width, height: width) Text(item.title) .font(.custom(Font.medium.rawValue, size: 13.3)) diff --git a/SodaLive/Sources/Content/Main/ContentMainItemView.swift b/SodaLive/Sources/Content/Main/ContentMainItemView.swift index 1601ec6..3d90f19 100644 --- a/SodaLive/Sources/Content/Main/ContentMainItemView.swift +++ b/SodaLive/Sources/Content/Main/ContentMainItemView.swift @@ -59,7 +59,9 @@ struct ContentMainItemView_Previews: PreviewProvider { title: "ㅓ처랴햐햫햐햐", creatorId: 8, creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png", - creatorNickname: "유저2" + creatorNickname: "유저2", + price: 10, + duration: "00:00:30" ) ) } diff --git a/SodaLive/Sources/Content/Main/GetAudioContentMainResponse.swift b/SodaLive/Sources/Content/Main/GetAudioContentMainResponse.swift index a3eb34a..ab856d5 100644 --- a/SodaLive/Sources/Content/Main/GetAudioContentMainResponse.swift +++ b/SodaLive/Sources/Content/Main/GetAudioContentMainResponse.swift @@ -48,6 +48,8 @@ struct GetAudioContentMainItem: Decodable { let creatorId: Int let creatorProfileImageUrl: String let creatorNickname: String + let price: Int + let duration: String } struct GetAudioContentCurationResponse: Decodable {