회사정보 변경

This commit is contained in:
Yu Sung
2024-05-21 01:24:27 +09:00
parent 568d7f2284
commit 043a583985
7 changed files with 31 additions and 20 deletions

View File

@@ -37,6 +37,8 @@ class AppState: ObservableObject {
}
@Published var eventPopup: EventItem? = nil
@Published var purchasedContentId = 0
@Published var purchasedContentOrderType = OrderType.KEEP
func setAppStep(step: AppStep) {
switch step {

View File

@@ -128,5 +128,5 @@ enum AppStep {
case seriesContentAll(seriesId: Int, seriesTitle: String)
case tempCanPayment(title: String, can: Int, onSuccess: () -> Void)
case tempCanPayment(orderType: OrderType, contentId: Int, title: String, can: Int)
}

View File

@@ -230,11 +230,10 @@ struct ContentDetailView: View {
AppState.shared
.setAppStep(
step: .tempCanPayment(
orderType: orderType,
contentId: audioContent.contentId,
title: audioContent.title,
can: orderType == .RENTAL ? Int(ceil(Double(audioContent.price) * 0.6)) : audioContent.price,
onSuccess: {
viewModel.order(orderType: orderType)
}
can: orderType == .RENTAL ? Int(ceil(Double(audioContent.price) * 0.6)) : audioContent.price
)
)
} else {

View File

@@ -62,7 +62,11 @@ final class ContentDetailViewModel: ObservableObject {
let decoded = try jsonDecoder.decode(ApiResponse<GetAudioContentDetailResponse>.self, from: responseData)
if let data = decoded.data, decoded.success {
self.audioContent = data
if AppState.shared.purchasedContentId > 0 && AppState.shared.purchasedContentId == data.contentId {
self.order(orderType: AppState.shared.purchasedContentOrderType)
} else {
self.audioContent = data
}
} else {
if let message = decoded.message {
self.errorMessage = message
@@ -298,6 +302,9 @@ final class ContentDetailViewModel: ObservableObject {
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
if decoded.success {
AppState.shared.purchasedContentId = 0
AppState.shared.purchasedContentOrderType = .KEEP
self.orderType = nil
self.errorMessage = orderType == .RENTAL ? "대여가 완료되었습니다." : "구매가 완료되었습니다."
self.isShowPopup = true

View File

@@ -187,8 +187,8 @@ struct ContentView: View {
case .seriesContentAll(let seriesId, let seriesTitle):
SeriesContentAllView(seriesId: seriesId, seriesTitle: seriesTitle)
case .tempCanPayment(let title, let can, let onSuccess):
CanPaymentTempView(title: title, can: can, onSuccess: onSuccess)
case .tempCanPayment(let orderType, let contentId, let title, let can):
CanPaymentTempView(orderType: orderType, contentId: contentId, title: title, can: can)
default:

View File

@@ -13,14 +13,16 @@ struct CanPaymentTempView: View {
@StateObject var viewModel = CanPaymentTempViewModel()
let orderType: OrderType
let contentId: Int
let title: String
let can: Int
let onSuccess: () -> Void
init(title: String, can: Int, onSuccess: @escaping () -> Void) {
init(orderType: OrderType, contentId: Int, title: String, can: Int) {
self.orderType = orderType
self.contentId = contentId
self.title = title
self.can = can
self.onSuccess = onSuccess
}
var body: some View {
@@ -48,9 +50,11 @@ struct CanPaymentTempView: View {
let can = UserDefaults.int(forKey: .can)
UserDefaults.set(can + self.can, forKey: .can)
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
AppState.shared.purchasedContentId = contentId
AppState.shared.purchasedContentOrderType = orderType
DispatchQueue.main.async {
AppState.shared.back()
onSuccess()
}
}
}
@@ -65,7 +69,7 @@ struct CanPaymentTempView: View {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 0) {
HStack(spacing: 0) {
HStack(spacing: 0) {
Text(self.title)
.font(.custom(Font.bold.rawValue, size: 15.3))
.foregroundColor(Color(hex: "eeeeee"))
@@ -271,5 +275,5 @@ struct CanPaymentTempView: View {
}
#Preview {
CanPaymentTempView(title: "콘텐츠 제목", can: 1000, onSuccess: {})
CanPaymentTempView(orderType: .KEEP, contentId: 0, title: "콘텐츠 제목", can: 1000)
}

View File

@@ -156,11 +156,10 @@ struct SettingsView: View {
.padding(.top, 13.3)
Text("""
- 회사명 : 주식회사 비비드넥스트
- 대표자 : 한지영
- 주소 : 서울 강남구 테헤란로 410, 11층 A08호(대치동, 금강타워)
- 사업자등록번호 : 508-86-01545
- 통신판매업신고 : 제2022-서울강남-00559호
- 회사명 : 주식회사 소다라이브
- 대표자 : 이재형
- 주소 : 경기도 성남시 분당구 황새울로335번길 10, 5층 563A호 (서현동, 멜로즈 프라자)
- 사업자등록번호 : 870-81-03220
- 고객센터 : 02.2055.1477
""")
.font(.custom(Font.medium.rawValue, size: 11))