Преглед изворни кода

编辑发布 -- to be continued

Chris пре 5 година
родитељ
комит
829a88dad5

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

@@ -424,6 +424,12 @@
 		BD20F1D52283D15500677D8E /* OrderFinishPayFailureCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD20F1D42283D15500677D8E /* OrderFinishPayFailureCell.swift */; };
 		BD24FABB22B509CF00C7AA3B /* PublishModule.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD24FABA22B509CF00C7AA3B /* PublishModule.xcassets */; };
 		BD24FABF22B50C4B00C7AA3B /* KSMediaPicker.strings in Resources */ = {isa = PBXBuildFile; fileRef = BD24FABE22B50C4B00C7AA3B /* KSMediaPicker.strings */; };
+		BD28077822B721BF002AB976 /* PublishEditController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD28077722B721BF002AB976 /* PublishEditController.swift */; };
+		BD28077A22B72734002AB976 /* PublishEditTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD28077922B72734002AB976 /* PublishEditTitleCell.swift */; };
+		BD28077C22B72761002AB976 /* PublishEditDescribeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD28077B22B72761002AB976 /* PublishEditDescribeCell.swift */; };
+		BD28077E22B72797002AB976 /* PublishEditAddTopicCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD28077D22B72797002AB976 /* PublishEditAddTopicCell.swift */; };
+		BD28078022B727A6002AB976 /* PublishEditAddAddressCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD28077F22B727A6002AB976 /* PublishEditAddAddressCell.swift */; };
+		BD28078222B727BD002AB976 /* PublishEditAddPicCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD28078122B727BD002AB976 /* PublishEditAddPicCell.swift */; };
 		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 */; };
@@ -943,6 +949,12 @@
 		BD20F1D42283D15500677D8E /* OrderFinishPayFailureCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderFinishPayFailureCell.swift; sourceTree = "<group>"; };
 		BD24FABA22B509CF00C7AA3B /* PublishModule.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = PublishModule.xcassets; sourceTree = "<group>"; };
 		BD24FABE22B50C4B00C7AA3B /* KSMediaPicker.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = KSMediaPicker.strings; sourceTree = "<group>"; };
+		BD28077722B721BF002AB976 /* PublishEditController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditController.swift; sourceTree = "<group>"; };
+		BD28077922B72734002AB976 /* PublishEditTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditTitleCell.swift; sourceTree = "<group>"; };
+		BD28077B22B72761002AB976 /* PublishEditDescribeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditDescribeCell.swift; sourceTree = "<group>"; };
+		BD28077D22B72797002AB976 /* PublishEditAddTopicCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditAddTopicCell.swift; sourceTree = "<group>"; };
+		BD28077F22B727A6002AB976 /* PublishEditAddAddressCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditAddAddressCell.swift; sourceTree = "<group>"; };
+		BD28078122B727BD002AB976 /* PublishEditAddPicCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditAddPicCell.swift; 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>"; };
@@ -3383,6 +3395,7 @@
 			isa = PBXGroup;
 			children = (
 				BD12B67222B4E99800AEB10B /* PublishMediaPicker */,
+				BD28077422B72175002AB976 /* PublishEditController */,
 			);
 			path = PublishModule;
 			sourceTree = "<group>";
@@ -3538,6 +3551,35 @@
 			path = Category;
 			sourceTree = "<group>";
 		};
