Prechádzať zdrojové kódy

被设置为圈子精选的内容,需要在前端显示精品内容的标志feed流都需要展示

南鑫林 5 rokov pred
rodič
commit
cd0eda405f
15 zmenil súbory, kde vykonal 463 pridanie a 112 odobranie
  1. 8 0
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 4 0
      RainbowPlanet/RainbowPlanet/Macro/ColorMacro.swift
  3. 114 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicHTMLTableViewCell.swift
  4. 0 7
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/TitleContent/CardContentTitleTableViewCell.swift
  5. 89 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/TitleContent/CardTitleHTMLTableViewCell.swift
  6. 22 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/User/CardContentUserTableViewCell.swift
  7. 59 36
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift
  8. 62 34
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift
  9. 61 34
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift
  10. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/ico_select.imageset/Contents.json
  11. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/ico_select.imageset/ico_select@2x.png
  12. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/ico_select.imageset/ico_select@3x.png
  13. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/pic_select_bg.imageset/Contents.json
  14. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/pic_select_bg.imageset/pic_select_bg@2x.png
  15. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/pic_select_bg.imageset/pic_select_bg@3x.png

+ 8 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -298,6 +298,8 @@
 		A784F2AE234F352000E49140 /* BrowsePicturesSaveImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2AD234F352000E49140 /* BrowsePicturesSaveImageView.swift */; };
 		A784F2B12350124200E49140 /* CopyLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2B02350124200E49140 /* CopyLabel.swift */; };
 		A784F2B32350337D00E49140 /* ShareH5LinkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2B22350337D00E49140 /* ShareH5LinkView.swift */; };
+		A784F2B623505D3F00E49140 /* CardTitleHTMLTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2B523505D3F00E49140 /* CardTitleHTMLTableViewCell.swift */; };
+		A784F2B823505E3700E49140 /* CardContentPicHTMLTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2B723505E3700E49140 /* CardContentPicHTMLTableViewCell.swift */; };
 		A78A5F7622FAA03800DD1764 /* share_iSpt.gif in Resources */ = {isa = PBXBuildFile; fileRef = A78A5F7522FAA03800DD1764 /* share_iSpt.gif */; };
 		A78A5F7822FAC7F000DD1764 /* SetGenderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A78A5F7722FAC7F000DD1764 /* SetGenderModel.swift */; };
 		A78CEE0A22E0864100C512A4 /* BaseLottieAnimateContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A78CEE0922E0864100C512A4 /* BaseLottieAnimateContentView.swift */; };
@@ -984,6 +986,8 @@
 		A784F2AD234F352000E49140 /* BrowsePicturesSaveImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowsePicturesSaveImageView.swift; sourceTree = "<group>"; };
 		A784F2B02350124200E49140 /* CopyLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CopyLabel.swift; sourceTree = "<group>"; };
 		A784F2B22350337D00E49140 /* ShareH5LinkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareH5LinkView.swift; sourceTree = "<group>"; };
+		A784F2B523505D3F00E49140 /* CardTitleHTMLTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardTitleHTMLTableViewCell.swift; sourceTree = "<group>"; };
+		A784F2B723505E3700E49140 /* CardContentPicHTMLTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardContentPicHTMLTableViewCell.swift; sourceTree = "<group>"; };
 		A78A5F7522FAA03800DD1764 /* share_iSpt.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = share_iSpt.gif; sourceTree = "<group>"; };
 		A78A5F7722FAC7F000DD1764 /* SetGenderModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetGenderModel.swift; sourceTree = "<group>"; };
 		A78CEE0922E0864100C512A4 /* BaseLottieAnimateContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseLottieAnimateContentView.swift; sourceTree = "<group>"; };
@@ -3584,6 +3588,7 @@
 			isa = PBXGroup;
 			children = (
 				A7BF202922B396F300396DB3 /* CardContentTitleTableViewCell.swift */,
+				A784F2B523505D3F00E49140 /* CardTitleHTMLTableViewCell.swift */,
 			);
 			path = TitleContent;
 			sourceTree = "<group>";
