parent
7e44bb8be3
commit
d09ffe1973
|
@ -6,64 +6,96 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import Kingfisher
|
||||||
|
|
||||||
struct ContentDetailInfoLimitedEditionView: View {
|
struct ContentDetailInfoLimitedEditionView: View {
|
||||||
|
|
||||||
let totalContentCount: Int
|
let totalContentCount: Int
|
||||||
let remainingContentCount: Int
|
let remainingContentCount: Int
|
||||||
let orderSequence: Int?
|
let orderSequence: Int?
|
||||||
|
let buyerList: [ContentBuyer]
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(spacing: 0) {
|
VStack(alignment: .leading, spacing: 13.3) {
|
||||||
Text("한정판")
|
HStack(spacing: 0) {
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
Text("한정판")
|
||||||
.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))
|
.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))
|
|
||||||
.foregroundColor(Color.grayd2)
|
|
||||||
|
|
||||||
Text("\(remainingContentCount)")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 13.3))
|
|
||||||
.foregroundColor(Color.button)
|
.foregroundColor(Color.button)
|
||||||
.padding(.leading, 5.3)
|
|
||||||
|
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 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))
|
||||||
|
.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)
|
||||||
|
|
||||||
|
if !buyerList.isEmpty {
|
||||||
|
Text("구매자")
|
||||||
|
.font(.custom(Font.bold.rawValue, size: 18.3))
|
||||||
|
.foregroundColor(Color.grayee)
|
||||||
|
|
||||||
|
ScrollView(.horizontal, showsIndicators: false) {
|
||||||
|
HStack(alignment: .top, spacing: 13.3) {
|
||||||
|
ForEach(0..<buyerList.count, id: \.self) {
|
||||||
|
let buyer = buyerList[$0]
|
||||||
|
|
||||||
|
VStack(spacing: 6.7) {
|
||||||
|
KFImage(URL(string: buyer.profileImageUrl))
|
||||||
|
.cancelOnDisappear(true)
|
||||||
|
.resizable()
|
||||||
|
.scaledToFill()
|
||||||
|
.frame(width: 46.7, height: 46.7, alignment: .top)
|
||||||
|
.clipShape(Circle())
|
||||||
|
|
||||||
|
Text(buyer.nickname)
|
||||||
|
.font(.custom(Font.medium.rawValue, size: 12))
|
||||||
|
.foregroundColor(Color.graybb)
|
||||||
|
.lineLimit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.padding(.vertical, 8)
|
|
||||||
.padding(.horizontal, 10.3)
|
|
||||||
.background(Color(hex: "14262d"))
|
|
||||||
.cornerRadius(5.3)
|
|
||||||
.padding(.top, 13.3)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +103,18 @@ struct ContentDetailInfoLimitedEditionView: View {
|
||||||
ContentDetailInfoLimitedEditionView(
|
ContentDetailInfoLimitedEditionView(
|
||||||
totalContentCount: 10,
|
totalContentCount: 10,
|
||||||
remainingContentCount: 0,
|
remainingContentCount: 0,
|
||||||
orderSequence: nil
|
orderSequence: nil,
|
||||||
|
buyerList: [
|
||||||
|
ContentBuyer(nickname: "user1", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user2", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user3", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user4", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user5", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user6", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user7", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user8", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user9", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
ContentBuyer(nickname: "user10", profileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png"),
|
||||||
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,8 @@ struct ContentDetailInfoView: View {
|
||||||
ContentDetailInfoLimitedEditionView(
|
ContentDetailInfoLimitedEditionView(
|
||||||
totalContentCount: totalContentCount,
|
totalContentCount: totalContentCount,
|
||||||
remainingContentCount: remainingContentCount,
|
remainingContentCount: remainingContentCount,
|
||||||
orderSequence: audioContent.orderSequence
|
orderSequence: audioContent.orderSequence,
|
||||||
|
buyerList: audioContent.buyerList
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ struct GetAudioContentDetailResponse: Decodable {
|
||||||
let creator: AudioContentCreator
|
let creator: AudioContentCreator
|
||||||
let previousContent: OtherContentResponse?
|
let previousContent: OtherContentResponse?
|
||||||
let nextContent: OtherContentResponse?
|
let nextContent: OtherContentResponse?
|
||||||
|
let buyerList: [ContentBuyer]
|
||||||
}
|
}
|
||||||
|
|
||||||
enum OrderType: String, Codable {
|
enum OrderType: String, Codable {
|
||||||
|
@ -60,3 +61,8 @@ struct AudioContentCreator: Decodable {
|
||||||
let isFollow: Bool
|
let isFollow: Bool
|
||||||
let isNotify: Bool
|
let isNotify: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct ContentBuyer: Decodable {
|
||||||
|
let nickname: String
|
||||||
|
let profileImageUrl: String
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue