라이브 상세 페이지 추가

This commit is contained in:
Yu Sung
2023-08-14 19:22:23 +09:00
parent e0a5fb733d
commit 634f50d4f2
37 changed files with 2767 additions and 49 deletions

View File

@@ -30,13 +30,9 @@ final class UserProfileViewModel: ObservableObject {
@Published var paymentDialogConfirmAction = {}
@Published var paymentDialogConfirmTitle = ""
@Published var secretDialogManagerNickname = ""
@Published var secretDialogConfirmAction = {}
@Published var isShowSecretDialog = false
@Published var secretOrPasswordDialogCan = 0
@Published var passwordDialogConfirmAction: (Int) -> Void = { _ in }
@Published var passwordDialogConfirmAction: (String) -> Void = { _ in }
@Published var isShowPasswordDialog = false
@Published var navigationTitle = "채널"
@@ -101,7 +97,6 @@ final class UserProfileViewModel: ObservableObject {
func hidePaymentPopup() {
isShowPaymentDialog = false
isShowSecretDialog = false
isShowPasswordDialog = false
paymentDialogTitle = ""
@@ -109,9 +104,6 @@ final class UserProfileViewModel: ObservableObject {
paymentDialogConfirmAction = {}
secretOrPasswordDialogCan = 0
secretDialogManagerNickname = ""
secretDialogConfirmAction = {}
passwordDialogConfirmAction = { _ in }
}
@@ -144,7 +136,7 @@ final class UserProfileViewModel: ObservableObject {
}
}
private func reservation(roomId: Int, password: Int? = nil) {
private func reservation(roomId: Int, password: String? = nil) {
isLoading = true
let request = MakeLiveReservationRequest(roomId: roomId, password: password)
liveRepository.makeReservation(request: request)
@@ -190,14 +182,7 @@ final class UserProfileViewModel: ObservableObject {
self.enterRoom(roomId: roomId)
}
} else if ($0.price == 0 || $0.isPaid) {
if $0.isSecretRoom {
self.secretDialogManagerNickname = $0.manager.nickname
self.secretDialogConfirmAction = {
self.enterRoom(roomId: roomId)
}
self.secretOrPasswordDialogCan = 0
self.isShowSecretDialog = true
} else if $0.isPrivateRoom {
if $0.isPrivateRoom {
self.passwordDialogConfirmAction = { password in
self.enterRoom(roomId: roomId, password: password)
}
@@ -208,14 +193,7 @@ final class UserProfileViewModel: ObservableObject {
}
}
} else {
if $0.isSecretRoom {
self.secretDialogManagerNickname = $0.manager.nickname
self.secretDialogConfirmAction = {
self.enterRoom(roomId: roomId)
}
self.secretOrPasswordDialogCan = $0.price
self.isShowSecretDialog = true
} else if $0.isPrivateRoom {
if $0.isPrivateRoom {
self.secretOrPasswordDialogCan = $0.price
self.passwordDialogConfirmAction = { password in
self.enterRoom(roomId: roomId, password: password)
@@ -236,7 +214,7 @@ final class UserProfileViewModel: ObservableObject {
}
}
func enterRoom(roomId: Int, onSuccess: (() -> Void)? = nil, password: Int? = nil) {
func enterRoom(roomId: Int, onSuccess: (() -> Void)? = nil, password: String? = nil) {
isLoading = true
let request = EnterOrQuitLiveRoomRequest(roomId: roomId, password: password)
liveRepository.enterRoom(request: request)