소스 검색

图文详情页 -- to be continued

Chris 5 년 전
부모
커밋
4603fabeb4

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

@@ -388,6 +388,11 @@
 		BD20F1D52283D15500677D8E /* OrderFinishPayFailureCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD20F1D42283D15500677D8E /* OrderFinishPayFailureCell.swift */; };
 		BD20F1D82283D2AA00677D8E /* ShoppingCartModule.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD20F1D72283D2AA00677D8E /* ShoppingCartModule.xcassets */; };
 		BD29A92E228F99780018CFC3 /* OrderCommentParameterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD29A92D228F99780018CFC3 /* OrderCommentParameterModel.swift */; };
+		BD2FCBE222B21CF70006D974 /* CommunityRecommendController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2FCBE122B21CF70006D974 /* CommunityRecommendController.swift */; };
+		BD2FCBE422B244250006D974 /* RecommendDetailContentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2FCBE322B244250006D974 /* RecommendDetailContentCell.swift */; };
+		BD2FCBE622B2586C0006D974 /* CommunityTagCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2FCBE522B2586C0006D974 /* CommunityTagCollectionCell.swift */; };
+		BD2FCBEA22B267280006D974 /* RecommendNoneCommentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2FCBE922B267280006D974 /* RecommendNoneCommentCell.swift */; };
+		BD2FCBEC22B274020006D974 /* RecommendCommentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2FCBEB22B274020006D974 /* RecommendCommentCell.swift */; };
 		BD3474F522857B85000908C5 /* CommonPayHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3474F422857B85000908C5 /* CommonPayHeader.swift */; };
 		BD3AA45822AE63EC00EF4F20 /* MessageMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3AA45722AE63EC00EF4F20 /* MessageMainViewController.swift */; };
 		BD3AA45F22AE6F2500EF4F20 /* MessagePlanetTableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3AA45E22AE6F2500EF4F20 /* MessagePlanetTableCell.swift */; };
@@ -852,6 +857,11 @@
 		BD20F1D42283D15500677D8E /* OrderFinishPayFailureCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderFinishPayFailureCell.swift; sourceTree = "<group>"; };
 		BD20F1D72283D2AA00677D8E /* ShoppingCartModule.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ShoppingCartModule.xcassets; sourceTree = "<group>"; };
 		BD29A92D228F99780018CFC3 /* OrderCommentParameterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderCommentParameterModel.swift; sourceTree = "<group>"; };
+		BD2FCBE122B21CF70006D974 /* CommunityRecommendController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityRecommendController.swift; sourceTree = "<group>"; };
+		BD2FCBE322B244250006D974 /* RecommendDetailContentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendDetailContentCell.swift; sourceTree = "<group>"; };
+		BD2FCBE522B2586C0006D974 /* CommunityTagCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityTagCollectionCell.swift; sourceTree = "<group>"; };
+		BD2FCBE922B267280006D974 /* RecommendNoneCommentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendNoneCommentCell.swift; sourceTree = "<group>"; };
+		BD2FCBEB22B274020006D974 /* RecommendCommentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendCommentCell.swift; sourceTree = "<group>"; };
 		BD3474F422857B85000908C5 /* CommonPayHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonPayHeader.swift; sourceTree = "<group>"; };
 		BD3AA45722AE63EC00EF4F20 /* MessageMainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageMainViewController.swift; sourceTree = "<group>"; };
 		BD3AA45E22AE6F2500EF4F20 /* MessagePlanetTableCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagePlanetTableCell.swift; sourceTree = "<group>"; };
@@ -1292,6 +1302,7 @@
 			children = (
 				A719EE6722AF438E001AAC98 /* Community */,
 				BD1FC18222B09F4700D55081 /* CommunitySubComment */,
+				BD2FCBDE22B21BE00006D974 /* CommunityRecommendDetail */,
 				BD1FC17D22B08CEB00D55081 /* CommunityMyFollowTopic */,
 			);
 			path = CommunityModule;
@@ -3272,6 +3283,34 @@
 			path = Category;
 			sourceTree = "<group>";
 		};
