Эх сурвалжийг харах

feat: 增加众多的视频类型

100Years 1 сар өмнө
parent
commit
65df4fec21
31 өөрчлөгдсөн 1263 нэмэгдсэн , 214 устгасан
  1. 72 4
      TSLiveWallpaper.xcodeproj/project.pbxproj
  2. 22 0
      TSLiveWallpaper/Assets.xcassets/AIList/ailist_smallShaow.imageset/Contents.json
  3. BIN
      TSLiveWallpaper/Assets.xcassets/AIList/ailist_smallShaow.imageset/ailist_smallShaow@2x.png
  4. BIN
      TSLiveWallpaper/Assets.xcassets/AIList/ailist_smallShaow.imageset/ailist_smallShaow@3x.png
  5. 31 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIList+Enmu.swift
  6. 1 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/TSAIListHistoryVC.swift
  7. 169 33
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/TSAIListVC.swift
  8. 114 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataModel.swift
  9. 57 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM+Click.swift
  10. 164 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM+Dic.swift
  11. 164 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM.swift
  12. 6 115
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/View/TSAILIstCell.swift
  13. 139 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/View/TSAILIstFullCardCell.swift
  14. 156 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/View/TSAILIstStyleMoreCell.swift
  15. 24 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoGeneratorVC/Model/TSAIListPhotoGeneratorModel.swift
  16. 14 3
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIUploadPhotoVC.swift
  17. 1 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/View/TSAIUploadPhotoTextView.swift
  18. 6 6
      TSLiveWallpaper/Common/TSNetWork/TSNetworkManager.swift
  19. 66 35
      TSLiveWallpaper/Data/OperationQueue/TSGenerateBaseOperation/TSGenerateBasePhotoOperation.swift
  20. 30 3
      TSLiveWallpaper/Data/TSDBManager/TSDBActionInfoModel.swift
  21. 27 12
      TSLiveWallpaper/Data/TSDBManager/TSDBManager.swift
  22. BIN
      TSLiveWallpaper/Resource/Gif/aiList_BlowKiss.gif
  23. BIN
      TSLiveWallpaper/Resource/Gif/aiList_ForeheadKiss.gif
  24. BIN
      TSLiveWallpaper/Resource/Gif/aiList_HeartGesture.gif
  25. BIN
      TSLiveWallpaper/Resource/Gif/aiList_Hug.gif
  26. BIN
      TSLiveWallpaper/Resource/Gif/aiList_Kiss.gif
  27. BIN
      TSLiveWallpaper/Resource/Gif/aiList_SayHi.gif
  28. BIN
      TSLiveWallpaper/Resource/Gif/aiList_Smile.gif
  29. BIN
      TSLiveWallpaper/Resource/Gif/aiList_Stroll.gif
  30. BIN
      TSLiveWallpaper/Resource/animated_example.gif
  31. BIN
      TSLiveWallpaper/Resource/animated_photos.webp

+ 72 - 4
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -60,6 +60,20 @@
 		A839463C2D1D6E3600ABFF0D /* TSRandomWallpaperCopyrightVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A839463B2D1D6E3500ABFF0D /* TSRandomWallpaperCopyrightVC.swift */; };
 		A839463C2D1D6E3600ABFF0D /* TSRandomWallpaperCopyrightVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A839463B2D1D6E3500ABFF0D /* TSRandomWallpaperCopyrightVC.swift */; };
 		A839463F2D1D6FB700ABFF0D /* TSLiveWallpaperTutorialsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A839463E2D1D6FB600ABFF0D /* TSLiveWallpaperTutorialsVC.swift */; };
 		A839463F2D1D6FB700ABFF0D /* TSLiveWallpaperTutorialsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A839463E2D1D6FB600ABFF0D /* TSLiveWallpaperTutorialsVC.swift */; };
 		A83946432D1D701500ABFF0D /* TSLiveWallpaperCopyrightVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83946422D1D701300ABFF0D /* TSLiveWallpaperCopyrightVC.swift */; };
 		A83946432D1D701500ABFF0D /* TSLiveWallpaperCopyrightVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83946422D1D701300ABFF0D /* TSLiveWallpaperCopyrightVC.swift */; };
+		A83F28892E162343009A4975 /* TSAIListDataVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83F28882E16233B009A4975 /* TSAIListDataVM.swift */; };
+		A83F288B2E162369009A4975 /* TSAIListDataVM+Dic.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83F288A2E162364009A4975 /* TSAIListDataVM+Dic.swift */; };
+		A83F288D2E162B19009A4975 /* TSAILIstFullCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83F288C2E162B18009A4975 /* TSAILIstFullCardCell.swift */; };
+		A83F288F2E162B7C009A4975 /* TSAILIstStyleMoreCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83F288E2E162B7B009A4975 /* TSAILIstStyleMoreCell.swift */; };
+		A83F28912E162DB7009A4975 /* TSAIListDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83F28902E162DB3009A4975 /* TSAIListDataModel.swift */; };
+		A83F28932E162E45009A4975 /* TSAIListDataVM+Click.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83F28922E162E42009A4975 /* TSAIListDataVM+Click.swift */; };
+		A83F289F2E165043009A4975 /* aiList_Hug.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83F289A2E165043009A4975 /* aiList_Hug.gif */; };
+		A83F28A02E165043009A4975 /* aiList_Smile.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83F289D2E165043009A4975 /* aiList_Smile.gif */; };
+		A83F28A12E165043009A4975 /* aiList_HeartGesture.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83F28992E165043009A4975 /* aiList_HeartGesture.gif */; };
+		A83F28A22E165043009A4975 /* aiList_SayHi.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83F289C2E165043009A4975 /* aiList_SayHi.gif */; };
+		A83F28A32E165043009A4975 /* aiList_BlowKiss.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83F28972E165043009A4975 /* aiList_BlowKiss.gif */; };
+		A83F28A42E165043009A4975 /* aiList_Kiss.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83F289B2E165043009A4975 /* aiList_Kiss.gif */; };
+		A83F28A52E165043009A4975 /* aiList_Stroll.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83F289E2E165043009A4975 /* aiList_Stroll.gif */; };
+		A83F28A62E165043009A4975 /* aiList_ForeheadKiss.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83F28982E165043009A4975 /* aiList_ForeheadKiss.gif */; };
 		A8477C972D22737900DF0B93 /* TSBusinessWebVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8477C962D22737800DF0B93 /* TSBusinessWebVC.swift */; };
 		A8477C972D22737900DF0B93 /* TSBusinessWebVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8477C962D22737800DF0B93 /* TSBusinessWebVC.swift */; };
 		A8477C9F2D22ABDA00DF0B93 /* TSEditLiveEidtCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8477C9E2D22ABD500DF0B93 /* TSEditLiveEidtCell.swift */; };
 		A8477C9F2D22ABDA00DF0B93 /* TSEditLiveEidtCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8477C9E2D22ABD500DF0B93 /* TSEditLiveEidtCell.swift */; };
 		A84C239A2D1E3A4300B61B55 /* GPVideoPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A84C23962D1E3A4300B61B55 /* GPVideoPlayerView.swift */; };
 		A84C239A2D1E3A4300B61B55 /* GPVideoPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A84C23962D1E3A4300B61B55 /* GPVideoPlayerView.swift */; };
@@ -152,7 +166,6 @@
 		A8F8BCE32E0423B100EF4AA6 /* TSAIPhotoDetailsVC+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCE22E0423AD00EF4AA6 /* TSAIPhotoDetailsVC+View.swift */; };
 		A8F8BCE32E0423B100EF4AA6 /* TSAIPhotoDetailsVC+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCE22E0423AD00EF4AA6 /* TSAIPhotoDetailsVC+View.swift */; };
 		A8F8BCE62E04F62400EF4AA6 /* TSAIListPhotoGeneratorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCE52E04F62200EF4AA6 /* TSAIListPhotoGeneratorModel.swift */; };
 		A8F8BCE62E04F62400EF4AA6 /* TSAIListPhotoGeneratorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCE52E04F62200EF4AA6 /* TSAIListPhotoGeneratorModel.swift */; };
 		A8F8BCEB2E0501DC00EF4AA6 /* TSAppUpdateAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCEA2E0501DB00EF4AA6 /* TSAppUpdateAlertVC.swift */; };
 		A8F8BCEB2E0501DC00EF4AA6 /* TSAppUpdateAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCEA2E0501DB00EF4AA6 /* TSAppUpdateAlertVC.swift */; };
-		A8F8BCED2E0513D000EF4AA6 /* animated_photos.webp in Resources */ = {isa = PBXBuildFile; fileRef = A8F8BCEC2E0513D000EF4AA6 /* animated_photos.webp */; };
 		A8F8BCF92E054A1A00EF4AA6 /* animated_example.gif in Resources */ = {isa = PBXBuildFile; fileRef = A8F8BCF82E054A1A00EF4AA6 /* animated_example.gif */; };
 		A8F8BCF92E054A1A00EF4AA6 /* animated_example.gif in Resources */ = {isa = PBXBuildFile; fileRef = A8F8BCF82E054A1A00EF4AA6 /* animated_example.gif */; };
 		A8FD8F332DFBCB85008CAACF /* ZillaSlab-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A8FD8F322DFBCB85008CAACF /* ZillaSlab-Regular.ttf */; };
 		A8FD8F332DFBCB85008CAACF /* ZillaSlab-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A8FD8F322DFBCB85008CAACF /* ZillaSlab-Regular.ttf */; };
 		A8FD8F342DFBCB85008CAACF /* ZillaSlab-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A8FD8F312DFBCB85008CAACF /* ZillaSlab-Medium.ttf */; };
 		A8FD8F342DFBCB85008CAACF /* ZillaSlab-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A8FD8F312DFBCB85008CAACF /* ZillaSlab-Medium.ttf */; };
