Explorar el Código

3.1(2)
1.修改 bug
2.图生图新增 3 个新风格
3.文生图和文生表情迁移到 ai 列表

100Years hace 6 días
padre
commit
eb5838bf17
Se han modificado 58 ficheros con 548 adiciones y 234 borrados
  1. 4 4
      AIEmoji.xcodeproj/project.pbxproj
  2. 22 0
      AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/Contents.json
  3. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/aiList_emoji@2x.png
  4. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/aiList_emoji@3x.png
  5. 22 0
      AIEmoji/Assets.xcassets/AIList/aiList_ttp.imageset/Contents.json
  6. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_ttp.imageset/aiList_ttp@2x.png
  7. BIN
      AIEmoji/Assets.xcassets/AIList/aiList_ttp.imageset/aiList_ttp@3x.png
  8. 22 0
      AIEmoji/Assets.xcassets/AIList/nav_title_ailist.imageset/Contents.json
  9. BIN
      AIEmoji/Assets.xcassets/AIList/nav_title_ailist.imageset/nav_title_ailist@2x.png
  10. BIN
      AIEmoji/Assets.xcassets/AIList/nav_title_ailist.imageset/nav_title_ailist@3x.png
  11. BIN
      AIEmoji/Assets.xcassets/Common/failed_big.imageset/failed_big@2x.png
  12. BIN
      AIEmoji/Assets.xcassets/Common/failed_big.imageset/failed_big@3x.png
  13. 22 0
      AIEmoji/Assets.xcassets/Common/launch_Chibi.imageset/Contents.json
  14. BIN
      AIEmoji/Assets.xcassets/Common/launch_Chibi.imageset/launch_Chibi@2x.png
  15. BIN
      AIEmoji/Assets.xcassets/Common/launch_Chibi.imageset/launch_Chibi@3x.png
  16. 22 0
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_chibi.imageset/Contents.json
  17. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_chibi.imageset/ptp_style_chibi@2x.png
  18. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_chibi.imageset/ptp_style_chibi@3x.png
  19. 22 0
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_disney.imageset/Contents.json
  20. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_disney.imageset/ptp_style_disney@2x.png
  21. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_disney.imageset/ptp_style_disney@3x.png
  22. 22 0
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_new.imageset/Contents.json
  23. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_new.imageset/ptp_style_new@2x.png
  24. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_new.imageset/ptp_style_new@3x.png
  25. 22 0
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_ukiyoe.imageset/Contents.json
  26. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_ukiyoe.imageset/ptp_style_ukiyoe@2x-3.png
  27. BIN
      AIEmoji/Assets.xcassets/PTP/style/ptp_style_ukiyoe.imageset/ptp_style_ukiyoe@3x-3.png
  28. 3 3
      AIEmoji/Base.lproj/LaunchScreen.storyboard
  29. 12 1
      AIEmoji/Business/TSAILIstVC/TSAIAgeImageHintVC/TSAIAgeImageHintVC.swift
  30. 36 24
      AIEmoji/Business/TSAILIstVC/TSAIAgeImageHintVC/TSAIListHintBaseVC.swift
  31. 3 1
      AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstCell.swift
  32. 26 3
      AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstVC.swift
  33. 10 14
      AIEmoji/Business/TSAILIstVC/TSAIPhotoGeneratorBaseVC/TSAIListPhotoGeneratorBaseVC.swift
  34. 29 29
      AIEmoji/Business/TSAILIstVC/TSAIUploadPhotoBaseVC/TSAIUploadPhotoBaseVC.swift
  35. 2 0
      AIEmoji/Business/TSPTPGeneratorVC/TSAIPhotoGeneratorBaseVC/TSAIPhotoBrowseVC.swift
  36. 2 2
      AIEmoji/Business/TSPTPGeneratorVC/TSPTPImageHintVC/TSPTPImageHintVC.swift
  37. 121 118
      AIEmoji/Business/TSPTPGeneratorVC/TSPTPInputVC/TSPTPInputVC.swift
  38. 1 1
      AIEmoji/Business/TSPTPGeneratorVC/TSPTPInputVC/View/TSPTPUploadView.swift
  39. 15 4
      AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/Cell/TSPTPSelectStyleCell.swift
  40. 1 1
      AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/Cell/TSPTPUploadCell.swift
  41. 1 1
      AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/M/TSPTPStyleModel.swift
  42. 17 6
      AIEmoji/Business/TSSetingVC/SetingVC/TSSetingModel.swift
  43. 5 5
      AIEmoji/Business/TSSetingVC/SetingVC/TSSetingVC.swift
  44. 3 3
      AIEmoji/Business/TSSetingVC/SetingVC/View/TSSettingListView.swift
  45. 1 1
      AIEmoji/Business/TSSetingVC/TSAboutDataVC.swift
  46. 3 3
      AIEmoji/Common/Purchase/TSPurchaseManager.swift
  47. 1 1
      AIEmoji/Common/Tool/TSCommonTool/TSCommonTool.swift
  48. 1 0
      AIEmoji/Common/View/TSPhotoPickerManager/TSPhotoPickerManager.swift
  49. 21 0
      AIEmoji/Res/photo_to_photo_style.json
  50. 6 1
      AIEmoji/de.lproj/Localizable.strings
  51. 6 1
      AIEmoji/en.lproj/Localizable.strings
  52. 6 1
      AIEmoji/es.lproj/Localizable.strings
  53. 6 1
      AIEmoji/ja.lproj/Localizable.strings
  54. 6 1
      AIEmoji/ko.lproj/Localizable.strings
  55. 6 1
      AIEmoji/pt-BR.lproj/Localizable.strings
  56. 6 1
      AIEmoji/pt-PT.lproj/Localizable.strings
  57. 6 1
      AIEmoji/zh-Hans.lproj/Localizable.strings
  58. 6 1
      AIEmoji/zh-Hant.lproj/Localizable.strings

+ 4 - 4
AIEmoji.xcodeproj/project.pbxproj

@@ -2202,12 +2202,12 @@
 				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;
 				INFOPLIST_FILE = AIEmoji/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = Ghiblimage;
+				INFOPLIST_KEY_CFBundleDisplayName = Chibi;
 				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Allow us to access photos to upload your photos to generate new styles.";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
 				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
@@ -2241,12 +2241,12 @@
 				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;
 				INFOPLIST_FILE = AIEmoji/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = Ghiblimage;
+				INFOPLIST_KEY_CFBundleDisplayName = Chibi;
 				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Allow us to access photos to upload your photos to generate new styles.";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
 				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;

+ 22 - 0
AIEmoji/Assets.xcassets/AIList/aiList_emoji.imageset/Contents.json

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

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


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


+ 22 - 0
AIEmoji/Assets.xcassets/AIList/aiList_ttp.imageset/Contents.json

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

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


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


+ 22 - 0
AIEmoji/Assets.xcassets/AIList/nav_title_ailist.imageset/Contents.json

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

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/Common/failed_big.imageset/failed_big@2x.png


BIN
AIEmoji/Assets.xcassets/Common/failed_big.imageset/failed_big@3x.png


+ 22 - 0
AIEmoji/Assets.xcassets/Common/launch_Chibi.imageset/Contents.json

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

BIN
AIEmoji/Assets.xcassets/Common/launch_Chibi.imageset/launch_Chibi@2x.png


BIN
AIEmoji/Assets.xcassets/Common/launch_Chibi.imageset/launch_Chibi@3x.png


+ 22 - 0
AIEmoji/Assets.xcassets/PTP/style/ptp_style_chibi.imageset/Contents.json

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

BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_chibi.imageset/ptp_style_chibi@2x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_chibi.imageset/ptp_style_chibi@3x.png


