diff --git a/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/DetailViewController.swift b/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/DetailViewController.swift index 035bc36..0303dcf 100644 --- a/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/DetailViewController.swift +++ b/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/DetailViewController.swift @@ -71,6 +71,8 @@ final class DetailViewController: UIViewController { private let productUnderlineView = UIView() private let deliveryUnderlineView = UIView() private let availableUnderlineView = UIView() + private let tabbarButtonUnderlineView = UIView() + private let tabbarButtonSelectedUnderlineView = UIView() private let productDetailUnderlineView = UIView() private let recommendUnderlineView = UIView() private let relatedUnderlineView = UIView() @@ -218,6 +220,21 @@ final class DetailViewController: UIViewController { $0.textColor = 0x2f2f2f.color } + private let productDetailLabel = UILabel().then { + $0.font = .tittleSubhead1 + $0.textColor = 0x8e8e8e.color + } + + private let reviewLabel = UILabel().then { + $0.font = .tittleSubhead1 + $0.textColor = 0x8e8e8e.color } + + private let qAndALabel = UILabel().then { + $0.font = .tittleSubhead1 + $0.textColor = 0x8e8e8e.color + } + + private let rateImageView = UIImageView(image: UIImage(named: "starRate")) private let singleStarImageView = UIImageView(image: UIImage(named: "star14X14")) private let productImageView = UIImageView(image: UIImage(named: "detailView")) @@ -227,15 +244,21 @@ final class DetailViewController: UIViewController { //MARK: - Variables var isSelected = true - var tagList = ["립밤", "핸드크림", "틴트", "쿠션", "마스크팩"] + var tagList = [ + "립밤", + "핸드크림", + "틴트", + "쿠션", + "마스크팩" + ] - var recommendList:[recommendModel] = [ + var recommendList: [recommendModel] = [ recommendModel(name: "아이소이", description:"엔젤 아쿠아 수분 진정 크림 150ml모이스춰닥터 장/수/진 수분 앰플 기획" , productImage: "", price: "27,000"), recommendModel(name: "센카", description: "퍼펙트 휩 페이셜 위시 120g", productImage: "", price: "8,500"), recommendModel(name: "라운드랩", description: "1025 독도 앰플 45g", productImage: "", price: "28,000") ] - var relateList:[relateModel] = [ + var relateList: [relateModel] = [ relateModel(name: "피지오겔", description: "[한정기획] AI크림 100ml 기획", productImage: "", price: "27,000", discountRate: "23%"), relateModel(name: "에스트라", description: "아토베리어 365 하이드로 에센스 200ml ", productImage: "", price: "21,600", discountRate: "32%"), relateModel(name: "아벤느", description: "시칼파트플러스 크림 1+1 기획", productImage: "", price: "19,310", discountRate: "5%") @@ -345,6 +368,14 @@ extension DetailViewController { stockLabel ) + tabbarButtonContainerView.addSubviews( + productDetailLabel, + reviewLabel, + qAndALabel, + tabbarButtonUnderlineView, + tabbarButtonSelectedUnderlineView + ) + productDetailContainerView.addSubview(productImageView) recommendContainerView.addSubviews( @@ -650,6 +681,35 @@ extension DetailViewController { $0.trailing.equalToSuperview() } + //tabbarButtonContainerView + productDetailLabel.snp.makeConstraints { + $0.top.equalToSuperview().offset(20) + $0.leading.equalToSuperview().offset(15) + } + + reviewLabel.snp.makeConstraints { + $0.top.equalTo(productDetailLabel) + $0.centerX.equalToSuperview() + } + + qAndALabel.snp.makeConstraints { + $0.top.equalTo(productDetailLabel) + $0.trailing.equalToSuperview().offset(-14.9) + } + + tabbarButtonUnderlineView.snp.makeConstraints { + $0.top.equalTo(productDetailLabel.snp.bottom).offset(12) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(1) + } + + tabbarButtonSelectedUnderlineView.snp.makeConstraints { + $0.bottom.equalTo(tabbarButtonUnderlineView.snp.top) + $0.leading.trailing.equalTo(productDetailLabel) + $0.height.equalTo(2) + + } + productImageView.snp.makeConstraints { $0.edges.equalToSuperview() } @@ -738,6 +798,9 @@ extension DetailViewController { self.relateLabel.text = "이 상품은 어떠세요?" self.recommendLabel.text = "방금 본 것과 유사한 상품이에요" self.purchaseLabel.text = "구매하기" + self.productDetailLabel.text = "제품상세" + self.reviewLabel.text = "리뷰" + self.qAndALabel.text = "Q&A" } private func viewConfig() { @@ -750,6 +813,8 @@ extension DetailViewController { availableGreenUnderlineView.backgroundColor = 0xa4d232.color separatelineView.backgroundColor = 0xebebeb.color purchaseView.backgroundColor = 0xa4d232.color + tabbarButtonUnderlineView.backgroundColor = 0xebebeb.color + tabbarButtonSelectedUnderlineView.backgroundColor = 0x2f2f2f.color } private func configDelegate() { diff --git a/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/EmptyViewController.swift b/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/EmptyViewController.swift new file mode 100644 index 0000000..5b1462b --- /dev/null +++ b/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/EmptyViewController.swift @@ -0,0 +1,217 @@ +//// +//// EmptyViewController.swift +//// Oliveyoung-iOS +//// +//// Created by Joon Baek on 2022/11/24. +//// +// +//import UIKit +// +//import Then +//import SnapKit +//import SwiftyColor +// +////MARK: - EmptyViewController +//final class EmptyViewController: UIViewController { +// +// //MARK: - Lazy Components +// private lazy var scrollView = UIScrollView() +// +// private lazy var relateCollectionView: UICollectionView = { +// let layout = UICollectionViewFlowLayout() +// layout.scrollDirection = .vertical +// +// let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) +// collectionView.backgroundColor = .clear +// collectionView.translatesAutoresizingMaskIntoConstraints = false +// collectionView.isScrollEnabled = true +// collectionView.showsVerticalScrollIndicator = false +// return collectionView +// }() +// +// //MARK: - UI Components +// +// private let topContainerView = UIView() +// private let emptyContainerView = UIView() +// private let emptyUnderlineView = UIView() +// private let recommendContainerView = UIView() +// +// private let textField = UITextField().then { +// $0.borderColor = 0xa4d232.color +// $0.cornerRadius = 19 +// } +// +// private let backButton = UIButton().then { +// $0.setImage(UIImage(named: "back"), for: .normal) +// } +// +// private let searchButton = UIButton().then { +// $0.setImage(UIImage(named: "searchIcon24X24"), for: .normal) +// } +// +// private let errorImageView = UIImageView().then { +// $0.image = UIImage(named: "error") +// } +// +// private let errorLabel = UILabel().then { +// $0.font = .tittleHeadline +// $0.textColor = 0x2f2f2f.color +// $0.text = "검색 결과가 없습니다." +// } +// +// private let relateLabel = UILabel().then { +// $0.font = .tittleSubhead1 +// $0.textColor = 0x2f2f2f.color +// $0.text = "이 검색어는 어떠세요?" +// } +// +// //MARK: - Variables +// var recommendList: [searchModel] = [ +// searchModel(name: "립밤"), +// searchModel(name: "핸드크림"), +// searchModel(name: "틴트"), +// searchModel(name: "쿠션"), +// searchModel(name: "마스크팩"), +// searchModel(name: "향수"), +// searchModel(name: "립밤"), +// searchModel(name: "핸드크림"), +// searchModel(name: "틴트"), +// searchModel(name: "쿠션"), +// searchModel(name: "마스크팩"), +// searchModel(name: "향수") +// ] +// +// //MARK: - Life Cycles +// override func viewDidLoad() { +// super.viewDidLoad() +// layout() +// } +//} +// +////MARK: - Extensions +//extension EmptyViewController { +// +// //MARK: - Layout Helpers +// private func layout() { +// view.addSubviews(topContainerView, scrollView) +// +// scrollView.addSubviews( +// emptyContainerView, +// emptyUnderlineView, +// recommendContainerView +// ) +// +// topContainerView.addSubviews( +// backButton, +// textField, +// searchButton +// ) +// +// textField.addSubview(searchButton) +// +// emptyContainerView.addSubviews( +// errorImageView, +// errorLabel +// ) +// +// recommendContainerView.addSubviews( +// relateLabel, +// relateCollectionView +// ) +// +// topContainerView.snp.makeConstraints { +// $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) +// $0.height.equalTo(36) +// } +// +// scrollView.snp.makeConstraints { +// $0.top.equalTo(topContainerView.snp.bottom) +// $0.leading.trailing.bottom.equalTo(view.safeAreaLayoutGuide) +// } +// +// //containerViews +// emptyContainerView.snp.makeConstraints { +// $0.top.equalToSuperview() +// $0.leading.trailing.equalToSuperview() +// $0.height.equalTo(<#T##other: ConstraintRelatableTarget##ConstraintRelatableTarget#>) +// } +// +// emptyUnderlineView.snp.makeConstraints { +// +// } +// +// recommendContainerView.snp.makeConstraints { +// +// } +// +// //topContainerView +// backButton.snp.makeConstraints { +// $0.centerY.equalToSuperview() +// $0.leading.equalToSuperview().offset(28) +// $0.width.equalTo(18) +// $0.height.equalTo(16) +// } +// +// textField.snp.makeConstraints { +// $0.centerY.equalToSuperview() +// $0.leading.equalTo(backButton.snp.trailing).offset(14) +// $0.trailing.equalToSuperview().offset(28) +// $0.height.equalToSuperview() +// } +// +// searchButton.snp.makeConstraints { +// $0.centerY.equalToSuperview() +// $0.trailing.equalToSuperview().offset(-12) +// $0.width.height.equalTo(20) +// } +// +// errorImageView.snp.makeConstraints { +// $0.top.equalToSuperview().offset(200.5) +// $0.centerX.equalToSuperview() +// $0.width.height.equalTo(84.6) +// } +// +// errorLabel.snp.makeConstraints { +// $0.top.equalTo(errorImageView.snp.bottom).offset(35.1) +// $0.centerX.equalToSuperview() +// } +// +// +// } +// +// //MARK: - General Helpers +// +//} +// +////MARK: - UICollectionViewDelegateFlowLayout +//extension EmptyViewController: UICollectionViewDelegateFlowLayout { +// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { +// <#code#> +// } +// +// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { +// <#code#> +// } +// +// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { +// <#code#> +// } +// +// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { +// <#code#> +// } +// +//} +// +////MARK: - +//extension EmptyViewController: UICollectionViewDataSource{ +// func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { +// <#code#> +// } +// +// func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { +// <#code#> +// } +// +// +//} diff --git a/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/ProductModel.swift b/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/ProductModel.swift index 1c5c975..73dbbb2 100644 --- a/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/ProductModel.swift +++ b/Oliveyoung-iOS/Oliveyoung-iOS/Source/Presentation/Detail/ProductModel.swift @@ -21,3 +21,7 @@ struct relateModel { var price: String var discountRate: String } + +struct searchModel { + var name: String +}