@@ -220,6 +233,20 @@
 		A839463B2D1D6E3500ABFF0D /* TSRandomWallpaperCopyrightVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSRandomWallpaperCopyrightVC.swift; sourceTree = "<group>"; };
 		A839463B2D1D6E3500ABFF0D /* TSRandomWallpaperCopyrightVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSRandomWallpaperCopyrightVC.swift; sourceTree = "<group>"; };
 		A839463E2D1D6FB600ABFF0D /* TSLiveWallpaperTutorialsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLiveWallpaperTutorialsVC.swift; sourceTree = "<group>"; };
 		A839463E2D1D6FB600ABFF0D /* TSLiveWallpaperTutorialsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLiveWallpaperTutorialsVC.swift; sourceTree = "<group>"; };
 		A83946422D1D701300ABFF0D /* TSLiveWallpaperCopyrightVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLiveWallpaperCopyrightVC.swift; sourceTree = "<group>"; };
 		A83946422D1D701300ABFF0D /* TSLiveWallpaperCopyrightVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLiveWallpaperCopyrightVC.swift; sourceTree = "<group>"; };
+		A83F28882E16233B009A4975 /* TSAIListDataVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIListDataVM.swift; sourceTree = "<group>"; };
+		A83F288A2E162364009A4975 /* TSAIListDataVM+Dic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TSAIListDataVM+Dic.swift"; sourceTree = "<group>"; };
+		A83F288C2E162B18009A4975 /* TSAILIstFullCardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAILIstFullCardCell.swift; sourceTree = "<group>"; };
+		A83F288E2E162B7B009A4975 /* TSAILIstStyleMoreCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAILIstStyleMoreCell.swift; sourceTree = "<group>"; };
+		A83F28902E162DB3009A4975 /* TSAIListDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIListDataModel.swift; sourceTree = "<group>"; };
+		A83F28922E162E42009A4975 /* TSAIListDataVM+Click.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TSAIListDataVM+Click.swift"; sourceTree = "<group>"; };
+		A83F28972E165043009A4975 /* aiList_BlowKiss.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = aiList_BlowKiss.gif; sourceTree = "<group>"; };
+		A83F28982E165043009A4975 /* aiList_ForeheadKiss.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = aiList_ForeheadKiss.gif; sourceTree = "<group>"; };
+		A83F28992E165043009A4975 /* aiList_HeartGesture.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = aiList_HeartGesture.gif; sourceTree = "<group>"; };
+		A83F289A2E165043009A4975 /* aiList_Hug.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = aiList_Hug.gif; sourceTree = "<group>"; };
+		A83F289B2E165043009A4975 /* aiList_Kiss.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = aiList_Kiss.gif; sourceTree = "<group>"; };
+		A83F289C2E165043009A4975 /* aiList_SayHi.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = aiList_SayHi.gif; sourceTree = "<group>"; };
+		A83F289D2E165043009A4975 /* aiList_Smile.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = aiList_Smile.gif; sourceTree = "<group>"; };
+		A83F289E2E165043009A4975 /* aiList_Stroll.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = aiList_Stroll.gif; sourceTree = "<group>"; };
 		A8477C962D22737800DF0B93 /* TSBusinessWebVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBusinessWebVC.swift; sourceTree = "<group>"; };
 		A8477C962D22737800DF0B93 /* TSBusinessWebVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBusinessWebVC.swift; sourceTree = "<group>"; };
 		A8477C9E2D22ABD500DF0B93 /* TSEditLiveEidtCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSEditLiveEidtCell.swift; sourceTree = "<group>"; };
 		A8477C9E2D22ABD500DF0B93 /* TSEditLiveEidtCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSEditLiveEidtCell.swift; sourceTree = "<group>"; };
 		A84C23952D1E3A4300B61B55 /* GPVideoConfigMaker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GPVideoConfigMaker.swift; sourceTree = "<group>"; };
 		A84C23952D1E3A4300B61B55 /* GPVideoConfigMaker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GPVideoConfigMaker.swift; sourceTree = "<group>"; };
@@ -323,7 +350,6 @@
 		A8F8BCE22E0423AD00EF4AA6 /* TSAIPhotoDetailsVC+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TSAIPhotoDetailsVC+View.swift"; sourceTree = "<group>"; };
 		A8F8BCE22E0423AD00EF4AA6 /* TSAIPhotoDetailsVC+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TSAIPhotoDetailsVC+View.swift"; sourceTree = "<group>"; };
 		A8F8BCE52E04F62200EF4AA6 /* TSAIListPhotoGeneratorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIListPhotoGeneratorModel.swift; sourceTree = "<group>"; };
 		A8F8BCE52E04F62200EF4AA6 /* TSAIListPhotoGeneratorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIListPhotoGeneratorModel.swift; sourceTree = "<group>"; };
 		A8F8BCEA2E0501DB00EF4AA6 /* TSAppUpdateAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAppUpdateAlertVC.swift; sourceTree = "<group>"; };
 		A8F8BCEA2E0501DB00EF4AA6 /* TSAppUpdateAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAppUpdateAlertVC.swift; sourceTree = "<group>"; };
-		A8F8BCEC2E0513D000EF4AA6 /* animated_photos.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = animated_photos.webp; sourceTree = "<group>"; };
 		A8F8BCEF2E0535C200EF4AA6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		A8F8BCEF2E0535C200EF4AA6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		A8F8BCF02E0535C200EF4AA6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		A8F8BCF02E0535C200EF4AA6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		A8F8BCF12E0535C200EF4AA6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
 		A8F8BCF12E0535C200EF4AA6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -569,7 +595,7 @@
 		A81CA4B12D1695F300A3AAC8 /* Resource */ = {
 		A81CA4B12D1695F300A3AAC8 /* Resource */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
-				A8F8BCEC2E0513D000EF4AA6 /* animated_photos.webp */,
+				A83F28962E16503C009A4975 /* Gif */,
 				A8F8BCF82E054A1A00EF4AA6 /* animated_example.gif */,
 				A8F8BCF82E054A1A00EF4AA6 /* animated_example.gif */,
 				A86857D62DF983620089D222 /* generat_loading.gif */,
 				A86857D62DF983620089D222 /* generat_loading.gif */,
 				606372D62D545E55005C82CF /* Example */,
 				606372D62D545E55005C82CF /* Example */,
@@ -691,6 +717,32 @@
 			path = TSEditVideoVC;
 			path = TSEditVideoVC;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		A83F28872E16231E009A4975 /* VM */ = {
+			isa = PBXGroup;
+			children = (
+				A83F28882E16233B009A4975 /* TSAIListDataVM.swift */,
+				A83F28922E162E42009A4975 /* TSAIListDataVM+Click.swift */,
+				A83F28902E162DB3009A4975 /* TSAIListDataModel.swift */,
+				A83F288A2E162364009A4975 /* TSAIListDataVM+Dic.swift */,
+			);
+			path = VM;
+			sourceTree = "<group>";
+		};
+		A83F28962E16503C009A4975 /* Gif */ = {
+			isa = PBXGroup;
+			children = (
+				A83F28972E165043009A4975 /* aiList_BlowKiss.gif */,
+				A83F28982E165043009A4975 /* aiList_ForeheadKiss.gif */,
+				A83F28992E165043009A4975 /* aiList_HeartGesture.gif */,
+				A83F289A2E165043009A4975 /* aiList_Hug.gif */,
+				A83F289B2E165043009A4975 /* aiList_Kiss.gif */,
+				A83F289C2E165043009A4975 /* aiList_SayHi.gif */,
+				A83F289D2E165043009A4975 /* aiList_Smile.gif */,
+				A83F289E2E165043009A4975 /* aiList_Stroll.gif */,
+			);
+			path = Gif;
+			sourceTree = "<group>";
+		};
 		A8477C952D2272FB00DF0B93 /* TSBusinessWebVC */ = {
 		A8477C952D2272FB00DF0B93 /* TSBusinessWebVC */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -799,6 +851,7 @@
 		A868579F2DF91EA10089D222 /* TSAIListVC */ = {
 		A868579F2DF91EA10089D222 /* TSAIListVC */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				A83F28872E16231E009A4975 /* VM */,
 				A8EE92D92E00120F0077DFFD /* View */,
 				A8EE92D92E00120F0077DFFD /* View */,
 				A8EE92D32DFFFFAA0077DFFD /* TSAIListVM.swift */,
 				A8EE92D32DFFFFAA0077DFFD /* TSAIListVM.swift */,
 				A86857A02DF91EB80089D222 /* TSAIListVC.swift */,
 				A86857A02DF91EB80089D222 /* TSAIListVC.swift */,
@@ -995,6 +1048,8 @@
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
 				A86857A22DF91F680089D222 /* TSAILIstCell.swift */,
 				A86857A22DF91F680089D222 /* TSAILIstCell.swift */,
+				A83F288C2E162B18009A4975 /* TSAILIstFullCardCell.swift */,
+				A83F288E2E162B7B009A4975 /* TSAILIstStyleMoreCell.swift */,
 			);
 			);
 			path = View;
 			path = View;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -1173,7 +1228,6 @@
 			isa = PBXResourcesBuildPhase;
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
-				A8F8BCED2E0513D000EF4AA6 /* animated_photos.webp in Resources */,
 				603901222DF9770A0096551E /* Flash-old-Time.png in Resources */,
 				603901222DF9770A0096551E /* Flash-old-Time.png in Resources */,
 				A87CF85A2E02AF070063CB7E /* InfoPlist.strings in Resources */,
 				A87CF85A2E02AF070063CB7E /* InfoPlist.strings in Resources */,
 				A8C4C0A42D24218A003C46FC /* metadata.mov in Resources */,
 				A8C4C0A42D24218A003C46FC /* metadata.mov in Resources */,
@@ -1185,6 +1239,14 @@
 				A8FD8F332DFBCB85008CAACF /* ZillaSlab-Regular.ttf in Resources */,
 				A8FD8F332DFBCB85008CAACF /* ZillaSlab-Regular.ttf in Resources */,
 				A8FD8F342DFBCB85008CAACF /* ZillaSlab-Medium.ttf in Resources */,
 				A8FD8F342DFBCB85008CAACF /* ZillaSlab-Medium.ttf in Resources */,
 				A8FD8F352DFBCB85008CAACF /* ZillaSlab-BoldItalic.ttf in Resources */,
 				A8FD8F352DFBCB85008CAACF /* ZillaSlab-BoldItalic.ttf in Resources */,
+				A83F289F2E165043009A4975 /* aiList_Hug.gif in Resources */,
+				A83F28A02E165043009A4975 /* aiList_Smile.gif in Resources */,
+				A83F28A12E165043009A4975 /* aiList_HeartGesture.gif in Resources */,
+				A83F28A22E165043009A4975 /* aiList_SayHi.gif in Resources */,
+				A83F28A32E165043009A4975 /* aiList_BlowKiss.gif in Resources */,
+				A83F28A42E165043009A4975 /* aiList_Kiss.gif in Resources */,
+				A83F28A52E165043009A4975 /* aiList_Stroll.gif in Resources */,
+				A83F28A62E165043009A4975 /* aiList_ForeheadKiss.gif in Resources */,
 				A8E56BF92D1520EC003C54AF /* Assets.xcassets in Resources */,
 				A8E56BF92D1520EC003C54AF /* Assets.xcassets in Resources */,
 				A81F5B522D19685900740085 /* response.json in Resources */,
 				A81F5B522D19685900740085 /* response.json in Resources */,
 				A8E56BFB2D1520EC003C54AF /* LaunchScreen.storyboard in Resources */,
 				A8E56BFB2D1520EC003C54AF /* LaunchScreen.storyboard in Resources */,
@@ -1254,11 +1316,14 @@
 				A8EE92CF2DFFF2860077DFFD /* TSGenerateBasePhotoOperation.swift in Sources */,
 				A8EE92CF2DFFF2860077DFFD /* TSGenerateBasePhotoOperation.swift in Sources */,
 				A8EE92D02DFFF2860077DFFD /* TSBaseOperationQueue.swift in Sources */,
 				A8EE92D02DFFF2860077DFFD /* TSBaseOperationQueue.swift in Sources */,
 				A8FD8F412DFC138A008CAACF /* TYCycleImageComparisonView.swift in Sources */,
 				A8FD8F412DFC138A008CAACF /* TYCycleImageComparisonView.swift in Sources */,
+				A83F28892E162343009A4975 /* TSAIListDataVM.swift in Sources */,
 				A8C4C0E62D268D02003C46FC /* LivePhotoCreater.swift in Sources */,
 				A8C4C0E62D268D02003C46FC /* LivePhotoCreater.swift in Sources */,
+				A83F288D2E162B19009A4975 /* TSAILIstFullCardCell.swift in Sources */,
 				A8C4C0E72D268D02003C46FC /* VideoRecorder.swift in Sources */,
 				A8C4C0E72D268D02003C46FC /* VideoRecorder.swift in Sources */,
 				A8F76C4D2D3747B400AA6E93 /* TSPurchaseVC.swift in Sources */,
 				A8F76C4D2D3747B400AA6E93 /* TSPurchaseVC.swift in Sources */,
 				A895B5002E01370E004F9B85 /* TSTextToastView.swift in Sources */,
 				A895B5002E01370E004F9B85 /* TSTextToastView.swift in Sources */,
 				A81F5B5B2D1A5F2300740085 /* TSHomeTopBannerCell.swift in Sources */,
 				A81F5B5B2D1A5F2300740085 /* TSHomeTopBannerCell.swift in Sources */,
+				A83F288F2E162B7C009A4975 /* TSAILIstStyleMoreCell.swift in Sources */,
 				A83946312D1D66A000ABFF0D /* TSTermsServiceVC.swift in Sources */,
 				A83946312D1D66A000ABFF0D /* TSTermsServiceVC.swift in Sources */,
 				A8F8BCD52E03FE5000EF4AA6 /* TSAIUploadPhotoVC+View.swift in Sources */,
 				A8F8BCD52E03FE5000EF4AA6 /* TSAIUploadPhotoVC+View.swift in Sources */,
 				A8C4C0982D242154003C46FC /* LivePhoto.swift in Sources */,
 				A8C4C0982D242154003C46FC /* LivePhoto.swift in Sources */,
@@ -1300,6 +1365,7 @@
 				A8F8BCEB2E0501DC00EF4AA6 /* TSAppUpdateAlertVC.swift in Sources */,
 				A8F8BCEB2E0501DC00EF4AA6 /* TSAppUpdateAlertVC.swift in Sources */,
 				A81F5B402D194EA900740085 /* UIDevice+Extension.swift in Sources */,
 				A81F5B402D194EA900740085 /* UIDevice+Extension.swift in Sources */,
 				A8F778AE2D1AC12400BF55D5 /* TSRandomWallpaperBrowseView.swift in Sources */,
 				A8F778AE2D1AC12400BF55D5 /* TSRandomWallpaperBrowseView.swift in Sources */,
+				A83F28932E162E45009A4975 /* TSAIListDataVM+Click.swift in Sources */,
 				A81F5B4B2D19658300740085 /* PhotoTools.swift in Sources */,
 				A81F5B4B2D19658300740085 /* PhotoTools.swift in Sources */,
 				A83946272D1D623800ABFF0D /* TSShareUsVC.swift in Sources */,
 				A83946272D1D623800ABFF0D /* TSShareUsVC.swift in Sources */,
 				A81CA48B2D15843700A3AAC8 /* TSCommonTool.swift in Sources */,
 				A81CA48B2D15843700A3AAC8 /* TSCommonTool.swift in Sources */,
@@ -1314,6 +1380,7 @@
 				A86857882DF81B660089D222 /* TSNetworkManager.swift in Sources */,
 				A86857882DF81B660089D222 /* TSNetworkManager.swift in Sources */,
 				A86857892DF81B660089D222 /* TSNetworkManager+Loading.swift in Sources */,
 				A86857892DF81B660089D222 /* TSNetworkManager+Loading.swift in Sources */,
 				A8F8BCD12E03FD4200EF4AA6 /* TSAIUploadPhotoVC+Image.swift in Sources */,
 				A8F8BCD12E03FD4200EF4AA6 /* TSAIUploadPhotoVC+Image.swift in Sources */,
+				A83F28912E162DB7009A4975 /* TSAIListDataModel.swift in Sources */,
 				A86857A32DF91F690089D222 /* TSAILIstCell.swift in Sources */,
 				A86857A32DF91F690089D222 /* TSAILIstCell.swift in Sources */,
 				A868577C2DF819BB0089D222 /* TSDBManager.swift in Sources */,
 				A868577C2DF819BB0089D222 /* TSDBManager.swift in Sources */,
 				A8F8BCE02E04210000EF4AA6 /* TSAIPhotoDetailsVC+Video.swift in Sources */,
 				A8F8BCE02E04210000EF4AA6 /* TSAIPhotoDetailsVC+Video.swift in Sources */,
@@ -1341,6 +1408,7 @@
 				A86857D12DF977980089D222 /* TSAIListPhotoGeneratorVM.swift in Sources */,
 				A86857D12DF977980089D222 /* TSAIListPhotoGeneratorVM.swift in Sources */,
 				A8E590392DFFAE4400C2533F /* TSBootVC.swift in Sources */,
 				A8E590392DFFAE4400C2533F /* TSBootVC.swift in Sources */,
 				A8EE92DB2E00121A0077DFFD /* TSGennerateCellView.swift in Sources */,
 				A8EE92DB2E00121A0077DFFD /* TSGennerateCellView.swift in Sources */,
+				A83F288B2E162369009A4975 /* TSAIListDataVM+Dic.swift in Sources */,
 				A86857982DF846FE0089D222 /* TSDynamicBlurView.swift in Sources */,
 				A86857982DF846FE0089D222 /* TSDynamicBlurView.swift in Sources */,
 				A83946332D1D66A900ABFF0D /* TSPrivacyPolicyVC.swift in Sources */,
 				A83946332D1D66A900ABFF0D /* TSPrivacyPolicyVC.swift in Sources */,
 				A86857C22DF926ED0089D222 /* TSPhotoSizeHelper.swift in Sources */,
 				A86857C22DF926ED0089D222 /* TSPhotoSizeHelper.swift in Sources */,

+ 22 - 0
TSLiveWallpaper/Assets.xcassets/AIList/ailist_smallShaow.imageset/Contents.json

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

BIN
TSLiveWallpaper/Assets.xcassets/AIList/ailist_smallShaow.imageset/ailist_smallShaow@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/AIList/ailist_smallShaow.imageset/ailist_smallShaow@3x.png


+ 31 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIList+Enmu.swift

@@ -13,6 +13,8 @@ enum TSGeneratorImageStyle:String {
     case enlighten = "enlighten"   //调整光线
     case enlighten = "enlighten"   //调整光线
     case recreate = "recreate"   //修复和上色老照片
     case recreate = "recreate"   //修复和上色老照片
     case creatVideo = "creatVideo"   //修复和上色老照片
     case creatVideo = "creatVideo"   //修复和上色老照片
+
+    case ptp = "ptp"
     
     
     var imageMaxKb:Int{
     var imageMaxKb:Int{
         switch self {
         switch self {
@@ -50,6 +52,8 @@ enum TSGeneratorImageStyle:String {
             return .recreateConfig
             return .recreateConfig
         case .creatVideo:
         case .creatVideo:
             return .animatedConfig
             return .animatedConfig
+        default:
+            return .animatedConfig
         }
         }
     }
     }
     
     
@@ -76,6 +80,33 @@ enum TSGeneratorImageStyle:String {
             return "Recreate Photo".localized
             return "Recreate Photo".localized
         case .creatVideo:
         case .creatVideo:
             return "Animated Photo".localized
             return "Animated Photo".localized
+        default:
+            return "Photo".localized
         }
         }
     }
     }
 }
 }
