From 6c0ea9595ccaaf5aa815eedac6fc5f06aafe3c3b Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 8 Jan 2025 01:40:41 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20-=20=EB=82=B4=20=EB=B3=B4=EA=B4=80=ED=95=A8=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SodaLive/Sources/App/AppStep.swift | 2 +- .../Sources/Content/Box/ContentBoxView.swift | 7 +- .../Content/Main/ContentMainView.swift | 2 +- SodaLive/Sources/ContentView.swift | 4 +- SodaLive/Sources/MyPage/CanCardView.swift | 6 +- SodaLive/Sources/MyPage/MyInfoCardView.swift | 6 +- SodaLive/Sources/MyPage/MyPageResponse.swift | 1 - SodaLive/Sources/MyPage/MyPageView.swift | 65 +++++++++++++++---- .../MyPage/ReservationStatusView.swift | 6 +- 9 files changed, 65 insertions(+), 34 deletions(-) diff --git a/SodaLive/Sources/App/AppStep.swift b/SodaLive/Sources/App/AppStep.swift index 89d20cd..f1119df 100644 --- a/SodaLive/Sources/App/AppStep.swift +++ b/SodaLive/Sources/App/AppStep.swift @@ -134,7 +134,7 @@ enum AppStep { case blockList - case myBox + case myBox(currentTab: ContentBoxViewModel.CurrentTab) case auditionDetail(auditionId: Int) diff --git a/SodaLive/Sources/Content/Box/ContentBoxView.swift b/SodaLive/Sources/Content/Box/ContentBoxView.swift index 8f0e074..1ee447c 100644 --- a/SodaLive/Sources/Content/Box/ContentBoxView.swift +++ b/SodaLive/Sources/Content/Box/ContentBoxView.swift @@ -17,6 +17,8 @@ struct ContentBoxView: View { @State private var selectedPlaylistId = 0 + let initCurrentTab: ContentBoxViewModel.CurrentTab + var body: some View { ZStack { NavigationView { @@ -71,6 +73,9 @@ struct ContentBoxView: View { OrderListAllInnerView() } } + .onAppear { + viewModel.currentTab = initCurrentTab + } } if isShowCreatePlaylist { @@ -92,5 +97,5 @@ struct ContentBoxView: View { } #Preview { - ContentBoxView() + ContentBoxView(initCurrentTab: .orderlist) } diff --git a/SodaLive/Sources/Content/Main/ContentMainView.swift b/SodaLive/Sources/Content/Main/ContentMainView.swift index d866f11..b55fb18 100644 --- a/SodaLive/Sources/Content/Main/ContentMainView.swift +++ b/SodaLive/Sources/Content/Main/ContentMainView.swift @@ -26,7 +26,7 @@ struct ContentMainView: View { Image("ic_content_keep") .onTapGesture { - AppState.shared.setAppStep(step: .myBox) + AppState.shared.setAppStep(step: .myBox(currentTab: .orderlist)) } } .padding(.bottom, 26.7) diff --git a/SodaLive/Sources/ContentView.swift b/SodaLive/Sources/ContentView.swift index 53fd302..bc9c410 100644 --- a/SodaLive/Sources/ContentView.swift +++ b/SodaLive/Sources/ContentView.swift @@ -200,8 +200,8 @@ struct ContentView: View { case .blockList: BlockMemberListView() - case .myBox: - ContentBoxView() + case .myBox(let currentTab): + ContentBoxView(initCurrentTab: currentTab) case .auditionDetail(let auditionId): AuditionDetailView(auditionId: auditionId) diff --git a/SodaLive/Sources/MyPage/CanCardView.swift b/SodaLive/Sources/MyPage/CanCardView.swift index 763ce85..356f715 100644 --- a/SodaLive/Sources/MyPage/CanCardView.swift +++ b/SodaLive/Sources/MyPage/CanCardView.swift @@ -71,11 +71,7 @@ struct CanCardView_Previews: PreviewProvider { websiteUrl: "", blogUrl: "", liveReservationCount: 0, - isAuth: false, - orderList: GetAudioContentOrderListResponse( - totalCount: 0, - items: [] - ) + isAuth: false ), refresh: {} ) diff --git a/SodaLive/Sources/MyPage/MyInfoCardView.swift b/SodaLive/Sources/MyPage/MyInfoCardView.swift index 4ecfa61..b56812a 100644 --- a/SodaLive/Sources/MyPage/MyInfoCardView.swift +++ b/SodaLive/Sources/MyPage/MyInfoCardView.swift @@ -95,11 +95,7 @@ struct MyInfoCardView_Previews: PreviewProvider { websiteUrl: "", blogUrl: "", liveReservationCount: 0, - isAuth: false, - orderList: GetAudioContentOrderListResponse( - totalCount: 0, - items: [] - ) + isAuth: false ), refresh: {} ) diff --git a/SodaLive/Sources/MyPage/MyPageResponse.swift b/SodaLive/Sources/MyPage/MyPageResponse.swift index 802608e..1635cf1 100644 --- a/SodaLive/Sources/MyPage/MyPageResponse.swift +++ b/SodaLive/Sources/MyPage/MyPageResponse.swift @@ -18,6 +18,5 @@ struct MyPageResponse: Decodable { let blogUrl: String? let liveReservationCount: Int let isAuth: Bool - let orderList: GetAudioContentOrderListResponse } diff --git a/SodaLive/Sources/MyPage/MyPageView.swift b/SodaLive/Sources/MyPage/MyPageView.swift index ab4aa75..5e73c91 100644 --- a/SodaLive/Sources/MyPage/MyPageView.swift +++ b/SodaLive/Sources/MyPage/MyPageView.swift @@ -81,16 +81,17 @@ struct MyPageView: View { } } - HStack(spacing: 8) { + HStack(spacing: 10.7) { Text("팔로잉 리스트") + .font(.custom(Font.bold.rawValue, size: 14.7)) + .foregroundColor(Color.button) .frame(maxWidth: .infinity) .padding(.vertical, 13.3) - .font(.custom(Font.bold.rawValue, size: 15.3)) - .foregroundColor(Color.grayee) + .background(Color.bg) .cornerRadius(6.7) .overlay( RoundedRectangle(cornerRadius: 6.7) - .stroke(Color.button, lineWidth: 1) + .stroke(Color.button, lineWidth: 1.3) ) .contentShape(Rectangle()) .onTapGesture { @@ -98,14 +99,15 @@ struct MyPageView: View { } Text("차단 리스트") + .font(.custom(Font.bold.rawValue, size: 14.7)) + .foregroundColor(Color.button) .frame(maxWidth: .infinity) .padding(.vertical, 13.3) - .font(.custom(Font.bold.rawValue, size: 15.3)) - .foregroundColor(Color.grayee) + .background(Color.bg) .cornerRadius(6.7) .overlay( RoundedRectangle(cornerRadius: 6.7) - .stroke(Color.button, lineWidth: 1) + .stroke(Color.button, lineWidth: 1.3) ) .contentShape(Rectangle()) .onTapGesture { @@ -132,13 +134,50 @@ struct MyPageView: View { } } - ReservationStatusView(data: data) - .padding(.top, 33.3) - - if data.orderList.totalCount > 0 { - OrderListView(items: data.orderList.items) - .padding(.top, 40) + VStack(alignment: .leading, spacing: 13.3) { + Text("내 보관함") + .font(.custom(Font.bold.rawValue, size: 18.3)) + .foregroundColor(Color.grayee) + + HStack(spacing: 10.7) { + Text("구매목록") + .font(.custom(Font.bold.rawValue, size: 14.7)) + .foregroundColor(Color.button) + .frame(maxWidth: .infinity) + .padding(.vertical, 13.3) + .background(Color.bg) + .cornerRadius(6.7) + .overlay( + RoundedRectangle(cornerRadius: 6.7) + .stroke(Color.button, lineWidth: 1.3) + ) + .contentShape(Rectangle()) + .onTapGesture { + AppState.shared.setAppStep(step: .myBox(currentTab: .orderlist)) + } + + Text("재생목록") + .font(.custom(Font.bold.rawValue, size: 14.7)) + .foregroundColor(Color.button) + .frame(maxWidth: .infinity) + .padding(.vertical, 13.3) + .background(Color.bg) + .cornerRadius(6.7) + .overlay( + RoundedRectangle(cornerRadius: 6.7) + .stroke(Color.button, lineWidth: 1.3) + ) + .contentShape(Rectangle()) + .onTapGesture { + AppState.shared.setAppStep(step: .myBox(currentTab: .playlist)) + } + } } + .padding(.top, 33) + .padding(.horizontal, 13.3) + + ReservationStatusView(data: data) + .padding(.top, 40) ServiceCenterButtonView() .padding(.top, 40) diff --git a/SodaLive/Sources/MyPage/ReservationStatusView.swift b/SodaLive/Sources/MyPage/ReservationStatusView.swift index d7d55e8..9c194eb 100644 --- a/SodaLive/Sources/MyPage/ReservationStatusView.swift +++ b/SodaLive/Sources/MyPage/ReservationStatusView.swift @@ -61,11 +61,7 @@ struct ReservationStatusView_Previews: PreviewProvider { websiteUrl: "", blogUrl: "", liveReservationCount: 0, - isAuth: false, - orderList: GetAudioContentOrderListResponse( - totalCount: 0, - items: [] - ) + isAuth: false ) ) }