瀏覽代碼

打包2.7(2),修改上个版本bug

100Years 1 周之前
父節點
當前提交
ab4299aad0

+ 2 - 2
AIEmoji.xcodeproj/project.pbxproj

@@ -1944,7 +1944,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;
@@ -1983,7 +1983,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;

+ 28 - 21
AIEmoji/Business/TSGenmojiVC/TSGenmojiGennerateVC/TSGenmojiGennerateVC.swift

@@ -9,6 +9,7 @@ class TSGenmojiGennerateVC: TSBottomAlertVC {
     
     var imageModel:TSGenmojiModel?
     var complete:((TSGenmojiModel)->Void)
+    var progressState = TSProgressState.none
     var aiText:String
     init(aiText: String,complete:@escaping ((TSGenmojiModel)->Void)) {
         self.aiText = aiText
@@ -52,27 +53,32 @@ class TSGenmojiGennerateVC: TSBottomAlertVC {
     }
     
     override func closePage() {
-        TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
-            message: "As you leave, your generation will be interrupted and no result.".localized,
-            messageColor: .white,
-            messageFont: .systemFont(ofSize: 16),
-            
-            cancelTitle: "Leave".localized,
-            cancelColor: .white,
-            
-            confirmTitle: "Wait".localized,
-            confirmColor: .themeColor,
-            
-            cancelAction: { [weak self]  in
-                guard let self = self else { return }
-                print("用户点击了Leave")
-                viewModel.cancelAllRequest()
-                self.dismiss(animated: true, completion: nil)
-            },
-            confirmAction: {
-                print("用户点击了Stay")
-            }
-        ))
+        if progressState.isResult {
+            viewModel.cancelAllRequest()
+            self.dismiss(animated: true, completion: nil)
+        }else{
+            TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
+                message: "As you leave, your generation will be interrupted and no result.".localized,
+                messageColor: .white,
+                messageFont: .systemFont(ofSize: 16),
+                
+                cancelTitle: "Leave".localized,
+                cancelColor: .white,
+                
+                confirmTitle: "Wait".localized,
+                confirmColor: .themeColor,
+                
+                cancelAction: { [weak self]  in
+                    guard let self = self else { return }
+                    print("用户点击了Leave")
+                    viewModel.cancelAllRequest()
+                    self.dismiss(animated: true, completion: nil)
+                },
+                confirmAction: {
+                    print("用户点击了Stay")
+                }
+            ))
+        }
     }
     
     
