콘텐츠 상세
- 한정판 UI 추가
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
@@ -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 {
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user