+ 22 - 0
AIEmoji/Assets.xcassets/PTP/style/ptp_style_disney.imageset/Contents.json

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

BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_disney.imageset/ptp_style_disney@2x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_disney.imageset/ptp_style_disney@3x.png


+ 22 - 0
AIEmoji/Assets.xcassets/PTP/style/ptp_style_new.imageset/Contents.json

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

BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_new.imageset/ptp_style_new@2x.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_new.imageset/ptp_style_new@3x.png


+ 22 - 0
AIEmoji/Assets.xcassets/PTP/style/ptp_style_ukiyoe.imageset/Contents.json

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

BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_ukiyoe.imageset/ptp_style_ukiyoe@2x-3.png


BIN
AIEmoji/Assets.xcassets/PTP/style/ptp_style_ukiyoe.imageset/ptp_style_ukiyoe@3x-3.png


+ 3 - 3
AIEmoji/Base.lproj/LaunchScreen.storyboard

@@ -16,8 +16,8 @@
                         <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launch_Ghiblimage" translatesAutoresizingMaskIntoConstraints="NO" id="FfL-7D-71P">
-                                <rect key="frame" x="47.666666666666657" y="325" width="297.66666666666674" height="45.333333333333314"/>
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launch_Chibi" highlighted="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FfL-7D-71P">
+                                <rect key="frame" x="132.66666666666666" y="325" width="127.99999999999997" height="45.333333333333314"/>
                             </imageView>
                         </subviews>
                         <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
@@ -34,6 +34,6 @@
         </scene>
     </scenes>
     <resources>
-        <image name="launch_Ghiblimage" width="297.66665649414062" height="45.333332061767578"/>
+        <image name="launch_Chibi" width="128" height="45.333332061767578"/>
     </resources>
 </document>

+ 12 - 1
AIEmoji/Business/TSAILIstVC/TSAIAgeImageHintVC/TSAIAgeImageHintVC.swift