+
+extension TSGeneratorImageStyle {
+    
+    var generateModel:TSGenerateModel? {
+        let vm = TSAIListDataVM.shared
+        switch self {
+        case .enhance:
+            return TSGenerateModel(json: vm.ptp_PhotoEnhance)
+        case .colorize:
+            return TSGenerateModel(json: vm.ptp_Colorize)
+        case .descratch:
+            return TSGenerateModel(json: vm.ptp_Descratch)
+        case .enlighten:
+            return TSGenerateModel(json: vm.ptp_Enlighten)
+        case .recreate:
+            return TSGenerateModel(json: vm.ptp_Recreate)
+        case .creatVideo:
+            return TSGenerateModel(json: vm.video_Creat)
+        default:
+            return nil
+        }
+    }
+    
+    
+}

+ 1 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/TSAIListHistoryVC.swift

@@ -137,7 +137,7 @@ class TSAIListHistoryVC: TSBaseVC {
     }
     }
     
     
     override func viewWillAppear(_ animated: Bool) {
     override func viewWillAppear(_ animated: Bool) {
-        print("viewWillAppear")
+        super.viewWillAppear(animated)
     }
     }
     
     
     @objc func clickNavRight() {
     @objc func clickNavRight() {

+ 169 - 33
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/TSAIListVC.swift

@@ -8,15 +8,11 @@
 
 
 class TSAIListVC: TSBaseVC {
 class TSAIListVC: TSBaseVC {
     
     
-    lazy var viewModel: TSAIListVM = {
-        let viewModel = TSAIListVM(target: self)
+    lazy var viewModel: TSAIListDataVM = {
+        let viewModel = TSAIListDataVM()
         return viewModel
         return viewModel
     }()
     }()
     
     
-    lazy var dataArray: [TSBasicSectionModel] = {
-        return viewModel.dataArray
-    }()
-
     //###################################### 导航栏 view ######################################
     //###################################### 导航栏 view ######################################
     lazy var vipBtn: UIButton = {
     lazy var vipBtn: UIButton = {
         let vipBtn = UIButton.createButton(image: UIImage(named: "nav_vip")) { [weak self] in
         let vipBtn = UIButton.createButton(image: UIImage(named: "nav_vip")) { [weak self] in
@@ -53,20 +49,22 @@ class TSAIListVC: TSBaseVC {
     lazy var layout: UICollectionViewFlowLayout = {
     lazy var layout: UICollectionViewFlowLayout = {
         let layout = UICollectionViewFlowLayout()
         let layout = UICollectionViewFlowLayout()
         layout.scrollDirection = .vertical
         layout.scrollDirection = .vertical
-        let w = k_ScreenWidth-32
-        let h = kGetScaleHeight(originalSize: CGSizeMake(343, 230), width: w)
-        layout.itemSize = CGSize(width: w, height: h)
+//        let w = k_ScreenWidth-32
+//        let h = kGetScaleHeight(originalSize: CGSizeMake(343, 230), width: w)
+//        layout.itemSize = CGSize(width: w, height: h)
         layout.minimumInteritemSpacing = 8
         layout.minimumInteritemSpacing = 8
         layout.minimumLineSpacing = 8
         layout.minimumLineSpacing = 8
         
         
-        layout.sectionInset = UIEdgeInsets(top: 10, left: 16, bottom: k_Height_TabBar+20, right: 16)
+//        layout.sectionInset = UIEdgeInsets(top: 10, left: 16, bottom: k_Height_TabBar+20, right: 16)
         return layout
         return layout
     }()
     }()
     lazy var collectionView:TSBaseCollectionView = {
     lazy var collectionView:TSBaseCollectionView = {
         let collectionView = TSBaseCollectionView(frame: .zero, collectionViewLayout: layout)
         let collectionView = TSBaseCollectionView(frame: .zero, collectionViewLayout: layout)
         collectionView.delegate = self
         collectionView.delegate = self
         collectionView.dataSource = self
         collectionView.dataSource = self
-        collectionView.register(TSAILIstCell.self, forCellWithReuseIdentifier: TSAILIstCell.cellID)
+        collectionView.register(TSAILIstBaseCell.self, forCellWithReuseIdentifier: "TSAILIstBaseCell")
+        collectionView.register(TSAILIstFullCardCell.self, forCellWithReuseIdentifier: "TSAILIstFullCardCell")
+        collectionView.register(TSAILIstStyleMoreCell.self, forCellWithReuseIdentifier: "TSAILIstStyleMoreCell")
         return collectionView
         return collectionView
     }()
     }()
 
 
@@ -101,43 +99,181 @@ class TSAIListVC: TSBaseVC {
         }
         }
     }
     }
 }
 }
-
-extension TSAIListVC: UICollectionViewDataSource ,UICollectionViewDelegate {
+extension TSAIListVC: UICollectionViewDataSource ,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout{
     
     
-    public func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return dataArray.count
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return viewModel.listDatas.count
     }
     }
     
     
-    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        if let sectionModel = dataArray.safeObj(At: section){
-            return sectionModel.itemsArray.count
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        if let secModel = viewModel.listDatas.safeObj(At:section){
+            return secModel.items.count
         }
         }
         return 0
         return 0
     }
     }
     
     
-    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         
         
-        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: TSAILIstCell.cellID, for: indexPath)
-        if let cell = cell as? TSAILIstCell {
-            if let sectionModel = dataArray.safeObj(At: indexPath.section),let itemModel = sectionModel.itemsArray.safeObj(At: indexPath.row){
-                cell.itemModel = itemModel
+        if let secModel = viewModel.listDatas.safeObj(At:indexPath.section),let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing:secModel.style.cell), for: indexPath) as? TSAILIstBaseCell, let item = secModel.items.safeObj(At:indexPath.row){
+            cell.items = item
+            cell.clickBlock = { [weak self] model  in
+                guard let self = self else { return }
+                if let secModel = viewModel.listDatas.safeObj(At:indexPath.section) {
+                    Self.clickCell(target: self,indexPath: indexPath, itemModel:model,secModel: secModel)
+                }
             }
             }
+            return cell
+        }
+        return UICollectionViewCell()
+    }
+
+//    func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
+//        if let secModel = viewModel.listDatas.safeObj(At:indexPath.section),
+//           kind == UICollectionView.elementKindSectionHeader,
+//           let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "TSDiscoverHeaderView", for: indexPath) as? TSDiscoverHeaderView{
+//            header.sectionModel = secModel
+//            header.clickBlock = { [weak self] model in
+//                guard let self = self else { return }
+//                clickHeader(indexPath: indexPath,model: model)
+//            }
+//            return header
+//        }
+//        return UICollectionReusableView()
+//    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize{
+        if let secModel = viewModel.listDatas.safeObj(At:indexPath.section) {
+            return secModel.style.itemSize
         }
         }
