100Years 3 долоо хоног өмнө
parent
commit
fbe6728e6e
74 өөрчлөгдсөн 122 нэмэгдсэн , 46 устгасан
  1. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_MotherDay.imageset/aiList_MotherDay@2x.png
  2. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_MotherDay.imageset/aiList_MotherDay@3x.png
  3. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_aiChat.imageset/aiList_aiChat@2x.png
  4. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_aiChat.imageset/aiList_aiChat@3x.png
  5. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_catTohuman.imageset/aiList_catTohuman@2x.png
  6. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_catTohuman.imageset/aiList_catTohuman@3x.png
  7. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/aiList_emoji@2x.png
  8. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/aiList_emoji@3x.png
  9. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_emote.imageset/aiList_emote@2x.png
  10. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_emote.imageset/aiList_emote@3x.png
  11. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_hair.imageset/aiList_hair@2x.png
  12. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_hair.imageset/aiList_hair@3x.png
  13. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_hairColor.imageset/aiList_hairColor@2x.png
  14. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_hairColor.imageset/aiList_hairColor@3x.png
  15. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_livePhoto.imageset/aiList_livePhoto@2x.png
  16. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_livePhoto.imageset/aiList_livePhoto@3x.png
  17. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_oldPeople.imageset/aiList_oldPeople@2x.png
  18. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_oldPeople.imageset/aiList_oldPeople@3x.png
  19. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_photoExpand.imageset/aiList_photoExpand@2x.png
  20. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_photoExpand.imageset/aiList_photoExpand@3x.png
  21. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_quality.imageset/aiList_quality@2x.png
  22. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_quality.imageset/aiList_quality@3x.png
  23. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_restOldPhoto.imageset/aiList_restOldPhoto@2x.png
  24. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_restOldPhoto.imageset/aiList_restOldPhoto@3x.png
  25. BIN
      AIEmoji/Assets.xcassets/AIList/ailist_child.imageset/ailist_child@2x.png
  26. BIN
      AIEmoji/Assets.xcassets/AIList/ailist_child.imageset/ailist_child@3x.png
  27. BIN
      AIEmoji/Assets.xcassets/AIList/ailist_eyeOpen.imageset/ailist_eyeOpen@2x.png
  28. BIN
      AIEmoji/Assets.xcassets/AIList/ailist_eyeOpen.imageset/ailist_eyeOpen@3x.png
  29. BIN
      AIEmoji/Assets.xcassets/AIList/ailist_pretty.imageset/ailist_pretty@2x.png
  30. BIN
      AIEmoji/Assets.xcassets/AIList/ailist_pretty.imageset/ailist_pretty@3x.png
  31. BIN
      AIEmoji/Assets.xcassets/AIList/nav_title_ailist.imageset/nav_title_ailist@2x.png
  32. BIN
      AIEmoji/Assets.xcassets/AIList/nav_title_ailist.imageset/nav_title_ailist@3x.png
  33. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio16_9.imageset/ttp_ratio16_9@2x.png
  34. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio16_9.imageset/ttp_ratio16_9@3x.png
  35. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio1_1.imageset/ttp_ratio1_1@2x.png
  36. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio1_1.imageset/ttp_ratio1_1@3x.png
  37. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio2_3.imageset/ttp_ratio2_3@2x.png
  38. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio2_3.imageset/ttp_ratio2_3@3x.png
  39. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio3_2.imageset/ttp_ratio3_2@2x.png
  40. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio3_2.imageset/ttp_ratio3_2@3x.png
  41. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio3_4.imageset/ttp_ratio3_4@2x.png
  42. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio3_4.imageset/ttp_ratio3_4@3x.png
  43. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio4_3.imageset/ttp_ratio4_3@2x.png
  44. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio4_3.imageset/ttp_ratio4_3@3x.png
  45. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio9_16.imageset/ttp_ratio9_16@2x.png
  46. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio9_16.imageset/ttp_ratio9_16@3x.png
  47. 2 2
      AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image0.imageset/Contents.json
  48. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image0.imageset/ttp_example_image0@2x.png
  49. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image0.imageset/ttp_example_image0@3x.png
  50. 22 0
      AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image1.imageset/Contents.json
  51. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image1.imageset/ttp_example_image1@2x.png
  52. BIN
      AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image1.imageset/ttp_example_image1@3x.png
  53. 1 1
      AIEmoji/Business/AIChat/TSAIChatHistoryVC/TSAIChatHistoryVC.swift
  54. 1 1
      AIEmoji/Business/AIChat/TSChatViewController/TSChatViewController/TSChatViewController+NaviBar.swift
  55. 10 5
      AIEmoji/Business/AIChat/TSChatViewController/TSChatViewController/TSChatViewController.swift
  56. 15 1
      AIEmoji/Business/Data/TSDBHistoryManager.swift
  57. 10 6
      AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstCell.swift
  58. 1 1
      AIEmoji/Business/TSAILIstVC/TSAIListHistoryBaseVC/TSAIListHistoryBaseVC.swift
  59. 2 0
      AIEmoji/Business/TSAILIstVC/TSAIPhotoGeneratorBaseVC/TSAIListPhotoGeneratorBaseVC.swift
  60. 5 4
      AIEmoji/Business/TSAILIstVC/TSAIPhotoGeneratorBaseVC/TSAIPhotoGeneratorBaseVM/TSAIListPhotoGeneratorBaseVM.swift
  61. 27 4
      AIEmoji/Business/TSAILIstVC/TSAIUploadPhotoBaseVC/TSAIUploadPhotoBaseVC.swift
  62. 1 1
      AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/TSGenmojiVC.swift
  63. 3 3
      AIEmoji/Business/TSPTPGeneratorVC/TSGennertatorSelectStyleVC/TSGennertatorSelectStyleVC.swift
  64. 1 1
      AIEmoji/Business/TSPTPGeneratorVC/TSPTPHistoryVC/TSPTPHistoryVC.swift
  65. 1 1
      AIEmoji/Business/TSPTPGeneratorVC/TSPTPInputVC/TSPTPInputVC.swift
  66. 1 1
      AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/TSPhotoToPhotoVC.swift
  67. 1 1
      AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/TSTTPInputVC+Col.swift
  68. 2 1
      AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/TSTTPInputVC+Style.swift
  69. 3 3
      AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/View/TSPromptTextView.swift
  70. 2 2
      AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/View/TSTTPStyleView.swift
  71. 1 1
      AIEmoji/Business/TSTextGeneralPictureVC/TSTextGeneralPictureVC/TSTextGeneralPictureVC.swift
  72. 5 1
      AIEmoji/Business/TSTextGeneralPictureVC/TSTextPicGennerateVC/TSTextPicGennerateVC.swift
  73. 3 3
      AIEmoji/Common/View/TSPhotoPickerManager/TSPhotoPickerManager.swift
  74. 2 2
      AIEmoji/Res/text_to_photo_style.json