+		BD2FCBDE22B21BE00006D974 /* CommunityRecommendDetail */ = {
+			isa = PBXGroup;
+			children = (
+				BD2FCBE022B21C600006D974 /* View */,
+				BD2FCBDF22B21C3F0006D974 /* Controller */,
+			);
+			path = CommunityRecommendDetail;
+			sourceTree = "<group>";
+		};
+		BD2FCBDF22B21C3F0006D974 /* Controller */ = {
+			isa = PBXGroup;
+			children = (
+				BD2FCBE122B21CF70006D974 /* CommunityRecommendController.swift */,
+			);
+			path = Controller;
+			sourceTree = "<group>";
+		};
+		BD2FCBE022B21C600006D974 /* View */ = {
+			isa = PBXGroup;
+			children = (
+				BD2FCBE322B244250006D974 /* RecommendDetailContentCell.swift */,
+				BD2FCBE522B2586C0006D974 /* CommunityTagCollectionCell.swift */,
+				BD2FCBE922B267280006D974 /* RecommendNoneCommentCell.swift */,
+				BD2FCBEB22B274020006D974 /* RecommendCommentCell.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		BD3474F722859788000908C5 /* OrderPayOrder */ = {
 			isa = PBXGroup;
 			children = (
@@ -3803,6 +3842,7 @@
 				A7CC74D822700359003C4F38 /* MineTableViewHeaderView.swift in Sources */,
 				A7931E1122AF989B00297D0A /* TopicSelectionViewController.swift in Sources */,
 				A71D2A602265673A00A55D16 /* RegisterLoginView.swift in Sources */,
+				BD2FCBE422B244250006D974 /* RecommendDetailContentCell.swift in Sources */,
 				A73D7C682268A032002A4CE3 /* SwiftyStarRatingView.swift in Sources */,
 				A7931E0122AF827600297D0A /* ESTabBarItemContentView.swift in Sources */,
 				A71AA5102272156A008FF1A5 /* ExpressAddressListViewController.swift in Sources */,
@@ -3853,6 +3893,7 @@
 				A7FF1592228C918100A85748 /* OrderRefunddetailsStatusTableViewCell.swift in Sources */,
 				A7CC74E62270628B003C4F38 /* DeliveryMethodTypeModel.swift in Sources */,
 				BDAA40FD228E9CD600CF841D /* OrderApplyRefundPhoneCell.swift in Sources */,
+				BD2FCBE222B21CF70006D974 /* CommunityRecommendController.swift in Sources */,
 				A71AA51F22729F35008FF1A5 /* AuthorizationSwift.swift in Sources */,
 				A7A98E3622802AD7005306E9 /* ShoppingMallBannerFSPagerViewCell.swift in Sources */,
 				BD12204E22AFB07E0051C7C2 /* MessageThumbController.swift in Sources */,
@@ -4011,6 +4052,7 @@
 				A775CBFE2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift in Sources */,
 				A71AA5212272E527008FF1A5 /* Extension+UINavigationController.swift in Sources */,
 				A7CC751822716202003C4F38 /* SetView.swift in Sources */,
+				BD2FCBEA22B267280006D974 /* RecommendNoneCommentCell.swift in Sources */,
 				A7FF1594228C919A00A85748 /* OrderRefunddetailsTipsTableViewCell.swift in Sources */,
 				A7B4E73A228192D20012914A /* CMSTemplateModel.swift in Sources */,
 				A72A72C622321DE000B21995 /* WebView.swift in Sources */,
@@ -4041,6 +4083,7 @@
 				A7B4E72F2281773F0012914A /* ProductFloorCenterTitleView.swift in Sources */,
 				A7284A542252FB5C000BAEC4 /* PaginationModel.swift in Sources */,
 				A72A72D022321E2700B21995 /* FontMacro.swift in Sources */,
+				BD2FCBE622B2586C0006D974 /* CommunityTagCollectionCell.swift in Sources */,
 				BD1DC6C9228D005000B89C57 /* OrderCreateParameterModel.swift in Sources */,
 				A71AA52622732068008FF1A5 /* SwiftMoyaServiceConfigApi.swift in Sources */,
 				A77F2C982231FD25001BD3F6 /* BaseNavigationViewController.swift in Sources */,
@@ -4090,6 +4133,7 @@
 				BDEF7791228571DC00ED0AC0 /* CommonPayView.swift in Sources */,
 				A71AF0A6226EDDC8001730FE /* SearchViewController.swift in Sources */,
 				BD20F1CF2283CE2300677D8E /* OrderFinishPayView.swift in Sources */,
+				BD2FCBEC22B274020006D974 /* RecommendCommentCell.swift in Sources */,
 				A7A98E4322804851005306E9 /* ShoppingMallSepcialFlowLayout.swift in Sources */,
 				BD12204122AF8E320051C7C2 /* MessagePlanetNotiTableCell.swift in Sources */,
 				A79057062276EA3D0037F823 /* OpenCityListModel.swift in Sources */,

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

@@ -128,3 +128,9 @@ let kfafafaColor = UIColor(hexString: "fafafa")
 let kfff8efColor = UIColor(hexString: "fff8ef")
 
 let kebebebColor = UIColor(hexString: "ebebeb")
+
+let k262626Color = UIColor(hexString: "262626")
+
+let kfff8ecColor = UIColor(hexString: "fff8ec")
+
+let k62cc74Color = UIColor(hexString: "62cc74")

+ 100 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -0,0 +1,100 @@
+//
+//  CommunityRecommendController.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class CommunityRecommendController: BaseViewController {
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+    }
+    
+    override func setupViews() {
+        navigationBar.title = "推荐详情"
+        view.backgroundColor = kf7f8faColor
+        
+        view.addSubview(tableView)
+    }
+    
+    override func setupLayouts() {
+        tableView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kNavBarTotalHeight)
+            make.left.right.bottom.equalTo(0)
+        }
+    }
+    
+    override func setupData() {
+        
+    }
+    
+    lazy var tableView: UITableView = {
+        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
+        tableView.separatorStyle = .none
+        tableView.backgroundColor = kf7f8faColor
+        tableView.dataSource = self
+        tableView.delegate = self
+        tableView.estimatedRowHeight = 200
+        tableView.estimatedSectionFooterHeight = 0.000001
+        tableView.estimatedSectionHeaderHeight = 0.000001
+        return tableView
+    }()
+    
+}
+
+// MARK: - tableView dataSource && delegate
+extension CommunityRecommendController: UITableViewDataSource, UITableViewDelegate {
+    
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return 2
+    }
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        switch section {
+        case 0:
+            return 1
+        case 1:
+            return 1
+        case 2:
+            return 3
+        default:
+            return 1
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        switch indexPath.section {
+        case 0:
+            let cell = RecommendDetailContentCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.layoutIfNeeded()
+            cell.reloadData()
+            return cell
+        case 1:
+            let cell = RecommendNoneCommentCell.cellWith(tableView: tableView, indexPath: indexPath)
+            return cell
+        case 2:
+            return UITableViewCell()
+        default:
+            return UITableViewCell()
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        print("点击了----\(indexPath.row)")
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return UITableView.automaticDimension
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 10
+    }
+    
+}