@@ -121,6 +127,7 @@ extension TSGenmojiGennerateVC {
 }
 extension TSGenmojiGennerateVC {
     func upDateView(state:TSProgressState,model:TSGenmojiModel?){
+        progressState = state
         switch state {
             case .failed(let errorStr):
                 showError(text: errorStr)

+ 12 - 4
AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/View/TSGenmojiItemCell.swift

@@ -7,15 +7,18 @@
 
 class TSGenmojiItemCell: TSBaseCollectionCell {
     
-    lazy var exampleView: UIView = {
-        let exampleView = UIView()
-        exampleView.backgroundColor = "#232323".uiColor.withAlphaComponent(0.3)
-        
+    lazy var textLabel: UILabel = {
         let textLabel = UILabel.createLabel(
             text: "Example".localized,
             font: .font(size: 12),
             textColor: .white
         )
+        return textLabel
+    }()
+    
+    lazy var exampleView: UIView = {
+        let exampleView = UIView()
+        exampleView.backgroundColor = "#232323".uiColor.withAlphaComponent(0.3)
         
         exampleView.addSubview(textLabel)
         textLabel.snp.makeConstraints { make in
@@ -54,6 +57,11 @@ class TSGenmojiItemCell: TSBaseCollectionCell {
         super.renderView(with: object, component: component, attributes: attributes)
         if let itemModel = object as? TSGenmojiCoLItemModel{
             if itemModel.dataModel.modelType == .example {
+                
+                if itemModel.style == .ptpPicHistory {
+                    textLabel.text = "Ghibli Style Example"
+                }
+                
                 exampleView.isHidden = false
                 showImageView.image = UIImage(named: itemModel.dataModel.response.resultUrl)
             }else{

+ 29 - 25
AIEmoji/Business/TSPTPGeneratorVC/TSPTPGeneratorVC/TSPTPGeneratorVC.swift

@@ -14,7 +14,7 @@ class TSPTPGeneratorVC: TSAIPhotoGeneratorBaseVC {
     var promptSort:String
     var imageUrl:String
     var upLoadImage:UIImage
-
+    var progressState = TSProgressState.none
     init(prompt:String,promptSort:String,imageUrl:String,upLoadImage:UIImage,complete:@escaping ((TSGenmojiModel)->Void)) {
         self.prompt = prompt
         self.promptSort = promptSort
@@ -50,29 +50,32 @@ class TSPTPGeneratorVC: TSAIPhotoGeneratorBaseVC {
     }
     
     override func closePage() {
-        
-        TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
-            message: "As you leave, your generation will be interrupted and no result.".localized,
-            messageColor: .white,
-            messageFont: .systemFont(ofSize: 16),
-            
-            cancelTitle: "Leave".localized,
-            cancelColor: .white,
-            
-            confirmTitle: "Wait".localized,
-            confirmColor: .themeColor,
-            
-            cancelAction: { [weak self]  in
-                guard let self = self else { return }
-                print("用户点击了Leave")
-                viewModel.cancelAllRequest()
-                self.dismiss(animated: true, completion: nil)
-            },
-            confirmAction: {
-                print("用户点击了Stay")
-            }
-        ))
-   
+        if progressState.isResult {
+            viewModel.cancelAllRequest()
+            self.dismiss(animated: true, completion: nil)
+        }else{
+            TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
+                message: "As you leave, your generation will be interrupted and no result.".localized,
+                messageColor: .white,
+                messageFont: .systemFont(ofSize: 16),
+                
+                cancelTitle: "Leave".localized,
+                cancelColor: .white,
+                
+                confirmTitle: "Wait".localized,
+                confirmColor: .themeColor,
+                
+                cancelAction: { [weak self]  in
+                    guard let self = self else { return }
+                    print("用户点击了Leave")
+                    viewModel.cancelAllRequest()
+                    self.dismiss(animated: true, completion: nil)
+                },
+                confirmAction: {
+                    print("用户点击了Stay")
+                }
+            ))
+        }
     }
     
     //重试
@@ -124,7 +127,9 @@ extension TSPTPGeneratorVC {
     
 }
 extension TSPTPGeneratorVC {
+    
     func upDateView(state:TSProgressState,model:TSGenmojiModel?){
+        progressState = state
         switch state {
             case .failed(let errorStr):
                 showError(text: errorStr)
@@ -187,7 +192,6 @@ extension TSPTPGeneratorVC {
         bottomView.isHidden = false
         netWorkImageView.isHidden = false
         
-
         self.netWorkImageView.setAsyncImage(urlString: model.response.resultUrl,placeholder:kPlaceholderImage,backgroundColor:netWorkImageView.backgroundColor!){ [weak self] image in
             guard let self = self else { return }
             

+ 14 - 16
AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/Cell/TSPTPSelectStyleCell.swift

@@ -104,27 +104,25 @@ class TSPTPSelectStyleCCell: TSBaseCollectionCell {
     var itemModel:TSPTPStyleModel = TSPTPStyleModel(){
         didSet{
             imageView.image = UIImage(named: itemModel.imageName)
-
+            var strokeColor = UIColor.white
+            var font = UIFont.font(size: 14)
             if itemModel.style == 1 {
                 hotImageView.isHidden = false
-                
-                let font = UIFont.font(name:.PoppinsBlackItalic,size: 18)
-                textLabel.font = font
-                textLabel.attributedText = NSAttributedString(
-                    string: itemModel.imageText,
-                    attributes: [
-                        .strokeColor: "#FFB73C".uiColor,       // 描边颜色
-                        .strokeWidth: -4.0,                // 负值表示同时填充和描边(正值仅描边)
-                        .foregroundColor: UIColor.white,   // 文字填充色
-                        .font: font
-                    ]
-                )
+                font = UIFont.font(name:.PoppinsBlackItalic,size: 18)
+                strokeColor = "#FFB73C".uiColor
             }else{
                 hotImageView.isHidden = true
-                textLabel.font = .font(size: 14)
-                textLabel.attributedText = nil
             }
-            textLabel.text = itemModel.imageText
+        
+            textLabel.attributedText = NSAttributedString(
+                string: itemModel.imageText,
+                attributes: [
+                    .strokeColor: strokeColor,       // 描边颜色
+                    .strokeWidth: -4.0,                // 负值表示同时填充和描边(正值仅描边)
+                    .foregroundColor: UIColor.white,   // 文字填充色
+                    .font: font
+                ]
+            )
         }
     }
     

+ 8 - 3
AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/TSPhotoToPhotoVC.swift

@@ -120,7 +120,7 @@ class TSPhotoToPhotoVC: TSBaseVC {
             }else if let model = cellCp as? TSPTPStyleModel ,indexPath == IndexPath(item: 0, section: 1) {
                 //选择了某个样式
                 viewModel.selectedPTPStyleModel = model
-                kSetBtnVipIcon(btn: self.submitBtn, show: model.isVip)
+                updateVipView()
             }
         }
         
@@ -222,7 +222,6 @@ class TSPhotoToPhotoVC: TSBaseVC {
     override func dealThings() {
         NotificationCenter.default.addObserver(self, selector: #selector(vipInfoChanged), name: .kPurchaseDidChanged, object: nil)
         updateVipView()
-        kSetBtnVipIcon(btn: self.submitBtn, show: self.viewModel.selectedPTPStyleModel?.isVip ?? false)
     }
     
     @objc func vipInfoChanged() {
@@ -233,7 +232,13 @@ class TSPhotoToPhotoVC: TSBaseVC {
     func updateVipView() {
         kExecuteOnMainThread {
             self.vipBtn.isHidden = PurchaseManager.default.isVip
-            kSetBtnVipIcon(btn: self.submitBtn, show: kPurchaseDefault.generateVipShow(type: .picToPic))
+            
+            var showVip = kPurchaseDefault.generateVipShow(type: .picToPic)
+            if showVip == false {
+                showVip = self.viewModel.selectedPTPStyleModel?.isVip ?? false
+            }
+            
+            kSetBtnVipIcon(btn: self.submitBtn, show: showVip)
         }
     }
     @objc func clickCollectionView() {

+ 1 - 1
AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/VM/TSPhotoToPhotoVM.swift

@@ -64,7 +64,7 @@ class TSPhotoToPhotoVM {
         let uploadSectionModel = TSGenmojiCoLSectionModel()
         uploadSectionModel.style = .ptpUpload
         uploadSectionModel.name = "Upload Photo".localized
-        uploadSectionModel.subText = "(Size ≤ 10Mb)".localized
+        uploadSectionModel.subText = "(Size ≤ 10MB)".localized
         let itemModel = TSGenmojiCoLItemModel()
         itemModel.style = .ptpUpload
         itemModel.ptpStyleModels = [updateImageModel]

+ 1 - 1
AIEmoji/Business/TSSetingVC/SetingVC/View/SettingPurchaseTopView.swift

@@ -36,7 +36,7 @@ struct SettingPurchaseTopView: View {
                     
                     VStack(alignment: .leading,spacing: 12) {
 //                        Image(.settingNoVip).resizable().frame(width: 186*kDesignScale, height: 44*kDesignScale)
-                        customText(text: " \(kAppName) ",fontName: .KelsiRegular,color:UIColor.white.color).frame(height: 50*kDesignScale)
+                        customText(text: " \(kAppName) ",fontName: .KelsiFill,color:UIColor.white.color).frame(height: 50*kDesignScale)
                         HStack {
                             Text("Limited Time Discount")
                                 .font(.font(size: 14))

+ 6 - 3
AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/TSTTPInputVC.swift

@@ -50,7 +50,7 @@ class TSTTPInputVC: TSBaseVC {
         promptStyleView.selectedValueBlock = { [weak self] model in
             guard let self = self else { return }
             viewModel.selectPromptModel = model
-            kSetBtnVipIcon(btn: self.creatBtnView.creatBtn, show: model.isVip)
+            updateVipView()
         }
         return promptStyleView
     }()
@@ -103,7 +103,6 @@ class TSTTPInputVC: TSBaseVC {
     override func dealThings() {
         updateVipView()
         NotificationCenter.default.addObserver(self, selector: #selector(vipInfoChanged), name: .kPurchaseDidChanged, object: nil)
-        kSetBtnVipIcon(btn: self.creatBtnView.creatBtn, show: self.viewModel.selectPromptModel?.isVip ?? false)
     }
     
     @objc func vipInfoChanged() {
@@ -120,7 +119,11 @@ class TSTTPInputVC: TSBaseVC {
     
     func updateVipView() {
         kExecuteOnMainThread {
-            kSetBtnVipIcon(btn: self.creatBtnView.creatBtn, show: kPurchaseDefault.generateVipShow(type: .textGeneratePic))
+            var showVip = kPurchaseDefault.generateVipShow(type: .textGeneratePic)
+            if showVip == false {
+                showVip = self.viewModel.selectPromptModel?.isVip ?? false
+            }
+            kSetBtnVipIcon(btn: self.creatBtnView.creatBtn, show: showVip)
         }
     }
     

+ 28 - 22
AIEmoji/Business/TSTextGeneralPictureVC/TSTextPicGennerateVC/TSTextPicGennerateVC.swift

@@ -10,7 +10,7 @@ class TSTextPicGennerateVC: TSAIPhotoGeneratorBaseVC {
     var imageModel:TSGenmojiModel?
     var complete:((TSGenmojiModel)->Void)
     var aiText:String
-
+    var progressState = TSProgressState.none
     init(aiText: String,complete:@escaping ((TSGenmojiModel)->Void)) {
         self.aiText = aiText
         self.complete = complete
@@ -40,27 +40,32 @@ class TSTextPicGennerateVC: TSAIPhotoGeneratorBaseVC {
     }
     
     override func closePage() {
-        TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
-            message: "As you leave, your generation will be interrupted and no result.".localized,
-            messageColor: .white,
-            messageFont: .systemFont(ofSize: 16),
-            
-            cancelTitle: "Leave".localized,
-            cancelColor: .white,
-            
-            confirmTitle: "Wait".localized,
-            confirmColor: .themeColor,
-            
-            cancelAction: { [weak self]  in
-                guard let self = self else { return }
-                print("用户点击了Leave")
-                viewModel.cancelAllRequest()
-                self.dismiss(animated: true, completion: nil)
-            },
-            confirmAction: {
-                print("用户点击了Stay")
-            }
-        ))
+        if progressState.isResult {
+            viewModel.cancelAllRequest()
+            self.dismiss(animated: true, completion: nil)
+        }else{
+            TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
+                message: "As you leave, your generation will be interrupted and no result.".localized,
+                messageColor: .white,
+                messageFont: .systemFont(ofSize: 16),
+                
+                cancelTitle: "Leave".localized,
+                cancelColor: .white,
+                
+                confirmTitle: "Wait".localized,
+                confirmColor: .themeColor,
+                
+                cancelAction: { [weak self]  in
+                    guard let self = self else { return }
+                    print("用户点击了Leave")
+                    viewModel.cancelAllRequest()
+                    self.dismiss(animated: true, completion: nil)
+                },
+                confirmAction: {
+                    print("用户点击了Stay")
+                }
+            ))
+        }
     }
     
     
@@ -115,6 +120,7 @@ extension TSTextPicGennerateVC {
 }
 extension TSTextPicGennerateVC {
     func upDateView(state:TSProgressState,model:TSGenmojiModel?){
+        progressState = state
         switch state {
             case .failed(let errorStr):
                 showError(text: errorStr)