@@ -6,8 +6,19 @@
 //
 
 class TSAIAgeImageHintVC: TSAIListHintBaseVC {
+    
+//    var userDefaultsKey:String
+//    init(userDefaultsKey: String) {
+//        self.userDefaultsKey = userDefaultsKey
+//        super.init()
+//    }
+//    
+//    @MainActor required init?(coder: NSCoder) {
+//        fatalError("init(coder:) has not been implemented")
+//    }
+    
     override func createData() {
-        Self.userDefaultsKey = "isFirstAIListAge"
+//        Self.userDefaultsKey = "isFirstAIListAge"
         goodImageNamed = "ptp_goodImage"
         badImageNamed = "ptp_badImage"
         super.createData()

+ 36 - 24
AIEmoji/Business/TSAILIstVC/TSAIAgeImageHintVC/TSAIListHintBaseVC.swift

@@ -5,7 +5,7 @@
 //  Created by 100Years on 2025/4/9.
 //
 
-
+import PhotosUI
 class TSAIListHintBaseVC: TSBaseVC {
     
     static var userDefaultsKey:String = "isFirstAIListAge"
@@ -18,7 +18,7 @@ class TSAIListHintBaseVC: TSBaseVC {
     let popupContentViewW:CGFloat = k_ScreenWidth - 40.0
     let popupContentViewH:CGFloat = k_ScreenHeight - 268.0
     
-    var clickUpImageHandle:(()->Void)?
+    var clickUpImageHandle:((UIImage?,PHAsset?)->Void)?
     lazy var popupContentView: UIView = {
         let popupContentView = UIView(frame: CGRectMake(0, 0, popupContentViewW, popupContentViewH))
         popupContentView.backgroundColor = "#222222".uiColor
@@ -26,16 +26,20 @@ class TSAIListHintBaseVC: TSBaseVC {
         return popupContentView
     }()
     
-    
-    lazy var noPromptsBtn: UIButton = {
-        let noPromptsBtn = UIButton.createButton(title: "Do not show again".localized,image: UIImage(named: "circle_unSelected"),font: .font(size: 11),titleColor: .white.withAlphaComponent(0.6)){ [weak self]  in
-            guard let self = self else { return }
-            changeNoPromptsBtn()
-        }
-        noPromptsBtn.setImage(UIImage(named: "circle_selected"), for: .selected)
-//        noPromptsBtn.setTitleImageSpace(spacing: 4)
-        return noPromptsBtn
+    lazy var photoPickerManager: TSPhotoPickerManager = {
+        let photoPickerManager = TSPhotoPickerManager(viewController: self)
+        return photoPickerManager
     }()
+    
+//    lazy var noPromptsBtn: UIButton = {
+//        let noPromptsBtn = UIButton.createButton(title: "Do not show again".localized,image: UIImage(named: "circle_unSelected"),font: .font(size: 11),titleColor: .white.withAlphaComponent(0.6)){ [weak self]  in
+//            guard let self = self else { return }
+//            changeNoPromptsBtn()
+//        }
+//        noPromptsBtn.setImage(UIImage(named: "circle_selected"), for: .selected)
+//        noPromptsBtn.setTitleImageSpace(spacing: 6)
+//        return noPromptsBtn
+//    }()
     override func createView() {
         setNavBarViewHidden(true)
         view.backgroundColor = .black.withAlphaComponent(0.7)
@@ -123,8 +127,7 @@ class TSAIListHintBaseVC: TSBaseVC {
         
         let submitBtn = kCreateNormalSubmitBtn(title: "Upload Photo".localized) { [weak self]  in
             guard let self = self else { return }
-            dismiss()
-            clickUpImageHandle?()
+            pickSinglePhoto()
         }
         submitBtn.cornerRadius = 24.0
         popupContentView.addSubview(submitBtn)
@@ -133,21 +136,22 @@ class TSAIListHintBaseVC: TSBaseVC {
             make.centerX.equalToSuperview()
             make.width.equalTo(250*kDesignScale)
             make.height.equalTo(48)
-        }
-
-        popupContentView.addSubview(noPromptsBtn)
-        noPromptsBtn.snp.makeConstraints { make in
-            make.top.equalTo(submitBtn.snp.bottom).offset(12)
-            make.centerX.equalToSuperview()
-            make.height.equalTo(16)
             make.bottom.equalTo(-24)
         }
+
+//        popupContentView.addSubview(noPromptsBtn)
+//        noPromptsBtn.snp.makeConstraints { make in
+//            make.top.equalTo(submitBtn.snp.bottom).offset(12)
+//            make.centerX.equalToSuperview()
+//            make.height.equalTo(16)
+//            make.bottom.equalTo(-24)
+//        }
     }
     
-    func changeNoPromptsBtn(){
-        noPromptsBtn.isSelected = !noPromptsBtn.isSelected
-        Self.isShowUploadImageHint = !noPromptsBtn.isSelected
-    }
+//    func changeNoPromptsBtn(){
+//        noPromptsBtn.isSelected = !noPromptsBtn.isSelected
+//        Self.isShowUploadImageHint = !noPromptsBtn.isSelected
+//    }
     
     static var isShowUploadImageHint:Bool{
         get {
@@ -159,4 +163,12 @@ class TSAIListHintBaseVC: TSBaseVC {
             UserDefaults.standard.synchronize()
         }
     }
+    
+    func pickSinglePhoto()  {
+        photoPickerManager.pickSinglePhoto { [weak self] image,phAsset in
+            guard let self = self else { return }
+            dismiss()
+            clickUpImageHandle?(image,phAsset)
+        }
+    }
 }

+ 3 - 1
AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstCell.swift

@@ -26,6 +26,7 @@ class TSAILIstCell: TSBaseCollectionCell {
     
     lazy var bgImageView: UIImageView = {
         let bgImageView = UIImageView()
+        bgImageView.contentMode = .scaleToFill
         return bgImageView
     }()
     
@@ -49,12 +50,13 @@ class TSAILIstCell: TSBaseCollectionCell {
         let submitBtn = UIButton.createButton(title: "Try Now".localized,backgroundColor: .themeColor,font: .font(size: 12),titleColor: "#111111".uiColor)
         submitBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 12, bottom: 0, right: 12)
         submitBtn.cornerRadius = 12
+        submitBtn.isUserInteractionEnabled = false
         return submitBtn
     }()
     
 
     override func creatUI() {
-        
+        bgContentView.clipsToBounds = true
         bgContentView.addSubview(bgImageView)
         bgImageView.snp.makeConstraints { make in
             make.top.bottom.leading.trailing.equalTo(0)

+ 26 - 3
AIEmoji/Business/TSAILIstVC/TSAILIstVC/TSAILIstVC.swift

@@ -12,11 +12,24 @@ class TSAILIstVC: TSBaseVC {
         let sectionModel = TSBasicSectionModel()
         dataArray.append(sectionModel)
 
+        
+        sectionModel.addSubItemModel(
+            createItemModel(
+                leftImageName:"aiList_ttp",
+                leftTitle: "Text ➡️ Photo".localized,
+                leftSubTitle: "Turn words into visually stunning artwork".localized,
+                rightViewStyle: 0,
+                tapBlock: { [weak self] model, _, _ in
+                   guard let self = self else { return }
+                    let baseVc = TSAIUploadPhotoBaseVC(titleString: model.leftTitle ?? "", generatorStyle: .ageOld)
+                    kPushVC(target: self, modelVC: TSTextGeneralPictureVC())
+        }))
+        
         sectionModel.addSubItemModel(
             createItemModel(
                 leftImageName:"aiList_oldPeople",
-                leftTitle: "Change Age".localized,
-                leftSubTitle: "AI predicts what you look like in your old age.".localized,
+                leftTitle: "Predicting Old Age".localized,
+                leftSubTitle: "AI predicts what you look like in your old age".localized,
                 rightViewStyle: 0,
                 tapBlock: { [weak self] model, _, _ in
                    guard let self = self else { return }
@@ -37,6 +50,16 @@ class TSAILIstVC: TSBaseVC {
                                 
         }))
 
+        sectionModel.addSubItemModel(
+            createItemModel(
+                leftImageName:"aiList_emoji",
+                leftTitle: "Text ➡️ Emoji".localized,
+                leftSubTitle: "Turn your inspiration into brilliant emojis".localized,
+                rightViewStyle: 0,
+                tapBlock: { [weak self] model, _, _ in
+                   guard let self = self else { return }
+                    kPushVC(target: self, modelVC: TSGenmojiVC())
+        }))
         return dataArray
 
     }()
@@ -55,7 +78,7 @@ class TSAILIstVC: TSBaseVC {
     lazy var navBarView: TSBaseNavContentBarView = {
        let navBarView = TSBaseNavContentBarView()
        
-       let titleImageView = UIImageView.createImageView(imageName: "nav_title_pic",contentMode: .scaleToFill)
+       let titleImageView = UIImageView.createImageView(imageName: "nav_title_ailist",contentMode: .scaleToFill)
        navBarView.barView.addSubview(titleImageView)
        titleImageView.snp.makeConstraints { make in
            make.centerY.equalToSuperview()

+ 10 - 14
AIEmoji/Business/TSAILIstVC/TSAIPhotoGeneratorBaseVC/TSAIListPhotoGeneratorBaseVC.swift

@@ -58,10 +58,9 @@ class TSAIListPhotoGeneratorBaseVC: TSAIPhotoGeneratorBaseVC {
     
     
     lazy var switchOriginalPictureBtn: UIButton = {
-        let switchOriginalPictureBtn = UIButton.createButton(image:UIImage(named: "switch_original_picture")){ [weak self]  in
-            guard let self = self else { return }
-            switchOriginalPictureHandle()
-        }
+        let switchOriginalPictureBtn = UIButton.createButton(image:UIImage(named: "switch_original_picture"))
+        switchOriginalPictureBtn.addTarget(self, action: #selector(switchOriginalPictureTouchDown), for: .touchDown)
+        switchOriginalPictureBtn.addTarget(self, action: #selector(switchOriginalPictureTouchUp), for: [.touchUpInside, .touchUpOutside, .touchCancel])
         switchOriginalPictureBtn.isHidden = true
         return switchOriginalPictureBtn
     }()
@@ -247,17 +246,14 @@ extension TSAIListPhotoGeneratorBaseVC {
         }
     }
     
-    func switchOriginalPictureHandle() {
-        
+    @objc func switchOriginalPictureTouchDown() {
+        self.netWorkImageView.image = upLoadImage
+    }
+    
+    @objc func switchOriginalPictureTouchUp() {
         guard let imageModel = imageModel else { return }
-        switchOriginalPictureBtn.isSelected = !switchOriginalPictureBtn.isSelected
-        
-        if switchOriginalPictureBtn.isSelected {
-            self.netWorkImageView.image = upLoadImage
-        }else {
-            self.netWorkImageView.setAsyncImage(urlString: imageModel.response.resultUrl,placeholder:kPlaceholderImage,backgroundColor:netWorkImageView.backgroundColor!){ [weak self] image in
-                guard let self = self else { return }
-            }
+        self.netWorkImageView.setAsyncImage(urlString: imageModel.response.resultUrl,placeholder:kPlaceholderImage,backgroundColor:netWorkImageView.backgroundColor!){ [weak self] image in
+            guard let self = self else { return }
         }
     }
 }

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

@@ -5,7 +5,7 @@
 //  Created by 100Years on 2025/4/9.
 //
 
-
+import PhotosUI
 enum TSGeneratorImageStyle {
     case ageOld
     case ageChild
@@ -37,7 +37,7 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
 
     
     lazy var submitBtn: UIButton = {
-        let submitBtn = kCreateNormalSubmitBtn(title: "Accept".localized) { [weak self]  in
+        let submitBtn = kCreateNormalSubmitBtn(title: "Generate".localized) { [weak self]  in
             guard let self = self else { return }
             generateImage()
         }
@@ -79,7 +79,7 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
             make.width.height.equalTo(24)
         }
         
-        let textLabel = UILabel.createLabel(text: "Upload Image".localized,font: .font(size: 16),textColor: .white)
+        let textLabel = UILabel.createLabel(text: "Upload Photo".localized,font: .font(size: 16),textColor: .white)
         bgView.addSubview(textLabel)
         textLabel.snp.makeConstraints { make in
             make.top.equalTo(addImageView.snp.bottom).offset(16)
@@ -190,8 +190,10 @@ class TSAIUploadPhotoBaseVC: TSBaseVC {
 //        NotificationCenter.default.addObserver(self, selector: #selector(updateVipView), name: .kPurchaseDidChanged, object: nil)
 //        updateVipView()
         
+        TSAIAgeImageHintVC.userDefaultsKey = "isFirstAIList" + titleString
         kDelayMainShort {
             if TSAIAgeImageHintVC.isShowUploadImageHint{
+                TSAIAgeImageHintVC.isShowUploadImageHint = false
                 self.presentModalHintVC()
             }
         }
@@ -216,7 +218,6 @@ extension TSAIUploadPhotoBaseVC {
         
         //添加上传一大块
         let bgView = UIView()
-//        bgView.backgroundColor = .yellow.withAlphaComponent(0.1)
         bgView.addSubview(uploadImageBgView)
         cusStackView.addSubviewToStack(bgView)
     
@@ -237,7 +238,7 @@ extension TSAIUploadPhotoBaseVC {
         
         
         //文字信息区域
-        cusStackView.addSubviewToStack(getTextInfoCell(text: "Size ≤ 5mb".localized))
+        cusStackView.addSubviewToStack(getTextInfoCell(text: "Size ≤ 10MB".localized))
         cusStackView.addSpacing(height: lineSpacing)
         cusStackView.addSubviewToStack(getTextInfoCell(text: "Single photo with face fully visible".localized))
         cusStackView.addSpacing(height: lineSpacing)
@@ -282,39 +283,39 @@ extension TSAIUploadPhotoBaseVC {
     func pickSinglePhoto()  {
         photoPickerManager.pickSinglePhoto { [weak self] image,phAsset in
             guard let self = self else { return }
-
-            let maxSize = 10 * 1024 * 1024
-            
-            if let image = image,let phAsset = phAsset {
-                // 方法2:异步获取详细大小(不阻塞主线程)
-                TSPhotoSizeHelper.getImageFileSizeAsync(asset: phAsset) {[weak self] size in
-                    guard let self = self else { return }
-                    
-                    let mbSize = Double(size) / (1024 * 1024)
-                    print("精确大小: \(mbSize) MB,size = \(size)")
-                    if size > maxSize {
-                        TSToastShared.showToast(text: "Photo must be smaller than 10MB.".localized)
-                    }else{
-//                        viewModel.upLoadImage = image
-                        upLoadImage = image
-                    }
-                }
-            }else if let image = image {
-                if image.isLargerThan(byteSize: maxSize) {
+            handleSinglePhoto(image: image, phAsset: phAsset)
+        }
+    }
+    
+    func handleSinglePhoto(image:UIImage?,phAsset:PHAsset?){
+        let maxSize = 10 * 1024 * 1024
+        
+        if let image = image,let phAsset = phAsset {
+            // 方法2:异步获取详细大小(不阻塞主线程)
+            TSPhotoSizeHelper.getImageFileSizeAsync(asset: phAsset) {[weak self] size in
+                guard let self = self else { return }
+                
+                let mbSize = Double(size) / (1024 * 1024)
+                print("精确大小: \(mbSize) MB,size = \(size)")
+                if size > maxSize {
                     TSToastShared.showToast(text: "Photo must be smaller than 10MB.".localized)
                 }else{
-//                    viewModel.upLoadImage = image
                     upLoadImage = image
                 }
             }
+        }else if let image = image {
+            if image.isLargerThan(byteSize: maxSize) {
+                TSToastShared.showToast(text: "Photo must be smaller than 10MB.".localized)
+            }else{
+                upLoadImage = image
+            }
         }
     }
-    
     func presentModalHintVC(){
         let vc = TSAIAgeImageHintVC()
-        vc.clickUpImageHandle = { [weak self]  in
+        vc.clickUpImageHandle = { [weak self] image,phAsset in
             guard let self = self else { return }
-            pickSinglePhoto()
+            handleSinglePhoto(image: image, phAsset: phAsset)
         }
         kPresentModalVC(target: self, modelVC: vc,transitionStyle: .crossDissolve)
     }
@@ -332,7 +333,6 @@ extension TSAIUploadPhotoBaseVC {
             guard let self = self else { return }
         }{ return }
         
-    
         guard let upLoadImage = upLoadImage else { return }
         let gennerateVC = TSAIListPhotoGeneratorBaseVC(upLoadImage: upLoadImage, generatorStyle: generatorStyle) { [weak self] model in
             guard let self = self else { return }

+ 2 - 0
AIEmoji/Business/TSPTPGeneratorVC/TSAIPhotoGeneratorBaseVC/TSAIPhotoBrowseVC.swift

@@ -80,6 +80,8 @@ class TSAIPhotoBrowseVC: TSBaseVC {
             guard let self = self else { return }
             clickSubmitBtn()
         }
+        bigSaveBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        bigSaveBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
         bigSaveBtn.frame = CGRectMake(0, 0, 252, 44)
         bigSaveBtn.cornerRadius = 22.0
         return bigSaveBtn

+ 2 - 2
AIEmoji/Business/TSPTPGeneratorVC/TSPTPImageHintVC/TSPTPImageHintVC.swift

@@ -70,7 +70,7 @@ class TSPTPImageHintVC: TSBaseVC {
             make.trailing.equalTo(-32)
         }
         
-        let goodInfoLabel = UILabel.createLabel(text: "Fully clear and visible face, in good lighting".localized,font: .font(size: 14,weight: .medium),textColor: .white.withAlphaComponent(0.6),numberOfLines: 0)
+        let goodInfoLabel = UILabel.createLabel(text: "Fully clear and visible face, in good lighting".localized,font: .font(size: 14),textColor: .white.withAlphaComponent(0.6),numberOfLines: 0)
         popupContentView.addSubview(goodInfoLabel)
         goodInfoLabel.snp.makeConstraints { make in
             make.top.equalTo(goodLabel.snp.bottom).offset(8)
@@ -97,7 +97,7 @@ class TSPTPImageHintVC: TSBaseVC {
             make.trailing.equalTo(-32)
         }
         
-        let badInfoLabel = UILabel.createLabel(text: "Group photos, covered faces, nudes".localized,font: .font(size: 14,weight: .medium),textColor: .white.withAlphaComponent(0.6),numberOfLines: 0)
+        let badInfoLabel = UILabel.createLabel(text: "Group photos, covered faces, nudes".localized,font: .font(size: 14),textColor: .white.withAlphaComponent(0.6),numberOfLines: 0)
         popupContentView.addSubview(badInfoLabel)
         badInfoLabel.snp.makeConstraints { make in
             make.top.equalTo(badLabel.snp.bottom).offset(8)

+ 121 - 118
AIEmoji/Business/TSPTPGeneratorVC/TSPTPInputVC/TSPTPInputVC.swift

@@ -6,7 +6,7 @@
 //
 
 //import IQKeyboardManagerSwift
-
+import PhotosUI
 class TSPTPInputVC: TSBaseVC {
 
     lazy var viewModel: TSPTPInputVM = {
@@ -28,9 +28,7 @@ class TSPTPInputVC: TSBaseVC {
     lazy var vipBtn: UIButton = {
        let vipBtn = UIButton.createButton(image: UIImage(named: "nav_vip")) { [weak self]  in
            guard let self = self else { return }
-           TSPurchaseVC.show(target: self) {
-     
-           }
+           TSPurchaseVC.show(target: self) {}
        }
        return vipBtn
    }()
@@ -46,21 +44,21 @@ class TSPTPInputVC: TSBaseVC {
            make.left.equalTo(16)
        }
        
-       let keyboardBtn = UIButton.createButton(image: UIImage(named: "keyboard")) { [weak self]  in
-           guard let self = self else { return }
-           kPresentModalVC(target: self, modelVC: TSWallpaperVC())
-       }
-       navBarView.barView.addSubview(keyboardBtn)
-        keyboardBtn.snp.makeConstraints { make in
-           make.centerY.equalToSuperview()
-           make.trailing.equalTo(-16)
-           make.width.height.equalTo(24)
-       }
+//       let keyboardBtn = UIButton.createButton(image: UIImage(named: "keyboard")) { [weak self]  in
+//           guard let self = self else { return }
+//           kPresentModalVC(target: self, modelVC: TSWallpaperVC())
+//       }
+//       navBarView.barView.addSubview(keyboardBtn)
+//        keyboardBtn.snp.makeConstraints { make in
+//           make.centerY.equalToSuperview()
+//           make.trailing.equalTo(-16)
+//           make.width.height.equalTo(24)
+//       }
        
        navBarView.barView.addSubview(vipBtn)
        vipBtn.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
-           make.trailing.equalTo(-60)
+           make.trailing.equalTo(-16)//(-60)
            make.width.height.equalTo(24)
        }
        
@@ -73,71 +71,71 @@ class TSPTPInputVC: TSBaseVC {
         cusStackView.scrollView.isScrollEnabled = false
         return cusStackView
     }()
-    
-    //###################################### 入口 view ######################################
 
-    let bannerY:CGFloat = 17
-    let bannerW:CGFloat = 166*kDesignScale
-    let bannerH:CGFloat = 117*kDesignScale
-    lazy var textToPhotoBannerBtn: UIButton = {
-        let textToPhotoBannerBtn = UIButton.createButton(backgroundImage: UIImage(named: "textToPhoto_banner"))
-        textToPhotoBannerBtn.addTarget(self, action: #selector(clickTextToPhoto), for: .touchUpInside)
-        textToPhotoBannerBtn.frame = CGRect(x: 16, y: bannerY, width: bannerW, height: bannerH)
-    
-        let label = UILabel.createLabel(text: "Text ➡️ Photo".localized,font: .font(name:.PoppinsBlackItalic,size: 16),textColor: .white)
-        textToPhotoBannerBtn.addSubview(label)
-        label.snp.makeConstraints { make in
-            make.top.equalTo(12)
-            make.leading.equalTo(8)
-            make.height.equalTo(24)
-        }
-        
-        let button = UIButton.createButton(title:"Try Now".localized,backgroundColor:.white,font: .font(size: 11),titleColor: "#ED69AA".uiColor,corner: 9)
-        button.contentEdgeInsets = UIEdgeInsets(top: 0, left: 6, bottom: 0, right: 6)
-        textToPhotoBannerBtn.addSubview(button)
-        button.snp.makeConstraints { make in
-            make.top.equalTo(44)
-            make.leading.equalTo(8)
-            make.height.equalTo(18)
-        }
-        
-        return textToPhotoBannerBtn
-    }()
-
-    lazy var textToEmojiBannerBtn: UIButton = {
-        let textToEmojiBannerBtn = UIButton.createButton(backgroundImage: UIImage(named: "textToEmoji_banner"))
-        textToEmojiBannerBtn.addTarget(self, action: #selector(clickTextToEmoji), for: .touchUpInside)
-        let x = textToPhotoBannerBtn.x + textToPhotoBannerBtn.width + 11.0
-        textToEmojiBannerBtn.frame = CGRect(x: x, y: bannerY, width: bannerW, height: bannerH)
-        
-        let color:UIColor = "#7855D6".uiColor
-        let label = UILabel.createLabel(text: "Text ➡️ Emoji".localized,font: .font(name:.PoppinsBlackItalic,size: 16),textColor: color)
-        textToEmojiBannerBtn.addSubview(label)
-        label.snp.makeConstraints { make in
-            make.top.equalTo(12)
-            make.leading.equalTo(8)
-            make.height.equalTo(24)
-        }
-        
-        let button = UIButton.createButton(title:"Try Now".localized,backgroundColor:color,font: .font(size: 11),titleColor: "#D0D5FF".uiColor,corner: 9)
-        button.contentEdgeInsets = UIEdgeInsets(top: 0, left: 6, bottom: 0, right: 6)
-        textToEmojiBannerBtn.addSubview(button)
-        button.snp.makeConstraints { make in
-            make.top.equalTo(44)
-            make.leading.equalTo(8)
-            make.height.equalTo(18)
-        }
-        
-        return textToEmojiBannerBtn
-    }()
-    
-    
-    lazy var entranceView: UIView = {
-        let entranceView = UIView()
-        entranceView.addSubview(textToPhotoBannerBtn)
-        entranceView.addSubview(textToEmojiBannerBtn)
-        return entranceView
-    }()
+//    //###################################### 入口 view ######################################
+//
+//    let bannerY:CGFloat = 17
+//    let bannerW:CGFloat = 166*kDesignScale
+//    let bannerH:CGFloat = 117*kDesignScale
+//    lazy var textToPhotoBannerBtn: UIButton = {
+//        let textToPhotoBannerBtn = UIButton.createButton(backgroundImage: UIImage(named: "textToPhoto_banner"))
+//        textToPhotoBannerBtn.addTarget(self, action: #selector(clickTextToPhoto), for: .touchUpInside)
+//        textToPhotoBannerBtn.frame = CGRect(x: 16, y: bannerY, width: bannerW, height: bannerH)
+//    
+//        let label = UILabel.createLabel(text: "Text ➡️ Photo".localized,font: .font(name:.PoppinsBlackItalic,size: 16),textColor: .white)
+//        textToPhotoBannerBtn.addSubview(label)
+//        label.snp.makeConstraints { make in
+//            make.top.equalTo(12)
+//            make.leading.equalTo(8)
+//            make.height.equalTo(24)
+//        }
+//        
+//        let button = UIButton.createButton(title:"Try Now".localized,backgroundColor:.white,font: .font(size: 11),titleColor: "#ED69AA".uiColor,corner: 9)
+//        button.contentEdgeInsets = UIEdgeInsets(top: 0, left: 6, bottom: 0, right: 6)
+//        textToPhotoBannerBtn.addSubview(button)
+//        button.snp.makeConstraints { make in
+//            make.top.equalTo(44)
+//            make.leading.equalTo(8)
+//            make.height.equalTo(18)
+//        }
+//        
+//        return textToPhotoBannerBtn
+//    }()
+//
+//    lazy var textToEmojiBannerBtn: UIButton = {
+//        let textToEmojiBannerBtn = UIButton.createButton(backgroundImage: UIImage(named: "textToEmoji_banner"))
+//        textToEmojiBannerBtn.addTarget(self, action: #selector(clickTextToEmoji), for: .touchUpInside)
+//        let x = textToPhotoBannerBtn.x + textToPhotoBannerBtn.width + 11.0
+//        textToEmojiBannerBtn.frame = CGRect(x: x, y: bannerY, width: bannerW, height: bannerH)
+//        
+//        let color:UIColor = "#7855D6".uiColor
+//        let label = UILabel.createLabel(text: "Text ➡️ Emoji".localized,font: .font(name:.PoppinsBlackItalic,size: 16),textColor: color)
+//        textToEmojiBannerBtn.addSubview(label)
+//        label.snp.makeConstraints { make in
+//            make.top.equalTo(12)
+//            make.leading.equalTo(8)
+//            make.height.equalTo(24)
+//        }
+//        
+//        let button = UIButton.createButton(title:"Try Now".localized,backgroundColor:color,font: .font(size: 11),titleColor: "#D0D5FF".uiColor,corner: 9)
+//        button.contentEdgeInsets = UIEdgeInsets(top: 0, left: 6, bottom: 0, right: 6)
+//        textToEmojiBannerBtn.addSubview(button)
+//        button.snp.makeConstraints { make in
+//            make.top.equalTo(44)
+//            make.leading.equalTo(8)
+//            make.height.equalTo(18)
+//        }
+//        
+//        return textToEmojiBannerBtn
+//    }()
+//    
+//    
+//    lazy var entranceView: UIView = {
+//        let entranceView = UIView()
+//        entranceView.addSubview(textToPhotoBannerBtn)
+//        entranceView.addSubview(textToEmojiBannerBtn)
+//        return entranceView
+//    }()
     
     //###################################### 上传图片 ######################################
     lazy var uploadView: TSPTPUploadView = {
@@ -149,8 +147,8 @@ class TSPTPInputVC: TSBaseVC {
                 viewModel.upLoadImage = nil
                 uploadView.upLoadImage = nil
             }else{//添加
-                if TSPTPImageHintVC.isShowUploadImageHint{
-                    TSPTPImageHintVC.isShowUploadImageHint = false
+                if TSAIAgeImageHintVC.isShowUploadImageHint{
+                    TSAIAgeImageHintVC.isShowUploadImageHint = false
                     presentModalHintVC()
                 }else {
                     pickSinglePhoto()
@@ -164,33 +162,38 @@ class TSPTPInputVC: TSBaseVC {
     func pickSinglePhoto()  {
         photoPickerManager.pickSinglePhoto { [weak self] image,phAsset in
             guard let self = self else { return }
-
-            let maxSize = 10 * 1024 * 1024
-            
-            if let image = image,let phAsset = phAsset {
-                // 方法2:异步获取详细大小(不阻塞主线程)
-                TSPhotoSizeHelper.getImageFileSizeAsync(asset: phAsset) {[weak self] size in
-                    guard let self = self else { return }
-                    
-                    let mbSize = Double(size) / (1024 * 1024)
-                    print("精确大小: \(mbSize) MB,size = \(size)")
-                    if size > maxSize {
-                        TSToastShared.showToast(text: "Photo must be smaller than 10MB.".localized)
-                    }else{
-                        viewModel.upLoadImage = image
-                        uploadView.upLoadImage = image
-                    }
-                }
-            }else if let image = image {
-                if image.isLargerThan(byteSize: maxSize) {
+            handleSinglePhoto(image: image, phAsset: phAsset)
+        }
+    }
+    
+    func handleSinglePhoto(image:UIImage?,phAsset:PHAsset?){
+        let maxSize = 10 * 1024 * 1024
+        
+        if let image = image,let phAsset = phAsset {
+            // 方法2:异步获取详细大小(不阻塞主线程)
+            TSPhotoSizeHelper.getImageFileSizeAsync(asset: phAsset) {[weak self] size in
+                guard let self = self else { return }
+                
+                let mbSize = Double(size) / (1024 * 1024)
+                print("精确大小: \(mbSize) MB,size = \(size)")
+                if size > maxSize {
                     TSToastShared.showToast(text: "Photo must be smaller than 10MB.".localized)
                 }else{
                     viewModel.upLoadImage = image
                     uploadView.upLoadImage = image
                 }
             }
+        }else if let image = image {
+            if image.isLargerThan(byteSize: maxSize) {
+                TSToastShared.showToast(text: "Photo must be smaller than 10MB.".localized)
+            }else{
+                viewModel.upLoadImage = image
+                uploadView.upLoadImage = image
+            }
         }
     }
+    
+    
     //###################################### 选择风格 ######################################
     lazy var selectStyleView: TSPTPSelectStyleView = {
         let selectStyleView = TSPTPSelectStyleView()
@@ -350,7 +353,7 @@ class TSPTPInputVC: TSBaseVC {
         
         setUpCusStackView()
         
-        upDateCusStackViewH()
+//        upDateCusStackViewH()
         kDelayMainShort {
             self.upDateCusStackViewH()
         }
@@ -359,6 +362,7 @@ class TSPTPInputVC: TSBaseVC {
     override func dealThings() {
         NotificationCenter.default.addObserver(self, selector: #selector(vipInfoChanged), name: .kPurchaseDidChanged, object: nil)
         updateVipView()
+        TSAIAgeImageHintVC.userDefaultsKey = "isFirstUploadImagePTP"
 //        collectionViewObserverHandle()
 ////        // 监听键盘事件
 //        NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
@@ -410,8 +414,7 @@ extension TSPTPInputVC {
                 dePrint("collectionViewObserver cusStackView.viewH == \(cusStackView.viewH)")
                 return cusStackView.viewH
             }
-            dePrint("collectionViewObserver cusStackView.viewH = \(462+bannerH+bannerY+promptTextViewH)")
-            return 462+bannerH+bannerY+promptTextViewH
+            return 462 //+bannerH+bannerY+promptTextViewH
         }
     }
     
@@ -428,10 +431,10 @@ extension TSPTPInputVC {
     }
     
     func presentModalHintVC(){
-        let vc = TSPTPImageHintVC()
-        vc.clickUpImageHandle = { [weak self]  in
+        let vc = TSAIAgeImageHintVC()
+        vc.clickUpImageHandle = { [weak self] image,phAsset in
             guard let self = self else { return }
-            pickSinglePhoto()
+            handleSinglePhoto(image: image, phAsset: phAsset)
         }
         kPresentModalVC(target: self, modelVC: vc,transitionStyle: .crossDissolve)
     }
@@ -440,11 +443,11 @@ extension TSPTPInputVC {
         
         collectionComponent.collectionView.addSubview(cusStackView)
         
-        cusStackView.addSubviewToStack(entranceView)
-        entranceView.snp.makeConstraints { make in
-            make.height.equalTo(bannerH+bannerY)
-            make.width.equalTo(k_ScreenWidth)
-        }
+//        cusStackView.addSubviewToStack(entranceView)
+//        entranceView.snp.makeConstraints { make in
+//            make.height.equalTo(bannerH+bannerY)
+//            make.width.equalTo(k_ScreenWidth)
+//        }
 
         let uploadPhotoTitleView = TSTitleView.creatTitleView(title: "Upload Photo".localized, subTitle: "(Size ≤ 10MB)".localized)
         cusStackView.addSubviewToStack(uploadPhotoTitleView)
@@ -547,13 +550,13 @@ extension TSPTPInputVC {
 }
 extension TSPTPInputVC {
     
-    @objc func clickTextToPhoto() {
-        kPushVC(target: self, modelVC: TSTextGeneralPictureVC())
-    }
-    
-    @objc func clickTextToEmoji() {
-        kPushVC(target: self, modelVC: TSGenmojiVC())
-    }
+//    @objc func clickTextToPhoto() {
+//        kPushVC(target: self, modelVC: TSTextGeneralPictureVC())
+//    }
+//    
+//    @objc func clickTextToEmoji() {
+//        kPushVC(target: self, modelVC: TSGenmojiVC())
+//    }
     
     @objc func clickView() {
         view.endEditing(true)

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

@@ -39,7 +39,7 @@ class TSPTPUploadView: TSBaseView {
             make.width.height.equalTo(24)
         }
         
-        let textLabel = UILabel.createLabel(text: "Upload Image".localized,font: .font(size: 16),textColor: .white)
+        let textLabel = UILabel.createLabel(text: "Upload Photo".localized,font: .font(size: 16),textColor: .white)
         bgView.addSubview(textLabel)
         textLabel.snp.makeConstraints { make in
             make.top.equalTo(addImageView.snp.bottom).offset(16)

+ 15 - 4
AIEmoji/Business/TSPTPGeneratorVC/TSPhotoToPhotoVC/Cell/TSPTPSelectStyleCell.swift

@@ -104,16 +104,17 @@ class TSPTPSelectStyleCCell: TSBaseCollectionCell {
     var itemModel:TSPTPStyleModel = TSPTPStyleModel(){
         didSet{
             imageView.image = UIImage(named: itemModel.imageName)
+            let hotImageNamed = getHotImageNamed(specialStyle: itemModel.specialStyle)
+            hotImageView.image = UIImage(named: hotImageNamed)
+            hotImageView.isHidden = hotImageNamed.count < 0
+            
             var strokeColor = UIColor.white
             var font = UIFont.font(size: 14)
             if itemModel.specialStyle == 1 {
-                hotImageView.isHidden = false
                 font = UIFont.font(name:.PoppinsBlackItalic,size: 18)
                 strokeColor = "#FFB73C".uiColor
-            }else{
-                hotImageView.isHidden = true
             }
-        
+            
             textLabel.attributedText = NSAttributedString(
                 string: itemModel.imageText.localized,
                 attributes: [
@@ -126,6 +127,16 @@ class TSPTPSelectStyleCCell: TSBaseCollectionCell {
         }
     }
     
+    
+    func getHotImageNamed(specialStyle:Int)->String{
+        if specialStyle == 1 {
+            return "ptp_style_hot"
+        }else if specialStyle == 2 {
+            return "ptp_style_new"
+        }
+        return ""
+    }
+    
     lazy var imageView: UIImageView = {
         let imageView = UIImageView()
         return imageView

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

@@ -36,7 +36,7 @@ class TSPTPUploadCell : TSBaseCollectionCell{
             make.width.height.equalTo(24)
         }
         
-        let textLabel = UILabel.createLabel(text: "Upload Image".localized,font: .font(size: 16),textColor: .white)
+        let textLabel = UILabel.createLabel(text: "Upload Photo".localized,font: .font(size: 16),textColor: .white)
         bgView.addSubview(textLabel)
         textLabel.snp.makeConstraints { make in
             make.top.equalTo(addImageView.snp.bottom).offset(16)

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

@@ -14,7 +14,7 @@ class TSPTPStyleModel: TSBaseModel {
     var imageText:String = ""
     var prompt:String = ""
     var isVip:Bool = false
-    var specialStyle:Int = 0 //0 普通类型,1 热门类型
+    var specialStyle:Int = 0 //0 普通类型,1 热门类型,2 新类型
     var style:String = ""
     override func mapping(map: ObjectMapper.Map) {
         imageName               <- map["imageName"]

+ 17 - 6
AIEmoji/Business/TSSetingVC/SetingVC/TSSetingModel.swift

@@ -5,15 +5,26 @@
 //  Created by 100Years on 2025/1/16.
 //
 
+
+//设置页面的顺序按照给的顺序排列:
+//更新版本
+//教程
+//评分
+//分享
+//关于数据
+//删除数据
+//隐私协议
+//用户协议
+//关于我们
+
 enum SettingType: String, CaseIterable {
-    case AboutData = "About Data"
-    case removeCloudData = "Remove Cloud Data"
+    case update = "Update Version"
+    case howToUse = "How to add emojis to iMessages?"
     case rateus = "Rate us"
     case shareus = "Share us"
-    case update = "Update Version"
+    case AboutData = "About Data"
+    case removeCloudData = "Remove Cloud Data"
     case privacy = "Privacy Policy"
     case agreement = "Terms of Service"
-    
-//    case about = "About us"
-//case howToUse = "How to add emojis to iMessages?"
+    case about = "About us"
 }

+ 5 - 5
AIEmoji/Business/TSSetingVC/SetingVC/TSSetingVC.swift

@@ -34,7 +34,7 @@ class TSSetingVC: TSBaseVC {
         
         contentView.addSubview(hostVc.view)
         hostVc.view.snp.makeConstraints { make in
-            make.top.equalTo(k_Height_NavBar)
+            make.top.equalTo(k_Height_StatusBar+16)
             make.leading.trailing.bottom.equalToSuperview()
         }
     }
@@ -53,8 +53,8 @@ class TSSetingVC: TSBaseVC {
             }
             
             switch type {
-//            case .howToUse:
-//                viewModel.pushTutorials(parent: self)
+            case .howToUse:
+                viewModel.pushTutorials(parent: self)
             case .shareus:
                 viewModel.shareApp(parent: self)
             case .agreement:
@@ -70,8 +70,8 @@ class TSSetingVC: TSBaseVC {
             case .AboutData:
                 viewModel.AboutData(parent: self)
                 break
-//            case .about:
-//                break
+            case .about:
+                break
             case .rateus:
                 viewModel.rateAction()
             }

+ 3 - 3
AIEmoji/Business/TSSetingVC/SetingVC/View/TSSettingListView.swift

@@ -11,8 +11,8 @@ struct TSSettingListView: View {
     @ObservedObject var viewModel: TSSetingViewModel
     var publisher: ListEventPublisher
     var body: some View {
-        ZStack {
-            Color.clear
+        ScrollView {
+//            Color.clear
             VStack(spacing: 0) {
                 Spacer().frame(height: 16)
                 
@@ -37,7 +37,7 @@ struct TSSettingListView: View {
 
             }
             .padding(.horizontal)
-            
+            Spacer().frame(height: 20)
         }
     }
 }

+ 1 - 1
AIEmoji/Business/TSSetingVC/TSAboutDataVC.swift

@@ -78,7 +78,7 @@ class TSAboutDataVC: TSBaseVC {
     
     func addTextPrivacy(){
         let bgView = UIView()
-        let fullText = "By clicking \"Accept\", you give explicit consent that our Privacy Policy. To learn more about how we handle your personal data and our third-party partners, please refer to our Privacy Policy."
+        let fullText = "To learn more about how we handle your personal data and our third-party partners, please refer to our Privacy Policy."
         let label = TSClickableLinkLabel()
         label.translatesAutoresizingMaskIntoConstraints = false
         label.setText(

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

@@ -143,9 +143,9 @@ public class PurchaseManager: NSObject {
     }
 
     @objc public var isVip: Bool {
-//        #if DEBUG
-//            return true
-//        #endif
+        #if DEBUG
+            return true
+        #endif
         guard let expiresDate = expiredDate else {
             return false
         }

+ 1 - 1
AIEmoji/Common/Tool/TSCommonTool/TSCommonTool.swift

@@ -221,4 +221,4 @@ func kExecuteOnMainThread(_ block: @escaping () -> Void) {
     }
 }
 
-let kAppName:String = "Ghiblimage" //Ghiblii
+let kAppName:String = "Chibi" //Chibi Ghiblii

+ 1 - 0
AIEmoji/Common/View/TSPhotoPickerManager/TSPhotoPickerManager.swift

@@ -131,5 +131,6 @@ extension TSPhotoPickerManager: UIImagePickerControllerDelegate, UINavigationCon
     
     func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
         picker.dismiss(animated: true, completion: nil)
+        self.completionHandler?(nil,nil)
     }
 }

+ 21 - 0
AIEmoji/Res/photo_to_photo_style.json

@@ -6,12 +6,33 @@
         "specialStyle":1,
         "isVip": true
     },
+    {
+        "imageName": "ptp_style_disney",
+        "imageText": "Disney",
+        "prompt":"把图片变成disney风格",
+        "specialStyle":2,
+        "isVip": true
+    },
     {
         "imageName": "ptp_style_7",
         "imageText": "Fantasy Illustration",
         "prompt":"Fantasy illustration conversion:  Core structure preservation (90% shape accuracy)  Arthur Rackham-inspired inking with Art Nouveau flourishes  Spectral lighting effects (etherial glow: intensity 0.7)  Arcane texture overlay: • Ancient grimoire parchment (60% opacity) • Luminescent crystal refraction patterns • Elven vine motifs (density: 25/cm²)  Chromatic scheme: Base: Pantone 19-4052 Classic Blue Accent: 17-1463 Flame Scarlet + 13-0647 Iced Green  Mystical atmosphere injection: • Floating rune particles (size variance: 0.3-2mm) • Subtle aura pulsation (frequency: 0.5Hz) • Stardust specular highlights  Prohibited alterations: No added wings/horns/non-native elements Max 15% anatomical exaggeration Color shift tolerance ΔE<8",
         "isVip": false
     },
+    {
+        "imageName": "ptp_style_ukiyoe",
+        "imageText": "Ukiyoe",
+        "prompt":"整体转换为浮世绘风格,保留原始人物面部细节",
+        "specialStyle":2,
+        "isVip": true
+    },
+    {
+        "imageName": "ptp_style_chibi",
+        "imageText": "Chibi",
+        "prompt":"把图片变成 Chibi 风格",
+        "specialStyle":2,
+        "isVip": true
+    },
     {
         "imageName": "ptp_style_0",
         "imageText": "Retro Anime",

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

@@ -142,6 +142,11 @@
 "Size ≤ 5mb" = "Größe ≤5MB";
 "AI helps you go back to being a baby" = "KI zeigt Ihr Baby-Ich";
 "Back to Baby" = "Zum Baby werden";
-"AI predicts what you look like in your old age." = "KI sagt Ihr Aussehen im Alter voraus";
+"AI predicts what you look like in your old age" = "KI sagt Ihr Aussehen im Alter voraus";
 "Predicting Old Age" = "Alter vorhersagen";
 "About Data" = "Über Daten";
+
+"Disney" = "Disney";
+"Ukiyoe" = "Ukiyo-e";
+"Turn words into visually stunning artwork" = "Verwandeln Sie Wörter in visuell beeindruckende Kunstwerke";
+"Turn your inspiration into brilliant emojis" = "Verwandeln Sie Ihre Inspiration in brillante Emojis";

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

@@ -142,6 +142,11 @@
 "Size ≤ 5mb" = "Size ≤ 5MB";
 "AI helps you go back to being a baby" = "AI helps you go back to being a baby";
 "Back to Baby" = "Back to Baby";
-"AI predicts what you look like in your old age." = "AI predicts what you look like in your old age.";
+"AI predicts what you look like in your old age" = "AI predicts what you look like in your old age";
 "Predicting Old Age" = "Predicting Old Age";
 "About Data" = "About Data";
+
+"Disney" = "Disney";
+"Ukiyoe" = "Ukiyoe";
+"Turn words into visually stunning artwork" = "Turn words into visually stunning artwork";
+"Turn your inspiration into brilliant emojis" = "Turn your inspiration into brilliant emojis";

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

@@ -142,6 +142,11 @@
 "Size ≤ 5mb" = "Tamaño ≤5MB";
 "AI helps you go back to being a baby" = "La IA te devuelve a tu etapa de bebé";
 "Back to Baby" = "Convertir en bebé";
-"AI predicts what you look like in your old age." = "La IA predice tu apariencia en la vejez";
+"AI predicts what you look like in your old age" = "La IA predice tu apariencia en la vejez";
 "Predicting Old Age" = "Predecir vejez";
 "About Data" = "Acerca de los datos";
+
+"Disney" = "Disney";
+"Ukiyoe" = "Ukiyo-e";
+"Turn words into visually stunning artwork" = "Convierte palabras en obras de arte visualmente impresionantes";
+"Turn your inspiration into brilliant emojis" = "Convierte tu inspiración en emojis brillantes";

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

@@ -142,6 +142,11 @@
 "Size ≤ 5mb" = "サイズ≤5MB";
 "AI helps you go back to being a baby" = "AIがあなたを赤ちゃん時代に変身";
 "Back to Baby" = "ベイビーに戻る";
-"AI predicts what you look like in your old age." = "AIが予測する老後姿";
+"AI predicts what you look like in your old age" = "AIが予測する老後姿";
 "Predicting Old Age" = "老後予測";
 "About Data" = "データについて";
+
+"Disney" = "ディズニー";
+"Ukiyoe" = "浮世絵";
+"Turn words into visually stunning artwork" = "言葉を素晴らしいアートに変える";
+"Turn your inspiration into brilliant emojis" = "あなたのインスピレーションを素晴らしい表現に変えます";

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

@@ -142,6 +142,11 @@
 "Size ≤ 5mb" = "용량 ≤5MB";
 "AI helps you go back to being a baby" = "AI가 당신을 아기 시절로 돌려드립니다";
 "Back to Baby" = "아기로 변신";
-"AI predicts what you look like in your old age." = "AI가 예측하는 당신의 노년 모습";
+"AI predicts what you look like in your old age" = "AI가 예측하는 당신의 노년 모습";
 "Predicting Old Age" = "노년 모습 예측";
 "About Data" = "데이터에 대하여";
+
+"Disney" = "디즈니";
+"Ukiyoe" = "우키요에";
+"Turn words into visually stunning artwork" = "단어를 시각적으로 놀라운 예술 작품으로 바꿔 보세요.";
+"Turn your inspiration into brilliant emojis" = "영감을 화려한 이모티콘으로 바꿔보세요";

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

@@ -142,6 +142,11 @@
 "Size ≤ 5mb" = "Tamanho ≤5MB";
 "AI helps you go back to being a baby" = "IA recria sua aparência de bebê";
 "Back to Baby" = "Transformar em bebê";
-"AI predicts what you look like in your old age." = "IA prevê sua aparência na velhice";
+"AI predicts what you look like in your old age" = "IA prevê sua aparência na velhice";
 "Predicting Old Age" = "Prever velhice";
 "About Data" = "Sobre dados";
+
+"Disney" = "disney";
+"Ukiyoe" = "Ukiyo-e";
+"Turn words into visually stunning artwork" = "Transforme palavras em obras de arte visualmente deslumbrantes";
+"Turn your inspiration into brilliant emojis" = "Transforme sua inspiração em emojis brilhantes";

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

@@ -142,6 +142,11 @@
 "Size ≤ 5mb" = "Tamanho ≤5MB";
 "AI helps you go back to being a baby" = "IA recria sua aparência de bebê";
 "Back to Baby" = "Transformar em bebê";
-"AI predicts what you look like in your old age." = "IA prevê sua aparência na velhice";
+"AI predicts what you look like in your old age" = "IA prevê sua aparência na velhice";
 "Predicting Old Age" = "Prever velhice";
 "About Data" = "Sobre dados";
+
+"Disney" = "disney";
+"Ukiyoe" = "Ukiyo-e";
+"Turn words into visually stunning artwork" = "Transforme palavras em obras de arte visualmente deslumbrantes";
+"Turn your inspiration into brilliant emojis" = "Transforme sua inspiração em emojis brilhantes";

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

@@ -142,6 +142,11 @@
 "Size ≤ 5mb" = "大小≤5MB";
 "AI helps you go back to being a baby" = "AI 帮你回到婴儿时期";
 "Back to Baby" = "变回婴儿";
-"AI predicts what you look like in your old age." = "AI 预测你晚年的模样";
+"AI predicts what you look like in your old age" = "AI 预测你晚年的模样";
 "Predicting Old Age" = "预测晚年";
 "About Data" = "关于数据";
+
+"Disney" = "迪士尼";
+"Ukiyoe" = "浮世绘";
+"Turn words into visually stunning artwork" = "将文字变成令人惊叹的艺术";
+"Turn your inspiration into brilliant emojis" = "将您的灵感转化为精彩的表情";

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

@@ -138,6 +138,11 @@
 "Size ≤ 5mb" = "大小≤5MB";
 "AI helps you go back to being a baby" = "AI 幫你回到嬰兒時期";
 "Back to Baby" = "變回嬰兒";
-"AI predicts what you look like in your old age." = "AI 預測你晚年的模樣";
+"AI predicts what you look like in your old age" = "AI 預測你晚年的模樣";
 "Predicting Old Age" = "預測晚年";
 "About Data" = "關於數據";
+
+"Disney" = "迪士尼";
+"Ukiyoe" = "浮世繪";
+"Turn words into visually stunning artwork" = "將文字變成令人驚嘆的藝術";
+"Turn your inspiration into brilliant emojis" = "將您的靈感轉化為精彩的表情";