+        return .zero
+    }
+
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets{
+        if let secModel = viewModel.listDatas.safeObj(At:section) {
+            var sectionEdge = UIEdgeInsets(top: 0, left: kDiscoverSection.left, bottom: 0, right: kDiscoverSection.right)
+            if secModel.title.isEmpty {
+                sectionEdge = UIEdgeInsets(top: 20, left: kDiscoverSection.left, bottom: 0, right: kDiscoverSection.right)
+            }
+            if section == viewModel.listDatas.count-1 {
+                sectionEdge = UIEdgeInsets(top: sectionEdge.top, left: sectionEdge.left, bottom: sectionEdge.bottom+20+k_TabBar_Height, right: sectionEdge.right)
+            }
+            return sectionEdge
+        }
+        return .zero
+    }
+
+//    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
+//        if let secModel = viewModel.listDatas.safeObj(At:section),secModel.title.count > 0 {
+//            return CGSize(width: k_ScreenWidth, height: kDiscoverSectionH)
+//        }
+//        return .zero
+//    }
+}
+
+//extension TSAIListVC: UICollectionViewDataSource ,UICollectionViewDelegate {
+//    
+//    public func numberOfSections(in collectionView: UICollectionView) -> Int {
+//        return viewModel.listDatas.count
+//    }
+//    
+//    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+//        if let sectionModel = dataArray.safeObj(At: section){
+//            return sectionModel.itemsArray.count
+//        }
+//        return 0
+//    }
+//    
+//    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+//        
+//        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "TSAILIstCell", for: indexPath)
+//        if let cell = cell as? TSAILIstCell {
+//            if let sectionModel = dataArray.safeObj(At: indexPath.section),let itemModel = sectionModel.itemsArray.safeObj(At: indexPath.row){
+//                cell.item = itemModel
+//            }
+//        }
+//        
+//        return cell
+//    }
+//
+//    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+//        if let sectionModel = dataArray.safeObj(At: indexPath.section),let itemModel = sectionModel.itemsArray.safeObj(At: indexPath.row){
+//            
+//            if TSGenerateBasePhotoOperationQueue.shared.isAvailability == false {
+//                kTextToastShared.show(atView: self.view,text: "1 task is processing"){
+//                    TSAIListHistoryVC.showPosition()
+//                }
+//                return
+//            }
+//
+//            itemModel.tapBlock?(itemModel,indexPath.row,nil)
+//        }
+//    }
+//}
+extension TSAIListVC {
+    
+//    func clickHeader(indexPath:IndexPath,model:TSDiscoverSectionModel) {
+//        kPushVC(target: self, modelVC: TSDiscoverStyleMoreVC(sectionModel: model))
+//    }
+//    
+    static func clickCell(target:UIViewController,indexPath:IndexPath,itemModel:TSDiscoverItemModel,secModel:TSDiscoverSectionModel) {
         
         
-        return cell
+        if TSGenerateBasePhotoOperationQueue.shared.isAvailability == false {
+            kTextToastShared.show(atView: target.view,text: "1 task is processing"){
+                TSAIListHistoryVC.showPosition()
+            }
+            return
+        }
+        
+        Self.enterSelectPhotos(target: target,style: itemModel.style) { image in
+            kPushVC(target: target, modelVC: TSAIUploadPhotoVC(titleString: itemModel.viewModel.title,upLoadImage: image, generatorStyle: itemModel.style,disCoverItemModel: itemModel))
+        }
     }
     }
+}
 
 
-    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        if let sectionModel = dataArray.safeObj(At: indexPath.section),let itemModel = sectionModel.itemsArray.safeObj(At: indexPath.row){
-            
-            if TSGenerateBasePhotoOperationQueue.shared.isAvailability == false {
-                kTextToastShared.show(atView: self.view,text: "1 task is processing"){
-                    TSAIListHistoryVC.showPosition()
-                }
-                return
+extension TSAIListVC{
+    static func enterSelectPhotos(target:UIViewController,style:TSGeneratorImageStyle,complete: @escaping (UIImage)->Void){
+        if style.userDefaultsKey.count == 0 {
+            self.pickSinglePhoto(target:target,complete:complete)
+        }else{
+            TSAIListHintBaseVC.userDefaultsKey = style.userDefaultsKey
+            if TSAIListHintBaseVC.isShowUploadImageHint{
+                TSAIListHintBaseVC.isShowUploadImageHint = false
+                self.presentModalHintVC(target:target,config:style.config,complete:complete)
+            }else {
+                self.pickSinglePhoto(target:target,complete:complete)
             }
             }
+        }
+    }
 
 
-            itemModel.tapBlock?(itemModel,indexPath.row,nil)
+    static func presentModalHintVC(target:UIViewController,config:TSAIListHintBaseVC.Config,complete:@escaping (UIImage)->Void){
+        let hintBaseVC = TSAIListHintBaseVC(config: config)
+        hintBaseVC.clickUpImageHandle = { image in
+            if let image = image {
+                complete(image)
+            }else{
+                dePrint("图片异常")
+            }
+            kDelayMainShort {
+                hintBaseVC.dismissPageVC()
+            }
+        }
+        kPresentModalVC(target: target, modelVC: hintBaseVC,transitionStyle: .crossDissolve)
+    }
+    
+    static func pickSinglePhoto(target:UIViewController,complete: @escaping (UIImage)->Void)  {
+        let photoPickerManager = TSPhotoPickerManager(viewController: target)
+        photoPickerManager.pickCustomSinglePhoto() { image, errorString in
+            if let errorString = errorString {
+                TSToastShared.showToast(text: errorString)
+            }else if let image = image {
+                complete(image)
+            }else{
+                dePrint("图片异常")
+            }
+            kDelayMainShort {
+                photoPickerManager.dismissPageVC()
+            }
+            
         }
         }
     }
     }
 }
 }

+ 114 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataModel.swift

@@ -0,0 +1,114 @@
+//
+//  Untitled.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/2.
+//
+
+
+//MARK: 枚举
+enum TSDiscoverItemAnimationStyle:CaseIterable {
+    case none
+    case comparison
+    case gif
+}
+
+let kDiscoverSection:UIEdgeInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
+
+//顶部按钮功能
+let fullCardW = k_ScreenWidth - kDiscoverSection.left - kDiscoverSection.right
+let fullCardSize:CGSize = CGSize(width: fullCardW, height: kGetScaleHeight(originalSize: CGSize(width: 343, height: 230), width: fullCardW))
+
+enum TSDiscoverViewStyle:CaseIterable {
+    case funcItems  //功能按钮块
+    case styleMore  //更多风格
+    case fullCard   //大卡片
+ 
+    var itemSize:CGSize {
+        switch self {
+        case .funcItems:
+            return CGSize(width: k_ScreenWidth, height: 112.0)
+        case .styleMore:
+            return CGSize(width: k_ScreenWidth, height: 200.0)
+        case .fullCard:
+            return fullCardSize
+        }
+    }
+    
+    var cell:TSAILIstBaseCell.Type {
+        switch self {
+        case .funcItems:
+            return TSAILIstFullCardCell.self
+        case .styleMore:
+            return TSAILIstStyleMoreCell.self
+        case .fullCard:
+            return TSAILIstFullCardCell.self
+        }
+    }
+}
+//MARK: UI model
+class TSDiscoverBaseItemVM {
+    var title:String = ""
+    var imageNamed:String = ""
+    var info:String = ""
+
+    init(title: String, imageNamed: String, info: String = "") {
+        self.title = title
+        self.imageNamed = imageNamed
+        self.info = info
+    }
+}
+
+class TSDiscoverAnimationItemVM:TSDiscoverBaseItemVM{
+    var style:TSDiscoverItemAnimationStyle = .none
+    var imageNameds:[String] = []
+    
+    init(title: String, info: String = "",style: TSDiscoverItemAnimationStyle = .comparison, imageNameds: [String]) {
+        self.style = style
+        self.imageNameds = imageNameds
+        super.init(title: title, imageNamed: "")
+    }
+}
+//MARK: 分区
+
+let kDiscoverSectionH = 56.0
+
+class TSDiscoverSectionModel {
+    var title:String = ""
+    var style:TSDiscoverViewStyle = .styleMore
+    var items:[Any] = []
+    func setTitle(title:String) {
+        self.title = title
+    }
+}
+
+
+class TSDiscoverItemModel {
+    var style:TSGeneratorImageStyle = .ptp
+    var viewModel:TSDiscoverBaseItemVM
+    var generateModel:TSGenerateModel?
+    
+    var name:String {
+        if viewModel.title.isEmpty {
+            if let generateModel = generateModel,!generateModel.imageText.isEmpty{
+                return generateModel.imageText.localized
+            }
+        }
+        return viewModel.title.localized
+    }
+    
+    var imageNamed:String {
+        if !viewModel.imageNamed.isEmpty {
+            return viewModel.imageNamed
+        }
+        return ""
+    }
+    
+    init(style: TSGeneratorImageStyle,
+         viewModel:TSDiscoverBaseItemVM,
+         generateModel: TSGenerateModel? = nil) {
+        self.style = style
+        self.viewModel = viewModel
+        self.generateModel = generateModel
+    }
+}

+ 57 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM+Click.swift

