Browse Source

3.6.5(3)打包

100Years 3 weeks ago
parent
commit
89151f964b
23 changed files with 97 additions and 46 deletions
  1. 2 2
      AIEmoji.xcodeproj/project.pbxproj
  2. 2 2
      AIEmoji/Business/AIChat/TSChatViewController/Models/CHatMessageModel/TSChatThinkingModel.swift
  3. 1 0
      AIEmoji/Business/AIChat/TSChatViewController/TSChatViewController/TSChatViewController+SendMsg.swift
  4. 23 1
      AIEmoji/Business/AIChat/TSChatViewController/Views/TSChatMsgBaseView/TSAIThinkingView.swift
  5. 1 0
      AIEmoji/Business/General/Ex/Notification+Ex.swift
  6. 5 4
      AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstCell.swift
  7. 29 20
      AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstVC.swift
  8. 7 4
      AIEmoji/Business/TSAILIstVC/TSAIUploadPhotoBaseVC/TSAIUploadPhotoBaseVC.swift
  9. 1 1
      AIEmoji/Business/TSPTPGeneratorVC/TSGennertatorSelectStyleVC/TSGennertatorSelectStyleVC.swift
  10. 1 1
      AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/View/TSTitleView.swift
  11. 2 3
      AIEmoji/Business/TSTextGeneralPictureVC/TSTextPicGennerateVC/TSTextPicGennerateVC.swift
  12. 2 0
      AIEmoji/Business/TSTextGeneralPictureVC/TSTextPicGennerateVC/TSTextPicGennerateVM.swift
  13. 10 7
      AIEmoji/Common/SchemeHandler/SchemeHandler+Ext.swift
  14. 2 1
      AIEmoji/Common/Tool/OperationQueue/TSGenerateBaseOperation/TSGeneratePosterOperation.swift
  15. 1 0
      AIEmoji/de.lproj/Localizable.strings
  16. 1 0
      AIEmoji/en.lproj/Localizable.strings
  17. 1 0
      AIEmoji/es.lproj/Localizable.strings
  18. 1 0
      AIEmoji/ja.lproj/Localizable.strings
  19. 1 0
      AIEmoji/ko.lproj/Localizable.strings
  20. 1 0
      AIEmoji/pt-BR.lproj/Localizable.strings
  21. 1 0
      AIEmoji/pt-PT.lproj/Localizable.strings
  22. 1 0
      AIEmoji/zh-Hans.lproj/Localizable.strings
  23. 1 0
      AIEmoji/zh-Hant.lproj/Localizable.strings

+ 2 - 2
AIEmoji.xcodeproj/project.pbxproj

@@ -2480,7 +2480,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -2519,7 +2519,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;

+ 2 - 2
AIEmoji/Business/AIChat/TSChatViewController/Models/CHatMessageModel/TSChatThinkingModel.swift

