Ver Fonte

feat:调整细节,新增多选操作

kailen há 2 meses atrás
pai
commit
a8b2e46195
30 ficheiros alterados com 317 adições e 45 exclusões
  1. 7 3
      Podfile.lock
  2. 1 1
      TSLiveWallpaper/AppDelegate.swift
  3. BIN
      TSLiveWallpaper/Assets.xcassets/Music/.DS_Store
  4. 23 0
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_muti.imageset/Contents.json
  5. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_muti.imageset/ic_mine_ring_muti@1x.png
  6. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_muti.imageset/ic_mine_ring_muti@2x.png
  7. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_muti.imageset/ic_mine_ring_muti@3x.png
  8. 23 0
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_sort_down.imageset/Contents.json
  9. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_sort_down.imageset/ic_mine_ring_sort_down@1x.png
  10. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_sort_down.imageset/ic_mine_ring_sort_down@2x.png
  11. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_sort_down.imageset/ic_mine_ring_sort_down@3x.png
  12. 22 0
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_sort_up.imageset/Contents.json
  13. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_sort_up.imageset/ic_mine_ring_sort_up@2x.png
  14. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_sort_up.imageset/ic_mine_ring_sort_up@3x.png
  15. 23 0
      TSLiveWallpaper/Assets.xcassets/Music/ic_multi_addPlaylist.imageset/Contents.json
  16. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_multi_addPlaylist.imageset/ic_addPlaylist@1x.png
  17. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_multi_addPlaylist.imageset/ic_addPlaylist@2x.png
  18. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_multi_addPlaylist.imageset/ic_addPlaylist@3x.png
  19. 23 0
      TSLiveWallpaper/Assets.xcassets/Music/ic_playall.imageset/Contents.json
  20. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_playall.imageset/ic_playall@1x.png
  21. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_playall.imageset/ic_playall@2x.png
  22. BIN
      TSLiveWallpaper/Assets.xcassets/Music/ic_playall.imageset/ic_playall@3x.png
  23. 2 2
      TSLiveWallpaper/Business/TSMusic/Detail/PlayerManager.swift
  24. 1 1
      TSLiveWallpaper/Business/TSMusic/Helper/CWMutiSelectOpeateView.swift
  25. 3 3
      TSLiveWallpaper/Business/TSMusic/Helper/FilterBarView.swift
  26. 4 4
      TSLiveWallpaper/Business/TSMusic/Helper/SortMenuViewController.swift
  27. 78 11
      TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController.swift
  28. 91 17
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistDetailViewController.swift
  29. 1 1
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListCell.swift
  30. 15 2
      TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift

+ 7 - 3
Podfile.lock

@@ -124,7 +124,7 @@ DEPENDENCIES:
   - ObjectMapper (= 4.2)
   - SnapKit
   - SVProgressHUD
-  - TSVideoKit (from `../tsvideo-kit`)
+  - TSVideoKit (from `https://gitee.com/WanlanNeel/tsvideo-kit.git`, branch `feature/mini`)
   - TYCyclePagerView
   - TZImagePickerController
 
@@ -158,7 +158,8 @@ EXTERNAL SOURCES:
   KLTips:
     :git: https://gitee.com/WanlanNeel/kltips.git
   TSVideoKit:
-    :path: "../tsvideo-kit"
+    :branch: feature/mini
+    :git: https://gitee.com/WanlanNeel/tsvideo-kit.git
 
 CHECKOUT OPTIONS:
   KLExtension:
@@ -167,6 +168,9 @@ CHECKOUT OPTIONS:
   KLTips:
     :commit: dc38e277b3d62f753ce6c73ec62c0f8ae29c1b36
     :git: https://gitee.com/WanlanNeel/kltips.git
+  TSVideoKit:
+    :commit: c67bc820c784aa480f7de9b7ae302f5834b67ce7
+    :git: https://gitee.com/WanlanNeel/tsvideo-kit.git
 
 SPEC CHECKSUMS:
   AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58
@@ -193,6 +197,6 @@ SPEC CHECKSUMS:
   TZImagePickerController: d084a7b97c82d387e7669dd86dc9a9057500aacf
   YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
 
-PODFILE CHECKSUM: 14a6abcd165658c5b5fb2dfe2df75f98fe20b0e0
+PODFILE CHECKSUM: 3d6910304a92df060b8e6f0f687589367a3fadd3
 
 COCOAPODS: 1.15.2

+ 1 - 1
TSLiveWallpaper/AppDelegate.swift

