Bladeren bron

开发完毕多语言的切换逻辑3.6.9(1)

100Years 1 maand geleden
bovenliggende
commit
96b506ab21
26 gewijzigde bestanden met toevoegingen van 533 en 40 verwijderingen
  1. 20 4
      TSLiveWallpaper.xcodeproj/project.pbxproj
  2. 25 4
      TSLiveWallpaper/AppDelegate.swift
  3. BIN
      TSLiveWallpaper/Assets.xcassets/Common/check.imageset/check@2x.png
  4. BIN
      TSLiveWallpaper/Assets.xcassets/Common/check.imageset/check@3x.png
  5. 22 0
      TSLiveWallpaper/Assets.xcassets/Common/un_check.imageset/Contents.json
  6. BIN
      TSLiveWallpaper/Assets.xcassets/Common/un_check.imageset/un_check@2x.png
  7. BIN
      TSLiveWallpaper/Assets.xcassets/Common/un_check.imageset/un_check@3x.png
  8. 22 0
      TSLiveWallpaper/Assets.xcassets/Mine/mine_cell_language.imageset/Contents.json
  9. BIN
      TSLiveWallpaper/Assets.xcassets/Mine/mine_cell_language.imageset/mine_cell_language@2x.png
  10. BIN
      TSLiveWallpaper/Assets.xcassets/Mine/mine_cell_language.imageset/mine_cell_language@3x.png
  11. 22 0
      TSLiveWallpaper/Assets.xcassets/Vip/vip_color_icon.imageset/Contents.json
  12. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/vip_color_icon.imageset/vip_color_icon@2x.png
  13. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/vip_color_icon.imageset/vip_color_icon@3x.png
  14. 9 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/TSAIListHistoryVC.swift
  15. 66 4
      TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/View/TSAIListHistoryCell.swift
  16. 7 6
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift
  17. 2 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserVC.swift
  18. 28 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC+Video.swift
  19. 11 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC+View.swift
  20. 9 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC.swift
  21. 8 10
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoGeneratorVC/TSAIListPhotoGeneratorVC.swift
  22. 6 5
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIUploadPhotoVC.swift
  23. 135 0
      TSLiveWallpaper/Business/TSMineVC/TSChangeLanguageVC/TSChangeLanguageVC.swift
  24. 11 1
      TSLiveWallpaper/Business/TSMineVC/TSMineVM.swift
  25. 3 3
      TSLiveWallpaper/Common/Purchase/TSPurchaseManager.swift
  26. 127 0
      TSLiveWallpaper/Common/Tool/LanguageManager.swift

+ 20 - 4
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -60,6 +60,8 @@
 		A839463C2D1D6E3600ABFF0D /* TSRandomWallpaperCopyrightVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A839463B2D1D6E3500ABFF0D /* TSRandomWallpaperCopyrightVC.swift */; };
 		A839463F2D1D6FB700ABFF0D /* TSLiveWallpaperTutorialsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A839463E2D1D6FB600ABFF0D /* TSLiveWallpaperTutorialsVC.swift */; };
 		A83946432D1D701500ABFF0D /* TSLiveWallpaperCopyrightVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83946422D1D701300ABFF0D /* TSLiveWallpaperCopyrightVC.swift */; };