BIN
AIEmoji/Assets.xcassets/AIList/aiList_MotherDay.imageset/aiList_MotherDay@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_MotherDay.imageset/aiList_MotherDay@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_aiChat.imageset/aiList_aiChat@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_aiChat.imageset/aiList_aiChat@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_catTohuman.imageset/aiList_catTohuman@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_catTohuman.imageset/aiList_catTohuman@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/aiList_emoji@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/aiList_emoji@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_emote.imageset/aiList_emote@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_emote.imageset/aiList_emote@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_hair.imageset/aiList_hair@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_hair.imageset/aiList_hair@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_hairColor.imageset/aiList_hairColor@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_hairColor.imageset/aiList_hairColor@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_livePhoto.imageset/aiList_livePhoto@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_livePhoto.imageset/aiList_livePhoto@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_oldPeople.imageset/aiList_oldPeople@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_oldPeople.imageset/aiList_oldPeople@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_photoExpand.imageset/aiList_photoExpand@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_photoExpand.imageset/aiList_photoExpand@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_quality.imageset/aiList_quality@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_quality.imageset/aiList_quality@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_restOldPhoto.imageset/aiList_restOldPhoto@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/aiList_restOldPhoto.imageset/aiList_restOldPhoto@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/ailist_child.imageset/ailist_child@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/ailist_child.imageset/ailist_child@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/ailist_eyeOpen.imageset/ailist_eyeOpen@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/ailist_eyeOpen.imageset/ailist_eyeOpen@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/ailist_pretty.imageset/ailist_pretty@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/ailist_pretty.imageset/ailist_pretty@3x.png


