Selaa lähdekoodia

1.播放详情页

wenweiwei 3 vuotta sitten
vanhempi
commit
6126ed7644

+ 25 - 8
MusicVideoPlus.xcodeproj/project.pbxproj

@@ -10,6 +10,10 @@
 		2D076756266DF8E300E64472 /* PQServerProtocalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D076755266DF8E300E64472 /* PQServerProtocalView.swift */; };
 		2D076758266E08E700E64472 /* MVHomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D076757266E08E700E64472 /* MVHomeController.swift */; };
 		2D1EC138266B4F4900CBACE4 /* MVThirdApiUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D1EC137266B4F4900CBACE4 /* MVThirdApiUtil.swift */; };
+		2D9630D3268186A500AE6FFE /* MVPlayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D9630D2268186A500AE6FFE /* MVPlayViewController.swift */; };
+		2D9630D52681874D00AE6FFE /* MVPlayControlViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D9630D42681874D00AE6FFE /* MVPlayControlViewCell.swift */; };
+		2D9630D92681947300AE6FFE /* MVRequestURLUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D9630D82681947300AE6FFE /* MVRequestURLUtil.swift */; };
+		2D9630DC2681C8AB00AE6FFE /* MVMineViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D9630DB2681C8AB00AE6FFE /* MVMineViewModel.swift */; };
 		4112DD832669BFA600A5AFD9 /* MVBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4112DD822669BFA600A5AFD9 /* MVBanner.swift */; };
 		4112DD862669BFFA00A5AFD9 /* MVBannerFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4112DD852669BFFA00A5AFD9 /* MVBannerFlowLayout.swift */; };
 		4112DD912669C11C00A5AFD9 /* MVBannerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4112DD902669C11C00A5AFD9 /* MVBannerCell.swift */; };
@@ -34,6 +38,10 @@
 		2D076755266DF8E300E64472 /* PQServerProtocalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PQServerProtocalView.swift; sourceTree = "<group>"; };
 		2D076757266E08E700E64472 /* MVHomeController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MVHomeController.swift; sourceTree = "<group>"; };
 		2D1EC137266B4F4900CBACE4 /* MVThirdApiUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVThirdApiUtil.swift; sourceTree = "<group>"; };
+		2D9630D2268186A500AE6FFE /* MVPlayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVPlayViewController.swift; sourceTree = "<group>"; };
+		2D9630D42681874D00AE6FFE /* MVPlayControlViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVPlayControlViewCell.swift; sourceTree = "<group>"; };
+		2D9630D82681947300AE6FFE /* MVRequestURLUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVRequestURLUtil.swift; sourceTree = "<group>"; };
+		2D9630DB2681C8AB00AE6FFE /* MVMineViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MVMineViewModel.swift; sourceTree = "<group>"; };
 		3FA19A38D145C54301B3CD85 /* Pods_MusicVideoPlus.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MusicVideoPlus.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		4112DCF02668C45B00A5AFD9 /* MusicVideoPlus.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MusicVideoPlus.entitlements; sourceTree = "<group>"; };
 		4112DD492668D6A600A5AFD9 /* MusicVideoPlus-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MusicVideoPlus-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -84,11 +92,20 @@
 			isa = PBXGroup;
 			children = (
 				2D1EC137266B4F4900CBACE4 /* MVThirdApiUtil.swift */,
+				2D9630D82681947300AE6FFE /* MVRequestURLUtil.swift */,
 			);
 			name = Utils;
 			path = Modules/Utils;
 			sourceTree = "<group>";
 		};