+		A83A6A862E1FC99E0084197A /* LanguageManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83A6A852E1FC9930084197A /* LanguageManager.swift */; };
+		A83A6A892E1FCF750084197A /* TSChangeLanguageVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83A6A882E1FCF740084197A /* TSChangeLanguageVC.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 */; };
@@ -236,6 +238,8 @@
 		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>"; };
 		A83946422D1D701300ABFF0D /* TSLiveWallpaperCopyrightVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLiveWallpaperCopyrightVC.swift; sourceTree = "<group>"; };
+		A83A6A852E1FC9930084197A /* LanguageManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageManager.swift; sourceTree = "<group>"; };
+		A83A6A882E1FCF740084197A /* TSChangeLanguageVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSChangeLanguageVC.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>"; };
@@ -501,6 +505,7 @@
 		A81CA4882D15840F00A3AAC8 /* Tool */ = {
 			isa = PBXGroup;
 			children = (
+				A83A6A852E1FC9930084197A /* LanguageManager.swift */,
 				A8F8BCDB2E040D9E00EF4AA6 /* TSBusinessFileManager.swift */,
 				A8F8BCD92E040D8100EF4AA6 /* TSDownloadManager.swift */,
 				A8C4C0EE2D27BFEA003C46FC /* TSNetworkTool.swift */,
@@ -560,6 +565,7 @@
 		A81CA4912D16521300A3AAC8 /* TSMineVC */ = {
 			isa = PBXGroup;
 			children = (
+				A83A6A872E1FCF680084197A /* TSChangeLanguageVC */,
 				A8FD8F362DFBD650008CAACF /* View */,
 				A839461C2D1D61A900ABFF0D /* VC */,
 				A81CA4982D1652C200A3AAC8 /* TSMineVC.swift */,
@@ -724,6 +730,14 @@
 			path = TSEditVideoVC;
 			sourceTree = "<group>";
 		};
+		A83A6A872E1FCF680084197A /* TSChangeLanguageVC */ = {
+			isa = PBXGroup;
+			children = (
+				A83A6A882E1FCF740084197A /* TSChangeLanguageVC.swift */,
+			);
+			path = TSChangeLanguageVC;
+			sourceTree = "<group>";
+		};
 		A83F28872E16231E009A4975 /* VM */ = {
 			isa = PBXGroup;
 			children = (
@@ -1350,6 +1364,7 @@
 				A81F5B4F2D19674600740085 /* AVAsset+Ex.swift in Sources */,
 				A8E56BF62D1520EC003C54AF /* AppDelegate.swift in Sources */,
 				A8F778B42D1BB8F600BF55D5 /* PhotoManager.swift in Sources */,
+				A83A6A862E1FC99E0084197A /* LanguageManager.swift in Sources */,
 				60553FD02D3B54A400BAAD7F /* LWNavigationBar.swift in Sources */,
 				60553FD22D3B54A400BAAD7F /* GradientButton.swift in Sources */,
 				60553FD42D3B54A400BAAD7F /* LWBaseViewController.swift in Sources */,
@@ -1412,6 +1427,7 @@
 				A86857DA2DF994600089D222 /* TSAIPhotoDetailsVC.swift in Sources */,
 				A86857CF2DF977640089D222 /* TSAIListPhotoGeneratorVC.swift in Sources */,
 				A86857922DF845F60089D222 /* TSGeneratoringAnimationView.swift in Sources */,
+				A83A6A892E1FCF750084197A /* TSChangeLanguageVC.swift in Sources */,
 				A86857BC2DF926110089D222 /* TSAIListHistoryVC.swift in Sources */,
 				A86857932DF845F60089D222 /* TSGeneratorErrorView.swift in Sources */,
 				A86857C02DF926870089D222 /* TSPageNullView.swift in Sources */,
@@ -1522,7 +1538,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 7;
+				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -1539,7 +1555,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.8;
+				MARKETING_VERSION = 3.6.9;
 				PRODUCT_BUNDLE_IDENTIFIER = musicplayer.offline.com;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1562,7 +1578,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 7;
+				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -1579,7 +1595,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.8;
+				MARKETING_VERSION = 3.6.9;
 				PRODUCT_BUNDLE_IDENTIFIER = musicplayer.offline.com;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";

+ 25 - 4
TSLiveWallpaper/AppDelegate.swift

@@ -10,17 +10,18 @@ import UIKit
 import Kingfisher
 @main
 class AppDelegate: UIResponder, UIApplicationDelegate {
-    
+    static var shared:AppDelegate?
     static var tabbar:TSTabBarController?
-    
     var window: UIWindow?
-
+    var backgroundTaskIdentifier: UIBackgroundTaskIdentifier = .invalid
+    
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
+        AppDelegate.shared = self
         window = UIWindow(frame: UIScreen.main.bounds)
         window?.backgroundColor = UIColor.black
         window?.makeKeyAndVisible()
-        goToLoadVC()
         initPlatform()
+        goToLoadVC()
         return true
     }
 
@@ -64,6 +65,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     func applicationWillEnterForeground(_ application: UIApplication) {
         checkAppConfig()
     }
+    
+    func applicationDidEnterBackground(_ application: UIApplication) {
+        beginBackgroundTask()
+    }
+    
+    func beginBackgroundTask() {
+        backgroundTaskIdentifier = UIApplication.shared.beginBackgroundTask { [weak self] in
+            self?.endBackgroundTask()
+        }
+    }
+
+    func endBackgroundTask() {
+        if backgroundTaskIdentifier != .invalid {
+            UIApplication.shared.endBackgroundTask(backgroundTaskIdentifier)
+            backgroundTaskIdentifier = .invalid
+        }
+    }
 }
 
 
@@ -75,7 +93,10 @@ extension AppDelegate {
     }
     
     func initPlatform() {
+        
+        _ = LanguageManager.shared//多语言设置切换
         TSRTLManage.setUpInit() //阿拉伯语适配
+        
         dePrint("TSRMShared.aiListDB.listModels.count=\(TSRMShared.aiListDB.listModels.count)")//提前预热数据库
         TSColorConfigShared.themeColor = .themeColor
         TSColorConfigShared.naviMianTextColor = .white//设置基类颜色

BIN
TSLiveWallpaper/Assets.xcassets/Common/check.imageset/check@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Common/check.imageset/check@3x.png


+ 22 - 0
TSLiveWallpaper/Assets.xcassets/Common/un_check.imageset/Contents.json

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

BIN
TSLiveWallpaper/Assets.xcassets/Common/un_check.imageset/un_check@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Common/un_check.imageset/un_check@3x.png


+ 22 - 0
TSLiveWallpaper/Assets.xcassets/Mine/mine_cell_language.imageset/Contents.json

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

BIN
TSLiveWallpaper/Assets.xcassets/Mine/mine_cell_language.imageset/mine_cell_language@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Mine/mine_cell_language.imageset/mine_cell_language@3x.png


+ 22 - 0
TSLiveWallpaper/Assets.xcassets/Vip/vip_color_icon.imageset/Contents.json

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

BIN
TSLiveWallpaper/Assets.xcassets/Vip/vip_color_icon.imageset/vip_color_icon@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Vip/vip_color_icon.imageset/vip_color_icon@3x.png


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

@@ -115,6 +115,7 @@ class TSAIListHistoryVC: TSBaseVC {
     @objc func updateVipView() {
         kMainAsync{
             self.vipBtn.isHidden = PurchaseManager.default.isVip
+            self.collectionView.reloadData()
         }
     }
     
@@ -179,11 +180,16 @@ extension TSAIListHistoryVC: UICollectionViewDataSource ,UICollectionViewDelegat
     public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
 
         if let dbModel = listModelArray.safeObj(At:indexPath.row){
+            
+            let isVip = kPurchaseBusiness.isVip
             //多个浏览
             var dataModelArray: [TSActionInfoModel] = []
             for itemModel in listModelArray {
                 if itemModel.status == "success" || itemModel.modelType == .example {
-                    dataModelArray.append(itemModel)
+                    if isVip == false,itemModel.isVideo {
+                    }else{
+                        dataModelArray.append(itemModel)
+                    }
                 }
             }
             
@@ -227,6 +233,8 @@ extension TSAIListHistoryVC{
                         updateDataView()
                     }
                 ))
+            }else if cmd == "unlockVip" {
+                TSPurchaseVC.show(target: self, closePageBlock: nil)
             }
         }
     }

+ 66 - 4
TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/View/TSAIListHistoryCell.swift

@@ -29,7 +29,7 @@ class TSAIListHistoryCell: TSBaseCollectionCell {
         }
     }
     
-
+    lazy var videoPlayerVC: TSAIListVideoPlayerVC = TSAIListVideoPlayerVC(videoURL: URL(string: "www.baidu.com")!)
     lazy var generateView: TSGennerateCellView = {
         let generateView = TSGennerateCellView()
         generateView.isHidden = true
@@ -99,6 +99,39 @@ class TSAIListHistoryCell: TSBaseCollectionCell {
         return videoIconImageView
     }()
     
+    lazy var blurEffect: UIVisualEffectView = {
+        let blurEffect = createBlurEffectView(style: .dark)
+        blurEffect.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickUnlockVip)))
+        let bgView = UIView()
+        blurEffect.contentView.addSubview(bgView)
+        bgView.snp.makeConstraints { make in
+            make.center.equalToSuperview()
+        }
+
+        let vipImageView = UIImageView.createImageView(image: .vipColorIcon)
+        bgView.addSubview(vipImageView)
+        
+        let textLabel = UILabel.createLabel(text: "Unlock Result".localized,font: .font(size: 12),textColor: .themeColor)
+        bgView.addSubview(textLabel)
+        
+        vipImageView.snp.makeConstraints { make in
+            make.leading.top.bottom.equalToSuperview()
+            make.height.width.equalTo(20)
+        }
+        
+        textLabel.snp.makeConstraints { make in
+            make.centerY.equalToSuperview()
+            make.trailing.equalToSuperview()
+            make.leading.equalTo(vipImageView.snp.trailing).offset(6)
+        }
+
+        return blurEffect
+    }()
+    
+    @objc func clickUnlockVip(_ gestureRecognizer: UILongPressGestureRecognizer) {
+        buttonTapped?("unlockVip")
+    }
+
     @objc func handleLongPress(_ gestureRecognizer: UILongPressGestureRecognizer) {
         // 确保只在手势开始时触发一次
         guard gestureRecognizer.state == .began else { return }
@@ -135,17 +168,24 @@ class TSAIListHistoryCell: TSBaseCollectionCell {
             make.height.equalTo(20)
         }
         
+        contentView.addSubview(blurEffect)
+        blurEffect.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        
         contentView.addSubview(videoIconImageView)
         videoIconImageView.snp.makeConstraints { make in
             make.top.equalTo(8)
             make.leading.equalTo(8)
             make.width.height.equalTo(20)
         }
-        
+
         contentView.addSubview(generateView)
         generateView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
+        
+
     }
 }
 