BIN
AIEmoji/Assets.xcassets/AIList/nav_title_ailist.imageset/nav_title_ailist@2x.png


BIN
AIEmoji/Assets.xcassets/AIList/nav_title_ailist.imageset/nav_title_ailist@3x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio16_9.imageset/ttp_ratio16_9@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio16_9.imageset/ttp_ratio16_9@3x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio1_1.imageset/ttp_ratio1_1@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio1_1.imageset/ttp_ratio1_1@3x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio2_3.imageset/ttp_ratio2_3@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio2_3.imageset/ttp_ratio2_3@3x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio3_2.imageset/ttp_ratio3_2@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio3_2.imageset/ttp_ratio3_2@3x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio3_4.imageset/ttp_ratio3_4@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio3_4.imageset/ttp_ratio3_4@3x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio4_3.imageset/ttp_ratio4_3@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio4_3.imageset/ttp_ratio4_3@3x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio9_16.imageset/ttp_ratio9_16@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ratio/ttp_ratio9_16.imageset/ttp_ratio9_16@3x.png


+ 2 - 2
AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/Contents.json → AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image0.imageset/Contents.json

@@ -5,12 +5,12 @@
       "scale" : "1x"
     },
     {
-      "filename" : "aiList_emoji@2x.png",
+      "filename" : "ttp_example_image0@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "aiList_emoji@3x.png",
+      "filename" : "ttp_example_image0@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image0.imageset/ttp_example_image0@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image0.imageset/ttp_example_image0@3x.png


+ 22 - 0
AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image1.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "ttp_example_image1@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "ttp_example_image1@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image1.imageset/ttp_example_image1@2x.png


BIN
AIEmoji/Assets.xcassets/TextGeneralPicture/ttp_example_image1.imageset/ttp_example_image1@3x.png


+ 1 - 1
AIEmoji/Business/AIChat/TSAIChatHistoryVC/TSAIChatHistoryVC.swift

@@ -73,7 +73,7 @@ class TSAIChatHistoryVC: TSBaseVC {
     }
     
     @objc func deleteAll(){
-        showCustomAlert(message: "Are you sure to delete".localized, deleteHandler:  { [weak self]  in
+        showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler:  { [weak self]  in
             guard let self = self else { return }
             viewModel.deleteAll()
             self.viewModel.historyModelChatList.removeAll()

+ 1 - 1
AIEmoji/Business/AIChat/TSChatViewController/TSChatViewController/TSChatViewController+NaviBar.swift

@@ -158,7 +158,7 @@ extension TSChatViewController {
     }
     
     @objc func clickDelete(){
-        showCustomAlert(message: "Are you sure to delete".localized, deleteHandler:  { [weak self]  in
+        showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler:  { [weak self]  in
             guard let self = self else { return }
             viewModel.dbAIChatList.delete()
         

+ 10 - 5
AIEmoji/Business/AIChat/TSChatViewController/TSChatViewController/TSChatViewController.swift

@@ -86,11 +86,9 @@ class TSChatViewController: MessagesViewController, MessagesDataSource {
         
 //        vipBtn.isHidden = PurchaseManager.default.isVip
 //        NotificationCenter.default.addObserver(self, selector: #selector(vipInfoChanged), name: .kPurchaseDidChanged, object: nil)
-        
-        if viewModel.uiStyle == .chat {
-            // 注册通知监听,App死的时候,保存本次聊天记录到本地
-            NotificationCenter.default.addObserver(self, selector: #selector(saveChatList), name: .kApplicationWillTerminate, object: nil)
-        }
+
+        // 注册通知监听,App死的时候,保存本次聊天记录到本地
+        NotificationCenter.default.addObserver(self, selector: #selector(saveChatList), name: .kApplicationWillTerminate, object: nil)
     }
     
 //    @objc func vipInfoChanged() {
@@ -101,6 +99,10 @@ class TSChatViewController: MessagesViewController, MessagesDataSource {
 //    }
 
     @objc func saveChatList() {
+        if viewModel.uiStyle != .chat {
+            return
+        }
+        
         messageList.removeFirst()
         if messageList.count > 0 {
             //保存本次聊天记录
@@ -220,6 +222,9 @@ class TSChatViewController: MessagesViewController, MessagesDataSource {
         
     }
 
+    deinit {
+        saveChatList()
+    }
 }
 
 

+ 15 - 1
AIEmoji/Business/Data/TSDBHistoryManager.swift

@@ -241,7 +241,21 @@ extension TSRealmManager {
     
     //文生图
     var ttpDBHistory:TSDBHistory {
-        return getDBHistory(type: TSDBHistoryType.ttp)
+
+        let history = getDBHistory(type: TSDBHistoryType.ttp)
+        
+        if history.listModels.count == 0,UserDefaults.standard.string(forKey: "insertTTPExampleData") == nil {
+            let id = Date.timestampInt
+            history.updateDatas([
+                createExampleModel(id:id, imageName: "ttp_example_image0"),
+                createExampleModel(id:id+1, imageName: "ttp_example_image1")
+            ])
+            UserDefaults.standard.set("1", forKey: "insertTTPExampleData")
+            UserDefaults.standard.synchronize()
+        }
+        
+        return history
+        
     }
 
     //文生表情

+ 10 - 6
AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstCell.swift

@@ -112,26 +112,30 @@ class TSAILIstCell: TSBaseCollectionCell {
 //            make.height.equalTo(90*kDesignScale)
 //        }
         
+        
+        let leading = 16.0
         bgContentView.addSubview(infoLab)
         infoLab.snp.makeConstraints { make in
             make.trailing.equalTo(-110)
-            make.leading.equalTo(12)
+            make.leading.equalTo(leading)
             make.bottom.equalTo(-16)
+            make.height.equalTo(16)
         }
 
         bgContentView.addSubview(titleLab)
         titleLab.snp.makeConstraints { make in
             make.trailing.equalTo(-110)
-            make.leading.equalTo(12)
-            make.bottom.equalTo(infoLab.snp.top).offset(0)
+            make.leading.equalTo(leading)
+            make.bottom.equalTo(infoLab.snp.top).offset(-12)
+            make.height.equalTo(18)
         }
         
         bgContentView.addSubview(catPawAnimatedImageView)
         catPawAnimatedImageView.snp.makeConstraints { make in
-            make.leading.equalTo(12)
+            make.leading.equalTo(leading)
             make.bottom.equalTo(titleLab.snp.top).offset(-4)
-            make.width.equalTo(13.0)
-            make.height.equalTo(22.0)
+            make.width.equalTo(18.0)
+            make.height.equalTo(30.0)
         }
         
         kDelayMainShort {

+ 1 - 1
AIEmoji/Business/TSAILIstVC/TSAIListHistoryBaseVC/TSAIListHistoryBaseVC.swift

@@ -90,7 +90,7 @@ class TSAIListHistoryBaseVC: TSBaseVC {
     }
     
     @objc func clickNavRight() {
-        showCustomAlert(message: "Are you sure to delete".localized, deleteHandler:  {
+        showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler:  {
             self.removeAllHistoryList()
             self.updateDataView()
         })

+ 2 - 0
AIEmoji/Business/TSAILIstVC/TSAIPhotoGeneratorBaseVC/TSAIListPhotoGeneratorBaseVC.swift

@@ -54,6 +54,8 @@ class TSAIListPhotoGeneratorBaseVC: TSAIPhotoGeneratorBaseVC {
 
     lazy var generateInView : TSGeneratorloadingView = {
         let generateInView = TSGeneratorloadingView()
+        generateInView.timeLabel.text = String(format: "~ %d min".localized, 2)
+        generateInView.infoLabel.text = "It is definitely worth your wait. Just watch it".localized
         return generateInView
     }()
     

+ 5 - 4
AIEmoji/Business/TSAILIstVC/TSAIPhotoGeneratorBaseVC/TSAIPhotoGeneratorBaseVM/TSAIListPhotoGeneratorBaseVM.swift

@@ -156,19 +156,20 @@ class TSAIListPhotoGeneratorBaseVM {
                 urlType = .imageRewrite
                 postDict = ["prompt":"提高上传图片的清晰度,不要改变任何",
                             "imageUrl":imageUrl,
-                            "device":getUserInfoJsonString()]
+                            "device":getUserInfoJsonString(),
+                            "advance": generatorModel.generatorStyle.advance]
             case .motherDay:
                 urlType = .imageRewrite
                 postDict = ["prompt":"把照片转化为Q版人物形象,3D黏土风,是真实世界的光影,保留原始人物数量和细节,包括服装和造型。整体放在一张拍立得照片中,有一只手握着拍立得相纸。图中角色从拍立得相纸中,突破边框,延伸进入现实世界的二维空间。背景要温馨,包含母亲节快乐的元素。处理掉异常现象如半个物体",
                             "imageUrl":imageUrl,
                             "device":getUserInfoJsonString(),
-                            "advance": true]
+                            "advance": generatorModel.generatorStyle.advance]
             case .catTohuman:
                 urlType = .imageRewrite
-            postDict = ["prompt":"Turn my pets into a human" + generatorModel.additionalPrompt,
+                postDict = ["prompt":"Turn my pets into a human" + generatorModel.additionalPrompt,
                             "imageUrl":imageUrl,
                             "device":getUserInfoJsonString(),
-                            "advance": true]
+                            "advance": generatorModel.generatorStyle.advance]
         }
         creatRequest = TSNetworkShared.post(urlType: urlType,parameters: postDict) { [weak self] data,error in
             guard let self = self else { return }

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

@@ -120,6 +120,15 @@ enum TSGeneratorImageStyle {
             return .catTohumanConfig
         }
     }
+    
+    var advance:Bool{
+        switch self {
+        case .catTohuman,.motherDay:
+            return true
+        default:
+            return false
+        }
+    }
 }
 
 class TSAIUploadPhotoBaseVC: TSBaseVC {
@@ -181,6 +190,12 @@ 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))
+        return textLabel
+    }()
+    
     lazy var upLoadView: UIView = {
         let bgView = UIView()
         
@@ -197,6 +212,12 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
         textLabel.snp.makeConstraints { make in
             make.top.equalTo(addImageView.snp.bottom).offset(16)
             make.centerX.equalToSuperview()
+        }
+        
+        bgView.addSubview(subInfoLabel)
+        subInfoLabel.snp.makeConstraints { make in
+            make.top.equalTo(textLabel.snp.bottom).offset(8)
+            make.centerX.equalToSuperview()
             make.bottom.equalToSuperview()
         }
         
@@ -266,13 +287,13 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
         segmentedView.addTarget(self,action: #selector(segmentedControlValueChanged(_:)),for: .valueChanged)
         return segmentedView
     }()
-    var additionalPrompt = "male"
+    var additionalPrompt = "female"
     @objc func segmentedControlValueChanged(_ sender: BetterSegmentedControl) {
         switch sender.index {
         case 0:
-            additionalPrompt = "male"
+            additionalPrompt = "female"//女
         case 1:
-            additionalPrompt = "female"
+            additionalPrompt = "male"//男
         default:
             additionalPrompt = ""
         }
@@ -303,6 +324,8 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
         
         let image = upLoadImage
         upLoadImage = image
+        
+        subInfoLabel.isHidden = generatorStyle == .catTohuman ? false : true
     }
 
     
@@ -336,7 +359,7 @@ extension TSAIUploadPhotoBaseVC {
         }
         
         if generatorStyle == .catTohuman {
-            cusStackView.addSpacing(length: 24)
+            cusStackView.addSpacing(length: 9)
             cusStackView.addSubviewToStackWhiteBoard(segmentedView, length: 46)
             segmentedView.snp.makeConstraints { make in
                 make.width.equalTo(k_ScreenWidth-70)

+ 1 - 1
AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/TSGenmojiVC.swift

@@ -31,7 +31,7 @@ class TSGenmojiVC: TSBaseVC {
         cp.sectionActionHandler = { [weak self] cellCp, indexPath in
             guard let self = self else { return }
             if let cmd = cellCp as? String, cmd == "delete"  {
-                showCustomAlert(message: "Are you sure to delete".localized, deleteHandler:  {
+                showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler:  {
                     self.viewModel.removeAllHistoryList()
                     self.updateListDataView()
                 })

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

@@ -143,8 +143,8 @@ extension TSGennertatorSelectStyleVC: UICollectionViewDataSource ,UICollectionVi
         
         let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TSGennertatorSelectStyleCell.cellID, for: indexPath)
         if let cell = cell as? TSGennertatorSelectStyleCell,let itemModel = dataArray.safeObj(At: indexPath.item){
-            cell.itemModel = itemModel
             cell.style = style
+            cell.itemModel = itemModel
         }
         return cell
     }
@@ -189,8 +189,8 @@ class TSGennertatorSelectStyleCell: TSBaseCollectionCell {
                     make.width.height.equalTo(w)
                 }
                 imageView.snp.updateConstraints { make in
-                    make.top.equalTo(0)
-                    make.width.height.equalTo(w)
+                    make.top.equalTo(4)
+                    make.width.height.equalTo(w-8)
                 }
             }
         }

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

@@ -104,7 +104,7 @@ class TSPTPHistoryVC: TSBaseVC {
     }
     
     @objc func clickNavRight() {
-        showCustomAlert(message: "Are you sure to delete".localized, deleteHandler:  {
+        showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler:  {
             self.removeAllHistoryList()
             self.updateDataView()
             self.dataChangedNotification()

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

@@ -192,7 +192,7 @@ class TSPTPInputVC: TSBaseVC {
             guard let self = self else { return }
             if let cmd = cellCp as? String {
                 if cmd == "delete" {
-                    showCustomAlert(message: "Are you sure to delete".localized, deleteHandler: {
+                    showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler: {
                         self.viewModel.removeAllHistoryList()
                         self.updataCollectionView()
                     })

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

@@ -179,7 +179,7 @@ class TSPhotoToPhotoVC: TSBaseVC {
         cp.sectionActionHandler = { [weak self] cellCp, indexPath in
             guard let self = self else { return }
             if let cmd = cellCp as? String, cmd == "delete"  {
-                showCustomAlert(message: "Are you sure to delete".localized, deleteHandler:  {
+                showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler:  {
                     self.viewModel.removeAllHistoryList()
                     self.collectionComponent.clear()
                     self.collectionComponent.reloadView(with: self.viewModel.colDataArray)

+ 1 - 1
AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/TSTTPInputVC+Col.swift

@@ -15,7 +15,7 @@ extension TSTTPInputVC {
             guard let self = self else { return }
             if let cmd = cellCp as? String  {
                 if cmd == "delete" {
-                    showCustomAlert(message: "Are you sure to delete".localized, deleteHandler:  {
+                    showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler:  {
                         self.viewModel.removeAllHistoryList()
                         self.updateListDataView()
                     })

+ 2 - 1
AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/TSTTPInputVC+Style.swift

@@ -11,9 +11,10 @@ extension TSTTPInputVC {
         let promptStyleView = TSTTPStyleView()
         promptStyleView.currentIndexPath = IndexPath(item: viewModel.selectedStyleIndex, section: 0)
         promptStyleView.dataArray = viewModel.ptpStyleModels
-        promptStyleView.selectedValueBlock = { [weak self] model in
+        promptStyleView.selectedValueBlock = { [weak self] index,model in
             guard let self = self else { return }
             viewModel.selectPromptModel = model
+            viewModel.selectedStyleIndex = index.item
             updateVipView()
         }
         promptStyleView.clickMoreBlock = { [weak self]  in

+ 3 - 3
AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/View/TSPromptTextView.swift

@@ -33,7 +33,7 @@ class TSPromptTextView : TSBaseView{
     
     lazy var textBgView: UIView = {
         let textBgView = UIView()
-        textBgView.backgroundColor = "#333333".uiColor
+        textBgView.backgroundColor = "#292929".uiColor
         textBgView.cornerRadius = 12
         return textBgView
     }()
@@ -44,7 +44,7 @@ class TSPromptTextView : TSBaseView{
             text: "",
             font: .font(size: 14),
             textColor: .white,
-            backgroundColor: "#333333".uiColor
+            backgroundColor: .clear
         )
         customTextView.delegate = self
         customTextView.returnKeyType = .send
@@ -144,7 +144,7 @@ class TSPromptTextView : TSBaseView{
             make.top.equalTo(21)
             make.leading.equalTo(16)
             make.trailing.equalTo(-16)
-            make.bottom.equalTo(-21)
+            make.bottom.equalTo(-52)
         }
         
         textBgView.addSubview(inspirationBtn)

+ 2 - 2
AIEmoji/Business/TSTextGeneralPictureVC/TSTTPInputVC/View/TSTTPStyleView.swift

@@ -7,7 +7,7 @@
 
 class TSTTPStyleView:TSBaseView {
     
-    var selectedValueBlock:((TSGenerateStyleModel)->Void)?
+    var selectedValueBlock:((IndexPath,TSGenerateStyleModel)->Void)?
     var clickMoreBlock:(()->Void)?{
         didSet{
             titleView.clickMoreBlock = clickMoreBlock
@@ -109,7 +109,7 @@ extension TSTTPStyleView: UICollectionViewDataSource ,UICollectionViewDelegate {
         if let model = dataArray.safeObj(At: indexPath.item){
             currentIndexPath = indexPath
             self.styleCollectionView.selectItem(at: self.currentIndexPath, animated: true, scrollPosition: .centeredHorizontally)
-            selectedValueBlock?(model)
+            selectedValueBlock?(indexPath,model)
         }
     }
 }

+ 1 - 1
AIEmoji/Business/TSTextGeneralPictureVC/TSTextGeneralPictureVC/TSTextGeneralPictureVC.swift

@@ -46,7 +46,7 @@ class TSTextGeneralPictureVC: TSBaseVC {
         cp.sectionActionHandler = { [weak self] cellCp, indexPath in
             guard let self = self else { return }
             if let cmd = cellCp as? String, cmd == "delete"  {
-                showCustomAlert(message: "Are you sure to delete".localized, deleteHandler:  {
+                showCustomAlert(message: "Are you sure to delete all histories?".localized, deleteHandler:  {
                     self.viewModel.removeAllHistoryList()
                     self.updateListDataView()
                 })

+ 5 - 1
AIEmoji/Business/TSTextGeneralPictureVC/TSTextPicGennerateVC/TSTextPicGennerateVC.swift

@@ -25,6 +25,8 @@ class TSTextPicGennerateVC: TSAIPhotoGeneratorBaseVC {
 
     lazy var generateInView : TSGeneratorloadingView = {
         let generateInView = TSGeneratorloadingView()
+        generateInView.timeLabel.text = String(format: "~ %d seconds".localized, 20)
+        generateInView.infoLabel.text = ""
         return generateInView
     }()
     
@@ -59,8 +61,10 @@ class TSTextPicGennerateVC: TSAIPhotoGeneratorBaseVC {
                 cancelAction: { [weak self]  in
                     guard let self = self else { return }
                     print("用户点击了Leave")
-                    viewModel.cancelAllRequest()
                     self.dismiss(animated: true, completion: nil)
+                    kDelayMainShort {
+                        self.viewModel.cancelAllRequest()
+                    }
                 },
                 confirmAction: {
                     print("用户点击了Stay")

+ 3 - 3
AIEmoji/Common/View/TSPhotoPickerManager/TSPhotoPickerManager.swift

@@ -106,10 +106,10 @@ extension TSPhotoPickerManager: UIImagePickerControllerDelegate, UINavigationCon
     }
     
     func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
-        self.completionHandler?(nil,nil)
-        if completionSizeHandler == nil {
+//        self.completionHandler?(nil,nil)
+//        if completionSizeHandler == nil {
             picker.dismiss(animated: true, completion: nil)
-        }
+//        }
     }
 }
 

+ 2 - 2
AIEmoji/Res/text_to_photo_style.json

@@ -4,12 +4,12 @@
         "imageName": "ttp_style_DreamyAnime",
         "imageText": "Dreamy Anime",
         "prompt":"吉卜力、宫崎骏、梦幻童话、清新治愈、手绘风,",
-        "specialStyle":0,
+        "specialStyle":1,
         "isVip":true
     },
     {
         "imageName": "ttp_style_Toon",
-        "imageText": "Toon",
+        "imageText": "Toon 3D",
         "prompt":"卡通3D Disney风格、圆润线条、夸张表情、梦幻光影,色彩丰富,",
         "specialStyle":0,
         "isVip":false