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