Explorar el Código

Merge branch 'master' of http://hubgit.cn/zhouzhenshuai/TSLiveWallpaper

100Years hace 2 meses
padre
commit
acc0659461
Se han modificado 42 ficheros con 697 adiciones y 418 borrados
  1. 8 4
      TSLiveWallpaper.xcodeproj/project.pbxproj
  2. 14 1
      TSLiveWallpaper/AppDelegate.swift
  3. 3 2
      TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/Contents.json
  4. BIN
      TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/top_diy@1x.png
  5. BIN
      TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/top_diy@2x.png
  6. BIN
      TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/top_diy@3x.png
  7. 23 0
      TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/Contents.json
  8. BIN
      TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/top_shuffle@1x.png
  9. BIN
      TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/top_shuffle@2x.png
  10. BIN
      TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/top_shuffle@3x.png
  11. 26 0
      TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/Contents.json
  12. BIN
      TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@1x.png
  13. BIN
      TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@2x.png
  14. BIN
      TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@3x.png
  15. 23 0
      TSLiveWallpaper/Assets.xcassets/Music/ic_nav_playlist.imageset/Contents.json
  16. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_nav_playlist.imageset/ic_nav_playlist@1x.png
  17. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_nav_playlist.imageset/ic_nav_playlist@2x.png
  18. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_nav_playlist.imageset/ic_nav_playlist@3x.png
  19. 26 0
      TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_select_playlist.imageset/Contents.json
  20. BIN
      TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_select_playlist.imageset/tabbar_select_playlist@1x.png
  21. BIN
      TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_select_playlist.imageset/tabbar_select_playlist@2x.png
  22. BIN
      TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_select_playlist.imageset/tabbar_select_playlist@3x.png
  23. 26 0
      TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_unselect_playlist.imageset/Contents.json
  24. BIN
      TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_unselect_playlist.imageset/tabbar_unselect_playlist@1x.png
  25. BIN
      TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_unselect_playlist.imageset/tabbar_unselect_playlist@2x.png
  26. BIN
      TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_unselect_playlist.imageset/tabbar_unselect_playlist@3x.png
  27. 23 0
      TSLiveWallpaper/Assets.xcassets/Vip/Dmanager_pro.imageset/Contents.json
  28. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Dmanager_pro.imageset/Dmanager_pro@1x.png
  29. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Dmanager_pro.imageset/Dmanager_pro@2x.png
  30. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Dmanager_pro.imageset/Dmanager_pro@3x.png
  31. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/dmanagepro.imageset/Dmanagepro@2x.png
  32. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/dmanagepro.imageset/Dmanagepro@3x.png
  33. 37 6
      TSLiveWallpaper/Business/TSHomeVC/TSHomeVC.swift
  34. 135 126
      TSLiveWallpaper/Business/TSMineVC/TSMineVC.swift
  35. 0 262
      TSLiveWallpaper/Business/TSMusic/List/Controller/MusicContainerViewController.swift
  36. 157 0
      TSLiveWallpaper/Business/TSMusic/List/Controller/MusicHomeContainerViewController.swift
  37. 162 0
      TSLiveWallpaper/Business/TSMusic/List/Controller/MusicPlaylistContainerViewController.swift
  38. 1 1
      TSLiveWallpaper/Business/TSPurchaseMembershipVC/TSPurchaseMembershipVC.swift
  39. 2 1
      TSLiveWallpaper/Business/TSPurchaseMembershipVC/TSPurchaseVC.swift
  40. 27 12
      TSLiveWallpaper/Business/TSRandomWallpaperVC/TSRandomWallpaperVC.swift
  41. 3 3
      TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift
  42. 1 0
      TSLiveWallpaper/LaunchVC/TSLaunchVC.swift

+ 8 - 4
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -108,7 +108,8 @@
 		606372E12D54BC37005C82CF /* GoogleMobileAdsConsentManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372E02D54BC37005C82CF /* GoogleMobileAdsConsentManager.swift */; };
 		606372E32D55A995005C82CF /* ADLoadingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372E22D55A995005C82CF /* ADLoadingViewController.swift */; };
 		606372E52D55BAB8005C82CF /* GuideBubbleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372E42D55BAB8005C82CF /* GuideBubbleView.swift */; };
-		60F82C0F2D43295100FFB08D /* MusicContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60F82C0E2D43295100FFB08D /* MusicContainerViewController.swift */; };
+		606372E72D5705F4005C82CF /* MusicPlaylistContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372E62D5705F4005C82CF /* MusicPlaylistContainerViewController.swift */; };
+		60F82C0F2D43295100FFB08D /* MusicHomeContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60F82C0E2D43295100FFB08D /* MusicHomeContainerViewController.swift */; };
 		60F82C112D43298800FFB08D /* MusicContainerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60F82C102D43298800FFB08D /* MusicContainerViewModel.swift */; };
 		A81CA4652D15685F00A3AAC8 /* TSLaunchVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA4642D15685D00A3AAC8 /* TSLaunchVC.swift */; };
 		A81CA4692D156AB600A3AAC8 /* TSBaseVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA4682D156AAB00A3AAC8 /* TSBaseVC.swift */; };
@@ -315,7 +316,8 @@
 		606372E02D54BC37005C82CF /* GoogleMobileAdsConsentManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleMobileAdsConsentManager.swift; sourceTree = "<group>"; };
 		606372E22D55A995005C82CF /* ADLoadingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ADLoadingViewController.swift; sourceTree = "<group>"; };
 		606372E42D55BAB8005C82CF /* GuideBubbleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuideBubbleView.swift; sourceTree = "<group>"; };
-		60F82C0E2D43295100FFB08D /* MusicContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicContainerViewController.swift; sourceTree = "<group>"; };
+		606372E62D5705F4005C82CF /* MusicPlaylistContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicPlaylistContainerViewController.swift; sourceTree = "<group>"; };
+		60F82C0E2D43295100FFB08D /* MusicHomeContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicHomeContainerViewController.swift; sourceTree = "<group>"; };
 		60F82C102D43298800FFB08D /* MusicContainerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicContainerViewModel.swift; sourceTree = "<group>"; };
 		71E5F623537702A8306DF3C8 /* Pods-TSLiveWallpaper.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TSLiveWallpaper.release.xcconfig"; path = "Target Support Files/Pods-TSLiveWallpaper/Pods-TSLiveWallpaper.release.xcconfig"; sourceTree = "<group>"; };
 		A81CA4642D15685D00A3AAC8 /* TSLaunchVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLaunchVC.swift; sourceTree = "<group>"; };
@@ -691,7 +693,8 @@
 				60553F5E2D3B528A00BAAD7F /* SongListViewController.swift */,
 				60553FE22D3DF12200BAAD7F /* CustomSegementItem.swift */,
 				60553F5F2D3B528A00BAAD7F /* SongListViewController+Target.swift */,