+		2D9630DA2681C8AB00AE6FFE /* ViewModel */ = {
+			isa = PBXGroup;
+			children = (
+				2D9630DB2681C8AB00AE6FFE /* MVMineViewModel.swift */,
+			);
+			path = ViewModel;
+			sourceTree = "<group>";
+		};
 		4112DD812669BF8900A5AFD9 /* Banner */ = {
 			isa = PBXGroup;
 			children = (
@@ -200,6 +217,7 @@
 			isa = PBXGroup;
 			children = (
 				2D076757266E08E700E64472 /* MVHomeController.swift */,
+				2D9630D2268186A500AE6FFE /* MVPlayViewController.swift */,
 			);
 			path = Controllers;
 			sourceTree = "<group>";
@@ -210,6 +228,7 @@
 				4112DD812669BF8900A5AFD9 /* Banner */,
 				4112DD902669C11C00A5AFD9 /* MVBannerCell.swift */,
 				4149C8922669FE6F0055CAA2 /* MVTagsCell.swift */,
+				2D9630D42681874D00AE6FFE /* MVPlayControlViewCell.swift */,
 			);
 			path = Views;
 			sourceTree = "<group>";
@@ -217,7 +236,7 @@
 		41CA6E43266782C900874B19 /* Mine */ = {
 			isa = PBXGroup;
 			children = (
-				41CA6E44266782C900874B19 /* ViewModels */,
+				2D9630DA2681C8AB00AE6FFE /* ViewModel */,
 				41CA6E45266782C900874B19 /* Models */,
 				41CA6E46266782C900874B19 /* Controllers */,
 				41CA6E47266782C900874B19 /* Views */,
@@ -225,13 +244,6 @@
 			path = Mine;
 			sourceTree = "<group>";
 		};
-		41CA6E44266782C900874B19 /* ViewModels */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = ViewModels;
-			sourceTree = "<group>";
-		};
 		41CA6E45266782C900874B19 /* Models */ = {
 			isa = PBXGroup;
 			children = (
@@ -463,6 +475,7 @@
 		418532242665342100DCA2C1 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
+				CLASSPREFIX = MV;
 				LastSwiftUpdateCheck = 1230;
 				LastUpgradeCheck = 1230;
 				TargetAttributes = {
@@ -572,13 +585,17 @@
 				4112DD912669C11C00A5AFD9 /* MVBannerCell.swift in Sources */,
 				41CA6E6C266788F700874B19 /* MVPlayerConntroller.swift in Sources */,
 				41CA6E5E266782EC00874B19 /* MVBaseController.swift in Sources */,
+				2D9630D92681947300AE6FFE /* MVRequestURLUtil.swift in Sources */,
 				417D86A7266A3CC900DA2444 /* MVHotVideoModel.swift in Sources */,
+				2D9630D52681874D00AE6FFE /* MVPlayControlViewCell.swift in Sources */,
 				4149C8932669FE6F0055CAA2 /* MVTagsCell.swift in Sources */,
 				4112DD832669BFA600A5AFD9 /* MVBanner.swift in Sources */,
 				2D1EC138266B4F4900CBACE4 /* MVThirdApiUtil.swift in Sources */,
+				2D9630D3268186A500AE6FFE /* MVPlayViewController.swift in Sources */,
 				2D076756266DF8E300E64472 /* PQServerProtocalView.swift in Sources */,
 				4144BE31266F128E00ABBDFA /* PQBandingPhoneController.swift in Sources */,
 				41CA6E69266788C000874B19 /* MVLoginController.swift in Sources */,
+				2D9630DC2681C8AB00AE6FFE /* MVMineViewModel.swift in Sources */,
 				41CA6E662667887C00874B19 /* MVMineController.swift in Sources */,
 				41CA6F4B26689F4400874B19 /* PQMineViewModel.swift in Sources */,
 				417D868C266A2E8400DA2444 /* MVHomeViewModel.swift in Sources */,

+ 22 - 0
MusicVideoPlus/Assets.xcassets/Login/mi_upload_share_timeline.imageset/Contents.json

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

BIN
MusicVideoPlus/Assets.xcassets/Login/mi_upload_share_timeline.imageset/mi_upload_share_timeline@2x.png


BIN
MusicVideoPlus/Assets.xcassets/Login/mi_upload_share_timeline.imageset/mi_upload_share_timeline@3x.png


+ 24 - 22
MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -491,27 +491,29 @@ extension MVHomeController: UICollectionViewDelegate, UICollectionViewDataSource
     }
 
     func collectionView(_: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        for hot in mVideos {
-            hot.isSelected = false
-        }
-
-        let itemDataNew: MVHotVideoModel = mVideos[indexPath.item]
-        itemDataNew.isSelected = true
-        categoryCollectionView.reloadData()
-
-        // 找出当前选择分类之前的视频数量和
-        var videosCount: Int = 0
-        if indexPath.row != 0 {
-            for i in 0 ... indexPath.row - 1 {
-                videosCount = videosCount + mVideos[i].videos.count
-            }
-            BFLog(message: "indexPath 选择\(indexPath.item) 之前的视频合\(videosCount)")
-        }
-        viewListView.currentIndex = videosCount
-        viewListView.scrollToItem(at: videosCount, animated: false)
-
-        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.05) {
-            self.playVideo(page: videosCount)
-        }
+//        for hot in mVideos {
+//            hot.isSelected = false
+//        }
+//
+//        let itemDataNew: MVHotVideoModel = mVideos[indexPath.item]
+//        itemDataNew.isSelected = true
+//        categoryCollectionView.reloadData()
+//
+//        // 找出当前选择分类之前的视频数量和
+//        var videosCount: Int = 0
+//        if indexPath.row != 0 {
+//            for i in 0 ... indexPath.row - 1 {
+//                videosCount = videosCount + mVideos[i].videos.count
+//            }
+//            BFLog(message: "indexPath 选择\(indexPath.item) 之前的视频合\(videosCount)")
+//        }
+//        viewListView.currentIndex = videosCount
+//        viewListView.scrollToItem(at: videosCount, animated: false)
+//
+//        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.05) {
+//            self.playVideo(page: videosCount)
+//        }
+        let vc = MVPlayViewController.init()
+        navigationController?.pushViewController(vc, animated: true)
     }
 }

+ 155 - 0
MusicVideoPlus/Classes/Modules/Home/Controllers/MVPlayViewController.swift

@@ -0,0 +1,155 @@
+//
+//  MVPlayViewController.swift
+//  MusicVideoPlus
+//
+//  Created by SanW on 2021/6/22.
+//
+
+import BFFramework
+import UIKit
+import WechatOpenSDK
+
+class MVPlayViewController: PQBaseViewController {
+    var itemsList: [PQVideoListModel] = Array<PQVideoListModel>.init()
+    var pageNum: Int = 1
+    var currentIndex: IndexPath?
+    lazy var leftBtn: UIButton = {
+        let leftBtn = UIButton(type: .custom)
+        leftBtn.frame = CGRect(x: 0, y: cDevice_iPhoneStatusBarHei, width: cDefaultMargin * 4, height: cDefaultMargin * 4)
+        leftBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: -5, right: 0)
+        leftBtn.setImage(UIImage().BF_Image(named: "icon_detail_back"), for: .normal)
+        leftBtn.addTarget(self, action: #selector(backBtnClick), for: .touchUpInside)
+        return leftBtn
+    }()
+
+    lazy var collectionView: UICollectionView = {
+        let layout = UICollectionViewFlowLayout()
+        layout.minimumLineSpacing = 0
+        layout.sectionInset = UIEdgeInsets.zero
+        layout.minimumInteritemSpacing = 0
+        layout.itemSize = view.frame.size
+        let collectionView = UICollectionView(frame: view.frame, collectionViewLayout: layout)
+        collectionView.scrollsToTop = false
+        collectionView.isPagingEnabled = true
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.register(MVPlayControlViewCell.self, forCellWithReuseIdentifier: String(describing: MVPlayControlViewCell.self))
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        if #available(iOS 11.0, *) {
+            collectionView.contentInsetAdjustmentBehavior = .never
+        } else {
+            automaticallyAdjustsScrollViewInsets = false
+        }
+        collectionView.addRefreshView { [weak self] isRefresh in
+            self?.loadRequestData(isRefresh: isRefresh)
+        }
+        return collectionView
+    }()
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        view.addSubview(collectionView)
+        view.addSubview(leftBtn)
+        if itemsList.count <= 0 {
+            loadRequestData()
+        }
+        if currentIndex != nil, itemsList.count > (currentIndex?.item ?? 0) {
+            collectionView.contentOffset = CGPoint(x: 0, y: CGFloat(currentIndex?.item ?? 0) * view.frame.size.height)
+        }
+    }
+
+    /// 请求网络数据
+    /// - Parameter isRefresh: <#isRefresh description#>
+    /// - Returns: <#description#>
+    func loadRequestData(isRefresh: Bool = true) {
+        if isRefresh {
+            pageNum = 1
+        } else {
+            pageNum = pageNum + 1
+        }
+        MVMineViewModel.userVideoListData(pageNum: pageNum) { [weak self] videoList, _ in
+            if videoList != nil, (videoList?.count ?? 0) > 0 {
+                if isRefresh {
+                    self?.itemsList = videoList!
+                } else {
+                    self?.itemsList = self!.itemsList + videoList!
+                }
+                self?.collectionView.reloadData()
+            } else {
+                self?.pageNum = (self?.pageNum ?? 1) - 1
+            }
+            self?.collectionView.mj_header?.endRefreshing()
+            self?.collectionView.mj_footer?.endRefreshing()
+        }
+    }
+}
+
+extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSource {
+    func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int {
+        return itemsList.count
+    }
+
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let itemData = itemsList[indexPath.item]
+        let cell = MVPlayControlViewCell.playControlCell(collectionView: collectionView, indexPath: indexPath)
+        cell.videoData = itemData
+        cell.btnClickHandle = { [weak self] sender, videoData in
+            self?.btnClickHandle(sender: sender, videoData: videoData)
+        }
+        return cell
+    }
+
+    func collectionView(_: UICollectionView, didSelectItemAt _: IndexPath) {}
+
+    /// 按钮点击处理
+    /// - Parameters:
+    ///   - sender: <#sender description#>
+    ///   - videoData: <#videoData description#>
+    /// - Returns: <#description#>
+    func btnClickHandle(sender: UIButton, videoData: PQVideoListModel?) {
+        switch sender.tag {
+        case 1: // 暂停/播放
+
+            break
+        case 2: // 昵称
+
+            break
+        case 3: // 做同款
+            let navVc: UINavigationController? = (UIApplication.shared.keyWindow?.rootViewController) as? UINavigationController
+            (navVc?.viewControllers.first as? MVHomeController)?.jumpToDetailVc(type: 2, videoData: videoData)
+        case 4: // 分享好友
+            if !PQSingletoWXApiUtil.shared.isInstallWX() {
+                cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
+                return
+            }
+            cShowHUB(superView: nil, msg: nil)
+            let shareId = getUniqueId(desc: "\(videoData?.uniqueId ?? "")shareId")
+            PQBaseViewModel.wxFriendShareInfo(videoId: (videoData?.uniqueId)!) { [weak self] imagePath, title, shareWeappRawId, msg in
+                if msg != nil {
+                    cShowHUB(superView: nil, msg: "网络不佳哦")
+                    return
+                }
+                PQSingletoWXApiUtil.shared.share(type: 3, scene: Int32(WXSceneSession.rawValue), shareWeappRawId: shareWeappRawId, title: title, description: title, imageUrl: imagePath, path: videoData?.videoPath, videoId: (videoData?.uniqueId)!, pageSource: videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
+                }
+                cHiddenHUB(superView: nil)
+            }
+        case 5: // 分享朋友圈
+            if !PQSingletoWXApiUtil.shared.isInstallWX() {
+                cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
+                return
+            }
+            let shareId = getUniqueId(desc: "\(videoData?.uniqueId ?? "")shareId")
+            PQBaseViewModel.h5ShareLinkInfo(videoId: videoData?.uniqueId ?? "", pageSource: videoData?.pageSource ?? .sp_category) { [weak self] path, _ in
+                cHiddenHUB(superView: nil)
+                if path != nil {
+                    PQSingletoWXApiUtil.shared.share(type: 1, scene: Int32(WXSceneTimeline.rawValue), title: BFLoginUserInfo.shared.isLogin() ? "\(BFLoginUserInfo.shared.nickName)made a music video for you" : "Music Video for U", description: "", imageUrl: videoData?.shareImgPath, path: path, videoId: (videoData?.uniqueId)!, pageSource: videoData?.pageSource ?? .sp_category, shareId: shareId).wxApiUtilHander = { _, _ in
+                    }
+                } else {
+                    cShowHUB(superView: nil, msg: "网络不佳哦")
+                }
+            }
+        default:
+            break
+        }
+    }
+}

