|
@@ -13,95 +13,102 @@ struct TSPurchaseVideoTimesAlertView :View {
|
|
|
@State var isExpand: Bool = false
|
|
|
var body: some View {
|
|
|
VStack {
|
|
|
+ let limit = "You've hit your limit. Get more effect credits below.".localized
|
|
|
|
|
|
Spacer()
|
|
|
-
|
|
|
- VStack {
|
|
|
- Spacer().frame(height: 24)
|
|
|
- Text("Limit Reached".localized)
|
|
|
- .font(.font(size: 22,weight: .medium))
|
|
|
- .foregroundColor(.white)
|
|
|
- .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
-
|
|
|
- Spacer().frame(height: 16)
|
|
|
- Text("You've hit your weekly limit. Get more effect credits below.".localized)
|
|
|
- .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)
|
|
|
+ ZStack(alignment: .topTrailing) {
|
|
|
+ VStack {
|
|
|
+ Spacer().frame(height: 24)
|
|
|
+ Text("Limit Reached".localized)
|
|
|
+ .font(.font(size: 22,weight: .medium))
|
|
|
+ .foregroundColor(.white)
|
|
|
+ .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
+
|
|
|
+ Spacer().frame(height: 16)
|
|
|
+ Text(limit)
|
|
|
+ .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(.videoNum2)
|
|
|
+ viewModel.selectedType = .purchase(.videoNum1)
|
|
|
}
|
|
|
- TSPurchaseVideoTimesRecView()
|
|
|
- .offset(x:-30,y:-14)
|
|
|
- }
|
|
|
- TSPurchaseVideoTimesCellView(type: .purchase(.videoNum3), selectedType: $viewModel.selectedType)
|
|
|
- .onTapGesture {
|
|
|
- viewModel.selectedType = .purchase(.videoNum3)
|
|
|
+ ZStack(alignment: .topTrailing) {
|
|
|
+ TSPurchaseVideoTimesCellView(type: .purchase(.videoNum2), selectedType: $viewModel.selectedType)
|
|
|
+ .onTapGesture {
|
|
|
+ viewModel.selectedType = .purchase(.videoNum2)
|
|
|
+ }
|
|
|
+ TSPurchaseVideoTimesRecView()
|
|
|
+ .offset(x:-30,y:-14)
|
|
|
}
|
|
|
- }).multilineTextAlignment(.center).font(.font(size: 16,weight:.regular)).foregroundColor(.white)
|
|
|
-
|
|
|
- Spacer().frame(height: 44)
|
|
|
-
|
|
|
-
|
|
|
- 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)
|
|
|
+ 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: 44)
|
|
|
+
|
|
|
+
|
|
|
Button {
|
|
|
- withAnimation(.easeInOut(duration: 0.3)) {
|
|
|
- isExpand.toggle()
|
|
|
- }
|
|
|
+ viewModel.buyPublisher.send(true)
|
|
|
} label: {
|
|
|
- HStack(spacing: 4) {
|
|
|
- Text("View Credit Rules".localized)
|
|
|
- .font(.font(size: 12,weight: .regular))
|
|
|
- .foregroundColor(.white.opacity(0.7))
|
|
|
- Image(isExpand ? .chatUpArrow : .chatDownArrow)
|
|
|
- }
|
|
|
+ ZStack {
|
|
|
+ Image(.purchaseVideoTimesBtnbg)
|
|
|
+ Text("Purchase".localized)
|
|
|
+ .font(.font(size: 16,weight: .medium))
|
|
|
+ .foregroundColor(.white)
|
|
|
+ }.frame(maxWidth: .infinity ,minHeight: 48.0,maxHeight: 48.0)
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- if isExpand {
|
|
|
|
|
|
- Spacer().frame(height: 10)
|
|
|
|
|
|
- VStack(alignment: .leading, spacing: 8, content: {
|
|
|
- TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Only VIP can purchase video effect credits".localized)
|
|
|
- TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Credits can be applied to all video generations".localized)
|
|
|
- TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Credits never expire and can be purchased repeatedly".localized)
|
|
|
- TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "All unused credits will be lost if the app is uninstalled".localized)
|
|
|
- })
|
|
|
- .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
|
|
|
+ VStack{
|
|
|
+ Spacer().frame(height: 15)
|
|
|
+ Button {
|
|
|
+ withAnimation(.easeInOut(duration: 0.3)) {
|
|
|
+ isExpand.toggle()
|
|
|
+ }
|
|
|
+ } label: {
|
|
|
+ HStack(spacing: 4) {
|
|
|
+ Text("View Credit Rules".localized)
|
|
|
+ .font(.font(size: 12,weight: .regular))
|
|
|
+ .foregroundColor(.white.opacity(0.7))
|
|
|
+ Image(isExpand ? .chatUpArrow : .chatDownArrow)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- Spacer().frame(height: 24 + k_Height_safeAreaInsetsBottom())
|
|
|
- }else{
|
|
|
- Spacer().frame(height: k_Height_safeAreaInsetsBottom())
|
|
|
- }
|
|
|
+ if isExpand {
|
|
|
+
|
|
|
+ Spacer().frame(height: 10)
|
|
|
+
|
|
|
+ VStack(alignment: .leading, spacing: 8, content: {
|
|
|
+ TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Only VIP can purchase video effect credits".localized)
|
|
|
+ TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Credits can be applied to all video generations".localized)
|
|
|
+ TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "Credits never expire and can be purchased repeatedly".localized)
|
|
|
+ TSPurchaseVideoTextLineView(image: .purchaseVideoTimesCheck, text: "All unused credits 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 {
|
|
|
+ viewModel.closePagePublisher.send(true)
|
|
|
+ } label: {
|
|
|
+ Image(.closeClear).resizable().frame(width: 24, height: 24)
|
|
|
+ }.offset(x:-8,y:8)
|
|
|
}
|
|
|
- .padding(.horizontal,16)
|
|
|
- .background(
|
|
|
- Color.hex("#261840").cornerRadius([.topLeading,.topTrailing], 20)
|
|
|
- )
|
|
|
-
|
|
|
}
|
|
|
.ignoresSafeArea()
|
|
|
}
|