Forráskód Böngészése

关注页面完成

南鑫林 5 éve
szülő
commit
ec3d3775ea

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/CommentList/CardContentCommentListTableViewCell.swift

@@ -55,6 +55,7 @@ class CardContentCommentListTableViewCell: UITableViewCell {
         tableView.tableFooterView = footerView
         tableView.dataSource = self
         tableView.delegate = self
+        tableView.isScrollEnabled = false
         return tableView
     }()
     
@@ -77,8 +78,8 @@ class CardContentCommentListTableViewCell: UITableViewCell {
         let contentSize = self.tableView.contentSize
         tableView.snp.remakeConstraints { (make) in
             make.top.left.right.equalToSuperview()
-            make.height.equalTo(contentSize.height)
-//            make.bottom.lessThanOrEqualToSuperview()
+            make.height.equalTo(contentSize.height - 54)
+            make.bottom.lessThanOrEqualToSuperview()
         }
         
     }

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoCollectionViewCell.swift

@@ -35,6 +35,7 @@ class CardContentPicVideoCollectionViewCell: UICollectionViewCell {
     
     //MARK: - 设置view
     private func setupViews() {
+        backgroundColor = .gray
         self.cornerRadius = 2
         self.masksToBounds = true
         addSubview(iconImageView)
@@ -47,8 +48,8 @@ class CardContentPicVideoCollectionViewCell: UICollectionViewCell {
     }
     
     private lazy var iconImageView: UIImageView = {
-        let iconImageView = UIImageView()
-        iconImageView.image = kImage(name: "pic_preload")
+        let iconImageView = UIImageView.init(image: kImage(name: "pic_preload"))
+        iconImageView.contentMode = .scaleAspectFit
         return iconImageView
     }()
     

+ 128 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoCollectionViewLayout.swift

@@ -9,5 +9,133 @@
 import UIKit
 
 class CardContentPicVideoCollectionViewLayout: UICollectionViewLayout {
+    
+    var cardContentPicVideoModel: CardContentPicVideoModel? {
+        didSet {
+            
+        }
+    }
+    
+    //子类必须重写此方法。
+    //并使用它来返回CollectionView视图内容的宽高,
+    //这个值代表的是所有的内容的宽高,并不是当前可见的部分。
+    //CollectionView将会使用该值配置内容的大小来促进滚动。
+    override var collectionViewContentSize: CGSize {
+        return CGSize(width: kScreenWidth-28 , height: (cardContentPicVideoModel?.collectionViewHeight() ?? 0))
+    }
+    
+    // 所有单元格位置属性
+    override func layoutAttributesForElements(in rect: CGRect)
+        -> [UICollectionViewLayoutAttributes]? {
+            var attributesArray = [UICollectionViewLayoutAttributes]()
+            let cellCount = self.collectionView!.numberOfItems(inSection: 0)
+            for i in 0..<cellCount {
+                let indexPath =  IndexPath(item:i, section:0)
+                let attributes =  self.layoutAttributesForItem(at: indexPath)
+                attributesArray.append(attributes!)
+            }
+            return attributesArray
+    }
+    
+    // 这个方法返回每个单元格的位置和大小
+    override func layoutAttributesForItem(at indexPath: IndexPath)
+        -> UICollectionViewLayoutAttributes? {
+            //当前单元格布局属性
+            let attribute =  UICollectionViewLayoutAttributes(forCellWith:indexPath)
+            attribute.frame = collectionCellFrame(at: indexPath)
+            return attribute
+    }
+    
+    func collectionCellFrame(at indexPath: IndexPath) -> CGRect {
+        
+        let spacing : CGFloat = 1
+        
+        if cardContentPicVideoModel?.picAndVideo == 0 { //图片
+            switch cardContentPicVideoModel?.number {
+            case 1:
+                if cardContentPicVideoModel?.width ?? 0 < cardContentPicVideoModel?.height ?? 0 { //图片宽度小于图片高度
+                    if (cardContentPicVideoModel?.height ?? 0) / (cardContentPicVideoModel?.width ?? 0) > 2 {
+                        return CGRect(x: 0, y: 0, width: (cardContentPicVideoModel?.width ?? 0) * kScaleWidth, height: 347 * kScaleWidth)
 
+                    }else {
+                        return CGRect(x: 0, y: 0, width: (cardContentPicVideoModel?.width ?? 0) * kScaleWidth, height: 232 * kScaleWidth)
+                    }
+                }else if cardContentPicVideoModel?.width ?? 0 == cardContentPicVideoModel?.height ?? 0 { //图片宽度等于图片高度
+                    return CGRect(x: 0, y: 0, width: 232 * kScaleWidth, height: 232 * kScaleWidth)
+
+                }else{ //图片宽度大于图片高度
+                    if (cardContentPicVideoModel?.width ?? 0) / (cardContentPicVideoModel?.height ?? 0) > 2 {
+                        return CGRect(x: 0, y: 0, width: (kScreenWidth-28), height: ((347 * (cardContentPicVideoModel?.height ?? 0)) / (cardContentPicVideoModel?.width ?? 0)) * kScaleWidth)
+
+                    }else {
+                        return CGRect(x: 0, y: 0, width: 232 * kScaleWidth, height: ((232 * (cardContentPicVideoModel?.height ?? 0)) / (cardContentPicVideoModel?.width ?? 0)) * kScaleWidth)
+                    }
+                }
+            case 2:
+                return CGRect(x: (CGFloat(indexPath.row) * 173.5 * kScaleWidth) + (CGFloat(indexPath.row) * spacing), y: 0, width: 173.5 * kScaleWidth, height: (kScreenWidth - 29) / 3)
+            case 3:
+                return CGRect(x: (CGFloat(indexPath.row) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row) * spacing), y: 0, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+            case 4:
+                if indexPath.row == 0 {
+                    return CGRect(x: 0, y: 0, width: kScreenWidth-28, height: 195 * kScaleWidth)
+
+                }else {
+                    return CGRect(x: (CGFloat(indexPath.row-1) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row-1) * spacing), y: 195 * kScaleWidth + 1, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+                }
+            case 5:
+                if indexPath.row < 2 {
+                    return CGRect(x: (CGFloat(indexPath.row) * (kScreenWidth - 29) / 2) + (CGFloat(indexPath.row) * spacing), y: 0, width: (kScreenWidth - 29) / 2, height: 115 * kScaleWidth)
+                }else {
+                    return CGRect(x: (CGFloat(indexPath.row-2) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row-2) * spacing), y: 115 * kScaleWidth + 1, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+
+                }
+            case 6:
+                if indexPath.row < 3 {
+                    return CGRect(x: (CGFloat(indexPath.row) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row) * spacing), y: 0, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+
+                }else {
+                    return CGRect(x: (CGFloat(indexPath.row-3) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row-3) * spacing), y: (kScreenWidth - 30) / 3 + 1, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+                    
+                }
+            case 7:
+                if indexPath.row == 0 {
+                    return CGRect(x: 0, y: 0, width: kScreenWidth-28, height: 195 * kScaleWidth)
+                
+                }else if indexPath.row > 0 && indexPath.row < 4  {
+                    return CGRect(x: (CGFloat(indexPath.row - 1) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row - 1) * spacing), y: 195 * kScaleWidth + 1, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+                    
+                }else {
+                    return CGRect(x: (CGFloat(indexPath.row-4) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row-4) * spacing), y: 195 * kScaleWidth + (kScreenWidth - 30) / 3 + 2, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+                    
+                }
+            case 8:
+                if indexPath.row >= 0 && indexPath.row < 3 {
+                    return CGRect(x: (CGFloat(indexPath.row) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row) * spacing), y: 0, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+                }else if indexPath.row >= 3 && indexPath.row < 5 {
+                    return CGRect(x: (CGFloat(indexPath.row-3) * (kScreenWidth - 29) / 2) + (CGFloat(indexPath.row-3) * spacing), y: (kScreenWidth-30)/3 + 1, width: (kScreenWidth - 29) / 2, height: 115 * kScaleWidth)
+                }else {
+                    return CGRect(x: (CGFloat(indexPath.row-5) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row-5) * spacing), y: 115 * kScaleWidth + (kScreenWidth - 30) / 3 + 2, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+                    
+                }
+            case 9:
+                if indexPath.row >= 0 && indexPath.row < 3 {
+                    return CGRect(x: (CGFloat(indexPath.row) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row) * spacing), y: 0, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+                }else if indexPath.row >= 3 && indexPath.row < 6 {
+                    return CGRect(x: (CGFloat(indexPath.row-3) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row-3) * spacing), y: (kScreenWidth - 30) / 3 + 1, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+
+                }else {
+                    return CGRect(x: (CGFloat(indexPath.row-6) * (kScreenWidth-30)/3) + (CGFloat(indexPath.row-6) * spacing), y: (kScreenWidth - 30) / 3 * 2 + 2, width: (kScreenWidth-30)/3, height: (kScreenWidth-30)/3)
+                    
+                }
+            default:
+                return CGRect(x: 0, y: 0, width: 0, height: 0)
+            }
+        }else { //视频
+            if cardContentPicVideoModel?.width ?? 0 > cardContentPicVideoModel?.height ?? 0 {
+                return CGRect(x: 0, y: 0, width: (kScreenWidth-28), height: 462.5 * kScaleWidth)
+            }else {
+                return CGRect(x: 0, y: 0, width: (kScreenWidth-28), height: 185 * kScaleWidth)
+            }
+        }
+    }
 }

+ 53 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoModel.swift

@@ -15,4 +15,57 @@ class CardContentPicVideoModel: NSObject {
     var picAndVideo : Int = 0
     var number : Int = 0
     
+    func collectionViewHeight() -> CGFloat {
+        
+        if picAndVideo == 0 { //图片
+            switch number {
+            case 1:
+                if width < height { //图片宽度大于图片高度
+                    if height / width > 2 {
+                        NXLLog(347 * kScaleWidth)
+                        return 347 * kScaleWidth
+                    }else {
+                        NXLLog(232 * kScaleWidth)
+                        return 232 * kScaleWidth
+                    }
+                }else if width == height { //图片宽度等于图片高度
+                    NXLLog(232 * kScaleWidth)
+                    return 232 * kScaleWidth
+                }else{
+                     if width / height > 2 {
+                        NXLLog(((347 * height) / width) * kScaleWidth)
+                        return ((347 * height) / width) * kScaleWidth
+                     }else {
+                        NXLLog(((232 * height) / width) * kScaleWidth)
+                        return ((232 * height) / width) * kScaleWidth
+                    }
+                }
+            case 2:
+                return (kScreenWidth - 29) / 3
+            case 3:
+                return (kScreenWidth-30)/3
+            case 4:
+                return (kScreenWidth - 30) / 3 + 195 * kScaleWidth + 1
+            case 5:
+                return 115 * kScaleWidth + (kScreenWidth-30)/3 + 1
+            case 6:
+                return (kScreenWidth - 30) / 3 * 2 + 1
+            case 7:
+                return ((kScreenWidth - 30) / 3 * 2 ) + 195 * kScaleWidth + 2
+            case 8:
+                return ((kScreenWidth - 30) / 3 * 2 )  + 115 * kScaleWidth + 2
+            case 9:
+                return ((kScreenWidth - 30) / 3 * 2 ) + 115 * kScaleWidth + 2
+            default:
+                return 0
+            }
+        }else { //视频
+            if width > height {
+                return 462.5 * kScaleWidth
+            }else {
+                return 185 * kScaleWidth
+            }
+        }
+    }
+    
 }

+ 53 - 5
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoTableViewCell.swift

@@ -8,12 +8,12 @@
 
 import UIKit
 
-class CardContentPicTableViewCell: UITableViewCell {
+class CardContentPicVideoTableViewCell: UITableViewCell {
     
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> CardContentPicTableViewCell {
-        let ID = "CardContentPicTableViewCell"
-        tableView.register(CardContentPicTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : CardContentPicTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! CardContentPicTableViewCell
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> CardContentPicVideoTableViewCell {
+        let ID = "CardContentPicVideoTableViewCell"
+        tableView.register(CardContentPicVideoTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : CardContentPicVideoTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! CardContentPicVideoTableViewCell
         cell.indexPath = indexPath
         return cell
     }
@@ -36,10 +36,58 @@ class CardContentPicTableViewCell: UITableViewCell {
     //MRAK: - 设置View
     private func setupViews() {
         self.selectionStyle = .none
+        addSubview(collectionView)
     }
     
     private func setupLayouts() {
+       
         
     }
+    private lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
+        collectionView.backgroundColor = .gray
+        collectionView.delegate = self;
+        collectionView.dataSource = self;
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        return collectionView
+    }()
+    
+    private lazy var collectionViewLayout: CardContentPicVideoCollectionViewLayout = {
+        let collectionViewLayout = CardContentPicVideoCollectionViewLayout.init()
+        return collectionViewLayout
+    }()
+    
+    var cardContentPicVideoModel: CardContentPicVideoModel? {
+        didSet {
+            collectionViewLayout.cardContentPicVideoModel = cardContentPicVideoModel
+            addSubview(collectionView)
+            collectionView.snp_makeConstraints { (make) in
+                make.top.equalToSuperview()
+                make.left.equalTo(14)
+                make.right.equalTo(-14)
+                make.bottom.equalTo(-20)
+            }
+            collectionView.reloadData()
+        }
+    }
+}
 
+extension CardContentPicVideoTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return cardContentPicVideoModel?.number ?? 0
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = CardContentPicVideoCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        return cell
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        
+    }
 }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/TitleContent/CardContentTitleTableViewCell.swift

@@ -84,7 +84,7 @@ class CardContentTitleTableViewCell: UITableViewCell {
         didSet {
             switch cardContentTitleTableViewCellType {
             case .noTitleMoreThan?:
-                titleLabel.isHidden = false
+                titleLabel.isHidden = true
                 var str = " 在1962年,白人至上运动在美国又一次掀起小高潮,黑人邮政员维克写了这么一本小册黑人邮政员维克写了这么一本小册"
 
                 if str.count >= 46 {
@@ -104,7 +104,7 @@ class CardContentTitleTableViewCell: UITableViewCell {
                 }
                 break
             case .noTitleNoMoreThan?:
-                titleLabel.isHidden = false
+                titleLabel.isHidden = true
                 subtitleLabel.text = "在1962年,"
                 subtitleLabel.snp_remakeConstraints { (make) in
                     make.top.bottom.equalToSuperview()

+ 867 - 12
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/CommunityListViewController.swift

@@ -89,7 +89,7 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
     func numberOfSections(in tableView: UITableView) -> Int {
         switch communityListVCType {
         case .follow?:
-            return 12
+            return 23
         case .recommend?:
             return 0
         default:
@@ -178,7 +178,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
                     }
                     return cell
                 case 1:
-                    let cell = CardContentPicTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 100
+                    cardContentPicVideoModel.height = 200
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
                     return cell
                 case 2:
                     let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
@@ -224,7 +230,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
                     }
                     return cell
                 case 1:
-                    let cell = CardContentPicTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 100
+                    cardContentPicVideoModel.height = 300
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
                     return cell
                 case 2:
                     let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
@@ -270,7 +282,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
                     }
                     return cell
                 case 1:
-                    let cell = CardContentPicTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 200
+                    cardContentPicVideoModel.height = 200
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    cardContentPicVideoModel.picAndVideo = 0
                     return cell
                 case 2:
                     let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
@@ -317,7 +335,574 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
                     }
                     return cell
                 case 1:
-                    let cell = CardContentPicTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 200
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 12:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 13:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 2
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 14:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 3
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 15:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 4
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 16:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 5
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 17:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 6
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 18:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 7
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 19:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 8
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 20:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 9
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 21:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 100
+                    cardContentPicVideoModel.height = 300
+                    cardContentPicVideoModel.picAndVideo = 1
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
+                    return cell
+                case 2:
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.cardContentTitleTableViewCellType = .titleNoMoreThan
+                    return cell
+                case 3:
+                    let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.collectClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    cell.praiseClosureName = {
+                        (button:UIButton) -> Bool in
+                        return !button.isSelected
+                    }
+                    
+                    return cell
+                case 4:
+                    let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.frame = tableView.frame
+                    cell.layoutIfNeeded()
+                    cell.reloadData()
+                    return cell
+                case 5:
+                    let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.addCommnetClosureName = {
+                        
+                    }
+                    return cell
+                default:
+                    return UITableViewCell()
+                }
+            case 22:
+                switch indexPath.row {
+                case 0:
+                    let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.followType = .mutualFollow
+                    //关注状态
+                    cell.followClosure = {
+                        [weak self] in
+                        self?.followData(indexPath: indexPath)
+                    }
+                    return cell
+                case 1:
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 1
+                    cell.cardContentPicVideoModel = cardContentPicVideoModel
                     return cell
                 case 2:
                     let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
@@ -388,6 +973,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
                 switch indexPath.row {
                 case 0:
                     return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 100
+                    cardContentPicVideoModel.height = 200
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
                 case 2:
                     return UITableView.automaticDimension
                 case 3:
@@ -403,6 +995,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
                 switch indexPath.row {
                 case 0:
                     return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 100
+                    cardContentPicVideoModel.height = 300
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
                 case 2:
                     return UITableView.automaticDimension
                 case 3:
@@ -418,6 +1017,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
                 switch indexPath.row {
                 case 0:
                     return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 200
+                    cardContentPicVideoModel.height = 200
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
                 case 2:
                     return UITableView.automaticDimension
                 case 3:
@@ -433,6 +1039,255 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
                 switch indexPath.row {
                 case 0:
                     return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 200
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 12:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 13:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 2
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 14:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 3
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 15:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 4
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 16:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 5
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 17:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 6
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 18:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 7
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 19:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 8
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 20:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 9
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 0
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 21:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 9
+                    cardContentPicVideoModel.width = 100
+                    cardContentPicVideoModel.height = 300
+                    cardContentPicVideoModel.picAndVideo = 1
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
+                case 2:
+                    return UITableView.automaticDimension
+                case 3:
+                    return 54
+                case 4:
+                    return UITableView.automaticDimension
+                case 5:
+                    return 74
+                default:
+                    return 0
+                }
+            case 22:
+                switch indexPath.row {
+                case 0:
+                    return 80
+                case 1:
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.number = 1
+                    cardContentPicVideoModel.width = 300
+                    cardContentPicVideoModel.height = 100
+                    cardContentPicVideoModel.picAndVideo = 1
+                    return cardContentPicVideoModel.collectionViewHeight() + 20
                 case 2:
                     return UITableView.automaticDimension
                 case 3:
@@ -508,13 +1363,6 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
         cellHeightsDictionary.updateValue(cell.frame.size.height, forKey: indexPath)
     }
     
-//    func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) {
-//        cellHeightsFooterDictionary.updateValue(view.frame.size.height, forKey: section)
-//    }
-//    func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
-//        cellHeightsHeaderDictionary.updateValue(view.frame.size.height, forKey: section)
-//    }
-    
     func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
         let height = cellHeightsDictionary[indexPath]
         if let height = height  {
@@ -523,6 +1371,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
         return UITableView.automaticDimension
     }
     
+//    func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) {
+//        cellHeightsFooterDictionary.updateValue(view.frame.size.height, forKey: section)
+//    }
+//    func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
+//        cellHeightsHeaderDictionary.updateValue(view.frame.size.height, forKey: section)
+//    }
+    
 //    func tableView(_ tableView: UITableView, estimatedHeightForHeaderInSection section: Int) -> CGFloat {
 //        let height = cellHeightsHeaderDictionary[section]
 //        if let height = height  {