회사정보 변경
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user