diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/CalendarView.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/CalendarView.swift index 84a7eb94..edae2439 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/CalendarView.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/CalendarView.swift @@ -14,6 +14,5 @@ struct CalendarView: View { Color.red700 Text("CalendarView") } - } } diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/SelectTreatment/SelectTreatmentView.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/SelectTreatment/SelectTreatmentView.swift index b71780fc..6552d452 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/SelectTreatment/SelectTreatmentView.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/SelectTreatment/SelectTreatmentView.swift @@ -24,17 +24,25 @@ struct SelectTreatmentView: View { calendarCoordinator.popToRoot() } ) - VStack { + + VStack(spacing: 0) { Spacer() .frame(height: 94.adjustedH) + TitleView() + Spacer() .frame(height: 40.adjustedH) + SelectChipsView(viewModel: viewModel) + Spacer() + CherrishButton(title: "다음", type: .next, state: $viewModel.buttonState, action: { }) + Spacer() .frame(height: 72.adjustedH) + } .ignoresSafeArea() .padding(.leading, 34.adjustedW) @@ -44,12 +52,16 @@ struct SelectTreatmentView: View { } private struct TitleView: View { + var body: some View { HStack { VStack(alignment: .leading){ TypographyText("시술 일정을 추가해볼게요.", style: .title1_sb_18, color: .gray1000) + TypographyText("이미 생각해둔 시술이 있나요?", style: .title1_sb_18, color: .gray1000) + TypographyText("시술을 선택하셨는지 확인할게요.", style: .body1_r_14, color: .gray700) + } Spacer() } @@ -60,9 +72,7 @@ private struct SelectChipsView: View { @ObservedObject var viewModel: SelectTreatmentViewModel var body: some View { - HStack( - spacing: 12 - ) { + HStack(spacing: 12) { ForEach(TreatmentSelectionState.allCases, id: \.self) { state in SelectionChip( title: state.title, diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/SelectedTreatmentView.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/SelectedTreatmentView.swift index 385d22d8..055b45c1 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/SelectedTreatmentView.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/SelectedTreatmentView.swift @@ -25,7 +25,9 @@ struct SelectedTreatmentView: View { VStack(spacing: 0) { HStack(spacing: 0) { TypographyText("선택한 시술", style: .body1_sb_14, color: .gray600) + Spacer() + } .padding(.horizontal, 26.adjustedW) .padding(.vertical, 9.adjustedH) @@ -33,6 +35,7 @@ struct SelectedTreatmentView: View { Rectangle() .frame(height: 1) .foregroundStyle(.gray400) + } .background(.gray0) .cornerRadius(10, corners: [.topLeft, .topRight]) diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/TargetDdaySettingView.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/TargetDdaySettingView.swift index 82234f58..ed6a2096 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/TargetDdaySettingView.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/TargetDdaySettingView.swift @@ -33,16 +33,22 @@ struct TargetDdaySettingView: View { VStack { Spacer() .frame(height: 50.adjustedH) + HStack(spacing:0){ VStack(alignment: .leading, spacing: 0) { TypographyText("회복을 계획할 때 고려해야 할", style: .title1_sb_18, color: .gray1000) + TypographyText("중요한 일정이 있나요?", style: .title1_sb_18, color: .gray1000) + } + Spacer() } .frame(height: 54.adjustedH) + Spacer() .frame(height: 40) + HStack(spacing: 12.adjustedW) { ForEach(DdayState.allCases, id: \.self) { state in SelectionChip( @@ -61,8 +67,10 @@ struct TargetDdaySettingView: View { ) } } + Spacer() .frame(height: 56.adjustedH) + if let state = dDayState { HStack(spacing: 0) { switch state { @@ -71,13 +79,17 @@ struct TargetDdaySettingView: View { case .no: TypographyText("대략적인 회복 목표일을 정해볼까요?", style: .title1_sb_18, color: .gray1000) } + Spacer() + } + Spacer() .frame(height: 24.adjustedH) + DateTextBox(year: $year, month: $month, day: $day) - } + } } } } diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift new file mode 100644 index 00000000..bb1fd5f5 --- /dev/null +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/DownTimeSettingView.swift @@ -0,0 +1,72 @@ +// +// DownTimeSettingView.swift +// Cherrish-iOS +// +// Created by 어재선 on 1/16/26. +// + +import SwiftUI + +struct DownTimeSettingView: View { + var treatments: [TreatmentEntity] + + var body: some View { + VStack { + Spacer() + .frame(height: 30) + + HStack { + TypographyText( + "필요에 맞게 다운타임을 조정할 수 있어요.", + style: .title1_sb_18, + color: .gray1000 + ) + + Spacer() + + } + ScrollView(.vertical, showsIndicators: false) { + ForEach(treatments, id: \.self) { treatment in + TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {}) + } + + Spacer() + .frame(height: 14.adjustedH) + + HStack(alignment: .top, spacing: 0) { + TypographyText( + "◎", + style: .body3_r_12, + color: .gray600 + ) + + VStack(alignment: .leading, spacing: 0) { + TypographyText( + "본 정보는 의료 상담이나 진단을 대체하지 않으며,", + style: .body3_r_12, + color: .gray600 + ) + + TypographyText( + "실제 다운타임 및 회복 과정은 개인에 따라 다를 수 있습니다.", + style: .body3_r_12, + color: .gray600 + ) + + TypographyText( + "정확한 내용은 의료진 상담을 통해 확인하세요.", + style: .body3_r_12, + color: .gray600 + ) + + } + + Spacer() + } + } + + } + .padding(.horizontal, 25.adjustedW) + } + +} diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/NoTreatment.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/NoTreatment.swift index e5604734..73338bda 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/NoTreatment.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/NoTreatment.swift @@ -35,15 +35,21 @@ enum NoTreatment: Int, CaseIterable, Identifiable { extension NoTreatment { mutating func next() { let allCases = Self.allCases + guard let currentIndex = allCases.firstIndex(of: self), currentIndex + 1 < allCases.count else { return } + self = allCases[allCases.index(after: currentIndex)] + } mutating func previous() { let allCases = Self.allCases + guard let currentIndex = allCases.firstIndex(of: self), currentIndex > 0 else { return } + self = allCases[allCases.index(before: currentIndex)] + } } diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/TreatmentCategory.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/TreatmentCategory.swift index 4dc38166..a4b8900d 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/TreatmentCategory.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/Model/TreatmentCategory.swift @@ -30,6 +30,7 @@ enum TreatmentCategory: CaseIterable, Identifiable { return "모공" case .trouble: return "트러블" + } } } diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/View/NoTreatmentFilterView.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/View/NoTreatmentFilterView.swift index b7bb266e..9c9b5dc8 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/View/NoTreatmentFilterView.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/View/NoTreatmentFilterView.swift @@ -8,16 +8,19 @@ import SwiftUI struct NoTreatmentFilterView: View { - @ObservedObject var viewModel: NoTreatmentViewModel + var body: some View { VStack(spacing: 0) { TitleHeaderView(title: viewModel.treatmentCatagory?.title ?? "") + Spacer() .frame(height: 10.adjustedH) + ScrollView(.vertical, showsIndicators: false){ Spacer() .frame(height: 10.adjustedH) + ForEach(viewModel.treatments, id: \.id) { treatment in TreatmentRowView( displayMode: .checkBoxView, @@ -27,6 +30,7 @@ struct NoTreatmentFilterView: View { ) .padding(.leading, 34.adjustedW) .padding(.trailing, 33.adjustedW) + } } } @@ -35,29 +39,40 @@ struct NoTreatmentFilterView: View { private struct TitleHeaderView: View { let title: String + var body: some View { VStack { VStack(alignment: .leading) { HStack(spacing: 6) { TypographyText(title, style: .title1_sb_18, color: .gray1000) + TypographyText("관련 시술 리스트", style: .title1_sb_18, color: .gray1000) + Spacer() + } HStack(spacing: 4) { VStack { TypographyText("◎", style: .body3_r_12, color: .gray600) + Spacer() + } VStack(alignment: .leading) { TypographyText("본 정보는 인터넷 빅테이터 검색 및 분석을 통해 수집된 정보이며, ", style: .body3_r_12, color: .gray600) + TypographyText("관련 시술 리스트", style: .body3_r_12, color: .gray600) + Spacer() + } } } .padding(.leading, 25.adjustedW) .padding(.vertical, 20.adjustedH) + Spacer() + } .background(Color.gray100) .overlay(alignment: .top) { diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/View/NoTreatmentView.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/View/NoTreatmentView.swift index 84fe33d0..b50168ed 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/View/NoTreatmentView.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/View/NoTreatmentView.swift @@ -25,8 +25,10 @@ struct NoTreatmentView: View { } ) + Spacer() .frame(height: 20.adjustedH) + ProgressBar( totalSteps: NoTreatment.allCases.count, currentStep: .constant(viewModel.step) @@ -43,30 +45,33 @@ struct NoTreatmentView: View { .padding( .leading, 34.adjustedW) .padding( .trailing, 33.adjustedW) .id(viewModel.state) + case .targetDdaySetting: TargetDdaySettingView(dDayState: $viewModel.dDay, year: $viewModel.year, month: $viewModel.month, day: $viewModel.day) .padding( .leading, 34.adjustedW) .padding( .trailing, 33.adjustedW) .id(viewModel.state) + case .treatmentFilter: NoTreatmentFilterView(viewModel: viewModel) case .downTimeSetting: - //TODO: 다운타임 설정 - EmptyView() + DownTimeSettingView(treatments: viewModel.selectedTreatments) + } } Spacer() CherrishButton(title: "다음", type: .next, state: .constant(viewModel.canProceed ? .active : .normal)) { viewModel.next() - + } .padding(.leading, 25.adjustedW) .padding(.trailing, 24.adjustedW) Spacer() .frame(height: 38.adjustedH) + } .id(viewModel.step) } @@ -87,6 +92,7 @@ private struct TreatmentSelectedCategory: View { VStack(spacing: 0) { Spacer() .frame(height: 50.adjustedH) + HStack(spacing: 0) { VStack(alignment: .leading, spacing: 0) { TypographyText( @@ -94,20 +100,25 @@ private struct TreatmentSelectedCategory: View { style: .title1_sb_18, color: .gray1000 ) + TypographyText( "피부 고민은 무엇인가요?", style: .title1_sb_18, color: .gray1000 ) + TypographyText( "선택한 고민을 기준으로 시술 정보를 정리해줘요.", style: .body1_m_14, color: .gray700 ) + } .frame(height: 78.adjustedH) + Spacer() } + Spacer() .frame(height: 40.adjustedH) LazyVGrid(columns: columns, spacing: 12) { diff --git a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/ViewModel/NoTreatmentViewModel.swift b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/ViewModel/NoTreatmentViewModel.swift index 1628e833..1b8e6365 100644 --- a/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/ViewModel/NoTreatmentViewModel.swift +++ b/Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/NoTreatment/ViewModel/NoTreatmentViewModel.swift @@ -8,7 +8,6 @@ import Foundation final class NoTreatmentViewModel: ObservableObject{ - @Published var state: NoTreatment = .treatmentSelectedCategory @Published var treatmentCatagory: TreatmentCategory? @Published var dDay: DdayState?