유료방 입장 팝업 - UI 수정, 알림 문구 수정
This commit is contained in:
@@ -91,13 +91,16 @@ struct LiveView: View {
|
||||
}
|
||||
|
||||
if viewModel.isShowPaymentDialog {
|
||||
SodaDialog(
|
||||
LivePaymentDialog(
|
||||
title: viewModel.paymentDialogTitle,
|
||||
desc: viewModel.paymentDialogDesc,
|
||||
desc2: viewModel.paymentDialogDesc2,
|
||||
confirmButtonTitle: viewModel.paymentDialogConfirmTitle,
|
||||
confirmButtonAction: viewModel.paymentDialogConfirmAction,
|
||||
cancelButtonTitle: viewModel.paymentDialogCancelTitle,
|
||||
cancelButtonAction: viewModel.hidePopup
|
||||
cancelButtonAction: viewModel.hidePopup,
|
||||
startDateTime: viewModel.liveStartDate,
|
||||
nowDateTime: viewModel.nowDate
|
||||
)
|
||||
}
|
||||
|
||||
|
@@ -34,6 +34,7 @@ final class LiveViewModel: ObservableObject {
|
||||
|
||||
@Published var paymentDialogTitle = ""
|
||||
@Published var paymentDialogDesc = ""
|
||||
@Published var paymentDialogDesc2 = ""
|
||||
@Published var isShowPaymentDialog = false
|
||||
@Published var paymentDialogConfirmAction = {}
|
||||
@Published var paymentDialogConfirmTitle = ""
|
||||
@@ -48,6 +49,9 @@ final class LiveViewModel: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
@Published var liveStartDate: String? = nil
|
||||
@Published var nowDate: String? = nil
|
||||
|
||||
let paymentDialogCancelTitle = "취소"
|
||||
|
||||
var page = 1
|
||||
@@ -71,6 +75,7 @@ final class LiveViewModel: ObservableObject {
|
||||
|
||||
paymentDialogTitle = ""
|
||||
paymentDialogDesc = ""
|
||||
paymentDialogDesc2 = ""
|
||||
paymentDialogConfirmAction = {}
|
||||
|
||||
secretOrPasswordDialogCan = 0
|
||||
@@ -438,8 +443,24 @@ final class LiveViewModel: ObservableObject {
|
||||
}
|
||||
self.isShowPasswordDialog = true
|
||||
} else {
|
||||
self.paymentDialogTitle = "\($0.price)캔으로 입장"
|
||||
self.paymentDialogDesc = "'\($0.title)' 라이브에 참여하기 위해 결제합니다."
|
||||
let fromFormatter = DateFormatter()
|
||||
fromFormatter.dateFormat = "yyyy.MM.dd EEE hh:mm a"
|
||||
fromFormatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
let beginDate = fromFormatter.date(from: $0.beginDateTime)!
|
||||
let now = Date()
|
||||
|
||||
let timeInterval = now.timeIntervalSince(beginDate)
|
||||
let hours = Int(timeInterval / 3600)
|
||||
let minutes = Int((timeInterval.truncatingRemainder(dividingBy: 3600)) / 60)
|
||||
|
||||
if hours >= 1 {
|
||||
self.liveStartDate = beginDate.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
|
||||
self.nowDate = now.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
|
||||
self.paymentDialogDesc2 = "라이브를 시작한 지 \(hours)시간 \(minutes)분이 지났습니다. 라이브에 입장 후 30분 이내에 라이브가 종료될 수도 있습니다."
|
||||
}
|
||||
|
||||
self.paymentDialogTitle = "유료 라이브 입장"
|
||||
self.paymentDialogDesc = "\($0.price)캔을 차감하고\n라이브에 입장 하시겠습니까?"
|
||||
self.paymentDialogConfirmTitle = "결제 후 참여하기"
|
||||
self.paymentDialogConfirmAction = { [unowned self] in
|
||||
hidePopup()
|
||||
|
Reference in New Issue
Block a user