회사정보 변경

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

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