@@ -0,0 +1,57 @@
+//
+//  Untitled.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/2.
+//
+
+//extension TSAIListDataVM {
+//    func enterSelectPhotos(style:TSGeneratorImageStyle,complete: @escaping (UIImage)->Void){
+//        if style.userDefaultsKey.isEmpty{
+//            self.pickSinglePhoto(maxBitSize:style.imageMaxBitSize,complete:complete)
+//        }else{
+//            TSAIListHintBaseVC.userDefaultsKey = style.userDefaultsKey
+//            if TSAIListHintBaseVC.isShowUploadImageHint{
+//                TSAIListHintBaseVC.isShowUploadImageHint = false
+//                self.presentModalHintVC(config:style.config,complete:complete)
+//            }else {
+//                self.pickSinglePhoto(maxBitSize:style.imageMaxBitSize,complete:complete)
+//            }
+//        }
+//    }
+//    
+//    
+//    func presentModalHintVC(config:TSAIListHintBaseVC.Config,complete:@escaping (UIImage)->Void){
+//        hintBaseVC = TSAIListHintBaseVC(config: config) { [weak self] image in
+//            guard let self = self else { return }
+//            if let image = image {
+//                complete(image)
+//            }else{
+//                dePrint("图片异常")
+//            }
+//            kDelayMainShort {
+//                self.hintBaseVC.dismissPageVC()
+//            }
+//        }
+// 
+//        kPresentModalVC(target: self.target, modelVC: hintBaseVC,transitionStyle: .crossDissolve)
+//    }
+//    
+//    func pickSinglePhoto(maxBitSize:Int,complete: @escaping (UIImage)->Void)  {
+////        photoPickerManager.pickSinglePhoto(maxBitSize: maxBitSize) { [weak self] image, errorString in
+//        photoPickerManager.pickCustomSinglePhoto() { [weak self] image, errorString in
+//            guard let self = self else { return }
+//            if let errorString = errorString {
+//                TSToastShared.showToast(text: errorString)
+//            }else if let image = image {
+//                complete(image)
+//            }else{
+//                dePrint("图片异常")
+//            }
+//            kDelayMainShort {
+//                self.photoPickerManager.dismissPageVC()
+//            }
+//            
+//        }
+//    }
+//}

+ 164 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM+Dic.swift

@@ -0,0 +1,164 @@
+//
+//  TSAIListDataVM+Dic.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/2.
+//
+
+private let imageName = "imageName"
+private let imageText = "imageText"
+private let prompt = "prompt"
+private let isVip = "isVip"
+private let specialStyle = "specialStyle"
+private let unionType = "unionType"
+
+private let model = "model"             //走新的通道,根据内容确定
+let kie = "kie"                 //走kie--chatgpt
+let volcengine = "volcengine"   //走火山引擎
+let flux = "flux"               //走kie--flux
+
+private let input = "input"
+
+//MARK: 功能性模型
+extension TSAIListDataVM {
+
+    //Say Hi
+    var video_SayHi:[String:Any]{
+        [
+            imageText: "Say Hi",
+            prompt:"Create a realistic and natural scene where the people in the old photo are facing the camera and waving their hands as if saying hi. Their pose should look completely natural and relaxed, with warm and happy facial expressions, slightly smiling, and their body language should show a friendly greeting. Keep their original appearance, clothing, and style, but seamlessly adjust their pose so they look like they were originally waving at the camera. Make sure the lighting, colors, and atmosphere remain consistent with the original photo to maintain realism and harmony.",
+            isVip: true
+        ]
+    }
+    
+    var video_Smile:[String:Any]{
+        [
+            imageText: "Smile",
+            prompt:"Photo animation, Slight head turn, normal eye blinking, smile, realistic facial movement",
+            isVip: true
+        ]
+    }
+    
+
+    var video_Hug:[String:Any]{
+        [
+            imageText: "Hug",
+            prompt:"Create a realistic and emotionally warm scene where the people in the old photo are gently hugging each other. Their pose should look completely natural, with soft and relaxed body language, subtle happy facial expressions, and a warm atmosphere. The final image should preserve their original appearance, clothing, and style, but seamlessly add a gentle hug between them, making it look like they were originally embracing each other in the photo. The lighting and colors should remain consistent with the original photo to maintain realism and harmony.",
+            isVip: true
+        ]
+    }
+    
+    var video_HeartGesture:[String:Any]{
+        [
+            imageText: "Heart Gesture",
+            prompt:"Create a realistic and natural scene where the people in the old photo are facing the camera and making a heart gesture with their hands. Their pose should look completely natural and relaxed, with warm, cheerful facial expressions and friendly body language. Preserve their original appearance, clothing, and style, but seamlessly adjust their pose so they look like they were originally making a cute heart sign in the photo. Make sure the lighting, colors, and atmosphere stay consistent with the original photo to maintain realism and harmony.",
+            isVip: true
+        ]
+    }
+    
+    var video_ForeheadKiss:[String:Any]{
+        [
+            imageText: "Forehead Kiss",
+            prompt:"Create a realistic and emotionally warm scene where one person in the old photo is gently kissing another person on the forehead. Their pose should look completely natural and comfortable, with soft, loving facial expressions and relaxed body language that shows care and tenderness. Preserve their original appearance, clothing, and style, but seamlessly adjust their pose so it looks like they were originally sharing a gentle forehead kiss in the photo. Make sure the lighting, colors, and atmosphere remain consistent with the original photo to maintain realism and harmony.",
+            isVip: true
+        ]
+    }
+    
+    var video_Kiss:[String:Any]{
+        [
+            imageText: "Kiss",
+            prompt:"Create a realistic and emotionally warm scene where the people in the old photo are gently kissing each other. Their pose should look completely natural and comfortable, with relaxed body language and soft, loving facial expressions. Preserve their original appearance, clothing, and style, but seamlessly adjust their pose so they look like they were originally sharing a gentle kiss in the photo. Make sure the lighting, colors, and atmosphere remain consistent with the original photo to maintain realism and harmony.",
+            isVip: true
+        ]
+    }
+    
+    var video_BlowKiss:[String:Any]{
+        [
+            imageText: "Blow Kiss",
+            prompt:"Create a realistic and natural scene where the people in the old photo are facing the camera and blowing a kiss with their hand. Their pose should look completely natural and relaxed, with warm and playful facial expressions, slightly smiling, and their body language should clearly show the gesture of blowing a kiss. Preserve their original appearance, clothing, and style, but seamlessly adjust their pose so they look like they were originally blowing a kiss in the photo. Ensure the lighting, colors, and atmosphere remain consistent with the original photo to maintain realism and harmony.",
+            isVip: true
+        ]
+    }
+    
+    var video_Stroll:[String:Any]{
+        [
+            imageText: "Stroll",
+            prompt:"Create a realistic and natural scene where the people in the old photo are strolling together. Their pose should look completely natural and relaxed, with comfortable walking body language and warm, happy facial expressions. Preserve their original appearance, clothing, and style, but seamlessly adjust their pose so they look like they were originally walking side by side in the photo. Ensure the lighting, colors, and atmosphere remain consistent with the original photo to maintain realism and harmony.",
+            isVip: true
+        ]
+    }
+    
+    var video_Creat:[String:Any]{
+        [
+            imageText: "Creat",
+            prompt:"Photo animation, Slight head turn, normal eye blinking, smile, realistic facial movement",
+            input:true,
+            isVip: true
+        ]
+    }
+
+}
+
+//MARK: 图生图的模型
+extension TSAIListDataVM {
+
+    var ptp_PhotoEnhance:[String:Any]{
+        [
+            imageName: "",
+           imageText: "Photo Enhance",
+           prompt:"把图片变清晰",
+            specialStyle:1,
+            isVip: true,
+            unionType: 1,
+            model:kie
+        ]
+    }
+    
+    var ptp_Colorize:[String:Any]{
+        [
+            imageName: "",
+           imageText: "Colorize",
+           prompt:"Add suitable colors to photos",
+            specialStyle:0,
+            isVip: true,
+            unionType: 1,
+            model:kie
+        ]
+    }
+    
+    var ptp_Descratch:[String:Any]{
+        [
+            imageName: "",
+           imageText: "Descratch",
+           prompt:"Remove the photo's scratches and dirt",
+            specialStyle:0,
+            isVip: false,
+            unionType: 1,
+            model:kie
+        ]
+    }
+    
+    var ptp_Enlighten:[String:Any]{
+        [
+            imageName: "",
+           imageText: "Enlighten",
+           prompt:"Adjust the light and darkness of the photo to make the overall look coordinated",
+            specialStyle:0,
+            isVip: true,
+            unionType: 1,
+            model:kie
+        ]
+    }
+    
+    var ptp_Recreate:[String:Any]{
+        [
+            imageName: "",
+           imageText: "Recreate",
+           prompt:"Recreate damaged portraits and added suitable color for photo",
+            isVip: false,
+            unionType: 1,
+            model:kie
+        ]
+    }
+    
+}

+ 164 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM.swift

@@ -0,0 +1,164 @@
+//
+//  TSAIListDataVM.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/2.
+//
+
+
+import ObjectMapper
+
+
+//MARK: 组装数据
+class TSAIListDataVM {
+    
+    static let shared:TSAIListDataVM = TSAIListDataVM()
+    
+    lazy var videoSection: TSDiscoverSectionModel = {
+        let section = TSDiscoverSectionModel()
+        section.style = .styleMore
+        section.items = [[
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(title: "",style: .gif, imageNameds: ["aiList_SayHi"]),
+                                generateModel: TSGenerateModel(json: video_SayHi)),
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(title: "",style: .gif, imageNameds: ["aiList_Smile"]),
+                                generateModel: TSGenerateModel(json: video_Smile)),
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(title: "",style: .gif, imageNameds: ["aiList_Hug"]),
+                                generateModel: TSGenerateModel(json: video_Hug)),
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(title: "",style: .gif, imageNameds: ["aiList_HeartGesture"]),
+                                generateModel: TSGenerateModel(json: video_HeartGesture)),
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(title: "",style: .gif, imageNameds: ["aiList_ForeheadKiss"]),
+                                generateModel: TSGenerateModel(json: video_ForeheadKiss)),
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(title: "",style: .gif, imageNameds: ["aiList_Kiss"]),
+                                generateModel: TSGenerateModel(json: video_Kiss)),
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(title: "",style: .gif, imageNameds: ["aiList_BlowKiss"]),
+                                generateModel: TSGenerateModel(json: video_BlowKiss)),
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(title: "",style: .gif, imageNameds: ["aiList_Stroll"]),
+                                generateModel: TSGenerateModel(json: video_Stroll)),
+        ]]
+        return section
+    }()
+    
+    
+    
+    lazy var colorizeSection: TSDiscoverSectionModel = {
+        let section = TSDiscoverSectionModel()
+        section.style = .fullCard
+        section.items = [
+            TSDiscoverItemModel(style: .colorize,
+                                viewModel: TSDiscoverBaseItemVM(
+                                    title: "Colorize".localized,
+                                    imageNamed: "aiList_Colorize",
+                                    info: "Add colors to black-and-white photos".localized
+                                ),
+                                generateModel: TSGenerateModel(json: ptp_Colorize)),
+        ]
+        
+        return section
+    }()
+    
+    
+    lazy var Descratchection: TSDiscoverSectionModel = {
+        let section = TSDiscoverSectionModel()
+        section.style = .fullCard
+        section.items = [
+            TSDiscoverItemModel(style: .descratch,
+                                viewModel: TSDiscoverBaseItemVM(
+                                    title: "Descratch".localized,
+                                    imageNamed: "aiList_Descratch",
+                                    info: "Remove scratches and dirt".localized
+                                ),
+                                generateModel: TSGenerateModel(json: ptp_Descratch)),
+        ]
+        
+        return section
+    }()
+    
+    lazy var creatVideoSection: TSDiscoverSectionModel = {
+        let section = TSDiscoverSectionModel()
+        section.style = .fullCard
+        section.items = [
+            TSDiscoverItemModel(style: .creatVideo,
+                                viewModel: TSDiscoverAnimationItemVM(
+                                    title: "Animated Photo".localized,
+                                    info: "Turn photos into live moments".localized,
+                                    style: .gif,
+                                    imageNameds: ["aiList_Animated","animated_example.gif"]
+                                ),
+                                generateModel: TSGenerateModel(json: video_Creat)),
+        ]
+
+        return section
+    }()
+    
+    lazy var enhanceSection: TSDiscoverSectionModel = {
+        let section = TSDiscoverSectionModel()
+        section.style = .fullCard
+        section.items = [
+            TSDiscoverItemModel(style: .enhance,
+                                viewModel: TSDiscoverBaseItemVM(
+                                    title: "Enhance".localized,
+                                    imageNamed: "aiList_Enhance",
+                                    info: "Remove blur, sharpen, add details".localized
+                                ),
+                                generateModel: TSGenerateModel(json: ptp_PhotoEnhance)),
+        ]
+        
+        return section
+    }()
+    
+    lazy var RecreateSection: TSDiscoverSectionModel = {
+        let section = TSDiscoverSectionModel()
+        section.style = .fullCard
+        section.items = [
+            TSDiscoverItemModel(style: .recreate,
+                                viewModel: TSDiscoverBaseItemVM(
+                                    title: "Recreate".localized,
+                                    imageNamed: "aiList_Recreate",
+                                    info: "Bring new life to old photos".localized
+                                ),
+                                generateModel: TSGenerateModel(json: ptp_Recreate)),
+        ]
+        
+        return section
+    }()
+    
+    
+    lazy var enlightenSection: TSDiscoverSectionModel = {
+        let section = TSDiscoverSectionModel()
+        section.style = .fullCard
+        section.items = [
+            TSDiscoverItemModel(style: .enlighten,
+                                viewModel: TSDiscoverBaseItemVM(
+                                    title: "Adjust Light".localized,
+                                    imageNamed: "aiList_Enlighten",
+                                    info: "Easily fix lighting issues on photos".localized
+                                ),
+                                generateModel: TSGenerateModel(json: ptp_Enlighten)),
+        ]
+        
+        return section
+    }()
+    
+    lazy var listDatas: [TSDiscoverSectionModel] = {
+        return [
+            videoSection,
+            colorizeSection,
+            Descratchection,
+            creatVideoSection,
+            enhanceSection,
+            RecreateSection,
+            enlightenSection,
+        ]
+    }()
+    
+
+
+}