@@ -14,7 +14,7 @@ class TSChatThinkingModel:TSBaseModel{
     
     var thinkingString: String = ""//ai思考内容
     var thinkingFold: Bool = false//ai 思考UI是否折叠
-    
+    var isCanExtend:Bool = true //ai思考是否可以展开
     var startStamp: Int = 0//开始思考时间戳
     var endStamp: Int = 0//结束思考时间戳
     
@@ -26,7 +26,7 @@ class TSChatThinkingModel:TSBaseModel{
         
         thinkingString                  <- map["thinkingString"]
         thinkingFold            <- map["thinkingFold"]
-        
+        isCanExtend            <- map["isCanExtend"]
         startStamp                <- map["startStamp"]
         endStamp            <- map["endStamp"]
     }

+ 1 - 0
AIEmoji/Business/AIChat/TSChatViewController/TSChatViewController/TSChatViewController+SendMsg.swift

@@ -175,6 +175,7 @@ extension TSChatViewController{
         thinkingModel.startStamp = Int.timestampInt()
         thinkingModel.thinkingName = "DeepSeek-R1"
         thinkingModel.thinkingState = "Thinking...".localized
+        thinkingModel.isCanExtend = (viewModel.uiStyle == .perfectHint) ? false : true
         message.thinkingModel = thinkingModel
         
         let model = TSChatMessageUIBaseModel.creat(viewClass: "TSAIThinkingView", msgModel: message)

+ 23 - 1
AIEmoji/Business/AIChat/TSChatViewController/Views/TSChatMsgBaseView/TSAIThinkingView.swift

@@ -26,6 +26,23 @@ class TSAIThinkingView: TSChatMsgBaseView {
             updateViewH()
         }
     }
+    //是否可以展开
+    var isCanExtend:Bool = true{
+        
+        didSet{
+            if isCanExtend {
+                let isFold = isFold
+                self.isFold = isFold
+            }else{
+                isFold = true
+            }
+            
+            arrowImageView.snp.updateConstraints { make in
+                make.width.equalTo(isCanExtend ? 16.0 : 0.0)
+            }
+        }
+    }
+    
     lazy var aiIconImageView: UIImageView = {
         let iconImageView = UIImageView.createImageView(imageName: "deepseek_icon")
         return iconImageView
@@ -38,6 +55,7 @@ class TSAIThinkingView: TSChatMsgBaseView {
     
     lazy var arrowImageView: UIImageView = {
         let arrowImageView = UIImageView.createImageView(imageName: "chat_up_arrow")
+        arrowImageView.clipsToBounds = true
         return arrowImageView
     }()
     lazy var topView: UIView = {
@@ -126,6 +144,10 @@ class TSAIThinkingView: TSChatMsgBaseView {
 //        isFold = !isFold
 //        self.uiBaseModel?.msgModel?.thinkingFold = isFold
         
+        if isCanExtend == false {
+            return
+        }
+        
         if let isFold = self.uiBaseModel?.msgModel?.thinkingModel?.thinkingFold {
             self.uiBaseModel?.msgModel?.thinkingModel?.thinkingFold = !isFold
             self.isFold = !isFold
@@ -169,7 +191,7 @@ class TSAIThinkingView: TSChatMsgBaseView {
         self.isFold = thinkingModel.thinkingFold
         //dePrint("modelView.viewH text =\(textLabel.text)")
     
-        
+        self.isCanExtend = thinkingModel.isCanExtend
      
     }
 }

+ 1 - 0
AIEmoji/Business/General/Ex/Notification+Ex.swift

@@ -20,4 +20,5 @@ extension Notification.Name {
     static let kTTPDataChanged = Notification.Name("kTTPDataChanged") //文生图数据放生改变
     
     static let kOpenMotherDayVC = Notification.Name("kOpenMotherDayVC") //打开母亲节 vc
+    static let kOpenCatTohumanVC = Notification.Name("kOpenCatTohumanVC") //打开猫咪变人 vc
 }

+ 5 - 4
AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstCell.swift

@@ -113,18 +113,19 @@ class TSAILIstCell: TSBaseCollectionCell {
 //        }
         
         
-        let leading = 16.0
+        let leading = 12.0
+        let trailing = -155.0*kDesignScale
         bgContentView.addSubview(infoLab)
         infoLab.snp.makeConstraints { make in
-            make.trailing.equalTo(-110)
+            make.trailing.equalTo(trailing)
             make.leading.equalTo(leading)
-            make.bottom.equalTo(-16)
+            make.bottom.equalTo(-12)
             make.height.greaterThanOrEqualTo(16)
         }
 
         bgContentView.addSubview(titleLab)
         titleLab.snp.makeConstraints { make in
-            make.trailing.equalTo(-110)
+            make.trailing.equalTo(trailing)
             make.leading.equalTo(leading)
             make.bottom.equalTo(infoLab.snp.top).offset(-8)
             make.height.greaterThanOrEqualTo(18)

+ 29 - 20
AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstVC.swift

@@ -12,25 +12,6 @@ class TSAILIstVC: TSBaseVC {
         let sectionModel = TSBasicSectionModel()
         dataArray.append(sectionModel)
 
-        //母亲节
-        sectionModel.addSubItemModel(
-            createItemModel(
-                leftImageName:"aiList_MotherDay",
-                leftTitle: "Happy Mother's Day".localized,
-                leftSubTitle: "Create sweet memories with Mom".localized,
-                rightViewStyle: 0,
-                tapBlock: { [weak self] model, _, _ in
-                   guard let self = self else { return }
-//                    enterSelectPhotos(
-//                        userDefaultsKey: "isFirstAIMotherDay",
-//                        maxBitSize: kUploadImageMaxBit10Size,
-//                         config:.getDefaultConfig(imageMaxBitSize: kUploadImageMaxBit10Size)
-//                    ) { image in
-                    let baseVc = TSAIUploadPhotoBaseVC(titleString: model.leftTitle ?? "",upLoadImage: nil,imageMaxBitSize: kUploadImageMaxBit10Size, generatorStyle: .motherDay)
-                        kPushVC(target: self, modelVC: baseVc)
-//                    }
-        }))
-
         //猫咪变人
         let catTohumanItemModel = createItemModel(
             leftImageName:"aiList_catTohuman",
@@ -50,7 +31,28 @@ class TSAILIstVC: TSBaseVC {
             })
         catTohumanItemModel.isWhether = true
         sectionModel.addSubItemModel(catTohumanItemModel)
+        
+        //母亲节
+        sectionModel.addSubItemModel(
+            createItemModel(
+                leftImageName:"aiList_MotherDay",
+                leftTitle: "Happy Mother's Day".localized,
+                leftSubTitle: "Create sweet memories with Mom".localized,
+                rightViewStyle: 0,
+                tapBlock: { [weak self] model, _, _ in
+                   guard let self = self else { return }
+//                    enterSelectPhotos(
+//                        userDefaultsKey: "isFirstAIMotherDay",
+//                        maxBitSize: kUploadImageMaxBit10Size,
+//                         config:.getDefaultConfig(imageMaxBitSize: kUploadImageMaxBit10Size)
+//                    ) { image in
+                    let baseVc = TSAIUploadPhotoBaseVC(titleString: model.leftTitle ?? "",upLoadImage: nil,imageMaxBitSize: kUploadImageMaxBit10Size, generatorStyle: .motherDay)
+                        kPushVC(target: self, modelVC: baseVc)
+//                    }
+        }))
+
 
+        //改头发型
         sectionModel.addSubItemModel(
             createItemModel(
                 leftImageName:"aiList_hair",
@@ -367,11 +369,18 @@ class TSAILIstVC: TSBaseVC {
         NotificationCenter.default.addObserver(forName: .kOpenMotherDayVC, object: nil, queue: OperationQueue.main) { [weak self] _ in
             guard let self = self else { return }
             DispatchQueue.main.async {
-//                self.openMotherDayVC(titleString: "Happy Mother's Day".localized)
                 let baseVc = TSAIUploadPhotoBaseVC(titleString: "Happy Mother's Day".localized,upLoadImage: nil,imageMaxBitSize: kUploadImageMaxBit10Size, generatorStyle: .motherDay)
                 kPushVC(target: self, modelVC: baseVc)
             }
         }
+        
+        NotificationCenter.default.addObserver(forName: .kOpenCatTohumanVC, object: nil, queue: OperationQueue.main) { [weak self] _ in
+            guard let self = self else { return }
+            DispatchQueue.main.async {
+                let baseVc = TSAIUploadPhotoBaseVC(titleString: "Pet Humanization".localized,upLoadImage: nil,imageMaxBitSize: kUploadImageMaxBit10Size, generatorStyle: .catTohuman)
+                kPushVC(target: self, modelVC: baseVc)
+            }
+        }
 
     }
 }

+ 7 - 4
AIEmoji/Business/TSAILIstVC/TSAIUploadPhotoBaseVC/TSAIUploadPhotoBaseVC.swift

@@ -192,7 +192,7 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
     
     
     lazy var subInfoLabel: UILabel = {
-        let textLabel = UILabel.createLabel(text: "Select an image with face fully visible".localized,font: .font(size: 12),textColor: UIColor.white.withAlphaComponent(0.6))
+        let textLabel = UILabel.createLabel(text: "Select an image with face fully visible".localized,font: .font(size: 12),textColor: UIColor.white.withAlphaComponent(0.6),textAlignment: .center,numberOfLines: 0)
         return textLabel
     }()
     
@@ -207,17 +207,19 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
             make.width.height.equalTo(24)
         }
         
-        let textLabel = UILabel.createLabel(text: "Upload Photo".localized,font: .font(size: 16),textColor: .white)
+        let textLabel = UILabel.createLabel(text: "Upload Photo".localized,font: .font(size: 16),textColor: .white,textAlignment: .center,numberOfLines: 0)
         bgView.addSubview(textLabel)
         textLabel.snp.makeConstraints { make in
             make.top.equalTo(addImageView.snp.bottom).offset(16)
-            make.centerX.equalToSuperview()
+            make.leading.equalTo(18)
+            make.trailing.equalTo(-18)
         }
         
         bgView.addSubview(subInfoLabel)
         subInfoLabel.snp.makeConstraints { make in
             make.top.equalTo(textLabel.snp.bottom).offset(8)
-            make.centerX.equalToSuperview()
+            make.leading.equalTo(18)
+            make.trailing.equalTo(-18)
             make.bottom.equalToSuperview()
         }
         
@@ -247,6 +249,7 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
         upLoadView.snp.makeConstraints { make in
             make.top.equalTo(244*kDesignScale)
             make.centerX.equalToSuperview()
+            make.width.lessThanOrEqualTo(k_ScreenWidth - 80)
         }
 
         bgView.addSubview(uploadImageView)

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

@@ -189,7 +189,7 @@ class TSGennertatorSelectStyleCell: TSBaseCollectionCell {
                 }
             case .ttp:
                 boardImageView.cornerRadius = 34.0
-                let w = 68.0
+                let w = 76.0
                 boardImageView.snp.updateConstraints { make in
                     make.width.height.equalTo(w)
                 }

+ 1 - 1
AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/View/TSTitleView.swift

@@ -76,7 +76,7 @@ class TSTitleMoreView: TSTitleView {
 
         contentView.addSubview(moreView)
         moreView.snp.makeConstraints { make in
-            make.trailing.equalTo(-16)
+            make.trailing.equalTo(-6)//16
             make.centerY.equalTo(titleLab)
         }
         

+ 2 - 3
AIEmoji/Business/TSTextGeneralPictureVC/TSTextPicGennerateVC/TSTextPicGennerateVC.swift

@@ -62,9 +62,8 @@ class TSTextPicGennerateVC: TSAIPhotoGeneratorBaseVC {
                     guard let self = self else { return }
                     print("用户点击了Leave")
                     self.dismiss(animated: true, completion: nil)
-                    kDelayMainShort {
-                        self.viewModel.cancelAllRequest()
-                    }
+                    self.viewModel.cancelAllRequest()
+                    
                 },
                 confirmAction: {
                     print("用户点击了Stay")

+ 2 - 0
AIEmoji/Business/TSTextGeneralPictureVC/TSTextPicGennerateVC/TSTextPicGennerateVM.swift

@@ -79,6 +79,7 @@ class TSTextPicGennerateVM {
         stateDatauPblished = (.progressString(generating(progress: 0.0)),nil)
         creatRequest = TSNetworkShared.post(urlType: .textPicCreate,parameters: postDict) { [weak self] data,error in
             guard let self = self else { return }
+            if stopNetwork == true { return }
             if let dataDict = kNetWorkCodeSuccess(data: data),
                let actionId = dataDict["actionId"] as? Int{
                 if stopNetwork == false {
@@ -94,6 +95,7 @@ class TSTextPicGennerateVM {
     func getActionInfo(action_id:Int){
         queryRequest = TSNetworkShared.get(urlType: .actionInfo,parameters: ["action_id":action_id]) { [weak self] data,error in
             guard let self = self else { return }
+            if stopNetwork == true { return }
             if let result = kNetWorkResultSuccess(data: data) {
                 if let genmojiModel = TSActionInfoModel(JSON: result) {
                     switch genmojiModel.actionStatus {

+ 10 - 7
AIEmoji/Common/SchemeHandler/SchemeHandler+Ext.swift

@@ -34,17 +34,17 @@ extension SchemeHandler {
     /// 打开文生图页面
     func handleTextToImageOpen(params: [URLQueryItem]?) {
         WindowHelper.resetToTabBarController(at: 1)
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
-            if let top = WindowHelper.topViewController() {
-                kPushVC(target: top, modelVC: TSTextGeneralPictureVC())
-            }
-        }
+//        DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
+//            if let top = WindowHelper.topViewController() {
+//                kPushVC(target: top, modelVC: TSTextGeneralPictureVC())
+//            }
+//        }
     }
 
     /// 打开母亲节活动页面
     func handleMotherPolaroidOpen(params: [URLQueryItem]?) {
         // TODO: 跳转 母亲节页面,参考文生图
-        WindowHelper.resetToTabBarController(at: 1)
+        WindowHelper.resetToTabBarController(at: 2)
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
             NotificationCenter.default.post(name: .kOpenMotherDayVC, object: nil)
         }
@@ -53,6 +53,9 @@ extension SchemeHandler {
     /// 打开猫咪拟人化页面
     func handlePetHumanizationOpen(params: [URLQueryItem]?) {
         // TODO: 跳转猫咪拟人化页面,参考文生图
-
+        WindowHelper.resetToTabBarController(at: 2)
+        DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
+            NotificationCenter.default.post(name: .kOpenCatTohumanVC, object: nil)
+        }
     }
 }

+ 2 - 1
AIEmoji/Common/Tool/OperationQueue/TSGenerateBaseOperation/TSGeneratePosterOperation.swift

@@ -141,6 +141,7 @@ class TSGeneratePTPOperation: TSGenerateBaseOperation , @unchecked Sendable{
             }
         } completion: { [weak self]  data, error in
             guard let self = self else { return }
+            if stopNetwork == true { return }
             if let error = error {
                 generateStyleModel.upLoadImageUrl = nil
                 self.stateDatauPblished = (.failed(error.localizedDescription),nil)
@@ -198,7 +199,7 @@ class TSGeneratePTPOperation: TSGenerateBaseOperation , @unchecked Sendable{
                                                  "advance": request.advance
                                                 ]) { [weak self] data,error in
             guard let self = self else { return }
-            
+            if stopNetwork == true { return }
             if let dataDict = kNetWorkCodeSuccess(data: data),
                let actionId = dataDict["actionId"] as? Int{
                 if stopNetwork == false {

+ 1 - 0
AIEmoji/de.lproj/Localizable.strings

@@ -352,3 +352,4 @@
 "AI Store" = "AI-Speicher";
 "Are you sure to delete all histories?" = "Sind Sie sicher, alle Historien zu löschen?";
 "Delete All" = "Alle löschen";
+"Select an image with face fully visible" = "Wählen Sie ein Bild aus, auf dem das Gesicht vollständig sichtbar ist";

+ 1 - 0
AIEmoji/en.lproj/Localizable.strings

@@ -349,3 +349,4 @@
 "AI Store" = "AI Store";
 "Are you sure to delete all histories?" = "Are you sure to delete all histories?";
 "Delete All" = "Delete All";
+"Select an image with face fully visible" = "Select an image with face fully visible";

+ 1 - 0
AIEmoji/es.lproj/Localizable.strings

@@ -349,3 +349,4 @@
 "AI Store" = "Tienda AI";
 "Are you sure to delete all histories?" = "¿Estás seguro de borrar todos los historiales?";
 "Delete All" = "Eliminar todo";
+"Select an image with face fully visible" = "Seleccione una imagen con la cara completamente visible";

+ 1 - 0
AIEmoji/ja.lproj/Localizable.strings

@@ -348,3 +348,4 @@
 "AI Store" = "AIストア";
 "Are you sure to delete all histories?" = "すべての履歴を削除してもよろしいですか?";
 "Delete All" = "すべて削除";
+"Select an image with face fully visible" = "顔が完全に見える画像を選択してください";

+ 1 - 0
AIEmoji/ko.lproj/Localizable.strings

@@ -354,3 +354,4 @@
 "AI Store" = "AI 스토어";
 "Are you sure to delete all histories?" = "모든 기록을 삭제하시겠습니까?";
 "Delete All" = "모두 삭제";
+"Select an image with face fully visible" = "얼굴이 완전히 보이는 이미지를 선택하세요.";

+ 1 - 0
AIEmoji/pt-BR.lproj/Localizable.strings

@@ -348,3 +348,4 @@
 "AI Store" = "Loja de IA";
 "Are you sure to delete all histories?" = "Tem certeza de que deseja excluir todos os históricos?";
 "Delete All" = "Excluir tudo";
+"Select an image with face fully visible" = "Selecione uma imagem com o rosto totalmente visível";

+ 1 - 0
AIEmoji/pt-PT.lproj/Localizable.strings

@@ -348,3 +348,4 @@
 "AI Store" = "Loja de IA";
 "Are you sure to delete all histories?" = "Tem certeza de que deseja excluir todos os históricos?";
 "Delete All" = "Excluir tudo";
+"Select an image with face fully visible" = "Selecione uma imagem com o rosto totalmente visível";

+ 1 - 0
AIEmoji/zh-Hans.lproj/Localizable.strings

@@ -350,3 +350,4 @@
 "AI Store" = "AI 商店";
 "Are you sure to delete all histories?" = "确定要删除所有历史记录吗?";
 "Delete All" = "全部删除";
+"Select an image with face fully visible" = "选择面部完全可见的图像";

+ 1 - 0
AIEmoji/zh-Hant.lproj/Localizable.strings

@@ -340,3 +340,4 @@
 "AI Store" = "AI 商店";
 "Are you sure to delete all histories?" = "確定要刪除所有歷史記錄嗎?";
 "Delete All" = "全部刪除";
+"Select an image with face fully visible" = "選擇臉部完全可見的影像";