+ 85 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/CommunityTagCollectionCell.swift

@@ -0,0 +1,85 @@
+//
+//  CommunityTagCollectionCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  标签のCollectionCell
+
+import UIKit
+
+class CommunityTagCollectionCell: UICollectionViewCell {
+    
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> CommunityTagCollectionCell {
+        let ID = "CommunityTagCollectionCell"
+        collectionView.register(CommunityTagCollectionCell.self, forCellWithReuseIdentifier: ID)
+        let cell : CommunityTagCollectionCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! CommunityTagCollectionCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        backgroundColor = kffffffColor
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MRAK: - 设置View
+    private func setupViews() {
+        addSubview(typeView)
+        typeView.addSubview(iconImageView)
+        typeView.addSubview(titleLabel)
+    }
+    
+    private func setupLayouts() {
+        typeView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        iconImageView.snp.makeConstraints { (make) in
+            make.top.equalTo(5)
+            make.left.equalTo(6)
+            make.size.equalTo(16)
+        }
+        titleLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(3)
+            make.left.equalTo(iconImageView.snp_right).offset(5)
+            make.right.equalTo(-6)
+            make.height.equalTo(19)
+        }
+    }
+    
+    private lazy var typeView: UIView = {
+        let typeView = UIView()
+        typeView.backgroundColor = kf7f8faColor
+        typeView.cornerRadius = 12
+        typeView.masksToBounds = true
+        return typeView
+    }()
+    
+    private lazy var iconImageView: UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "pic_preload")
+        return iconImageView
+    }()
+    
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.text = "运动健身"
+        titleLabel.textColor = k666666Color
+        titleLabel.font = kRegularFont13
+        titleLabel.textAlignment = .left
+        return titleLabel
+    }()
+    
+}

