크리에이터 채널, 콘텐츠 상세 - 오픈예정 추가

This commit is contained in:
Yu Sung 2024-01-10 02:55:00 +09:00
parent a836215d37
commit 679783cc35
7 changed files with 57 additions and 22 deletions

View File

@ -26,6 +26,15 @@ struct ContentListItemView: View {
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 8) { 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) Text(item.themeStr)
.font(.custom(Font.medium.rawValue, size: 8)) .font(.custom(Font.medium.rawValue, size: 8))
.foregroundColor(Color(hex: "3bac6a")) .foregroundColor(Color(hex: "3bac6a"))
@ -112,7 +121,8 @@ struct ContentListItemView_Previews: PreviewProvider {
duration: "00:04:43", duration: "00:04:43",
likeCount: 2, likeCount: 2,
commentCount: 0, commentCount: 0,
isAdult: false isAdult: false,
isScheduledToOpen: true
) )
) )
} }

View File

@ -21,6 +21,16 @@ struct ContentDetailInfoView: View {
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
VStack(alignment: .leading, spacing: 8) { VStack(alignment: .leading, spacing: 8) {
HStack(spacing: 5.3) { 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) Text(audioContent.themeStr)
.font(.custom(Font.medium.rawValue, size: 12)) .font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "3bac6a")) .foregroundColor(Color(hex: "3bac6a"))

View File

@ -35,26 +35,28 @@ struct ContentDetailPlayView: View {
) )
.cornerRadius(10.7, corners: [.topLeft, .topRight]) .cornerRadius(10.7, corners: [.topLeft, .topRight])
Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play") if audioContent.releaseDate == nil {
.onTapGesture { Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play")
if isPlaying() { .onTapGesture {
contentPlayManager.pauseAudio() if isPlaying() {
} else { contentPlayManager.pauseAudio()
contentPlayManager.startTimer = startTimer } else {
contentPlayManager.stopTimer = stopTimer contentPlayManager.startTimer = startTimer
contentPlayManager.stopTimer = stopTimer
contentPlayManager.playAudio(
contentId: audioContent.contentId, contentPlayManager.playAudio(
title: audioContent.title, contentId: audioContent.contentId,
nickname: audioContent.creator.nickname, title: audioContent.title,
coverImage: audioContent.coverImageUrl, nickname: audioContent.creator.nickname,
contentUrl: audioContent.contentUrl, coverImage: audioContent.coverImageUrl,
isFree: audioContent.price <= 0, contentUrl: audioContent.contentUrl,
isPreview: !audioContent.existOrdered && audioContent.price > 0 isFree: audioContent.price <= 0,
) isPreview: !audioContent.existOrdered && audioContent.price > 0
isShowPreviewAlert = true )
isShowPreviewAlert = true
}
} }
} }
VStack(alignment: .leading, spacing: 13.3) { VStack(alignment: .leading, spacing: 13.3) {
Spacer() Spacer()

View File

@ -93,7 +93,17 @@ struct ContentDetailView: View {
) )
.padding(.horizontal, 13.3) .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.existOrdered &&
audioContent.orderType == nil && audioContent.orderType == nil &&
audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) { audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) {

View File

@ -17,6 +17,7 @@ struct GetAudioContentDetailResponse: Decodable {
let tag: String let tag: String
let price: Int let price: Int
let duration: String let duration: String
let releaseDate: String?
let isAdult: Bool let isAdult: Bool
let isMosaic: Bool let isMosaic: Bool
let isOnlyRental: Bool let isOnlyRental: Bool

View File

@ -78,6 +78,7 @@ struct GetAudioContentListItem: Decodable {
let likeCount: Int let likeCount: Int
let commentCount: Int let commentCount: Int
let isAdult: Bool let isAdult: Bool
let isScheduledToOpen: Bool
} }
struct GetCreatorActivitySummary: Decodable { struct GetCreatorActivitySummary: Decodable {

View File

@ -74,7 +74,8 @@ struct UserProfileContentView_Previews: PreviewProvider {
duration: "00:04:43", duration: "00:04:43",
likeCount: 2, likeCount: 2,
commentCount: 0, commentCount: 0,
isAdult: false isAdult: false,
isScheduledToOpen: false
) )
] ]
) )