瀏覽代碼

修改一些 bug

100Years 1 月之前
父節點
當前提交
8cdb736ab6

+ 1 - 1
AIRingtone/Business/LaunchVC/TSLaunchVC.swift

@@ -60,7 +60,7 @@ class TSLaunchVC: UIViewController {
     func enterApp() {
         AppDelegate.showEveryDayPopPurchase { vc in
             if let vc = vc {
-                self.navigationController?.pushViewController(vc, animated: true)
+                kPresentModalVC(target:self, modelVC: vc)
             }else{
                 self.dismissHandler?()
             }

+ 4 - 0
AIRingtone/Business/TSPurchaseMembershipVC/TSPurchaseVC.swift

@@ -72,6 +72,10 @@ class TSPurchaseVC: TSBaseVC {
     override func dealThings() {
         addNotifaction()
         onPurchaseStateChanged()
+        NotificationCenter.default.addObserver(forName: .kPurchasePrepared, object: nil, queue: OperationQueue.main) { [weak self] _ in
+            guard let self = self else { return }
+            viewModel.selectedType = viewModel.selectedType
+        }
     }
     
     

+ 41 - 41
AIRingtone/Common/Tool/OperationQueue/TSGenerateBaseOperation/TSGeneratePhotoOperation.swift

@@ -55,47 +55,47 @@ class TSGeneratePhotoOperation: TSGenerateBaseOperation , @unchecked Sendable{
         kPurchaseToolShared.useOnceForFree(type: .photo)
     }
     
-//    //模拟数据
-//    func creatPhoto(oldModel:TSActionInfoModel? = nil,prompt:String,promptSort:String) {
-//        if let model = oldModel {
-//            currentActionInfoModel = model
-//        }else {
-//            currentActionInfoModel.id = Int.timestampInt()
-//            currentActionInfoModel.request.prompt = prompt
-//            currentActionInfoModel.request.promptSort = promptSort
-//            currentActionInfoModel.actionStatus = .pending
-//            currentActionInfoModel.status = "pending"
-//        }
-//        
-//        replaceSaveInfoModel(model: currentActionInfoModel)
-//        stateDatauPblished = (.start,currentActionInfoModel)
-//        let time = 5.0
-//        
-//        for i in 0..<Int(time){
-//            kDelayOnMainThread(Double(i)) {
-//                let progress = Float(i)*10/100.0
-//                self.currentActionInfoModel.percent = progress
-//                self.currentActionInfoModel.actionStatus = .running
-//                self.currentActionInfoModel.status = "running"
-//                self.replaceSaveInfoModel(model: self.currentActionInfoModel)
-//                self.stateDatauPblished = (.progressString(self.generating(progress: progress)),nil)
-//            }
-//        }
-//
-//        kDelayOnMainThread(time+1.0) {
-//            if kRandomBool(), let infoModel = TSActionInfoModel(JSON: self.actionInfoDict){
-//                infoModel.id = Int.uuid
-//                self.replaceSaveInfoModel(model: infoModel)
-//                self.stateDatauPblished = (.success(nil),self.currentActionInfoModel)
-//            }else{
-//                self.currentActionInfoModel.actionStatus = .failed
-//                self.currentActionInfoModel.status = "failed"
-//                self.replaceSaveInfoModel(model: self.currentActionInfoModel)
-//                self.stateDatauPblished = (.failed("error?.localizedDescription"),nil)
-//            }
-////            TSPhotoHistory.shared.dePrintAllModel()
-//        }
-//    }
+    //模拟数据
+    func creatPhoto(oldModel:TSActionInfoModel? = nil,prompt:String,promptSort:String) {
+        if let model = oldModel {
+            currentActionInfoModel = model
+        }else {
+            currentActionInfoModel.id = Int.timestampInt()
+            currentActionInfoModel.request.prompt = prompt
+            currentActionInfoModel.request.promptSort = promptSort
+            currentActionInfoModel.actionStatus = .pending
+            currentActionInfoModel.status = "pending"
+        }
+        
+        replaceSaveInfoModel(model: currentActionInfoModel)
+        stateDatauPblished = (.start,currentActionInfoModel)
+        let time = 5.0
+        
+        for i in 0..<Int(time){
+            kDelayOnMainThread(Double(i)) {
+                let progress = Float(i)*10/100.0
+                self.currentActionInfoModel.percent = progress
+                self.currentActionInfoModel.actionStatus = .running
+                self.currentActionInfoModel.status = "running"
+                self.replaceSaveInfoModel(model: self.currentActionInfoModel)
+                self.stateDatauPblished = (.progressString(self.generating(progress: progress)),nil)
+            }
+        }
+
+        kDelayOnMainThread(time+1.0) {
+            if kRandomBool(), let infoModel = TSActionInfoModel(JSON: self.actionInfoDict){
+                infoModel.id = Int.uuid
+                self.replaceSaveInfoModel(model: infoModel)
+                self.stateDatauPblished = (.success(nil),self.currentActionInfoModel)
+            }else{
+                self.currentActionInfoModel.actionStatus = .failed
+                self.currentActionInfoModel.status = "failed"
+                self.replaceSaveInfoModel(model: self.currentActionInfoModel)
+                self.stateDatauPblished = (.failed("error?.localizedDescription"),nil)
+            }
+//            TSPhotoHistory.shared.dePrintAllModel()
+        }
+    }