+ 84 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/RecommendCommentCell.swift

@@ -0,0 +1,84 @@
+//
+//  RecommendCommentCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  推荐图文内容--有留言のCell
+
+import UIKit
+import RxSwift
+
+class RecommendCommentCell: UITableViewCell {
+    
+    let disposeBag = DisposeBag()
+    
+    typealias CommentClosure = () -> Void
+    var commentClosure : CommentClosure?
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> RecommendCommentCell {
+        let ID = "RecommendCommentCell"
+        tableView.register(RecommendCommentCell.self, forCellReuseIdentifier: ID)
+        let cell : RecommendCommentCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! RecommendCommentCell
+        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 = kffffffColor
+        
+        
+    }
+    
+    private func setupLayouts() {
+        
+    }
+    
+    
+    
+    
+    private lazy var titleView: UIView = {
+        let titleView = UIView()
+        titleView.backgroundColor = kF4F4F4Color
+        titleView.cornerRadius = 4
+        titleView.masksToBounds = true
+        return titleView
+    }()
+    
+    private lazy var commentBtn: UIButton = {
+        let commentBtn = UIButton(type: UIButton.ButtonType.custom)
+        commentBtn.backgroundColor = k62cc74Color
+        commentBtn.setTitle("我要留言", for: .normal)
+        commentBtn.setTitleColor(kffffffColor, for: .normal)
+        commentBtn.titleLabel?.font = kRegularFont14
+        commentBtn.cornerRadius = 17
+        commentBtn.masksToBounds = true
+        commentBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
+            if let commentClosure = self?.commentClosure {
+                commentClosure()
+            }
+            print("----btnClicked")
+        }).disposed(by: disposeBag)
+        
+        return commentBtn
+    }()
+    
+}

+ 218 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/RecommendDetailContentCell.swift