@@ -4318,6 +4323,7 @@
 		A7F2D6DB22B252520093000B /* PicVideo */ = {
 			isa = PBXGroup;
 			children = (
+				A784F2B723505E3700E49140 /* CardContentPicHTMLTableViewCell.swift */,
 				A7F2D6D822B250EF0093000B /* CardContentPicVideoTableViewCell.swift */,
 				A7F2D6DC22B2536F0093000B /* CardContentPicVideoCollectionViewCell.swift */,
 				A7F2D6DE22B25B5D0093000B /* CardContentPicVideoCollectionViewLayout.swift */,
@@ -5689,6 +5695,7 @@
 				BDD9377522DEF371002D11B3 /* PublishMusicListCell.swift in Sources */,
 				A76893A2233A0BB000819EC3 /* DrawCircleProgressButton.m in Sources */,
 				A7A98E12227ECA11005306E9 /* ProductSearchModel.swift in Sources */,
+				A784F2B823505E3700E49140 /* CardContentPicHTMLTableViewCell.swift in Sources */,
 				BD61225E22C3561C00D3F513 /* AlivcRecordFocusView.m in Sources */,
 				A71AF0B0226EF185001730FE /* SearchCollectionViewCell.swift in Sources */,
 				BD01B20122BC677900CE9F36 /* PublishFilterView.swift in Sources */,
@@ -6101,6 +6108,7 @@
 				A7F2D6C822B0E2F60093000B /* CommunityRecommendFollowTableViewCell.swift in Sources */,
 				A77F2C9C2231FDCF001BD3F6 /* BaseView.swift in Sources */,
 				A7A98E2F228017E2005306E9 /* SwiftMoyaNetWorkServiceCMS.swift in Sources */,
+				A784F2B623505D3F00E49140 /* CardTitleHTMLTableViewCell.swift in Sources */,
 				A7284A522252EE9A000BAEC4 /* RootModel.swift in Sources */,
 				BD13B6E022BA03BC008BB323 /* PublishTopicItemCell.swift in Sources */,
 				BD1FC18822B0A30300D55081 /* CommunityMajorCommentCell.swift in Sources */,

+ 4 - 0
RainbowPlanet/RainbowPlanet/Macro/ColorMacro.swift

@@ -26,6 +26,10 @@ let k000000Color = UIColor(hexString: "000000")
 
 let k333333Color = UIColor(hexString: "333333")
 
+let k6A3800Color = UIColor(hexString: "6A3800")
+
+let kDFB768Color = UIColor(hexString: "DFB768")
+
 let k262626Color = UIColor(hexString: "262626")
 
 let k313334Color = UIColor(hexString: "313334")

+ 114 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicHTMLTableViewCell.swift

@@ -0,0 +1,114 @@
+//
+//  CardContentPicHTMLTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/11.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import Kingfisher
+
+class CardContentPicHTMLTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> CardContentPicHTMLTableViewCell {
+        let ID = "CardContentPicHTMLTableViewCell"
+        tableView.register(CardContentPicHTMLTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : CardContentPicHTMLTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! CardContentPicHTMLTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        backgroundColor = UIColor.white
+        addSubview(contentLabel)
+        addSubview(picImageView)
+    }
+    
+    private func setupLayouts() {
+
+        picImageView.snp.makeConstraints { (make) in
+            make.top.equalTo(10)
+            make.right.equalTo(-14)
+            make.size.equalTo(62)
+        }
+        
+        contentLabel.snp.remakeConstraints { (make) in
+            make.top.equalTo(picImageView).offset(1)
+            make.bottom.equalTo(picImageView).offset(-1)
+            make.left.equalTo(14)
+            make.right.equalTo(picImageView.snp.left).offset(-10)
+        }
+        
+    }
+    
+    private lazy var contentLabel: UILabel = {
+        let contentLabel = UILabel()
+        contentLabel.textColor = k313334Color
+        contentLabel.font = kRegularFont14
+        contentLabel.numberOfLines = 3
+        return contentLabel
+    }()
+    
+    private lazy var picImageView: UIImageView = {
+        let picImageView = UIImageView()
+        picImageView.cornerRadius = 2
+        picImageView.clipsToBounds = true
+        return picImageView
+    }()
+    
+    var communityRecommendDataModel: CommunityRecommendDataModel? {
+        didSet {
+            
+            let imageResource = ImageResource(downloadURL: kURLThumbnailsImage(name: communityRecommendDataModel?.img ?? "",size: CGSize(width: 62, height: 62))!)
+            picImageView.kf.setImage(with: imageResource, placeholder: kImage(name: "default_pic"))
+            
+            var contentStr = communityRecommendDataModel?.content ?? ""
+            contentStr = contentStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+            let subtitleLabelHeightH =  contentStr.heightForComment(font: kMediumFont16!, width: kScreenWidth-28-62-10, maxHeight: 60.0)
+            contentLabel.snp.remakeConstraints { (make) in
+                make.top.equalToSuperview()
+                make.left.equalTo(14)
+                make.right.equalTo(-14)
+                make.height.equalTo(subtitleLabelHeightH)
+            }
+            contentLabel.text = contentStr
+        }
+    }
+    
+    var communityFollowDataModel : CommunityFollowDataModel? {
+        didSet {
+            
+            let imageResource = ImageResource(downloadURL: kURLThumbnailsImage(name: communityFollowDataModel?.relateData?.img ?? "",size: CGSize(width: 62, height: 62))!)
+            picImageView.kf.setImage(with: imageResource, placeholder: kImage(name: "default_pic"))
+            
+            var contentStr = communityFollowDataModel?.relateData?.content ?? ""
+            contentStr = contentStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+            let subtitleLabelHeightH =  contentStr.heightForComment(font: kMediumFont16!, width: kScreenWidth-28-62-10, maxHeight: 60.0)
+            contentLabel.snp.remakeConstraints { (make) in
+                make.top.equalToSuperview()
+                make.left.equalTo(14)
+                make.right.equalTo(-14)
+                make.height.equalTo(subtitleLabelHeightH)
+            }
+            contentLabel.text = contentStr
+        }
+    }
+}

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

@@ -8,13 +8,6 @@
 
 import UIKit
 
-//enum CardContentTitleTableViewCellType {
-//    case noTitleMoreThan
-//    case noTitleNoMoreThan
-//    case titleMoreThan
-//    case titleNoMoreThan
-//}
-
 class CardContentTitleTableViewCell: UITableViewCell {
 
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> CardContentTitleTableViewCell {

+ 89 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/TitleContent/CardTitleHTMLTableViewCell.swift

@@ -0,0 +1,89 @@
+//
+//  CardTitleHTMLTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/11.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class CardTitleHTMLTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> CardTitleHTMLTableViewCell {
+        let ID = "CardTitleHTMLTableViewCell"
+        tableView.register(CardTitleHTMLTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : CardTitleHTMLTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! CardTitleHTMLTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        backgroundColor = UIColor.white
+        addSubview(titleLabel)
+    }
+    
+    private func setupLayouts() {
+        titleLabel.snp.remakeConstraints { (make) in
+            make.top.equalToSuperview()
+            make.left.equalTo(14)
+            make.right.equalTo(-14)
+        }
+        
+    }
+    
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.textColor = k262626Color
+        titleLabel.font = kMediumFont16
+        titleLabel.numberOfLines = 2
+        return titleLabel
+    }()
+    
+    var communityRecommendDataModel: CommunityRecommendDataModel? {
+        didSet {
+            var titleStr = communityRecommendDataModel?.title ?? ""
+            titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+            let subtitleLabelHeightH =  titleStr.heightForComment(font: kMediumFont16!, width: kScreenWidth-28, maxHeight: 44.0)
+            titleLabel.snp.remakeConstraints { (make) in
+                make.top.equalToSuperview()
+                make.left.equalTo(14)
+                make.right.equalTo(-14)
+                make.height.equalTo(subtitleLabelHeightH)
+            }
+            titleLabel.text = titleStr
+        }
+    }
+    
+    var communityFollowDataModel : CommunityFollowDataModel? {
+        didSet {
+            var titleStr = communityFollowDataModel?.relateData?.title ?? ""
+            titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+            let subtitleLabelHeightH =  titleStr.heightForComment(font: kMediumFont16!, width: kScreenWidth-28, maxHeight: 44.0)
+            titleLabel.snp.remakeConstraints { (make) in
+                make.top.equalToSuperview()
+                make.left.equalTo(14)
+                make.right.equalTo(-14)
+                make.height.equalTo(subtitleLabelHeightH)
+            }
+            titleLabel.text = titleStr
+        }
+    }
+}

+ 22 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/User/CardContentUserTableViewCell.swift

@@ -47,8 +47,10 @@ class CardContentUserTableViewCell: UITableViewCell {
     private func setupViews() {
         self.selectionStyle = .none
         backgroundColor = UIColor.white
+        addSubview(bgView)
         addSubview(avatarButton)
         addSubview(titleButton)
+        addSubview(featuredButton)
         addSubview(timeLabel)
         addSubview(setButton)
         addSubview(followButton)
@@ -56,6 +58,9 @@ class CardContentUserTableViewCell: UITableViewCell {
     }
     
     private func setupLayouts() {
+        bgView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
         avatarButton.snp.makeConstraints { (make) in
             make.centerY.equalToSuperview()
             make.size.equalTo(40)
@@ -65,7 +70,11 @@ class CardContentUserTableViewCell: UITableViewCell {
             make.top.equalTo(avatarButton).offset(2)
             make.height.equalTo(21)
             make.left.equalTo(avatarButton.snp.right).offset(16)
-            make.right.equalTo(setButton.snp.left).offset(-80)
+            make.right.lessThanOrEqualTo(setButton.snp.left).offset(-80-46-5)
+        }
+        featuredButton.snp.makeConstraints { (make) in
+            make.centerY.equalTo(titleButton)
+            make.left.equalTo(titleButton.snp.right).offset(5)
         }
         timeLabel.snp.makeConstraints { (make) in
             make.bottom.equalTo(avatarButton).offset(4)
@@ -85,6 +94,12 @@ class CardContentUserTableViewCell: UITableViewCell {
         }
     }
     
+    private lazy var bgView: UIView = {
+        let bgView = UIView(frame: self.frame)
+        bgView.backgroundColor = UIColor(patternImage: kImage(name: "pic_select_bg")!)
+        return bgView
+    }()
+    
     private lazy var avatarButton: UIButton = {
         let avatarButton = UIButton(type: UIButton.ButtonType.custom)
         avatarButton.setImage(kImage(name: "default_pic"), for: UIControl.State.normal)
@@ -113,6 +128,12 @@ class CardContentUserTableViewCell: UITableViewCell {
         return titleButton
     }()
     
+    private lazy var featuredButton: UIButton = {
+        let featuredButton = UIButton(type: UIButton.ButtonType.custom)
+        featuredButton.setImage(kImage(name: "ico_select"), for: UIControl.State.normal)
+        return featuredButton
+    }()
+    
     private lazy var timeLabel: UILabel = {
         let timeLabel = UILabel()
         timeLabel.text = "5小时前"

+ 59 - 36
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift

@@ -458,15 +458,30 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
 
         //内容标题
         case 1:
-            let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.communityFollowDataModel = communityFollowDataModel
-            return cell
+            
+            if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "html") == .html {
+                let cell = CardTitleHTMLTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.communityFollowDataModel = communityFollowDataModel
+                return cell
+            }else {
+                let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.communityFollowDataModel = communityFollowDataModel
+                 return cell
+            }
+           
         //图片视频
         case 2:
-            let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.type = .follow
-            cell.communityFollowDataModel = communityFollowDataModel
-            return cell
+            
+            if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "html") == .html {
+                let cell = CardContentPicHTMLTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.communityFollowDataModel = communityFollowDataModel
+                return cell
+            }else {
+                let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.type = .follow
+                cell.communityFollowDataModel = communityFollowDataModel
+                return cell
+            }
         //点赞,收藏,分享
         case 3:
             let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
@@ -598,39 +613,36 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
             return 0
         //内容标题
         case 1:
-            
-            var titleStr = communityFollowDataModel?.relateData?.title ?? ""
-            titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
-            
-            var str = communityFollowDataModel?.relateData?.content ?? ""
-            str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
-            
-            let subtitleLabelHeight =  str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28, maxHeight: 40.0)
-            
-            if titleStr == "" {
+            if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "html") == .html {
+                var titleStr = communityFollowDataModel?.relateData?.title ?? ""
+                titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                let subtitleLabelHeight =  titleStr.heightForComment(font: kMediumFont16!, width: kScreenWidth-28, maxHeight: 44.0)
                 return subtitleLabelHeight
             }else {
-                return 22 + 6 + subtitleLabelHeight
+                var titleStr = communityFollowDataModel?.relateData?.title ?? ""
+                titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                
+                var str = communityFollowDataModel?.relateData?.content ?? ""
+                str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                
+                let subtitleLabelHeight =  str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28, maxHeight: 40.0)
+                
+                if titleStr == "" {
+                    return subtitleLabelHeight
+                }else {
+                    return 22 + 6 + subtitleLabelHeight
+                }
             }
         //图片视频
         case 2:
-            
-            let cardContentPicVideoModel = CardContentPicVideoModel()
-            cardContentPicVideoModel.postType = PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image")!
-            
-            let imgStr = communityFollowDataModel?.relateData?.img
-            if communityFollowDataModel?.relateData?.imgs?.isEmpty ?? true {
-                if imgStr != "" && imgStr != nil {
-                    cardContentPicVideoModel.number = 1
-                    cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
-                    cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
-                    return cardContentPicVideoModel.collectionViewHeight() + 12
-                }else {
-                    return 0
-                }
+            if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "html") == .html {
+                return 82
             }else {
-                if communityFollowDataModel?.relateData?.imgs?.count ?? 0 == 1 {
-                    if imgStr != "" || imgStr != nil {
+                let cardContentPicVideoModel = CardContentPicVideoModel()
+                cardContentPicVideoModel.postType = PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image")!
+                let imgStr = communityFollowDataModel?.relateData?.img
+                if communityFollowDataModel?.relateData?.imgs?.isEmpty ?? true {
+                    if imgStr != "" && imgStr != nil {
                         cardContentPicVideoModel.number = 1
                         cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
                         cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
@@ -639,8 +651,19 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
                         return 0
                     }
                 }else {
-                    cardContentPicVideoModel.number = communityFollowDataModel?.relateData?.imgs?.count ?? 0
-                    return cardContentPicVideoModel.collectionViewHeight() + 12
+                    if communityFollowDataModel?.relateData?.imgs?.count ?? 0 == 1 {
+                        if imgStr != "" || imgStr != nil {
+                            cardContentPicVideoModel.number = 1
+                            cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
+                            cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
+                            return cardContentPicVideoModel.collectionViewHeight() + 12
+                        }else {
+                            return 0
+                        }
+                    }else {
+                        cardContentPicVideoModel.number = communityFollowDataModel?.relateData?.imgs?.count ?? 0
+                        return cardContentPicVideoModel.collectionViewHeight() + 12
+                    }
                 }
             }
         //点赞,收藏,分享

+ 62 - 34
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift

@@ -355,15 +355,29 @@ extension CommunityRecommnendViewController : UITableViewDelegate,UITableViewDat
                 return cell
             //内容标题
             case 1:
-                let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.communityRecommendDataModel = communityRecommendDataModel
-                return cell
+                
+                if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                    let cell = CardTitleHTMLTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.communityRecommendDataModel = communityRecommendDataModel
+                    return cell
+                }else {
+                    let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.communityRecommendDataModel = communityRecommendDataModel
+                    return cell
+                }
             //图片视频
             case 2:
-                let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.type = .recommend
-                cell.communityRecommendDataModel = communityRecommendDataModel
-                return cell
+                if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                    let cell = CardContentPicHTMLTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.communityRecommendDataModel = communityRecommendDataModel
+                    return cell
+                }else {
+                    let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                    cell.type = .recommend
+                    cell.communityRecommendDataModel = communityRecommendDataModel
+                    return cell
+                }
+                
             //点赞,收藏,分享
             case 3:
                 let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
@@ -486,38 +500,41 @@ extension CommunityRecommnendViewController : UITableViewDelegate,UITableViewDat
             //内容标题
             case 1:
                 
-                var titleStr = communityRecommendDataModel.title ?? ""
-                titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
-                
-                var str = communityRecommendDataModel.content ?? ""
-                str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
-                
-                let subtitleLabelHeight =  str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28, maxHeight: 40.0)
-                
-                if titleStr == "" {
+                if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                    var titleStr = communityRecommendDataModel.title ?? ""
+                    titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                     let subtitleLabelHeight =  titleStr.heightForComment(font: kMediumFont16!, width: kScreenWidth-28, maxHeight: 44.0)
                     return subtitleLabelHeight
                 }else {
-                    return 22 + 6 + subtitleLabelHeight
+                    var titleStr = communityRecommendDataModel.title ?? ""
+                    titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                    
+                    var str = communityRecommendDataModel.content ?? ""
+                    str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                    
+                    let subtitleLabelHeight =  str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28, maxHeight: 40.0)
+                    
+                    if titleStr == "" {
+                        return subtitleLabelHeight
+                    }else {
+                        return 22 + 6 + subtitleLabelHeight
+                    }
                 }
+                
+                
             //图片视频
             case 2:
                 
-                let cardContentPicVideoModel = CardContentPicVideoModel()
-                cardContentPicVideoModel.postType = PostType(rawValue: communityRecommendDataModel.type ?? "html")
-                
-                let imgStr = communityRecommendDataModel.img
-                if communityRecommendDataModel.imgs?.count ?? 0 == 0 {
-                    if communityRecommendDataModel.img != "" && communityRecommendDataModel.img != nil {
-                        cardContentPicVideoModel.number = 1
-                        cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
-                        cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
-                        return cardContentPicVideoModel.collectionViewHeight() + 12
-                    }else {
-                        return 0
-                    }
+                if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+
+                    return 82
                 }else {
-                    if communityRecommendDataModel.imgs?.count ?? 0 == 1 {
-                        if communityRecommendDataModel.img != "" || communityRecommendDataModel.img != nil {
+                    let cardContentPicVideoModel = CardContentPicVideoModel()
+                    cardContentPicVideoModel.postType = PostType(rawValue: communityRecommendDataModel.type ?? "html")
+                    
+                    let imgStr = communityRecommendDataModel.img
+                    if communityRecommendDataModel.imgs?.count ?? 0 == 0 {
+                        if communityRecommendDataModel.img != "" && communityRecommendDataModel.img != nil {
                             cardContentPicVideoModel.number = 1
                             cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
                             cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
@@ -526,8 +543,19 @@ extension CommunityRecommnendViewController : UITableViewDelegate,UITableViewDat
                             return 0
                         }
                     }else {
-                        cardContentPicVideoModel.number = communityRecommendDataModel.imgs?.count ?? 0
-                        return cardContentPicVideoModel.collectionViewHeight() + 12
+                        if communityRecommendDataModel.imgs?.count ?? 0 == 1 {
+                            if communityRecommendDataModel.img != "" || communityRecommendDataModel.img != nil {
+                                cardContentPicVideoModel.number = 1
+                                cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
+                                cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
+                                return cardContentPicVideoModel.collectionViewHeight() + 12
+                            }else {
+                                return 0
+                            }
+                        }else {
+                            cardContentPicVideoModel.number = communityRecommendDataModel.imgs?.count ?? 0
+                            return cardContentPicVideoModel.collectionViewHeight() + 12
+                        }
                     }
                 }
             //点赞,收藏,分享

+ 61 - 34
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift

@@ -440,15 +440,28 @@ extension CommunityFeaturedTopicsViewController : UITableViewDelegate,UITableVie
 
         //内容标题
         case 1:
-            let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.communityRecommendDataModel = communityRecommendDataModel
-            return cell
+            
+            if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                let cell = CardTitleHTMLTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.communityRecommendDataModel = communityRecommendDataModel
+                return cell
+            }else {
+                let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.communityRecommendDataModel = communityRecommendDataModel
+                return cell
+            }
         //图片视频
         case 2:
-            let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.type = .recommend
-            cell.communityRecommendDataModel = communityRecommendDataModel
-            return cell
+            if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                let cell = CardContentPicHTMLTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.communityRecommendDataModel = communityRecommendDataModel
+                return cell
+            }else {
+                let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                cell.type = .recommend
+                cell.communityRecommendDataModel = communityRecommendDataModel
+                return cell
+            }
         //点赞,收藏,分享
         case 3:
             let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
@@ -523,38 +536,42 @@ extension CommunityFeaturedTopicsViewController : UITableViewDelegate,UITableVie
         
         //内容标题
         case 1:
-            var titleStr = communityRecommendDataModel.title ?? ""
-            titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
-            
-            var str = communityRecommendDataModel.content ?? ""
-            str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
-            
-            let subtitleLabelHeight =  str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28, maxHeight: 40.0)
             
-            if titleStr == "" {
+            if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                var titleStr = communityRecommendDataModel.title ?? ""
+                titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                let subtitleLabelHeight =  titleStr.heightForComment(font: kMediumFont16!, width: kScreenWidth-28, maxHeight: 44.0)
                 return subtitleLabelHeight
             }else {
-                return 22 + 6 + subtitleLabelHeight
+                var titleStr = communityRecommendDataModel.title ?? ""
+                titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                
+                var str = communityRecommendDataModel.content ?? ""
+                str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                
+                let subtitleLabelHeight =  str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28, maxHeight: 40.0)
+                
+                if titleStr == "" {
+                    return subtitleLabelHeight
+                }else {
+                    return 22 + 6 + subtitleLabelHeight
+                }
             }
