소스 검색

3.6.28(2)修改 bug后,提测

100Years 2 일 전
부모
커밋
fa14622399

+ 4 - 4
AIEmoji.xcodeproj/project.pbxproj

@@ -3276,7 +3276,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -3292,7 +3292,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.27;
+				MARKETING_VERSION = 3.6.28;
 				PRODUCT_BUNDLE_IDENTIFIER = com.girl.music.wallpaper;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -3315,7 +3315,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -3331,7 +3331,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.27;
+				MARKETING_VERSION = 3.6.28;
 				PRODUCT_BUNDLE_IDENTIFIER = com.girl.music.wallpaper;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

+ 1 - 1
AIEmoji.xcodeproj/xcshareddata/xcschemes/AIEmoji.xcscheme

@@ -31,7 +31,7 @@
       shouldAutocreateTestPlan = "YES">
    </TestAction>
    <LaunchAction
-      buildConfiguration = "Debug"
+      buildConfiguration = "Release"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       launchStyle = "0"

+ 1 - 1
AIEmoji/Business/TSPTPGeneratorVC/TSPTPInputVC/TSPTPInputVC.swift

@@ -275,7 +275,7 @@ class TSPTPInputVC: TSBaseVC {
         }
         creatBtnView.isClickVipBlock = { [weak self] in
             guard let self = self else { return false }
-            var isVip = kPurchaseDefault.freeNumAvailable(type: .picToPic) == false
+            var isVip = kPurchaseDefault.freeNumAvailable(type: .picToPic) == false //废弃文件,后面删除
             if viewModel.selectedPTPStyleModel.isVip == true {
                 isVip = true
             }

+ 220 - 223
AIEmoji/Business/TSPurchaseMembershipVC/TSPurchaseVideoTimesVC/View/TSPurchaseVideoTimesAlertView.swift

@@ -8,135 +8,243 @@
 import SwiftUI
 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 {
 //    @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) {
+//                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 {
 //                    viewModel.closePagePublisher.send(true)
 //                } label: {
@@ -147,114 +255,3 @@ import SwiftUIX
 //        .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()
-    }
-}

+ 2 - 1
AIEmoji/Business/TSPurchaseMembershipVC/TSPurchaseVideoTimesVC/View/TSPurchaseVideoTimesView.swift

@@ -22,6 +22,7 @@ struct TSPurchaseVideoTimesView :View {
                     Spacer().frame(height: 40)
                     
                     Text("Video Effect Use Pack".localized)
+                        .multilineTextAlignment(.center)
                         .font(.font(name:.PoppinsBoldItalic,size: 22))
                         .gradientForeground(colors: [Color.hex("#8C5FFF"),Color.hex("#F680F8")], startPoint:.leading, endPoint:.trailing)
                         .padding(EdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10))
@@ -96,7 +97,7 @@ struct TSPurchaseVideoTextLineView: View {
    var body: some View {
        HStack(alignment: .top, spacing: 4) {
            Image(image).resizable().frame(width: 24, height: 24)
-           Text(text).lineLimit(2).multilineTextAlignment(.leading).font(.font(size: 16,weight:.regular)).foregroundColor(.white)
+           Text(text).lineLimit(2).multilineTextAlignment(.leading).font(.font(size: 16,weight:.regular)).foregroundColor(Color.hex("#FCE5FF").opacity(0.8))
        }.frame(height: 40)
    }
 }

+ 1 - 1
AIEmoji/Business/TSSetingVC/SetingVC/TSSetingViewModel.swift

@@ -97,7 +97,7 @@ class TSSetingViewModel: ObservableObject {
     }
     
     func purchaseVideoTimesVC(parent: UIViewController) {
-        kPresentModalVC(target: parent, modelVC: TSPurchaseVideoTimesVC(isShowAlertModel: false))
+        kPresentModalVC(target: parent, modelVC: TSPurchaseVideoTimesVC(isShowAlertModel: false),transitionStyle:.crossDissolve)
     }
 }
 

+ 1 - 1
AIEmoji/Business/VIewTool/TSGeneratorloadingView/TSGeneratorErrorView.swift

