diff --git a/MEME/MEME.xcodeproj/project.pbxproj b/MEME/MEME.xcodeproj/project.pbxproj index 480f3ef..791abd1 100644 --- a/MEME/MEME.xcodeproj/project.pbxproj +++ b/MEME/MEME.xcodeproj/project.pbxproj @@ -13,15 +13,17 @@ 09275E822B518D150033EF34 /* ArtistHomeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 09275E812B518D150033EF34 /* ArtistHomeViewController.xib */; }; 09275E892B528A610033EF34 /* ArtistReservationStatusTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09275E872B528A610033EF34 /* ArtistReservationStatusTableViewCell.swift */; }; 09275E8A2B528A610033EF34 /* ArtistReservationStatusTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 09275E882B528A610033EF34 /* ArtistReservationStatusTableViewCell.xib */; }; - 093CE0812BE1602E0043F36F /* memeSecret.plist in Resources */ = {isa = PBXBuildFile; fileRef = 093CE07F2BE1602E0043F36F /* memeSecret.plist */; }; 094884C72B584B7000C233E0 /* ArtistMakeupTagCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 094884C52B584B7000C233E0 /* ArtistMakeupTagCollectionViewCell.swift */; }; 094884C82B584B7000C233E0 /* ArtistMakeupTagCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 094884C62B584B7000C233E0 /* ArtistMakeupTagCollectionViewCell.xib */; }; 094884CB2B584B8F00C233E0 /* ArtistPortfolioCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 094884C92B584B8F00C233E0 /* ArtistPortfolioCollectionViewCell.swift */; }; 094884CC2B584B8F00C233E0 /* ArtistPortfolioCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 094884CA2B584B8F00C233E0 /* ArtistPortfolioCollectionViewCell.xib */; }; 094884DB2B59915500C233E0 /* SingleReservationManageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 094884D92B59915400C233E0 /* SingleReservationManageViewController.swift */; }; 094884DC2B59915500C233E0 /* SingleReservationManageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 094884DA2B59915400C233E0 /* SingleReservationManageViewController.xib */; }; + 095417022C3D12850012B04D /* ReservationHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095417012C3D12850012B04D /* ReservationHeaderView.swift */; }; 095742512B66153E0011B580 /* ArtistPortfolioEditingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0957424F2B66153E0011B580 /* ArtistPortfolioEditingViewController.swift */; }; 095742522B66153E0011B580 /* ArtistPortfolioEditingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 095742502B66153E0011B580 /* ArtistPortfolioEditingViewController.xib */; }; + 09919FBC2C2AB7F900894119 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 09919FBA2C2AB7F900894119 /* GoogleService-Info.plist */; }; + 09919FBD2C2AB7F900894119 /* memeSecret.plist in Resources */ = {isa = PBXBuildFile; fileRef = 09919FBB2C2AB7F900894119 /* memeSecret.plist */; }; 09A6B0A02B9B0EE6007DCC0A /* PortfolioCategories.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09A6B09F2B9B0EE6007DCC0A /* PortfolioCategories.swift */; }; 2D0A19012B4EC9A000C1CECA /* ModelReservationConfirmViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D0A19002B4EC9A000C1CECA /* ModelReservationConfirmViewCell.xib */; }; 2D0A19052B4ED07B00C1CECA /* SelectMakeupCardViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D0A19042B4ED07B00C1CECA /* SelectMakeupCardViewCell.xib */; }; @@ -73,7 +75,6 @@ 2DA208192B7CF9EE006EB9B9 /* PortfolioDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DA208182B7CF9EE006EB9B9 /* PortfolioDTO.swift */; }; 2DB303E82B8286EF00D9E394 /* (null) in Sources */ = {isa = PBXBuildFile; }; 2DB303F32B829EF200D9E394 /* BusinessLocationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DB303F22B829EF200D9E394 /* BusinessLocationModel.swift */; }; - 2DC54B552BB749A800464DB2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2DC54B512BB7487100464DB2 /* GoogleService-Info.plist */; }; 2DD60FFB2BC5AE1700B362F1 /* RecommendHeaderReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DD60FFA2BC5AE1700B362F1 /* RecommendHeaderReusableView.swift */; }; 2DD60FFF2BC5AE5A00B362F1 /* ModelHomeViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DD60FFE2BC5AE5A00B362F1 /* ModelHomeViewItem.swift */; }; 2DD610022BC5AE7400B362F1 /* ModelHomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DD610012BC5AE7400B362F1 /* ModelHomeViewModel.swift */; }; @@ -348,15 +349,17 @@ 09275E812B518D150033EF34 /* ArtistHomeViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArtistHomeViewController.xib; sourceTree = ""; }; 09275E872B528A610033EF34 /* ArtistReservationStatusTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistReservationStatusTableViewCell.swift; sourceTree = ""; }; 09275E882B528A610033EF34 /* ArtistReservationStatusTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArtistReservationStatusTableViewCell.xib; sourceTree = ""; }; - 093CE07F2BE1602E0043F36F /* memeSecret.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = memeSecret.plist; sourceTree = ""; }; 094884C52B584B7000C233E0 /* ArtistMakeupTagCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistMakeupTagCollectionViewCell.swift; sourceTree = ""; }; 094884C62B584B7000C233E0 /* ArtistMakeupTagCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArtistMakeupTagCollectionViewCell.xib; sourceTree = ""; }; 094884C92B584B8F00C233E0 /* ArtistPortfolioCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistPortfolioCollectionViewCell.swift; sourceTree = ""; }; 094884CA2B584B8F00C233E0 /* ArtistPortfolioCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArtistPortfolioCollectionViewCell.xib; sourceTree = ""; }; 094884D92B59915400C233E0 /* SingleReservationManageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SingleReservationManageViewController.swift; sourceTree = ""; }; 094884DA2B59915400C233E0 /* SingleReservationManageViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SingleReservationManageViewController.xib; sourceTree = ""; }; + 095417012C3D12850012B04D /* ReservationHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReservationHeaderView.swift; sourceTree = ""; }; 0957424F2B66153E0011B580 /* ArtistPortfolioEditingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistPortfolioEditingViewController.swift; sourceTree = ""; }; 095742502B66153E0011B580 /* ArtistPortfolioEditingViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArtistPortfolioEditingViewController.xib; sourceTree = ""; }; + 09919FBA2C2AB7F900894119 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 09919FBB2C2AB7F900894119 /* memeSecret.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = memeSecret.plist; sourceTree = ""; }; 09A6B09F2B9B0EE6007DCC0A /* PortfolioCategories.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PortfolioCategories.swift; sourceTree = ""; }; 2D0A19002B4EC9A000C1CECA /* ModelReservationConfirmViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ModelReservationConfirmViewCell.xib; sourceTree = ""; }; 2D0A19042B4ED07B00C1CECA /* SelectMakeupCardViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SelectMakeupCardViewCell.xib; sourceTree = ""; }; @@ -409,7 +412,6 @@ 2DA208162B7CF87B006EB9B9 /* PortfolioManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PortfolioManager.swift; sourceTree = ""; }; 2DA208182B7CF9EE006EB9B9 /* PortfolioDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PortfolioDTO.swift; sourceTree = ""; }; 2DB303F22B829EF200D9E394 /* BusinessLocationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BusinessLocationModel.swift; sourceTree = ""; }; - 2DC54B512BB7487100464DB2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 2DD60FFA2BC5AE1700B362F1 /* RecommendHeaderReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendHeaderReusableView.swift; sourceTree = ""; }; 2DD60FFE2BC5AE5A00B362F1 /* ModelHomeViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelHomeViewItem.swift; sourceTree = ""; }; 2DD610012BC5AE7400B362F1 /* ModelHomeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelHomeViewModel.swift; sourceTree = ""; }; @@ -802,6 +804,7 @@ children = ( 3142B9AE2B4D08380066CD5A /* ArtistHomeViewController.swift */, 09275E812B518D150033EF34 /* ArtistHomeViewController.xib */, + 09A12F972C3D0E9200378980 /* ReservationDateHeader */, ); path = ArtistHomeView; sourceTree = ""; @@ -833,6 +836,14 @@ path = ManagementReservation; sourceTree = ""; }; + 09A12F972C3D0E9200378980 /* ReservationDateHeader */ = { + isa = PBXGroup; + children = ( + 095417012C3D12850012B04D /* ReservationHeaderView.swift */, + ); + path = ReservationDateHeader; + sourceTree = ""; + }; 09A6B0A42B9B22B3007DCC0A /* ArtistHome */ = { isa = PBXGroup; children = ( @@ -1116,8 +1127,8 @@ 3142B9612B4CFFED0066CD5A /* Assets.xcassets */, 314F74E92B52DDF200CACF20 /* Font */, 3142B9662B4CFFED0066CD5A /* Info.plist */, - 2DC54B512BB7487100464DB2 /* GoogleService-Info.plist */, - 093CE07F2BE1602E0043F36F /* memeSecret.plist */, + 09919FBA2C2AB7F900894119 /* GoogleService-Info.plist */, + 09919FBB2C2AB7F900894119 /* memeSecret.plist */, 3142B9632B4CFFED0066CD5A /* LaunchScreen.storyboard */, 3156D1FD2B69438800559820 /* Network */, 3142B9992B4D01FB0066CD5A /* extenstions */, @@ -2108,7 +2119,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2DC54B552BB749A800464DB2 /* GoogleService-Info.plist in Resources */, CCAB5A632B67B6CA00067FA4 /* ModelDetailSettingView.xib in Resources */, 094884CC2B584B8F00C233E0 /* ArtistPortfolioCollectionViewCell.xib in Resources */, 094884DC2B59915500C233E0 /* SingleReservationManageViewController.xib in Resources */, @@ -2143,12 +2153,13 @@ 091CCCDB2B64158B00ADD21C /* ArtistPortfolioManageViewController.xib in Resources */, 31B263502B57EE7D00304FBE /* SetProfileImageViewController.xib in Resources */, 31B263572B57EE9500304FBE /* RegistrationCompletionViewController.xib in Resources */, - 093CE0812BE1602E0043F36F /* memeSecret.plist in Resources */, 312B304C2B550FF9008D17FC /* Pretendard-Black.otf in Resources */, 312B30542B550FF9008D17FC /* Pretendard-Regular.otf in Resources */, 31F6F8462B52C7A500EC621D /* NavigationBarView.xib in Resources */, 31B263482B57EE4800304FBE /* LoginViewController.xib in Resources */, 312B30512B550FF9008D17FC /* Pretendard-SemiBold.otf in Resources */, + 09919FBD2C2AB7F900894119 /* memeSecret.plist in Resources */, + 09919FBC2C2AB7F900894119 /* GoogleService-Info.plist in Resources */, 31B263442B57EDE300304FBE /* TermDetailViewController.xib in Resources */, 315EE2D62B6658B50042A082 /* SetBusinessInfoViewController.xib in Resources */, ); @@ -2381,6 +2392,7 @@ 3142B99D2B4D021A0066CD5A /* UIView+.swift in Sources */, CC9C388F2B81B3530073A257 /* ContactAPI.swift in Sources */, CCB3190E2B8309CC003B4738 /* ProvisionViewController.swift in Sources */, + 095417022C3D12850012B04D /* ReservationHeaderView.swift in Sources */, CCAB5A4D2B65938F00067FA4 /* InterestArtistCollectionViewCell.swift in Sources */, CC2F3AC22B54361100508DA5 /* MyPageInfoViewController.swift in Sources */, 2DA208012B7AB514006EB9B9 /* SearchAPI.swift in Sources */, diff --git a/MEME/MEME.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/MEME/MEME.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index cf43879..1273b48 100644 --- a/MEME/MEME.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/MEME/MEME.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,4 @@ { - "originHash" : "6fca7f2af149821944265304d5e3334bcedc5b888fd37cfca509d25af23d8be1", "pins" : [ { "identity" : "abseil-cpp-binary", @@ -69,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "bc27fad73504f3d4af235de451f02ee22586ebd3", - "version" : "7.12.1" + "revision" : "57a1d307f42df690fdef2637f3e5b776da02aad6", + "version" : "7.13.3" } }, { @@ -87,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/gtm-session-fetcher.git", "state" : { - "revision" : "76135c9f4e1ac85459d5fec61b6f76ac47ab3a4c", - "version" : "3.3.1" + "revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b", + "version" : "3.5.0" } }, { @@ -105,8 +104,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/kakao/kakao-ios-sdk", "state" : { - "revision" : "b7a78bac4cb015fc3b1de34255b96421091fcf42", - "version" : "2.22.0" + "revision" : "08089eeffc9b442da1c7343a70bf66c6de1a72c9", + "version" : "2.22.4" } }, { @@ -114,8 +113,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/kakao/kakao-ios-sdk-rx", "state" : { - "revision" : "b282310c0b67e7f6e50bd05f4d0db275eb8f5a05", - "version" : "2.22.0" + "revision" : "bdcb118183ef59a75753a69ac5d3cc93def0baa3", + "version" : "2.22.4" } }, { @@ -123,8 +122,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/leveldb.git", "state" : { - "revision" : "9d108e9112aa1d65ce508facf804674546116d9c", - "version" : "1.22.3" + "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1", + "version" : "1.22.5" } }, { @@ -141,8 +140,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/nanopb.git", "state" : { - "revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692", - "version" : "2.30909.0" + "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1", + "version" : "2.30910.0" } }, { @@ -159,8 +158,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/promises.git", "state" : { - "revision" : "e70e889c0196c76d22759eb50d6a0270ca9f1d9e", - "version" : "2.3.1" + "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac", + "version" : "2.4.0" } }, { @@ -186,8 +185,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ReactiveX/RxSwift.git", "state" : { - "revision" : "9dcaa4b333db437b0fbfaf453fad29069044a8b4", - "version" : "6.6.0" + "revision" : "b06a8c8596e4c3e8e7788e08e720e3248563ce6a", + "version" : "6.7.1" } }, { @@ -195,8 +194,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/SnapKit/SnapKit.git", "state" : { - "revision" : "e74fe2a978d1216c3602b129447c7301573cc2d8", - "version" : "5.7.0" + "revision" : "2842e6e84e82eb9a8dac0100ca90d9444b0307f4", + "version" : "5.7.1" } }, { @@ -204,10 +203,10 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "65e8f29b2d63c4e38e736b25c27b83e012159be8", - "version" : "1.25.2" + "revision" : "d57a5aecf24a25b32ec4a74be2f5d0a995a47c4b", + "version" : "1.27.0" } } ], - "version" : 3 + "version" : 2 } diff --git a/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ArtistHomeViewController.swift b/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ArtistHomeViewController.swift index d579e0b..4c4360a 100644 --- a/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ArtistHomeViewController.swift +++ b/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ArtistHomeViewController.swift @@ -8,329 +8,314 @@ import UIKit class ArtistHomeViewController: UIViewController { - //MARK: - UI Properties - @IBOutlet private weak var artistHomeProfileStatusView: UIView! - @IBOutlet private weak var secondArtistHomeProfileStatusView: UIView! + //MARK: UI Properties @IBOutlet private weak var artistProfileImageView: UIImageView! @IBOutlet private weak var artistHomeProfileLabel: UILabel! - @IBOutlet private weak var artistReservationStatusTableView: UITableView! - @IBOutlet private weak var firstArtistResLabel: UILabel! - @IBOutlet private weak var firstArtistResTimeLabel: UILabel! - @IBOutlet private weak var firstArtistResBtnLabel: UILabel! - @IBOutlet private weak var secondArtistResBtn: UIButton! - @IBOutlet private weak var secondArtistResLabel: UILabel! - @IBOutlet private weak var secondArtistResTimeLabel: UILabel! + @IBOutlet private weak var todayReservationCollectionView: UICollectionView! + @IBOutlet private weak var reservationCollectionView: UICollectionView! + @IBOutlet weak var noProfileView: UIView! + @IBOutlet private weak var noProfileLabel: UILabel! + @IBOutlet weak var profileSettingButton: UIButton! - //MARK: - Properties - private var todayCount: Int = 0 - private var tomorrowCount: Int = 0 - private var fromTomorrowCount: Int = 0 - private var showDataCount: Int = 0 - private var selectedIdx: Int! - private var reservationData: [ReservationData]! - private var artistProfileData: MyPageData? - private var reservationStatusData: [Int] = [] - private var showReservationData: [Int] = [0,0,0,0] + //MARK: Properties + private var profileComplete : Bool = false + private var artistProfileData: ArtistProfileInfoData? + private var artistID: Int = -1 + private var todayReservationData: [ReservationData] = [] + private var pendingReservationData: [ReservationData] = [] + private var groupedReservations: [String: [ReservationData]] = [:] - //MARK: - ViewController 생명 주기 + //MARK: View LifeCycle override func viewDidLoad() { - super.viewDidLoad() - tableViewConfigure() - setUI() + artistID = getArtistID() + profileUISet() + reservationUISet() + filterReservations(reservationData: dummyReservations) } override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(true) - self.todayCount = 0 - self.tomorrowCount = 0 - self.fromTomorrowCount = 0 - artistID = KeyChainManager.loadMemberID() - getArtistProfile(userId: artistID) - getArtistReservation(artistId: artistID) - + getArtistProfile(artistID) + getArtistReservationData(artistID) } - - //MARK: - setUI() - private func setUI(){ - artistReservationStatusTableView.backgroundColor = .white - if(todayCount == 0){ - firstArtistResLabel.text = "포트폴리오 관리하러 가기" - firstArtistResBtnLabel.text = ">" - firstArtistResTimeLabel.text = nil - secondArtistHomeProfileStatusView.isHidden = true - secondArtistResBtn.isHidden = true - }else if(todayCount == 1){ - firstArtistResBtnLabel.text = "예약" - firstArtistResLabel.text = reservationData[showReservationData[0]].makeupName - firstArtistResTimeLabel.text = convertTimeString(reservationData[showReservationData[0]].reservationDayOfWeekAndTime.values.first!) - secondArtistHomeProfileStatusView.isHidden = true - secondArtistResBtn.isHidden = true - }else{ - firstArtistResLabel.text = reservationData[showReservationData[0]].makeupName - firstArtistResTimeLabel.text = convertTimeString(reservationData[showReservationData[0]].reservationDayOfWeekAndTime.values.first!) - secondArtistResLabel.text = reservationData[showReservationData[1]].makeupName - secondArtistResTimeLabel.text = convertTimeString(reservationData[showReservationData[1]].reservationDayOfWeekAndTime.values.first!) + //MARK: UI Setting functions + private func profileUISet(){ +// profileComplete = artistProfileData?.region != nil && artistProfileData?.shopLocation != nil && artistProfileData?.specialization != nil + // 프로필 완성하러 가기 뷰 + noProfileView.isHidden = profileComplete + if profileComplete{ + // 프로필 정보 라벨 + artistHomeProfileLabel.text = "안녕하세요,\n\(artistProfileData?.nickname) 님!\n오늘 예약 \("예약 건수")건이 있어요." + }else { + // 프로필 정보 라벨 + artistHomeProfileLabel.text = "안녕하세요,\n\(artistProfileData?.nickname) 님!" + // 프로필 완성하러 가기 버튼 + profileSettingButton.layer.cornerRadius = 10 + // 라벨 텍스트 + noProfileLabel.text = "프로필을 완성하고\n 모델과의 예약을 잡아보세요!" } - artistHomeProfileStatusView.layer.cornerRadius = 10 - secondArtistHomeProfileStatusView.layer.cornerRadius = 10 - - artistProfileImageView.layer.cornerRadius = artistProfileImageView.frame.height/2 - artistProfileImageView.clipsToBounds = true - } - //MARK: - tableViewConfigure() - private func tableViewConfigure(){ - artistReservationStatusTableView.delegate = self - artistReservationStatusTableView.dataSource = self - artistReservationStatusTableView.register(ArtistReservationStatusTableViewCell.nib(), forCellReuseIdentifier: ArtistReservationStatusTableViewCell.identifier) + private func reservationUISet(){ + todayReservationCollectionView.delegate = self + todayReservationCollectionView.dataSource = self + todayReservationCollectionView.register(ModelReservationConfirmViewCell.nib, forCellWithReuseIdentifier: ModelReservationConfirmViewCell.className) + todayReservationCollectionView.collectionViewLayout = self.createTodayReservationLayout() + reservationCollectionView.delegate = self + reservationCollectionView.dataSource = self + reservationCollectionView.register(ModelReservationConfirmViewCell.nib, forCellWithReuseIdentifier: ModelReservationConfirmViewCell.className) + reservationCollectionView.register(ReservationHeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReservationHeaderView.className) + reservationCollectionView.collectionViewLayout = self.createReservationLayout() } - //MARK: - @IBAction - @IBAction private func profileImageTapped(_ sender: UIButton) { - let vc = ModelViewArtistProfileViewController() - self.tabBarController?.tabBar.isHidden = true - navigationController?.pushViewController(vc, animated: true) + // 프로필 완성하러 가기 버튼 + @IBAction func showAllReservationButtonTapped(_ sender: UIButton) { + let nextVC = SetBusinessInfoViewController() + navigationController?.pushViewController(nextVC, animated: true) } - - @IBAction private func entireReservationBtnTapped(_ sender: UIButton) { - self.tabBarController?.selectedIndex = 1 + @IBAction func notificationButtonTapped(_ sender: UIButton) { + // let nextVC = NotificationViewController() + // navigationController?.pushViewController(nextVC, animated: true) } - @objc private func reservationManagedBtnTapped(_ sender: UIButton){ - let vc = SingleReservationManageViewController() - let selectedIdx = sender.tag - vc.reservationData = reservationData[selectedIdx] - vc.isToday = false - vc.reservationTimeString = convertTimeString(vc.reservationData.reservationDayOfWeekAndTime.values.first!) - vc.reservationDateString = formatDateString(op: 3,vc.reservationData.reservationDate) - self.tabBarController?.tabBar.isHidden = true - navigationController?.pushViewController(vc, animated: true) +} + +extension ArtistHomeViewController{ + func dateString(from date: Date) -> String { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy. MM. dd E" + dateFormatter.locale = Locale(identifier: "ko_KR") + return dateFormatter.string(from: date) } - @IBAction func firstTodayResBtnDidTap(_ sender: UIButton) { - if(todayCount != 0) { - let vc = SingleReservationManageViewController() - vc.reservationData = reservationData[self.showReservationData[0]] - vc.isToday = true - vc.reservationTimeString = convertTimeString(vc.reservationData.reservationDayOfWeekAndTime.values.first!) - vc.reservationDateString = formatDateString(op: 3,vc.reservationData.reservationDate) - self.tabBarController?.tabBar.isHidden = true - navigationController?.pushViewController(vc, animated: true) - }else{ - let vc = SingleReservationManageViewController() - self.tabBarController?.tabBar.isHidden = true - navigationController?.pushViewController(vc, animated: true) - } + private func dateFromString(_ dateString: String) -> Date? { + let formatter = ISO8601DateFormatter() + formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] + return formatter.date(from: dateString) } - @IBAction func secondTodayResBtnDidTap(_ sender: UIButton) { - let vc = SingleReservationManageViewController() - vc.reservationData = reservationData[self.showReservationData[1]] - vc.isToday = true - vc.reservationTimeString = convertTimeString(vc.reservationData.reservationDayOfWeekAndTime.values.first!) - vc.reservationDateString = formatDateString(op: 3,vc.reservationData.reservationDate) - self.tabBarController?.tabBar.isHidden = true - navigationController?.pushViewController(vc, animated: true) + + private func isToday(_ date: Date?) -> Bool { + guard let date = date else { return false } + return Calendar.current.isDateInToday(date) } - //MARK: - distinguishDate() - private func distinguishDate(reservationData: [ReservationData]){ - for i in 0.. Int(koreanTime)!{ - // afterTomorrow - reservationStatusData.append(1) - if(fromTomorrowCount<2){ - showReservationData[fromTomorrowCount+2] = i - } - fromTomorrowCount += 1 - }else { - // past - reservationStatusData.append(-1) - } + let dateString = self.dateString(from: date) + if var reservations = groupedReservations[dateString] { + reservations.append(reservation) + groupedReservations[dateString] = reservations + } else { + groupedReservations[dateString] = [reservation] } - } else { + default: + break } - } } - //MARK: - 날짜 형식 변환 - private func formatDateString(op: Int,_ dateString: String) -> String? { - let dateFormatter = DateFormatter() - dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" // 입력된 날짜의 형식에 맞게 설정 - - if let date = dateFormatter.date(from: dateString) { - // 원하는 형식으로 날짜 문자열을 변환 - let koreanTimeZone = TimeZone(identifier: "Asia/Seoul")! - let dateFormatter = DateFormatter() - dateFormatter.timeZone = koreanTimeZone - if op==1 { - dateFormatter.dateFormat = "yyyy. MM. dd EEE" - }else if op==2{ - dateFormatter.dateFormat = "yyyy. MM. dd EEEE" - }else{ - dateFormatter.dateFormat = "M월 d일 EEEE" + } + +} + +//MARK: UICollectionViewDelegate +extension ArtistHomeViewController: UICollectionViewDelegate{ + //TODO: 화면 전환 + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + if collectionView == todayReservationCollectionView{ + let nextVC = SingleReservationManageViewController(reservationId: todayReservationData[indexPath.row].reservationId) + navigationController?.pushViewController(nextVC, animated: true) + }else { + let sortedKeys = groupedReservations.keys.sorted() + let dateKey = sortedKeys[indexPath.section] + if let reservation = groupedReservations[dateKey]?[indexPath.row] { + let nextVC = SingleReservationManageViewController(reservationId: reservation.reservationId) + navigationController?.pushViewController(nextVC, animated: true) } - dateFormatter.locale = Locale(identifier: "ko_KR") - return dateFormatter.string(from: date) - } else { - return nil } } - //MARK: - 시간 형식 변환 - private func convertTimeString(_ input: String) -> String { - // 문자열의 처음의 "_"를 ":"로 대체하여 반환 - var result = input - if let firstUnderscoreIndex = input.firstIndex(of: "_") { - result.replaceSubrange(firstUnderscoreIndex...firstUnderscoreIndex, with: "") - } - return result.replacingOccurrences(of: "_", with: ":") +} + +//MARK: UICollectionViewDelegate +extension ArtistHomeViewController: UICollectionViewDelegateFlowLayout{ + // todayReservationCollectionView Paging 구현 + private func createTodayReservationsSection(using environment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection { + let width = environment.container.effectiveContentSize.width - 48 + + let itemSize = NSCollectionLayoutSize( + widthDimension: .absolute(width), + heightDimension: .absolute(142) + ) + let item = NSCollectionLayoutItem(layoutSize: itemSize) + + let groupSize = NSCollectionLayoutSize( + widthDimension: .absolute(width), + heightDimension: .absolute(142) + ) + let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) + + let section = NSCollectionLayoutSection(group: group) + section.interGroupSpacing = 24 + section.orthogonalScrollingBehavior = .groupPaging + section.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 24, bottom: 0, trailing: 24) + + return section + } + private func createTodayReservationLayout() -> UICollectionViewCompositionalLayout { + let config = UICollectionViewCompositionalLayoutConfiguration() + config.interSectionSpacing = 30 + return UICollectionViewCompositionalLayout(sectionProvider: { [weak self] (sectionIndex, layoutEnvironment) -> NSCollectionLayoutSection? in + return self?.createTodayReservationsSection(using: layoutEnvironment) + }, configuration: config) + } + private func createReservationsSection(using environment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection { + let width = environment.container.effectiveContentSize.width + + let itemSize = NSCollectionLayoutSize( + widthDimension: .absolute(width), + heightDimension: .absolute(142) + ) + let item = NSCollectionLayoutItem(layoutSize: itemSize) + + let groupSize = NSCollectionLayoutSize( + widthDimension: .absolute(width), + heightDimension: .estimated(142) + ) + let group = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [item]) + + let section = NSCollectionLayoutSection(group: group) + section.interGroupSpacing = 12 + section.contentInsets = NSDirectionalEdgeInsets(top: 12, leading: 0, bottom: 0, trailing: 0) + + let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .absolute(19)) + let header = NSCollectionLayoutBoundarySupplementaryItem(layoutSize: headerSize, elementKind: UICollectionView.elementKindSectionHeader, alignment: .top) + section.boundarySupplementaryItems = [header] + + return section } + private func createReservationLayout() -> UICollectionViewCompositionalLayout { + let config = UICollectionViewCompositionalLayoutConfiguration() + config.interSectionSpacing = 12 + return UICollectionViewCompositionalLayout(sectionProvider: { [weak self] (sectionIndex, layoutEnvironment) -> NSCollectionLayoutSection? in + return self?.createReservationsSection(using: layoutEnvironment) + }, configuration: config) + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { + return CGSize(width: collectionView.bounds.width, height: 19) + } } -// MARK: - UITableViewDataSource -extension ArtistHomeViewController : UITableViewDataSource { - func tableView( - _ tableView: UITableView, - numberOfRowsInSection section: Int - ) -> Int { - if let reservationData = reservationData { - fromTomorrowCount = 0 - showDataCount = 0 - for i in 0.. Int { + // 날짜별로 묶은 데이터.count + switch collectionView{ + case todayReservationCollectionView: + return 1 + case reservationCollectionView: + return groupedReservations.keys.count + default: + return 0 + } + } + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + switch collectionView{ + case todayReservationCollectionView: + return todayReservationData.count + case reservationCollectionView: + let dateKey = Array(groupedReservations.keys)[section] + return groupedReservations[dateKey]?.count ?? 0 + default: return 0 } - } - func tableView( - _ tableView: UITableView, - cellForRowAt indexPath: IndexPath - ) -> UITableViewCell { - // 셀 교체 필요 - guard let resCell = artistReservationStatusTableView.dequeueReusableCell(withIdentifier: ArtistReservationStatusTableViewCell.identifier, for: indexPath) as? ArtistReservationStatusTableViewCell else { return UITableViewCell() } - resCell.makeUpNameLabel.text = reservationData[indexPath.row].makeupName - resCell.modelNameLabel.text = reservationData[indexPath.row].modelNickName - resCell.reservationDateLabel.text = formatDateString(op:1, reservationData[indexPath.row].reservationDate) - resCell.reservationTimeLabel.text = convertTimeString(reservationData[indexPath.row].reservationDayOfWeekAndTime.values.first!) - resCell.reservationPlaceLabel.text = reservationData[indexPath.row].shopLocation - resCell.reservationPriceLabel.text = "\(String(reservationData[indexPath.row].price))원" - // 버튼 태그로 index 전달 - resCell.reservationManageBtn.tag = indexPath.row - resCell.reservationManageBtn.addTarget( - self, - action: #selector(reservationManagedBtnTapped), - for: .touchUpInside - ) - return resCell + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + switch collectionView{ + case todayReservationCollectionView: + guard let todayCell = todayReservationCollectionView.dequeueReusableCell(withReuseIdentifier: ModelReservationConfirmViewCell.className, for: indexPath) as? ModelReservationConfirmViewCell else { + return UICollectionViewCell() + } + todayCell.configure(with: todayReservationData[indexPath.row]) + todayCell.backgroundColor = .gray400 + return todayCell + case reservationCollectionView: + guard let cell = reservationCollectionView.dequeueReusableCell(withReuseIdentifier: ModelReservationConfirmViewCell.className, for: indexPath) as? ModelReservationConfirmViewCell else { + return UICollectionViewCell() + } + let sortedKeys = groupedReservations.keys.sorted() + let dateKey = sortedKeys[indexPath.section] + if let reservation = groupedReservations[dateKey]?[indexPath.row] { + cell.configure(with: reservation) + cell.contentView.backgroundColor = .gray300 + cell.modelReservationLabel.text = "예약 대기 중" + cell.modelReservationLabel.textColor = .black + cell.modelReservationPriceLabel.textColor = .black + cell.modelReservationArtistNameLabel.textColor = .black + cell.modelReservationMakeupNameLabel.textColor = .black + cell.modelReservationLocationLabel.textColor = .black + } + return cell + default: + return UICollectionViewCell() + } } -} -// MARK: - UITableViewDelegate -extension ArtistHomeViewController : UITableViewDelegate { - func tableView( - _ tableView: UITableView, - heightForRowAt indexPath: IndexPath - ) -> CGFloat { - if reservationStatusData[indexPath.row] == 1{ - return CGFloat(192) - }else { - return CGFloat(0) + func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { + if kind == UICollectionView.elementKindSectionHeader { + guard let header = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReservationHeaderView.className, for: indexPath) as? ReservationHeaderView else { + return UICollectionReusableView() + } + let dateKey = Array(groupedReservations.keys)[indexPath.section] + header.configure(with: dateKey) + return header + } else { + return UICollectionReusableView() } } + } -//MARK: - API 호출 -extension ArtistHomeViewController { +//MARK: API 호출 +extension ArtistHomeViewController{ + private func getArtistID() -> Int{ + return KeyChainManager.loadMemberID() + } - func getArtistProfile(userId: Int){ - MyPageManager.shared.getMyPageProfile(userId: userId) { [weak self] result in - guard let self = self else { return } - switch result { - case .success(let profile): - - print("Success: \(profile)") - print("message: "+profile.message) - self.artistProfileData? = profile.data! - - guard - let data = profile.data, - let nickName = data.nickname - else { return } - - if nickName.count > 6 { - self.artistHomeProfileLabel.text = "안녕하세요,"+"\n"+"\(nickName)님!"+"\n"+"내일 예약 \(String(self.tomorrowCount))건이 있어요." - }else{ - print("nicknamecomplete") - artistHomeProfileLabel.text = "안녕하세요, \(nickName)님!"+"\n"+"내일 예약 \(String(self.tomorrowCount))건이 있어요." - } - if let profileImg = data.profileImg { - FirebaseStorageManager.downloadImage( - urlString: profileImg - ) { [weak self] image in - guard let image = image else { return } // 성공적으로 업로드 했으면 이미지가 nil 값이 아님 - //이미지를 가지고 할 작업 처리 ex) 이미지 뷰에 다운 받은 이미지를 넣음 - print("Imagecomplete") - self?.artistProfileImageView.image = image - } + private func getArtistProfile(_ userId: Int){ + ArtistProfileInfoManager.shared.getArtistProfileInfo(userId: userId) { result in + DispatchQueue.main.async { + switch result{ + case .success(let response): + self.artistProfileData = response.data + self.profileUISet() + case .failure(let error): + print(error.localizedDescription) } - case .failure(let error): - print("Failure: \(error)") } } } - - private func getArtistReservation(artistId: Int){ - let getArtistReservation = ReservationManager.shared - getArtistReservation.getArtistReservation(artistId: artistId) { result in - switch result { - case .success(let response) : - self.reservationData = response.data - self.distinguishDate(reservationData: self.reservationData) - self.artistReservationStatusTableView.reloadData() - self.setUI() - case .failure(let error): - print(error.localizedDescription) + private func getArtistReservationData(_ artistId: Int){ + ReservationManager.shared.getArtistReservation(artistId: artistId) { result in + DispatchQueue.main.async { + switch result { + case .success(let response): + if let reservationData = response.data{ + self.filterReservations(reservationData: reservationData) + self.reservationUISet() + } + case .failure(let error): + print(error.localizedDescription) + } } } } + } diff --git a/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ArtistHomeViewController.xib b/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ArtistHomeViewController.xib index fc7bf4f..0a950c0 100644 --- a/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ArtistHomeViewController.xib +++ b/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ArtistHomeViewController.xib @@ -4,11 +4,14 @@ - + + + Pretendard-Regular + Pretendard-SemiBold @@ -17,16 +20,12 @@ - - - - - - - - - + + + + + @@ -35,92 +34,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -157,96 +103,122 @@ + - + - + + - - - + + + - - + + - - + - - - - - - + + + + + + - + - - + - - - + + + - - + + - - - + + + diff --git a/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ReservationDateHeader/ReservationHeaderView.swift b/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ReservationDateHeader/ReservationHeaderView.swift new file mode 100644 index 0000000..7766a3f --- /dev/null +++ b/MEME/MEME/Artist/ArtistHome/ArtistHomeView/ReservationDateHeader/ReservationHeaderView.swift @@ -0,0 +1,32 @@ +import UIKit +import SnapKit + +class ReservationHeaderView: UICollectionReusableView { + private let dateLabel: UILabel = { + let label = UILabel() + label.textColor = .black + label.font = .pretendard(to: .semiBold, size: 16) + return label + }() + + override init(frame: CGRect) { + super.init(frame: frame) + setUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func setUI() { + addSubview(dateLabel) + dateLabel.snp.makeConstraints { make in + make.leading.equalToSuperview() + make.centerY.equalToSuperview() + } + } + + func configure(with dateString: String) { + dateLabel.text = dateString + } +} diff --git a/MEME/MEME/Artist/ManagementReservation/ ManagementReservationsView/ManagementReservationsViewController.swift b/MEME/MEME/Artist/ManagementReservation/ ManagementReservationsView/ManagementReservationsViewController.swift index 0de36bd..a051eef 100644 --- a/MEME/MEME/Artist/ManagementReservation/ ManagementReservationsView/ManagementReservationsViewController.swift +++ b/MEME/MEME/Artist/ManagementReservation/ ManagementReservationsView/ManagementReservationsViewController.swift @@ -304,15 +304,15 @@ extension ManagementReservationsViewController: UICollectionViewDelegateFlowLayo navigationController?.pushViewController(vc, animated: true) }else{ if reservationData.status == "EXPECTED" { - let vc = SingleReservationManageViewController() - if formatDateString(op: 1, reservationData.reservationDate) == formatDateString(op: 1, DateFormatter().string(from: Date())) { - // 오늘 - vc.isToday = true - } - vc.reservationData = reservationData - vc.reservationTimeString = convertTimeString(vc.reservationData.reservationDayOfWeekAndTime.values.first!) - vc.reservationDateString = formatDateString(op: 3,vc.reservationData.reservationDate) - navigationController?.pushViewController(vc, animated: true) +// let vc = SingleReservationManageViewController() +// if formatDateString(op: 1, reservationData.reservationDate) == formatDateString(op: 1, DateFormatter().string(from: Date())) { +// // 오늘 +// vc.isToday = true +// } +// vc.reservationData = reservationData +// vc.reservationTimeString = convertTimeString(vc.reservationData.reservationDayOfWeekAndTime.values.first!) +// vc.reservationDateString = formatDateString(op: 3,vc.reservationData.reservationDate) +// navigationController?.pushViewController(vc, animated: true) } } default: diff --git a/MEME/MEME/Artist/SingleReservationManageView/SingleReservationManageViewController.swift b/MEME/MEME/Artist/SingleReservationManageView/SingleReservationManageViewController.swift index 5a6e600..267df61 100644 --- a/MEME/MEME/Artist/SingleReservationManageView/SingleReservationManageViewController.swift +++ b/MEME/MEME/Artist/SingleReservationManageView/SingleReservationManageViewController.swift @@ -25,17 +25,27 @@ class SingleReservationManageViewController: UIViewController { @IBOutlet weak var reservationDateLabel: UILabel! @IBOutlet weak var reservationTimeLabel: UILabel! @IBOutlet weak var reservationPlaceLabel: UILabel! + @IBOutlet weak var reservationPriceLabel: UILabel! + @IBOutlet weak var reservationEmailLabel: UILabel! + @IBOutlet weak var modelInfoLabel: UILabel! //MARK: - Properties - var isToday: Bool = false - var reservationData: ReservationData! - var reservationDateString: String! - var reservationTimeString: String! + private var reservationData: ReservationDetailData! + private var reservationId: Int! //MARK: - ViewController 생명 주기 override func viewDidLoad() { super.viewDidLoad() setUI() + configure() + } + required init(reservationId: Int) { + self.reservationId = reservationId + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") } //MARK: - setUI() @@ -44,6 +54,7 @@ class SingleReservationManageViewController: UIViewController { cancelBarView.layer.cornerRadius=10 confirmReservationBarView.layer.cornerRadius=10 + modelInfoLabel.text = KeyChainManager.read(forkey: .role) == RoleType.ARTIST.rawValue ? "모델 정보" : "나의 정보" modelInfoFrameView.layer.borderColor = UIColor.mainBold.cgColor modelInfoFrameView.layer.borderWidth = 1.3 @@ -55,16 +66,12 @@ class SingleReservationManageViewController: UIViewController { modelInfoView.layer.masksToBounds = false modelInfoFrameView.layer.cornerRadius=10 - if isToday { - cancelBarView.backgroundColor = .gray500 - cancelBarLabel.text = "당일 예약은 취소가 불가능합니다" - cancelBarButton.isHidden = true - }else{ - cancelBarView.backgroundColor = .systemRed - cancelBarLabel.text = "예약 취소하기" - cancelBarButton.isHidden = false - } } + + func configure(){ + //TODO: API Response DTO 수정 후 재작성 + } + @IBAction private func reservationCancelBtnDidTap(_ sender: UIButton) { let alert = UIAlertController( title: "예약 취소하기", @@ -93,6 +100,20 @@ class SingleReservationManageViewController: UIViewController { } } +extension SingleReservationManageViewController{ + func dateString(from date: Date) -> String { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "MM월 dd일 (E)" + dateFormatter.locale = Locale(identifier: "ko_KR") + return dateFormatter.string(from: date) + } + private func dateFromString(_ dateString: String) -> Date? { + let formatter = ISO8601DateFormatter() + formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] + return formatter.date(from: dateString) + } +} + //MARK: - API 호출 extension SingleReservationManageViewController { func patchReservation(reservationId: Int) { @@ -113,6 +134,10 @@ extension SingleReservationManageViewController { //TODO: - 예약 확정 API 호출 func confirmReservation(){ + } + //TODO: - 예약 상세 조회 API 호출 + func getReservationDetail(){ + } } diff --git a/MEME/MEME/Artist/SingleReservationManageView/SingleReservationManageViewController.xib b/MEME/MEME/Artist/SingleReservationManageView/SingleReservationManageViewController.xib index 8f22b27..90340c1 100644 --- a/MEME/MEME/Artist/SingleReservationManageView/SingleReservationManageViewController.xib +++ b/MEME/MEME/Artist/SingleReservationManageView/SingleReservationManageViewController.xib @@ -31,12 +31,15 @@ + + + @@ -432,7 +435,7 @@ - + @@ -499,10 +502,10 @@ - - + + diff --git a/MEME/MEME/Core/Model/ReservationState.swift b/MEME/MEME/Core/Model/ReservationState.swift index 6004882..c4d4dfb 100644 --- a/MEME/MEME/Core/Model/ReservationState.swift +++ b/MEME/MEME/Core/Model/ReservationState.swift @@ -9,6 +9,7 @@ import Foundation enum ReservationState: String { case EXPECTED + case PENDING case COMPLETE case CANCEL } diff --git a/MEME/MEME/Model/ModelHomeView/View/ModelReservationCell/ModelReservationConfirmCell/ModelReservationConfirmViewCell.xib b/MEME/MEME/Model/ModelHomeView/View/ModelReservationCell/ModelReservationConfirmCell/ModelReservationConfirmViewCell.xib index c081e84..441832b 100644 --- a/MEME/MEME/Model/ModelHomeView/View/ModelReservationCell/ModelReservationConfirmCell/ModelReservationConfirmViewCell.xib +++ b/MEME/MEME/Model/ModelHomeView/View/ModelReservationCell/ModelReservationConfirmCell/ModelReservationConfirmViewCell.xib @@ -29,54 +29,59 @@ - + + + + + + + - - +