+ 6 - 115
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/View/TSAILIstCell.swift

@@ -5,123 +5,14 @@
 //  Created by 100Years on 2025/6/10.
 //  Created by 100Years on 2025/6/10.
 //
 //
 
 
-
-import Kingfisher
-class TSAILIstCell: TSBaseCollectionCell {
-    
-    static let cellID = "TSAILIstCell"
-    var itemModel:TSBasicItemModel = TSBasicItemModel(){
-        didSet{
-            if let imageNamed = itemModel.leftImageName{
-                bgImageView.image = UIImage(named: imageNamed)?.mirrored
-            }
-            titleLab.text = itemModel.leftTitle
-            infoLab.text = itemModel.leftSubTitle
-            
-            if let leftImagePath = itemModel.leftImagePath{
-                if let gifURL = Bundle.main.url(forResource: leftImagePath, withExtension: nil) {
-                    animatedImageView.kf.setImage(with: gifURL, options: [.cacheOriginalImage])
-                    kMainShort {
-                        self.animatedImageView.isHidden = false
-                        self.animatedImageView.startAnimating()
-                    }
-                }
-            }else{
-                animatedImageView.stopAnimating()
-                animatedImageView.isHidden = true
-            }
-         
-        }
-    }
-    
-    lazy var bgImageView: UIImageView = {
-        let bgImageView = UIImageView()
-        bgImageView.contentMode = .scaleToFill
-        return bgImageView
-    }()
-    
-    
-    lazy var titleLab: UILabel = {
-        let titleLab = UILabel.createLabel(font: .font(name: .ZillaSlab,size: 20,weight: .bold),textColor:.fromHex("FFFFFF"),numberOfLines: 0)
-        return titleLab
-    }()
-    
-    lazy var infoLab: UILabel = {
-        let infoLab = UILabel.createLabel(font: .font(size: 14,weight: .regular),textColor: .white.withAlphaComponent(0.8),numberOfLines: 0)
-        return infoLab
-    }()
-    
-    
-    lazy var tryBtn: UIButton = {
-        let tryBtn = UIButton.createButton(title: "Try".localized,font: .font(name: .ZillaSlab,size: 14,weight: .medium),titleColor: "#121212".uiColor,corner: 13)
-        tryBtn.isUserInteractionEnabled = false
-        tryBtn.contentEdgeInsets = UIEdgeInsets(top: 6, left: 20, bottom: 6, right: 20)
-        kMainAsync {
-            tryBtn.addGradientBg(colors: ["#F1D3AB".uiCGColor,"#E4A858".uiCGColor])
-        }
-        return tryBtn
-    }()
-
-    lazy var animatedImageView: AnimatedImageView = {
-        let animatedImageView = AnimatedImageView()
-        animatedImageView.autoPlayAnimatedImage = false
-        return animatedImageView
-    }()
-    
-    
-    override func creatUI() {
-        bgContentView.clipsToBounds = true
-        bgContentView.addSubview(bgImageView)
-        bgImageView.snp.makeConstraints { make in
-            make.top.bottom.leading.trailing.equalTo(0)
-        }
-        
-        let leading = 16.0
-        let trailing = -186.0*kDesignScale
-        bgContentView.addSubview(titleLab)
-        titleLab.snp.makeConstraints { make in
-            make.trailing.equalTo(trailing)
-            make.leading.equalTo(leading)
-            make.top.equalTo(43)
-        }
-
-        bgContentView.addSubview(infoLab)
-        infoLab.snp.makeConstraints { make in
-            make.trailing.equalTo(trailing)
-            make.leading.equalTo(leading)
-            make.top.equalTo(titleLab.snp.bottom).offset(8)
-            make.height.greaterThanOrEqualTo(16)
-        }
-
-        bgContentView.addSubview(tryBtn)
-        tryBtn.snp.makeConstraints { make in
-            make.bottom.equalTo(-43)
-            make.leading.equalTo(leading)
-            make.height.equalTo(26)
-        }
-    
-        addAnimatedImageView()
-    }
-    
-    
-    
-    func addAnimatedImageView(){
-        bgContentView.addSubview(animatedImageView)
-        animatedImageView.snp.makeConstraints { make in
-            make.trailing.equalTo(-22.5*kDesignScale)
-            make.centerY.equalToSuperview().offset(-4.5*kDesignScale)
-            make.width.equalTo(155*kDesignScale)
-            make.height.equalTo(207*kDesignScale)
-        }
-        let boradView = UIView()
-        boradView.layer.borderWidth = 3
-        boradView.layer.borderColor = "#DFD7C0".uiCGColor
-        animatedImageView.addSubview(boradView)
-        boradView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
+class TSAILIstBaseCell: TSBaseCollectionCell {
+    var clickBlock:((TSDiscoverItemModel)->Void)?
+    var items:Any? {
+        didSet {
+            upDateModel()
         }
         }
-        animatedImageView.setRotation(angle: kIsRTL ? 5 : -5)
     }
     }
     
     
+    func upDateModel() { }
 }
 }
 
 

+ 139 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/View/TSAILIstFullCardCell.swift

@@ -0,0 +1,139 @@
+//
+//  TSAILIstFullCardCell.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/2.
+//
+
+import Kingfisher
+class TSAILIstFullCardCell: TSAILIstBaseCell {
+    override func upDateModel() {
+        if let model = items as? TSDiscoverItemModel {
+            bgImageView.image = UIImage(named: model.viewModel.imageNamed)
+            titleLab.text = model.name
+            infoLab.text = model.viewModel.info
+            
+            if let animationModel = model.viewModel as? TSDiscoverAnimationItemVM {
+                if let imageNamed = animationModel.imageNameds.first {
+                    bgImageView.image = UIImage(named: imageNamed)
+                }
+                
+                if let gifNamed = animationModel.imageNameds.last {
+                    if let gifURL = Bundle.main.url(forResource: gifNamed, withExtension: nil) {
+                        animatedImageView.kf.setImage(with: gifURL, options: [.cacheOriginalImage]){ result in
+                            switch result {
+                            case .success(_):
+                                self.animatedImageView.isHidden = false
+                                self.animatedImageView.startAnimating()
+                            case .failure(let error):
+                                print("GIF 加载失败: \(error.localizedDescription)")
+                            }
+                        }
+                    }
+                }
+            }else{
+                bgImageView.image = UIImage(named: model.viewModel.imageNamed)
+                animatedImageView.stopAnimating()
+                animatedImageView.isHidden = true
+            }
+        }
+    }
+
+    lazy var bgImageView: UIImageView = {
+        let bgImageView = UIImageView()
+        bgImageView.contentMode = .scaleToFill
+        return bgImageView
+    }()
+    
+    
+    lazy var titleLab: UILabel = {
+        let titleLab = UILabel.createLabel(font: .font(name: .ZillaSlab,size: 20,weight: .bold),textColor:.fromHex("FFFFFF"),numberOfLines: 0)
+        return titleLab
+    }()
+    
+    lazy var infoLab: UILabel = {
+        let infoLab = UILabel.createLabel(font: .font(size: 14,weight: .regular),textColor: .white.withAlphaComponent(0.8),numberOfLines: 0)
+        return infoLab
+    }()
+    
+    
+    lazy var tryBtn: UIButton = {
+        let tryBtn = UIButton.createButton(title: "Try".localized,font: .font(name: .ZillaSlab,size: 14,weight: .medium),titleColor: "#121212".uiColor,corner: 13)
+        tryBtn.isUserInteractionEnabled = false
+        tryBtn.contentEdgeInsets = UIEdgeInsets(top: 6, left: 20, bottom: 6, right: 20)
+        kMainAsync {
+            tryBtn.addGradientBg(colors: ["#F1D3AB".uiCGColor,"#E4A858".uiCGColor])
+        }
+        return tryBtn
+    }()
+
+    lazy var animatedImageView: AnimatedImageView = {
+        let animatedImageView = AnimatedImageView()
+        animatedImageView.autoPlayAnimatedImage = false
+        return animatedImageView
+    }()
+    
+    
+    override func creatUI() {
+        
+        bgContentView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickView)))
+        
+        bgContentView.clipsToBounds = true
+        bgContentView.addSubview(bgImageView)
+        bgImageView.snp.makeConstraints { make in
+            make.top.bottom.leading.trailing.equalTo(0)
+        }
+        
+        let leading = 16.0
+        let trailing = -186.0*kDesignScale
+        bgContentView.addSubview(titleLab)
+        titleLab.snp.makeConstraints { make in
+            make.trailing.equalTo(trailing)
+            make.leading.equalTo(leading)
+            make.top.equalTo(43)
+        }
+
+        bgContentView.addSubview(infoLab)
+        infoLab.snp.makeConstraints { make in
+            make.trailing.equalTo(trailing)
+            make.leading.equalTo(leading)
+            make.top.equalTo(titleLab.snp.bottom).offset(8)
+            make.height.greaterThanOrEqualTo(16)
+        }
+
+        bgContentView.addSubview(tryBtn)
+        tryBtn.snp.makeConstraints { make in
+            make.bottom.equalTo(-43)
+            make.leading.equalTo(leading)
+            make.height.equalTo(26)
+        }
+    
+        addAnimatedImageView()
+    }
+    
+    
+    
+    func addAnimatedImageView(){
+        bgContentView.addSubview(animatedImageView)
+        animatedImageView.snp.makeConstraints { make in
+            make.trailing.equalTo(-22.5*kDesignScale)
+            make.centerY.equalToSuperview().offset(-4.5*kDesignScale)
+            make.width.equalTo(155*kDesignScale)
+            make.height.equalTo(207*kDesignScale)
+        }
+        let boradView = UIView()
+        boradView.layer.borderWidth = 3
+        boradView.layer.borderColor = "#DFD7C0".uiCGColor
+        animatedImageView.addSubview(boradView)
+        boradView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        animatedImageView.setRotation(angle: kIsRTL ? 5 : -5)
+    }
+    
+    @objc  func clickView(){
+        if let model = items as? TSDiscoverItemModel {
+            clickBlock?(model)
+        }
+     }
+}

