浏览代码

1.修改分享 2.修改UI

wenweiwei 3 年之前
父节点
当前提交
3f974610df

+ 3 - 3
MusicVideoPlus.xcodeproj/project.pbxproj

@@ -117,6 +117,7 @@
 		2D9630DF2682080100AE6FFE /* Views */ = {
 		2D9630DF2682080100AE6FFE /* Views */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				2D9630D42681874D00AE6FFE /* MVPlayControlViewCell.swift */,
 				2D9630E226820B1900AE6FFE /* MVMineProductCell.swift */,
 				2D9630E226820B1900AE6FFE /* MVMineProductCell.swift */,
 				2D9630E42682D14500AE6FFE /* MVMineHeadInfoView.swift */,
 				2D9630E42682D14500AE6FFE /* MVMineHeadInfoView.swift */,
 				2D9630E62683534B00AE6FFE /* MVProductEmptyView.swift */,
 				2D9630E62683534B00AE6FFE /* MVProductEmptyView.swift */,
@@ -245,7 +246,6 @@
 				4112DD812669BF8900A5AFD9 /* Banner */,
 				4112DD812669BF8900A5AFD9 /* Banner */,
 				4112DD902669C11C00A5AFD9 /* MVBannerCell.swift */,
 				4112DD902669C11C00A5AFD9 /* MVBannerCell.swift */,
 				4149C8922669FE6F0055CAA2 /* MVTagsCell.swift */,
 				4149C8922669FE6F0055CAA2 /* MVTagsCell.swift */,
-				2D9630D42681874D00AE6FFE /* MVPlayControlViewCell.swift */,
 			);
 			);
 			path = Views;
 			path = Views;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -757,7 +757,7 @@
 					"$(inherited)",
 					"$(inherited)",
 					"@executable_path/Frameworks",
 					"@executable_path/Frameworks",
 				);
 				);
-				MARKETING_VERSION = 1.0.2;
+				MARKETING_VERSION = 1.1.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.piaoquan.shanyin;
 				PRODUCT_BUNDLE_IDENTIFIER = com.piaoquan.shanyin;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "MusicVideoPlus/MusicVideoPlus-Bridging-Header.h";
 				SWIFT_OBJC_BRIDGING_HEADER = "MusicVideoPlus/MusicVideoPlus-Bridging-Header.h";
@@ -784,7 +784,7 @@
 					"$(inherited)",
 					"$(inherited)",
 					"@executable_path/Frameworks",
 					"@executable_path/Frameworks",
 				);
 				);
-				MARKETING_VERSION = 1.0.2;
+				MARKETING_VERSION = 1.1.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.piaoquan.shanyin;
 				PRODUCT_BUNDLE_IDENTIFIER = com.piaoquan.shanyin;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "MusicVideoPlus/MusicVideoPlus-Bridging-Header.h";
 				SWIFT_OBJC_BRIDGING_HEADER = "MusicVideoPlus/MusicVideoPlus-Bridging-Header.h";

