|
@@ -8,135 +8,243 @@
|
|
import SwiftUI
|
|
import SwiftUI
|
|
import SwiftUIX
|
|
import SwiftUIX
|
|
|
|
|
|
|
|
+struct TSPurchaseVideoTimesAlertView :View {
|
|
|
|
+ @ObservedObject var viewModel: TSPurchaseVideoTimesVM
|
|
|
|
+ @State var isExpand: Bool = false
|
|
|
|
+ @State private var scrollProxy: ScrollViewProxy? = nil
|
|
|
|
+ private let bottomID = "BOTTOM_ID" // 底部标识符
|
|
|
|
+
|
|
|
|
+ var body: some View {
|
|
|
|
+ VStack {
|
|
|
|
+ let limit = "No effect uses left. Get more to keep creating.".localized
|
|
|
|
+ let alertHeight:CGFloat = 468.0
|
|
|
|
+ Spacer()
|
|
|
|
+ ZStack(alignment: .topTrailing) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ ZStack(alignment: .top) {
|
|
|
|
+
|
|
|
|
+ Image(.purchaseVideoTimesAlertBj)
|
|
|
|
+ .resizable()
|
|
|
|
+ .scaledToFill()
|
|
|
|
+ .frame(height: alertHeight)
|
|
|
|
+ .clipped()
|
|
|
|
+
|
|
|
|
+ // 内容层(可滚动)
|
|
|
|
+ ScrollViewReader { proxy in
|
|
|
|
+ ScrollView {
|
|
|
|
+ VStack {
|
|
|
|
+ Spacer().frame(height: 24)
|
|
|
|
+ Text("Limit Reached".localized)
|
|
|
|
+ .multilineTextAlignment(.center)
|
|
|
|
+ .font(.font(size: 22,weight: .medium))
|
|
|
|
+ .foregroundColor(.white)
|
|
|
|
+ .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
+
|
|
|
|
+ Spacer().frame(height: 16)
|
|
|
|
+ Text(limit)
|
|
|
|
+ .font(.font(size: 14,weight: .regular))
|
|
|
|
+ .multilineTextAlignment(.center)
|
|
|
|
+ .foregroundColor(.white.opacity(0.7))
|
|
|
|
+ .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
+
|
|
|
|
+ Spacer().frame(height: 15)
|
|
|
|
+ VStack(alignment: .leading, spacing: 20, content: {
|
|
|
|
+ TSPurchaseVideoTimesCellView(type: .purchase(.videoNum1), selectedType: $viewModel.selectedType)
|
|
|
|
+ .onTapGesture {
|
|
|
|
+ viewModel.selectedType = .purchase(.videoNum1)
|
|
|
|
+ }
|
|
|
|
+ ZStack(alignment: .topTrailing) {
|
|
|
|
+ TSPurchaseVideoTimesCellView(type: .purchase(.videoNum2), selectedType: $viewModel.selectedType)
|
|
|
|
+ .onTapGesture {
|
|
|
|
+ viewModel.selectedType = .purchase(.videoNum2)
|
|
|
|
+ }
|
|
|
|
+ TSPurchaseVideoTimesRecView()
|
|
|
|
+ .offset(x:-12,y:-14)
|
|
|
|
+ }
|
|
|
|
+ TSPurchaseVideoTimesCellView(type: .purchase(.videoNum3), selectedType: $viewModel.selectedType)
|
|
|
|
+ .onTapGesture {
|
|
|
|
+ viewModel.selectedType = .purchase(.videoNum3)
|
|
|
|
+ }
|
|
|
|
+ }).multilineTextAlignment(.center).font(.font(size: 16,weight:.regular)).foregroundColor(.white)
|
|
|
|
+
|
|
|
|
+ Spacer().frame(height: 28)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Button {
|
|
|
|
+ viewModel.buyPublisher.send(true)
|
|
|
|
+ } label: {
|
|
|
|
+ ZStack {
|
|
|
|
+ Image(.purchaseVideoTimesBtnbg)
|
|
|
|
+ Text("Purchase".localized)
|
|
|
|
+ .font(.font(size: 16,weight: .medium))
|
|
|
|
+ .foregroundColor(.white)
|
|
|
|
+ }.frame(maxWidth: .infinity ,minHeight: 48.0,maxHeight: 48.0)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ VStack{
|
|
|
|
+ Spacer().frame(height: 15)
|
|
|
|
+ Button {
|
|
|
|
+ withAnimation(.easeInOut(duration: 0.3)) {
|
|
|
|
+ isExpand.toggle()
|
|
|
|
+ }
|
|
|
|
+ } label: {
|
|
|
|
+ HStack(spacing: 4) {
|
|
|
|
+ Text("View Usage Rules".localized)
|
|
|
|
+ .font(.font(size: 12,weight: .regular))
|
|
|
|
+ .foregroundColor(.white.opacity(0.7))
|
|
|
|
+ Image(isExpand ? .chatUpArrow : .chatDownArrow)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if isExpand {
|
|
|
|
+
|
|
|
|
+ Spacer().frame(height: 5)
|
|
|
|
+
|
|
|
|
+ VStack(alignment: .leading, spacing: 8, content: {
|
|
|
|
+ TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Only VIP can purchase video effect uses".localized)
|
|
|
|
+ TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Uses can be applied to all video generations".localized)
|
|
|
|
+ TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Uses never expire and can be purchased repeatedly".localized)
|
|
|
|
+ TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "All unused uses will be lost if the app is uninstalled".localized)
|
|
|
|
+ })
|
|
|
|
+ .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
+
|
|
|
|
+ Spacer().frame(height: 24 + k_Height_safeAreaInsetsBottom())
|
|
|
|
+ }else{
|
|
|
|
+ Spacer().frame(height: k_Height_safeAreaInsetsBottom())
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// // 关键:透明的底部定位Spacer
|
|
|
|
+// Color.clear
|
|
|
|
+// .frame(height: 1)
|
|
|
|
+// .id(bottomID) // 设置唯一标识符
|
|
|
|
+// .onAppear {
|
|
|
|
+// if isExpand == true {
|
|
|
|
+// scrollProxy?.scrollTo(bottomID, anchor: .bottom)
|
|
|
|
+// }
|
|
|
|
+// print("展开完成")
|
|
|
|
+// }
|
|
|
|
+ }
|
|
|
|
+ .padding(.horizontal,16)
|
|
|
|
+ .onAppear {
|
|
|
|
+ self.scrollProxy = proxy
|
|
|
|
+ }
|
|
|
|
+ }.frame(height: alertHeight)
|
|
|
|
+ }
|
|
|
|
+ }.cornerRadius([.topLeading,.topTrailing], 20)
|
|
|
|
+
|
|
|
|
+ Button {
|
|
|
|
+ viewModel.closePagePublisher.send(true)
|
|
|
|
+ } label: {
|
|
|
|
+ Image(.closeClear).resizable().frame(width: 24, height: 24)
|
|
|
|
+ }.offset(x:-8,y:8)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .ignoresSafeArea()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
//struct TSPurchaseVideoTimesAlertView :View {
|
|
//struct TSPurchaseVideoTimesAlertView :View {
|
|
// @ObservedObject var viewModel: TSPurchaseVideoTimesVM
|
|
// @ObservedObject var viewModel: TSPurchaseVideoTimesVM
|
|
// @State var isExpand: Bool = false
|
|
// @State var isExpand: Bool = false
|
|
-// @State private var scrollProxy: ScrollViewProxy? = nil
|
|
|
|
-// private let bottomID = "BOTTOM_ID" // 底部标识符
|
|
|
|
-//
|
|
|
|
// var body: some View {
|
|
// var body: some View {
|
|
// VStack {
|
|
// VStack {
|
|
// let limit = "No effect uses left. Get more to keep creating.".localized
|
|
// let limit = "No effect uses left. Get more to keep creating.".localized
|
|
-// let alertHeight:CGFloat = 468.0
|
|
|
|
|
|
+//
|
|
// Spacer()
|
|
// Spacer()
|
|
// ZStack(alignment: .topTrailing) {
|
|
// ZStack(alignment: .topTrailing) {
|
|
-//
|
|
|
|
-//
|
|
|
|
-// ZStack(alignment: .top) {
|
|
|
|
|
|
+// VStack {
|
|
|
|
+// Spacer().frame(height: 24)
|
|
|
|
+// Text("Limit Reached".localized)
|
|
|
|
+// .multilineTextAlignment(.center)
|
|
|
|
+// .font(.font(size: 22,weight: .medium))
|
|
|
|
+// .foregroundColor(.white)
|
|
|
|
+// .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
//
|
|
//
|
|
-// Image(.purchaseVideoTimesAlertBj)
|
|
|
|
-// .resizable()
|
|
|
|
-// .scaledToFill()
|
|
|
|
-// .frame(height: alertHeight)
|
|
|
|
-// .clipped()
|
|
|
|
|
|
+// Spacer().frame(height: 16)
|
|
|
|
+// Text(limit)
|
|
|
|
+// .font(.font(size: 14,weight: .regular))
|
|
|
|
+// .multilineTextAlignment(.center)
|
|
|
|
+// .foregroundColor(.white.opacity(0.7))
|
|
|
|
+// .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
//
|
|
//
|
|
-// // 内容层(可滚动)
|
|
|
|
-// ScrollViewReader { proxy in
|
|
|
|
-// ScrollView {
|
|
|
|
-// VStack {
|
|
|
|
-// Spacer().frame(height: 24)
|
|
|
|
-// Text("Limit Reached".localized)
|
|
|
|
-// .multilineTextAlignment(.center)
|
|
|
|
-// .font(.font(size: 22,weight: .medium))
|
|
|
|
-// .foregroundColor(.white)
|
|
|
|
-// .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
-//
|
|
|
|
-// Spacer().frame(height: 16)
|
|
|
|
-// Text(limit)
|
|
|
|
-// .font(.font(size: 14,weight: .regular))
|
|
|
|
-// .multilineTextAlignment(.center)
|
|
|
|
-// .foregroundColor(.white.opacity(0.7))
|
|
|
|
-// .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
-//
|
|
|
|
-// Spacer().frame(height: 15)
|
|
|
|
-// VStack(alignment: .leading, spacing: 20, content: {
|
|
|
|
-// TSPurchaseVideoTimesCellView(type: .purchase(.videoNum1), selectedType: $viewModel.selectedType)
|
|
|
|
-// .onTapGesture {
|
|
|
|
-// viewModel.selectedType = .purchase(.videoNum1)
|
|
|
|
-// }
|
|
|
|
-// ZStack(alignment: .topTrailing) {
|
|
|
|
-// TSPurchaseVideoTimesCellView(type: .purchase(.videoNum2), selectedType: $viewModel.selectedType)
|
|
|
|
-// .onTapGesture {
|
|
|
|
-// viewModel.selectedType = .purchase(.videoNum2)
|
|
|
|
-// }
|
|
|
|
-// TSPurchaseVideoTimesRecView()
|
|
|
|
-// .offset(x:-12,y:-14)
|
|
|
|
-// }
|
|
|
|
-// TSPurchaseVideoTimesCellView(type: .purchase(.videoNum3), selectedType: $viewModel.selectedType)
|
|
|
|
-// .onTapGesture {
|
|
|
|
-// viewModel.selectedType = .purchase(.videoNum3)
|
|
|
|
-// }
|
|
|
|
-// }).multilineTextAlignment(.center).font(.font(size: 16,weight:.regular)).foregroundColor(.white)
|
|
|
|
-//
|
|
|
|
-// Spacer().frame(height: 28)
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// Button {
|
|
|
|
-// viewModel.buyPublisher.send(true)
|
|
|
|
-// } label: {
|
|
|
|
-// ZStack {
|
|
|
|
-// Image(.purchaseVideoTimesBtnbg)
|
|
|
|
-// Text("Purchase".localized)
|
|
|
|
-// .font(.font(size: 16,weight: .medium))
|
|
|
|
-// .foregroundColor(.white)
|
|
|
|
-// }.frame(maxWidth: .infinity ,minHeight: 48.0,maxHeight: 48.0)
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// VStack{
|
|
|
|
-// Spacer().frame(height: 15)
|
|
|
|
-// Button {
|
|
|
|
-// withAnimation(.easeInOut(duration: 0.3)) {
|
|
|
|
-// isExpand.toggle()
|
|
|
|
-//
|
|
|
|
-// if isExpand == true {
|
|
|
|
-// scrollProxy?.scrollTo(bottomID, anchor: .bottom)
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-// } label: {
|
|
|
|
-// HStack(spacing: 4) {
|
|
|
|
-// Text("View Usage Rules".localized)
|
|
|
|
-// .font(.font(size: 12,weight: .regular))
|
|
|
|
-// .foregroundColor(.white.opacity(0.7))
|
|
|
|
-// Image(isExpand ? .chatUpArrow : .chatDownArrow)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// if isExpand {
|
|
|
|
-//
|
|
|
|
-// Spacer().frame(height: 10)
|
|
|
|
-//
|
|
|
|
-// VStack(alignment: .leading, spacing: 8, content: {
|
|
|
|
-// TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Only VIP can purchase video effect uses".localized)
|
|
|
|
-// TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Uses can be applied to all video generations".localized)
|
|
|
|
-// TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Uses never expire and can be purchased repeatedly".localized)
|
|
|
|
-// TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "All unused uses will be lost if the app is uninstalled".localized)
|
|
|
|
-// })
|
|
|
|
-// .foregroundColor(Color.hex("#FCE5FF").opacity(0.8))
|
|
|
|
-// .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
-//
|
|
|
|
-// Spacer().frame(height: 24 + k_Height_safeAreaInsetsBottom())
|
|
|
|
-// }else{
|
|
|
|
-// Spacer().frame(height: k_Height_safeAreaInsetsBottom())
|
|
|
|
|
|
+// Spacer().frame(height: 15)
|
|
|
|
+// VStack(alignment: .leading, spacing: 20, content: {
|
|
|
|
+// TSPurchaseVideoTimesCellView(type: .purchase(.videoNum1), selectedType: $viewModel.selectedType)
|
|
|
|
+// .onTapGesture {
|
|
|
|
+// viewModel.selectedType = .purchase(.videoNum1)
|
|
|
|
+// }
|
|
|
|
+// ZStack(alignment: .topTrailing) {
|
|
|
|
+// TSPurchaseVideoTimesCellView(type: .purchase(.videoNum2), selectedType: $viewModel.selectedType)
|
|
|
|
+// .onTapGesture {
|
|
|
|
+// viewModel.selectedType = .purchase(.videoNum2)
|
|
// }
|
|
// }
|
|
-//
|
|
|
|
-// // 关键:透明的底部定位Spacer
|
|
|
|
-// Color.clear
|
|
|
|
-// .frame(height: 1)
|
|
|
|
-// .id(bottomID) // 设置唯一标识符
|
|
|
|
|
|
+// TSPurchaseVideoTimesRecView()
|
|
|
|
+// .offset(x:-12,y:-14)
|
|
|
|
+// }
|
|
|
|
+// TSPurchaseVideoTimesCellView(type: .purchase(.videoNum3), selectedType: $viewModel.selectedType)
|
|
|
|
+// .onTapGesture {
|
|
|
|
+// viewModel.selectedType = .purchase(.videoNum3)
|
|
|
|
+// }
|
|
|
|
+// }).multilineTextAlignment(.center).font(.font(size: 16,weight:.regular)).foregroundColor(.white)
|
|
|
|
+//
|
|
|
|
+// Spacer().frame(height: 28)
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// Button {
|
|
|
|
+// viewModel.buyPublisher.send(true)
|
|
|
|
+// } label: {
|
|
|
|
+// ZStack {
|
|
|
|
+// Image(.purchaseVideoTimesBtnbg)
|
|
|
|
+// Text("Purchase".localized)
|
|
|
|
+// .font(.font(size: 16,weight: .medium))
|
|
|
|
+// .foregroundColor(.white)
|
|
|
|
+// }.frame(maxWidth: .infinity ,minHeight: 48.0,maxHeight: 48.0)
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// VStack{
|
|
|
|
+// Spacer().frame(height: 15)
|
|
|
|
+// Button {
|
|
|
|
+// withAnimation(.easeInOut(duration: 0.3)) {
|
|
|
|
+// isExpand.toggle()
|
|
// }
|
|
// }
|
|
-// .padding(.horizontal,16)
|
|
|
|
-// .onAppear {
|
|
|
|
-// self.scrollProxy = proxy
|
|
|
|
|
|
+// } label: {
|
|
|
|
+// HStack(spacing: 4) {
|
|
|
|
+// Text("View Usage Rules".localized)
|
|
|
|
+// .font(.font(size: 12,weight: .regular))
|
|
|
|
+// .foregroundColor(.white.opacity(0.7))
|
|
|
|
+// Image(isExpand ? .chatUpArrow : .chatDownArrow)
|
|
// }
|
|
// }
|
|
-// }.frame(height: alertHeight)
|
|
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// if isExpand {
|
|
//
|
|
//
|
|
|
|
+// Spacer().frame(height: 10)
|
|
//
|
|
//
|
|
|
|
+// VStack(alignment: .leading, spacing: 8, content: {
|
|
|
|
+// TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Only VIP can purchase video effect uses".localized)
|
|
|
|
+// TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Uses can be applied to all video generations".localized)
|
|
|
|
+// TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Uses never expire and can be purchased repeatedly".localized)
|
|
|
|
+// TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "All unused uses will be lost if the app is uninstalled".localized)
|
|
|
|
+// })
|
|
|
|
+// .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
+//
|
|
|
|
+// Spacer().frame(height: 24 + k_Height_safeAreaInsetsBottom())
|
|
|
|
+// }else{
|
|
|
|
+// Spacer().frame(height: k_Height_safeAreaInsetsBottom())
|
|
// }
|
|
// }
|
|
-// }
|
|
|
|
//
|
|
//
|
|
|
|
+// }
|
|
|
|
+// .padding(.horizontal,16)
|
|
|
|
+// .background(
|
|
|
|
+// Color.hex("#261840").cornerRadius([.topLeading,.topTrailing], 20)
|
|
|
|
+// )
|
|
|
|
+//
|
|
// Button {
|
|
// Button {
|
|
// viewModel.closePagePublisher.send(true)
|
|
// viewModel.closePagePublisher.send(true)
|
|
// } label: {
|
|
// } label: {
|
|
@@ -147,114 +255,3 @@ import SwiftUIX
|
|
// .ignoresSafeArea()
|
|
// .ignoresSafeArea()
|
|
// }
|
|
// }
|
|
//}
|
|
//}
|
|
-
|
|
|
|
-
|
|
|
|
-struct TSPurchaseVideoTimesAlertView :View {
|
|
|
|
- @ObservedObject var viewModel: TSPurchaseVideoTimesVM
|
|
|
|
- @State var isExpand: Bool = false
|
|
|
|
- var body: some View {
|
|
|
|
- VStack {
|
|
|
|
- let limit = "No effect uses left. Get more to keep creating.".localized
|
|
|
|
-
|
|
|
|
- Spacer()
|
|
|
|
- ZStack(alignment: .topTrailing) {
|
|
|
|
- VStack {
|
|
|
|
- Spacer().frame(height: 24)
|
|
|
|
- Text("Limit Reached".localized)
|
|
|
|
- .multilineTextAlignment(.center)
|
|
|
|
- .font(.font(size: 22,weight: .medium))
|
|
|
|
- .foregroundColor(.white)
|
|
|
|
- .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
-
|
|
|
|
- Spacer().frame(height: 16)
|
|
|
|
- Text(limit)
|
|
|
|
- .font(.font(size: 14,weight: .regular))
|
|
|
|
- .multilineTextAlignment(.center)
|
|
|
|
- .foregroundColor(.white.opacity(0.7))
|
|
|
|
- .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
-
|
|
|
|
- Spacer().frame(height: 15)
|
|
|
|
- VStack(alignment: .leading, spacing: 20, content: {
|
|
|
|
- TSPurchaseVideoTimesCellView(type: .purchase(.videoNum1), selectedType: $viewModel.selectedType)
|
|
|
|
- .onTapGesture {
|
|
|
|
- viewModel.selectedType = .purchase(.videoNum1)
|
|
|
|
- }
|
|
|
|
- ZStack(alignment: .topTrailing) {
|
|
|
|
- TSPurchaseVideoTimesCellView(type: .purchase(.videoNum2), selectedType: $viewModel.selectedType)
|
|
|
|
- .onTapGesture {
|
|
|
|
- viewModel.selectedType = .purchase(.videoNum2)
|
|
|
|
- }
|
|
|
|
- TSPurchaseVideoTimesRecView()
|
|
|
|
- .offset(x:-12,y:-14)
|
|
|
|
- }
|
|
|
|
- TSPurchaseVideoTimesCellView(type: .purchase(.videoNum3), selectedType: $viewModel.selectedType)
|
|
|
|
- .onTapGesture {
|
|
|
|
- viewModel.selectedType = .purchase(.videoNum3)
|
|
|
|
- }
|
|
|
|
- }).multilineTextAlignment(.center).font(.font(size: 16,weight:.regular)).foregroundColor(.white)
|
|
|
|
-
|
|
|
|
- Spacer().frame(height: 28)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- Button {
|
|
|
|
- viewModel.buyPublisher.send(true)
|
|
|
|
- } label: {
|
|
|
|
- ZStack {
|
|
|
|
- Image(.purchaseVideoTimesBtnbg)
|
|
|
|
- Text("Purchase".localized)
|
|
|
|
- .font(.font(size: 16,weight: .medium))
|
|
|
|
- .foregroundColor(.white)
|
|
|
|
- }.frame(maxWidth: .infinity ,minHeight: 48.0,maxHeight: 48.0)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- VStack{
|
|
|
|
- Spacer().frame(height: 15)
|
|
|
|
- Button {
|
|
|
|
- withAnimation(.easeInOut(duration: 0.3)) {
|
|
|
|
- isExpand.toggle()
|
|
|
|
- }
|
|
|
|
- } label: {
|
|
|
|
- HStack(spacing: 4) {
|
|
|
|
- Text("View Usage Rules".localized)
|
|
|
|
- .font(.font(size: 12,weight: .regular))
|
|
|
|
- .foregroundColor(.white.opacity(0.7))
|
|
|
|
- Image(isExpand ? .chatUpArrow : .chatDownArrow)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if isExpand {
|
|
|
|
-
|
|
|
|
- Spacer().frame(height: 10)
|
|
|
|
-
|
|
|
|
- VStack(alignment: .leading, spacing: 8, content: {
|
|
|
|
- TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Only VIP can purchase video effect uses".localized)
|
|
|
|
- TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Uses can be applied to all video generations".localized)
|
|
|
|
- TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Uses never expire and can be purchased repeatedly".localized)
|
|
|
|
- TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "All unused uses will be lost if the app is uninstalled".localized)
|
|
|
|
- })
|
|
|
|
- .foregroundColor(Color.hex("#FCE5FF").opacity(0.8))
|
|
|
|
- .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
|
-
|
|
|
|
- Spacer().frame(height: 24 + k_Height_safeAreaInsetsBottom())
|
|
|
|
- }else{
|
|
|
|
- Spacer().frame(height: k_Height_safeAreaInsetsBottom())
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- .padding(.horizontal,16)
|
|
|
|
- .background(
|
|
|
|
- Color.hex("#261840").cornerRadius([.topLeading,.topTrailing], 20)
|
|
|
|
- )
|
|
|
|
-
|
|
|
|
- Button {
|
|
|
|
- viewModel.closePagePublisher.send(true)
|
|
|
|
- } label: {
|
|
|
|
- Image(.closeClear).resizable().frame(width: 24, height: 24)
|
|
|
|
- }.offset(x:-8,y:8)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .ignoresSafeArea()
|
|
|
|
- }
|
|
|
|
-}
|
|
|