Explorar o código

推荐详情 -- 有评论的Cell to be continued

Chris %!s(int64=5) %!d(string=hai) anos
pai
achega
163780183a

+ 24 - 4
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -392,7 +392,6 @@
 		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 */; };
@@ -414,6 +413,10 @@
 		BDAF83A622B334D90004BCC3 /* RecommendSimilarCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF83A522B334D90004BCC3 /* RecommendSimilarCollectionCell.swift */; };
 		BDAF83A822B343C50004BCC3 /* RecommendBottomCommentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF83A722B343C50004BCC3 /* RecommendBottomCommentView.swift */; };
 		BDAF83AA22B388F20004BCC3 /* RecommendDefaultBackCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF83A922B388F20004BCC3 /* RecommendDefaultBackCell.swift */; };
+		BDAF83B022B3B63B0004BCC3 /* RecommendCommentHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF83AF22B3B63B0004BCC3 /* RecommendCommentHeader.swift */; };
+		BDAF83B222B3B67D0004BCC3 /* RecommendCommentFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF83B122B3B67D0004BCC3 /* RecommendCommentFooter.swift */; };
+		BDAF83B422B3B6DF0004BCC3 /* RecommendMajorCommentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF83B322B3B6DF0004BCC3 /* RecommendMajorCommentCell.swift */; };
+		BDAF83B622B3B7010004BCC3 /* RecommendSubCommentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAF83B522B3B7010004BCC3 /* RecommendSubCommentCell.swift */; };
 		BDD22F0B228FAA5B00D43BFB /* ImageUrlModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD22F0A228FAA5B00D43BFB /* ImageUrlModel.swift */; };
 		BDD4FB1222840597006FE833 /* ShoppingCartPayOrderController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD4FB1122840597006FE833 /* ShoppingCartPayOrderController.swift */; };
 		BDD4FB1422840954006FE833 /* ShoppingCartOrderPayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD4FB1322840954006FE833 /* ShoppingCartOrderPayView.swift */; };
@@ -865,7 +868,6 @@
 		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>"; };
