회사정보 변경
This commit is contained in:
parent
568d7f2284
commit
043a583985
|
@ -37,6 +37,8 @@ class AppState: ObservableObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Published var eventPopup: EventItem? = nil
|
@Published var eventPopup: EventItem? = nil
|
||||||
|
@Published var purchasedContentId = 0
|
||||||
|
@Published var purchasedContentOrderType = OrderType.KEEP
|
||||||
|
|
||||||
func setAppStep(step: AppStep) {
|
func setAppStep(step: AppStep) {
|
||||||
switch step {
|
switch step {
|
||||||
|
|
|
@ -128,5 +128,5 @@ enum AppStep {
|
||||||
|
|
||||||
case seriesContentAll(seriesId: Int, seriesTitle: String)
|
case seriesContentAll(seriesId: Int, seriesTitle: String)
|
||||||
|
|
||||||
case tempCanPayment(title: String, can: Int, onSuccess: () -> Void)
|
case tempCanPayment(orderType: OrderType, contentId: Int, title: String, can: Int)
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,11 +230,10 @@ struct ContentDetailView: View {
|
||||||
AppState.shared
|
AppState.shared
|
||||||
.setAppStep(
|
.setAppStep(
|
||||||
step: .tempCanPayment(
|
step: .tempCanPayment(
|
||||||
|
orderType: orderType,
|
||||||
|
contentId: audioContent.contentId,
|
||||||
title: audioContent.title,
|
title: audioContent.title,
|
||||||
can: orderType == .RENTAL ? Int(ceil(Double(audioContent.price) * 0.6)) : audioContent.price,
|
can: orderType == .RENTAL ? Int(ceil(Double(audioContent.price) * 0.6)) : audioContent.price
|
||||||
onSuccess: {
|
|
||||||
viewModel.order(orderType: orderType)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -62,7 +62,11 @@ final class ContentDetailViewModel: ObservableObject {
|
||||||
let decoded = try jsonDecoder.decode(ApiResponse<GetAudioContentDetailResponse>.self, from: responseData)
|
let decoded = try jsonDecoder.decode(ApiResponse<GetAudioContentDetailResponse>.self, from: responseData)
|
||||||
|
|
||||||
if let data = decoded.data, decoded.success {
|
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 {
|
} else {
|
||||||
if let message = decoded.message {
|
if let message = decoded.message {
|
||||||
self.errorMessage = message
|
self.errorMessage = message
|
||||||
|
@ -298,6 +302,9 @@ final class ContentDetailViewModel: ObservableObject {
|
||||||
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
|
let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
|
||||||
|
|
||||||
if decoded.success {
|
if decoded.success {
|
||||||
|
AppState.shared.purchasedContentId = 0
|
||||||
|
AppState.shared.purchasedContentOrderType = .KEEP
|
||||||
|
|
||||||
self.orderType = nil
|
self.orderType = nil
|
||||||
self.errorMessage = orderType == .RENTAL ? "대여가 완료되었습니다." : "구매가 완료되었습니다."
|
self.errorMessage = orderType == .RENTAL ? "대여가 완료되었습니다." : "구매가 완료되었습니다."
|
||||||
self.isShowPopup = true
|
self.isShowPopup = true
|
||||||
|
|
|
@ -187,8 +187,8 @@ struct ContentView: View {
|
||||||
case .seriesContentAll(let seriesId, let seriesTitle):
|
case .seriesContentAll(let seriesId, let seriesTitle):
|
||||||
SeriesContentAllView(seriesId: seriesId, seriesTitle: seriesTitle)
|
SeriesContentAllView(seriesId: seriesId, seriesTitle: seriesTitle)
|
||||||
|
|
||||||
case .tempCanPayment(let title, let can, let onSuccess):
|
case .tempCanPayment(let orderType, let contentId, let title, let can):
|
||||||
CanPaymentTempView(title: title, can: can, onSuccess: onSuccess)
|
CanPaymentTempView(orderType: orderType, contentId: contentId, title: title, can: can)
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -13,14 +13,16 @@ struct CanPaymentTempView: View {
|
||||||
|
|
||||||
@StateObject var viewModel = CanPaymentTempViewModel()
|
@StateObject var viewModel = CanPaymentTempViewModel()
|
||||||
|
|
||||||
|
let orderType: OrderType
|
||||||
|
let contentId: Int
|
||||||
let title: String
|
let title: String
|
||||||
let can: Int
|
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.title = title
|
||||||
self.can = can
|
self.can = can
|
||||||
self.onSuccess = onSuccess
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
@ -48,9 +50,11 @@ struct CanPaymentTempView: View {
|
||||||
let can = UserDefaults.int(forKey: .can)
|
let can = UserDefaults.int(forKey: .can)
|
||||||
UserDefaults.set(can + self.can, 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()
|
AppState.shared.back()
|
||||||
onSuccess()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +69,7 @@ struct CanPaymentTempView: View {
|
||||||
|
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
HStack(spacing: 0) {
|
HStack(spacing: 0) {
|
||||||
Text(self.title)
|
Text(self.title)
|
||||||
.font(.custom(Font.bold.rawValue, size: 15.3))
|
.font(.custom(Font.bold.rawValue, size: 15.3))
|
||||||
.foregroundColor(Color(hex: "eeeeee"))
|
.foregroundColor(Color(hex: "eeeeee"))
|
||||||
|
@ -271,5 +275,5 @@ struct CanPaymentTempView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
CanPaymentTempView(title: "콘텐츠 제목", can: 1000, onSuccess: {})
|
CanPaymentTempView(orderType: .KEEP, contentId: 0, title: "콘텐츠 제목", can: 1000)
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,11 +156,10 @@ struct SettingsView: View {
|
||||||
.padding(.top, 13.3)
|
.padding(.top, 13.3)
|
||||||
|
|
||||||
Text("""
|
Text("""
|
||||||
- 회사명 : 주식회사 비비드넥스트
|
- 회사명 : 주식회사 소다라이브
|
||||||
- 대표자 : 한지영
|
- 대표자 : 이재형
|
||||||
- 주소 : 서울 강남구 테헤란로 410, 11층 A08호(대치동, 금강타워)
|
- 주소 : 경기도 성남시 분당구 황새울로335번길 10, 5층 563A호 (서현동, 멜로즈 프라자)
|
||||||
- 사업자등록번호 : 508-86-01545
|
- 사업자등록번호 : 870-81-03220
|
||||||
- 통신판매업신고 : 제2022-서울강남-00559호
|
|
||||||
- 고객센터 : 02.2055.1477
|
- 고객센터 : 02.2055.1477
|
||||||
""")
|
""")
|
||||||
.font(.custom(Font.medium.rawValue, size: 11))
|
.font(.custom(Font.medium.rawValue, size: 11))
|
||||||
|
|
Loading…
Reference in New Issue