-				60F82C0E2D43295100FFB08D /* MusicContainerViewController.swift */,
+				60F82C0E2D43295100FFB08D /* MusicHomeContainerViewController.swift */,
+				606372E62D5705F4005C82CF /* MusicPlaylistContainerViewController.swift */,
 			);
 			path = Controller;
 			sourceTree = "<group>";
@@ -1412,6 +1415,7 @@
 				60553FDD2D3B84E700BAAD7F /* UIScrollView+Ext.swift in Sources */,
 				A81CA4792D1577E800A3AAC8 /* NSString+Ex.swift in Sources */,
 				A81CA4852D1582A600A3AAC8 /* UIButton+Ex.swift in Sources */,
+				606372E72D5705F4005C82CF /* MusicPlaylistContainerViewController.swift in Sources */,
 				A81CA46B2D156BDC00A3AAC8 /* TSBaseNavigationC.swift in Sources */,
 				A81CA47F2D15789C00A3AAC8 /* TSConfig.swift in Sources */,
 				A81CA49F2D1655CE00A3AAC8 /* UICollectionView+Ex.swift in Sources */,
@@ -1470,7 +1474,7 @@
 				60553F972D3B528A00BAAD7F /* PlayDetailPlaceHolderView.swift in Sources */,
 				60553F982D3B528A00BAAD7F /* SJIJKMediaPlaybackController.m in Sources */,
 				60553F992D3B528A00BAAD7F /* FilterBarViewModel.swift in Sources */,
-				60F82C0F2D43295100FFB08D /* MusicContainerViewController.swift in Sources */,
+				60F82C0F2D43295100FFB08D /* MusicHomeContainerViewController.swift in Sources */,
 				60553F9A2D3B528A00BAAD7F /* PlayListManageView.swift in Sources */,
 				606372DF2D54BBB5005C82CF /* AppConfig.swift in Sources */,
 				60553F9B2D3B528A00BAAD7F /* LWSearchBar.swift in Sources */,

+ 14 - 1
TSLiveWallpaper/AppDelegate.swift

@@ -5,11 +5,12 @@
 //  Created by 100Years on 2024/12/19.i
 //
 
+import ADManager
 import AppTrackingTransparency
 import GoogleMobileAds
+import StoreKit
 import TSVideoKit
 import UIKit
-import ADManager
 
 @main
 class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -21,6 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         window?.makeKeyAndVisible()
         goToLoadVC()
         initBaseDatas()
+        downloadNotifaction()
         return true
     }
 
@@ -52,6 +54,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         }
     }
 
