Browse Source

修改第一批 1.7(1)bug

100Years 1 month ago
parent
commit
0476364bf2
19 changed files with 184 additions and 51 deletions
  1. 6 2
      AIEmoji.xcodeproj/project.pbxproj
  2. 22 0
      AIEmoji/Assets.xcassets/Common/inspiration_yellow.imageset/Contents.json
  3. BIN
      AIEmoji/Assets.xcassets/Common/inspiration_yellow.imageset/inspiration_yellow@2x.png
  4. BIN
      AIEmoji/Assets.xcassets/Common/inspiration_yellow.imageset/inspiration_yellow@3x.png
  5. 6 3
      AIEmoji/Business/AIChat/TSChatViewController/Models/TSLayoutSizeCalculator.swift
  6. 1 1
      AIEmoji/Business/AIChat/TSChatViewController/ViewModel/TSAIChatVM.swift
  7. 1 0
      AIEmoji/Business/AIChat/TSChatViewController/Views/TSMessageContentCell.swift
  8. 18 11
      AIEmoji/Business/General/TSBigIconBrowseVC/TSBigIconBrowseCell.swift
  9. 1 1
      AIEmoji/Business/General/TSBigIconBrowseVC/TSBigIconBrowseVC.swift
  10. 15 13
      AIEmoji/Business/TSEmojisVC/TSEmojisVC/TSEmojisVC.swift
  11. 1 1
      AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/TSGenmojiVC.swift
  12. 49 3
      AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/View/TSGenmojiGennerateCell.swift
  13. 1 1
      AIEmoji/Business/TSSetingVC/SetingVC/TSSetingModel.swift
  14. 3 2
      AIEmoji/Business/TSSetingVC/SetingVC/View/SettingPurchaseTopView.swift
  15. 4 4
      AIEmoji/Business/TSTabBarController/TSTabBarController.swift
  16. 2 6
      AIEmoji/Business/TSTextGeneralPictureVC/TSTextGeneralPictureVC/TSTextGeneralPictureVC.swift
  17. 21 2
      AIEmoji/Business/TSTextGeneralPictureVC/TSTextGeneralPictureVC/ViewModel/TSTextGeneralPictureVM.swift
  18. 6 1
      AIEmoji/Business/TSTextGeneralPictureVC/TSTextPicGennerateVC/TSTextPicGennerateVC.swift
  19. 27 0
      AIEmoji/Common/Tool/TSRandomTextPicker.swift

+ 6 - 2
AIEmoji.xcodeproj/project.pbxproj

@@ -44,6 +44,7 @@
 		A85E47982D672AE70018D62D /* TSTextPicGennerateVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = A85E47972D672AE40018D62D /* TSTextPicGennerateVM.swift */; };
 		A85E479B2D6808C40018D62D /* TSBigIconBrowseVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A85E479A2D6808C30018D62D /* TSBigIconBrowseVC.swift */; };
 		A85E479D2D6809DC0018D62D /* TSBigIconBrowseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A85E479C2D6809DA0018D62D /* TSBigIconBrowseCell.swift */; };
+		A85E479F2D6859FA0018D62D /* TSRandomTextPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = A85E479E2D6859F80018D62D /* TSRandomTextPicker.swift */; };
 		A89EA64B2D59A588000EB181 /* MessageKit in Frameworks */ = {isa = PBXBuildFile; productRef = A89EA64A2D59A588000EB181 /* MessageKit */; };
 		A89EA6542D59A9F4000EB181 /* TSTextLayoutSizeCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A89EA64F2D59A9F4000EB181 /* TSTextLayoutSizeCalculator.swift */; };
 		A89EA6552D59A9F4000EB181 /* TSChatMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = A89EA6502D59A9F4000EB181 /* TSChatMessage.swift */; };
