콘텐츠 리스트 - 가격, 시간 추가
This commit is contained in:
parent
7d0c472885
commit
20cce36c16
|
@ -19,12 +19,55 @@ struct ContentNewAllItemView: View {
|
|||
ContentDetailView(contentId: item.contentId)
|
||||
} label: {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
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))
|
||||
.foregroundColor(Color(hex: "d2d2d2"))
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue