- 룰렛 돌리기 API 연동

- 룰렛 돌린 결과 전송
This commit is contained in:
Yu Sung
2023-12-07 04:29:03 +09:00
parent 5682adf967
commit 0af16ac000
8 changed files with 333 additions and 3 deletions

View File

@@ -327,6 +327,9 @@ struct LiveRoomView: View {
.background(Color(hex: "525252").opacity(0.6))
.cornerRadius(10)
.padding(.bottom, 13.3)
.onTapGesture {
viewModel.showRoulette()
}
}
}
@@ -691,6 +694,19 @@ struct LiveRoomView: View {
}
}
if let preview = viewModel.roulettePreview, viewModel.isShowRoulettePreview {
RoulettePreviewDialog(
isShowing: $viewModel.isShowRoulettePreview,
title: nil,
onClickSpin: { spinRoulette() },
preview: preview
)
}
if viewModel.isShowRoulette {
}
if viewModel.isLoading && viewModel.liveRoomInfo == nil {
LoadingView()
}
@@ -927,6 +943,10 @@ struct LiveRoomView: View {
LazyVGrid(columns: chatColumns, alignment: .leading, spacing: 20) {
ForEach(0..<viewModel.messages.count, id: \.self) { index in
switch (viewModel.messages[index].type) {
case LiveRoomChatType.ROULETTE_DONATION:
let chatMessage = viewModel.messages[index] as! LiveRoomRouletteDonationChat
LiveRoomRouletteDonationChatItemView(chatMessage: chatMessage)
case LiveRoomChatType.DONATION:
let chatMessage = viewModel.messages[index] as! LiveRoomDonationChat
LiveRoomDonationChatItemView(chatMessage: chatMessage)
@@ -955,6 +975,10 @@ struct LiveRoomView: View {
}
}
}
private func spinRoulette() {
viewModel.spinRoulette()
}
}
struct LiveRoomView_Previews: PreviewProvider {