@@ -168,14 +208,16 @@ extension TSAIListHistoryCell {
                 textLabel.text = "Example".localized
                 exampleView.isHidden = false
                 showImageView.image = UIImage(named: model.response.resultUrl)
+                setVideoHidden()
             }else{
                 exampleView.isHidden = true
-                
+              
                 videoIconImageView.isHidden = !model.isVideo
                 if dataModel.isVideo {
                     videoIconImageView.isHidden = false
-                    showImageView.setAsyncImage(urlString: model.response.previewUrl,contentMode: .scaleAspectFill,backgroundColor: .white.withAlphaComponent(0.1))
+                    setVideoURL()
                 }else {
+                    setVideoHidden()
                     showImageView.setAsyncImage(urlString: model.response.resultUrl,contentMode: .scaleAspectFill,backgroundColor: .white.withAlphaComponent(0.1))
                     hiddenImageView.setAsyncImage(urlString: model.request.imageUrl,contentMode: .scaleAspectFill)
                 }
@@ -192,3 +234,23 @@ extension TSAIListHistoryCell {
         }
     }
 }
+
+
+extension TSAIListHistoryCell {
+    
+    func setVideoHidden(){
+        blurEffect.isHidden = true
+        videoPlayerVC.view.removeFromSuperview()
+    }
+    
+    func setVideoURL(){
+        blurEffect.isHidden = kPurchaseBusiness.isVip
+        self.videoPlayerVC.view.removeFromSuperview()
+        self.videoPlayerVC = TSAIListVideoPlayerVC(videoURL: dataModel.response.videoURL)
+        self.videoPlayerVC.viewFrame = self.contentView.bounds
+        self.videoPlayerVC.view.frame = self.contentView.bounds
+        self.showImageView.insertSubview(self.videoPlayerVC.view, at: 0)
+        self.videoPlayerVC.runloppPlay()
+        self.videoPlayerVC.view.isUserInteractionEnabled = false
+    }
+}