@@ -34,7 +34,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 
     func initBaseDatas() {
         var config = TSConfiguration.default
-        config.configurePath = "http: // p.100yearslater.com/live/config"
+        config.configurePath = "http://p.100yearslater.com/live/config"
         TSVideoOperator.shared.loadWithConfiguration(config: config, needJs: true)
 //        if UserDefaults.standard.string(forKey: "InitExampleData") == nil {
 //            if let path = Bundle.main.path(forResource: "CandyTown", ofType: ".mp3") {

BIN
TSLiveWallpaper/Assets.xcassets/Music/.DS_Store


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

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

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


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


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


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

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

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


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


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


+ 22 - 0
TSLiveWallpaper/Assets.xcassets/Music/ic_mine_ring_sort_up.imageset/Contents.json

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

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


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


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

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

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


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


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


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

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

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


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


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


+ 2 - 2
TSLiveWallpaper/Business/TSMusic/Detail/PlayerManager.swift

@@ -139,11 +139,11 @@ class PlayerManager {
     }
 
     func showMutiOperateView(isFromPlaylist: Bool, playlist: TSPlayList? = nil) {
-//        rootVc?.showMultiSelectView()
+        rootVc?.showMultiSelectView()
     }
 
     func hideMutiOperateView() {
-//        rootVc?.hideMultiSelectView()
+        rootVc?.hideMultiSelectView()
     }
 
     @objc func addVideosToPlaylist() {

+ 1 - 1
TSLiveWallpaper/Business/TSMusic/Helper/CWMutiSelectOpeateView.swift

@@ -16,7 +16,7 @@ class CWMutiSelectOpeateView: UIView {
     }()
 
     lazy var deleteButton: CWOperateButton = .init(title: "Delete".localized(), imgName: "ic_delete")
-    lazy var addPlaylist: CWOperateButton = .init(title: "Add to Playlist".localized(), imgName: "ic_addPlaylist")
+    lazy var addPlaylist: CWOperateButton = .init(title: "Add to Playlist".localized(), imgName: "ic_multi_addPlaylist")
 
     override init(frame: CGRect) {
         super.init(frame: frame)

+ 3 - 3
TSLiveWallpaper/Business/TSMusic/Helper/FilterBarView.swift

@@ -32,8 +32,8 @@ class FilterBarView: UIView {
 
     lazy var selectButton: SpacedButton = {
         let btn = SpacedButton()
-        btn.setImage(UIImage(named: "ic_mine_ring_mutil_unselect"), for: .normal)
-        btn.setImage(UIImage(named: "ic_mine_ring_mutil_select"), for: .selected)
+        btn.setImage(UIImage(named: "ic_check_n"), for: .normal)
+        btn.setImage(UIImage(named: "ic_check_s"), for: .selected)
         btn.setTitle("Select All (0/0)", for: .normal)
         btn.titleLabel?.font = .systemFont(ofSize: 14)
         btn.isHidden = true
@@ -54,7 +54,7 @@ class FilterBarView: UIView {
         let btn = UIButton()
         btn.setTitle("Done".localized(), for: .normal)
         btn.titleLabel?.font = .systemFont(ofSize: 14)
-        btn.setTitleColor(.hexColor("#7E38EF"), for: .normal)
+        btn.setTitleColor(.hexColor("#FFFFFF"), for: .normal)
         btn.isHidden = true
         return btn
     }()

+ 4 - 4
TSLiveWallpaper/Business/TSMusic/Helper/SortMenuViewController.swift

@@ -23,13 +23,13 @@ class SortMenuViewController: UIViewController {
         control.addTarget(self, action: #selector(dismissCurrentVc), for: .touchUpInside)
         return control
     }()
-    lazy var bgView: UIView = .simpleView(color: .white)
+    lazy var bgView: UIView = .simpleView(color: .hexColor("#222222"))
 
-    lazy var titlelabel: UILabel = .simpleLabel(text: "Sort By".localized(),font: .boldSystemFont18,color: .black)
+    lazy var titlelabel: UILabel = .simpleLabel(text: "Sort By".localized(),font: .boldSystemFont18,color: .white)
 
     lazy var closeButton: UIButton = {
         let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_close"), for: .normal)
+        btn.setImage(UIImage(named: "ic-close"), for: .normal)
         btn.addTarget(self, action: #selector(dismissCurrentVc), for: .touchUpInside)
         return btn
     }()
@@ -134,7 +134,7 @@ class SortMenuViewController: UIViewController {
 
 class SortSelectCell: UIControl {
     lazy var selectIcon: UIImageView = .simpleImage(imageName: "ic_check_n")
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Ascending order by time".localized(),font: .systemFont16,color: .black)
+    lazy var titleLabel: UILabel = .simpleLabel(text: "Ascending order by time".localized(),font: .systemFont16,color: .white)
         
     var type: SortType = .downName
 

+ 78 - 11
TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController.swift

@@ -43,6 +43,14 @@ class SongListViewController: LWBGViewController {
         return mView
     }()
 
+    lazy var filterVc: FilterBarViewController = {
+        let vModel = FilterBarViewModel(videos: viewModel.videos, barTyle: .default, selectedVideos: [], sortType: .downTime)
+        let top = FilterBarViewController(viewModel: vModel)
+        top.needSearch = true
+        top.delegate = self
+        return top
+    }()
+
     lazy var listView: UITableView = {
         let tabView = UITableView()
         tabView.dataSource = viewModel
@@ -70,18 +78,22 @@ class SongListViewController: LWBGViewController {
         navigationItem.leftBarButtonItems?.removeAll()
         viewModel.requestData()
         addNotifaction()
-        
+
         let longPressGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPress(_:)))
-        listView.addGestureRecognizer(longPressGesture)        
+        listView.addGestureRecognizer(longPressGesture)
     }
 
     override func addNotifaction() {
         super.addNotifaction()
 
-        viewModel.$videos.receive(on: DispatchQueue.main).sink { [weak self] _ in
+        viewModel.$videos.receive(on: DispatchQueue.main).sink { [weak self] videos in
             guard let self = self else {
                 return
             }
+            self.filterVc.viewModel?.videos = videos
+            self.filterVc.viewModel?.selectedVideos = []
+            self.filterVc.updateBarInfo()
+            self.filterVc.mutiDoneButtonClicked()
             self.emptyView.isHidden = !viewModel.isEmptyData
             self.listView.reloadData()
         }.store(in: &cancellables)
@@ -126,6 +138,9 @@ class SongListViewController: LWBGViewController {
 
     override func addChildren() {
         super.addChildren()
+        view.addSubview(filterVc.view)
+        addChild(filterVc)
+        filterVc.didMove(toParent: self)
         view.addSubview(listView)
         view.addSubview(emptyView)
     }
@@ -163,11 +178,16 @@ class SongListViewController: LWBGViewController {
 
     override func makeConstarints() {
         super.makeConstarints()
+        filterVc.view.snp.makeConstraints { make in
+            make.top.equalToSuperview()
+            make.horizontalEdges.equalToSuperview().inset(16)
+            make.height.equalTo(46)
+        }
 
         listView.snp.makeConstraints { make in
             make.leading.trailing.equalToSuperview()
             make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
-            make.top.equalToSuperview()
+            make.top.equalTo(filterVc.view.snp.bottom)
         }
         emptyView.snp.makeConstraints { make in
             make.edges.equalTo(listView)
@@ -215,13 +235,14 @@ extension SongListViewController: UITableViewDelegate {
             print("indexPath.row == \(indexPath.row) , count = \(viewModel.videos.count) ")
             if indexPath.row < viewModel.videos.count {
                 let video = viewModel.videos[indexPath.row]
-//                /// 多选模式 禁止点击
-//                if viewModel.isMutiSelectModel {
-//                    viewModel.addToSelectedList(video: video)
-//                    listView.reloadData()
-//                } else {
-                PlayerManager.shared.playVideo(video: video, list: viewModel.videos, scene: .local, onceAdKey: "MinePlayVideo")
-//                }
+                /// 多选模式 禁止点击
+                if viewModel.isMutiSelectModel {
+                    viewModel.addToSelectedList(video: video)
+                    filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
+                    listView.reloadData()
+                } else {
+                    PlayerManager.shared.playVideo(video: video, list: viewModel.videos, scene: .local, onceAdKey: "MinePlayVideo")
+                }
             }
         }
     }
@@ -240,3 +261,49 @@ extension SongListViewController: UITableViewDelegate {
         menuView.removeFromSuperview()
     }
 }
+
+extension SongListViewController: FilterBarViewControllerDelegate {
+    func selectedAllVideo() {
+        if filterVc.viewModel?.selectedVideos.count == viewModel.videos.count {
+            viewModel.selectedVideos = []
+        } else {
+            viewModel.selectedVideos = viewModel.videos
+        }
+        filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
+        listView.reloadData()
+    }
+
+    func doneMutiManage() {
+        viewModel.selectedVideos = []
+        filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
+        listView.reloadData()
+    }
+
+    func localSearchDidClicked() {
+//        if PurchaseManager.default.isVip {
+        let vc = LocalSearchViewController()
+        vc.viewModel.sort = viewModel.sortDescriptor
+        vc.hidesBottomBarWhenPushed = true
+        navigationController?.pushViewController(vc, animated: true)
+//        } else {
+//            ADManager.shared.showAd(scene: ADScene.searchInsert, from: self) { state in
+//                if state == .finished || state == .fail {
+//                    let vc = LocalSearchViewController()
+//                    vc.viewModel.sort = self.viewModel.sortDescriptor
+//                    vc.hidesBottomBarWhenPushed = true
+//                    self.navigationController?.pushViewController(vc, animated: true)
+//                }
+//            }
+//        }
+    }
+
+    func topBarTypeDidChange(barType: MineRingTopType) {
+        viewModel.isMutiSelectModel = barType == .mutiselect
+        listView.reloadData()
+    }
+
+    func sortTypeDidChange(sortType: SortType) {
+        viewModel.sortType = sortType
+        viewModel.requestData()
+    }
+}

+ 91 - 17
TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistDetailViewController.swift

@@ -48,15 +48,15 @@ class PlaylistDetailViewController: LWBGViewController, UITableViewDelegate {
     }()
 
     lazy var emptyView: MusicEmptyView = .init(algin: .center, needButton: false)
-//    lazy var filterVc: FilterBarViewController = {
-//        let vModel = FilterBarViewModel(videos: viewModel?.videos ?? [], barTyle: .default, selectedVideos: [], sortType: .downTime)
-//        vModel.isFromPlaylist = true
-//        vModel.playlist = viewModel?.playlist
-//        let top = FilterBarViewController(viewModel: vModel)
-//        top.needSearch = false
-//        top.delegate = self
-//        return top
-//    }()
+    lazy var filterVc: FilterBarViewController = {
+        let vModel = FilterBarViewModel(videos: viewModel?.videos ?? [], barTyle: .default, selectedVideos: [], sortType: .downTime)
+        vModel.isFromPlaylist = true
+        vModel.playlist = viewModel?.playlist
+        let top = FilterBarViewController(viewModel: vModel)
+        top.needSearch = false
+        top.delegate = self
+        return top
+    }()
 
     lazy var topView: SongListTopView = {
         let top = SongListTopView()
@@ -132,12 +132,8 @@ class PlaylistDetailViewController: LWBGViewController, UITableViewDelegate {
             guard let self = self else {
                 return
             }
-            let isEmpty = self.viewModel?.videos.isEmpty == true
-            self.emptyView.isHidden = !isEmpty
-            self.topView.isHidden = isEmpty
-            self.sortButton.isHidden = isEmpty
-            self.manageButton.isHidden = isEmpty
-            self.listView.reloadData()
+            self.emptyView.isHidden = self.viewModel?.videos.isEmpty == false
+            self.refreshViews()
         }).store(in: &canncellable)
 
         NotificationCenter.default.addObserver(self, selector: #selector(reloadDatas), name: .K_RefreshNotifaction, object: nil)
@@ -218,12 +214,29 @@ class PlaylistDetailViewController: LWBGViewController, UITableViewDelegate {
     }
 
     @objc func showManageViewController() {
-   
+    }
+
+    func refreshViews() {
+        if viewModel?.videos.isEmpty == true {
+            filterVc.view.isHidden = true
+        } else {
+            filterVc.view.isHidden = false
+        }
+        filterVc.viewModel?.selectedVideos = []
+        filterVc.viewModel?.videos = viewModel?.videos ?? []
+        filterVc.updateBarInfo()
+        filterVc.mutiDoneButtonClicked()
+        listView.reloadData()
+        resetViews()
     }
 
     override func addChildren() {
         super.addChildren()
+        addChild(filterVc)
         view.addSubview(navBar)
+        view.addSubview(filterVc.view)
+        filterVc.didMove(toParent: self)
+
 //        navBar.appendRightItem(item: sortButton)
 //        navBar.appendRightItem(item: manageButton)
 //        navBar.appendRightItem(item: moreButton)
@@ -246,9 +259,14 @@ class PlaylistDetailViewController: LWBGViewController, UITableViewDelegate {
 //            make.top.equalTo(navBar.snp.bottom).offset(16)
 //            make.height.equalTo(44)
 //        }
+        filterVc.view.snp.makeConstraints { make in
+            make.horizontalEdges.equalToSuperview().inset(16)
+            make.top.equalTo(navBar.snp.bottom)
+            make.height.equalTo(40)
+        }
 
         listView.snp.makeConstraints { make in
-            make.top.equalTo(navBar.snp.bottom).offset(12)
+            make.top.equalTo(filterVc.view.snp.bottom).offset(12)
             make.bottom.leading.trailing.equalToSuperview()
         }
         emptyView.snp.makeConstraints { make in
@@ -262,6 +280,7 @@ class PlaylistDetailViewController: LWBGViewController, UITableViewDelegate {
             let model = vM.videos[indexPath.row]
             if viewModel?.isMuti == true {
                 vM.addToSelectedList(video: model)
+                filterVc.viewModel?.selectedVideos = vM.selectedVideos
                 listView.reloadData()
             } else {
                 PlayerManager.shared.playVideo(video: model, list: vM.videos, scene: .local, onceAdKey: viewModel?.playlist?.id?.uuidString ?? "DefaultPlaylist")
@@ -275,3 +294,58 @@ class PlaylistDetailViewController: LWBGViewController, UITableViewDelegate {
         canncellable.removeAll()
     }
 }
+
+extension PlaylistDetailViewController: FilterBarViewControllerDelegate {
+    func selectedAllVideo() {
+        guard let viewModel = viewModel else { return }
+        if filterVc.viewModel?.selectedVideos.count == viewModel.videos.count {
+            viewModel.selectedVideos = []
+        } else {
+            viewModel.selectedVideos = viewModel.videos
+        }
+        filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
+        listView.reloadData()
+    }
+
+    func doneMutiManage() {
+        guard let viewModel = viewModel else { return }
+
+        viewModel.selectedVideos = []
+        filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
+        listView.reloadData()
+    }
+
+    func resetViews() {
+        listView.snp.updateConstraints { make in
+            if viewModel?.isMuti == true {
+                make.bottom.equalToSuperview().offset(-180)
+            } else {
+                make.bottom.equalToSuperview()
+            }
+        }
+        emptyView.snp.updateConstraints { make in
+            if viewModel?.isMuti == true {
+                make.bottom.equalToSuperview().offset(-180)
+            } else {
+                make.bottom.equalToSuperview()
+            }
+        }
+    }
+
+    func localSearchDidClicked() {
+    }
+
+    func topBarTypeDidChange(barType: MineRingTopType) {
+        viewModel?.isMuti = barType == .mutiselect
+        listView.reloadData()
+        resetViews()
+    }
+
+    func sortTypeDidChange(sortType: SortType) {
+        viewModel?.sortType = sortType
+        viewModel?.requestData()
+        if viewModel?.videos.isEmpty == false {
+            listView.scrollToRow(at: .init(row: 0, section: 0), at: .top, animated: false)
+        }
+    }
+}

+ 1 - 1
TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListCell.swift

@@ -81,7 +81,7 @@ class PlayListCell: UITableViewCell {
             if firstVideo.isAudio,!firstVideo.isOnline {
                 iconView.image = .icDefault
             } else {
-                iconView.kf.setImage(with: firstVideo.iconUrl)
+                iconView.kf.setImage(with: firstVideo.iconUrl,placeholder: UIImage.init(named: "ic_default"))
             }
         } else {
             iconView.image = list.artworkImage ?? .icDefault

+ 15 - 2
TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift

@@ -14,8 +14,8 @@ class TSTabBarController: UITabBarController {
     lazy var multiSelectView: CWMutiSelectOpeateView = {
         let mView = CWMutiSelectOpeateView()
         mView.isHidden = true
-//        mView.deleteButton.addTarget(self, action: #selector(deleteButtonAction), for: .touchUpInside)
-//        mView.addPlaylist.addTarget(self, action: #selector(addToPlaylistAction), for: .touchUpInside)
+        mView.deleteButton.addTarget(self, action: #selector(deleteButtonAction), for: .touchUpInside)
+        mView.addPlaylist.addTarget(self, action: #selector(addToPlaylistAction), for: .touchUpInside)
         return mView
     }()
 
@@ -139,6 +139,7 @@ extension TSTabBarController: UITabBarControllerDelegate {
 // MARK: 音乐布局相关
 
 extension TSTabBarController {
+    
     private func addMusicAndMiniBar() {
         let tap = UITapGestureRecognizer(target: self, action: #selector(showPlayDetailVc))
         miniBar.bgImageView.addGestureRecognizer(tap)
@@ -194,6 +195,18 @@ extension TSTabBarController {
 // MARK: 音乐操作相关
 
 extension TSTabBarController {
+    
+    func showMultiSelectView(){
+        multiSelectView.isHidden = false
+        view.bringSubviewToFront(multiSelectView)
+    }
+    
+    func hideMultiSelectView(){
+        multiSelectView.isHidden = true
+        view.bringSubviewToFront(multiSelectView)
+    }
+
+
     @objc func deleteButtonAction() {
         PlayerManager.shared.deleteSelectedVideos()
     }