@@ -888,6 +890,10 @@
 		BDAF83A522B334D90004BCC3 /* RecommendSimilarCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendSimilarCollectionCell.swift; sourceTree = "<group>"; };
 		BDAF83A722B343C50004BCC3 /* RecommendBottomCommentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendBottomCommentView.swift; sourceTree = "<group>"; };
 		BDAF83A922B388F20004BCC3 /* RecommendDefaultBackCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendDefaultBackCell.swift; sourceTree = "<group>"; };
+		BDAF83AF22B3B63B0004BCC3 /* RecommendCommentHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendCommentHeader.swift; sourceTree = "<group>"; };
+		BDAF83B122B3B67D0004BCC3 /* RecommendCommentFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendCommentFooter.swift; sourceTree = "<group>"; };
+		BDAF83B322B3B6DF0004BCC3 /* RecommendMajorCommentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendMajorCommentCell.swift; sourceTree = "<group>"; };
+		BDAF83B522B3B7010004BCC3 /* RecommendSubCommentCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendSubCommentCell.swift; sourceTree = "<group>"; };
 		BDD22F0A228FAA5B00D43BFB /* ImageUrlModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageUrlModel.swift; sourceTree = "<group>"; };
 		BDD4FB1122840597006FE833 /* ShoppingCartPayOrderController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartPayOrderController.swift; sourceTree = "<group>"; };
 		BDD4FB1322840954006FE833 /* ShoppingCartOrderPayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartOrderPayView.swift; sourceTree = "<group>"; };
@@ -3311,11 +3317,11 @@
 		BD2FCBE022B21C600006D974 /* View */ = {
 			isa = PBXGroup;
 			children = (
+				BDAF83AE22B3B6150004BCC3 /* 全部评论的Cell */,
 				BDAF83A922B388F20004BCC3 /* RecommendDefaultBackCell.swift */,
 				BD2FCBE322B244250006D974 /* RecommendDetailContentCell.swift */,
 				BD2FCBE522B2586C0006D974 /* CommunityTagCollectionCell.swift */,
 				BD2FCBE922B267280006D974 /* RecommendNoneCommentCell.swift */,
-				BD2FCBEB22B274020006D974 /* RecommendCommentCell.swift */,
 				BDAF83A122B330540004BCC3 /* RecommendSimilarCell.swift */,
 				BDAF83A522B334D90004BCC3 /* RecommendSimilarCollectionCell.swift */,
 				BDAF83A722B343C50004BCC3 /* RecommendBottomCommentView.swift */,
@@ -3458,6 +3464,17 @@
 			path = AdressCell;
 			sourceTree = "<group>";
 		};
+		BDAF83AE22B3B6150004BCC3 /* 全部评论的Cell */ = {
+			isa = PBXGroup;
+			children = (
+				BDAF83AF22B3B63B0004BCC3 /* RecommendCommentHeader.swift */,
+				BDAF83B322B3B6DF0004BCC3 /* RecommendMajorCommentCell.swift */,
+				BDAF83B522B3B7010004BCC3 /* RecommendSubCommentCell.swift */,
+				BDAF83B122B3B67D0004BCC3 /* RecommendCommentFooter.swift */,
+			);
+			path = "全部评论的Cell";
+			sourceTree = "<group>";
+		};
 		BDEF778F228571C200ED0AC0 /* PayManagerView */ = {
 			isa = PBXGroup;
 			children = (
@@ -3795,10 +3812,13 @@
 				A70B2C3322880BB700B2449F /* ProductDetailProductLabelTableViewCell.swift in Sources */,
 				BDF45F0D228C00B8004E2682 /* DefaultContactInfoModel.swift in Sources */,
 				A72A72BA22321DE000B21995 /* Extension+String.swift in Sources */,
+				BDAF83B222B3B67D0004BCC3 /* RecommendCommentFooter.swift in Sources */,
 				A70B8430228FF6D400882BC5 /* ProductCartCountModel.swift in Sources */,
 				A77F2CA02231FE45001BD3F6 /* BaseWebViewController.swift in Sources */,
+				BDAF83B422B3B6DF0004BCC3 /* RecommendMajorCommentCell.swift in Sources */,
 				BD20F1D52283D15500677D8E /* OrderFinishPayFailureCell.swift in Sources */,
 				A72A72C022321DE000B21995 /* Extension+UIView.swift in Sources */,
+				BDAF83B022B3B63B0004BCC3 /* RecommendCommentHeader.swift in Sources */,
 				BD7AB83A2284288D0030646A /* ShoppingCartPayOrderFooter.swift in Sources */,
 				A719EE6E22AF441F001AAC98 /* CommunityViewController.swift in Sources */,
 				A72A72C522321DE000B21995 /* WKWebViewConfig.swift in Sources */,
@@ -4149,8 +4169,8 @@
 				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 */,
+				BDAF83B622B3B7010004BCC3 /* RecommendSubCommentCell.swift in Sources */,
 				BD12204122AF8E320051C7C2 /* MessagePlanetNotiTableCell.swift in Sources */,
 				A79057062276EA3D0037F823 /* OpenCityListModel.swift in Sources */,
 				BD7AB838228420310030646A /* ShoppingCartPayOrderHeader.swift in Sources */,

+ 38 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -77,7 +77,7 @@ class CommunityRecommendController: BaseViewController {
 extension CommunityRecommendController: UITableViewDataSource, UITableViewDelegate {
     
     func numberOfSections(in tableView: UITableView) -> Int {
-        return 4
+        return 5
     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@@ -88,6 +88,8 @@ extension CommunityRecommendController: UITableViewDataSource, UITableViewDelega
             return 1
         case 2:
             return 1
+        case 3:
+            return 3
         default:
             return 1
         }
@@ -111,6 +113,9 @@ extension CommunityRecommendController: UITableViewDataSource, UITableViewDelega
             }
             return cell
         case 3:
+            let cell = CommunityMajorCommentCell.cellWith(tableView: tableView, indexPath: indexPath)
+            return cell
+        case 4:
             let cell = RecommendSimilarCell.cellWith(tableView: tableView, indexPath: indexPath)
             cell.layoutIfNeeded()
             cell.reloadData()
@@ -133,11 +138,41 @@ extension CommunityRecommendController: UITableViewDataSource, UITableViewDelega
     }
     
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 10
+        if section == 3 {
+            return 64
+        } else {
+            return 10
+        }
     }
     
     func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0
+        if section == 3 {
+            return 51
+        } else {
+            return 0
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        if section == 3 {
+            let headerView = RecommendCommentHeader(frame: CGRect.zero)
+            return headerView
+        } else {
+            return nil
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        if section == 3 {
+            let footerView = RecommendCommentFooter(frame: CGRect.zero)
+            footerView.unfoldClosure = {
+                [weak self] in
+                print("----点击了展开")
+            }
+            return footerView
+        } else {
+            return nil
+        }
     }
     
 }

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

@@ -1,84 +0,0 @@
-//
-//  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
-    }()
-    
-}

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

