Browse Source

1.修改bugs

wenweiwei 4 years ago
parent
commit
3c9bff9f24

+ 4 - 4
MusicVideoPlus/Classes/Modules/Mine/Controllers/MVMineProductController.swift

@@ -76,7 +76,7 @@ class MVMineProductController: PQBaseViewController {
                 self?.headInfoView.addData()
                 self?.headInfoView.addData()
             }
             }
         }
         }
-        
+
         PQEventTrackViewModel.baseReportUpload(businessType: .bt_pageView, objectType: .ot_shanyinApp_viewPage_mineTab, pageSource: .sp_shanyinApp_mine, extParams: nil, remindmsg: "")
         PQEventTrackViewModel.baseReportUpload(businessType: .bt_pageView, objectType: .ot_shanyinApp_viewPage_mineTab, pageSource: .sp_shanyinApp_mine, extParams: nil, remindmsg: "")
     }
     }
 
 
@@ -213,9 +213,9 @@ extension MVMineProductController: UICollectionViewDelegate, UICollectionViewDat
             PQBaseViewModel.videoDetailInfo(videoId: videoData?.uniqueId ?? "") { [weak self] videoList, _, msg in
             PQBaseViewModel.videoDetailInfo(videoId: videoData?.uniqueId ?? "") { [weak self] videoList, _, msg in
                 if (videoList?.count ?? 0) > 0, msg == nil, !(videoList?.first?.first?.transcodeStatus == 2 || videoList?.first?.first?.auditStatus == 1 || videoList?.first?.first?.transcodeStatus == 1) {
                 if (videoList?.count ?? 0) > 0, msg == nil, !(videoList?.first?.first?.transcodeStatus == 2 || videoList?.first?.first?.auditStatus == 1 || videoList?.first?.first?.transcodeStatus == 1) {
                     let tempVideoData = videoList?.first?.first
                     let tempVideoData = videoList?.first?.first
-                    videoData?.transcodeStatus = videoList?.first?.first?.transcodeStatus ?? 0
-                    videoData?.auditStatus = videoList?.first?.first?.auditStatus ?? 0
-                    videoData?.transcodeStatus = videoList?.first?.first?.transcodeStatus ?? 0
+                    if tempVideoData != nil {
+                        self?.itemsList[indexPath.item] = tempVideoData!
+                    }
                     self?.collectionView.reloadData()
                     self?.collectionView.reloadData()
                     self?.collectionView(self!.collectionView, didSelectItemAt: indexPath)
                     self?.collectionView(self!.collectionView, didSelectItemAt: indexPath)
                 } else {
                 } else {

+ 19 - 4
MusicVideoPlus/Classes/Modules/Mine/Controllers/MVPlayViewController.swift

@@ -117,6 +117,13 @@ class MVPlayViewController: PQBaseViewController {
     /// - Parameter isRefresh: <#isRefresh description#>
     /// - Parameter isRefresh: <#isRefresh description#>
     /// - Returns: <#description#>
     /// - Returns: <#description#>
     func loadRequestData(isRefresh: Bool = true, isAutoPlay _: Bool = false) {
     func loadRequestData(isRefresh: Bool = true, isAutoPlay _: Bool = false) {
+        if !isNetConnected() {
+            cShowHUB(superView: nil, msg: "没有网络连接")
+            collectionView.mj_footer?.endRefreshing(completionBlock: {[weak self] in
+                self?.collectionView.setContentOffset(CGPoint.init(x: 0, y: (self?.collectionView.contentSize.height ?? 0) - (self?.collectionView.frame.height ?? 0)), animated: false)
+            })
+            return
+        }
         if isRequesting {
         if isRequesting {
             return
             return
         }
         }
@@ -191,12 +198,13 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
             return
             return
         }
         }
         let indexPath = collectionView.indexPath(for: cell!)
         let indexPath = collectionView.indexPath(for: cell!)
+        let itemData = itemsList[indexPath?.item ?? 0]
         if currentIndex != nil, currentIndex?.item == indexPath?.item, PQSingletoVideoPlayer.shared.playControllerView != nil {
         if currentIndex != nil, currentIndex?.item == indexPath?.item, PQSingletoVideoPlayer.shared.playControllerView != nil {
-//            PQSingletoVideoPlayer.shared.resumePlayer()
+            PQSingletoVideoPlayer.shared.configPlyer(videoData: itemData, controllerView: cell!.coverImageView, renderMode: .RENDER_MODE_FILL_EDGE)
+            PQSingletoVideoPlayer.shared.startPlayr()
             return
             return
         }
         }
         currentIndex = indexPath
         currentIndex = indexPath
-        let itemData = itemsList[indexPath?.item ?? 0]
         itemData.playProgress = 0
         itemData.playProgress = 0
         cell?.pauseBtn.isSelected = false
         cell?.pauseBtn.isSelected = false
         PQSingletoVideoPlayer.shared.configPlyer(videoData: itemData, controllerView: cell!.coverImageView, renderMode: .RENDER_MODE_FILL_EDGE)
         PQSingletoVideoPlayer.shared.configPlyer(videoData: itemData, controllerView: cell!.coverImageView, renderMode: .RENDER_MODE_FILL_EDGE)
@@ -226,6 +234,10 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
             let navVc: UINavigationController? = (UIApplication.shared.keyWindow?.rootViewController) as? UINavigationController
             let navVc: UINavigationController? = (UIApplication.shared.keyWindow?.rootViewController) as? UINavigationController
             (navVc?.viewControllers.first as? MVHomeController)?.jumpToDetailVc(type: 2, videoData: videoData)
             (navVc?.viewControllers.first as? MVHomeController)?.jumpToDetailVc(type: 2, videoData: videoData)
         case 4: // 分享好友
         case 4: // 分享好友
+            if !isNetConnected() {
+                cShowHUB(superView: nil, msg: "没有网络连接")
+                return
+            }
             if !PQSingletoWXApiUtil.shared.isInstallWX() {
             if !PQSingletoWXApiUtil.shared.isInstallWX() {
                 cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
                 cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
                 return
                 return
@@ -246,6 +258,10 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
             // 分享好友上报
             // 分享好友上报
             reportUpload(isFriend: true, openId: "", shareId: shareId, videoData: videoData)
             reportUpload(isFriend: true, openId: "", shareId: shareId, videoData: videoData)
         case 5: // 分享朋友圈
         case 5: // 分享朋友圈
+            if !isNetConnected() {
+                cShowHUB(superView: nil, msg: "没有网络连接")
+                return
+            }
             if !PQSingletoWXApiUtil.shared.isInstallWX() {
             if !PQSingletoWXApiUtil.shared.isInstallWX() {
                 cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
                 cShowHUB(superView: nil, msg: "您还未安装微信客户端!")
                 return
                 return
@@ -317,8 +333,7 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
         BFLog(message: "进入到前台")
         BFLog(message: "进入到前台")
         let navVc: UINavigationController? = (UIApplication.shared.keyWindow?.rootViewController) as? UINavigationController
         let navVc: UINavigationController? = (UIApplication.shared.keyWindow?.rootViewController) as? UINavigationController
         if navVc?.visibleViewController is MVPlayViewController {
         if navVc?.visibleViewController is MVPlayViewController {
-            (collectionView.visibleCell() as? MVPlayControlViewCell)?.pauseBtn.isSelected = false
-            PQSingletoVideoPlayer.shared.startPlayr()
+            self.scrollViewDidEndDecelerating(collectionView)
         }
         }
     }
     }
 
 

+ 4 - 3
MusicVideoPlus/Classes/Modules/Mine/Views/MVPlayControlViewCell.swift

@@ -14,7 +14,7 @@ class MVPlayControlViewCell: UICollectionViewCell {
     lazy var coverImageView: UIImageView = {
     lazy var coverImageView: UIImageView = {
         let coverImageView = UIImageView()
         let coverImageView = UIImageView()
         coverImageView.contentMode = .scaleAspectFit
         coverImageView.contentMode = .scaleAspectFit
-//        coverImageView.clipsToBounds = true
+        coverImageView.clipsToBounds = true
         coverImageView.isUserInteractionEnabled = true
         coverImageView.isUserInteractionEnabled = true
         coverImageView.tag = cCellTag
         coverImageView.tag = cCellTag
         coverImageView.backgroundColor = UIColor.black
         coverImageView.backgroundColor = UIColor.black
@@ -26,6 +26,7 @@ class MVPlayControlViewCell: UICollectionViewCell {
     lazy var maskImageView: UIImageView = {
     lazy var maskImageView: UIImageView = {
         let maskImageView = UIImageView(image: UIImage(named: "play_mask"))
         let maskImageView = UIImageView(image: UIImage(named: "play_mask"))
         maskImageView.contentMode = .scaleAspectFill
         maskImageView.contentMode = .scaleAspectFill
+        maskImageView.clipsToBounds = true
         return maskImageView
         return maskImageView
     }()
     }()
 
 
@@ -238,11 +239,11 @@ class MVPlayControlViewCell: UICollectionViewCell {
         let margin: CGFloat = 12
         let margin: CGFloat = 12
         let musicH: CGFloat = 32
         let musicH: CGFloat = 32
         coverImageView.snp.remakeConstraints { make in
         coverImageView.snp.remakeConstraints { make in
-            make.size.equalToSuperview()
+            make.left.right.top.bottom.equalToSuperview()
         }
         }
 
 
         maskImageView.snp.remakeConstraints { make in
         maskImageView.snp.remakeConstraints { make in
-            make.size.equalToSuperview()
+            make.left.right.top.bottom.equalToSuperview()
         }
         }
 
 
         pauseBtn.snp.remakeConstraints { make in
         pauseBtn.snp.remakeConstraints { make in