@@ -0,0 +1,218 @@
+//
+//  RecommendDetailContentCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  推荐图文内容--图文Cell
+
+import UIKit
+
+class RecommendDetailContentCell: UITableViewCell {
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> RecommendDetailContentCell {
+        let ID = "RecommendDetailContentCell"
+        tableView.register(RecommendDetailContentCell.self, forCellReuseIdentifier: ID)
+        let cell : RecommendDetailContentCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! RecommendDetailContentCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+        
+//        collectionView.reloadData()
+    }
+    
+    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 = kffffffColor
+        
+        addSubview(titleLabel)
+        addSubview(rainbowBeanView)
+        rainbowBeanView.addSubview(beanImageView)
+        rainbowBeanView.addSubview(beanLabel)
+        addSubview(contentLabel)
+        addSubview(collectionView)
+        addSubview(timeLabel)
+        addSubview(readLabel)
+    }
+    
+    private func setupLayouts() {
+        titleLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(20)
+            make.left.equalTo(14)
+            make.right.equalTo(-14)
+        }
+        rainbowBeanView.snp.makeConstraints { (make) in
+            make.top.equalTo(titleLabel.snp_bottom).offset(10)
+            make.left.equalTo(titleLabel.snp_left)
+            make.height.equalTo(24)
+        }
+        beanImageView.snp.makeConstraints { (make) in
+            make.left.equalTo(10)
+            make.centerY.equalToSuperview()
+            make.size.equalTo(19)
+        }
+        beanLabel.snp.makeConstraints { (make) in
+            make.left.equalTo(beanImageView.snp_right).offset(5)
+            make.centerY.equalToSuperview()
+            make.height.equalTo(19)
+            make.right.equalToSuperview().offset(-10)
+        }
+        contentLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(rainbowBeanView.snp_bottom).offset(10)
+            make.left.equalTo(titleLabel.snp_left)
+            make.right.equalTo(titleLabel.snp_right)
+        }
+        collectionView.snp.makeConstraints { (make) in
+            make.top.equalTo(contentLabel.snp_bottom).offset(15)
+            make.left.equalTo(titleLabel.snp_left)
+            make.right.equalTo(titleLabel.snp_right)
+        }
+        timeLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(collectionView.snp_bottom).offset(15)
+            make.left.equalTo(titleLabel.snp_left)
+            make.height.equalTo(15)
+            make.bottom.equalToSuperview().offset(-20)
+        }
+        readLabel.snp.makeConstraints { (make) in
+            make.right.equalTo(titleLabel.snp_right)
+            make.centerY.equalTo(timeLabel.snp_centerY)
+            make.height.equalTo(15)
+        }
+    }
+    
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.text = "绿皮书是一本历史上真实存在的黑人出行指南?是的,真是存在"
+        titleLabel.textColor = k262626Color
+        titleLabel.font = kMediumFont16
+        titleLabel.textAlignment = .left
+        titleLabel.numberOfLines = 0
+        return titleLabel
+    }()
+    
+    private lazy var rainbowBeanView: UIView = {
+        let rainbowBeanView = UIView()
+        rainbowBeanView.backgroundColor = kfff8ecColor
+        rainbowBeanView.cornerRadius = 12
+        rainbowBeanView.masksToBounds = true
+        return rainbowBeanView
+    }()
+    
+    private lazy var beanImageView : UIImageView = {
+        let beanImageView = UIImageView()
+        beanImageView.image = kImage(name: "page05")
+        return beanImageView
+    }()
+    
+    private lazy var beanLabel: UILabel = {
+        let beanLabel = UILabel()
+        beanLabel.text = "666彩虹豆待收获"
+        beanLabel.textColor = kFFA42FColor
+        beanLabel.font = kRegularFont13
+        beanLabel.textAlignment = .left
+        return beanLabel
+    }()
+    
+    private lazy var contentLabel: UILabel = {
+        let contentLabel = UILabel()
+        contentLabel.text = "The four-time Tour de France winner crashed at high-speed on Wednesday fracturing his right elbow, and right femur as well as several ribs. The fall took place during a recon of the stage 4 time trial at the Criterium du Dauphine and after several hours of medical assistance on the roadside near Roanne Froome was airlifted to hospital."
+        contentLabel.textColor = k313334Color
+        contentLabel.font = kRegularFont15
+        contentLabel.textAlignment = .left
+        contentLabel.numberOfLines = 0
+        return contentLabel
+    }()
+    
+    private lazy var timeLabel: UILabel = {
+        let timeLabel = UILabel()
+        timeLabel.text = "6个小时前"
+        timeLabel.textColor = kbbbbbbColor
+        timeLabel.font = kRegularFont12
+        timeLabel.textAlignment = .left
+        return timeLabel
+    }()
+    
+    private lazy var readLabel: UILabel = {
+        let readLabel = UILabel()
+        readLabel.text = "6个小时前"
+        readLabel.textColor = kbbbbbbColor
+        readLabel.font = kRegularFont12
+        readLabel.textAlignment = .right
+        return readLabel
+    }()
+    
+    private lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
+        collectionView.backgroundColor = kffffffColor
+        collectionView.delegate = self;
+        collectionView.dataSource = self;
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.bounces = false
+        collectionView.isScrollEnabled = false
+        return collectionView
+    }()
+    
+    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
+        let collectionViewLayout = UICollectionViewLeftAlignedLayout.init()
+        collectionViewLayout.minimumLineSpacing = 10
+        collectionViewLayout.minimumInteritemSpacing =  10
+//        collectionViewLayout.sectionInset = UIEdgeInsets(top: 10, left: 14, bottom: 10, right: 14)
+        collectionViewLayout.scrollDirection = UICollectionView.ScrollDirection.vertical
+        collectionViewLayout.estimatedItemSize = CGSize(width: ((kScreenWidth - 28) - 3*10)/4, height: 24)
+        return collectionViewLayout
+    }()
+    
+    //加载数据
+    func reloadData() {
+        //collectionView重新加载数据
+        self.collectionView.reloadData()
+        //更新collectionView的高度约束
+        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize        
+        collectionView.snp.makeConstraints { (make) in
+            make.top.equalTo(contentLabel.snp_bottom).offset(15)
+            make.left.equalTo(titleLabel.snp_left)
+            make.right.equalTo(titleLabel.snp_right)
+            make.height.equalTo(contentSize.height)
+        }
+        self.collectionView.collectionViewLayout.invalidateLayout()
+    }
+    
+}
+
+extension RecommendDetailContentCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return 5
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = CommunityTagCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        return cell
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        print("点击了collection----\(indexPath.row)")
+    }
+    
+}
+

+ 148 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/RecommendNoneCommentCell.swift