@@ -139,7 +139,6 @@ class RecommendNoneCommentCell: UITableViewCell {
             if let commentClosure = self?.commentClosure {
                 commentClosure()
             }
-            print("----btnClicked")
         }).disposed(by: disposeBag)
         
         return commentBtn

+ 16 - 4
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/RecommendSimilarCollectionCell.swift

@@ -26,7 +26,12 @@ class RecommendSimilarCollectionCell: UICollectionViewCell {
     //MARK: - indexPath
     var indexPath: IndexPath?{
         didSet {
-            
+            if self.indexPath?.row == 1 || self.indexPath?.row == 2 {
+                titleLabel.text = "The UCI announced on Thursday that its Anti-Doping Tribunal found Cobo \"guilty of an anti-doping rule violation (Use of a prohibited substance) based on abnormalities from 2009 and 2011 detected in his Biological Passport and imposed a three-year period of ineligibility on the rider.\""
+            } else {
+                titleLabel.text = "Criterium du Dauphine: Van Aert wins stage 4"
+            }
+
         }
     }
     //MARK: - 初始化
@@ -53,11 +58,12 @@ class RecommendSimilarCollectionCell: UICollectionViewCell {
     private func setupLayouts() {
         contentImageView.snp.makeConstraints { (make) in
             make.top.left.right.equalToSuperview()
+            make.width.equalTo((kScreenWidth-10-5)/2)
         }
         titleLabel.snp.makeConstraints { (make) in
             make.top.equalTo(contentImageView.snp_bottom).offset(15)
-            make.left.equalTo(10)
-            make.right.equalTo(-10)
+            make.left.equalTo(contentImageView.snp_left).offset(10)
+            make.right.equalTo(contentImageView.snp_right).offset(-10)
         }
         iconImageView.snp.makeConstraints { (make) in
             make.top.equalTo(titleLabel.snp_bottom).offset(10)
@@ -65,12 +71,14 @@ class RecommendSimilarCollectionCell: UICollectionViewCell {
             make.bottom.equalToSuperview().offset(-15)
             make.size.equalTo(18)
         }
+        
         likeBtn.snp.makeConstraints { (make) in
             make.top.equalTo(titleLabel.snp_bottom).offset(12)
             make.right.equalTo(-13)
             make.height.equalTo(15)
         }
         likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
+        
         nameLabel.snp.makeConstraints { (make) in
             make.centerY.equalTo(iconImageView.snp_centerY)
             make.left.equalTo(iconImageView.snp_right).offset(5)
@@ -87,7 +95,11 @@ class RecommendSimilarCollectionCell: UICollectionViewCell {
     
     private lazy var titleLabel: UILabel = {
         let titleLabel = UILabel()
-        titleLabel.text = "Criterium du Dauphine: Van Aert wins stage 4"
+//        if self.indexPath?.row == 1 {
+//            titleLabel.text = "The UCI announced on Thursday that its Anti-Doping Tribunal found Cobo \"guilty of an anti-doping rule violation (Use of a prohibited substance) based on abnormalities from 2009 and 2011 detected in his Biological Passport and imposed a three-year period of ineligibility on the rider.\""
+//        } else {
+//            titleLabel.text = "Criterium du Dauphine: Van Aert wins stage 4"
+//        }
         titleLabel.textColor = k262626Color
         titleLabel.font = kMediumFont13
         titleLabel.textAlignment = .left

+ 44 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/全部评论的Cell/RecommendCommentFooter.swift

@@ -0,0 +1,44 @@
+//
+//  RecommendCommentFooter.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/14.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  推荐图文内容--有留言のFooterView
+
+import UIKit
+
+class RecommendCommentFooter: BaseView {
+    
+    typealias UnfoldClosure = () -> Void
+    var unfoldClosure : UnfoldClosure?
+    
+    override func setupViews() {
+        self.backgroundColor = kffffffColor
+        
+        addSubview(unfoldBtn)
+    }
+    
+    override func setupLayouts() {
+        unfoldBtn.snp.makeConstraints { (make) in
+            make.center.equalToSuperview()
+            make.width.equalTo(120)
+            make.height.equalTo(30)
+        }
+    }
+    
+    private lazy var unfoldBtn: UIButton = {
+        let unfoldBtn = UIButton(type: UIButton.ButtonType.custom)        
+        unfoldBtn.setTitle("展开更多评论", for: .normal)
+        unfoldBtn.setTitleColor(k62cc74Color, for: .normal)
+        unfoldBtn.titleLabel?.font = kRegularFont14        
+        unfoldBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
+            if let unfoldClosure = self?.unfoldClosure {
+                unfoldClosure()
+            }            
+        }).disposed(by: disposeBag)
+        
+        return unfoldBtn
+    }()
+    
+}

+ 45 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/全部评论的Cell/RecommendCommentHeader.swift

@@ -0,0 +1,45 @@
+//
+//  RecommendCommentHeader.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/14.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  推荐图文内容--有留言のHeaderView
+
+import UIKit
+
+class RecommendCommentHeader: BaseView {
+    
+    override func setupViews() {
+        self.backgroundColor = kffffffColor
+        
+        addSubview(sepView)
+        addSubview(commentLabel)
+    }
+    
+    override func setupLayouts() {
+        sepView.snp.makeConstraints { (make) in
+            make.top.left.right.equalToSuperview()
+            make.height.equalTo(10)
+        }
+        commentLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(sepView.snp_bottom).offset(20)
+            make.left.equalTo(14)            
+            make.height.equalTo(24)
+        }
+    }
+    
+    private lazy var sepView: UIView = {
+        let sepView = UIView()
+        sepView.backgroundColor = kf7f8faColor
+        return sepView
+    }()
+    
+    private lazy var commentLabel: UILabel = {
+        let commentLabel = UILabel()
+        commentLabel.text = "全部评论 8"
+        commentLabel.textColor = k262626Color
+        commentLabel.font = kMediumFont18
+        return commentLabel
+    }()
+}

+ 108 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/全部评论的Cell/RecommendMajorCommentCell.swift

@@ -0,0 +1,108 @@
+//
+//  RecommendMajorCommentCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/14.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  推荐图文内容--主评论のCell
+
+import UIKit
+
+class RecommendMajorCommentCell: UITableViewCell {
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> RecommendMajorCommentCell {
+        let ID = "RecommendMajorCommentCell"
+        tableView.register(RecommendMajorCommentCell.self, forCellReuseIdentifier: ID)
+        let cell : RecommendMajorCommentCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! RecommendMajorCommentCell
+        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(titleLabel)
+        addSubview(contentLabel)
+        addSubview(timeLabel)
+    }
+    
+    private func setupLayouts() {
+        iconImageView.snp.makeConstraints { (make) in
+            make.top.equalTo(10)
+            make.left.equalTo(14)
+            make.size.equalTo(24)
+        }
+        titleLabel.snp.makeConstraints { (make) in
+            make.left.equalTo(iconImageView.snp_right).offset(10)
+            make.right.equalToSuperview().offset(-26)
+            make.centerY.equalTo(iconImageView)
+            make.height.equalTo(17)
+        }
+        contentLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(titleLabel.snp_bottom).offset(10)
+            make.left.equalTo(titleLabel.snp_left)
+            make.right.equalToSuperview().offset(-14)
+        }
+        timeLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(contentLabel.snp_bottom).offset(8)
+            make.left.equalTo(titleLabel.snp_left)
+            make.right.equalTo(contentLabel.snp_right)
+            make.height.equalTo(15)
+            make.bottom.equalToSuperview().offset(-10)
+        }
+    }
+    
+    lazy var iconImageView : UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "page05")
+        return iconImageView
+    }()
+    
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.text = "张吃饭"
+        titleLabel.textColor = k999999Color
+        titleLabel.font = kRegularFont14
+        titleLabel.textAlignment = .left
+        return titleLabel
+    }()
+    
+    private lazy var contentLabel: UILabel = {
+        let contentLabel = UILabel()
+        contentLabel.text = "点击单条评时弹出选择操作框(目前仅支持回复),点击操作框后进行相应的操作"
+        contentLabel.textColor = k333333Color
+        contentLabel.font = kRegularFont14
+        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
+    }()
+    
+}

+ 9 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/全部评论的Cell/RecommendSubCommentCell.swift

@@ -0,0 +1,9 @@
+//
+//  RecommendSubCommentCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/14.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  推荐图文内容--次级评论のCell
+
+import Foundation