+    @objc func recordData() {
+        if UserDefaults.standard.value(forKey: "CachedTag") == nil {
+            UserDefaults.standard.setValue("1", forKey: "CachedTag")
+            SKStoreReviewController.requestReview()
+        }
+    }
+
+    func downloadNotifaction() {
+        NotificationCenter.default.addObserver(self, selector: #selector(recordData), name: kGroupDownloadFinishNotifactionName, object: nil)
+    }
+
     static func requestAdTrack() {
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
             ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in

+ 3 - 2
TSLiveWallpaper/Assets.xcassets/Vip/dmanagepro.imageset/Contents.json → TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/Contents.json

@@ -1,16 +1,17 @@
 {
   "images" : [
     {
+      "filename" : "top_diy@1x.png",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
-      "filename" : "Dmanagepro@2x.png",
+      "filename" : "top_diy@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "Dmanagepro@3x.png",
+      "filename" : "top_diy@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
TSLiveWallpaper/Assets.xcassets/Common/top_diy.imageset/top_diy@1x.png


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


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


+ 23 - 0
TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/Contents.json

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

BIN
TSLiveWallpaper/Assets.xcassets/Common/top_shuffle.imageset/top_shuffle@1x.png


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


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


+ 26 - 0
TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "filename" : "WallpaperBg@1x.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "WallpaperBg@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "WallpaperBg@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Music/WallpaperBg.imageset/WallpaperBg@3x.png


+ 23 - 0
TSLiveWallpaper/Assets.xcassets/Music/ic_nav_playlist.imageset/Contents.json

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

BIN
TSLiveWallpaper/Assets.xcassets/Music/ic_nav_playlist.imageset/ic_nav_playlist@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Music/ic_nav_playlist.imageset/ic_nav_playlist@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Music/ic_nav_playlist.imageset/ic_nav_playlist@3x.png


+ 26 - 0
TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_select_playlist.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "filename" : "tabbar_select_playlist@1x.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "tabbar_select_playlist@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "tabbar_select_playlist@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_select_playlist.imageset/tabbar_select_playlist@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_select_playlist.imageset/tabbar_select_playlist@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_select_playlist.imageset/tabbar_select_playlist@3x.png


+ 26 - 0
TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_unselect_playlist.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "filename" : "tabbar_unselect_playlist@1x.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "tabbar_unselect_playlist@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "tabbar_unselect_playlist@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  },
+  "properties" : {
+    "template-rendering-intent" : "original"
+  }
+}

BIN
TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_unselect_playlist.imageset/tabbar_unselect_playlist@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_unselect_playlist.imageset/tabbar_unselect_playlist@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Tabbar/tabbar_unselect_playlist.imageset/tabbar_unselect_playlist@3x.png


+ 23 - 0
TSLiveWallpaper/Assets.xcassets/Vip/Dmanager_pro.imageset/Contents.json

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

BIN
TSLiveWallpaper/Assets.xcassets/Vip/Dmanager_pro.imageset/Dmanager_pro@1x.png


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


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


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


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


+ 37 - 6
TSLiveWallpaper/Business/TSHomeVC/TSHomeVC.swift

@@ -24,13 +24,33 @@ class TSHomeVC: TSBaseVC {
         return navBarView
     }()
 
+    lazy var hStack: UIStackView = {
+        let stack = UIStackView()
+        stack.axis = .horizontal
+        stack.distribution = .fillEqually
+        stack.spacing = 16
+        return stack
+    }()
+
     lazy var diyButton: SpacedButton = {
         let btn = SpacedButton()
-        btn.setTitle("DIY Live Wallpaper", for: .normal)
-        btn.setTitleColor(.black, for: .normal)
-        btn.setImage(UIImage(named: "ic_diy_wallpaper"), for: .normal)
-        btn.setBackgroundImage(UIImage(named: "ic_gen_button"), for: .normal)
+        btn.setTitle("DIY Live Photo", for: .normal)
+        btn.setTitleColor(.white, for: .normal)
+        btn.setImage(UIImage(named: "top_diy"), for: .normal)
+        btn.setBackgroundImage(UIImage(named: "WallpaperBg"), for: .normal)
         btn.addTarget(self, action: #selector(showDiyPaperController), for: .touchUpInside)
+        btn.titleLabel?.font = .systemFont14
+        return btn
+    }()
+
+    lazy var shuffleButton: SpacedButton = {
+        let btn = SpacedButton()
+        btn.setTitle("Shuffle Packs", for: .normal)
+        btn.setTitleColor(.white, for: .normal)
+        btn.setImage(UIImage(named: "top_shuffle"), for: .normal)
+        btn.setBackgroundImage(UIImage(named: "WallpaperBg"), for: .normal)
+        btn.addTarget(self, action: #selector(showRandomWallpaperVC), for: .touchUpInside)
+        btn.titleLabel?.font = .systemFont14
         return btn
     }()
 
@@ -63,8 +83,10 @@ class TSHomeVC: TSBaseVC {
             make.edges.equalToSuperview()
         }
 
-        contentView.addSubview(diyButton)
-        diyButton.snp.makeConstraints { make in
+        hStack.addArrangedSubview(diyButton)
+        hStack.addArrangedSubview(shuffleButton)
+        contentView.addSubview(hStack)
+        hStack.snp.makeConstraints { make in
             make.horizontalEdges.equalToSuperview().inset(16)
             make.top.equalToSuperview().offset(16)
             make.height.equalTo(60)
@@ -90,4 +112,13 @@ class TSHomeVC: TSBaseVC {
         vc.modalPresentationStyle = .overFullScreen
         present(vc, animated: true)
     }
+    
+    @objc func showRandomWallpaperVC() {
+        let vc = TSRandomWallpaperVC()
+        let nav = TSBaseNavigationC(rootViewController: vc)
+        nav.modalPresentationStyle = .overFullScreen
+        present(nav, animated: true)
+    }
+    
+    
 }

+ 135 - 126
TSLiveWallpaper/Business/TSMineVC/TSMineVC.swift

@@ -6,11 +6,10 @@
 //
 
 class TSMineVC: TSBaseVC {
-
     lazy var navBarView: TSBaseNavContentBarView = {
         let navBarView = TSBaseNavContentBarView()
-        let titleImageView = UIImageView.createImageView(imageName: "nav_title_setting",contentMode: .scaleToFill)
-        
+        let titleImageView = UIImageView.createImageView(imageName: "nav_title_setting", contentMode: .scaleToFill)
+
         navBarView.barView.addSubview(titleImageView)
         titleImageView.snp.makeConstraints { make in
             make.centerY.equalToSuperview()
@@ -18,25 +17,22 @@ class TSMineVC: TSBaseVC {
         }
         return navBarView
     }()
-    
-    
-    
+
     lazy var vipBgImageView: UIImageView = {
-        let vipBgImageView = UIImageView.createImageView(imageName: "noVip_big_bg",contentMode:.scaleToFill)
+        let vipBgImageView = UIImageView.createImageView(imageName: "noVip_big_bg", contentMode: .scaleToFill)
         vipBgImageView.isUserInteractionEnabled = true
         return vipBgImageView
     }()
-    
-    
+
     lazy var vipTimeLabel: UILabel = {
-        let vipTimeLabel = UILabel.createLabel(text: "Limited Time Discount",font: .font(size: 14),textColor: .lesserText)
+        let vipTimeLabel = UILabel.createLabel(text: "Limited Time Discount", font: .font(size: 14), textColor: .lesserText)
         return vipTimeLabel
     }()
-    
+
     lazy var upgradeBtn: UIButton = {
-        let upgradeBtn = TSViewTool.createNormalSubmitBtn(title: "Upgrade".localized) { [weak self]  in
+        let upgradeBtn = TSViewTool.createNormalSubmitBtn(title: "Upgrade".localized) { [weak self] in
             guard let self = self else { return }
-            TSPurchaseVC.show(target: self) {[weak self]  in
+            TSPurchaseVC.show(target: self) { [weak self] in
                 guard let self = self else { return }
                 updateVipView()
             }
@@ -45,7 +41,7 @@ class TSMineVC: TSBaseVC {
         upgradeBtn.titleLabel?.font = .font(size: 14)
         return upgradeBtn
     }()
-    
+
     lazy var headerView: UIView = {
         let headerView = UIView()
         headerView.frame = CGRect(x: 0, y: 0, width: k_ScreenWidth, height: 88)
@@ -54,21 +50,21 @@ class TSMineVC: TSBaseVC {
             make.top.equalTo(0)
             make.leading.trailing.bottom.equalTo(0)
         }
-        
-        let liveImageView = UIImageView.createImageView(imageName: "dmanagepro")
+
+        let liveImageView = UIImageView.createImageView(imageName: "Dmanager_pro")
         vipBgImageView.addSubview(liveImageView)
         liveImageView.snp.makeConstraints { make in
             make.leading.equalTo(16)
             make.top.equalTo(19)
         }
-        
+
         vipBgImageView.addSubview(vipTimeLabel)
         vipTimeLabel.snp.makeConstraints { make in
             make.leading.equalTo(16)
             make.bottom.equalTo(-19)
             make.height.equalTo(14.0)
         }
-        
+
         vipBgImageView.addSubview(upgradeBtn)
         upgradeBtn.snp.makeConstraints { make in
             make.width.equalTo(86)
@@ -76,140 +72,153 @@ class TSMineVC: TSBaseVC {
             make.trailing.equalTo(-29)
             make.centerY.equalToSuperview()
         }
-        
 
         return headerView
     }()
-    
-    
-    lazy var simpleTableView:TSSimpleTableView = {
+
+    lazy var simpleTableView: TSSimpleTableView = {
         let simpleTableView = TSSimpleTableView()
         simpleTableView.reuseClass = ["TSMineCell"]
         simpleTableView.dataArray = dataArray
         simpleTableView.tableView.tableHeaderView = headerView
         return simpleTableView
     }()
-    
-    
-    lazy var dataArray:[TSBasicSectionModel] = {
+
+    lazy var dataArray: [TSBasicSectionModel] = {
         var dataArray = [TSBasicSectionModel]()
         let sectionModel = TSBasicSectionModel()
         dataArray.append(sectionModel)
-        
+
         sectionModel.addSubItemModel(
             TSBasicItemModel.createItemModel(
-            leftTitle: "Rate us".localized,
-            rightViewStyle: 0,
-            rightString: "",
-            rightIsHave: true,
-            height: 80,
-            rectCorner:.allCorners,
-            tapBlock: {[weak self] itemModel, index, view  in
-                
-                guard let self = self else { return }
-                let appStoreLink = "itms-apps://itunes.apple.com/app/id\(TSConfig.appid)"
-                if let url = URL(string: appStoreLink + "?action=write-review"),
-                   UIApplication.shared.canOpenURL(url) {
-                    UIApplication.shared.open(url)
-                }
-            }))
-        
+                leftTitle: "Update".localized,
+                rightViewStyle: 0,
+                rightString: "",
+                rightIsHave: true,
+                height: 80,
+                rectCorner: .allCorners,
+                tapBlock: { [weak self] _, _, _ in
+                    let httpAppStoreLink = "https://apps.apple.com/app/id\(TSConfig.appid)"
+                    guard let appStoreURL = URL(string: httpAppStoreLink) else { return }
+
+                    if UIApplication.shared.canOpenURL(appStoreURL) {
+                        UIApplication.shared.open(appStoreURL, options: [:], completionHandler: nil)
+                    }
+                }))
+
         sectionModel.addSubItemModel(
             TSBasicItemModel.createItemModel(
-            leftTitle: "Share us".localized,
-            rightViewStyle: 0,
-            rightString: "",
-            rightIsHave: true,
-            height: 80,
-            rectCorner:.allCorners,
-            tapBlock: {[weak self] itemModel, index, view  in
-                guard let self = self else { return }
+                leftTitle: "Rate us".localized,
+                rightViewStyle: 0,
+                rightString: "",
+                rightIsHave: true,
+                height: 80,
+                rectCorner: .allCorners,
+                tapBlock: { [weak self] _, _, _ in
+
+                    guard let self = self else { return }
+                    let appStoreLink = "itms-apps://itunes.apple.com/app/id\(TSConfig.appid)"
+                    if let url = URL(string: appStoreLink + "?action=write-review"),
+                       UIApplication.shared.canOpenURL(url) {
+                        UIApplication.shared.open(url)
+                    }
+                }))
+
+        sectionModel.addSubItemModel(
+            TSBasicItemModel.createItemModel(
+                leftTitle: "Share us".localized,
+                rightViewStyle: 0,
+                rightString: "",
+                rightIsHave: true,
+                height: 80,
+                rectCorner: .allCorners,
+                tapBlock: { [weak self] _, _, _ in
+                    guard let self = self else { return }
 
-                let httpAppStoreLink = "https://apps.apple.com/app/id\(TSConfig.appid)"
-                let text = ""
-                let url = URL(string: httpAppStoreLink)!
-                let image = UIImage(named: "App-Icon")!
-                let vc = UIActivityViewController(activityItems: [image, text, url], applicationActivities: nil)
-                vc.completionWithItemsHandler = { activity, value, _, error in
-                    if let type = activity, type == .copyToPasteboard {
-                        UIPasteboard.general.string = httpAppStoreLink
+                    let httpAppStoreLink = "https://apps.apple.com/app/id\(TSConfig.appid)"
+                    let text = ""
+                    let url = URL(string: httpAppStoreLink)!
+                    let image = UIImage(named: "App-Icon")!
+                    let vc = UIActivityViewController(activityItems: [image, text, url], applicationActivities: nil)
+                    vc.completionWithItemsHandler = { activity, _, _, _ in
+                        if let type = activity, type == .copyToPasteboard {
+                            UIPasteboard.general.string = httpAppStoreLink
+                        }
                     }
-                }
-            
-                if UIDevice.isPad {
-                    if let popover = vc.popoverPresentationController {
-                        popover.sourceView = self.view // 设置锚点视图
-                        popover.sourceRect = CGRect(x: self.view.bounds.midX, y: self.view.bounds.midY, width: 0, height: 0) // 设置弹窗位置为屏幕中心
-                        popover.permittedArrowDirections = [] // 禁止箭头指向
+
+                    if UIDevice.isPad {
+                        if let popover = vc.popoverPresentationController {
+                            popover.sourceView = self.view // 设置锚点视图
+                            popover.sourceRect = CGRect(x: self.view.bounds.midX, y: self.view.bounds.midY, width: 0, height: 0) // 设置弹窗位置为屏幕中心
+                            popover.permittedArrowDirections = [] // 禁止箭头指向
+                        }
                     }
-                }
-                
-                self.present(vc, animated: true)
-                
-            }))
-        
+
+                    self.present(vc, animated: true)
+
+                }))
+
         sectionModel.addSubItemModel(
             TSBasicItemModel.createItemModel(
-            leftTitle: "Privacy Policy".localized,
-            rightViewStyle: 0,
-            rightString: "",
-            rightIsHave: true,
-            height: 80,
-            rectCorner:.allCorners,
-            tapBlock: {[weak self] itemModel, index, view  in
-                guard let self = self else { return }
-                let vc = TSBusinessWebVC(urlType: .privacy)
-                vc.hidesBottomBarWhenPushed = true
-                navigationController?.pushViewController(vc, animated: true)
-            }))
-        
+                leftTitle: "Privacy Policy".localized,
+                rightViewStyle: 0,
+                rightString: "",
+                rightIsHave: true,
+                height: 80,
+                rectCorner: .allCorners,
+                tapBlock: { [weak self] _, _, _ in
+                    guard let self = self else { return }
+                    let vc = TSBusinessWebVC(urlType: .privacy)
+                    vc.hidesBottomBarWhenPushed = true
+                    navigationController?.pushViewController(vc, animated: true)
+                }))
+
         sectionModel.addSubItemModel(
             TSBasicItemModel.createItemModel(
-            leftTitle: "Terms of Service".localized,
-            rightViewStyle: 0,
-            rightString: "",
-            rightIsHave: true,
-            height: 80,
-            rectCorner:.allCorners,
-            tapBlock: {[weak self] itemModel, index, view  in
-                guard let self = self else { return }
-                let vc = TSBusinessWebVC(urlType: .terms)
-                vc.hidesBottomBarWhenPushed = true
-                navigationController?.pushViewController(vc, animated: true)
-            }))
-        
+                leftTitle: "Terms of Service".localized,
+                rightViewStyle: 0,
+                rightString: "",
+                rightIsHave: true,
+                height: 80,
+                rectCorner: .allCorners,
+                tapBlock: { [weak self] _, _, _ in
+                    guard let self = self else { return }
+                    let vc = TSBusinessWebVC(urlType: .terms)
+                    vc.hidesBottomBarWhenPushed = true
+                    navigationController?.pushViewController(vc, animated: true)
+                }))
+
         sectionModel.addSubItemModel(
             TSBasicItemModel.createItemModel(
-            leftTitle: "About us".localized,
-            rightViewStyle: 0,
-            rightString: appVersion(),
-            rightIsHave: false,
-            height: 80,
-            rectCorner:.allCorners,
-            tapBlock: {[weak self] itemModel, index, view  in
-                guard let self = self else { return }
+                leftTitle: "About us".localized,
+                rightViewStyle: 0,
+                rightString: appVersion(),
+                rightIsHave: false,
+                height: 80,
+                rectCorner: .allCorners,
+                tapBlock: { [weak self] _, _, _ in
+                    guard let self = self else { return }
+
+                    #if DEBUG
+                        let vc = TSPurchaseVC()
+                        vc.hidesBottomBarWhenPushed = true
+                        kPresentModalVC(target: self, modelVC: vc)
+                    #endif
+
+                }))
 
-#if DEBUG
-                let vc = TSPurchaseVC()
-                vc.hidesBottomBarWhenPushed = true
-                kPresentModalVC(target: self, modelVC: vc)
-#endif
-                
-            }))
-        
         return dataArray
-        
+
     }()
-    
+
     override func createView() {
-        
         setViewBgImageNamed(named: "view_main_bg")
-        
+
         navBarContentView.addSubview(navBarView)
         navBarView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
-        
+
         contentView.addSubview(simpleTableView.tableView)
         simpleTableView.tableView.snp.makeConstraints { make in
             make.leading.equalTo(16)
@@ -218,22 +227,22 @@ class TSMineVC: TSBaseVC {
             make.bottom.equalTo(0)
         }
     }
-    
+
     override func viewWillAppear(_ animated: Bool) {
         updateVipView()
     }
-    
-    func updateVipView(){
+
+    func updateVipView() {
         vipTimeLabel.text = PurchaseManager.default.expiredDateString
-        vipBgImageView.image =  UIImage(named: PurchaseManager.default.isVip ? "vip_big_bg" : "noVip_big_bg")
-        
+        vipBgImageView.image = UIImage(named: PurchaseManager.default.isVip ? "vip_big_bg" : "noVip_big_bg")
+
         if PurchaseManager.default.isVip {
             vipTimeLabel.text = "Due Date: \(PurchaseManager.default.expiredDateString)"
-            vipBgImageView.image =  UIImage(named: "vip_big_bg")
+            vipBgImageView.image = UIImage(named: "vip_big_bg")
             upgradeBtn.isHidden = true
-        }else{
+        } else {
             vipTimeLabel.text = "Limited Time Discount"
-            vipBgImageView.image =  UIImage(named:"noVip_big_bg")
+            vipBgImageView.image = UIImage(named: "noVip_big_bg")
             upgradeBtn.isHidden = false
         }
     }

+ 0 - 262
TSLiveWallpaper/Business/TSMusic/List/Controller/MusicContainerViewController.swift

@@ -1,262 +0,0 @@
-//
-//  MusicContainerViewController.swift
-//  DiaryWallPaper
-//
-//  Created by 倪锴伦 on 2025/1/20.
-//
-
-import BetterSegmentedControl
-import Foundation
-import TSVideoKit
-import ADManager
-
-class MusicContainerViewController: LWBGViewController {
-    lazy var navBar: LWRightNavigationBar = LWRightNavigationBar()
-    lazy var searchBar: MusicSearchBar = MusicSearchBar()
-    weak var importMenuView: BubbleMenuView?
-
-    lazy var importButton: UIButton = {
-        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
-        bt.setImage(.icNavImport, for: .normal)
-        return bt
-    }()
-
-    lazy var pageControl: BetterSegmentedControl = {
-        let tracks = CustomSegementItem(text: "Tracks",
-                                        normalBackgroundColor: .clear,
-                                        normalFont: .systemFont14,
-                                        normalTextColor: .white,
-                                        selectedBackgroundColor: .hexColor("#111111"),
-                                        selectedFont: .boldSystemFont14,
-                                        selectedTextColor: .black)
-        let catalog = CustomSegementItem(text: "Playlist",
-                                         normalBackgroundColor: .clear,
-                                         normalFont: .systemFont14,
-                                         normalTextColor: .white,
-                                         selectedBackgroundColor: .hexColor("#111111"),
-                                         selectedFont: .boldSystemFont14,
-                                         selectedTextColor: .black)
-        let page = BetterSegmentedControl(frame: CGRect(x: 0, y: 0, width: 200, height: 30), segments: [tracks, catalog])
-        page.animationDuration = 0
-        page.indicatorViewBackgroundColor = .clear
-        page.backgroundColor = .white.withAlphaComponent(0.1)
-        page.layer.cornerRadius = 6
-        page.addTarget(self, action: #selector(changeSegement(sender:)), for: .valueChanged)
-        return page
-    }()
-
-    lazy var songlistVc: SongListViewController = SongListViewController()
-    lazy var playlistVc: PlaylistViewController = PlaylistViewController()
-
-    var viewModel: MusicContainerViewModel = MusicContainerViewModel()
-
-    var childVcs: [LWBaseViewController] {
-        [songlistVc, playlistVc]
-    }
-    
-    
-    lazy var guideBubble: GuideBubbleView = {
-        let guide = GuideBubbleView()
-        guide.addTarget(self, action: #selector(dismissGuideBubble), for: .touchUpInside)
-        guide.tapArea.addTarget(self, action: #selector(bubbleClick), for: .touchUpInside)
-        return guide
-    }()
-
-    // 添加 PageViewController
-    private lazy var pageViewController: UIPageViewController = {
-        let pageVC = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: nil)
-        pageVC.dataSource = self
-        pageVC.delegate = self
-        return pageVC
-    }()
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        bgImageView.image = .viewMainBg
-        addTargets()
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-//        topSegementBar.$type.receive(on: DispatchQueue.main).sink { [weak self] type in
-//            self?.handleTypeChange(type)
-//        }.store(in: &cancellable)
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        PlayerManager.shared.rootVc?.moveUpMiniBar()
-    }
-    
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-        print("TSConfiguration.isYs ===", TSConfiguration.isYs)
-        if UserDefaults.standard.string(forKey: "GuideKey") == nil, TSConfiguration.isYs {
-            view.addSubview(guideBubble)
-            view.bringSubviewToFront(guideBubble)
-            guideBubble.snp.makeConstraints { make in
-                make.edges.equalToSuperview()
-            }
-        }
-    }
-
-    func addTargets() {
-        searchBar.addTarget(self, action: #selector(showSearchViewController), for: .touchUpInside)
-        importButton.addTarget(self, action: #selector(showImportMenuView), for: .touchUpInside)
-    }
-
-    @objc func changeSegement(sender: BetterSegmentedControl) {
-        let index: Int = sender.index
-        // 获取当前可见的视图控制器
-        guard let currentViewController = pageViewController.viewControllers?.first else { return }
-        // 计算方向
-        let direction: UIPageViewController.NavigationDirection
-        if childVcs.firstIndex(of: currentViewController as! LWBaseViewController) ?? -1 < index {
-            direction = .forward // 从左向右
-        } else {
-            direction = .reverse // 从右向左
-        }
-        // 切换到目标视图控制器
-        let targetViewController = childVcs[index]
-        pageViewController.setViewControllers([targetViewController], direction: direction, animated: true, completion: nil)
-
-        songlistVc.filterVc.viewModel?.doneMutiSelect()
-    }
-
-    @objc func showImportMenuView() {
-        let menuView = BubbleMenuView()
-        menuView.position = FitManager.isAr ? .topLeft : .topRight
-        menuView.actionHanlder = { type in
-            self.menuClick(type: type)
-        }
-        view.addSubview(menuView)
-        menuView.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.top.equalTo(self.importButton.snp.bottom).offset(0)
-        }
-        importMenuView = menuView
-    }
-
-    func menuClick(type: ImportSource) {
-        importMenuView?.removeFromSuperview()
-        if type == .library {
-            ImportFilesManager.shared.openPhotoLibrary(parent: self)
-        } else if type == .file {
-            ImportFilesManager.shared.openFileDocument(parent: self, completion: nil)
-        }
-    }
-    
-    @objc func bubbleClick() {
-        showSearchViewController()
-        dismissGuideBubble()
-    }
-
-    @objc func dismissGuideBubble() {
-        guideBubble.isHidden = true
-        UserDefaults.standard.setValue("Guide", forKey: "GuideKey")
-    }
-
-    @objc func showSearchViewController() {
-        if PurchaseManager.default.isVip {
-            if TSConfiguration.isYs {
-                let vc = SearchOnlineViewController()
-                vc.hidesBottomBarWhenPushed = true
-                navigationController?.pushViewController(vc, animated: true)
-            } else {
-                let vc = LocalSearchViewController()
-                vc.hidesBottomBarWhenPushed = true
-                navigationController?.pushViewController(vc, animated: true)
-            }
-        } else {
-            ADManager.shared.showAd(scene: ADScene.searchInsert, from: self) { state in
-                if state == .finished || state == .fail {
-                    if TSConfiguration.isYs {
-                        let vc = SearchOnlineViewController()
-                        vc.hidesBottomBarWhenPushed = true
-                        self.navigationController?.pushViewController(vc, animated: true)
-                    } else {
-                        let vc = LocalSearchViewController()
-                        vc.hidesBottomBarWhenPushed = true
-                        self.navigationController?.pushViewController(vc, animated: true)
-                    }
-                }
-            }
-        }
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        view.addSubview(navBar)
-        navBar.appendRightItem(item: importButton)
-        view.addSubview(searchBar)
-        view.addSubview(pageControl)
-        addChild(pageViewController)
-        view.addSubview(pageViewController.view)
-        pageViewController.didMove(toParent: self)
-
-        if let firstViewController = childVcs.first {
-            pageViewController.setViewControllers([firstViewController], direction: .forward, animated: false, completion: nil)
-        }
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        navBar.snp.makeConstraints { make in
-            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
-            make.horizontalEdges.equalToSuperview()
-            make.height.equalTo(k_Height_NavBar)
-        }
-        searchBar.snp.makeConstraints { make in
-            make.top.equalTo(navBar.snp.bottom)
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.height.equalTo(44)
-        }
-
-        pageControl.snp.makeConstraints { make in
-            make.width.equalTo(260)
-            make.centerX.equalToSuperview()
-            make.top.equalTo(searchBar.snp.bottom).offset(20)
-            make.height.equalTo(32)
-        }
-
-        pageViewController.view.snp.makeConstraints { make in
-            make.top.equalTo(pageControl.snp.bottom).offset(16)
-            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
-            make.left.right.equalToSuperview()
-        }
-    }
-}
-
-// MARK: - UIPageViewControllerDataSource & Delegate
-
-extension MusicContainerViewController: UIPageViewControllerDataSource, UIPageViewControllerDelegate {
-    // 返回当前页面之前的视图控制器
-    func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
-        guard let currentIndex = childVcs.firstIndex(of: viewController as! LWBaseViewController) else { return nil }
-        let previousIndex = currentIndex - 1
-        guard previousIndex >= 0 else { return nil }
-        return childVcs[previousIndex]
-    }
-
-    // 返回当前页面之后的视图控制器
-    func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
-        guard let currentIndex = childVcs.firstIndex(of: viewController as! LWBaseViewController) else { return nil }
-        let nextIndex = currentIndex + 1
-        guard nextIndex < childVcs.count else { return nil }
-        return childVcs[nextIndex]
-    }
-
-    // 设置页面显示的初始视图控制器
-    func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo viewControllers: [UIViewController]) {
-        // 可以在这里更新 SegmentBar 的状态
-    }
-
-    // 页面切换完成后调用
-    func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted: Bool) {
-        if transitionCompleted, let visibleViewController = pageViewController.viewControllers?.first {
-            if let index = childVcs.firstIndex(of: visibleViewController as! LWBaseViewController) {
-                pageControl.setIndex(index)
-            }
-        }
-    }
-}

+ 157 - 0
TSLiveWallpaper/Business/TSMusic/List/Controller/MusicHomeContainerViewController.swift

@@ -0,0 +1,157 @@
+//
+//  MusicContainerViewController.swift
+//  DiaryWallPaper
+//
+//  Created by 倪锴伦 on 2025/1/20.
+//
+
+import ADManager
+import BetterSegmentedControl
+import Foundation
+import TSVideoKit
+
+class MusicHomeContainerViewController: LWBGViewController {
+    lazy var navBar: LWRightNavigationBar = LWRightNavigationBar()
+    lazy var searchBar: MusicSearchBar = MusicSearchBar()
+    weak var importMenuView: BubbleMenuView?
+
+    lazy var importButton: UIButton = {
+        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
+        bt.setImage(.icNavImport, for: .normal)
+        return bt
+    }()
+
+    lazy var songlistVc: SongListViewController = SongListViewController()
+    
+    var viewModel: MusicContainerViewModel = MusicContainerViewModel()
+    
+    lazy var guideBubble: GuideBubbleView = {
+        let guide = GuideBubbleView()
+        guide.addTarget(self, action: #selector(dismissGuideBubble), for: .touchUpInside)
+        guide.tapArea.addTarget(self, action: #selector(bubbleClick), for: .touchUpInside)
+        return guide
+    }()
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        bgImageView.image = .viewMainBg
+        addTargets()
+    }
+
+    override func addNotifaction() {
+        super.addNotifaction()
+    }
+
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        PlayerManager.shared.rootVc?.moveUpMiniBar()
+    }
+
+    override func viewDidLayoutSubviews() {
+        super.viewDidLayoutSubviews()
+        print("TSConfiguration.isYs ===", TSConfiguration.isYs)
+        if UserDefaults.standard.string(forKey: "GuideKey") == nil, TSConfiguration.isYs {
+            view.addSubview(guideBubble)
+            view.bringSubviewToFront(guideBubble)
+            guideBubble.snp.makeConstraints { make in
+                make.edges.equalToSuperview()
+            }
+        }
+    }
+
+    func addTargets() {
+        searchBar.addTarget(self, action: #selector(showSearchViewController), for: .touchUpInside)
+        importButton.addTarget(self, action: #selector(showImportMenuView), for: .touchUpInside)
+    }
+
+    @objc func showImportMenuView() {
+        let menuView = BubbleMenuView()
+        menuView.position = FitManager.isAr ? .topLeft : .topRight
+        menuView.actionHanlder = { type in
+            self.menuClick(type: type)
+        }
+        view.addSubview(menuView)
+        menuView.snp.makeConstraints { make in
+            make.trailing.equalToSuperview().offset(-16)
+            make.top.equalTo(self.importButton.snp.bottom).offset(0)
+        }
+        importMenuView = menuView
+    }
+
+    func menuClick(type: ImportSource) {
+        importMenuView?.removeFromSuperview()
+        if type == .library {
+            ImportFilesManager.shared.openPhotoLibrary(parent: self)
+        } else if type == .file {
+            ImportFilesManager.shared.openFileDocument(parent: self, completion: nil)
+        }
+    }
+
+    @objc func bubbleClick() {
+        showSearchViewController()
+        dismissGuideBubble()
+    }
+
+    @objc func dismissGuideBubble() {
+        guideBubble.isHidden = true
+        UserDefaults.standard.setValue("Guide", forKey: "GuideKey")
+    }
+
+    @objc func showSearchViewController() {
+        if PurchaseManager.default.isVip {
+            if TSConfiguration.isYs {
+                let vc = SearchOnlineViewController()
+                vc.hidesBottomBarWhenPushed = true
+                navigationController?.pushViewController(vc, animated: true)
+            } else {
+                let vc = LocalSearchViewController()
+                vc.hidesBottomBarWhenPushed = true
+                navigationController?.pushViewController(vc, animated: true)
+            }
+        } else {
+            ADManager.shared.showAd(scene: ADScene.searchInsert, from: self) { state in
+                if state == .finished || state == .fail {
+                    if TSConfiguration.isYs {
+                        let vc = SearchOnlineViewController()
+                        vc.hidesBottomBarWhenPushed = true
+                        self.navigationController?.pushViewController(vc, animated: true)
+                    } else {
+                        let vc = LocalSearchViewController()
+                        vc.hidesBottomBarWhenPushed = true
+                        self.navigationController?.pushViewController(vc, animated: true)
+                    }
+                }
+            }
+        }
+    }
+
+    override func addChildren() {
+        super.addChildren()
+        view.addSubview(navBar)
+        navBar.appendRightItem(item: importButton)
+        view.addSubview(searchBar)
+        view.addSubview(songlistVc.view)
+        addChild(songlistVc)
+        songlistVc.didMove(toParent: self)
+    }
+
+    override func makeConstarints() {
+        super.makeConstarints()
+        navBar.snp.makeConstraints { make in
+            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
+            make.horizontalEdges.equalToSuperview()
+            make.height.equalTo(k_Height_NavBar)
+        }
+        searchBar.snp.makeConstraints { make in
+            make.top.equalTo(navBar.snp.bottom)
+            make.horizontalEdges.equalToSuperview().inset(16)
+            make.height.equalTo(44)
+        }
+
+        songlistVc.view.snp.makeConstraints { make in
+            make.top.equalTo(searchBar.snp.bottom).offset(8)
+            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
+            make.left.right.equalToSuperview()
+        }
+    }
+}

+ 162 - 0
TSLiveWallpaper/Business/TSMusic/List/Controller/MusicPlaylistContainerViewController.swift

@@ -0,0 +1,162 @@
+//
+//  MusicContainerViewController.swift
+//  DiaryWallPaper
+//
+//  Created by 倪锴伦 on 2025/1/20.
+//
+
+import ADManager
+import BetterSegmentedControl
+import Foundation
+import TSVideoKit
+
+class MusicPlaylistContainerViewController: LWBGViewController {
+    lazy var navBar: LWRightNavigationBar = {
+        let bar = LWRightNavigationBar()
+        bar.iconView.image = .init(named: "ic_nav_playlist")
+        return bar
+    }()
+    
+    lazy var searchBar: MusicSearchBar = MusicSearchBar()
+    weak var importMenuView: BubbleMenuView?
+
+    lazy var importButton: UIButton = {
+        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
+        bt.setImage(.icNavImport, for: .normal)
+        return bt
+    }()
+
+    lazy var playlistVc: PlaylistViewController = PlaylistViewController()
+    
+    var viewModel: MusicContainerViewModel = MusicContainerViewModel()
+    
+    lazy var guideBubble: GuideBubbleView = {
+        let guide = GuideBubbleView()
+        guide.addTarget(self, action: #selector(dismissGuideBubble), for: .touchUpInside)
+        guide.tapArea.addTarget(self, action: #selector(bubbleClick), for: .touchUpInside)
+        return guide
+    }()
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        bgImageView.image = .viewMainBg
+        addTargets()
+    }
+
+    override func addNotifaction() {
+        super.addNotifaction()
+    }
+
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        PlayerManager.shared.rootVc?.moveUpMiniBar()
+    }
+
+    override func viewDidLayoutSubviews() {
+        super.viewDidLayoutSubviews()
+        print("TSConfiguration.isYs ===", TSConfiguration.isYs)
+        if UserDefaults.standard.string(forKey: "GuideKey") == nil, TSConfiguration.isYs {
+            view.addSubview(guideBubble)
+            view.bringSubviewToFront(guideBubble)
+            guideBubble.snp.makeConstraints { make in
+                make.edges.equalToSuperview()
+            }
+        }
+    }
+
+    func addTargets() {
+        searchBar.addTarget(self, action: #selector(showSearchViewController), for: .touchUpInside)
+        importButton.addTarget(self, action: #selector(showImportMenuView), for: .touchUpInside)
+    }
+
+    @objc func showImportMenuView() {
+        let menuView = BubbleMenuView()
+        menuView.position = FitManager.isAr ? .topLeft : .topRight
+        menuView.actionHanlder = { type in
+            self.menuClick(type: type)
+        }
+        view.addSubview(menuView)
+        menuView.snp.makeConstraints { make in
+            make.trailing.equalToSuperview().offset(-16)
+            make.top.equalTo(self.importButton.snp.bottom).offset(0)
+        }
+        importMenuView = menuView
+    }
+
+    func menuClick(type: ImportSource) {
+        importMenuView?.removeFromSuperview()
+        if type == .library {
+            ImportFilesManager.shared.openPhotoLibrary(parent: self)
+        } else if type == .file {
+            ImportFilesManager.shared.openFileDocument(parent: self, completion: nil)
+        }
+    }
+
+    @objc func bubbleClick() {
+        showSearchViewController()
+        dismissGuideBubble()
+    }
+
+    @objc func dismissGuideBubble() {
+        guideBubble.isHidden = true
+        UserDefaults.standard.setValue("Guide", forKey: "GuideKey")
+    }
+
+    @objc func showSearchViewController() {
+        if PurchaseManager.default.isVip {
+            if TSConfiguration.isYs {
+                let vc = SearchOnlineViewController()
+                vc.hidesBottomBarWhenPushed = true
+                navigationController?.pushViewController(vc, animated: true)
+            } else {
+                let vc = LocalSearchViewController()
+                vc.hidesBottomBarWhenPushed = true
+                navigationController?.pushViewController(vc, animated: true)
+            }
+        } else {
+            ADManager.shared.showAd(scene: ADScene.searchInsert, from: self) { state in
+                if state == .finished || state == .fail {
+                    if TSConfiguration.isYs {
+                        let vc = SearchOnlineViewController()
+                        vc.hidesBottomBarWhenPushed = true
+                        self.navigationController?.pushViewController(vc, animated: true)
+                    } else {
+                        let vc = LocalSearchViewController()
+                        vc.hidesBottomBarWhenPushed = true
+                        self.navigationController?.pushViewController(vc, animated: true)
+                    }
+                }
+            }
+        }
+    }
+
+    override func addChildren() {
+        super.addChildren()
+        view.addSubview(navBar)
+        navBar.appendRightItem(item: importButton)
+        view.addSubview(searchBar)
+        view.addSubview(playlistVc.view)
+        addChild(playlistVc)
+        playlistVc.didMove(toParent: self)
+    }
+
+    override func makeConstarints() {
+        super.makeConstarints()
+        navBar.snp.makeConstraints { make in
+            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
+            make.horizontalEdges.equalToSuperview()
+            make.height.equalTo(k_Height_NavBar)
+        }
+        searchBar.snp.makeConstraints { make in
+            make.top.equalTo(navBar.snp.bottom)
+            make.horizontalEdges.equalToSuperview().inset(16)
+            make.height.equalTo(44)
+        }
+
+        playlistVc.view.snp.makeConstraints { make in
+            make.top.equalTo(searchBar.snp.bottom).offset(8)
+            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
+            make.left.right.equalToSuperview()
+        }
+    }
+}

+ 1 - 1
TSLiveWallpaper/Business/TSPurchaseMembershipVC/TSPurchaseMembershipVC.swift

@@ -221,7 +221,7 @@ extension TSPurchaseMembership111VC {
         let vipImageView = UIImageView.createImageView(imageName: "vip_big_icon")
         topView.addSubview(vipImageView)
         
-        let liveImageView = UIImageView.createImageView(imageName: "dmanagepro")
+        let liveImageView = UIImageView.createImageView(imageName: "Dmanager_pro")
         topView.addSubview(liveImageView)
         
         let cell0 = creatCell(text: "All Premium Wallpapers")

+ 2 - 1
TSLiveWallpaper/Business/TSPurchaseMembershipVC/TSPurchaseVC.swift

@@ -53,6 +53,7 @@ class TSPurchaseVC: TSBaseVC {
     }
     
     override func dealThings() {
+        PurchaseManager.default.requestProducts()
         addNotifaction()
         onPurchaseStateChanged()
     }
@@ -211,7 +212,7 @@ struct PurchaseView :View {
             VStack {
                 Image("vip_big_icon").resizable().frame(width: 124, height: 102)
                 Spacer().frame(height: 12)
-                Image("dmanagepro")
+                Image("Dmanager_pro")
                 
                 Spacer().frame(height: 40)
                 

+ 27 - 12
TSLiveWallpaper/Business/TSRandomWallpaperVC/TSRandomWallpaperVC.swift

@@ -10,18 +10,27 @@ class TSRandomWallpaperVC: TSBaseVC {
     @UserDefault(key: "isShowGuide", defaultValue: true)
     var isShowGuide: Bool
     
-    lazy var navBarView: TSBaseNavContentBarView = {
-        let navBarView = TSBaseNavContentBarView()
-        let titleImageView = UIImageView.createImageView(imageName: "nav_title_random",contentMode: .scaleToFill)
-        
-        navBarView.barView.addSubview(titleImageView)
-        titleImageView.snp.makeConstraints { make in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(16)
-//            make.width.equalTo(185)
-//            make.height.equalTo(24)
-        }
-
+//    lazy var navBarView: TSBaseNavContentBarView = {
+//        let navBarView = TSBaseNavContentBarView()
+//        let titleImageView = UIImageView.createImageView(imageName: "nav_title_random",contentMode: .scaleToFill)
+//        
+//        navBarView.barView.addSubview(titleImageView)
+//        titleImageView.snp.makeConstraints { make in
+//            make.centerY.equalToSuperview()
+//            make.left.equalTo(16)
+////            make.width.equalTo(185)
+////            make.height.equalTo(24)
+//        }
+//
+//        return navBarView
+//    }()
+//    
+    
+    lazy var navBarView: LWSubNavigationBar = {
+        let navBarView = LWSubNavigationBar()
+        navBarView.backButton.addTarget(self, action: #selector(pop), for: .touchUpInside)
+        navBarView.backButton.setImage(.icClose, for: .normal)
+        navBarView.titleLabel.text = "DIY Live Wallpaper"
         return navBarView
     }()
     
@@ -65,9 +74,15 @@ class TSRandomWallpaperVC: TSBaseVC {
         setViewBgImageNamed(named: "view_main_bg")
         
         navBarContentView.addSubview(navBarView)
+        navBarContentView.snp.remakeConstraints { make in
+            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
+            make.leading.trailing.equalToSuperview()
+            make.height.equalTo(44.0)
+        }
         navBarView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
+
         
         contentView.addSubview(collectionComponent.collectionView)
         collectionComponent.collectionView.snp.makeConstraints { make in

+ 3 - 3
TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift

@@ -45,18 +45,18 @@ class TSTabBarController: UITabBarController {
     }
 
     @objc private func setUpData() {
-        viewControllerArray = ["MusicContainerViewController", "TSHomeVC", "TSRandomWallpaperVC", "TSMineVC"]
+        viewControllerArray = ["MusicHomeContainerViewController","MusicPlaylistContainerViewController", "TSHomeVC", "TSMineVC"]
 
         selectedImageArray = [
             "tabbar_select_music",
-            "tabbar_select_home",
+            "tabbar_select_playlist",
             "tabbar_select_random",
             "tabbar_select_mine",
         ]
         unselectedImageArray = [
             "tabbar_unSelect_music",
+            "tabbar_unSelect_playlist",
             "tabbar_unSelect_home",
-            "tabbar_unSelect_random",
             "tabbar_unSelect_mine",
         ]
 

+ 1 - 0
TSLiveWallpaper/LaunchVC/TSLaunchVC.swift

@@ -45,6 +45,7 @@ class TSLaunchVC: UIViewController {
                 if !PurchaseManager.default.isVip {
                     ADManager.shared.showLaunchAd(scene: ADScene.launch, in: self)
                 }
+                PurchaseManager.default.requestProducts()
                 self.initUmpProtocal()
                 manager?.stopListening()
             default: