크리에이터 채널, 콘텐츠 상세 - 오픈예정 추가
This commit is contained in:
parent
a836215d37
commit
679783cc35
|
@ -26,6 +26,15 @@ struct ContentListItemView: View {
|
|||
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
HStack(spacing: 8) {
|
||||
if item.isScheduledToOpen {
|
||||
Text("오픈예정")
|
||||
.font(.custom(Font.medium.rawValue, size: 8))
|
||||
.foregroundColor(Color(hex: "3bb9f1"))
|
||||
.padding(2.6)
|
||||
.background(Color(hex: "003851"))
|
||||
.cornerRadius(2.6)
|
||||
}
|
||||
|
||||
Text(item.themeStr)
|
||||
.font(.custom(Font.medium.rawValue, size: 8))
|
||||
.foregroundColor(Color(hex: "3bac6a"))
|
||||
|
@ -112,7 +121,8 @@ struct ContentListItemView_Previews: PreviewProvider {
|
|||
duration: "00:04:43",
|
||||
likeCount: 2,
|
||||
commentCount: 0,
|
||||
isAdult: false
|
||||
isAdult: false,
|
||||
isScheduledToOpen: true
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -21,6 +21,16 @@ struct ContentDetailInfoView: View {
|
|||
VStack(alignment: .leading, spacing: 0) {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack(spacing: 5.3) {
|
||||
if let _ = audioContent.releaseDate {
|
||||
Text("오픈예정")
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "3bb9f1"))
|
||||
.padding(.horizontal, 5.3)
|
||||
.padding(.vertical, 3.3)
|
||||
.background(Color(hex: "003851"))
|
||||
.cornerRadius(2.6)
|
||||
}
|
||||
|
||||
Text(audioContent.themeStr)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "3bac6a"))
|
||||
|
|
|
@ -35,26 +35,28 @@ struct ContentDetailPlayView: View {
|
|||
)
|
||||
.cornerRadius(10.7, corners: [.topLeft, .topRight])
|
||||
|
||||
Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play")
|
||||
.onTapGesture {
|
||||
if isPlaying() {
|
||||
contentPlayManager.pauseAudio()
|
||||
} else {
|
||||
contentPlayManager.startTimer = startTimer
|
||||
contentPlayManager.stopTimer = stopTimer
|
||||
|
||||
contentPlayManager.playAudio(
|
||||
contentId: audioContent.contentId,
|
||||
title: audioContent.title,
|
||||
nickname: audioContent.creator.nickname,
|
||||
coverImage: audioContent.coverImageUrl,
|
||||
contentUrl: audioContent.contentUrl,
|
||||
isFree: audioContent.price <= 0,
|
||||
isPreview: !audioContent.existOrdered && audioContent.price > 0
|
||||
)
|
||||
isShowPreviewAlert = true
|
||||
if audioContent.releaseDate == nil {
|
||||
Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play")
|
||||
.onTapGesture {
|
||||
if isPlaying() {
|
||||
contentPlayManager.pauseAudio()
|
||||
} else {
|
||||
contentPlayManager.startTimer = startTimer
|
||||
contentPlayManager.stopTimer = stopTimer
|
||||
|
||||
contentPlayManager.playAudio(
|
||||
contentId: audioContent.contentId,
|
||||
title: audioContent.title,
|
||||
nickname: audioContent.creator.nickname,
|
||||
coverImage: audioContent.coverImageUrl,
|
||||
contentUrl: audioContent.contentUrl,
|
||||
isFree: audioContent.price <= 0,
|
||||
isPreview: !audioContent.existOrdered && audioContent.price > 0
|
||||
)
|
||||
isShowPreviewAlert = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 13.3) {
|
||||
Spacer()
|
||||
|
|
|
@ -93,7 +93,17 @@ struct ContentDetailView: View {
|
|||
)
|
||||
.padding(.horizontal, 13.3)
|
||||
|
||||
if audioContent.price > 0 &&
|
||||
if let releaseDate = audioContent.releaseDate {
|
||||
Text(releaseDate)
|
||||
.font(.custom(Font.bold.rawValue, size: 13.3))
|
||||
.foregroundColor(.white)
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 48.7)
|
||||
.background(Color(hex: "525252"))
|
||||
.cornerRadius(5.3)
|
||||
.padding(.top, 18.3)
|
||||
.padding(.horizontal, 13.3)
|
||||
} else if audioContent.price > 0 &&
|
||||
!audioContent.existOrdered &&
|
||||
audioContent.orderType == nil &&
|
||||
audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) {
|
||||
|
|
|
@ -17,6 +17,7 @@ struct GetAudioContentDetailResponse: Decodable {
|
|||
let tag: String
|
||||
let price: Int
|
||||
let duration: String
|
||||
let releaseDate: String?
|
||||
let isAdult: Bool
|
||||
let isMosaic: Bool
|
||||
let isOnlyRental: Bool
|
||||
|
|
|
@ -78,6 +78,7 @@ struct GetAudioContentListItem: Decodable {
|
|||
let likeCount: Int
|
||||
let commentCount: Int
|
||||
let isAdult: Bool
|
||||
let isScheduledToOpen: Bool
|
||||
}
|
||||
|
||||
struct GetCreatorActivitySummary: Decodable {
|
||||
|
|
|
@ -74,7 +74,8 @@ struct UserProfileContentView_Previews: PreviewProvider {
|
|||
duration: "00:04:43",
|
||||
likeCount: 2,
|
||||
commentCount: 0,
|
||||
isAdult: false
|
||||
isAdult: false,
|
||||
isScheduledToOpen: false
|
||||
)
|
||||
]
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue