Skip to content

Commit

Permalink
Merge pull request #17 from APPSCHOOL1-REPO/221227-productDetail-jegyun
Browse files Browse the repository at this point in the history
[Add] 레포지토리 생성 이전 작업 추가 #4
  • Loading branch information
jeonghoonji authored Dec 27, 2022
2 parents 2ebd906 + 45a802a commit e1d418d
Show file tree
Hide file tree
Showing 15 changed files with 288 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */

22021FEF295AAEB800EFD5CF /* ProductDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22021FEE295AAEB800EFD5CF /* ProductDetailView.swift */; };
0456F63A295AD7EE002389F6 /* HomeMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0456F639295AD7EE002389F6 /* HomeMenuView.swift */; };
0456F63C295AD7F7002389F6 /* NotebookView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0456F63B295AD7F7002389F6 /* NotebookView.swift */; };
18ECD478295AB68700670B6F /* ShoppingBackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18ECD477295AB68700670B6F /* ShoppingBackView.swift */; };
Expand Down Expand Up @@ -42,6 +44,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */

22021FEE295AAEB800EFD5CF /* ProductDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailView.swift; sourceTree = "<group>"; };
0456F639295AD7EE002389F6 /* HomeMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeMenuView.swift; sourceTree = "<group>"; };
0456F63B295AD7F7002389F6 /* NotebookView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotebookView.swift; sourceTree = "<group>"; };
18ECD477295AB68700670B6F /* ShoppingBackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingBackView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -88,6 +92,13 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */

22021FED295AAE9C00EFD5CF /* FolderProductDetail */ = {
isa = PBXGroup;
children = (
22021FEE295AAEB800EFD5CF /* ProductDetailView.swift */,
);
path = FolderProductDetail;
0456F638295AD7C9002389F6 /* FolderHomeMenu */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -166,6 +177,7 @@
A77EE65F295A9A5100B6AA64 /* big-project-a-customer-ios */ = {
isa = PBXGroup;
children = (
22021FED295AAE9C00EFD5CF /* FolderProductDetail */,
A77EE660295A9A5100B6AA64 /* big_project_a_customer_iosApp.swift */,
A77EE662295A9A5100B6AA64 /* ContentView.swift */,
18ECD477295AB68700670B6F /* ShoppingBackView.swift */,
Expand Down Expand Up @@ -335,8 +347,11 @@
9556A45C295AC31F00FD8E1F /* MyPageInfoEditChecking.swift in Sources */,
A7421064295B117A005AEC9C /* MyReview.swift in Sources */,
A77EE661295A9A5100B6AA64 /* big_project_a_customer_iosApp.swift in Sources */,
22021FEF295AAEB800EFD5CF /* ProductDetailView.swift in Sources */,

0456F63A295AD7EE002389F6 /* HomeMenuView.swift in Sources */,
9556A45E295AC31F00FD8E1F /* MyPageInfoDetailView.swift in Sources */,

);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "applewatch1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "applewatch2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "applewatch3.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "applewatch4.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "productDetail.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "productInformation.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
//
// ProductDetailView.swift
// ProductDetail
//
// Created by 박희경 on 2022/12/27.
//

import SwiftUI

struct ProductDetailView: View {

@State private var imageHeight: CGFloat = 0


var body: some View {

VStack {
ScrollView(.vertical) {

VStack(alignment: .leading) {
TabView {
ForEach(1..<5) { i in
Image("applewatch\(i)")
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: UIScreen.screenWidth, height: UIScreen.screenWidth)
}
}
.tabViewStyle(.page)
.frame(height: UIScreen.screenWidth)

Divider()

VStack(alignment: .leading) {
Text("Apple 애플워치 시리즈 8")
.font(.title2)
.fontWeight(.bold)
.padding(.bottom, 4)
.padding(.top, 6)

HStack {
Image(systemName: "star")
.renderingMode(.original)

Text("4.7")
.padding(.trailing, 10)

Text("리뷰 100건 구매 4,681건")
.font(.caption)
.foregroundColor(.gray)
}.padding(.bottom, 10)

Text("596,730원")
.font(.title2)
.fontWeight(.bold)
}
.padding(.leading, 15)

Image("productInformation")
.resizable()
.scaledToFit()


Button {
// 버튼을 눌렀을때 image의 height를 최대로 늘려준다.
imageHeight = CGFloat.infinity
} label: {
HStack {
Spacer()
Text("상품정보 더보기")
Spacer()
}
}

Image("productDetail")
.resizable()
// .scaledToFit()
.aspectRatio(contentMode: .fit)
.frame(height: imageHeight)




}





}//scroll vstack

HStack {

Button {
print("")
} label: {
HStack {
Image(systemName: "heart")
.renderingMode(.original)
}
.padding()
.background(.white)
.clipShape(RoundedRectangle(cornerRadius: 10))
.padding(.horizontal)
}

Button {
print("")
} label: {
HStack {
Spacer()
Text("구매하기")
.fontWeight(.bold)
Spacer()
}
.padding()
.background(.pink)
.clipShape(RoundedRectangle(cornerRadius: 10))
.padding(.horizontal)
}
.tint(.white)
// .frame(height: UIScreen.screenWidth-)
}
}
}


}

struct ProductDetailView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}

extension UIScreen {
static let screenWidth = UIScreen.main.bounds.size.width
static let screenHeight = UIScreen.main.bounds.size.height
static let screenSize = UIScreen.main.bounds.size
static let produectImageHeight: CGFloat = 270.0
}

0 comments on commit e1d418d

Please sign in to comment.