@@ -170,6 +171,7 @@
 		A85E47972D672AE40018D62D /* TSTextPicGennerateVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSTextPicGennerateVM.swift; sourceTree = "<group>"; };
 		A85E479A2D6808C30018D62D /* TSBigIconBrowseVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBigIconBrowseVC.swift; sourceTree = "<group>"; };
 		A85E479C2D6809DA0018D62D /* TSBigIconBrowseCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBigIconBrowseCell.swift; sourceTree = "<group>"; };
+		A85E479E2D6859F80018D62D /* TSRandomTextPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSRandomTextPicker.swift; sourceTree = "<group>"; };
 		A89EA64C2D59A9F4000EB181 /* CustomMessageFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMessageFlowLayout.swift; sourceTree = "<group>"; };
 		A89EA64E2D59A9F4000EB181 /* TSLayoutSizeCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLayoutSizeCalculator.swift; sourceTree = "<group>"; };
 		A89EA64F2D59A9F4000EB181 /* TSTextLayoutSizeCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSTextLayoutSizeCalculator.swift; sourceTree = "<group>"; };
@@ -690,6 +692,7 @@
 		A8F774CE2D38EA8C00AA6E93 /* Tool */ = {
 			isa = PBXGroup;
 			children = (
+				A85E479E2D6859F80018D62D /* TSRandomTextPicker.swift */,
 				A8F774C82D38EA8C00AA6E93 /* TSCommonTool */,
 				A8F774CA2D38EA8C00AA6E93 /* TSFileManagerTool.swift */,
 				A8F7754F2D39ECED00AA6E93 /* PhotoManager.swift */,
@@ -1197,6 +1200,7 @@
 				A80E72772D41EFF900C64288 /* TSEmojisTutorialsVC.swift in Sources */,
 				A8F776482D3DE9F600AA6E93 /* TSSmallIconBrowseCell.swift in Sources */,
 				A8F7753D2D3918F800AA6E93 /* TSNetWork+Business.swift in Sources */,
+				A85E479F2D6859FA0018D62D /* TSRandomTextPicker.swift in Sources */,
 				A80E72262D3F3A9A00C64288 /* HYHAddImageView.m in Sources */,
 				A80E72272D3F3A9A00C64288 /* DiyTextElement.swift in Sources */,
 				A8FB02BA2D3E3BB20031A396 /* TSEmojisCoLItemCell.swift in Sources */,
@@ -1257,7 +1261,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -1296,7 +1300,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;

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

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

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


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


+ 6 - 3
AIEmoji/Business/AIChat/TSChatViewController/Models/TSLayoutSizeCalculator.swift

@@ -26,15 +26,18 @@ class TSLayoutSizeCalculator: MessageSizeCalculator {//CellSizeCalculator {
 
     static var avatarSize = CGSizeMake(40, 40)
     //MARK: ###################################左边头像###################################
-    static var leadingAvatarEdge:UIEdgeInsets = UIEdgeInsets(top: topSpaceH, left: 16, bottom: 0, right: 0)
-    static var leadingAvatarSize = CGSizeMake(40, 40)
+//    static var leadingAvatarEdge:UIEdgeInsets = UIEdgeInsets(top: topSpaceH, left: 16, bottom: 0, right: 0)
+//    static var leadingAvatarSize = CGSizeMake(40, 40)
+    static var leadingAvatarEdge:UIEdgeInsets = UIEdgeInsets(top: topSpaceH, left: 0, bottom: 0, right: 0)
+    static var leadingAvatarSize = CGSizeMake(0, 0)
     //MARK: ###################################右边头像###################################
     static var traingAvatarEdge:UIEdgeInsets = UIEdgeInsets(top: topSpaceH, left: 0, bottom: 0, right: 0)
     static var traingAvatarSize = CGSizeMake(0, 0)
     
     //MARK: ###################################消息容器###################################
     //消息容器的 UIEdgeInsets
-    static var cellMessageContainerLeadingEdge:UIEdgeInsets = UIEdgeInsets(top: topSpaceH, left: 8, bottom: 0, right: 16)
+//    static var cellMessageContainerLeadingEdge:UIEdgeInsets = UIEdgeInsets(top: topSpaceH, left: 8, bottom: 0, right: 16)
+    static var cellMessageContainerLeadingEdge:UIEdgeInsets = UIEdgeInsets(top: topSpaceH, left: 16, bottom: 0, right: 16)
     static var cellMessageContainerTraingEdge:UIEdgeInsets = UIEdgeInsets(top: topSpaceH, left: 16, bottom: 0, right: 16)
     static var cellMessageContainerMinSize:CGSize = CGSizeMake(48, 48)
     

+ 1 - 1
AIEmoji/Business/AIChat/TSChatViewController/ViewModel/TSAIChatVM.swift

@@ -97,7 +97,7 @@ extension TSAIChatVM {
         if uiStyle == .history {
             return self.dbAIChatList.getMessageList()
         }else {
-            let aiString = "I can tackle your questions, my skillset includes, but is not limited to:\n\n📧 Composing high-quality emails  \n🇺🇸 Facilitating language learning  \n📑 Assisting in your studies  \n💡 Brainstorming ideas and much more!"
+            let aiString = "I can tackle your questions, my skillset includes, but is not limited to:\n\n📧 Composing high-quality emails\n\n🇺🇸 Facilitating language learning\n\n📑 Assisting in your studies\n\n💡Brainstorming ideas\n\nand much more!"
             let msg = TSChatMessage(kind: .attributedText(kMDAttributedString(text: aiString)), user: kAIUser, messageId: "", date: Date())
             return [msg]
         }

+ 1 - 0
AIEmoji/Business/AIChat/TSChatViewController/Views/TSMessageContentCell.swift

@@ -54,6 +54,7 @@ class TSMessageContentCell: MessageCollectionViewCell {
     // 左头像
     var leadingAvatarImageView: UIImageView = {
         let imageView = UIImageView.createImageView(imageName: "aichat_avatar")
+        imageView.isHidden = true
         return imageView
     }()
     

+ 18 - 11
AIEmoji/Business/General/TSBigIconBrowseVC/TSBigIconBrowseCell.swift

@@ -12,19 +12,17 @@ class TSBigIconBrowseCell : TSBaseCollectionCell{
         let netWorkImageView = UIImageView.createImageView(imageName: "",corner: 24.0)
         return netWorkImageView
     }()
-    
-    
-    lazy var textBtn: UIButton = {
-        let textBtn = UIButton.createButton(
-            backgroundColor: "#333333".uiColor,
+
+    lazy var textLabel: UILabel = {
+        let textLabel = UILabel.createLabel(
             font: .font(size: 12),
-            titleColor: .white,
-            corner: 16
+            textColor: .white,
+            numberOfLines: 0
         )
-        textBtn.contentEdgeInsets = UIEdgeInsets(top: 12, left: 12, bottom: 12, right: 12)
-        return textBtn
+        return textLabel
     }()
     
+
     lazy var vipImageView: UIImageView = {
         let vipImageView = UIImageView.createImageView(imageName:"vip_side_icon")
         vipImageView.contentMode = .scaleToFill
@@ -43,8 +41,17 @@ class TSBigIconBrowseCell : TSBaseCollectionCell{
             make.height.equalTo(h)
         }
         
-        bgContentView.addSubview(textBtn)
-        textBtn.snp.makeConstraints { make in
+        let labelBgView = UIView()
+        labelBgView.backgroundColor = "#333333".uiColor
+        labelBgView.cornerRadius = 16.0
+        labelBgView.addSubview(textLabel)
+        textLabel.snp.makeConstraints { make in
+            make.top.leading.equalTo(12)
+            make.trailing.bottom.equalTo(-12)
+        }
+        
+        bgContentView.addSubview(labelBgView)
+        labelBgView.snp.makeConstraints { make in
             make.top.equalTo(netWorkImageView.snp.bottom).offset(20)
             make.centerX.equalToSuperview()
             make.leading.greaterThanOrEqualTo(16)

+ 1 - 1
AIEmoji/Business/General/TSBigIconBrowseVC/TSBigIconBrowseVC.swift

@@ -199,7 +199,7 @@ extension TSBigIconBrowseVC:UICollectionViewDataSource,UICollectionViewDelegate
         if let model = dataModelArray.safeObj(At: indexPath.item){
             cell.netWorkImageView.setAsyncImage(urlString: model.response.resultUrl,placeholder: kPlaceholderImage,contentMode: .scaleAspectFill)
             cell.vipImageView.isHidden = !model.response.vip
-            cell.textBtn.setTitle(model.request.prompt, for: .normal)
+            cell.textLabel.text = model.request.prompt
         }
         return cell
     }

+ 15 - 13
AIEmoji/Business/TSEmojisVC/TSEmojisVC/TSEmojisVC.swift

@@ -70,17 +70,17 @@ class TSEmojisVC: TSBaseVC {
             make.height.equalTo(117*kDesignScale)
         }
         
-        let closeBtn = UIButton.createButton{ [weak self]  in
-            guard let self = self else { return }
-            viewModel.isHiddenBanner = true
-            pagingView.reloadData()
-        }
-        view.addSubview(closeBtn)
-        closeBtn.snp.makeConstraints { make in
-            make.top.equalTo(16)
-            make.trailing.equalTo(-16)
-            make.width.height.equalTo(50)
-        }
+//        let closeBtn = UIButton.createButton{ [weak self]  in
+//            guard let self = self else { return }
+//            viewModel.isHiddenBanner = true
+//            pagingView.reloadData()
+//        }
+//        view.addSubview(closeBtn)
+//        closeBtn.snp.makeConstraints { make in
+//            make.top.equalTo(16)
+//            make.trailing.equalTo(-16)
+//            make.width.height.equalTo(50)
+//        }
         return view
     }()
     
@@ -166,11 +166,13 @@ class TSEmojisVC: TSBaseVC {
 extension TSEmojisVC: JXPagingViewDelegate {
 
     func tableHeaderViewHeight(in pagingView: JXPagingView) -> Int {
-        return viewModel.isHiddenBanner ? 0 : tableHeaderViewHeight
+//        return viewModel.isHiddenBanner ? 0 : tableHeaderViewHeight
+        return tableHeaderViewHeight
     }
 
     func tableHeaderView(in pagingView: JXPagingView) -> UIView {
-        return viewModel.isHiddenBanner ? UIView() : headerView
+//        return viewModel.isHiddenBanner ? UIView() : headerView
+        return headerView
     }
 
     func heightForPinSectionHeader(in pagingView: JXPagingView) -> Int {

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

@@ -56,7 +56,7 @@ class TSGenmojiVC: TSBaseVC {
     lazy var collectionComponent: TSCollectionViewComponent = {
         let layout = UICollectionViewFlowLayout()
         let cp = TSCollectionViewComponent(frame: CGRect.zero, layout: layout, attributes: [ :])
-        cp.collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: k_Height_TabBar, right: 0)
+        cp.collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 20, right: 0)
         cp.itemActionHandler = { [weak self] cellCp, indexPath in
             guard let self = self else { return }
             if let text = cellCp as? String ,indexPath == IndexPath(item: 0, section: 0) {

+ 49 - 3
AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/View/TSGenmojiGennerateCell.swift

@@ -7,10 +7,16 @@
 
 class TSGenmojiGennerateCell : TSBaseCollectionCell{
     lazy var robotImageView: UIImageView = {
-        let robotImageView = UIImageView.createImageView(imageName: "genmoji_robot")
+        let robotImageView = UIImageView.createImageView(imageName: "aichat_avatar")
         return robotImageView
     }()
     
+    
+    lazy var randomTextPicker: TSRandomTextPicker = {
+        let textPicker = TSRandomTextPicker(texts: kRandomTextArray)
+        return textPicker
+    }()
+    
     lazy var customTextView: TSCustomTextView = {
         let customTextView = TSCustomTextView(
             placeholder: "Type your idea here.",
@@ -38,6 +44,25 @@ class TSGenmojiGennerateCell : TSBaseCollectionCell{
     }()
     
     
+    lazy var inspirationBtn: UIButton = {
+        let inspirationBtn = UIButton.createButton(
+            title: "Hint Inspiration".localized,
+            image: UIImage(named: "inspiration_yellow"),
+            backgroundColor:"#FECB34".uiColor.withAlphaComponent(0.1),
+            font: .font(size: 12),
+            titleColor: .themeColor,
+            corner: 8.0)
+        { [weak self]  in
+            guard let self = self else { return }
+            customTextView.text = randomTextPicker.getRandomText()
+            textViewDidChange(customTextView)
+        }
+        inspirationBtn.contentEdgeInsets = UIEdgeInsets(top: 4, left: 7, bottom: 4, right: 7)
+        inspirationBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: -4, bottom: 0, right: 0)
+        inspirationBtn.isHidden = true
+        return inspirationBtn
+    }()
+    
     override func creatUI() {
         
         contentView.addSubview(robotImageView)
@@ -55,6 +80,13 @@ class TSGenmojiGennerateCell : TSBaseCollectionCell{
             make.height.equalTo(182.0*kDesignScale)
         }
         
+        contentView.addSubview(inspirationBtn)
+        inspirationBtn.snp.makeConstraints { make in
+            make.height.equalTo(28)
+            make.bottom.equalTo(customTextView.snp.bottom).offset(-8)
+            make.trailing.equalTo(customTextView.snp.trailing).offset(-8)
+        }
+        
         contentView.addSubview(submitBtn)
         submitBtn.snp.makeConstraints { make in
             make.top.equalTo(customTextView.snp.bottom).offset(16)
@@ -76,20 +108,34 @@ class TSGenmojiGennerateCell : TSBaseCollectionCell{
         super.renderView(with: object, component: component, attributes: attributes)
         
         var title = "Generate"
-        if kPurchaseDefault.isVip == false,
-           let itemModel = object as? TSGenmojiCoLItemModel{
+        if let itemModel = object as? TSGenmojiCoLItemModel{
             if itemModel.style == .generate{
                 title = "Generate (\(kPurchaseDefault.freeNum(type: .generatePic)))"
+                inspirationBtn.isHidden = true
             }else if itemModel.style == .textPicGenerate{
                 title = "Generate (\(kPurchaseDefault.freeNum(type: .textGeneratePic)))"
+                inspirationBtn.isHidden = false
             }
         }
+        
+        if kPurchaseDefault.isVip == true {
+            title = "Generate"
+        }
         submitBtn.setTitle(title, for: .normal)
+        
+        
+        
+        
 
     }
 }
 
 extension TSGenmojiGennerateCell: UITextViewDelegate{
+    
+    func textViewDidBeginEditing(_ textView: UITextView) {
+        self.colComponent?.collectionView.scrollToItem(at: IndexPath(item: 0, section: 0), at: .centeredVertically, animated: true)
+    }
+    
     func textViewDidChange(_ textView: UITextView) {
         submitBtn.isEnabled = textView.text.replacingOccurrences(of: " ", with: "") .count > 0
     }

+ 1 - 1
AIEmoji/Business/TSSetingVC/SetingVC/TSSetingModel.swift

@@ -6,7 +6,7 @@
 //
 
 enum SettingType: String, CaseIterable {
-    case howToUse = "How to use?"
+    case howToUse = "How to add emojis to iMessages?"
     case shareus = "Share us"
     case rateus = "Rate us"
     case agreement = "Terms of Service"

+ 3 - 2
AIEmoji/Business/TSSetingVC/SetingVC/View/SettingPurchaseTopView.swift

@@ -10,9 +10,10 @@ struct SettingPurchaseTopView: View {
     @Binding var isViper: Bool
     var body: some View {
         ZStack {
-            Image(PurchaseManager.default.isVip ? .settingVip : .settingNoVip).resizable().frame(width: 343*kDesignScale, height: 117*kDesignScale)
+            
 
             if isViper {
+                Image(.settingVip).resizable().frame(width: 343*kDesignScale, height: 117*kDesignScale)
                 VStack {
                     Spacer()
         
@@ -24,7 +25,7 @@ struct SettingPurchaseTopView: View {
                     Spacer().frame(height: 13)
                 }
             }else {
-                
+                Image(.settingNoVip).resizable().frame(width: 343*kDesignScale, height: 117*kDesignScale)
                 HStack {
                     Spacer()
                     

+ 4 - 4
AIEmoji/Business/TSTabBarController/TSTabBarController.swift

@@ -24,18 +24,18 @@ class TSTabBarController: UITabBarController {
     }
 
     @objc private func setUpData() {
-        viewControllerArray = ["TSChatViewController", "TSTextGeneralPictureVC","TSEmojisVC", "TSSetingVC"]
-        titleArray = ["AIChat","AI Wallpaper","Emojis","Setting"]
+        viewControllerArray = ["TSEmojisVC","TSChatViewController", "TSTextGeneralPictureVC", "TSSetingVC"]
+        titleArray = ["Emojis","Chat","Wallpaper","Setting"]
         selectedImageArray = [
+            "tabbar_select_emoji",
             "tabbar_select_aichat",
             "tabbar_select_pic",
-            "tabbar_select_emoji",
             "tabbar_select_setting"
         ]
         unselectedImageArray = [
+            "tabbar_unSelect_emoji",
             "tabbar_unSelect_aichat",
             "tabbar_unSelect_pic",
-            "tabbar_unSelect_emoji",
             "tabbar_unSelect_setting"
         ]
 

+ 2 - 6
AIEmoji/Business/TSTextGeneralPictureVC/TSTextGeneralPictureVC/TSTextGeneralPictureVC.swift

@@ -32,10 +32,6 @@ class TSTextGeneralPictureVC: TSBaseVC {
        
        let keyboardBtn = UIButton.createButton(image: UIImage(named: "keyboard")) { [weak self]  in
            guard let self = self else { return }
-//           let vc = TSWallpaperVC()
-//           vc.hidesBottomBarWhenPushed = true
-//           navigationController?.pushViewController(vc, animated: true)
-           
            kPresentModalVC(target: self, modelVC: TSWallpaperVC())
        }
        navBarView.barView.addSubview(keyboardBtn)
@@ -58,7 +54,7 @@ class TSTextGeneralPictureVC: TSBaseVC {
     lazy var collectionComponent: TSCollectionViewComponent = {
         let layout = UICollectionViewFlowLayout()
         let cp = TSCollectionViewComponent(frame: CGRect.zero, layout: layout, attributes: [ :])
-        cp.collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: k_Height_TabBar, right: 0)
+        cp.collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 20, right: 0)
         cp.itemActionHandler = { [weak self] cellCp, indexPath in
             guard let self = self else { return }
             if let text = cellCp as? String ,indexPath == IndexPath(item: 0, section: 0) {
@@ -114,7 +110,7 @@ class TSTextGeneralPictureVC: TSBaseVC {
             make.edges.equalToSuperview()
         }
         
-        collectionComponent.collectionView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickCollectionView)))
+//        view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickCollectionView)))
         collectionComponent.clear()
         collectionComponent.reloadView(with:viewModel.colDataArray)
         

+ 21 - 2
AIEmoji/Business/TSTextGeneralPictureVC/TSTextGeneralPictureVC/ViewModel/TSTextGeneralPictureVM.swift

@@ -7,6 +7,22 @@
 
 import ObjectMapper
 
+
+
+let kRandomTextArray:[String] = [
+    "Ultra-detailed northern lights over a glacial lake, mirrored reflections with vibrant turquoise and magenta hues, surreal celestial atmosphere, digital painting style with soft glow effects.",
+    "Neon-lit cyberpunk night market in a rainy Asian metropolis, holographic food stalls and floating drones, teal-orange color grading, retro-futuristic architecture with glowing Kanji signs",
+    "Macro photography of rainbow candy landscape with gummy bear mountains, chocolate river and lollipop trees, hyper-realistic textures under golden hour lighting",
+    "Traditional Chinese ink painting style phoenix soaring through misty mountain peaks, dynamic black brushstrokes with crimson accents on rice paper texture",
+    "Bioluminescent underwater metropolis with glass dome structures, schools of glowing fish weaving through coral skyscrapers, deep-sea blue palette with neon coral highlights",
+    "1950s retro sci-fi movie poster style wallpaper featuring a rocket orbiting Saturn, vintage orange-teal color scheme with halftone textures and hand-drawn typography",
+    "Minimalist wallpaper with overlapping translucent 3D geometric shapes in gradient pastel colors, clean negative space, soft shadows and metallic accents, 4K abstract design.",
+    "Steampunk floating library with brass gears and clockwork mechanisms, leather-bound books flying through amber-lit fog, Victorian-era architecture blended with retro-futurism",
+    "Zen rock garden transformed into cosmic landscape, black sand waves surrounding cratered moon-like stones, starry galaxy reflected in miniature, monochromatic with silver foil accents",
+    "Futuristic AI core visualization with flowing golden data streams through transparent quantum circuits, dark background with floating holographic equations, cybernetic glow effect"
+]
+
+
 class TSTextGeneralPictureVM {
     var colDataArray:[TSComponent] = [TSComponent]()
 
@@ -47,8 +63,6 @@ class TSTextGeneralPictureVM {
         return sectionModel
     }()
     
-    
-
     init() {
         combinedData()
     }
@@ -115,3 +129,8 @@ extension TSTextGeneralPictureVM {
     }
     
 }
+
+
+
+
+

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

@@ -93,7 +93,7 @@ class TSTextPicGennerateVC: TSBottomAlertVC {
         let netWorkImageViewW = k_ScreenWidth - 120.0
         let netWorkImageViewH = netWorkImageViewW/kTextWHScale
         netWorkImageView.snp.makeConstraints { make in
-            make.top.equalTo(90)
+            make.top.equalTo(90*kDesignScale)
             make.centerX.equalToSuperview()
             make.width.equalTo(netWorkImageViewW)
             make.height.equalTo(netWorkImageViewH)
@@ -121,6 +121,11 @@ class TSTextPicGennerateVC: TSBottomAlertVC {
     
     //重试
     @objc override func clickSubmitBtn(){
+        //判断 vip
+        if kJudgeVip(externalBool: kPurchaseDefault.freeNumAvailable(type: .textGeneratePic) == false, vc: self) {[weak self] in
+            guard let self = self else { return }
+        }{ return }
+        
         viewModel.creatImageEmoji(text:aiText)
     }
     

+ 27 - 0
AIEmoji/Common/Tool/TSRandomTextPicker.swift

@@ -0,0 +1,27 @@
+//
+//  TSRandomTextPicker.swift
+//  AIEmoji
+//
+//  Created by 100Years on 2025/2/20.
+//
+
+class TSRandomTextPicker {
+    private var texts: [String]
+    private var lastIndex: Int?
+
+    init(texts: [String]) {
+        self.texts = texts
+    }
+    
+    func getRandomText() -> String? {
+        guard !texts.isEmpty else { return nil }
+        
+        var randomIndex: Int
+        repeat {
+            randomIndex = Int.random(in: 0..<texts.count)
+        } while randomIndex == lastIndex
+        
+        lastIndex = randomIndex
+        return texts[randomIndex]
+    }
+}