+ 16 - 13
MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -7,6 +7,9 @@
 
 
 import BFFramework
 import BFFramework
 class MVHomeController: MVBaseController {
 class MVHomeController: MVBaseController {
+    var jumpType: Int = 1 // 跳转类型 type: 1-我的作品 2-再创作 3-卡点视频
+    var jumpVideoData: PQVideoListModel?
+    var isJumpToLogin: Bool = false
     // 视频播放列表
     // 视频播放列表
     public let margin: CGFloat = cDefaultMargin * 3
     public let margin: CGFloat = cDefaultMargin * 3
     public let maxHeight: CGFloat = cScreenHeigth - (cDevice_iPhoneStatusBarHei + 45 + 60 + (cDefaultMargin * 2 + cSafeAreaHeight) + cDefaultMargin * 3)
     public let maxHeight: CGFloat = cScreenHeigth - (cDevice_iPhoneStatusBarHei + 45 + 60 + (cDefaultMargin * 2 + cSafeAreaHeight) + cDefaultMargin * 3)
@@ -90,14 +93,11 @@ class MVHomeController: MVBaseController {
 
 
     // 登录成功后自动跳转到系统相册
     // 登录成功后自动跳转到系统相册
     @objc func loginSuccesss() {
     @objc func loginSuccesss() {
-        if isCreateVideo {
-            isCreateVideo = false
-            let videoListModel = mAllVideos[lastBnnerSelectIndex.row]
-            jumpToDetailVc(type: 2, videoData: videoListModel)
-        } else {
-            DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.2) { [weak self] in
-                self?.jumpToDetailVc(type: 3)
-            }
+        if isJumpToLogin {
+            isJumpToLogin = false
+            PQNotification.removeObserver(self)
+            // 跳转上传详情页
+            jumpToDetailVc(type: jumpType, videoData: jumpVideoData)
         }
         }
     }
     }
 
 
@@ -153,11 +153,7 @@ class MVHomeController: MVBaseController {
 
 
     override func viewDidLoad() {
     override func viewDidLoad() {
         super.viewDidLoad()
         super.viewDidLoad()
-
-        addNotification(self, selector: #selector(loginSuccesss), name: cLoginSuccesssNotiKey, object: nil)
-        addNotification(self, selector: #selector(loginSuccesss), name: cBandingPhoneSuccessKey, object: nil)
         addNotification(self, selector: #selector(stuckPointDismiss), name: cFinishedPublishedNotiKey, object: nil)
         addNotification(self, selector: #selector(stuckPointDismiss), name: cFinishedPublishedNotiKey, object: nil)
-
         view.addSubview(mineBtn)
         view.addSubview(mineBtn)
         view.addSubview(stuckPointBtn)
         view.addSubview(stuckPointBtn)
         view.addSubview(settingBtn)
         view.addSubview(settingBtn)
@@ -273,9 +269,12 @@ class MVHomeController: MVBaseController {
 
 
     /// 判断是否可进入对就界面
     /// 判断是否可进入对就界面
     /// - Parameters:
     /// - Parameters:
-    ///   - type: 进入界面  1, 个人中心 2,再创作进入相册 PQVideoListModel 不能为空要使用音乐数据  3,直接创作进入相机
+    ///   - type: 进入界面  1-我的作品 2-再创作 3-卡点视频
+    ///   PQVideoListModel 不能为空要使用音乐数据  3,直接创作进入相机
     ///   - videoData: type == 2 时必传
     ///   - videoData: type == 2 时必传
     func jumpToDetailVc(type: Int, videoData: PQVideoListModel? = nil) {
     func jumpToDetailVc(type: Int, videoData: PQVideoListModel? = nil) {
+        jumpType = type
+        jumpVideoData = videoData
         // 无网
         // 无网
         if !isNetConnected() {
         if !isNetConnected() {
             let remindData: PQBaseModel = PQBaseModel()
             let remindData: PQBaseModel = PQBaseModel()
@@ -292,6 +291,8 @@ class MVHomeController: MVBaseController {
         }
         }
         // 先判断是否登录
         // 先判断是否登录
         if !BFLoginUserInfo.shared.isLogin() {
         if !BFLoginUserInfo.shared.isLogin() {
+            isJumpToLogin = true
+            addNotification(self, selector: #selector(loginSuccesss), name: cLoginSuccesssNotiKey, object: nil)
             let vc = MVLoginController()
             let vc = MVLoginController()
             vc.modalPresentationStyle = .fullScreen
             vc.modalPresentationStyle = .fullScreen
             present(vc, animated: true, completion: nil)
             present(vc, animated: true, completion: nil)
@@ -312,6 +313,8 @@ class MVHomeController: MVBaseController {
             remindView.tag = cBandinPhoneTag
             remindView.tag = cBandinPhoneTag
             remindView.bandingPhoneRemindHandle = { [weak self] sender in
             remindView.bandingPhoneRemindHandle = { [weak self] sender in
                 if sender.tag == 2 {
                 if sender.tag == 2 {
+                    self?.isJumpToLogin = true
+                    addNotification(self!, selector: #selector(self?.loginSuccesss), name: cBandingPhoneSuccessKey, object: nil)
                     self?.navigationController?.pushViewController(PQBandingPhoneController(), animated: true)
                     self?.navigationController?.pushViewController(PQBandingPhoneController(), animated: true)
                 }
                 }
             }
             }

+ 67 - 27
MusicVideoPlus/Classes/Modules/Mine/Controllers/MVMineProductController.swift

@@ -44,14 +44,15 @@ class MVMineProductController: PQBaseViewController {
     }()
     }()
 
 
     lazy var emptyView: MVProductEmptyView = {
     lazy var emptyView: MVProductEmptyView = {
-        let emptyView = MVProductEmptyView.init(frame: CGRect.init(x: 0, y: headH, width: collectionView.frame.width, height: collectionView.frame.height - headH))
-        emptyView.btnClickHandle = {[weak self] sender in
+        let emptyView = MVProductEmptyView(frame: CGRect(x: 0, y: headH, width: collectionView.frame.width, height: collectionView.frame.height - headH))
+        emptyView.btnClickHandle = { [weak self] _ in
             let vc = PQStuckPointMaterialController()
             let vc = PQStuckPointMaterialController()
             self?.navigationController?.pushViewController(vc, animated: true)
             self?.navigationController?.pushViewController(vc, animated: true)
         }
         }
         emptyView.isHidden = true
         emptyView.isHidden = true
         return emptyView
         return emptyView
     }()
     }()
+
     override func viewDidLoad() {
     override func viewDidLoad() {
         super.viewDidLoad()
         super.viewDidLoad()
         view.addSubview(collectionView)
         view.addSubview(collectionView)
@@ -60,10 +61,19 @@ class MVMineProductController: PQBaseViewController {
         leftBackButton()
         leftBackButton()
         loadRequestData()
         loadRequestData()
         setTitle(title: BFLoginUserInfo.shared.nickName, color: UIColor(white: 0, alpha: 0))
         setTitle(title: BFLoginUserInfo.shared.nickName, color: UIColor(white: 0, alpha: 0))
-        MVMineViewModel.userInfoData { [weak self] count, _ in
+        MVMineViewModel.userInfoData { [weak self] count, avatarUrl, nickName, msg in
             if count != nil {
             if count != nil {
                 BFLoginUserInfo.shared.videos = "\(count ?? 0)"
                 BFLoginUserInfo.shared.videos = "\(count ?? 0)"
-                self?.headInfoView.updateProducts()
+            }
+            if avatarUrl != nil, (avatarUrl?.count ?? 0) > 0 {
+                BFLoginUserInfo.shared.avatarUrl = avatarUrl ?? ""
+            }
+            if nickName != nil, (nickName?.count ?? 0) > 0 {
+                BFLoginUserInfo.shared.nickName = nickName ?? ""
+            }
+            if msg == nil {
+                saveUserDefaults(key: cUserInfoStorageKey, value: BFLoginUserInfo.shared.toString())
+                self?.headInfoView.addData()
             }
             }
         }
         }
     }
     }
@@ -118,7 +128,7 @@ extension MVMineProductController: UICollectionViewDelegate, UICollectionViewDat
         let cell = MVMineProductCell.productCell(collectionView: collectionView, indexPath: indexPath)
         let cell = MVMineProductCell.productCell(collectionView: collectionView, indexPath: indexPath)
         cell.videoData = itemData
         cell.videoData = itemData
         cell.btnClickHandle = { [weak self] sender, videoData in
         cell.btnClickHandle = { [weak self] sender, videoData in
-            self?.btnClickHandle(sender: sender, videoData: videoData)
+            self?.btnClickHandle(sender: sender, videoData: videoData, indexPath: indexPath)
         }
         }
         return cell
         return cell
     }
     }
@@ -156,33 +166,63 @@ extension MVMineProductController: UICollectionViewDelegate, UICollectionViewDat
     /// - Parameters:
     /// - Parameters:
     ///   - sender: <#sender description#>
     ///   - sender: <#sender description#>
     ///   - videoData: <#videoData description#>
     ///   - videoData: <#videoData description#>
-    func btnClickHandle(sender _: UIButton, videoData: PQVideoListModel?) {
-        let seleView = PQSelectedOprationView.showSelectedOprationView(itemList: ["删除视频"]) { sender in
-            if sender.tag == 1 {
-                PQBaseViewModel.deleteVideo(videoId: Int(videoData?.uniqueId ?? "0") ?? 0) { [weak self] isSuccess, videoId, _ in
-                    if isSuccess {
-                        self?.itemsList.removeAll(where: { tempVideo in
-                            tempVideo.uniqueId == "\(videoId)"
-                        })
-                        self?.flowLayout.findList = self?.itemsList as! [PQVideoListModel]
-                        self?.collectionView.reloadData()
-                        cShowHUB(superView: nil, msg: "删除成功")
-                        if (self?.itemsList.count ?? 0) <= 0 {
-                            self?.loadRequestData()
+    func btnClickHandle(sender: UIButton, videoData: PQVideoListModel?, indexPath: IndexPath) {
+        switch sender.tag {
+        case 1:
+            let seleView = PQSelectedOprationView.showSelectedOprationView(itemList: ["删除视频"]) { sender in
+                if sender.tag == 1 {
+                    if !isNetConnected() {
+                        cShowHUB(superView: nil, msg: "没有网络连接")
+                        return
+                    }
+                    PQBaseViewModel.deleteVideo(videoId: Int(videoData?.uniqueId ?? "0") ?? 0) { [weak self] isSuccess, videoId, _ in
+                        if isSuccess {
+                            self?.itemsList.removeAll(where: { tempVideo in
+                                tempVideo.uniqueId == "\(videoId)"
+                            })
+                            self?.flowLayout.findList = self?.itemsList as! [PQVideoListModel]
+                            self?.collectionView.reloadData()
+                            cShowHUB(superView: nil, msg: "删除成功")
+                            if (self?.itemsList.count ?? 0) <= 0 {
+                                self?.loadRequestData()
+                            }
+                            var videos: Int = (Int(BFLoginUserInfo.shared.videos) ?? 0) - 1
+                            if videos < 0 {
+                                videos = 0
+                            }
+                            BFLoginUserInfo.shared.videos = "\(videos)"
+                            self?.headInfoView.updateProducts()
+                        } else {
+                            cShowHUB(superView: nil, msg: "删除失败")
                         }
                         }
                     }
                     }
                 }
                 }
             }
             }
+            seleView.contentView.backgroundColor = UIColor.hexColor(hexadecimal: "#F2F2F2")
+            seleView.cancelBtn.backgroundColor = UIColor.white
+            seleView.cancelBtn.setTitleColor(UIColor.black, for: .normal)
+            seleView.cancelBtn.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
+            let firstBtn: UIButton? = seleView.contentView.subviews[1] as? UIButton
+            firstBtn?.backgroundColor = UIColor.white
+            firstBtn?.setTitleColor(UIColor.hexColor(hexadecimal: "#FF0000"), for: .normal)
+            firstBtn?.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
+            seleView.contentView.subviews[2].backgroundColor = UIColor.hexColor(hexadecimal: "#F2F2F2")
+        case 2:
+            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) {
+                    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
+                    self?.collectionView.reloadData()
+                    self?.collectionView(self!.collectionView, didSelectItemAt: indexPath)
+                } else {
+                    cShowHUB(superView: nil, msg: "请稍后再刷新")
+                }
+            }
+        default:
+            break
         }
         }
-        seleView.contentView.backgroundColor = UIColor.hexColor(hexadecimal: "#F2F2F2")
-        seleView.cancelBtn.backgroundColor = UIColor.white
-        seleView.cancelBtn.setTitleColor(UIColor.black, for: .normal)
-        seleView.cancelBtn.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
-        let firstBtn: UIButton? = seleView.contentView.subviews[1] as? UIButton
-        firstBtn?.backgroundColor = UIColor.white
-        firstBtn?.setTitleColor(UIColor.hexColor(hexadecimal: "#FF0000"), for: .normal)
-        firstBtn?.titleLabel?.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
-        seleView.contentView.subviews[2].backgroundColor = UIColor.hexColor(hexadecimal: "#F2F2F2")
     }
     }
 
 
     @objc func btnClick(sender _: UIButton) {}
     @objc func btnClick(sender _: UIButton) {}

+ 38 - 1
MusicVideoPlus/Classes/Modules/Mine/Controllers/MVPlayViewController.swift

@@ -13,11 +13,14 @@ class MVPlayViewController: PQBaseViewController {
     var itemsList: [PQVideoListModel] = Array<PQVideoListModel>.init()
     var itemsList: [PQVideoListModel] = Array<PQVideoListModel>.init()
     var pageNum: Int = 1
     var pageNum: Int = 1
     var currentIndex: IndexPath?
     var currentIndex: IndexPath?
+    var currentActionBtn: UIButton? // 记录上次点击按钮
+    var currentVideoData: PQVideoListModel? // 记录上次点击数据
     lazy var leftBtn: UIButton = {
     lazy var leftBtn: UIButton = {
         let leftBtn = UIButton(type: .custom)
         let leftBtn = UIButton(type: .custom)
         leftBtn.frame = CGRect(x: 0, y: cDevice_iPhoneStatusBarHei, width: cDefaultMargin * 4, height: cDefaultMargin * 4)
         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.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: -5, right: 0)
-        leftBtn.setImage(UIImage().BF_Image(named: "icon_detail_back"), for: .normal)
+        leftBtn.tintColor = UIColor.white
+        leftBtn.setImage(UIImage().BF_Image(named: "icon_detail_back").withRenderingMode(.alwaysTemplate), for: .normal)
         leftBtn.addTarget(self, action: #selector(backBtnClick), for: .touchUpInside)
         leftBtn.addTarget(self, action: #selector(backBtnClick), for: .touchUpInside)
         return leftBtn
         return leftBtn
     }()
     }()
@@ -77,6 +80,8 @@ class MVPlayViewController: PQBaseViewController {
         PQSingletoVideoPlayer.shared.progressBloc = { [weak self] _, playProgress, duration in
         PQSingletoVideoPlayer.shared.progressBloc = { [weak self] _, playProgress, duration in
             (self?.collectionView.visibleCell() as? MVPlayControlViewCell)?.updateProgress(progress: playProgress / duration)
             (self?.collectionView.visibleCell() as? MVPlayControlViewCell)?.updateProgress(progress: playProgress / duration)
         }
         }
+
+        PQNotification.addObserver(self, selector: #selector(didBecomeActiveNotification), name: UIApplication.didBecomeActiveNotification, object: nil)
     }
     }
 
 
     override func viewDidAppear(_ animated: Bool) {
     override func viewDidAppear(_ animated: Bool) {
@@ -114,6 +119,10 @@ class MVPlayViewController: PQBaseViewController {
             self?.collectionView.mj_footer?.endRefreshing()
             self?.collectionView.mj_footer?.endRefreshing()
         }
         }
     }
     }
+
+    deinit {
+        PQNotification.removeObserver(self)
+    }
 }
 }
 
 
 extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSource, UIScrollViewDelegate {
 extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSource, UIScrollViewDelegate {
@@ -186,6 +195,8 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
                     return
                     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
                 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
+                    self?.currentActionBtn = sender
+                    self?.currentVideoData = videoData
                 }
                 }
                 cHiddenHUB(superView: nil)
                 cHiddenHUB(superView: nil)
             }
             }
@@ -199,6 +210,8 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
                 cHiddenHUB(superView: nil)
                 cHiddenHUB(superView: nil)
                 if path != 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
                     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
+                        self?.currentActionBtn = sender
+                        self?.currentVideoData = videoData
                     }
                     }
                 } else {
                 } else {
                     cShowHUB(superView: nil, msg: "网络不佳哦")
                     cShowHUB(superView: nil, msg: "网络不佳哦")
@@ -208,4 +221,28 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
             break
             break
         }
         }
     }
     }
+
+    @objc func didBecomeActiveNotification() {
+        if currentActionBtn != nil {
+            DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {
+                cShowHUB(superView: nil, msg: "分享成功")
+            }
+            if currentActionBtn?.tag == 4 {
+                if currentVideoData?.shareCountFriend != nil, currentVideoData?.shareCountFriend ?? 0 > 0 {
+                    currentVideoData?.shareCountFriend = (currentVideoData?.shareCountFriend ?? 0) + 1
+                } else {
+                    currentVideoData?.shareCountFriend = 1
+                }
+            } else if currentActionBtn?.tag == 5 {
+                if currentVideoData?.shareCount != nil, currentVideoData?.shareCount ?? 0 > 0 {
+                    currentVideoData?.shareCount = (currentVideoData?.shareCount ?? 0) + 1
+                } else {
+                    currentVideoData?.shareCount = 1
+                }
+            }
+            currentActionBtn = nil
+            currentVideoData = nil
+            collectionView.reloadData()
+        }
+    }
 }
 }

+ 5 - 3
MusicVideoPlus/Classes/Modules/Mine/ViewModel/MVMineViewModel.swift

@@ -39,13 +39,15 @@ class MVMineViewModel: NSObject {
 
 
     /// 获取用户信息
     /// 获取用户信息
     /// - Parameter completeHander: <#completeHander description#>
     /// - Parameter completeHander: <#completeHander description#>
-    class func userInfoData(completeHander: @escaping (_ videoCount: Int?, _ msg: String?) -> Void) {
+    class func userInfoData(completeHander: @escaping (_ videoCount: Int?, _ avatarUrl: String?, _ nickName: String?, _ msg: String?) -> Void) {
         SWNetRequest.postRequestData(url: PQENVUtil.shared.clipapiapi + userInfoUrl, parames: nil) { response, _, error, _ in
         SWNetRequest.postRequestData(url: PQENVUtil.shared.clipapiapi + userInfoUrl, parames: nil) { response, _, error, _ in
             if response is NSNull || response == nil {
             if response is NSNull || response == nil {
-                completeHander(nil, error?.msg)
+                completeHander(nil, nil, nil, error?.msg ?? "加载失败")
             } else {
             } else {
                 let videoCount: Int? = Int("\((response as? [String: Any])?["videoCount"] ?? "0")")
                 let videoCount: Int? = Int("\((response as? [String: Any])?["videoCount"] ?? "0")")
-                completeHander(videoCount, error?.msg)
+                let avatarUrl: String? = "\((response as? [String: Any])?["avatarUrl"] ?? "")"
+                let nickName: String? = "\((response as? [String: Any])?["nickName"] ?? "")"
+                completeHander(videoCount, avatarUrl, nickName, nil)
             }
             }
         }
         }
     }
     }

+ 0 - 2
MusicVideoPlus/Classes/Modules/Mine/Views/MVMineHeadInfoView.swift

@@ -22,7 +22,6 @@ class MVMineHeadInfoView: UIView {
         let nickNameLab = UILabel()
         let nickNameLab = UILabel()
         nickNameLab.textColor = .black
         nickNameLab.textColor = .black
         nickNameLab.numberOfLines = 1
         nickNameLab.numberOfLines = 1
-        nickNameLab.lineBreakMode = .byCharWrapping
         nickNameLab.font = UIFont.systemFont(ofSize: 24, weight: .bold)
         nickNameLab.font = UIFont.systemFont(ofSize: 24, weight: .bold)
         return nickNameLab
         return nickNameLab
     }()
     }()
@@ -31,7 +30,6 @@ class MVMineHeadInfoView: UIView {
         let productsLabel = UILabel()
         let productsLabel = UILabel()
         productsLabel.textColor = UIColor(white: 0, alpha: 0.5)
         productsLabel.textColor = UIColor(white: 0, alpha: 0.5)
         productsLabel.numberOfLines = 1
         productsLabel.numberOfLines = 1
-        productsLabel.lineBreakMode = .byCharWrapping
         productsLabel.font = UIFont.systemFont(ofSize: 14, weight: .semibold)
         productsLabel.font = UIFont.systemFont(ofSize: 14, weight: .semibold)
         return productsLabel
         return productsLabel
     }()
     }()

+ 25 - 4
MusicVideoPlus/Classes/Modules/Mine/Views/MVMineProductCell.swift

@@ -44,15 +44,25 @@ class MVMineProductCell: UICollectionViewCell {
         titleLabel.textAlignment = .left
         titleLabel.textAlignment = .left
         titleLabel.textColor = .white
         titleLabel.textColor = .white
         titleLabel.numberOfLines = 1
         titleLabel.numberOfLines = 1
-        titleLabel.lineBreakMode = .byCharWrapping
         titleLabel.font = UIFont.systemFont(ofSize: 16, weight: .bold)
         titleLabel.font = UIFont.systemFont(ofSize: 16, weight: .bold)
         return titleLabel
         return titleLabel
     }()
     }()
 
 
+    lazy var statusBtn: UIButton = {
+        let statusBtn = UIButton(type: .custom)
+        statusBtn.backgroundColor = cShadowColor
+        statusBtn.titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: .medium)
+        statusBtn.setTitleColor(UIColor.white, for: .normal)
+        statusBtn.tag = 2
+        statusBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
+        return statusBtn
+    }()
+
     override init(frame: CGRect) {
     override init(frame: CGRect) {
         super.init(frame: frame)
         super.init(frame: frame)
         contentView.addSubview(coverImageView)
         contentView.addSubview(coverImageView)
         coverImageView.addSubview(marksView)
         coverImageView.addSubview(marksView)
+        contentView.addSubview(statusBtn)
         contentView.addSubview(moreBtn)
         contentView.addSubview(moreBtn)
         contentView.addSubview(titleLabel)
         contentView.addSubview(titleLabel)
     }
     }
