Browse Source

视频播放调试完成

南鑫林 5 years ago
parent
commit
328d3d0896

+ 7 - 9
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/Location/ViewController/LocationViewController.swift

@@ -68,15 +68,13 @@ class LocationViewController: BaseViewController {
     
     private func setDeliveryMethodType() { //快递
         SwiftMoyaNetWorkServiceUser.shared().userSetDeliverTypeApi(deliveryMethodType: "2") { (data) -> (Void) in
-            kAppDelegate.setTabbarController()
-
-//            if self.presentingViewController != nil {
-//                self.dismiss(animated: false, completion: {
-//                    kAppDelegate.setTabbarController()
-//                })
-//            } else {
-//                kAppDelegate.setTabbarController()
-//            }
+            if self.presentingViewController != nil {
+                self.dismiss(animated: false, completion: {
+                    kAppDelegate.setTabbarController()
+                })
+            } else {
+                kAppDelegate.setTabbarController()
+            }
         }
     }
     

+ 7 - 8
RainbowPlanet/RainbowPlanet/Modules/CommonModules/LocationModule/SelfRecommendation/ViewController/SelfRecommendationViewController.swift

@@ -94,15 +94,14 @@ class SelfRecommendationViewController: BaseViewController {
     
     private func tabbarController(deliveryMethodType:String) {
         SwiftMoyaNetWorkServiceUser.shared().userSetDeliverTypeApi(deliveryMethodType: deliveryMethodType) { (data) -> (Void) in
-            kAppDelegate.setTabbarController()
 
-//                if self.presentingViewController != nil {
-//                    self.dismiss(animated: false, completion: {
-//                        kAppDelegate.setTabbarController()
-//                    })
-//                } else {
-//                    kAppDelegate.setTabbarController()
-//                }
+                if self.presentingViewController != nil {
+                    self.dismiss(animated: false, completion: {
+                        kAppDelegate.setTabbarController()
+                    })
+                } else {
+                    kAppDelegate.setTabbarController()
+                }
         }
         
         

+ 28 - 9
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift

@@ -70,6 +70,8 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         // 视频播放
         addSubview(videoPlayView)
         videoPlayView.addTapGesture(1, target: self, action: #selector(videoTapAction))
+        addSubview(bottomSepView)
+        addSubview(bgView)
         
         // 顶部渐变
         addSubview(topGradientView)
@@ -86,7 +88,6 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         
         // 底部
         bottomGradientView.addSubview(bottomCommentView)
-        bottomCommentView.addSubview(bottomSepView)
         bottomCommentView.addSubview(commentBtn)
         bottomCommentView.addSubview(collectBtn)
         bottomCommentView.addSubview(likeBtn)
@@ -156,8 +157,9 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
             make.height.equalTo(60)
         }
         bottomSepView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(1)
+            make.left.right.equalToSuperview()
+            make.height.equalTo(0.5)
+            make.bottom.equalToSuperview().offset(-(kSafeTabBarHeight + 60))
         }
         
         commentBtn.snp.makeConstraints { (make) in
@@ -185,7 +187,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
             make.centerY.equalToSuperview()
             make.left.equalToSuperview().offset(14)
             make.right.equalTo(likeBtn.snp_left).offset(-10)
-            make.height.equalTo(28)
+            make.height.equalTo(30)
         }
         commentLabel.snp.makeConstraints { (make) in
             make.left.equalTo(15)
@@ -361,6 +363,13 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         contentLabel.attributedText = attri
     }
     
+    lazy var bgView: UIView = {
+        let bgView = UIView(frame: self.frame)
+        bgView.backgroundColor = UIColor(hexString: "000000", alpha: 0.1)
+        bgView.isUserInteractionEnabled = true
+        return bgView
+    }()
+    
     // MARK: 视频播放View
     private lazy var videoPlayView: CommunityVideoPlayView = {
         let videoPlayView = CommunityVideoPlayView()
@@ -377,16 +386,26 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         bgLayer1.colors = [UIColor(red: 0, green: 0, blue: 0, alpha: 0.5).cgColor, UIColor(red: 0, green: 0, blue: 0, alpha: 0).cgColor]
         bgLayer1.locations = [0, 1]
         bgLayer1.frame = topGradientView.bounds
-        bgLayer1.startPoint = CGPoint(x: 0.5, y: 0)
-        bgLayer1.endPoint = CGPoint(x: 1, y: 1)
+        bgLayer1.startPoint = CGPoint(x: 0, y: 0)
+        bgLayer1.endPoint = CGPoint(x: 0, y: 1)
         topGradientView.layer.addSublayer(bgLayer1)
+        topGradientView.layer.cornerRadius = 2;
+        topGradientView.alpha = 1
         return topGradientView
     }()
     
     private lazy var bottomGradientView: UIView = {
         let bottomGradientView = UIView()
         bottomGradientView.frame = CGRect(x: 0, y: kScreenHeight-kSafeTabBarHeight-270, width: kScreenWidth, height: 270+kSafeTabBarHeight)
-        bottomGradientView.backgroundColor = kRGBAColor(r: 0, g: 0, b: 0, a: 0.4)
+        let bgLayer1 = CAGradientLayer()
+        bgLayer1.colors = [UIColor(red: 0, green: 0, blue: 0, alpha: 0.8).cgColor, UIColor(red: 0, green: 0, blue: 0, alpha: 0).cgColor]
+        bgLayer1.locations = [0, 1]
+        bgLayer1.frame = bottomGradientView.bounds
+        bgLayer1.startPoint = CGPoint(x: 0, y: 1)
+        bgLayer1.endPoint = CGPoint(x: 0, y: 0)
+        bottomGradientView.layer.addSublayer(bgLayer1)
+        bottomGradientView.layer.cornerRadius = 2;
+        bottomGradientView.alpha = 1
         return bottomGradientView
     }()
     
@@ -443,7 +462,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
     
     private lazy var bottomSepView: UIView = {
         let bottomSepView = UIView()
-        bottomSepView.backgroundColor = kDDDDDDColor
+        bottomSepView.backgroundColor = kffffffColor.withAlphaComponent(0.8)
         return bottomSepView
     }()
     
@@ -513,7 +532,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
     
     private lazy var commentView: UIView = {
         let commentView = UIView()
-        commentView.backgroundColor = kRGBAColor(r: 0/255.0, g: 0/255.0, b: 0/255.0, a: 0.3)
+        commentView.backgroundColor = kffffffColor.withAlphaComponent(0.3)
         commentView.cornerRadius = 15
         commentView.masksToBounds = true
         return commentView

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoSelTopicCell.swift

@@ -54,12 +54,12 @@ class CommunityVideoSelTopicCell: UICollectionViewCell {
     
     private func setupLayouts() {
         iconImageView.snp.makeConstraints { (make) in
-            make.top.equalTo(5)
+            make.centerY.equalToSuperview()
             make.left.equalTo(6)
             make.size.equalTo(16)
         }
         titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(3)
+            make.centerY.equalToSuperview()
             make.left.equalTo(iconImageView.snp_right).offset(5)
             make.right.equalTo(-6)
             make.height.equalTo(19)

+ 5 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoTopicView.swift

@@ -29,7 +29,6 @@ class CommunityVideoTopicView: BaseView {
         collectionView.dataSource = self;
         collectionView.showsVerticalScrollIndicator = false
         collectionView.showsHorizontalScrollIndicator = false
-        collectionView.bounces = false
         return collectionView
     }()
     
@@ -67,7 +66,7 @@ extension CommunityVideoTopicView: UICollectionViewDelegateFlowLayout,UICollecti
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         let cell = CommunityVideoSelTopicCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        cell.topicMdl = topicArray![indexPath.row]
+        cell.topicMdl = topicArray?[indexPath.row]
         return cell
     }
     
@@ -76,7 +75,10 @@ extension CommunityVideoTopicView: UICollectionViewDelegateFlowLayout,UICollecti
     }
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        print("点击了collection----\(indexPath.row)")
+        let topicMdl = topicArray?[indexPath.row]
+        let vc = CommunityFeaturedTopicsViewController()
+        vc.id = topicMdl?.id ?? 0
+        findViewController().navigationController?.pushViewController(vc, animated: true)
     }
     
 }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeTwoCollectionViewCell.swift

@@ -128,7 +128,7 @@ class MessageHomeTwoCollectionViewCell: UICollectionViewCell {
             }
             subLabel.text = messageModel?.view?.content
             timeLabel.text = messageModel?.view?.createdAt
-            if messageModel?.view?.content == nil {
+            if messageModel?.view?.content == nil || messageModel?.view?.content == "" {
                 titleLabel.snp.remakeConstraints { (make) in
                     make.centerY.equalToSuperview()
                     make.left.equalTo(iconImageView.snp_right).offset(8)

+ 0 - 17
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListCollectionViewCell.swift

@@ -116,21 +116,4 @@ class PersonViewUserAndOtherListCollectionViewCell: UICollectionViewCell {
             }
         }
     }
-    
-    var personalCenterVCType: Int? {
-        didSet {
-            if personalCenterVCType == 0 {
-                iconImageView.isHidden = false
-                rainbowBeanNumberLabel.isHidden = false
-            }
-            if personalCenterVCType == 1 {
-                iconImageView.isHidden = true
-                rainbowBeanNumberLabel.isHidden = true
-            }
-            if personalCenterVCType == 2 {
-                iconImageView.isHidden = true
-                rainbowBeanNumberLabel.isHidden = true
-            }
-        }
-    }
 }

+ 0 - 1
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListView.swift

@@ -115,7 +115,6 @@ extension PersonViewUserAndOtherListView: UICollectionViewDelegateFlowLayout,UIC
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         let cell = PersonViewUserAndOtherListCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
         cell.postMyModel = postMyModels[indexPath.row]
-        cell.personalCenterVCType = personalCenterVCType
         return cell
         
     }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/MobileLogin/ViewController/MobileLoginViewController.swift

