Skip to content

Commit 548a114

Browse files
committed
✨[feat]: 상세 뷰 1 차 작업 구현 중 #22
1 parent 0aca744 commit 548a114

26 files changed

+1961
-1766
lines changed

MarketApp/MarketApp.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
7F39FAC0295342BD0041BF8B /* NanumSquareNeo-dEb.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7F39FAB0295341A50041BF8B /* NanumSquareNeo-dEb.ttf */; };
6363
7F39FAC1295342BD0041BF8B /* NanumSquareNeo-eHv.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7F39FAB1295341A50041BF8B /* NanumSquareNeo-eHv.ttf */; };
6464
7F3E17C5299C6DF80095BB2F /* InfoViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F3E17C4299C6DF80095BB2F /* InfoViewModel.swift */; };
65+
7F40E26029C6F01800EC8AB6 /* ProductInfoImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F40E25F29C6F01800EC8AB6 /* ProductInfoImage.swift */; };
66+
7F40E26329C6F0C900EC8AB6 /* CommunityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F40E26229C6F0C900EC8AB6 /* CommunityView.swift */; };
6567
7F4189C029B2185D00965AB4 /* BannerImages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F4189BF29B2185D00965AB4 /* BannerImages.swift */; };
6668
7F4189C229B2375600965AB4 /* BrandType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F4189C129B2375600965AB4 /* BrandType.swift */; };
6769
7F4A041629B2F47C00D45CF4 /* SearchRowListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F4A041529B2F47C00D45CF4 /* SearchRowListView.swift */; };
@@ -192,6 +194,8 @@
192194
7F39FAB1295341A50041BF8B /* NanumSquareNeo-eHv.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NanumSquareNeo-eHv.ttf"; sourceTree = "<group>"; };
193195
7F39FAB2295341A50041BF8B /* NanumSquareNeo-cBd.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NanumSquareNeo-cBd.ttf"; sourceTree = "<group>"; };
194196
7F3E17C4299C6DF80095BB2F /* InfoViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoViewModel.swift; sourceTree = "<group>"; };
197+
7F40E25F29C6F01800EC8AB6 /* ProductInfoImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductInfoImage.swift; sourceTree = "<group>"; };
198+
7F40E26229C6F0C900EC8AB6 /* CommunityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityView.swift; sourceTree = "<group>"; };
195199
7F4189BF29B2185D00965AB4 /* BannerImages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BannerImages.swift; sourceTree = "<group>"; };
196200
7F4189C129B2375600965AB4 /* BrandType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrandType.swift; sourceTree = "<group>"; };
197201
7F4A041529B2F47C00D45CF4 /* SearchRowListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchRowListView.swift; sourceTree = "<group>"; };
@@ -506,6 +510,7 @@
506510
C9E3E7A5290823DB00914FE5 /* Favorite */,
507511
C9E3E7A32908239700914FE5 /* ProductList */,
508512
C9E3E7A4290823A200914FE5 /* ProductDetail */,
513+
7F40E26129C6F0AB00EC8AB6 /* Community */,
509514
);
510515
path = View;
511516
sourceTree = "<group>";
@@ -655,6 +660,14 @@
655660
path = FontAsset;
656661
sourceTree = "<group>";
657662
};
663+
7F40E26129C6F0AB00EC8AB6 /* Community */ = {
664+
isa = PBXGroup;
665+
children = (
666+
7F40E26229C6F0C900EC8AB6 /* CommunityView.swift */,
667+
);
668+
path = Community;
669+
sourceTree = "<group>";
670+
};
658671
7F4B961F298D1687006AAF48 /* ACarousel */ = {
659672
isa = PBXGroup;
660673
children = (
@@ -793,6 +806,7 @@
793806
7F3E17C4299C6DF80095BB2F /* InfoViewModel.swift */,
794807
EC451F6D290BBCD7008C88A7 /* InfoView.swift */,
795808
ECF5BE452914D01E0052655B /* ReviewView.swift */,
809+
7F40E25F29C6F01800EC8AB6 /* ProductInfoImage.swift */,
796810
);
797811
path = ProductDetail;
798812
sourceTree = "<group>";
@@ -1220,6 +1234,7 @@
12201234
7F0F165B296C4CBF00FB4C30 /* SignUPView.swift in Sources */,
12211235
7F4B9629298D17C3006AAF48 /* View+ReceiveTimer.swift in Sources */,
12221236
7F573DCD299F6F1B00A5652A /* WebView.swift in Sources */,
1237+
7F40E26029C6F01800EC8AB6 /* ProductInfoImage.swift in Sources */,
12231238
EC892ABB290820B800D02F99 /* FavoriteView.swift in Sources */,
12241239
7F0F1655296C456E00FB4C30 /* LoginItem.swift in Sources */,
12251240
7F4B9623298D16E9006AAF48 /* ACarouselAutoScroll.swift in Sources */,
@@ -1261,6 +1276,7 @@
12611276
EC892AA12908189600D02F99 /* MainTabView.swift in Sources */,
12621277
7F2F571D29BF534B00E2FFC2 /* ShoesDetailModel.swift in Sources */,
12631278
7F39FA8D2950922D0041BF8B /* ConfirmAlertView.swift in Sources */,
1279+
7F40E26329C6F0C900EC8AB6 /* CommunityView.swift in Sources */,
12641280
7F93C34F29856C3A00345AEC /* AffinityAppCheck.swift in Sources */,
12651281
7F204F0029B3974500D3D4FE /* WebViews.swift in Sources */,
12661282
7F2815F92990DB2600B2C481 /* ListArrowView.swift in Sources */,

MarketApp/MarketApp/Model/ShoesDetailModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import Foundation
99

1010
typealias ShoesDetailModel = [ShoesDetailData]
1111

12-
struct ShoesDetailData: Codable, Identifiable {
12+
struct ShoesDetailData: Codable, Identifiable, Hashable {
1313
let id = UUID()
1414
let shoesId: Int?
1515
let brandName, productName, transName, price: String?
16-
let productImg: String?
16+
let productImg: [String]
1717

1818
enum CodingKeys: String, CodingKey {
1919
case shoesId = "id"

MarketApp/MarketApp/Utill/Extensions/PreviewProvider.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class DevloperPreview {
1414
let signUPViewModel = SignUPViewModel()
1515
let shoesData = [ShoeData(shoesId: 1, brandName: "Nike", productName: "Nike Air Force 1 '07 Low White", transName: "나이키 에어포스 1 '07 로우 화이트", image: "https://kream-phinf.pstatic.net/MjAyMjA2MTVfMjYw/MDAxNjU1MjgzNjk2Mzk3.gh8n5rs7p-pWVqzIhNh7yj_KdyjLFBeJr9QbsDumoFEg.KdvPfvgBYmjm7MKKhcbIEQIP6FGeuof_GnmcDUgrvyAg.PNG/a_baa1ccea3726495badba419dfede63f9.png?type=m", price: "128,000"), ShoeData(shoesId: 1, brandName: "Nike", productName: "Nike Air Force 1 '07 Low White", transName: "나이키 에어포스 1 '07 로우 화이트", image: "https://kream-phinf.pstatic.net/MjAyMjA2MTVfMjYw/MDAxNjU1MjgzNjk2Mzk3.gh8n5rs7p-pWVqzIhNh7yj_KdyjLFBeJr9QbsDumoFEg.KdvPfvgBYmjm7MKKhcbIEQIP6FGeuof_GnmcDUgrvyAg.PNG/a_baa1ccea3726495badba419dfede63f9.png?type=m", price: "128,000"),]
1616
let shoesDatas = ShoeData(shoesId: 1, brandName: "Nike", productName: "Nike Air Force 1 '07 Low White", transName: "나이키 에어포스 1 '07 로우 화이트", image: "https://kream-phinf.pstatic.net/MjAyMjA2MTVfMjYw/MDAxNjU1MjgzNjk2Mzk3.gh8n5rs7p-pWVqzIhNh7yj_KdyjLFBeJr9QbsDumoFEg.KdvPfvgBYmjm7MKKhcbIEQIP6FGeuof_GnmcDUgrvyAg.PNG/a_baa1ccea3726495badba419dfede63f9.png?type=m", price: "128,000")
17+
18+
let shoesDetailData = [ShoesDetailData(shoesId: 2, brandName: "Nike", productName: "Nike Dunk Low Retro Grey Fog", transName: "나이키 덩크 로우 레트로 그레이 포그", price: "130,000", productImg: ["https://kream-phinf.pstatic.net/MjAyMTA5MDlfMTM2/MDAxNjMxMTY4NDgxNjYy.zbjY9wciksaYT7sUz-OdfVfMijT4zlN3ZrP1_FKTIkAg.q1tp-NTfS052i0hTqbYKf1mhtxZZBWEcEm9LUCfevhkg.PNG/a_bd87be02eddb460798690f5d082217c5.png?type=l", "https://kream-phinf.pstatic.net/MjAyMTA5MDlfMTE5/MDAxNjMxMTY4NDg0Mzk1.h6CHbDt3cSsoyGumXlzNmhTa8iNJvWcIzhzimNzNF2Ig.Gh0liKYzQEZ-r3l3gFAX0DBPT9bt2FuywdbiPK1-LJ0g.PNG/a_32465a09d3214e2e8cba85d1bc62ee04.png?type=l", "https://kream-phinf.pstatic.net/MjAyMTA5MDlfMTU5/MDAxNjMxMTY4NDg2Nzg3.Kf0RTLiVjQ2dxE8Z-ZgFPWDQGhJiQKt-LjVvrCo5NS4g.VPstVD7BiTciaEAwad02Z2i85fJvls4-zKUkaQHyElUg.PNG/a_dca56f9e768f4b028640d578f4703575.png?type=l"])]
1719
}
1820

1921
extension PreviewProvider {
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// CommunityView.swift
3+
// MarketApp
4+
//
5+
// Created by 서원지 on 2023/03/19.
6+
//
7+
8+
import SwiftUI
9+
10+
struct CommunityView: View {
11+
var nickName : String
12+
var time = Date()
13+
var comment : String
14+
15+
var body: some View {
16+
ZStack {
17+
Rectangle()
18+
.fill(.black)
19+
.frame(maxWidth: 360, minHeight: 60)
20+
.cornerRadius(20)
21+
22+
VStack(alignment: .leading) {
23+
HStack {
24+
Text("\(nickName)")
25+
.foregroundColor(.white) //커스텀컴포넌트로 변경예정
26+
Text("\(time, formatter: dateformat)")
27+
.foregroundColor(.gray)
28+
}
29+
Text("\(comment)")
30+
.foregroundColor(.white) //커스텀컴포넌트로 변경예정
31+
}
32+
}
33+
}
34+
}
35+
36+
struct CommunityView_Previews: PreviewProvider {
37+
static var previews: some View {
38+
CommunityView(nickName: "Zero", comment: "요즘 매종 키츠네 신발 유행인가요? 알려주세요 :)")
39+
}
40+
}

MarketApp/MarketApp/View/ProductDetail/InfoView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ import SwiftUI
99

1010
struct InfoView: View {
1111

12-
@State private var selectedPicker: tapInfo = .info
12+
@State private var selectedPicker: DetailTapInfo = .info
1313
@Namespace private var animation
1414

1515
var body: some View {
1616
VStack {
1717
animate()
18-
testView(tests: selectedPicker)
18+
ProductInfoImage(selectProductInfoTap: selectedPicker)
1919
}
2020
}
2121

2222
@ViewBuilder
2323
private func animate() -> some View {
2424
HStack {
25-
ForEach(tapInfo.allCases, id: \.self) { item in
25+
ForEach(DetailTapInfo.allCases, id: \.self) { item in
2626
VStack {
2727
Text(item.rawValue)
2828
.font(.title3)

MarketApp/MarketApp/View/ProductDetail/InfoViewModel.swift

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -14,61 +14,10 @@ let dateformat: DateFormatter = {
1414
return formatter
1515
}()
1616

17-
struct CommunityBlock : View {
18-
var nickName : String
19-
var time = Date()
20-
var comment : String
21-
22-
var body: some View {
23-
ZStack {
24-
Rectangle()
25-
.fill(.black)
26-
.frame(maxWidth: 360, minHeight: 60)
27-
.cornerRadius(20)
28-
29-
VStack(alignment: .leading) {
30-
HStack {
31-
Text("\(nickName)")
32-
.foregroundColor(.white) //커스텀컴포넌트로 변경예정
33-
Text("\(time, formatter: dateformat)")
34-
.foregroundColor(.gray)
35-
}
36-
Text("\(comment)")
37-
.foregroundColor(.white) //커스텀컴포넌트로 변경예정
38-
}
39-
}
40-
}
41-
}
4217

4318
//MARK : 상단탭바
44-
enum tapInfo : String, CaseIterable {
19+
enum DetailTapInfo : String, CaseIterable {
4520
case info = "상세정보"
4621
case community = "커뮤니티"
4722
}
4823

49-
struct testView : View {
50-
51-
var tests : tapInfo
52-
53-
var body: some View {
54-
ScrollView(.vertical, showsIndicators: false) {
55-
switch tests {
56-
case .info:
57-
ForEach(0..<5) { _ in
58-
Text("블랙컬러")
59-
.padding()
60-
Image("shoes")
61-
.resizable()
62-
.frame(maxWidth: 350, minHeight: 500)
63-
}
64-
case .community:
65-
ScrollView(showsIndicators: false) {
66-
ForEach(0..<7) { _ in
67-
CommunityBlock(nickName: "Zero",
68-
comment: "요즘 매종 키츠네 신발 유행인가요? 알려주세요 :)")
69-
}
70-
}
71-
}
72-
}
73-
}
74-
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// ProductInfoImage.swift
3+
// MarketApp
4+
//
5+
// Created by 서원지 on 2023/03/19.
6+
//
7+
8+
import SwiftUI
9+
10+
struct ProductInfoImage: View {
11+
var selectProductInfoTap : DetailTapInfo
12+
13+
var body: some View {
14+
ScrollView(.vertical, showsIndicators: false) {
15+
switch selectProductInfoTap {
16+
case .info:
17+
ForEach(0..<5) { _ in
18+
Text("블랙컬러")
19+
.padding()
20+
Image("shoes")
21+
.resizable()
22+
.frame(maxWidth: 350, minHeight: 500)
23+
}
24+
25+
case .community:
26+
ScrollView(showsIndicators: false) {
27+
ForEach(0..<7) { _ in
28+
CommunityView(nickName: "Zero",
29+
comment: "요즘 매종 키츠네 신발 유행인가요? 알려주세요 :)")
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
36+
37+
struct ProductInfoImage_Previews: PreviewProvider {
38+
static var previews: some View {
39+
ProductInfoImage(selectProductInfoTap: .info)
40+
}
41+
}

0 commit comments

Comments
 (0)