+		BD28077422B72175002AB976 /* PublishEditController */ = {
+			isa = PBXGroup;
+			children = (
+				BD28077622B721AC002AB976 /* View */,
+				BD28077522B721A2002AB976 /* Controller */,
+			);
+			path = PublishEditController;
+			sourceTree = "<group>";
+		};
+		BD28077522B721A2002AB976 /* Controller */ = {
+			isa = PBXGroup;
+			children = (
+				BD28077722B721BF002AB976 /* PublishEditController.swift */,
+			);
+			path = Controller;
+			sourceTree = "<group>";
+		};
+		BD28077622B721AC002AB976 /* View */ = {
+			isa = PBXGroup;
+			children = (
+				BD28078122B727BD002AB976 /* PublishEditAddPicCell.swift */,
+				BD28077922B72734002AB976 /* PublishEditTitleCell.swift */,
+				BD28077B22B72761002AB976 /* PublishEditDescribeCell.swift */,
+				BD28077D22B72797002AB976 /* PublishEditAddTopicCell.swift */,
+				BD28077F22B727A6002AB976 /* PublishEditAddAddressCell.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		BD2FCBDE22B21BE00006D974 /* CommunityRecommendDetail */ = {
 			isa = PBXGroup;
 			children = (
@@ -4106,6 +4148,7 @@
 				A71AA5152272160A008FF1A5 /* ExpressAddressListTableViewCell.swift in Sources */,
 				A72A72B722321DE000B21995 /* Extension+NSMutableAttributedString.swift in Sources */,
 				A7931E0D22AF874600297D0A /* GenderSelectionViewController.swift in Sources */,
+				BD28077E22B72797002AB976 /* PublishEditAddTopicCell.swift in Sources */,
 				A7F2D6D022B1119A0093000B /* CommunityEnum.swift in Sources */,
 				A7BB6857226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift in Sources */,
 				BDE3045F228554CA001D050F /* ProductCartAmountModel.swift in Sources */,
@@ -4125,6 +4168,7 @@
 				A71D2A602265673A00A55D16 /* RegisterLoginView.swift in Sources */,
 				BD12B6AC22B502C200AEB10B /* KSVideoPlayerBaseView.m in Sources */,
 				BD2FCBE422B244250006D974 /* RecommendDetailContentCell.swift in Sources */,
+				BD28078022B727A6002AB976 /* PublishEditAddAddressCell.swift in Sources */,
 				A73D7C682268A032002A4CE3 /* SwiftyStarRatingView.swift in Sources */,
 				A7931E0122AF827600297D0A /* ESTabBarItemContentView.swift in Sources */,
 				A71AA5102272156A008FF1A5 /* ExpressAddressListViewController.swift in Sources */,
@@ -4287,6 +4331,7 @@
 				A71AA52822732173008FF1A5 /* SwiftMoyaNetWorkServiceConfig.swift in Sources */,
 				A70B2C732289019200B2449F /* ProductDetailSkuView.swift in Sources */,
 				A70B2C4322883B4E00B2449F /* ProductDetailShopTableViewCell.swift in Sources */,
+				BD28078222B727BD002AB976 /* PublishEditAddPicCell.swift in Sources */,
 				A70B2C102286A3BC00B2449F /* ProductDetailModel.swift in Sources */,
 				A7A17E5F22A0CEF200B7A77E /* SwiftMoyaNetWorkManagerTools.swift in Sources */,
 				A72A72A922321DE000B21995 /* NumberKeyboard.swift in Sources */,
@@ -4380,6 +4425,7 @@
 				A71AF0BC226F099B001730FE /* ProductHBigTableViewCell.swift in Sources */,
 				BD12B69122B4F60300AEB10B /* KSMediaPickerScrollView.m in Sources */,
 				BD108C9622A60C2100837DAB /* HGImagePickerCell.swift in Sources */,
+				BD28077822B721BF002AB976 /* PublishEditController.swift in Sources */,
 				A7A98E3C228036D7005306E9 /* ShoppingMallCategoryCollectionViewCell.swift in Sources */,
 				A7C0FDEB22B4C6C300BC1E86 /* CardContentCommentListFooterView.swift in Sources */,
 				BD3AA45822AE63EC00EF4F20 /* MessageMainViewController.swift in Sources */,
@@ -4398,6 +4444,7 @@
 				A71AA52622732068008FF1A5 /* SwiftMoyaServiceConfigApi.swift in Sources */,
 				A77F2C982231FD25001BD3F6 /* BaseNavigationViewController.swift in Sources */,
 				A7274C5D228EE636000E3A07 /* LBXScanViewStyle.swift in Sources */,
+				BD28077C22B72761002AB976 /* PublishEditDescribeCell.swift in Sources */,
 				A73911B3229ECE340033177E /* UICollectionViewLeftAlignedLayout.m in Sources */,
 				A7A98E1B227EEE49005306E9 /* SpecialView.swift in Sources */,
 				BDF47D7A228271F600941AB9 /* ShoppingCartView.swift in Sources */,
@@ -4480,6 +4527,7 @@
 				BD12204422AF996E0051C7C2 /* MessageCommentController.swift in Sources */,
 				A7778CDD2246121500C7C47A /* PhoneCountryAreaListMdoel.swift in Sources */,
 				A72A733522325A4B00B21995 /* AppDelegate+HandleOpen.swift in Sources */,
+				BD28077A22B72734002AB976 /* PublishEditTitleCell.swift in Sources */,
 				A7FF156E228C6EAE00A85748 /* OrderDeliveryModeTableViewCell.swift in Sources */,
 				A72A72AC22321DE000B21995 /* Regex.swift in Sources */,
 				BD12B67422B4EC9700AEB10B /* KSMediaPickerController.swift in Sources */,

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

@@ -135,3 +135,5 @@ let kfff8ecColor = UIColor(hexString: "fff8ec")
 let k62cc74Color = UIColor(hexString: "62cc74")
 
 let kFFF8ECColor = UIColor(hexString: "FFF8EC")
+
+let kDDDDDDColor = UIColor(hexString: "DDDDDD")

+ 128 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/Controller/PublishEditController.swift

@@ -0,0 +1,128 @@
+//
+//  PublishEditController.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  编辑发布Vc
+
+import UIKit
+import RxSwift
+import SwiftyJSON
+import Photos
+
+class PublishEditController: BaseViewController {
+    
+    // 上传图片数组
+    var goodsImageArr = Array<UIImage>()
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupData()
+    }
+    
+    override func setupViews() {
+        self.view.backgroundColor = kffffffColor
+        
+        navigationBar.title = ""
+        navigationBar.wr_setRightButton(title: "发布", titleColor: k333333Color)
+        navigationBar.onClickRightButton = {
+            [weak self] in
+            print("----点击了发布")
+        }
+        
+        self.view.addSubview(tableView)
+    }
+    
+    override func setupLayouts() {
+        tableView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kNavBarTotalHeight)
+            make.left.right.bottom.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        
+    }
+    
+    lazy var tableView: UITableView = {
+        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
+        tableView.separatorStyle = .none
+        tableView.backgroundColor = kffffffColor
+        tableView.dataSource = self
+        tableView.delegate = self
+        tableView.estimatedRowHeight = 0.000001
+        tableView.estimatedSectionFooterHeight = 0.000001
+        tableView.estimatedSectionHeaderHeight = 0.000001
+        return tableView
+    }()
+    
+}
+
+// MARK: - tableView dataSource && delegate
+extension PublishEditController : UITableViewDelegate, UITableViewDataSource {
+    
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return 1
+    }
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 5
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        switch indexPath.row {
+        case 0:
+            let picCell = PublishEditAddPicCell.cellWith(tableView: tableView, indexPath: indexPath)
+            return picCell
+        case 1:
+            let titleCell = PublishEditTitleCell.cellWith(tableView: tableView, indexPath: indexPath)
+            return titleCell
+        case 2:
+            let desCell = PublishEditDescribeCell.cellWith(tableView: tableView, indexPath: indexPath)
+//            actCell.allSelectBlock = {
+//                [weak self] (isAllSel) in
+//                self?.isAllSelected = isAllSel
+//                self?.allSelectedAction(isAllSel)
+//            }
+            return desCell
+        case 3:
+            let topicCell = PublishEditAddTopicCell.cellWith(tableView: tableView, indexPath: indexPath)
+            return topicCell
+        case 4:
+            let addrCell = PublishEditAddAddressCell.cellWith(tableView: tableView, indexPath: indexPath)
+            return addrCell
+        default:
+            return UITableViewCell()
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        switch indexPath.row {
+        case 1,3,4:
+            return 50
+        case 2:
+            return 190
+        default:
+            return UITableView.automaticDimension
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0.000001
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+}

+ 108 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddAddressCell.swift

@@ -0,0 +1,108 @@
+//
+//  PublishEditAddAddressCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishEditAddAddressCell: UITableViewCell {
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishEditAddAddressCell {
+        let ID = "PublishEditAddAddressCell"
+        tableView.register(PublishEditAddAddressCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishEditAddAddressCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishEditAddAddressCell
+        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(20)
+            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(12)
+            make.left.equalTo(titleLabel.snp_left)
+            make.right.equalToSuperview().offset(-26)
+        }
+        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(-20)
+        }
+    }
+    
+    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
+    }()
+    
+}