+ 300 - 0
MusicVideoPlus/Classes/Modules/Home/Views/MVPlayControlViewCell.swift

@@ -0,0 +1,300 @@
+//
+//  MVPlayControlViewCell.swift
+//  MusicVideoPlus
+//
+//  Created by SanW on 2021/6/22.
+//
+
+import BFFramework
+import UIKit
+
+class MVPlayControlViewCell: UICollectionViewCell {
+    let musicWidth: CGFloat = cScreenWidth - 12 - (16 + cDefaultMargin) * 2 - (12 + cDefaultMargin * 7 + 12)
+    var btnClickHandle: ((_ sender: UIButton, _ videoData: PQVideoListModel?) -> Void)?
+    lazy var coverImageView: UIImageView = {
+        let coverImageView = UIImageView()
+        coverImageView.contentMode = .scaleAspectFill
+        coverImageView.isUserInteractionEnabled = true
+        coverImageView.tag = cCellTag
+        coverImageView.backgroundColor = UIColor.white
+        let ges = UITapGestureRecognizer(target: self, action: #selector(tagClick))
+        coverImageView.addGestureRecognizer(ges)
+        return coverImageView
+    }()
+
+    lazy var pauseBtn: UIButton = {
+        let pauseBtn = UIButton(type: .custom)
+        pauseBtn.setImage(UIImage(named: "video_pause"), for: .selected)
+        pauseBtn.setImage(nil, for: .normal)
+        pauseBtn.tag = 1
+//        pauseBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
+        return pauseBtn
+    }()
+
+    lazy var watchCountLab: UILabel = {
+        let watchCountLab = UILabel()
+        watchCountLab.addShadow()
+        watchCountLab.textColor = UIColor.white
+        watchCountLab.font = UIFont.systemFont(ofSize: 11)
+        return watchCountLab
+    }()
+
+    lazy var nickNameBtn: UIButton = {
+        let nickNameBtn = UIButton(type: .custom)
+        nickNameBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
+        nickNameBtn.setTitleColor(UIColor.white, for: .normal)
+        nickNameBtn.tag = 2
+        nickNameBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
+        return nickNameBtn
+    }()
+
+    lazy var musicContenView: UIView = {
+        let musicContenView = UIView()
+        return musicContenView
+    }()
+
+    lazy var musicImageView: UIImageView = {
+        let musicImageView = UIImageView(image: UIImage(named: "musicName_icon"))
+        musicImageView.showLoadingAnimation(duration: 3)
+        return musicImageView
+    }()
+
+    lazy var musicBgView: UIImageView = {
+        let musicBgView = UIImageView(image: UIImage(named: "musicName_bg"))
+        return musicBgView
+    }()
+
+    lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.textAlignment = .left
+        titleLabel.textColor = .white
+        titleLabel.numberOfLines = 5
+        titleLabel.lineBreakMode = .byCharWrapping
+        titleLabel.font = UIFont.systemFont(ofSize: 16, weight: .bold)
+        return titleLabel
+    }()
+
+    /// 音乐歌曲名称
+    lazy var musicNameLab: LMJHorizontalScrollText = {
+        let musicNameLab = LMJHorizontalScrollText(frame: CGRect(x: 12 + cDefaultMargin, y: 0, width: musicWidth, height: 32))
+        musicNameLab.textColor = UIColor.white
+        musicNameLab.textFont = UIFont.systemFont(ofSize: 15, weight: .semibold)
+        musicNameLab.speed = 0.03
+        musicNameLab.moveDirection = LMJTextScrollMoveLeft
+        musicNameLab.moveMode = LMJTextScrollContinuous
+        musicNameLab.stop()
+        return musicNameLab
+    }()
+
+    lazy var reCreateBtn: UIButton = {
+        let reCreateBtn = UIButton(type: .custom)
+        reCreateBtn.setTitle(" 用此音乐做视频", for: .normal)
+        reCreateBtn.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: .semibold)
+        reCreateBtn.setTitleColor(UIColor.white, for: .normal)
+        reCreateBtn.addCorner(corner: 8)
+        reCreateBtn.setImage(UIImage(named: "reCreate"), for: .normal)
+        reCreateBtn.tag = 3
+        reCreateBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
+        reCreateBtn.backgroundColor = UIColor(red: 61.0 / 255.0, green: 193.0 / 255.0, blue: 193.0 / 255.0, alpha: 0.8)
+        return reCreateBtn
+    }()
+
+    lazy var wechatImage: UIButton = {
+        let wechatImage = UIButton(type: .custom)
+        wechatImage.setImage(UIImage(named: "mi_upload_share_friend"), for: .normal)
+        wechatImage.tag = 4
+        wechatImage.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
+        wechatImage.layer.shadowColor = UIColor(white: 0, alpha: 0.5).cgColor
+        wechatImage.layer.shadowOffset = CGSize(width: 2, height: 2)
+        return wechatImage
+    }()
+
+    lazy var wechatLab: UILabel = {
+        let wechatLab = UILabel()
+        wechatLab.textAlignment = .center
+        wechatLab.textColor = UIColor.white
+        wechatLab.font = UIFont.systemFont(ofSize: 13, weight: .medium)
+        wechatLab.text = "分享好友"
+        wechatLab.addShadow()
+        wechatLab.layer.shadowColor = UIColor(white: 0, alpha: 0.5).cgColor
+        wechatLab.layer.shadowOffset = CGSize(width: 2, height: 2)
+        return wechatLab
+    }()
+
+    lazy var wechatFriImage: UIButton = {
+        let wechatFriImage = UIButton(type: .custom)
+        wechatFriImage.setImage(UIImage(named: "mi_upload_share_timeline"), for: .normal)
+        wechatFriImage.tag = 5
+        wechatFriImage.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
+        wechatFriImage.layer.shadowColor = UIColor(white: 0, alpha: 0.5).cgColor
+        wechatFriImage.layer.shadowOffset = CGSize(width: 2, height: 2)
+        return wechatFriImage
+    }()
+
+    lazy var wechatFriLab: UILabel = {
+        let wechatFriLab = UILabel()
+        wechatFriLab.textAlignment = .center
+        wechatFriLab.textColor = UIColor.white
+        wechatFriLab.font = UIFont.systemFont(ofSize: 13, weight: .medium)
+        wechatFriLab.text = "分享朋友圈"
+        wechatFriLab.addShadow()
+        wechatFriLab.layer.shadowColor = UIColor(white: 0, alpha: 0.5).cgColor
+        wechatFriLab.layer.shadowOffset = CGSize(width: 2, height: 2)
+        return wechatFriLab
+    }()
+
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        addSubview(coverImageView)
+        addSubview(pauseBtn)
+        addSubview(watchCountLab)
+        addSubview(nickNameBtn)
+        addSubview(titleLabel)
+        addSubview(musicContenView)
+        musicContenView.addSubview(musicBgView)
+        musicContenView.addSubview(musicImageView)
+        musicBgView.addSubview(musicNameLab)
+        addSubview(reCreateBtn)
+        addSubview(wechatImage)
+        addSubview(wechatLab)
+        addSubview(wechatFriImage)
+        addSubview(wechatFriLab)
+    }
+
+    required init?(coder _: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+
+    @objc class func playControlCell(collectionView: UICollectionView, indexPath: IndexPath) -> MVPlayControlViewCell {
+        let cell: MVPlayControlViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: MVPlayControlViewCell.self), for: indexPath) as! MVPlayControlViewCell
+        return cell
+    }
+
+    override func prepareForReuse() {
+        super.prepareForReuse()
+        pauseBtn.isSelected = false
+    }
+
+    var videoData: PQVideoListModel? {
+        didSet {
+            addData()
+            addLayout()
+        }
+    }
+
+    func addData() {
+        pauseBtn.isSelected = false
+        let coverImg = (videoData?.videoCoverSnapshotPath != nil && (videoData?.videoCoverSnapshotPath?.count ?? 0) > 0) ? videoData?.videoCoverSnapshotPath ?? "" : videoData?.coverImg?["coverImgPath"] as! String
+        netImage(url: coverImg, mainView: coverImageView)
+        if videoData?.shareCountFriend != nil, videoData?.shareCountFriend ?? 0 > 0 {
+            wechatLab.text = (videoData?.shareCountFriend ?? 0).changeUnit()
+        } else {
+            wechatLab.text = "分享好友"
+        }
+        if videoData?.shareCount != nil, videoData?.shareCount ?? 0 > 0 {
+            wechatFriLab.text = (videoData?.shareCount ?? 0).changeUnit()
+        } else {
+            wechatFriLab.text = "分享朋友圈"
+        }
+        watchCountLab.text = "\(videoData?.playCountFormatStr ?? "0")次观看"
+        nickNameBtn.setTitle("@\(videoData?.userInfo?.nickName ?? "")", for: .normal)
+        titleLabel.text = videoData?.title ?? ""
+        let nameWidth: CGFloat = sizeWithText(text: "\(videoData?.reCreateVideoData?.rhythmMusicName ?? "")  ", font: UIFont.systemFont(ofSize: 15, weight: .semibold), size: CGSize(width: cScreenWidth, height: 32)).width
+        musicNameLab.stop()
+        if nameWidth > musicWidth {
+            musicNameLab.move()
+            musicNameLab.text = "\(videoData?.reCreateVideoData?.rhythmMusicName ?? "")  "
+        } else {
+            musicNameLab.stop()
+            musicNameLab.text = "\(videoData?.reCreateVideoData?.rhythmMusicName ?? "")                                                                    "
+        }
+    }
+
+    func addLayout() {
+        let shareW: CGFloat = cDefaultMargin * 7
+        let margin: CGFloat = 12
+        let musicH: CGFloat = 32
+        coverImageView.snp.remakeConstraints { make in
+            make.size.equalToSuperview()
+        }
+
+        pauseBtn.snp.remakeConstraints { make in
+            make.width.height.equalTo(shareW)
+            make.center.equalToSuperview()
+        }
+
+        reCreateBtn.snp.makeConstraints { make in
+            make.left.equalToSuperview().offset(margin)
+            make.right.equalToSuperview().offset(-margin)
+            make.height.equalTo(margin * 4)
+            make.bottom.equalToSuperview().offset(-(cSafeAreaHeight + margin * 4))
+        }
+
+        wechatFriLab.snp.remakeConstraints { make in
+            make.bottom.equalTo(reCreateBtn.snp_top).offset(-cDefaultMargin * 2)
+            make.right.equalTo(reCreateBtn)
+            make.width.equalTo(shareW)
+        }
+
+        wechatFriImage.snp.remakeConstraints { make in
+            make.bottom.equalTo(wechatFriLab.snp_top)
+            make.width.height.equalTo(shareW)
+            make.right.equalTo(wechatFriLab)
+        }
+
+        wechatLab.snp.remakeConstraints { make in
+            make.bottom.equalTo(wechatFriImage.snp_top).offset(-margin)
+            make.width.height.right.equalTo(wechatFriLab)
+        }
+        wechatImage.snp.remakeConstraints { make in
+            make.bottom.equalTo(wechatLab.snp_top)
+            make.width.height.equalTo(shareW)
+            make.right.equalTo(wechatFriLab)
+        }
+
+        musicContenView.snp.remakeConstraints { make in
+            make.height.equalTo(musicH)
+            make.right.equalTo(wechatFriLab.snp_left).offset(-margin)
+            make.left.equalTo(reCreateBtn)
+            make.bottom.equalTo(reCreateBtn.snp_top).offset(-cDefaultMargin * 2)
+        }
+
+        musicImageView.snp.makeConstraints { make in
+            make.top.left.equalToSuperview()
+            make.width.height.equalTo(musicContenView.snp_height)
+        }
+
+        musicBgView.snp.makeConstraints { make in
+            make.left.equalTo(musicImageView.snp_centerX)
+            make.right.top.height.equalToSuperview()
+        }
+
+        titleLabel.snp.remakeConstraints { make in
+            make.bottom.equalTo(musicContenView.snp_top).offset(-margin)
+            make.left.equalTo(reCreateBtn)
+            make.right.equalTo(musicContenView)
+        }
+
+        nickNameBtn.snp.remakeConstraints { make in
+            make.left.equalTo(reCreateBtn)
+            make.bottom.equalTo(titleLabel.snp_top).offset(-margin / 2)
+        }
+
+        watchCountLab.snp.remakeConstraints { make in
+            make.left.equalTo(reCreateBtn)
+            make.right.equalTo(musicContenView)
+            make.bottom.equalTo(nickNameBtn.snp_top).offset(-margin / 2)
+        }
+    }
+
+    @objc func tagClick() {
+        pauseBtn.isSelected = !pauseBtn.isSelected
+        btnClick(sender: pauseBtn)
+    }
+
+    @objc func btnClick(sender: UIButton) {
+        if btnClickHandle != nil {
+            btnClickHandle!(sender, videoData)
+        }
+    }
+}

