라이브 방
- 하트 후원 API 연결 - 하트 후원 성공시 하트 애니메이션 호출 - 하트 후원 성공시 채팅으로 알림
This commit is contained in:
@@ -28,6 +28,10 @@ struct LiveRoomChatView: View {
|
||||
let chatMessage = messages[index] as! LiveRoomJoinChat
|
||||
LiveRoomJoinChatItemView(chatMessage: chatMessage)
|
||||
|
||||
case LiveRoomChatType.HEART:
|
||||
let chatMessage = messages[index] as! LiveRoomHeartDonationChat
|
||||
LiveRoomHeartDonationChatItemView(chatMessage: chatMessage)
|
||||
|
||||
default:
|
||||
let chatMessage = messages[index] as! LiveRoomNormalChat
|
||||
LiveRoomChatItemView(
|
||||
|
@@ -10,6 +10,7 @@ import SwiftUI
|
||||
struct LiveRoomInfoGuestView: View {
|
||||
|
||||
let title: String
|
||||
let totalHeart: Int
|
||||
let totalDonationCan: Int
|
||||
|
||||
let isOnBg: Bool
|
||||
@@ -163,7 +164,23 @@ struct LiveRoomInfoGuestView: View {
|
||||
|
||||
Spacer()
|
||||
|
||||
HStack(spacing: 2.7) {
|
||||
HStack(spacing: 6.7) {
|
||||
Image("ic_heart_pink")
|
||||
.resizable()
|
||||
.frame(width: 12, height: 12)
|
||||
|
||||
Text("\(totalHeart)")
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(.graybb)
|
||||
}
|
||||
.padding(.horizontal, 11)
|
||||
.padding(.vertical, 5.3)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 5.3)
|
||||
.stroke(Color.graybb, lineWidth: 1)
|
||||
)
|
||||
|
||||
HStack(spacing: 6.7) {
|
||||
Image("ic_can")
|
||||
.resizable()
|
||||
.frame(width: 12, height: 12)
|
||||
@@ -202,6 +219,7 @@ struct LiveRoomInfoGuestView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
LiveRoomInfoGuestView(
|
||||
title: "qwer",
|
||||
totalHeart: 1234,
|
||||
totalDonationCan: 123456,
|
||||
isOnBg: true,
|
||||
isOnNotice: false,
|
||||
|
@@ -11,6 +11,7 @@ import Kingfisher
|
||||
struct LiveRoomInfoHostView: View {
|
||||
|
||||
let title: String
|
||||
let totalHeart: Int
|
||||
let totalDonationCan: Int
|
||||
let participantsCount: Int
|
||||
|
||||
@@ -161,7 +162,23 @@ struct LiveRoomInfoHostView: View {
|
||||
|
||||
Spacer()
|
||||
|
||||
HStack(spacing: 2.7) {
|
||||
HStack(spacing: 6.7) {
|
||||
Image("ic_heart_pink")
|
||||
.resizable()
|
||||
.frame(width: 12, height: 12)
|
||||
|
||||
Text("\(totalHeart)")
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(.graybb)
|
||||
}
|
||||
.padding(.horizontal, 11)
|
||||
.padding(.vertical, 5.3)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 5.3)
|
||||
.stroke(Color.graybb, lineWidth: 1)
|
||||
)
|
||||
|
||||
HStack(spacing: 6.7) {
|
||||
Image("ic_can")
|
||||
.resizable()
|
||||
.frame(width: 12, height: 12)
|
||||
@@ -217,6 +234,7 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
LiveRoomInfoHostView(
|
||||
title: "오늘의 라이브방송은 OOO입니다.",
|
||||
totalHeart: 1234,
|
||||
totalDonationCan: 123456,
|
||||
participantsCount: 18,
|
||||
isOnBg: true,
|
||||
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// GetLiveRoomHeartTotalResponse.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 10/24/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct GetLiveRoomHeartTotalResponse: Decodable {
|
||||
let totalHeartCount: Int
|
||||
}
|
11
SodaLive/Sources/Live/Room/V2/LiveRoomLikeHeartRequest.swift
Normal file
11
SodaLive/Sources/Live/Room/V2/LiveRoomLikeHeartRequest.swift
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// LiveRoomLikeHeartRequest.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 10/24/24.
|
||||
//
|
||||
|
||||
struct LiveRoomLikeHeartRequest: Encodable {
|
||||
let roomId: Int
|
||||
let container: String = "ios"
|
||||
}
|
@@ -25,6 +25,7 @@ struct LiveRoomViewV2: View {
|
||||
if liveRoomInfo.creatorId == UserDefaults.int(forKey: .userId) {
|
||||
LiveRoomInfoHostView(
|
||||
title: liveRoomInfo.title,
|
||||
totalHeart: viewModel.totalHeartCount,
|
||||
totalDonationCan: viewModel.totalDonationCan,
|
||||
participantsCount: liveRoomInfo.participantsCount,
|
||||
isOnBg: viewModel.isBgOn,
|
||||
@@ -75,6 +76,7 @@ struct LiveRoomViewV2: View {
|
||||
} else {
|
||||
LiveRoomInfoGuestView(
|
||||
title: liveRoomInfo.title,
|
||||
totalHeart: viewModel.totalHeartCount,
|
||||
totalDonationCan: viewModel.totalDonationCan,
|
||||
isOnBg: viewModel.isBgOn,
|
||||
isOnNotice: viewModel.isShowNotice,
|
||||
|
Reference in New Issue
Block a user