콘텐츠 상세

- 소장만, 대여만 가능시 구매하기 버튼 배경색 변경
- 소장만, 대여만 가능시 구매하기 버튼을 터치하면 바로 구매확인 다이얼로그 표시
This commit is contained in:
Yu Sung
2024-11-08 21:06:24 +09:00
parent 696aed5c00
commit f6ae14d614
5 changed files with 87 additions and 80 deletions

View File

@@ -12,7 +12,6 @@ struct ContentOrderDialogView: View {
@Binding var isShowing: Bool
let price: Int
let isOnlyRental: Bool
let onTapPurchase: (OrderType) -> Void
var body: some View {
@@ -47,11 +46,11 @@ struct ContentOrderDialogView: View {
}
if UserDefaults.int(forKey: .userId) == 17958 {
Text(isOnlyRental ? "\(price * 110)" : "\(Int(ceil(Double(price) * 0.7)) * 110)")
Text("\(Int(ceil(Double(price) * 0.7)) * 110)")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
} else {
Text(isOnlyRental ? "\(price)" : "\(Int(ceil(Double(price) * 0.7)))")
Text("\(Int(ceil(Double(price) * 0.7)))")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
}
@@ -72,52 +71,50 @@ struct ContentOrderDialogView: View {
}
}
if !isOnlyRental {
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 5.3) {
Text("소장")
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 5.3) {
Text("소장")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(.white)
Text("(서비스 종료시까지)")
.font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white)
}
Spacer()
HStack(spacing: 8) {
if UserDefaults.int(forKey: .userId) != 17958 {
Image("ic_can")
.resizable()
.frame(width: 16.7, height: 16.7)
}
if UserDefaults.int(forKey: .userId) == 17958 {
Text("\(price * 110)")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(.white)
Text("(서비스 종료시까지)")
.font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white)
.foregroundColor(Color.grayee)
} else {
Text("\(price)")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
}
Spacer()
HStack(spacing: 8) {
if UserDefaults.int(forKey: .userId) != 17958 {
Image("ic_can")
.resizable()
.frame(width: 16.7, height: 16.7)
}
if UserDefaults.int(forKey: .userId) == 17958 {
Text("\(price * 110)")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
} else {
Text("\(price)")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
}
if UserDefaults.int(forKey: .userId) == 17958 {
Text("")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
}
}
.padding(.vertical, 8)
.padding(.horizontal, 13.3)
.background(Color.button)
.cornerRadius(5.3)
.onTapGesture {
onTapPurchase(.KEEP)
isShowing = false
if UserDefaults.int(forKey: .userId) == 17958 {
Text("")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
}
}
.padding(.vertical, 8)
.padding(.horizontal, 13.3)
.background(Color.button)
.cornerRadius(5.3)
.onTapGesture {
onTapPurchase(.KEEP)
isShowing = false
}
}
}
.padding(24)