ソースを参照

播放页收起展开细节fixed

Chris 5 年 前
コミット
03d980f063

ファイルの差分が大きいため隠しています
+ 135 - 18
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift


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

@@ -61,7 +61,7 @@ class CommunityVideoSelTopicCell: UICollectionViewCell {
         titleLabel.snp.makeConstraints { (make) in
             make.top.equalTo(3)
             make.left.equalTo(iconImageView.snp_right).offset(5)
-            make.right.equalTo(-26)
+            make.right.equalTo(-6)
             make.height.equalTo(19)
         }
     }

+ 36 - 0
RainbowPlanet/RainbowPlanet/ViewModel/Community/CommunityFollowUserViewModel.swift

@@ -65,6 +65,42 @@ class CommunityFollowUserViewModel: NSObject {
         }
     }
     
+    /// 设置关注
+    ///
+    /// - Parameters:
+    ///   - followButton: 关注button
+    ///   - followType: 关注类型
+    func setVideoFollowType(followButton:UIButton,followType: FollowType) {
+        switch followType {
+        case .futureFollow:
+            followButton.setTitle("关注", for: UIControl.State.normal)
+            followButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+            followButton.setImage(kImage(name: "star_attention"), for: UIControl.State.normal)
+            followButton.layer.borderColor = kThemeColor.cgColor
+            followButton.setBackgroundImage(UIImage.imageWithColor(color: kThemeColor), for: UIControl.State.normal)
+            followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 2)
+            
+            break
+        case .alreadyFollow:
+            followButton.setTitle("关注", for: UIControl.State.normal)
+            followButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+            followButton.setImage(kImage(name: "star_followed"), for: UIControl.State.normal)
+            followButton.layer.borderColor = kffffffColor.cgColor
+            followButton.setBackgroundImage(UIImage.imageWithColor(color: UIColor.clear), for: UIControl.State.normal)
+            followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 2)
+            break
+        case .mutualFollow:
+            followButton.setTitle("互相关注", for: UIControl.State.normal)
+            followButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+            followButton.setImage(nil, for: UIControl.State.normal)
+            followButton.layer.borderColor = kffffffColor.cgColor
+            followButton.setBackgroundImage(UIImage.imageWithColor(color: UIColor.clear), for: UIControl.State.normal)
+            followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 0)
+            
+            break
+        }
+    }
+    
 }
 
 // MARK: - communityPostDetailModel