ソースを参照

视频路由入口fixed

Chris 5 年 前
コミット
56afcc2fc5

+ 14 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift

@@ -9,6 +9,11 @@
 import UIKit
 import RxSwift
 
+public enum DepartureVCType{
+    case personal   // 个人中心
+    case others
+}
+
 class CommunityVideoListController: BaseViewController {
     
     // 内容Id
@@ -17,6 +22,8 @@ class CommunityVideoListController: BaseViewController {
             setupData()
         }
     }
+    // 来源Vc
+    var departureVc : DepartureVCType = .others
     
     var videoItemList: Array<CommunityVideoItemModel>?
     
@@ -82,11 +89,17 @@ class CommunityVideoListController: BaseViewController {
     
     override func setupViews() {        
         view.backgroundColor = UIColor.black
-        self.view.addSubview(collectionView)        
+        self.view.addSubview(collectionView)
         collectionView.snp.makeConstraints { (make) in
             make.top.equalTo(0)
             make.left.right.bottom.equalToSuperview()
         }
+        
+        // 个人中心页进入,不可滑动
+        if departureVc == .personal {
+            collectionView.isScrollEnabled = false
+        }
+        
         if #available(iOS 11.0, *) {
             UIScrollView.appearance().contentInsetAdjustmentBehavior =  .never
         } else {

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageList/ViewController/MessageListController.swift

@@ -118,7 +118,7 @@ extension MessageListController: UITableViewDataSource, UITableViewDelegate {
         switch messageVCType {
         case .comment?,.praise?:
             if messageDataModel.param?.postTypeEnum == .video {
-                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(messageDataModel.param?.postId ?? 0)"))
+                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(messageDataModel.param?.postId ?? 0)", departType: .others))
             }else {
                 Mediator.push(CommunityRouterModuleType.pushPostDetailContent(postId: "\(messageDataModel.param?.postId ?? 0)"))
             }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetActivity/Controller/MessagePlanetActivityController.swift

@@ -109,7 +109,7 @@ extension MessagePlanetActivityController: UITableViewDataSource, UITableViewDel
             break
         case .post?:
             if messageDataModel.param?.postTypeEnum == .video {
-                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(messageDataModel.param?.activityUrl ?? "")"))
+                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(messageDataModel.param?.activityUrl ?? "")", departType: .others))
             }else {
                 Mediator.push(CommunityRouterModuleType.pushPostDetailContent(postId: "\(messageDataModel.param?.activityUrl ?? "")"))
             }

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListView.swift

@@ -7,6 +7,7 @@
 //
 
 import UIKit
+import SwiftyMediator
 
 class PersonViewUserAndOtherListView: BaseView {
 
@@ -124,9 +125,8 @@ extension PersonViewUserAndOtherListView: UICollectionViewDelegateFlowLayout,UIC
         let postMyModel = postMyModels[indexPath.row]
 
         if PostType(rawValue: postMyModel.type ?? "video") == .video {
-            let vc = CommunityVideoListController()
-            vc.contentId = postMyModel.id ?? 0
-            findViewController().navigationController?.pushViewController(vc, animated: true)
+            Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(postMyModel.id ?? 0)", departType: .personal))
+            
         }else {
             let vc = CommunityRecommendController()
             vc.id = postMyModel.id ?? 0

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicChooseView.swift

@@ -259,7 +259,7 @@ class PublishMusicChooseView: FWPopupView {
         
         
         view.recommendButton.rx.tap.subscribe(onNext: { (data) in
-            Mediator.push(PublishRouterModuleType.push)
+            Mediator.push(PublishRouterModuleType.pushMucisChooseView)
             
         }).disposed(by: view.disposeBag)
         

+ 5 - 5
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListController.swift

@@ -91,6 +91,9 @@ extension PublishMusicListController : UITableViewDelegate, UITableViewDataSourc
         cell.musicItemMdl = musicItemMdlArr[indexPath.row]
         cell.useClickClosure = {
             [weak self] in
+            let curChoosingId = self?.musicItemMdlArr[indexPath.row].id!
+            MusicPlayManager.shared().curPlayingId = curChoosingId ?? 0
+            
             let musicUrlStr = self?.musicItemMdlArr[indexPath.row].url
             if let chooseMusicClosure = self?.chooseMusicClosure {
                 chooseMusicClosure(musicUrlStr ?? "")
@@ -107,11 +110,8 @@ extension PublishMusicListController : UITableViewDelegate, UITableViewDataSourc
         
         let musicId = musicItemMdlArr[indexPath.row].id!
         MusicPlayManager.shared().curPlayingId = musicId
-//        resetPlayingStatusWithout(musicId)
-        
-//        let curChoosingId = MusicPlayManager.shared().curChoosingId
-//        self.resetPlayingStatusWithout(curPlayingId)
-//        self.resetCellStatusWith(curPlayingId, curChoosingId)
+        let curChoosingId = MusicPlayManager.shared().curPlayingId
+        self.resetCellStatusWith(musicId, curChoosingId)
     }
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishRecordMusicView.swift

@@ -198,7 +198,7 @@ class PublishRecordMusicView: FWPopupView {
         }).disposed(by: view.disposeBag)
         
         view.recommendButton.rx.tap.subscribe(onNext: { (data) in
-            Mediator.push(PublishRouterModuleType.push)
+            Mediator.push(PublishRouterModuleType.pushMucisChooseView)
             
         }).disposed(by: view.disposeBag)
         

+ 3 - 2
RainbowPlanet/RainbowPlanet/Router/CommunityRouterModuleType.swift

@@ -16,7 +16,7 @@ import SwiftyMediator
 /// - pushFeaturedTopics: 话题内容
 public enum CommunityRouterModuleType: MediatorTargetType {
     case pushPostDetailContent(postId: String)
-    case pushPostDetailVoide(postId: String)
+    case pushPostDetailVoide(postId: String, departType: DepartureVCType)
     case pushFeaturedTopics(id : Int)
 }
 
@@ -27,9 +27,10 @@ extension CommunityRouterModuleType: MediatorSourceType {
             let vc = CommunityRecommendController()
             vc.id = Int(postId) ?? 0
             return vc
-        case .pushPostDetailVoide(let postId):
+        case .pushPostDetailVoide(let postId, let departType):
             let vc = CommunityVideoListController()
             vc.contentId = Int(postId) ?? 0
+            vc.departureVc = departType
             return vc
         case .pushFeaturedTopics(let id):
             let vc = CommunityFeaturedTopicsViewController()

+ 2 - 2
RainbowPlanet/RainbowPlanet/Router/PublishRouterModuleType.swift

@@ -11,13 +11,13 @@ import SwiftyMediator
 
 /// 推荐音乐
 public enum PublishRouterModuleType: MediatorTargetType {
-    case push
+    case pushMucisChooseView
 }
 
 extension PublishRouterModuleType: MediatorSourceType {
     public var viewController: UIViewController? {
         switch self {
-        case .push:
+        case .pushMucisChooseView:
             let vc = PublishRecommendMusicController()
             return vc
         }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Router/RouterManager.swift

@@ -27,7 +27,7 @@ class RouterManager: NSObject {
                     Mediator.push(CommunityRouterModuleType.pushPostDetailContent(postId: openAppModel?.postId ?? "0"))
                     break
                 case .video?:
-                    Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: openAppModel?.postId ?? "0"))
+                    Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: openAppModel?.postId ?? "0", departType: .others))
                     break
                 default:
                     break
@@ -50,7 +50,7 @@ class RouterManager: NSObject {
                 Mediator.push(CommunityRouterModuleType.pushPostDetailContent(postId: "\(pushModel.actionId ?? 0)"))
                 break
             case .video?: //视频帖子
-                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(pushModel.actionId ?? 0)"))
+                Mediator.push(CommunityRouterModuleType.pushPostDetailVoide(postId: "\(pushModel.actionId ?? 0)", departType: .others))
                 break
             default:
                 break