100Years 2 settimane fa
parent
commit
fe8f64489b

+ 4 - 4
AIEmoji.xcodeproj/project.pbxproj

@@ -2824,7 +2824,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 4;
+				CURRENT_PROJECT_VERSION = 5;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -2840,7 +2840,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.18;
+				MARKETING_VERSION = 3.6.20;
 				PRODUCT_BUNDLE_IDENTIFIER = com.girl.music.wallpaper;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -2863,7 +2863,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 4;
+				CURRENT_PROJECT_VERSION = 5;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -2879,7 +2879,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.18;
+				MARKETING_VERSION = 3.6.20;
 				PRODUCT_BUNDLE_IDENTIFIER = com.girl.music.wallpaper;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

+ 6 - 1
AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/View/TSGenmojiItemCell.swift

@@ -30,6 +30,11 @@ class TSGenmojiItemCell: TSBaseCollectionCell ,TSSimpleConfigurableView {
                             self.updataActionInfoModelView(model: actionInfoModel)
                         }
                     }
+                    operation.processProgressChanged = { [weak self] progress in
+                        guard let self = self else { return }
+                        generateView.setProgress(progress: progress)
+                    }
+                    
                     self.operation = operation
                 }
             }else{
@@ -132,7 +137,7 @@ class TSGenmojiItemCell: TSBaseCollectionCell ,TSSimpleConfigurableView {
         switch model.actionStatus {
         case .pending,.running:
             generateView.isHidden = false
-            generateView.setProgress(progress: model.percent)
+//            generateView.setProgress(progress: model.percent*kPercentScale)
         case .success:
             generateView.isHidden = true
             

+ 1 - 1
AIEmoji/Business2/DisCover/Data/TSDiscoverViewModel.swift

@@ -372,7 +372,7 @@ class TSDiscoverViewModel {
         section.items = [
             TSDiscoverItemModel(style: .ttp,
                                 viewModel: TSDiscoverBaseItemVM(
-                                    title: "AI ➡️ Photo".localized,
+                                    title: "Text ➡️ Photo".localized,
                                     imageNamed: "discover_ttp",
                                     info: "Turn words into visually stunning artwork".localized
                                 ),

+ 1 - 1
AIEmoji/Business2/DisCover/TSGenerateHistoryVC/View/TSGenerateHistoryCell.swift

@@ -54,7 +54,7 @@ class TSGenerateHistoryCell: TSBaseCollectionCell {
                     generateView.setProgress(progress: 0)
                 }else{
                     if let window = WindowHelper.getCurrentWindow() {
-                        kTextToastShared.show(atView: window,text: "1 task is processing".localized){
+                        kTextToastShared.show(atView: window,text: String(format: "%d task is processing".localized, 1)){
                             TSGenerateHistoryVC.showPosition()
                         }
                     }

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

@@ -203,9 +203,9 @@ public class PurchaseManager: NSObject {
     }
 
     @objc public var isVip: Bool {
-//#if DEBUG
-//        return vipType != .none
-//#endif
+#if DEBUG
+        return vipType != .none
+#endif
         guard let expiresDate = expiredDate else {
             return false
         }
@@ -217,9 +217,9 @@ public class PurchaseManager: NSObject {
     }
 
     public var vipType: PremiumPeriod {
-//#if DEBUG
-//        return PremiumPeriod.year
-//#endif
+#if DEBUG
+        return PremiumPeriod.year
+#endif
         guard isVip, let type = vipInformation["type"] as? String else {
             return .none
         }

+ 4 - 4
AIEmoji/Common/Tool/OperationQueue/V2/TSGenerateBaseOperation.swift

@@ -58,9 +58,6 @@ class TSGenerateBaseOperation: TSBaseOperation , @unchecked Sendable{
     @Published var stateDatauPblished:(TSProgressState,TSActionInfoModel?) = (TSProgressState.none,nil){
         didSet{
 //            dePrint("TSBaseOperation stateDatauPblished didSet = \(stateDatauPblished)")
-
-            self.stateDataPblishedChanged?(self.stateDatauPblished.0,self.stateDatauPblished.1)
-            
             if case .start = stateDatauPblished.0 {
                 start()
             }else if stateDatauPblished.0.isResult {
@@ -87,7 +84,7 @@ class TSGenerateBaseOperation: TSBaseOperation , @unchecked Sendable{
     }
     
     var currentActionInfoModelChanged:((TSActionInfoModel)->Void)?
-    var stateDataPblishedChanged:((TSProgressState,TSActionInfoModel?)->Void)?
+    var processProgressChanged:((Float)->Void)?
     @Published var currentActionInfoModel: TSActionInfoModel = TSActionInfoModel()
     
     func initializeActionInfoModel(oldModel:TSActionInfoModel) {
@@ -153,6 +150,7 @@ class TSGenerateBaseOperation: TSBaseOperation , @unchecked Sendable{
                         handleFailInfoModel(errorString:infoModel.response.codeErrorMsg,code: infoModel.response.code)
                     default:
                         stateDatauPblished = (.progressString(generating(progress: infoModel.percent)),currentActionInfoModel)
+                        processProgressChanged?(infoModel.percent*kPercentScale)
                         if stopNetwork == false {
                             kDelayOnMainThread(2.0) {
                                 self.getActionInfo(action_id: action_id)
@@ -233,6 +231,7 @@ class TSGenerateBaseOperation: TSBaseOperation , @unchecked Sendable{
             let progressInt = Int(progress*10.0)
             let progressString = self.generatingText + " " + kPercentlocalized(kPercentScaleInt + progressInt)
             self.stateDatauPblished = (.progressString(progressString),nil)
+            self.processProgressChanged?(0.9+Float(progress)*0.1)
             dePrint("生成后视频下载进度: \(progress)")
         } complete: { url, _ in
             completion(url)
@@ -246,6 +245,7 @@ class TSGenerateBaseOperation: TSBaseOperation , @unchecked Sendable{
             let progressInt = Int(progress*10.0)
             let progressString = self.generatingText + " " + kPercentlocalized(kPercentScaleInt + progressInt)
             stateDatauPblished = (.progressString(progressString),currentActionInfoModel)
+            self.processProgressChanged?(0.9+Float(progress)*0.1)
             dePrint("生成后图片下载进度: \(progress)")
         } completion: { image in
             completion(image)

+ 2 - 1
AIEmoji/Common/Tool/OperationQueue/V2/TSGenerateBasePhotoOperation.swift

@@ -29,8 +29,9 @@ class TSGenerateBasePhotoOperationQueue: TSGenerateBaseOperationQueue {
     
     
     static func isAvailabilityHandle(view:UIView)->Bool{
+        
         if TSGenerateBasePhotoOperationQueue.shared.isAvailability == false {
-            kTextToastShared.show(atView: view,text: "1 task is processing".localized){
+            kTextToastShared.show(atView: view,text: String(format: "%d task is processing".localized, 1)){
                 TSGenerateHistoryVC.showPosition()
             }
             return true

+ 1 - 1
AIEmoji/Common/View/TSTextToastView.swift

@@ -103,7 +103,7 @@ open class TSTextToastView {
         return bottom
     }
     
-    public func show(atView:UIView,text:String = "1 task is processing".localized,deadline:Double = 5.0,bottom:CGFloat = -112,showViewBtn:Bool = true,clickViewHandle:(()->Void)? = nil) {
+    public func show(atView:UIView,text:String = String(format: "%d task is processing".localized, 1),deadline:Double = 5.0,bottom:CGFloat = -112,showViewBtn:Bool = true,clickViewHandle:(()->Void)? = nil) {
         self.clickViewHandle = clickViewHandle
         kExecuteOnMainThread {
             self.textLabel.text = text