회사정보 변경

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

@@ -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