+ 156 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/View/TSAILIstStyleMoreCell.swift

@@ -0,0 +1,156 @@
+//
+//  TSAILIstStyleMoreCell.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/2.
+//
+
+class TSAILIstStyleMoreCell : TSAILIstBaseCell {
+    lazy var collectionView: UICollectionView = {
+        let layout = UICollectionViewFlowLayout()
+        layout.scrollDirection = .horizontal
+        layout.minimumLineSpacing = 16
+        layout.minimumInteritemSpacing = 16
+        layout.itemSize = CGSize(width: 150, height: 200)
+        let collectionView = TSBaseCollectionView(frame: .zero, collectionViewLayout: layout)
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.register(TSAILIstStyleMoreBaseCell.self, forCellWithReuseIdentifier: "TSAILIstStyleMoreBaseCell")
+        collectionView.register(TSAILIstStyleMoreAnimationGifCell.self, forCellWithReuseIdentifier: "TSAILIstStyleMoreAnimationGifCell")
+        collectionView.contentInset = kDiscoverSection
+        return collectionView
+    }()
+    var models:[TSDiscoverItemModel] = []
+    override func upDateModel() {
+        if let models = items as? [TSDiscoverItemModel] {
+            self.models = models
+        }
+        collectionView.reloadData()
+    }
+    
+    override func creatUI() {
+        bgContentView.addSubview(collectionView)
+        collectionView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+    }
+}
+extension TSAILIstStyleMoreCell: UICollectionViewDataSource ,UICollectionViewDelegate {
+    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return models.count
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        if let dbModel = models.safeObj(At: indexPath.row) {
+            if let animationModel = dbModel.viewModel as? TSDiscoverAnimationItemVM {
+            if animationModel.style == .gif {
+                    if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "TSAILIstStyleMoreAnimationGifCell", for: indexPath) as? TSAILIstStyleMoreAnimationGifCell{
+                        cell.model = dbModel
+                        return cell
+                    }
+                }
+            }else{
+                if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "TSAILIstStyleMoreBaseCell", for: indexPath) as? TSAILIstStyleMoreBaseCell{
+                    cell.model = dbModel
+                    return cell
+                }
+            }
+        }
+        return UICollectionViewCell()
+    }
+
+    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        if let model = models.safeObj(At: indexPath.row) {
+            clickBlock?(model)
+        }
+    }
+}
+
+
+
+private let CellCornerRadius = 16.0
+class TSAILIstStyleMoreBaseCell: TSBaseCollectionCell {
+    var model:TSDiscoverItemModel? {
+        didSet {
+            guard let model = model else { return }
+            imageView.image = UIImage(named: model.viewModel.imageNamed)
+            textLabel.text = model.name
+        }
+    }
+
+    lazy var imageView: UIImageView = {
+        let imageView = UIImageView.createImageView(contentMode: .scaleToFill,backgroundColor: .white.withAlphaComponent(0.2))
+        return imageView
+    }()
+    
+    
+    lazy var shadowView: UIImageView = {
+        let imageView = UIImageView.createImageView(image:.ailistSmallShaow,contentMode: .scaleToFill)
+        return imageView
+    }()
+    
+    lazy var textLabel: UILabel = {
+        let textLabel = UILabel.createLabel(font: .font(size: 14,weight: .medium),textColor: .white)
+        return textLabel
+    }()
+    
+    override func creatUI() {
+        contentView.layer.borderWidth = 3
+        contentView.layer.borderColor = "#DFD7C0".uiCGColor
+        bgContentView.addSubview(imageView)
+        bgContentView.addSubview(shadowView)
+        bgContentView.addSubview(textLabel)
+        
+        imageView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        shadowView.snp.makeConstraints { make in
+            make.height.equalTo(40)
+            make.leading.trailing.bottom.equalToSuperview()
+        }
+        
+        textLabel.snp.makeConstraints { make in
+            make.leading.equalTo(8)
+            make.trailing.bottom.equalTo(-8)
+        }
+    }
+}
+
+
+import Kingfisher
+class TSAILIstStyleMoreAnimationGifCell: TSAILIstStyleMoreBaseCell {
+    override var model:TSDiscoverItemModel? {
+        didSet {
+            guard let model = model else { return }
+            textLabel.text = model.name
+    
+            if let animationModel = model.viewModel as? TSDiscoverAnimationItemVM,let imageNamed = animationModel.imageNameds.first {
+                if let gifURL = Bundle.main.url(forResource: imageNamed, withExtension: "gif") {
+                    animatedImageView.kf.setImage(with: gifURL, options: [.cacheOriginalImage]){ result in
+                        switch result {
+                        case .success(_):
+                            self.animatedImageView.startAnimating()
+                        case .failure(let error):
+                            print("GIF 加载失败: \(error.localizedDescription)")
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    lazy var animatedImageView: AnimatedImageView = {
+        let animatedImageView = AnimatedImageView()
+        animatedImageView.autoPlayAnimatedImage = false
+        return animatedImageView
+    }()
+    
+    override func creatUI() {
+        super.creatUI()
+        imageView.addSubview(animatedImageView)
+        animatedImageView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+
+    }
+}

+ 24 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoGeneratorVC/Model/TSAIListPhotoGeneratorModel.swift

@@ -4,7 +4,7 @@
 //
 //
 //  Created by 100Years on 2025/6/19.
 //  Created by 100Years on 2025/6/19.
 //
 //
-
+import ObjectMapper
 class TSAIListPhotoGeneratorModel {
 class TSAIListPhotoGeneratorModel {
     var upLoadImage:UIImage
     var upLoadImage:UIImage
     var generatorStyle:TSGeneratorImageStyle
     var generatorStyle:TSGeneratorImageStyle
@@ -35,3 +35,26 @@ class TSAIListPhotoGeneratorModel {
     var upLoadImageUrl:String?
     var upLoadImageUrl:String?
     var model:String = ""   //决定生图的模型
     var model:String = ""   //决定生图的模型
 }
 }
+
+class TSGenerateModel: TSBaseModel {
+    var imageName:String = ""
+    var imageText:String = ""
+    var prompt:String = ""
+    var isVip:Bool = false
+    var specialStyle:Int = 0 //0 普通类型,1 热门类型,2 新类型,3 max,
+    var input:Bool = false   //是否输入框
+    var model:String = ""       //走新的通道,根据内容确定
+    var unionType:Int = 0 //聚合类型,相同的为一类
+    
+    override func mapping(map: ObjectMapper.Map) {
+        imageName               <- map["imageName"]
+        imageText               <- map["imageText"]
+        prompt                  <- map["prompt"]
+        isVip                   <- map["isVip"]
+        specialStyle            <- map["specialStyle"]
+        input                   <- map["input"]
+        model                   <- map["model"]
+        unionType               <- map["unionType"]
+    }
+    
+}

+ 14 - 3
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIUploadPhotoVC.swift

@@ -11,10 +11,12 @@ import BetterSegmentedControl
 class TSAIUploadPhotoVC: TSBaseVC {
 class TSAIUploadPhotoVC: TSBaseVC {
     var generatorStyle:TSGeneratorImageStyle
     var generatorStyle:TSGeneratorImageStyle
     var titleString:String
     var titleString:String
-    init(titleString:String,upLoadImage:UIImage,generatorStyle:TSGeneratorImageStyle) {
+    var disCoverItemModel:TSDiscoverItemModel?
+    init(titleString:String,upLoadImage:UIImage,generatorStyle:TSGeneratorImageStyle,disCoverItemModel:TSDiscoverItemModel? = nil) {
         self.titleString = titleString
         self.titleString = titleString
         self.upLoadImage = upLoadImage
         self.upLoadImage = upLoadImage
         self.generatorStyle = generatorStyle
         self.generatorStyle = generatorStyle
+        self.disCoverItemModel = disCoverItemModel
         super.init()
         super.init()
     }
     }
     
     
@@ -105,7 +107,7 @@ class TSAIUploadPhotoVC: TSBaseVC {
 
 
 extension TSAIUploadPhotoVC {
 extension TSAIUploadPhotoVC {
     func setUpStackView(){
     func setUpStackView(){
-        if generatorStyle == .creatVideo {
+        if generatorStyle == .creatVideo && disCoverItemModel?.generateModel?.input == true {
             setUpVideoUploadView()
             setUpVideoUploadView()
         }else{
         }else{
             setUpImageUploadView()
             setUpImageUploadView()
@@ -151,7 +153,16 @@ extension TSAIUploadPhotoVC {
         guard let upLoadImage = upLoadImage else { return }
         guard let upLoadImage = upLoadImage else { return }
         
         
         let generatorModel = TSAIListPhotoGeneratorModel(upLoadImage: upLoadImage, generatorStyle: generatorStyle,additionalPrompt: additionalPrompt)
         let generatorModel = TSAIListPhotoGeneratorModel(upLoadImage: upLoadImage, generatorStyle: generatorStyle,additionalPrompt: additionalPrompt)
-        generatorModel.prompt = prompt
+
+        if let generateModel = disCoverItemModel?.generateModel{
+            generatorModel.prompt = generateModel.prompt + additionalPrompt
+            generatorModel.model = generateModel.model
+        }else{
+            if let promptModel = generatorStyle.generateModel{
+                generatorModel.prompt = promptModel.prompt + additionalPrompt
+                generatorModel.model = promptModel.model
+            }
+        }
         
         
         let gennerateVC = TSAIListPhotoGeneratorVC(generatorModel:generatorModel){ model in }
         let gennerateVC = TSAIListPhotoGeneratorVC(generatorModel:generatorModel){ model in }
         gennerateVC.backstageBlock = { [weak self]  in
         gennerateVC.backstageBlock = { [weak self]  in

+ 1 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/View/TSAIUploadPhotoTextView.swift

@@ -25,7 +25,7 @@ class TSAIUploadPhotoTextView: TSBaseView {
             backgroundColor: "#333333".uiColor,
             backgroundColor: "#333333".uiColor,
             textInsets:UIEdgeInsets(top: 14, left: 12, bottom: 14, right: 12)
             textInsets:UIEdgeInsets(top: 14, left: 12, bottom: 14, right: 12)
         )
         )
-        placeholderTextView.maxLength = 200
+        placeholderTextView.maxLength = 500
         return placeholderTextView
         return placeholderTextView
     }()
     }()
     
     

+ 6 - 6
TSLiveWallpaper/Common/TSNetWork/TSNetworkManager.swift

@@ -26,12 +26,12 @@ class TSNetworkManager {
     }
     }
     
     
     lazy var afSession: Session = {
     lazy var afSession: Session = {
-        let configuration = URLSessionConfiguration.af.default
-        configuration.timeoutIntervalForRequest = 30  // 请求超时时间(秒)
-        configuration.timeoutIntervalForResource = 30 // 资源超时时间(秒)
-        let session = Session(configuration: configuration)
-        return session
-//        return AF
+//        let configuration = URLSessionConfiguration.af.default
+//        configuration.timeoutIntervalForRequest = 30  // 请求超时时间(秒)
+//        configuration.timeoutIntervalForResource = 30 // 资源超时时间(秒)
+//        let session = Session(configuration: configuration)
+//        return session
+        return AF
     }()
     }()
     lazy var encoder: JSONEncoding = {
     lazy var encoder: JSONEncoding = {
         return JSONEncoding(options: .withoutEscapingSlashes)// 关键:禁用斜杠转义
         return JSONEncoding(options: .withoutEscapingSlashes)// 关键:禁用斜杠转义

+ 66 - 35
TSLiveWallpaper/Data/OperationQueue/TSGenerateBaseOperation/TSGenerateBasePhotoOperation.swift

@@ -48,6 +48,8 @@ class TSGenerateBasePhotoOperation: TSGenerateBaseOperation , @unchecked Sendabl
         model.uuid = uuid
         model.uuid = uuid
         model.request.imageUrlTimestamp = currentActionInfoModel.request.imageUrlTimestamp
         model.request.imageUrlTimestamp = currentActionInfoModel.request.imageUrlTimestamp
         model.request.generatorStyle = currentActionInfoModel.request.generatorStyle
         model.request.generatorStyle = currentActionInfoModel.request.generatorStyle
+        model.request.model = currentActionInfoModel.request.model
+        
         if isSaveProcessToDB {
         if isSaveProcessToDB {
             saveDataDB()
             saveDataDB()
         }
         }
@@ -123,6 +125,7 @@ class TSGenerateBasePhotoOperation: TSGenerateBaseOperation , @unchecked Sendabl
         infoModel.request.prompt = generateStyleModel.prompt
         infoModel.request.prompt = generateStyleModel.prompt
         infoModel.request.inputText = generateStyleModel.inputText
         infoModel.request.inputText = generateStyleModel.inputText
         infoModel.request.generatorStyle = generateStyleModel.generatorStyle
         infoModel.request.generatorStyle = generateStyleModel.generatorStyle
+        infoModel.request.model = generateStyleModel.model
         
         
         return infoModel
         return infoModel
     }
     }
@@ -180,42 +183,44 @@ class TSGenerateBasePhotoOperation: TSGenerateBaseOperation , @unchecked Sendabl
         stateDatauPblished = (.progressString(generating(progress: 0.0)),currentActionInfoModel)
         stateDatauPblished = (.progressString(generating(progress: 0.0)),currentActionInfoModel)
  
  
         
         
-        let request = currentActionInfoModel.request
-        
-        
-        var urlType:TSNeURLType = .imageRewrite
-        var postDict:[String:Any] = [
-            "device":getUserInfoJsonString(),
-            "imageUrl":request.imageUrl,
-            "model":request.generatorStyle.aiModel
-        ]
-        switch request.generatorStyle {
-        case .enhance:
-            urlType = .imageRewrite
-            postDict["prompt"] = "把图片变清晰"
-        case .colorize:
-            urlType = .imageRewrite
-            postDict["prompt"] = "Add suitable colors to photos"
-        case .descratch:
-            urlType = .imageRewrite
-            postDict["prompt"] = "Remove the photo's scratches and dirt"
-        case .enlighten:
-            urlType = .imageRewrite
-            postDict["prompt"] = "Adjust the light and darkness of the photo to make the overall look coordinated"
-            
-        case .recreate:
-            urlType = .imageRewrite
-            postDict["prompt"] = "Recreate damaged portraits and added suitable color for photo"
-            
-        case .creatVideo:
-            urlType = .createVideo
-            postDict["prompt"] = request.prompt
-//            postDict["aspectRatio"] = "9:16"
-            postDict["duration"] = 5
-            postDict["quality"] = "720p"
-        }
+//        let request = currentActionInfoModel.request
+//        var urlType:TSNeURLType = .imageRewrite
+//        var postDict:[String:Any] = [
+//            "device":getUserInfoJsonString(),
+//            "imageUrl":request.imageUrl,
+//            "model":request.generatorStyle.aiModel
+//        ]
+//        switch request.generatorStyle {
+//        case .enhance:
+//            urlType = .imageRewrite
+//            postDict["prompt"] = "把图片变清晰"
+//        case .colorize:
+//            urlType = .imageRewrite
+//            postDict["prompt"] = "Add suitable colors to photos"
+//        case .descratch:
+//            urlType = .imageRewrite
+//            postDict["prompt"] = "Remove the photo's scratches and dirt"
+//        case .enlighten:
+//            urlType = .imageRewrite
+//            postDict["prompt"] = "Adjust the light and darkness of the photo to make the overall look coordinated"
+//            
+//        case .recreate:
+//            urlType = .imageRewrite
+//            postDict["prompt"] = "Recreate damaged portraits and added suitable color for photo"
+//            
+//        case .creatVideo:
+//            urlType = .createVideo
+//            postDict["prompt"] = request.prompt
+//            postDict["duration"] = 5
+//            postDict["quality"] = "720p"
+//            
+//        default:
+//            urlType = .imageRewrite
+//            postDict["prompt"] = "把图片变清晰"
+//        }
 
 
-        creatRequest = TSNetworkShared.post(urlType: urlType,parameters: postDict) { [weak self] data,error in
+        guard let getPostContent = getPostContent() else { return }
+        creatRequest = TSNetworkShared.post(urlType: getPostContent.0,parameters: getPostContent.1) { [weak self] data,error in
             guard let self = self else { return }
             guard let self = self else { return }
             if stopNetwork == true { return }
             if stopNetwork == true { return }
             
             
@@ -271,3 +276,29 @@ class TSGenerateBasePhotoOperation: TSGenerateBaseOperation , @unchecked Sendabl
         creatRequest?.cancel()
         creatRequest?.cancel()
     }
     }
 }
 }
+extension TSGenerateBasePhotoOperation {
+
+    func getPostContent()->(TSNeURLType,[String:Any])?{
+        let request = currentActionInfoModel.request
+        var urlType:TSNeURLType = .imageRewrite
+        var postDict:[String:Any] = [
+            "device":getUserInfoJsonString(),
+            "imageUrl":request.imageUrl,
+            "model":request.model
+        ]
+        
+        switch request.generatorStyle {
+        case .creatVideo:
+            urlType = .createVideo
+            postDict["prompt"] = request.prompt
+            postDict["duration"] = 5
+            postDict["quality"] = "720p"
+        default:
+            postDict["prompt"] = request.prompt
+            break;
+        }
+
+        return (urlType,postDict)
+    }
+    
+}

+ 30 - 3
TSLiveWallpaper/Data/TSDBManager/TSDBActionInfoModel.swift

@@ -27,9 +27,17 @@ class TSDBActionInfoModel: Object {
     @Persisted var uuid:String = UUID().uuidString
     @Persisted var uuid:String = UUID().uuidString
     
     
     static func createDBModel(actionInfoModel:TSActionInfoModel) -> TSDBActionInfoModel{
     static func createDBModel(actionInfoModel:TSActionInfoModel) -> TSDBActionInfoModel{
-        let dbModel = TSDBActionInfoModel()
-        dbModel.saveData(infoModel: actionInfoModel)
-        return dbModel
+        if let dbModel = TSRMShared.realm.object(ofType: TSDBActionInfoModel.self, forPrimaryKey: actionInfoModel.uuid) {
+            TSRMShared.writeThread {
+                dbModel.saveData(infoModel: actionInfoModel)
+            }
+            return dbModel
+        }else{
+            let dbModel = TSDBActionInfoModel()
+            dbModel.primaryKey = actionInfoModel.uuid
+            dbModel.saveData(infoModel: actionInfoModel)
+            return dbModel
+        }
     }
     }
     
     
     func saveData(infoModel:TSActionInfoModel) {
     func saveData(infoModel:TSActionInfoModel) {
@@ -88,6 +96,25 @@ class TSDBActionInfoModel: Object {
         return true
         return true
     }
     }
 
 
+    func deleteResources() {
+        //退出正在生成的任务
+        TSGenerateBasePhotoOperationQueue.shared.cancelOperations(uuid: uuid)
+        
+        if let response = response {
+            TSImageStoreTool.removeImage(urlString:response.resultUrl)
+            TSImageStoreTool.removeImage(urlString:response.previewUrl)
+            if !response.videoDocument.isEmpty {
+                TSFileManagerTool.removeItem(from: response.videoDocument.fillDocumentURL)
+            }
+            
+        }
+        
+        if let request = request {
+            TSImageStoreTool.removeImage(urlString:request.imageUrl)
+        }
+        
+        
+    }
 }
 }
 
 
 
 

+ 27 - 12
TSLiveWallpaper/Data/TSDBManager/TSDBManager.swift

@@ -70,6 +70,7 @@ class TSDBHistory: Object {
 
 
         TSRMShared.writeThread {
         TSRMShared.writeThread {
             listModels.removeAll()
             listModels.removeAll()
+            TSRMShared.realm.delete(listModels)
         }
         }
     }
     }
     
     
@@ -79,28 +80,27 @@ class TSDBHistory: Object {
         }
         }
     }
     }
     
     
+    func deleteListModel(uuid:String) {
+        if let index = listModels.firstIndex(where: { $0.uuid == uuid }) {
+            deleteListModel(index: index)
+        }
+    }
+    
     func deleteListModel(index:Int) {
     func deleteListModel(index:Int) {
         TSRMShared.writeThread {
         TSRMShared.writeThread {
             deleteResources(index:index)
             deleteResources(index:index)
             listModels.remove(at: index)
             listModels.remove(at: index)
+            if let model = listModels[safe: index] {
+                TSRMShared.realm.delete(model)
+            }
+            
             debugPrint("listModels.remove(at: \(index))")
             debugPrint("listModels.remove(at: \(index))")
         }
         }
     }
     }
 
 
     func deleteResources(index:Int) {
     func deleteResources(index:Int) {
         if let model = listModels[safe: index] {
         if let model = listModels[safe: index] {
-            if let response =  model.response {
-                TSImageStoreTool.removeImage(urlString:response.resultUrl)
-                TSImageStoreTool.removeImage(urlString:response.previewUrl)
-                if !response.videoDocument.isEmpty {
-                    TSFileManagerTool.removeItem(from: response.videoDocument.fillDocumentURL)
-                }
-                
-            }
-            
-            if let request =  model.request {
-                TSImageStoreTool.removeImage(urlString:request.imageUrl)
-            }
+            model.deleteResources()
         }
         }
     }
     }
     
     
@@ -179,6 +179,21 @@ extension TSRealmManager {
             UserDefaults.standard.synchronize()
             UserDefaults.standard.synchronize()
         }
         }
         
         
+        if history.listModels.count > 0,UserDefaults.standard.string(forKey: "aiListDBDeleteIncorrectData") == nil {
+            var primaryKeysToKeep:[String] = []
+            for model in history.listModels {
+                primaryKeysToKeep.append(model.primaryKey)
+            }
+            writeThread {
+                let objectsToDelete = realm.objects(TSDBActionInfoModel.self)
+                    .filter("NOT (primaryKey IN %@)", primaryKeysToKeep)
+                realm.delete(objectsToDelete)
+            }
+
+            UserDefaults.standard.set("1", forKey: "aiListDBDeleteIncorrectData")
+            UserDefaults.standard.synchronize()
+        }
+    
         return history
         return history
     }
     }
     
     

BIN
TSLiveWallpaper/Resource/Gif/aiList_BlowKiss.gif


BIN
TSLiveWallpaper/Resource/Gif/aiList_ForeheadKiss.gif


BIN
TSLiveWallpaper/Resource/Gif/aiList_HeartGesture.gif


BIN
TSLiveWallpaper/Resource/Gif/aiList_Hug.gif


BIN
TSLiveWallpaper/Resource/Gif/aiList_Kiss.gif


BIN
TSLiveWallpaper/Resource/Gif/aiList_SayHi.gif


BIN
TSLiveWallpaper/Resource/Gif/aiList_Smile.gif


BIN
TSLiveWallpaper/Resource/Gif/aiList_Stroll.gif


BIN
TSLiveWallpaper/Resource/animated_example.gif


BIN
TSLiveWallpaper/Resource/animated_photos.webp