+ 7 - 6
TSLiveWallpaper/Business/TSAIListVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift

@@ -24,6 +24,7 @@ class TSAIListVideoPlayerVC: UIViewController {
     
     private let videoURL: URL
     
+    var viewFrame:CGRect?
     
     public var isRunloppPlay:Bool = false
     
@@ -98,10 +99,11 @@ class TSAIListVideoPlayerVC: UIViewController {
         NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: .main) { _ in }
     }
     
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-        playerLayer?.frame = playerContainerView.bounds
-    }
+//    override func viewDidLayoutSubviews() {
+//        super.viewDidLayoutSubviews()
+//        playerLayer?.frame = viewFrame ?? view.bounds
+//        dePrint("playerLayer?.frame=\(playerLayer?.frame)")
+//    }
     
     deinit {
         removePeriodicTimeObserver()
@@ -121,8 +123,6 @@ class TSAIListVideoPlayerVC: UIViewController {
         view.backgroundColor = .clear
         playerContainerView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickBgView)))
         view.addSubview(playerContainerView)
-    
-
         playerContainerView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
@@ -181,6 +181,7 @@ class TSAIListVideoPlayerVC: UIViewController {
         
         if let playerLayer = playerLayer {
             playerContainerView.layer.insertSublayer(playerLayer, at: 0)
+            playerLayer.frame = viewFrame ?? view.bounds
         }
         
         // Add time observer to update progress

+ 2 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserVC.swift

@@ -55,7 +55,8 @@ class TSAIPhotoDetailsBrowserVC: TSBaseVC {
         shareBtn.setUpButton(title: "Share".localized,
                              image: .share,
                               font: .font(name:.ZillaSlab,size: 14,weight: .medium),
-                        titleColor: .white.withAlphaComponent(0.8)){ [weak self]  in
+                             titleColor: .white.withAlphaComponent(0.8),
+                             autoMirrored: false){ [weak self]  in
             guard let self = self else { return }
             clickShare()
         }

+ 28 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC+Video.swift

@@ -11,6 +11,7 @@ extension TSAIPhotoDetailsVC {
     func setVideoHidden(){
         videoPlayerVC.removeFromParent()
         videoPlayerVC.view.removeFromSuperview()
+        videoBlurEffect.removeFromSuperview()
     }
     
     func setVideoURL(){
@@ -23,5 +24,32 @@ extension TSAIPhotoDetailsVC {
         self.contentView.insertSubview(self.videoPlayerVC.view, at: 0)
         self.videoPlayerVC.setControlsBottom(bottem: -80-k_Height_safeAreaInsetsBottom())
         self.videoPlayerVC.runloppPlay()
+        self.videoPlayerVC.view.addSubview(videoBlurEffect)
+        videoBlurEffect.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        
+        //添加结算 Vip 的按钮
+        contentView.addSubview(unlockVipBtn)
+        unlockVipBtn.snp.makeConstraints { make in
+            make.centerX.equalToSuperview()
+            make.width.equalTo(248)
+            make.height.equalTo(48)
+            make.bottom.equalTo(-12-k_Height_safeAreaInsetsBottom())
+        }
+        updateVipView()
     }
+     
+    func clickUnlockVipBtn() {
+        TSPurchaseVC.show(target: self, closePageBlock: nil)
+    }
+    
+    @objc func updateVipView() {
+        let isVip = kPurchaseBusiness.isVip
+        unlockVipBtn.isHidden = isVip
+        videoBlurEffect.isHidden = isVip
+        shareBtn.isHidden = !isVip
+        saveBtn.isHidden = !isVip
+    }
+    
 }

+ 11 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC+View.swift

@@ -27,12 +27,22 @@ extension TSAIPhotoDetailsVC{
         return saveBtn
     }
     
+    func creatUnlockVipBtn() -> UIButton {
+        let saveBtn = kCreateNormalSubmitBtn(title: "Unlock Result".localized) { [weak self]  in
+            guard let self = self else { return }
+            clickUnlockVipBtn()
+        }
+        kSetBtnVipIcon(btn: saveBtn, show: true)
+        return saveBtn
+    }
+    
     func creatShareBtn() -> TSVerticalButton {
         let shareBtn = TSVerticalButton()
         shareBtn.setUpButton(title: "Share".localized,
                              image: .share,
                               font: .font(name:.ZillaSlab,size: 14,weight: .medium),
-                        titleColor: .white.withAlphaComponent(0.8)){ [weak self]  in
+                        titleColor: .white.withAlphaComponent(0.8),
+                             autoMirrored: false){ [weak self]  in
             guard let self = self else { return }
             clickShare()
         }

+ 9 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC.swift

@@ -22,6 +22,10 @@ class TSAIPhotoDetailsVC: TSBaseVC {
     lazy var saveBtn: UIButton = creatSaveBtn()
     var navRightBtn:UIButton = UIButton()
     var isSavePhotoMark:Bool = false
+    
+    lazy var videoBlurEffect: UIVisualEffectView = createBlurEffectView(style: .dark)
+    lazy var unlockVipBtn: UIButton = creatUnlockVipBtn()
+    
     override func createView() {
         
         let imageView = UIImageView.createImageView(image: .navShadow,contentMode: .scaleToFill)
@@ -140,6 +144,11 @@ class TSAIPhotoDetailsVC: TSBaseVC {
             }
         ))
     }
+    
+    
+    override func dealThings() {
+        NotificationCenter.default.addObserver(self, selector: #selector(updateVipView), name: .kPurchaseDidChanged, object: nil)
+    }
 }
 
 

+ 8 - 10
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoGeneratorVC/TSAIListPhotoGeneratorVC.swift

@@ -96,12 +96,6 @@ class TSAIListPhotoGeneratorVC: TSAIPhotoDetailsVC {
                     cancelAction: { [weak self]  in
                         guard let self = self else { return }
                         print("用户点击了Leave")
-                        
-                        if let model = infoModel{
-                            TSRMShared.aiListDB.deleteListModel(id: model.id)
-                            NotificationCenter.default.post(name: .kAIPhotoDataChanged, object: nil)
-                        }
-            
                         cancelDidmiss()
                     },
                     confirmAction: { [weak self]  in
@@ -128,6 +122,10 @@ class TSAIListPhotoGeneratorVC: TSAIPhotoDetailsVC {
                 cancelAction: { [weak self]  in
                     guard let self = self else { return }
                     print("用户点击了Leave")
+                    if let model = infoModel{
+                        TSRMShared.aiListDB.deleteListModel(id: model.id)
+                        NotificationCenter.default.post(name: .kAIPhotoDataChanged, object: nil)
+                    }
                     cancelDidmiss()
                 },
                 confirmAction: {
@@ -143,11 +141,11 @@ class TSAIListPhotoGeneratorVC: TSAIPhotoDetailsVC {
     }
     //重新生成
     @objc func clickRegenerateBtn(){
-        if generatorModel.generatorStyle == .creatVideo {
-            if kJudgeVip(externalBool: true, vc: self){ return } //判断 vip
-        }else{
+//        if generatorModel.generatorStyle == .creatVideo {
+//            if kJudgeVip(externalBool: true, vc: self){ return } //判断 vip
+//        }else{
             if kPurchaseBusiness.kJudgeVipFreeType(vipFreeNumType: .general){ return }//判断 vip
-        }
+//        }
         generatorOperation()
     }
 

+ 6 - 5
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIUploadPhotoVC.swift

@@ -113,7 +113,8 @@ class TSAIUploadPhotoVC: TSBaseVC {
     
     @objc func updateVipView() {
         kExecuteOnMainThread {
-            kSetBtnVipIcon(btn: self.submitBtn, show: self.generatorStyle == .creatVideo ? true: kPurchaseBusiness.generateVipShow(type: .general))
+//            kSetBtnVipIcon(btn: self.submitBtn, show: self.generatorStyle == .creatVideo ? true: kPurchaseBusiness.generateVipShow(type: .general))
+            kSetBtnVipIcon(btn: self.submitBtn, show: kPurchaseBusiness.generateVipShow(type: .general))
         }
     }
     
@@ -146,11 +147,11 @@ class TSAIUploadPhotoVC: TSBaseVC {
     
     func generateImage() {
         
-        if generatorStyle == .creatVideo {
-            if kJudgeVip(externalBool: true, vc: self){ return } //判断 vip
-        }else{
+//        if generatorStyle == .creatVideo {
+//            if kJudgeVip(externalBool: true, vc: self){ return } //判断 vip
+//        }else{
             if kPurchaseBusiness.kJudgeVipFreeType(vipFreeNumType: .general){ return }//判断 vip
-        }
+//        }
         
         guard let upLoadImage = upLoadImage else { return }
         let generatorModel = TSAIListPhotoGeneratorModel(upLoadImage: upLoadImage, generatorStyle: generatorStyle,additionalPrompt: additionalPrompt)

+ 135 - 0
TSLiveWallpaper/Business/TSMineVC/TSChangeLanguageVC/TSChangeLanguageVC.swift

@@ -0,0 +1,135 @@
+//
+//  TSChangeLanguageVC.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/10.
+//
+
+class TSChangeLanguageVC: TSBaseVC {
+    
+    lazy var simpleTableView: TSBaseTableView = {
+        let simpleTableView = TSBaseTableView()
+        simpleTableView.register(TSChangeLanguageCell.self, forCellReuseIdentifier: "TSChangeLanguageCell")
+        simpleTableView.delegate = self
+        simpleTableView.dataSource = self
+        return simpleTableView
+    }()
+    
+    var selectedIndex:Int = 0
+    lazy var dataArray:[LanguageManager.AppLanguage] = LanguageManager.AppLanguage.allCases
+
+    
+    override func createData() {
+        let currentLanguage = LanguageManager.shared.currentLanguage
+        for (i,language) in dataArray.enumerated() {
+            if language == currentLanguage {
+                selectedIndex = i
+                break
+            }
+        }
+    }
+    
+    override func createView() {
+        setPageTitle("Change Language".localized)
+        
+        _ = setNavigationItem("Save".localized, imageName: "", direction: .right, action: #selector(clickSave))
+        
+        contentView.addSubview(simpleTableView)
+        simpleTableView.snp.makeConstraints { make in
+            make.leading.equalTo(16)
+            make.trailing.equalTo(-16)
+            make.top.equalTo(16)
+            make.bottom.equalTo(0)
+        }
+    }
+ 
+    @objc func clickSave() {
+        LanguageManager.shared.currentLanguage = dataArray.safeObj(At: selectedIndex) ?? .en
+        TSRTLManage.setUpInit()
+        AppDelegate.shared?.goToTab()
+    }
+}
+extension TSChangeLanguageVC : UITableViewDataSource, UITableViewDelegate {
+    
+    public func numberOfSections(in tableView: UITableView) -> Int {
+        return 1
+    }
+    
+    public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return dataArray.count
+    }
+    
+    public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 64
+    }
+    
+    public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        if let cell = tableView.dequeueReusableCell(withIdentifier: "TSChangeLanguageCell") as? TSChangeLanguageCell{
+            if let language = dataArray.safeObj(At: indexPath.row){
+                cell.leftLab.text = language.displayName
+                cell.rightImageView.image = selectedIndex ==  indexPath.row ? .check : .unCheck
+            }
+            return cell
+        }
+        
+        return UITableViewCell()
+    }
+    
+    public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        selectedIndex = indexPath.row
+        simpleTableView.reloadData()
+    }
+}
+
+class TSChangeLanguageCell: UITableViewCell {
+    
+    open lazy var bgContentView:UIView = {
+        let view = UIView()
+        view.backgroundColor = .white.withAlphaComponent(0.1)
+        return view
+    }()
+    
+    public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        self.selectionStyle = .none
+        self.backgroundColor = .clear
+        self.addSubview(bgContentView)
+        bgContentView.snp.makeConstraints { make in
+            make.top.leading.trailing.bottom.equalTo(0)
+        }
+        creatUI()
+    }
+    
+    required public init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+
+    lazy var leftLab: UILabel = {
+        return UILabel.createLabel(font: .font(name:.ZillaSlab,size: 14),textColor: .white)
+    }()
+     
+
+    lazy var rightImageView: UIImageView = {
+        return UIImageView.createRightArrow()
+    }()
+    
+
+    func creatUI() {
+        bgContentView.addSubview(leftLab)
+        bgContentView.addSubview(rightImageView)
+
+        leftLab.snp.makeConstraints { make in
+            make.leading.equalTo(16)
+            make.centerY.equalToSuperview()
+        }
+    
+        rightImageView.snp.makeConstraints { make in
+            make.trailing.equalTo(-16)
+            make.centerY.equalToSuperview()
+            make.width.height.equalTo(16)
+        }
+        
+    }
+
+}

+ 11 - 1
TSLiveWallpaper/Business/TSMineVC/TSMineVM.swift

@@ -36,6 +36,16 @@ class TSMineVM {
 //                    }
 //                }))
 
+        
+        sectionModel.addSubItemModel(
+            createItemModel(
+                leftImage: .mineCellLanguage,
+                leftTitle: "Change Language".localized,
+                tapBlock: { [weak self] _, _, _ in
+                    guard let self = self else { return }
+                    kPushVC(target: self.target, modelVC: TSChangeLanguageVC())
+                }))
+        
         sectionModel.addSubItemModel(
             createItemModel(
                 leftImage: .mineCellShare,
@@ -46,7 +56,7 @@ class TSMineVM {
                     let httpAppStoreLink = "https://apps.apple.com/app/id\(appid)"
                     let text = ""
                     let url = URL(string: httpAppStoreLink)!
-                    let image = UIImage(named: "App-Icon")!
+                    let image:UIImage = .appIcon
                     let vc = UIActivityViewController(activityItems: [image, text, url], applicationActivities: nil)
                     vc.completionWithItemsHandler = { activity, _, _, _ in
                         if let type = activity, type == .copyToPasteboard {

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

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

+ 127 - 0
TSLiveWallpaper/Common/Tool/LanguageManager.swift

@@ -0,0 +1,127 @@
+//
+//  LanguageManager.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/10.
+//
+
+
+
+
+// 主工程中
+class MainLocalizationProvider: LocalizationProvider {
+    func localizedString(for key: String) -> String {
+        // 主工程自定义逻辑
+        return LanguageManager.shared.localizedString(for: key)
+    }
+
+    func isArabic() -> Bool {
+        return LanguageManager.shared.isArabic
+    }
+}
+
+
+class LanguageManager {
+    static let shared = LanguageManager()
+    
+    private let userDefaultsKey = "SelectedAppLanguage"
+    private var bundle: Bundle?
+    
+    // 支持的语言列表
+    enum AppLanguage: String, CaseIterable {
+        case en = "en"    // 英语
+//        case fr = "fr"    // 法语
+        case ja = "ja"    // 日语
+        case ar = "ar"    // 阿拉伯语
+        case zhHant = "zh-Hant" // 中文繁体
+        case es = "es"    // 西班牙
+        case ko = "ko"    // 韩语
+        
+        var displayName: String {
+            switch self {
+            case .en: return "🇬🇧 English"
+//            case .fr: return "Français"
+            case .ja: return "🇯🇵 日本語"
+            case .ar: return "🇸🇦 العربية"
+            case .zhHant: return "🇭🇰 繁體中文"
+            case .es: return "🇪🇸 Español"
+            case .ko: return "🇰🇷 한국어"
+            }
+        }
+    }
+    
+    var isArabic:Bool {
+        return self.currentLanguage == .ar
+    }
+    
+    // 当前语言
+    var currentLanguage: AppLanguage {
+        get {
+            // 先从用户选择中读取
+            if let savedLanguage = UserDefaults.standard.string(forKey: userDefaultsKey),
+               let language = AppLanguage(rawValue: savedLanguage) {
+                return language
+            }
+            
+            // 没有用户选择,则根据系统语言自动选择
+            return preferredLanguage(for: Locale.preferredLanguages.first)
+        }
+        set {
+            UserDefaults.standard.set(newValue.rawValue, forKey: userDefaultsKey)
+            setLanguage(newValue)
+        }
+    }
+    
+    // 初始化
+    private init() {
+        // 初始化时设置当前语言
+        setLanguage(currentLanguage)
+        LocalizationManager.sharedProvider = MainLocalizationProvider()
+    }
+    
+    // 根据系统语言选择最合适的应用语言
+    private func preferredLanguage(for systemLanguage: String?) -> AppLanguage {
+        guard let systemLanguage = systemLanguage else { return .en }
+        
+        // 处理中文情况
+        if systemLanguage.hasPrefix("zh-") {
+            if systemLanguage.contains("Hans") { // 简体中文
+                return .zhHant // 简体中文使用繁体中文显示
+            }
+            return .zhHant // 其他中文变体使用繁体中文
+        }
+        
+        // 检查是否支持系统语言
+        for language in AppLanguage.allCases {
+            if systemLanguage.hasPrefix(language.rawValue) {
+                return language
+            }
+        }
+        
+        // 默认英语
+        return .en
+    }
+    
+    // 设置语言并加载对应的语言包
+    private func setLanguage(_ language: AppLanguage) {
+        guard let path = Bundle.main.path(forResource: language.rawValue, ofType: "lproj") else {
+            bundle = nil
+            return
+        }
+        bundle = Bundle(path: path)
+        
+        // 发送语言变更通知
+        NotificationCenter.default.post(name: .languageChanged, object: nil)
+    }
+    
+    // 本地化字符串方法
+    func localizedString(for key: String, value: String? = nil) -> String {
+        let value = value ?? key
+        return bundle?.localizedString(forKey: key, value: value, table: nil) ?? Bundle.main.localizedString(forKey: key, value: value, table: nil)
+    }
+}
+
+// 语言变更通知
+extension Notification.Name {
+    static let languageChanged = Notification.Name("LanguageChangedNotification")
+}