@@ -0,0 +1,148 @@
+//
+//  RecommendNoneCommentCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  推荐图文内容--无留言のCell
+
+import UIKit
+import RxSwift
+
+class RecommendNoneCommentCell: UITableViewCell {
+    
+    let disposeBag = DisposeBag()
+    
+    typealias CommentClosure = () -> Void
+    var commentClosure : CommentClosure?
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> RecommendNoneCommentCell {
+        let ID = "RecommendNoneCommentCell"
+        tableView.register(RecommendNoneCommentCell.self, forCellReuseIdentifier: ID)
+        let cell : RecommendNoneCommentCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! RecommendNoneCommentCell
+        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 = kffffffColor
+        
+        addSubview(iconImageView)
+        addSubview(triangleView)
+        addSubview(titleView)
+        titleView.addSubview(titleLabel)
+        addSubview(commentBtn)
+    }
+    
+    private func setupLayouts() {
+        iconImageView.snp.makeConstraints { (make) in
+            make.top.equalTo(25)
+            make.left.equalTo(14)
+            make.size.equalTo(30)
+        }
+        triangleView.snp.makeConstraints { (make) in
+            make.left.equalTo(iconImageView.snp_right).offset(11)
+            make.centerY.equalTo(iconImageView.snp_centerY)
+            make.width.equalTo(8)
+            make.height.equalTo(14)
+        }
+        titleView.snp.makeConstraints { (make) in
+            make.left.equalTo(triangleView.snp_right)
+            make.centerY.equalTo(triangleView.snp_centerY)
+            make.right.equalToSuperview().offset(-14)
+            make.height.equalTo(40)
+        }
+        titleLabel.snp.makeConstraints { (make) in
+            make.left.equalTo(12)
+            make.centerY.equalToSuperview()
+            make.height.equalTo(20)
+        }
+        commentBtn.snp.makeConstraints { (make) in
+            make.top.equalTo(titleView.snp_bottom).offset(20)
+            make.centerX.equalToSuperview()
+            make.width.equalTo(110)
+            make.height.equalTo(34)
+            make.bottom.equalToSuperview().offset(-20)
+        }
+    }
+    
+    private lazy var iconImageView : UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "page05")
+        return iconImageView
+    }()
+    
+    private lazy var triangleView: UIView = {
+        let triangleView = UIView(frame: CGRect(x: 0, y: 0, width: 8, height: 14))
+        triangleView.backgroundColor = kF4F4F4Color
+        
+        // 画三角
+        let trianglePath = UIBezierPath()
+        var point = CGPoint(x: 0, y: 14/2)
+        trianglePath.move(to: point)
+        point = CGPoint(x: 8, y: 14)
+        trianglePath.addLine(to: point)
+        point = CGPoint(x: 8, y: 0)
+        trianglePath.addLine(to: point)
+        trianglePath.close()
+        let triangleLayer = CAShapeLayer()
+        triangleLayer.path = trianglePath.cgPath
+        triangleLayer.fillColor = kF4F4F4Color.cgColor
+        triangleView.layer.addSublayer(triangleLayer)
+        return triangleView
+    }()
+    
+    private lazy var titleView: UIView = {
+        let titleView = UIView()
+        titleView.backgroundColor = kF4F4F4Color
+        titleView.cornerRadius = 4
+        titleView.masksToBounds = true
+        return titleView
+    }()
+    
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.text = "“终于等到你来留言了”"
+        titleLabel.textColor = k333333Color
+        titleLabel.font = kRegularFont14
+        titleLabel.textAlignment = .left
+        return titleLabel
+    }()
+    
+    private lazy var commentBtn: UIButton = {
+        let commentBtn = UIButton(type: UIButton.ButtonType.custom)
+        commentBtn.backgroundColor = k62cc74Color
+        commentBtn.setTitle("我要留言", for: .normal)
+        commentBtn.setTitleColor(kffffffColor, for: .normal)
+        commentBtn.titleLabel?.font = kRegularFont14
+        commentBtn.cornerRadius = 17
+        commentBtn.masksToBounds = true
+        commentBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
+            if let commentClosure = self?.commentClosure {
+                commentClosure()
+            }
+            print("----btnClicked")
+        }).disposed(by: disposeBag)
+        
+        return commentBtn
+    }()
+    
+}