+ 103 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddPicCell.swift

@@ -0,0 +1,103 @@
+//
+//  PublishEditAddPicCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+import IQKeyboardManagerSwift
+
+class PublishEditAddPicCell: UITableViewCell {
+    
+    let disposeBag = DisposeBag()
+    
+    typealias NoteTextViewClosure = (_ text: String) -> Void
+    var noteTextViewClosure : NoteTextViewClosure?
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishEditAddPicCell {
+        let ID = "PublishEditAddPicCell"
+        tableView.register(PublishEditAddPicCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishEditAddPicCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishEditAddPicCell
+        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
+        addSubview(titleLabel)
+        addSubview(noteTextView)
+    }
+    
+    private func setupLayouts() {
+        titleLabel.snp.makeConstraints { (make) in
+            make.top.left.equalTo(14)
+            make.width.equalTo(56)
+            make.height.equalTo(20)
+        }
+        noteTextView.snp.remakeConstraints { (make) in
+            make.top.equalTo(6).priority(999)
+            make.height.greaterThanOrEqualTo(46).priority(888)
+            make.bottom.equalTo(-6).priority(777)
+            make.left.equalTo(titleLabel.snp_right).offset(20)
+            make.right.equalToSuperview().offset(-14)
+        }
+    }
+    
+    lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.textColor = k333333Color
+        titleLabel.font = kRegularFont14
+        titleLabel.text = "备注信息"
+        return titleLabel
+    }()
+    
+    lazy var noteTextView: IQTextView = {
+        let noteTextView = IQTextView()
+        noteTextView.backgroundColor = kffffffColor
+        noteTextView.textColor = k999999Color
+        noteTextView.font = kRegularFont14
+        noteTextView.placeholder = "如需部分商品退款请备注退款商品的名称和数量,如订单疑问可通过“我的”联系社长哦"
+        noteTextView.placeholderTextColor = k999999Color
+        noteTextView.isScrollEnabled = false
+        noteTextView.delegate = self
+        return noteTextView
+    }()
+    
+}
+
+extension PublishEditAddPicCell: UITextViewDelegate {
+    
+    func textViewDidChange(_ textView: UITextView) {
+        if textView == noteTextView {
+            var fullStr = textView.text ?? ""
+            if textView.text?.count ?? 0 > 180 {
+                fullStr = String(fullStr.prefix(150)) as String
+                textView.text = fullStr
+            }
+            
+            if let noteTextViewClosure = self.noteTextViewClosure {
+                noteTextViewClosure(self.noteTextView.text ?? "")
+            }
+        }
+    }
+    
+}

