재생 목록 수정 페이지 추가
This commit is contained in:
@@ -18,175 +18,184 @@ struct ContentPlaylistDetailView: View {
|
||||
@State private var isShowPopupMenu = false
|
||||
@State private var isShowDeleteConfirm = false
|
||||
|
||||
@State private var isShowModify = false
|
||||
|
||||
var body: some View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(spacing: 21.3) {
|
||||
HStack(spacing: 5.3) {
|
||||
Image("ic_back")
|
||||
.resizable()
|
||||
.frame(width: 20, height: 20)
|
||||
.padding(8)
|
||||
.onTapGesture {
|
||||
isShowing = false
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
Image("ic_edit_white")
|
||||
.padding(8)
|
||||
.onTapGesture {
|
||||
}
|
||||
|
||||
Image("ic_seemore_vertical_white")
|
||||
.padding(8)
|
||||
.onTapGesture {
|
||||
isShowPopupMenu = true
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(height: 50)
|
||||
.frame(maxWidth: .infinity)
|
||||
.background(Color.black)
|
||||
if reloadData {
|
||||
Color.clear
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
if let response = viewModel.response {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
HStack(alignment: .top, spacing: 13.3) {
|
||||
VStack(alignment: .center, spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
KFImage(URL(string: response.playlistCoverImageList[0]))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: 80, height: 80))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.clipped()
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
|
||||
if response.playlistCoverImageList.count > 2 {
|
||||
KFImage(URL(string: response.playlistCoverImageList[1]))
|
||||
LoadingView()
|
||||
} else {
|
||||
VStack(spacing: 21.3) {
|
||||
HStack(spacing: 5.3) {
|
||||
Image("ic_back")
|
||||
.resizable()
|
||||
.frame(width: 20, height: 20)
|
||||
.padding(8)
|
||||
.onTapGesture {
|
||||
isShowing = false
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
Image("ic_edit_white")
|
||||
.padding(8)
|
||||
.onTapGesture {
|
||||
isShowModify = true
|
||||
}
|
||||
|
||||
Image("ic_seemore_vertical_white")
|
||||
.padding(8)
|
||||
.onTapGesture {
|
||||
isShowPopupMenu = true
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
.frame(height: 50)
|
||||
.frame(maxWidth: .infinity)
|
||||
.background(Color.black)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
if let response = viewModel.response {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
HStack(alignment: .top, spacing: 13.3) {
|
||||
VStack(alignment: .center, spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
KFImage(URL(string: response.playlistCoverImageList[0]))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: 80, height: 80))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.clipped()
|
||||
.frame(maxWidth: 40, maxHeight: 40)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
|
||||
if response.playlistCoverImageList.count > 2 {
|
||||
KFImage(URL(string: response.playlistCoverImageList[1]))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: 80, height: 80))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.clipped()
|
||||
.frame(maxWidth: 40, maxHeight: 40)
|
||||
}
|
||||
}
|
||||
|
||||
HStack(spacing: 0) {
|
||||
if response.playlistCoverImageList.count > 2 {
|
||||
KFImage(URL(string: response.playlistCoverImageList[2]))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: 80, height: 80))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.clipped()
|
||||
.frame(maxWidth: 40, maxHeight: 40)
|
||||
}
|
||||
|
||||
if response.playlistCoverImageList.count > 3 {
|
||||
KFImage(URL(string: response.playlistCoverImageList[3]))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: 80, height: 80))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.clipped()
|
||||
.frame(maxWidth: 40, maxHeight: 40)
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(width: 80, height: 80)
|
||||
.background(Color.graybb)
|
||||
.cornerRadius(4)
|
||||
|
||||
HStack(spacing: 0) {
|
||||
if response.playlistCoverImageList.count > 2 {
|
||||
KFImage(URL(string: response.playlistCoverImageList[2]))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: 80, height: 80))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.clipped()
|
||||
.frame(maxWidth: 40, maxHeight: 40)
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 6.7) {
|
||||
Text(response.title)
|
||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
||||
.foregroundColor(Color.grayd2)
|
||||
.lineLimit(2)
|
||||
.truncationMode(.tail)
|
||||
|
||||
if response.playlistCoverImageList.count > 3 {
|
||||
KFImage(URL(string: response.playlistCoverImageList[3]))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: 80, height: 80))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.clipped()
|
||||
.frame(maxWidth: 40, maxHeight: 40)
|
||||
}
|
||||
Text(response.desc.prefix(100))
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color.gray90)
|
||||
.truncationMode(.tail)
|
||||
}
|
||||
}
|
||||
.frame(width: 80, height: 80)
|
||||
.background(Color.graybb)
|
||||
.cornerRadius(4)
|
||||
|
||||
VStack(spacing: 6.7) {
|
||||
Text(response.title)
|
||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
||||
.foregroundColor(Color.grayd2)
|
||||
.lineLimit(2)
|
||||
.truncationMode(.tail)
|
||||
|
||||
Text(response.desc.prefix(100))
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
HStack(spacing: 0) {
|
||||
Text("만든 날짜 \(response.createdDate)")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.gray90)
|
||||
.truncationMode(.tail)
|
||||
}
|
||||
}
|
||||
|
||||
HStack(spacing: 0) {
|
||||
Text("만든 날짜 \(response.createdDate)")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.gray90)
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("\(response.contentCount)개")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.grayee)
|
||||
}
|
||||
.padding(.top, 13.3)
|
||||
|
||||
HStack(spacing: 13.3) {
|
||||
HStack(spacing: 5.3) {
|
||||
Image("ic_playlist_play")
|
||||
|
||||
Text("Play")
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color.white)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 11)
|
||||
.background(Color.button)
|
||||
.cornerRadius(5.3)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
}
|
||||
|
||||
HStack(spacing: 5.3) {
|
||||
Image("ic_playlist_shuffle")
|
||||
Spacer()
|
||||
|
||||
Text("Shuffle")
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color.white)
|
||||
Text("\(response.contentCount)개")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.grayee)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 11)
|
||||
.background(Color.button)
|
||||
.cornerRadius(5.3)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
.padding(.top, 13.3)
|
||||
|
||||
HStack(spacing: 13.3) {
|
||||
HStack(spacing: 5.3) {
|
||||
Image("ic_playlist_play")
|
||||
|
||||
Text("Play")
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color.white)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 11)
|
||||
.background(Color.button)
|
||||
.cornerRadius(5.3)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
}
|
||||
|
||||
HStack(spacing: 5.3) {
|
||||
Image("ic_playlist_shuffle")
|
||||
|
||||
Text("Shuffle")
|
||||
.font(.custom(Font.bold.rawValue, size: 14.7))
|
||||
.foregroundColor(Color.white)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 11)
|
||||
.background(Color.button)
|
||||
.cornerRadius(5.3)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
}
|
||||
}
|
||||
.padding(.top, 18)
|
||||
|
||||
LazyVStack(alignment: .leading, spacing: 0) {
|
||||
ForEach(0..<response.contentList.count, id: \.self) {
|
||||
PlaylistContentItemView(item: response.contentList[$0])
|
||||
}
|
||||
}
|
||||
.padding(.top, 18)
|
||||
}
|
||||
.padding(.top, 18)
|
||||
|
||||
LazyVStack(alignment: .leading, spacing: 0) {
|
||||
ForEach(0..<response.contentList.count, id: \.self) {
|
||||
PlaylistContentItemView(item: response.contentList[$0])
|
||||
}
|
||||
}
|
||||
.padding(.top, 18)
|
||||
.padding(.horizontal, 13.3)
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text(viewModel.errorMessage)
|
||||
.padding(.vertical, 13.3)
|
||||
.frame(width: screenSize().width - 66.7, alignment: .center)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.background(Color.button)
|
||||
.foregroundColor(Color.white)
|
||||
.multilineTextAlignment(.leading)
|
||||
.cornerRadius(20)
|
||||
.padding(.bottom, 66.7)
|
||||
Spacer()
|
||||
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text(viewModel.errorMessage)
|
||||
.padding(.vertical, 13.3)
|
||||
.frame(width: screenSize().width - 66.7, alignment: .center)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.background(Color.button)
|
||||
.foregroundColor(Color.white)
|
||||
.multilineTextAlignment(.leading)
|
||||
.cornerRadius(20)
|
||||
.padding(.bottom, 66.7)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.playlistId = playlistId
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.playlistId = playlistId
|
||||
}
|
||||
|
||||
if isShowPopupMenu {
|
||||
@@ -243,6 +252,14 @@ struct ContentPlaylistDetailView: View {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if isShowModify {
|
||||
ContentPlaylistModifyView(
|
||||
playlistId: playlistId,
|
||||
isShowing: $isShowModify,
|
||||
reloadData: $reloadData
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user