@@ -135,7 +135,7 @@ extension TSGeneratorErrorView {
     
     
     func generateToMaxView() {
-        submitBtn.setTitle("Try Again".localized, for: .normal)
+        submitBtn.setTitle("Got it".localized, for: .normal)
         errorImageView.image = UIImage(named: "yellow_warning")
         
         errorImageView.snp.updateConstraints { make in

+ 18 - 9
AIEmoji/Business2/DIYVideo/TSAIDiyVideoVC.swift

@@ -169,16 +169,25 @@ extension TSAIDiyVideoVC: JXSegmentedListContainerViewDataSource {
 }
 
 extension TSAIDiyVideoVC {
-    func generateVideo() {
-        //判断是否允许用户点生成按钮
-        guard kPurchaseDefault.isVip == true ||  (kPurchaseDefault.videoAvailableNum > 0)else {
-            //判断是否需要购买视频加油包
-            if kPurchaseDefault.judgePurchaseVideoPackage(vipFreeNumType: VipFreeNumType.videoV2,isCanFree: false, target: self){ return }
-            //否则弹 vip订阅提示
-            TSPurchaseVC.show(target: self, closePageBlock: nil)
-            return
-        }
+    
+    
+    
+    func isInterceptGenerateVideo()->Bool{
         
+        if kPurchaseDefault.isHaveGeneratedNum(type: .videoV2) {
+            return false
+        }else{
+            if kPurchaseDefault.isVip {//如果是 vip,但次数不够,则提示去买次数
+                kPurchaseDefault.judgePurchaseVideoPackage(vipFreeNumType: VipFreeNumType.videoV2,isCanFree: false, target: self)
+            }else{
+                //否则弹订阅 vip提示
+                TSPurchaseVC.show(target: self, closePageBlock: nil)
+            }
+        }
+        return  true
+    }
+    func generateVideo() {
+        if isInterceptGenerateVideo() { return}
         if segmentedView.selectedIndex == 0 {
             guard let img = ptvVc.viewModel.uploadImage else {
                 return

+ 22 - 22
AIEmoji/Business2/DisCover/TSAIGenerateVC/TSAIGenerateVC.swift

@@ -54,8 +54,6 @@ class TSAIGenerateVC: TSAIGenerateBaseVC {
                 clickTryAgainBtn()
             case .sensitiveError:
                 pickSinglePhoto()
-            case .generateToMax:
-                clickTryAgainBtn()
             default:
                 self.dismiss(animated: false, completion: nil)
                 break
@@ -153,8 +151,10 @@ class TSAIGenerateVC: TSAIGenerateBaseVC {
     // 重新生成
     @objc override func clickRegenerateBtn() {
         // 判断 vip
-//        if kJudgeVip(externalBool: kPurchaseDefault.freeNumAvailable(type: .aiGenerate) == false, vc: self) { return }
-        if kJudgeVip(externalBool: kPurchaseDefault.freeNumAvailable(type: generatorModel.generatorStyle.vipFreeNumType) == false, vc: self) { return }
+        if kJudgeVip(externalBool:kPurchaseDefault.freeNumAvailable(type: generatorModel.generatorStyle.vipFreeNumType) == false, vc: self) { return }
+        //判断是否需要购买视频加油包
+        if kPurchaseDefault.judgePurchaseVideoPackage(vipFreeNumType: generatorModel.generatorStyle.vipFreeNumType, target: self){ return }
+        
         infoModel?.actionStatus = .failed // 状态设为失败,走generatorCreat
         uuidString = UUID().uuidString // 设置新的uuid,新的储存数据
         generatorOperation() // 开始生成
@@ -344,12 +344,12 @@ extension TSAIGenerateVC {
         progressState = state
         switch state {
         case let .failed(errorStr, code):
-            if handleGenerateToMax(code: code,completion: { [weak self]  in
-                guard let self = self else { return }
-                self.showError(text: errorStr, code: code)
-            }){}else {
+//            if handleGenerateToMax(code: code,completion: { [weak self]  in
+//                guard let self = self else { return }
+//                self.showError(text: errorStr, code: code)
+//            }){}else {
                 showError(text: errorStr, code: code)
-            }
+//            }
         case .success:
             if let model = model {
                 showSuccess(model: model)
@@ -397,16 +397,16 @@ extension TSAIGenerateVC {
     }
 }
 
-extension TSAIGenerateVC {
-    
-    func handleGenerateToMax(code:Int,completion: (() -> Void)? = nil) -> Bool {
-        //如果是vip次数超限,则主动触发,让 vc去谈起购买次数的弹窗
-        let style = TSNetWorkCode.getGeneratorStyle(code: code)
-        if style == .generateToMax{
-            kPresentModalVC(target: self, modelVC: TSPurchaseVideoTimesVC(isShowAlertModel: true),transitionStyle:.crossDissolve,completion: completion)
-            return true
-        }
-        
-        return false
-    }
-}
+//extension TSAIGenerateVC {
+//    
+//    func handleGenerateToMax(code:Int,completion: (() -> Void)? = nil) -> Bool {
+//        //如果是vip次数超限,则主动触发,让 vc去谈起购买次数的弹窗
+//        let style = TSNetWorkCode.getGeneratorStyle(code: code)
+//        if style == .generateToMax{
+//            kPresentModalVC(target: self, modelVC: TSPurchaseVideoTimesVC(isShowAlertModel: true),transitionStyle:.crossDissolve,completion: completion)
+//            return true
+//        }
+//        
+//        return false
+//    }
+//}

+ 1 - 1
AIEmoji/Business2/DisCover/TSPTPUploadImageVC/TSPTPUploadImageVC+View.swift

@@ -59,7 +59,7 @@ extension TSPTPUploadImageVC {
         }
         creatBtnView.isClickVipBlock = { [weak self] in
             guard let self = self else { return false }
-            var isVip = kPurchaseDefault.freeNumAvailable(type: vipFreeNumType)
+            var isVip = kPurchaseDefault.freeNumAvailable(type: vipFreeNumType) == false
             if isVip == false,vipFreeNumType == .videoV2 {//只对视频做模型 vip 判断
                 isVip = self.viewModel.selectedPTPStyleModel.isVip
             }

+ 2 - 2
AIEmoji/Common/Purchase/TSPurchaseManager+Free.swift

@@ -11,7 +11,7 @@ extension PurchaseManager {
     
     /// 使用一次免费次数
     func useOnceForFree(type: VipFreeNumType) {
-        if isVip || videoAvailableNum > 0 {
+        if isVip || isHaveGeneratedNum(type: type) {
             saveForDayGeneratedNum(type: type)
             saveForVipGeneratedNum(type: type)
         }else{
@@ -108,7 +108,7 @@ extension PurchaseManager {
 
     /// 免费次数是否可用
     func freeNumAvailable(type: VipFreeNumType) -> Bool {
-        if isVip == true {
+        if isVip == true || isHaveGeneratedNum(type: type) {
             return true
         } else {
             if freeNum(type: type) > 0 {

+ 4 - 3
AIEmoji/Common/Purchase/TSPurchaseManager+Judge.swift

@@ -146,12 +146,13 @@ extension PurchaseManager {
     
     
     //判断是否可以生成,包含视频判断
-    func isCanGenerated(type: VipFreeNumType) -> Bool {
+    func isHaveGeneratedNum(type: VipFreeNumType) -> Bool {
         //视频类做另外的特殊判断
         if (type.isVideo && videoAvailableNum > 0) {
             return true
         }
-        
-        return freeNumAvailable(type: type)
+        return false
     }
+    
+
 }

+ 1 - 1
AIEmoji/Common/Purchase/TSPurchaseManager.swift

@@ -136,7 +136,7 @@ public class PurchaseManager: NSObject {
 
     public var vipType: PremiumPeriod {
 //#if DEBUG
-//        return PremiumPeriod.year
+//        return PremiumPeriod.week(.week)
 //#endif
         guard isVip, let type = vipInformation["type"] as? String else {
             return .none

+ 0 - 5
AIEmoji/Common/SchemeHandler/SchemeHandler+Ext.swift

@@ -34,11 +34,6 @@ extension SchemeHandler {
     /// 打开文生图页面
     func handleTextToImageOpen(params: [URLQueryItem]?) {
         WindowHelper.resetToTabBarController(at: 2)
-//        DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
-//            if let top = WindowHelper.topViewController() {
-//                kPushVC(target: top, modelVC: TSTextGeneralPictureVC())
-//            }
-//        }
     }
 
     /// 打开母亲节活动页面