시리즈 전체보기 페이지 추가

This commit is contained in:
Yu Sung
2024-04-30 15:28:58 +09:00
parent 93110eff8c
commit a08b463c11
8 changed files with 153 additions and 3 deletions

View File

@@ -0,0 +1,52 @@
//
// SeriesContentAllView.swift
// SodaLive
//
// Created by klaus on 4/30/24.
//
import SwiftUI
struct SeriesContentAllView: View {
@ObservedObject var viewModel = SeriesContentAllViewModel()
let seriesId: Int
let seriesTitle: String
var body: some View {
VStack(spacing: 0) {
BaseView(isLoading: $viewModel.isLoading) {
VStack(spacing: 0) {
DetailNavigationBar(title: "\(seriesTitle) - 전체회차 듣기")
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 12) {
ForEach(0..<viewModel.seriesContentList.count, id: \.self) { index in
let item = viewModel.seriesContentList[index]
SeriesContentListItemView(item: item)
.contentShape(Rectangle())
.onTapGesture {
AppState.shared
.setAppStep(step: .contentDetail(contentId: item.contentId))
}
.onAppear {
if index == viewModel.seriesContentList.count - 1 {
viewModel.getSeriesContentList()
}
}
}
}
.padding(13.3)
.padding(.top, 12)
}
}
}
}
.onAppear {
viewModel.seriesId = seriesId
viewModel.getSeriesContentList()
}
}
}