@@ -77,29 +87,40 @@ class MVMineProductCell: UICollectionViewCell {
         let coverImg = (videoData?.videoCoverSnapshotPath != nil && (videoData?.videoCoverSnapshotPath?.count ?? 0) > 0) ? videoData?.videoCoverSnapshotPath ?? "" : videoData?.coverImg?["coverImgPath"] as! String
         let coverImg = (videoData?.videoCoverSnapshotPath != nil && (videoData?.videoCoverSnapshotPath?.count ?? 0) > 0) ? videoData?.videoCoverSnapshotPath ?? "" : videoData?.coverImg?["coverImgPath"] as! String
         coverImageView.setNetImage(url: coverImg)
         coverImageView.setNetImage(url: coverImg)
         titleLabel.text = videoData?.title ?? ""
         titleLabel.text = videoData?.title ?? ""
+        statusBtn.isHidden = (videoData?.auditStatus == 5 && videoData?.transcodeStatus == 3 && (videoData?.transcodeStatus == 1 || videoData?.transcodeStatus == 3))
+        if videoData?.transcodeStatus == 2 {
+            statusBtn.setTitle("转码中", for: .normal)
+        } else {
+            statusBtn.setTitle("制作中", for: .normal)
+        }
     }
     }
 
 
     func addLayout() {
     func addLayout() {
         let margin: CGFloat = 12
         let margin: CGFloat = 12
-        let moreH: CGFloat = 40
+        let moreH: CGFloat = 30
 
 
         coverImageView.snp.remakeConstraints { make in
         coverImageView.snp.remakeConstraints { make in
             make.size.equalToSuperview()
             make.size.equalToSuperview()
         }
         }
 
 
+        statusBtn.snp.makeConstraints { make in
+            make.size.equalToSuperview()
+        }
+
         marksView.snp.remakeConstraints { make in
         marksView.snp.remakeConstraints { make in
             make.width.left.bottom.equalToSuperview()
             make.width.left.bottom.equalToSuperview()
         }
         }
 
 
         moreBtn.snp.remakeConstraints { make in
         moreBtn.snp.remakeConstraints { make in
             make.width.height.equalTo(moreH)
             make.width.height.equalTo(moreH)
-            make.bottom.right.equalToSuperview()
+            make.right.equalToSuperview()
+            make.bottom.equalToSuperview().offset(-cDefaultMargin)
         }
         }
 
 
         titleLabel.snp.remakeConstraints { make in
         titleLabel.snp.remakeConstraints { make in
             make.centerY.equalTo(moreBtn)
             make.centerY.equalTo(moreBtn)
             make.left.equalToSuperview().offset(margin)
             make.left.equalToSuperview().offset(margin)
-            make.right.equalTo(moreBtn.snp_left)
+            make.right.equalTo(moreBtn.snp_left).offset(cDefaultMargin / 2)
         }
         }
     }
     }
 
 