+ 40 - 0
MusicVideoPlus/Classes/Modules/Mine/ViewModel/MVMineViewModel.swift

@@ -0,0 +1,40 @@
+//
+//  MVMineViewModel.swift
+//  MusicVideoPlus
+//
+//  Created by SanW on 2021/6/22.
+//
+
+import BFFramework
+import UIKit
+
+class MVMineViewModel: NSObject {
+    
+    /// 分页获取我的视频
+    /// - Parameters:
+    ///   - pageNum: 第几页
+    ///   - pageSize: 一页多少
+    ///   - completeHander: <#completeHander description#>
+    class func userVideoListData(pageNum: Int = 1, pageSize: Int = 20, completeHander: @escaping (_ videoLists: [PQVideoListModel]?, _ msg: String?) -> Void) {
+        SWNetRequest.postRequestData(url: PQENVUtil.shared.clipapiapi + userVideoListUrl, parames: ["pageNum": pageNum, "pageSize": pageSize]) { response, _, error, _ in
+            if response is NSNull || response == nil {
+                completeHander(nil, error?.msg)
+            } else {
+                let temResponseArr: [[String: Any]]? = response as? [[String: Any]]
+                if temResponseArr != nil, (temResponseArr?.count ?? 0) > 0 {
+                    var videoLists = Array<PQVideoListModel>.init()
+                    temResponseArr?.forEach { dic in
+                        let tempModel = PQVideoListModel(jsonDict: dic)
+                        let userInfo = PQUserInfoModel.init()
+                        userInfo.nickName = BFLoginUserInfo.shared.nickName
+                        tempModel.userInfo = userInfo
+                        videoLists.append(tempModel)
+                    }
+                    completeHander(videoLists, error?.msg)
+                } else {
+                    completeHander(nil, error?.msg)
+                }
+            }
+        }
+    }
+}

+ 13 - 0
MusicVideoPlus/Classes/Modules/Utils/MVRequestURLUtil.swift

@@ -0,0 +1,13 @@
+//
+//  MVRequestURLUtil.swift
+//  MusicVideoPlus
+//
+//  Created by SanW on 2021/6/22.
+//
+
+import UIKit
+
+/** 个人主页-用户视频列表 */
+public let userVideoListUrl = "rhythmapp/user/listUserVideos"
+/** 个人主页-用户信息 */
+public let userInfoUrl = "/rhythmapp/user/getMypageUserInfo"

+ 1 - 1
MusicVideoPlus/PQConfig.plist

@@ -3,6 +3,6 @@
 <plist version="1.0">
 <dict>
 	<key>ENVMode</key>
-	<string>ENVModeTest</string>
+	<string>ENVModeOnline</string>
 </dict>
 </plist>