@@ -45,13 +45,13 @@ class MobileLoginViewController: BaseViewController {
                 
                 if UserModel.shared().getModel()?.isNewMember == 1 {
                     VirusViewModel.shared.registeredVirueRecordAddApi()
-                }
-                if(UserModel.shared().getModel()?.gender == nil || UserModel.shared().getModel()?.gender == 0) {//设置性别话题
+                }else if(UserModel.shared().getModel()?.gender == nil || UserModel.shared().getModel()?.gender == 0) {//设置性别话题
                     self?.present(GenderSelectionViewController(), animated: true, completion: {
                         
                     })
                 }else {// 设置首页
                     kAppDelegate.setTabbarController()
+                    self?.navigationController?.popToRootViewController(animated: false)
                 }
             })
             

+ 1 - 8
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/PasswordLogin/ViewController/PasswordLoginViewController.swift

@@ -32,14 +32,7 @@ class PasswordLoginViewController: BaseViewController {
         passwordLoginView.loginBlock = {
             [weak self] (phoneNumber,password) in
             SwiftMoyaNetWorkServiceUser.shared().userMobileLoginApi(mobile: phoneNumber, password: password, completion: { (data) -> (Void) in
-                if(UserModel.shared().getModel()?.gender == nil || UserModel.shared().getModel()?.gender == 0) {//设置性别话题
-                    self?.present(GenderSelectionViewController(), animated: true, completion: {
-                        
-                    })
-                }else {// 设置首页
-                    kAppDelegate.setTabbarController()
-                }
-
+                kAppDelegate.setTabbarController()
             })
         }
         //忘记密码

+ 6 - 7
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/TopicSelection/ViewController/TopicSelectionViewController.swift

@@ -162,13 +162,12 @@ extension TopicSelectionViewController {
             let userModel = UserModel.shared().getModel()
             userModel?.isFollowSuggestTopic = 1
             UserModel.shared().setModel(model: userModel!)
-            kAppDelegate.setTabbarController()
-//            if self?.presentingViewController != nil {
-//                self?.dismiss(animated: false, completion: {
-//                })
-//            } else {
-//                kAppDelegate.setTabbarController()
-//            }
+            if self?.presentingViewController != nil {
+                self?.dismiss(animated: false, completion: {
+                })
+            } else {
+                kAppDelegate.setTabbarController()
+            }
         }
     }
 }