Compare commits
No commits in common. "27b87c9cbe36342dc665ff2177d11bb9597b3cac" and "62904d96b1b1fb48d4ede2f596d7dc6ad7989c8d" have entirely different histories.
27b87c9cbe
...
62904d96b1
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "ic_card_can_gray.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 552 B |
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "ic_card_time_small_gray.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 543 B |
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "ic_short_play.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB |
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "ic_thumb_play_blue.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB |
|
@ -119,6 +119,4 @@ enum AppStep {
|
||||||
case creatorCommunityModify(postId: Int, onSuccess: () -> Void)
|
case creatorCommunityModify(postId: Int, onSuccess: () -> Void)
|
||||||
|
|
||||||
case canCoupon
|
case canCoupon
|
||||||
|
|
||||||
case contentAllByTheme(themeId: Int)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,111 +0,0 @@
|
||||||
//
|
|
||||||
// ContentAllByThemeView.swift
|
|
||||||
// SodaLive
|
|
||||||
//
|
|
||||||
// Created by klaus on 2/14/24.
|
|
||||||
//
|
|
||||||
|
|
||||||
import SwiftUI
|
|
||||||
|
|
||||||
struct ContentAllByThemeView: View {
|
|
||||||
@StateObject var viewModel = ContentAllByThemeViewModel()
|
|
||||||
|
|
||||||
let themeId: Int
|
|
||||||
|
|
||||||
let columns = [
|
|
||||||
GridItem(.flexible(), alignment: .top),
|
|
||||||
GridItem(.flexible(), alignment: .top),
|
|
||||||
GridItem(.flexible(), alignment: .top)
|
|
||||||
]
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
NavigationView {
|
|
||||||
BaseView(isLoading: $viewModel.isLoading) {
|
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
|
||||||
DetailNavigationBar(title: viewModel.theme)
|
|
||||||
|
|
||||||
HStack(spacing: 13.3) {
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
Text("최신순")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
||||||
.foregroundColor(
|
|
||||||
Color(hex: "e2e2e2")
|
|
||||||
.opacity(viewModel.sort == .NEWEST ? 1 : 0.5)
|
|
||||||
)
|
|
||||||
.onTapGesture {
|
|
||||||
if viewModel.sort != .NEWEST {
|
|
||||||
viewModel.sort = .NEWEST
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text("높은 가격순")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
||||||
.foregroundColor(
|
|
||||||
Color(hex: "e2e2e2")
|
|
||||||
.opacity(viewModel.sort == .PRICE_HIGH ? 1 : 0.5)
|
|
||||||
)
|
|
||||||
.onTapGesture {
|
|
||||||
if viewModel.sort != .PRICE_HIGH {
|
|
||||||
viewModel.sort = .PRICE_HIGH
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text("낮은 가격순")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
||||||
.foregroundColor(
|
|
||||||
Color(hex: "e2e2e2")
|
|
||||||
.opacity(viewModel.sort == .PRICE_LOW ? 1 : 0.5)
|
|
||||||
)
|
|
||||||
.onTapGesture {
|
|
||||||
if viewModel.sort != .PRICE_LOW {
|
|
||||||
viewModel.sort = .PRICE_LOW
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding(.vertical, 13.3)
|
|
||||||
.padding(.horizontal, 20)
|
|
||||||
.background(Color(hex: "161616"))
|
|
||||||
.padding(.top, 13.3)
|
|
||||||
|
|
||||||
HStack(spacing: 0) {
|
|
||||||
Text("전체")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
||||||
.foregroundColor(Color(hex: "e2e2e2"))
|
|
||||||
|
|
||||||
Text("\(viewModel.totalCount)")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
||||||
.foregroundColor(Color(hex: "ff5c49"))
|
|
||||||
.padding(.leading, 8)
|
|
||||||
|
|
||||||
Text("개")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
||||||
.foregroundColor(Color(hex: "e2e2e2"))
|
|
||||||
.padding(.leading, 2)
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
}
|
|
||||||
.padding(.vertical, 13.3)
|
|
||||||
.padding(.horizontal, 20)
|
|
||||||
|
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
|
||||||
LazyVGrid(columns: columns, spacing: 13.3) {
|
|
||||||
ForEach(0..<viewModel.contentList.count, id: \.self) { index in
|
|
||||||
ContentNewAllItemView(item: viewModel.contentList[index])
|
|
||||||
.onAppear {
|
|
||||||
if index == viewModel.contentList.count - 1 {
|
|
||||||
viewModel.getContentList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.onAppear {
|
|
||||||
viewModel.themeId = themeId
|
|
||||||
viewModel.getContentList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,96 +0,0 @@
|
||||||
//
|
|
||||||
// ContentAllByThemeViewModel.swift
|
|
||||||
// SodaLive
|
|
||||||
//
|
|
||||||
// Created by klaus on 2/14/24.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import Combine
|
|
||||||
|
|
||||||
final class ContentAllByThemeViewModel: ObservableObject {
|
|
||||||
enum Sort: String {
|
|
||||||
case NEWEST, PRICE_HIGH, PRICE_LOW
|
|
||||||
}
|
|
||||||
|
|
||||||
private let repository = ContentRepository()
|
|
||||||
private var subscription = Set<AnyCancellable>()
|
|
||||||
|
|
||||||
@Published var errorMessage = ""
|
|
||||||
@Published var isShowPopup = false
|
|
||||||
@Published var isLoading = false
|
|
||||||
|
|
||||||
@Published var theme = ""
|
|
||||||
@Published var totalCount = 0
|
|
||||||
@Published var sort = Sort.NEWEST {
|
|
||||||
didSet {
|
|
||||||
page = 1
|
|
||||||
isLast = false
|
|
||||||
getContentList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Published var contentList: [GetAudioContentMainItem] = []
|
|
||||||
|
|
||||||
var themeId = 0
|
|
||||||
var page = 1
|
|
||||||
var isLast = false
|
|
||||||
private let pageSize = 10
|
|
||||||
|
|
||||||
func getContentList() {
|
|
||||||
if (!isLast && !isLoading) {
|
|
||||||
isLoading = true
|
|
||||||
|
|
||||||
repository.getAudioContentByTheme(
|
|
||||||
themeId: themeId,
|
|
||||||
page: page,
|
|
||||||
size: pageSize,
|
|
||||||
sort: sort
|
|
||||||
)
|
|
||||||
.sink { result in
|
|
||||||
switch result {
|
|
||||||
case .finished:
|
|
||||||
DEBUG_LOG("finish")
|
|
||||||
case .failure(let error):
|
|
||||||
ERROR_LOG(error.localizedDescription)
|
|
||||||
}
|
|
||||||
} receiveValue: { [unowned self] response in
|
|
||||||
let responseData = response.data
|
|
||||||
|
|
||||||
do {
|
|
||||||
let jsonDecoder = JSONDecoder()
|
|
||||||
let decoded = try jsonDecoder.decode(ApiResponse<GetContentByThemeResponse>.self, from: responseData)
|
|
||||||
|
|
||||||
if let data = decoded.data, decoded.success {
|
|
||||||
if page == 1 {
|
|
||||||
self.contentList.removeAll()
|
|
||||||
}
|
|
||||||
|
|
||||||
if !data.items.isEmpty {
|
|
||||||
page += 1
|
|
||||||
self.theme = data.theme
|
|
||||||
self.totalCount = data.totalCount
|
|
||||||
self.contentList.append(contentsOf: data.items)
|
|
||||||
} else {
|
|
||||||
isLast = true
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if let message = decoded.message {
|
|
||||||
self.errorMessage = message
|
|
||||||
} else {
|
|
||||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
|
||||||
}
|
|
||||||
|
|
||||||
self.isShowPopup = true
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
|
|
||||||
self.isShowPopup = true
|
|
||||||
}
|
|
||||||
|
|
||||||
self.isLoading = false
|
|
||||||
}
|
|
||||||
.store(in: &subscription)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
//
|
|
||||||
// GetContentByThemeResponse.swift
|
|
||||||
// SodaLive
|
|
||||||
//
|
|
||||||
// Created by klaus on 2/14/24.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
struct GetContentByThemeResponse: Decodable {
|
|
||||||
let theme: String
|
|
||||||
let totalCount: Int
|
|
||||||
let items: [GetAudioContentMainItem]
|
|
||||||
}
|
|
|
@ -19,55 +19,12 @@ struct ContentNewAllItemView: View {
|
||||||
ContentDetailView(contentId: item.contentId)
|
ContentDetailView(contentId: item.contentId)
|
||||||
} label: {
|
} label: {
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
ZStack(alignment: .bottom) {
|
|
||||||
KFImage(URL(string: item.coverImageUrl))
|
KFImage(URL(string: item.coverImageUrl))
|
||||||
.resizable()
|
.resizable()
|
||||||
.scaledToFill()
|
.scaledToFill()
|
||||||
.frame(width: width, height: width, alignment: .top)
|
.frame(width: width, height: width, alignment: .top)
|
||||||
.cornerRadius(2.7)
|
.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)
|
Text(item.title)
|
||||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||||
.foregroundColor(Color(hex: "d2d2d2"))
|
.foregroundColor(Color(hex: "d2d2d2"))
|
||||||
|
@ -93,7 +50,7 @@ struct ContentNewAllItemView: View {
|
||||||
}
|
}
|
||||||
.frame(width: width)
|
.frame(width: width)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
width = (screenSize().width - 54) / 3
|
width = (screenSize().width - 40) / 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ struct ContentNewAllView: View {
|
||||||
@StateObject var viewModel = ContentNewAllViewModel()
|
@StateObject var viewModel = ContentNewAllViewModel()
|
||||||
|
|
||||||
let columns = [
|
let columns = [
|
||||||
GridItem(.flexible(), alignment: .top),
|
|
||||||
GridItem(.flexible(), alignment: .top),
|
GridItem(.flexible(), alignment: .top),
|
||||||
GridItem(.flexible(), alignment: .top)
|
GridItem(.flexible(), alignment: .top)
|
||||||
]
|
]
|
||||||
|
|
|
@ -36,7 +36,6 @@ enum ContentApi {
|
||||||
case getContentRankingSortType
|
case getContentRankingSortType
|
||||||
case pinContent(contentId: Int)
|
case pinContent(contentId: Int)
|
||||||
case unpinContent(contentId: Int)
|
case unpinContent(contentId: Int)
|
||||||
case getAudioContentByTheme(themeId: Int, page: Int, size: Int, sort: ContentAllByThemeViewModel.Sort)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ContentApi: TargetType {
|
extension ContentApi: TargetType {
|
||||||
|
@ -126,9 +125,6 @@ extension ContentApi: TargetType {
|
||||||
|
|
||||||
case .unpinContent(let contentId):
|
case .unpinContent(let contentId):
|
||||||
return "/audio-content/unpin-at-the-top/\(contentId)"
|
return "/audio-content/unpin-at-the-top/\(contentId)"
|
||||||
|
|
||||||
case .getAudioContentByTheme(let themeId, _, _, _):
|
|
||||||
return "/audio-content/theme/\(themeId)/content"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +136,7 @@ extension ContentApi: TargetType {
|
||||||
.getContentRankingSortType:
|
.getContentRankingSortType:
|
||||||
return .get
|
return .get
|
||||||
|
|
||||||
case .getMainBannerList, .getMainOrderList, .getNewContentUploadCreatorList, .getCurationList, .getAudioContentByTheme:
|
case .getMainBannerList, .getMainOrderList, .getNewContentUploadCreatorList, .getCurationList:
|
||||||
return .get
|
return .get
|
||||||
|
|
||||||
case .likeContent, .modifyAudioContent, .modifyComment, .unpinContent:
|
case .likeContent, .modifyAudioContent, .modifyComment, .unpinContent:
|
||||||
|
@ -275,15 +271,6 @@ extension ContentApi: TargetType {
|
||||||
|
|
||||||
case .pinContent, .unpinContent:
|
case .pinContent, .unpinContent:
|
||||||
return .requestPlain
|
return .requestPlain
|
||||||
|
|
||||||
case .getAudioContentByTheme(_, let page, let size, let sort):
|
|
||||||
let parameters = [
|
|
||||||
"page": page - 1,
|
|
||||||
"size": size,
|
|
||||||
"sort-type": sort
|
|
||||||
] as [String : Any]
|
|
||||||
|
|
||||||
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,8 +125,4 @@ final class ContentRepository {
|
||||||
func getCategoryList(creatorId: Int) -> AnyPublisher<Response, MoyaError> {
|
func getCategoryList(creatorId: Int) -> AnyPublisher<Response, MoyaError> {
|
||||||
return categoryApi.requestPublisher(.getCategoryList(creatorId: creatorId))
|
return categoryApi.requestPublisher(.getCategoryList(creatorId: creatorId))
|
||||||
}
|
}
|
||||||
|
|
||||||
func getAudioContentByTheme(themeId: Int, page: Int, size: Int, sort: ContentAllByThemeViewModel.Sort) -> AnyPublisher<Response, MoyaError> {
|
|
||||||
return api.requestPublisher(.getAudioContentByTheme(themeId: themeId, page: page, size: size, sort: sort))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ struct ContentCurationView: View {
|
||||||
let curationId: Int
|
let curationId: Int
|
||||||
|
|
||||||
let columns = [
|
let columns = [
|
||||||
GridItem(.flexible(), alignment: .top),
|
|
||||||
GridItem(.flexible(), alignment: .top),
|
GridItem(.flexible(), alignment: .top),
|
||||||
GridItem(.flexible(), alignment: .top)
|
GridItem(.flexible(), alignment: .top)
|
||||||
]
|
]
|
||||||
|
|
|
@ -59,9 +59,7 @@ struct ContentMainItemView_Previews: PreviewProvider {
|
||||||
title: "ㅓ처랴햐햫햐햐",
|
title: "ㅓ처랴햐햫햐햐",
|
||||||
creatorId: 8,
|
creatorId: 8,
|
||||||
creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
|
creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
|
||||||
creatorNickname: "유저2",
|
creatorNickname: "유저2"
|
||||||
price: 10,
|
|
||||||
duration: "00:00:30"
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,60 +35,11 @@ struct ContentMainView: View {
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
|
|
||||||
ContentMainBannerView()
|
ContentMainBannerView()
|
||||||
.padding(.bottom, 26.7)
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
|
|
||||||
HStack(spacing: 13.3) {
|
|
||||||
VStack(spacing: 2.7) {
|
|
||||||
HStack(spacing: 2.7) {
|
|
||||||
Image("ic_short_play")
|
|
||||||
|
|
||||||
Text("숏플")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
|
||||||
.foregroundColor(Color(hex: "dd158d"))
|
|
||||||
}
|
|
||||||
|
|
||||||
Text("짧지만 꼴릿한 이야기")
|
|
||||||
.font(.custom(Font.light.rawValue, size: 10))
|
|
||||||
.foregroundColor(Color(hex: "dd158d"))
|
|
||||||
}
|
|
||||||
.padding(.vertical, 10)
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.background(Color(hex: "ffecf7"))
|
|
||||||
.cornerRadius(2.6)
|
|
||||||
.onTapGesture {
|
|
||||||
AppState.shared.setAppStep(
|
|
||||||
step: .contentAllByTheme(themeId: 11)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
VStack(spacing: 2.7) {
|
|
||||||
HStack(spacing: 2.7) {
|
|
||||||
Image("ic_thumb_play_blue")
|
|
||||||
|
|
||||||
Text("라이브 다시듣기")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
|
||||||
.foregroundColor(Color(hex: "0057ff"))
|
|
||||||
}
|
|
||||||
|
|
||||||
Text("놓쳤던 라이브 다시듣기")
|
|
||||||
.font(.custom(Font.light.rawValue, size: 10))
|
|
||||||
.foregroundColor(Color(hex: "0057ff"))
|
|
||||||
}
|
|
||||||
.padding(.vertical, 10)
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.background(Color(hex: "ecf9ff"))
|
|
||||||
.cornerRadius(2.6)
|
|
||||||
.onTapGesture {
|
|
||||||
AppState.shared.setAppStep(
|
|
||||||
step: .contentAllByTheme(themeId: 7)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding(.bottom, 40)
|
.padding(.bottom, 40)
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
|
|
||||||
ContentMainMyStashView()
|
ContentMainMyStashView()
|
||||||
|
.padding(.bottom, 40)
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
|
|
||||||
ContentMainNewContentView()
|
ContentMainNewContentView()
|
||||||
|
|
|
@ -48,8 +48,6 @@ struct GetAudioContentMainItem: Decodable {
|
||||||
let creatorId: Int
|
let creatorId: Int
|
||||||
let creatorProfileImageUrl: String
|
let creatorProfileImageUrl: String
|
||||||
let creatorNickname: String
|
let creatorNickname: String
|
||||||
let price: Int
|
|
||||||
let duration: String
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GetAudioContentCurationResponse: Decodable {
|
struct GetAudioContentCurationResponse: Decodable {
|
||||||
|
|
|
@ -39,7 +39,6 @@ struct ContentMainMyStashView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.bottom, 40)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if viewModel.isLoading {
|
if viewModel.isLoading {
|
||||||
|
|
|
@ -175,9 +175,6 @@ struct ContentView: View {
|
||||||
case .canCoupon:
|
case .canCoupon:
|
||||||
CanCouponView()
|
CanCouponView()
|
||||||
|
|
||||||
case .contentAllByTheme(let themeId):
|
|
||||||
ContentAllByThemeView(themeId: themeId)
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
EmptyView()
|
EmptyView()
|
||||||
.frame(width: 0, height: 0, alignment: .topLeading)
|
.frame(width: 0, height: 0, alignment: .topLeading)
|
||||||
|
|
|
@ -118,20 +118,9 @@ struct LiveDetailView: View {
|
||||||
.padding(.top, 16.7)
|
.padding(.top, 16.7)
|
||||||
.frame(width: proxy.size.width - 26.7)
|
.frame(width: proxy.size.width - 26.7)
|
||||||
|
|
||||||
if UserDefaults.int(forKey: .userId) == room.manager.id {
|
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.frame(height: 1)
|
.frame(height: 1)
|
||||||
.foregroundColor(Color.gray90.opacity(0.5))
|
.foregroundColor(Color(hex: "909090").opacity(0.5))
|
||||||
.padding(.top, 8)
|
|
||||||
.frame(width: proxy.size.width - 26.7)
|
|
||||||
|
|
||||||
ParticipantView(room: room)
|
|
||||||
.frame(width: proxy.size.width - 26.7)
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle()
|
|
||||||
.frame(height: 1)
|
|
||||||
.foregroundColor(Color.gray90.opacity(0.5))
|
|
||||||
.padding(.top, 13.3)
|
.padding(.top, 13.3)
|
||||||
|
|
||||||
HStack(spacing: 13.3) {
|
HStack(spacing: 13.3) {
|
||||||
|
@ -403,88 +392,6 @@ struct LiveDetailView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private func ParticipantView(room: GetRoomDetailResponse) -> some View {
|
|
||||||
if isExpandParticipantArea {
|
|
||||||
HStack(spacing: 0) {
|
|
||||||
Text(room.channelName.isNullOrBlank() ? "예약자" : "참가자")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
|
||||||
.foregroundColor(Color.graybb)
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
Text("\(room.numberOfParticipants)")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
|
||||||
.foregroundColor(Color.button)
|
|
||||||
|
|
||||||
Text("/\(room.numberOfParticipantsTotal)")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
|
||||||
.foregroundColor(Color.graybb)
|
|
||||||
}
|
|
||||||
.padding(.top, 16.7)
|
|
||||||
|
|
||||||
LazyVGrid(columns: columns) {
|
|
||||||
ForEach(room.participatingUsers, id: \.self) { user in
|
|
||||||
VStack(spacing: 6.7) {
|
|
||||||
KFImage(URL(string: user.profileImageUrl))
|
|
||||||
.resizable()
|
|
||||||
.scaledToFill()
|
|
||||||
.frame(width: 46.7, height: 46.7, alignment: .top)
|
|
||||||
.clipShape(Circle())
|
|
||||||
|
|
||||||
Text(user.nickname)
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
|
||||||
.foregroundColor(Color.graybb)
|
|
||||||
.lineLimit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding(.top, 16.7)
|
|
||||||
} else {
|
|
||||||
let userCount = room.numberOfParticipants > 10 ? 10 : room.numberOfParticipants
|
|
||||||
|
|
||||||
HStack(spacing: -13.3) {
|
|
||||||
ForEach(0..<userCount, id: \.self) { index in
|
|
||||||
let user = room.participatingUsers[index]
|
|
||||||
KFImage(URL(string: user.profileImageUrl))
|
|
||||||
.resizable()
|
|
||||||
.scaledToFill()
|
|
||||||
.frame(width: 33.3, height: 33.3, alignment: .top)
|
|
||||||
.clipShape(Circle())
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
HStack(spacing: 0) {
|
|
||||||
Text("\(room.numberOfParticipants)")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
|
||||||
.foregroundColor(Color.button)
|
|
||||||
|
|
||||||
Text("/\(room.numberOfParticipantsTotal)")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
|
||||||
.foregroundColor(Color.graybb)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding(.top, 22)
|
|
||||||
}
|
|
||||||
|
|
||||||
if room.numberOfParticipants > 0 {
|
|
||||||
HStack(spacing: 6.7) {
|
|
||||||
Image(isExpandParticipantArea ? "ic_live_detail_top" : "ic_live_detail_bottom")
|
|
||||||
.resizable()
|
|
||||||
.frame(width: 20, height: 20)
|
|
||||||
|
|
||||||
Text(isExpandParticipantArea ? "닫기" : "펼쳐보기")
|
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
|
||||||
.foregroundColor(Color.graybb)
|
|
||||||
}
|
|
||||||
.padding(.top, 13.3)
|
|
||||||
.onTapGesture {
|
|
||||||
isExpandParticipantArea.toggle()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func hideView() {
|
private func hideView() {
|
||||||
if let close = onClickClose {
|
if let close = onClickClose {
|
||||||
close()
|
close()
|
||||||
|
|
Loading…
Reference in New Issue