+ 85 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddTopicCell.swift

@@ -0,0 +1,85 @@
+//
+//  PublishEditAddTopicCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishEditAddTopicCell: UITableViewCell {
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishEditAddTopicCell {
+        let ID = "PublishEditAddTopicCell"
+        tableView.register(PublishEditAddTopicCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishEditAddTopicCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishEditAddTopicCell
+        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)
+        
+    }
+    
+    private func setupLayouts() {
+        iconImageView.snp.makeConstraints { (make) in
+            make.top.equalTo(20)
+            make.left.equalTo(14)
+            make.size.equalTo(24)
+        }
+        
+    }
+    
+    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 = k333333Color
+        titleLabel.font = kMediumFont14
+        titleLabel.textAlignment = .left
+        return titleLabel
+    }()
+    
+    private lazy var subLabel: UILabel = {
+        let subLabel = UILabel()
+        subLabel.text = "添加话题"
+        subLabel.textColor = k333333Color
+        subLabel.font = kMediumFont14
+        subLabel.textAlignment = .left
+        return subLabel
+    }()
+    
+    lazy var arrowImageView : UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "my_arrows_unfold")
+        return iconImageView
+    }()
+    
+}

+ 86 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditDescribeCell.swift

@@ -0,0 +1,86 @@
+//
+//  PublishEditDescribeCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+import IQKeyboardManagerSwift
+
+class PublishEditDescribeCell: UITableViewCell {
+    
+    let disposeBag = DisposeBag()
+    
+    typealias CommentTextViewClosure = (_ text: String) -> Void
+    var commentTextViewClosure : CommentTextViewClosure?
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishEditDescribeCell {
+        let ID = "PublishEditDescribeCell"
+        tableView.register(PublishEditDescribeCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishEditDescribeCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishEditDescribeCell
+        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
+        
+        addSubview(cmtTextView)
+    }
+    
+    private func setupLayouts() {
+        cmtTextView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    private lazy var cmtTextView: IQTextView = {
+        let cmtTextView = IQTextView()
+        cmtTextView.backgroundColor = kffffffColor
+        cmtTextView.textColor = k333333Color
+        cmtTextView.font = kRegularFont14
+        cmtTextView.placeholder = "说一说你的美好心得..."
+        cmtTextView.placeholderTextColor = k999999Color
+        cmtTextView.delegate = self
+        return cmtTextView
+    }()
+    
+}
+
+extension PublishEditDescribeCell: UITextViewDelegate {
+    
+    func textViewDidChange(_ textView: UITextView) {
+        if textView == cmtTextView {
+            var fullStr = textView.text ?? ""
+            if textView.text?.count ?? 0 > 180 {
+                fullStr = String(fullStr.prefix(150)) as String
+                textView.text = fullStr
+            }
+            
+            if let commentTextViewClosure = self.commentTextViewClosure {
+                commentTextViewClosure(self.cmtTextView.text ?? "")
+            }
+        }
+    }
+    
+}

+ 89 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditTitleCell.swift

@@ -0,0 +1,89 @@
+//
+//  PublishEditTitleCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+
+class PublishEditTitleCell: UITableViewCell {
+    
+    let disposeBag = DisposeBag()
+    
+    typealias EditTextFieldClosure = (_ text: String,_ indexPath:IndexPath) -> Void
+    var editTextFieldClosure : EditTextFieldClosure?
+    
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishEditTitleCell {
+        let ID = "PublishEditTitleCell"
+        tableView.register(PublishEditTitleCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishEditTitleCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishEditTitleCell
+        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
+        addSubview(editTextField)
+        addSubview(h_lineLabel)
+    }
+    
+    private func setupLayouts() {
+        editTextField.snp.makeConstraints { (make) in
+            make.top.equalToSuperview()
+            make.bottom.equalToSuperview().offset(-1)
+            make.left.equalTo(14)
+            make.right.equalTo(-14)
+        }
+        h_lineLabel.snp.makeConstraints { (make) in
+            make.left.equalTo(editTextField.snp_left)
+            make.right.equalTo(editTextField.snp_right)
+            make.top.equalTo(editTextField.snp_top)
+            make.height.equalTo(0.5)
+        }
+    }
+    
+    private lazy var editTextField: UITextField = {
+        let editTextField = UITextField()
+        editTextField.textColor = k333333Color
+        editTextField.font = kRegularFont16
+        editTextField.tintColor = kEnabledButtonColor
+        editTextField.clearButtonMode = .whileEditing
+        editTextField.placeholder = "标题吸引人,收豆不求人(标题20字,内容详情页不限)"
+        editTextField.rx.text.orEmpty.changed.subscribe(onNext: {
+            [weak self] (text) in
+            self?.editTextField.text = String(describing: text.prefix(11))
+            if let editTextFieldClosure = self?.editTextFieldClosure {
+                editTextFieldClosure(self?.editTextField.text ?? "",(self?.indexPath!)!)
+            }
+            
+        }).disposed(by: disposeBag)
+        return editTextField
+    }()
+    
+    private lazy var h_lineLabel: UILabel = {
+        let h_lineLabel = UILabel()
+        h_lineLabel.backgroundColor = kf5f5f5Color
+        return h_lineLabel
+    }()
+    
+}