콘텐츠 상세

- 한정판인 경우 대여/소장 선택 다이얼로그를 생략하고 바로 구매확인 다이얼로그가 나오도록 수정
- 한정판이 매진된 경우 구매버튼 비활성화 및 '해당 콘텐츠가 매진되었습니다.' 문구 표시
This commit is contained in:
Yu Sung 2024-03-27 17:54:01 +09:00
parent 5c15e7d52f
commit 4d73136740
2 changed files with 24 additions and 5 deletions

View File

@ -33,7 +33,7 @@ struct ContentDetailPurchaseButton: View {
}
.frame(maxWidth: .infinity)
.frame(height: 48.7)
.background(Color(hex: "9970ff"))
.background(Color.button)
.cornerRadius(5.3)
.padding(.top, 18.3)
}

View File

@ -107,10 +107,29 @@ struct ContentDetailView: View {
!audioContent.existOrdered &&
audioContent.orderType == nil &&
audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) {
ContentDetailPurchaseButton(price: audioContent.price, isOnlyRental: audioContent.isOnlyRental)
.contentShape(Rectangle())
.padding(.horizontal, 13.3)
.onTapGesture { isShowOrderView = true }
if let _ = audioContent.totalContentCount, let remainingContentCount = audioContent.remainingContentCount, remainingContentCount <= 0 {
Text("해당 콘텐츠가 매진되었습니다.")
.font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(.white)
.frame(maxWidth: .infinity)
.frame(height: 48.7)
.background(Color(hex: "525252"))
.cornerRadius(5.3)
.padding(.top, 18.3)
.padding(.horizontal, 13.3)
} else {
ContentDetailPurchaseButton(price: audioContent.price, isOnlyRental: audioContent.isOnlyRental)
.contentShape(Rectangle())
.padding(.horizontal, 13.3)
.onTapGesture {
if let _ = audioContent.totalContentCount, let _ = audioContent.remainingContentCount {
viewModel.orderType = .KEEP
isShowOrderConfirmView = true
} else {
isShowOrderView = true
}
}
}
}
if audioContent.isCommentAvailable {