+            
+            
         //图片视频
         case 2:
             
-            let cardContentPicVideoModel = CardContentPicVideoModel()
-            cardContentPicVideoModel.postType = PostType(rawValue: communityRecommendDataModel.type ?? "html")
-            
-            let imgStr = communityRecommendDataModel.img
-            if communityRecommendDataModel.imgs?.count ?? 0 == 0 {
-                if communityRecommendDataModel.img != "" && communityRecommendDataModel.img != nil {
-                    cardContentPicVideoModel.number = 1
-                    cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
-                    cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
-                    return cardContentPicVideoModel.collectionViewHeight() + 12
-                }else {
-                    return 0
-                }
+            if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                
+                return 82
             }else {
-                if communityRecommendDataModel.imgs?.count ?? 0 == 1 {
-                    if communityRecommendDataModel.img != "" || communityRecommendDataModel.img != nil {
+                let cardContentPicVideoModel = CardContentPicVideoModel()
+                cardContentPicVideoModel.postType = PostType(rawValue: communityRecommendDataModel.type ?? "html")
+                
+                let imgStr = communityRecommendDataModel.img
+                if communityRecommendDataModel.imgs?.count ?? 0 == 0 {
+                    if communityRecommendDataModel.img != "" && communityRecommendDataModel.img != nil {
                         cardContentPicVideoModel.number = 1
                         cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
                         cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
@@ -563,11 +580,21 @@ extension CommunityFeaturedTopicsViewController : UITableViewDelegate,UITableVie
                         return 0
                     }
                 }else {
-                    cardContentPicVideoModel.number = communityRecommendDataModel.imgs?.count ?? 0
-                    return cardContentPicVideoModel.collectionViewHeight() + 12
+                    if communityRecommendDataModel.imgs?.count ?? 0 == 1 {
+                        if communityRecommendDataModel.img != "" || communityRecommendDataModel.img != nil {
+                            cardContentPicVideoModel.number = 1
+                            cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
+                            cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
+                            return cardContentPicVideoModel.collectionViewHeight() + 12
+                        }else {
+                            return 0
+                        }
+                    }else {
+                        cardContentPicVideoModel.number = communityRecommendDataModel.imgs?.count ?? 0
+                        return cardContentPicVideoModel.collectionViewHeight() + 12
+                    }
                 }
             }
-
         //点赞,收藏,分享
         case 3:
             return 54

+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/ico_select.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "ico_select@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "ico_select@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/ico_select.imageset/ico_select@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/ico_select.imageset/ico_select@3x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/pic_select_bg.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "pic_select_bg@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "pic_select_bg@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/pic_select_bg.imageset/pic_select_bg@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/CommunityModule.xcassets/pic_select_bg.imageset/pic_select_bg@3x.png