+ 3 - 1
MusicVideoPlus/Classes/Modules/Home/Views/MVPlayControlViewCell.swift → MusicVideoPlus/Classes/Modules/Mine/Views/MVPlayControlViewCell.swift

@@ -43,6 +43,8 @@ class MVPlayControlViewCell: UICollectionViewCell {
     lazy var nickNameBtn: UIButton = {
     lazy var nickNameBtn: UIButton = {
         let nickNameBtn = UIButton(type: .custom)
         let nickNameBtn = UIButton(type: .custom)
         nickNameBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
         nickNameBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
+        nickNameBtn.titleLabel?.lineBreakMode = .byTruncatingTail
+        nickNameBtn.contentHorizontalAlignment = .left
         nickNameBtn.setTitleColor(UIColor.white, for: .normal)
         nickNameBtn.setTitleColor(UIColor.white, for: .normal)
         nickNameBtn.tag = 2
         nickNameBtn.tag = 2
         nickNameBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
         nickNameBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)
@@ -70,7 +72,6 @@ class MVPlayControlViewCell: UICollectionViewCell {
         titleLabel.textAlignment = .left
         titleLabel.textAlignment = .left
         titleLabel.textColor = .white
         titleLabel.textColor = .white
         titleLabel.numberOfLines = 5
         titleLabel.numberOfLines = 5
-        titleLabel.lineBreakMode = .byCharWrapping
         titleLabel.font = UIFont.systemFont(ofSize: 16, weight: .bold)
         titleLabel.font = UIFont.systemFont(ofSize: 16, weight: .bold)
         return titleLabel
         return titleLabel
     }()
     }()
@@ -292,6 +293,7 @@ class MVPlayControlViewCell: UICollectionViewCell {
 
 
         nickNameBtn.snp.remakeConstraints { make in
         nickNameBtn.snp.remakeConstraints { make in
             make.left.equalTo(reCreateBtn)
             make.left.equalTo(reCreateBtn)
+            make.right.equalTo(musicContenView)
             make.bottom.equalTo(titleLabel.snp_top).offset(-margin / 2)
             make.bottom.equalTo(titleLabel.snp_top).offset(-margin / 2)
         }
         }