浏览代码

编辑发布 -- 基础视图搭建

Chris 5 年之前
父节点
当前提交
e75b90df71

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

@@ -438,6 +438,8 @@
 		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 */; };
+		BD28078422B76568002AB976 /* PublishEditDefaultCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD28078322B76568002AB976 /* PublishEditDefaultCollectionCell.swift */; };
+		BD28078622B765E6002AB976 /* PublishEditAddImgCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD28078522B765E6002AB976 /* PublishEditAddImgCollectionCell.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 */; };
@@ -971,6 +973,8 @@
 		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>"; };
+		BD28078322B76568002AB976 /* PublishEditDefaultCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditDefaultCollectionCell.swift; sourceTree = "<group>"; };
+		BD28078522B765E6002AB976 /* PublishEditAddImgCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditAddImgCollectionCell.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>"; };
@@ -3644,6 +3648,8 @@
 			isa = PBXGroup;
 			children = (
 				BD28078122B727BD002AB976 /* PublishEditAddPicCell.swift */,
+				BD28078322B76568002AB976 /* PublishEditDefaultCollectionCell.swift */,
+				BD28078522B765E6002AB976 /* PublishEditAddImgCollectionCell.swift */,
 				BD28077922B72734002AB976 /* PublishEditTitleCell.swift */,
 				BD28077B22B72761002AB976 /* PublishEditDescribeCell.swift */,
 				BD28077D22B72797002AB976 /* PublishEditAddTopicCell.swift */,
@@ -4207,6 +4213,7 @@
 				BD108C9522A60C2100837DAB /* HGImageCollectionViewCell.swift in Sources */,
 				A7FF1589228C854900A85748 /* OrderDetailBottomView.swift in Sources */,
 				BD1FC1A722B1075F00D55081 /* UIColor+Expanded.m in Sources */,
+				BD28078422B76568002AB976 /* PublishEditDefaultCollectionCell.swift in Sources */,
 				BD12203122AF4A010051C7C2 /* MessageMainItemView.swift in Sources */,
 				BD1DC6C5228CFD0B00B89C57 /* SwiftMoyaNetWorkServiceOrder.swift in Sources */,
 				BD7AB83D228438020030646A /* OrderPayExpressInfoShowCell.swift in Sources */,
@@ -4557,6 +4564,7 @@
 				A7CC75382271ADD6003C4F38 /* AddressManagerSelfMentionExpressHeaderView.swift in Sources */,
 				A738D66F225D9BD900EEE860 /* UMLoginModel.swift in Sources */,
 				A7FF156C228C6E5E00A85748 /* OrderTotalAmountTableViewCell.swift in Sources */,
+				BD28078622B765E6002AB976 /* PublishEditAddImgCollectionCell.swift in Sources */,
 				A71738A622897892000AEA6A /* SwiftMoyaServiceShopApi.swift in Sources */,
 				A72A726722321DBD00B21995 /* LocationModel.swift in Sources */,
 				A7F2D6C622B0DC7B0093000B /* CommunityCommonSectionHeaderView.swift in Sources */,

+ 3 - 7
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/Controller/PublishEditController.swift

@@ -13,9 +13,6 @@ import Photos
 
 class PublishEditController: BaseViewController {
     
-    // 上传图片数组
-    var goodsImageArr = Array<UIImage>()
-    
     override func viewDidLoad() {
         super.viewDidLoad()
         setupViews()
@@ -32,10 +29,7 @@ class PublishEditController: BaseViewController {
             print("----点击了发布")
         }
         
-        self.view.addSubview(tableView)
-    }
-    
-    override func setupLayouts() {
+        view.addSubview(tableView)
         tableView.snp.makeConstraints { (make) in
             make.top.equalToSuperview().offset(kNavBarTotalHeight)
             make.left.right.bottom.equalToSuperview()
@@ -100,6 +94,8 @@ extension PublishEditController : UITableViewDelegate, UITableViewDataSource {
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
         switch indexPath.row {
+        case 0:
+            return 130
         case 1,3,4:
             return 50
         case 2:

+ 31 - 35
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddAddressCell.swift

@@ -40,9 +40,9 @@ class PublishEditAddAddressCell: UITableViewCell {
         backgroundColor = kffffffColor
         
         addSubview(iconImageView)
+        addSubview(arrowImageView)
         addSubview(titleLabel)
-        addSubview(contentLabel)
-        addSubview(timeLabel)
+        addSubview(subLabel)
     }
     
     private func setupLayouts() {
@@ -51,23 +51,23 @@ class PublishEditAddAddressCell: UITableViewCell {
             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)
+        arrowImageView.snp.makeConstraints { (make) in
+            make.right.equalToSuperview().offset(-19)
+            make.centerY.equalToSuperview()
+            make.width.equalTo(7)
+            make.height.equalTo(12)
         }
-        contentLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp_bottom).offset(12)
-            make.left.equalTo(titleLabel.snp_left)
-            make.right.equalToSuperview().offset(-26)
+        titleLabel.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(iconImageView.snp_right).offset(6)
+            make.width.equalTo(56)
+            make.height.equalTo(20)
         }
-        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)
+        subLabel.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(titleLabel.snp_right).offset(10)
+            make.right.equalTo(arrowImageView.snp_left).offset(-10)
+            make.height.equalTo(17)
         }
     }
     
@@ -79,30 +79,26 @@ class PublishEditAddAddressCell: UITableViewCell {
     
     private lazy var titleLabel: UILabel = {
         let titleLabel = UILabel()
-        titleLabel.text = "张吃饭"
-        titleLabel.textColor = k999999Color
-        titleLabel.font = kRegularFont14
+        titleLabel.text = "添加地点"
+        titleLabel.textColor = k333333Color
+        titleLabel.font = kMediumFont14
         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 subLabel: UILabel = {
+        let subLabel = UILabel()
+        subLabel.text = "(打卡地点,结识附近的彩虹居民)"
+        subLabel.textColor = kDDDDDDColor
+        subLabel.font = kRegularFont12
+        subLabel.textAlignment = .left
+        return subLabel
     }()
     
-    private lazy var timeLabel: UILabel = {
-        let timeLabel = UILabel()
-        timeLabel.text = "6个小时前"
-        timeLabel.textColor = kbbbbbbColor
-        timeLabel.font = kRegularFont12
-        timeLabel.textAlignment = .left
-        return timeLabel
+    lazy var arrowImageView : UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "my_arrows_unfold")
+        return iconImageView
     }()
     
 }

+ 93 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddImgCollectionCell.swift

@@ -0,0 +1,93 @@
+//
+//  PublishEditAddImgCollectionCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  编辑发布--添加照片のCell(有图)
+
+import UIKit
+import RxSwift
+
+class PublishEditAddImgCollectionCell: UICollectionViewCell {
+    
+    let disposeBag = DisposeBag()
+    
+    var showImage: UIImage? {
+        didSet {
+            if self.showImage != nil {
+                picImageView.image = self.showImage
+            }
+        }
+    }
+    
+    var productSearchModel: ProductSearchModel? {
+        didSet {
+            picImageView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
+        }
+    }
+    
+    typealias DelPicBlock = (_ idxRow:Int?) -> Void
+    var delPicBlock : DelPicBlock?
+    
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> PublishEditAddImgCollectionCell {
+        let ID = "PublishEditAddImgCollectionCell"
+        collectionView.register(PublishEditAddImgCollectionCell.self, forCellWithReuseIdentifier: ID)
+        let cell : PublishEditAddImgCollectionCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! PublishEditAddImgCollectionCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        cornerRadius = 2
+        masksToBounds = true
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MRAK: - 设置View
+    private func setupViews() {
+        addSubview(picImageView)        
+        addSubview(delButton)
+    }
+    
+    private func setupLayouts() {
+        picImageView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        delButton.snp.makeConstraints { (make) in
+            make.top.right.equalToSuperview()
+            make.size.equalTo(26)
+        }
+    }
+    
+    private lazy var picImageView: UIImageView = {
+        let picImageView = UIImageView()
+        return picImageView
+    }()
+    
+    private lazy var delButton: UIButton = {
+        let delButton = UIButton(type: UIButton.ButtonType.custom)
+        delButton.setImage(kImage(name: "common_sku_cancel"), for: UIControl.State.normal)
+        delButton.rx.tap.subscribe(onNext: {
+            [weak self] (data) in
+            let idxPath = self?.indexPath
+            if let delPicBlock = self?.delPicBlock {
+                delPicBlock(idxPath?.row)
+            }
+        }).disposed(by: disposeBag)
+        return delButton
+    }()
+    
+}

+ 96 - 45
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddPicCell.swift

@@ -7,15 +7,23 @@
 //
 
 import UIKit
-import RxSwift
-import IQKeyboardManagerSwift
 
 class PublishEditAddPicCell: UITableViewCell {
     
-    let disposeBag = DisposeBag()
+    private let maxImageCount: Int = 3
     
-    typealias NoteTextViewClosure = (_ text: String) -> Void
-    var noteTextViewClosure : NoteTextViewClosure?
+    typealias ChoosePicBlock = () -> Void
+    var choosePicBlock : ChoosePicBlock?
+    
+    typealias DelPicTransBlock = (_ idxRow:Int?) -> Void
+    var delPicTransBlock : DelPicTransBlock?
+    
+    var imgCount: Int = 0
+    var goodsImageArr: Array<UIImage>? {
+        didSet {
+            imgCount = self.goodsImageArr?.count ?? 0
+        }
+    }
     
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishEditAddPicCell {
         let ID = "PublishEditAddPicCell"
@@ -40,62 +48,105 @@ class PublishEditAddPicCell: UITableViewCell {
             
         }
     }
+    
     //MRAK: - 设置View
     private func setupViews() {
         self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(noteTextView)
+        
+        addSubview(collectionView)
     }
     
     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)
+        collectionView.snp.remakeConstraints { (make) in
+            make.top.equalTo(15)
+            make.bottom.equalTo(-15)
+            make.left.right.equalToSuperview()
         }
     }
     
-    lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont14
-        titleLabel.text = "备注信息"
-        return titleLabel
+    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
+        return collectionView
     }()
     
-    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
+    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
+        let collectionViewLayout = UICollectionViewFlowLayout.init()
+        collectionViewLayout.minimumInteritemSpacing = 10
+        return collectionViewLayout
     }()
     
+    //加载数据
+    func reloadData() {
+        //collectionView重新加载数据
+        self.collectionView.reloadData()
+        //更新collectionView的高度约束
+        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
+        collectionView.snp.remakeConstraints { (make) in
+            make.top.equalTo(15)
+            make.bottom.equalTo(-15)
+            make.left.right.equalToSuperview()
+        }
+        self.collectionView.collectionViewLayout.invalidateLayout()
+    }
 }
 
-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
+extension PublishEditAddPicCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource,UICollectionViewDelegate {
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        if imgCount < maxImageCount {
+            return imgCount+1
+        } else {
+            return maxImageCount
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        if imgCount < maxImageCount && indexPath.row == imgCount {
+            // 添加图片
+            let cell = PublishEditDefaultCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+            if imgCount == 0 {
+                cell.noteStr = "添加图片"
+            } else {
+                cell.noteStr = "\(imgCount)/\(maxImageCount)"
             }
-            
-            if let noteTextViewClosure = self.noteTextViewClosure {
-                noteTextViewClosure(self.noteTextView.text ?? "")
+            return cell
+        } else {
+            // 展示图片
+            let pCell = PublishEditAddImgCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+            if indexPath.row < imgCount {
+                pCell.showImage = self.goodsImageArr![indexPath.row]
+            }
+            pCell.delPicBlock = {
+                [weak self] (idxRow) in
+                if let delPicTransBlock = self?.delPicTransBlock {
+                    delPicTransBlock(idxRow)
+                }
+            }
+            return pCell
+        }
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSize(width:100, height: 100)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
+        return UIEdgeInsets(top: 0, left: 14, bottom: 0, right: -14)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        if imgCount < maxImageCount && indexPath.row == imgCount {
+            // 添加图片
+            if let choosePicBlock = self.choosePicBlock {
+                choosePicBlock()
             }
         }
     }

+ 24 - 5
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditAddTopicCell.swift

@@ -40,7 +40,9 @@ class PublishEditAddTopicCell: UITableViewCell {
         backgroundColor = kffffffColor
         
         addSubview(iconImageView)
-        
+        addSubview(arrowImageView)
+        addSubview(titleLabel)
+        addSubview(subLabel)
     }
     
     private func setupLayouts() {
@@ -49,7 +51,24 @@ class PublishEditAddTopicCell: UITableViewCell {
             make.left.equalTo(14)
             make.size.equalTo(24)
         }
-        
+        arrowImageView.snp.makeConstraints { (make) in
+            make.right.equalToSuperview().offset(-19)
+            make.centerY.equalToSuperview()
+            make.width.equalTo(7)
+            make.height.equalTo(12)
+        }
+        titleLabel.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(iconImageView.snp_right).offset(6)
+            make.width.equalTo(56)
+            make.height.equalTo(20)
+        }
+        subLabel.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(titleLabel.snp_right).offset(10)
+            make.right.equalTo(arrowImageView.snp_left).offset(-10)
+            make.height.equalTo(17)
+        }
     }
     
     lazy var iconImageView : UIImageView = {
@@ -69,9 +88,9 @@ class PublishEditAddTopicCell: UITableViewCell {
     
     private lazy var subLabel: UILabel = {
         let subLabel = UILabel()
-        subLabel.text = "添加话题"
-        subLabel.textColor = k333333Color
-        subLabel.font = kMediumFont14
+        subLabel.text = "(选择合适的话题让更多人看到)"
+        subLabel.textColor = kDDDDDDColor
+        subLabel.font = kRegularFont12
         subLabel.textAlignment = .left
         return subLabel
     }()

+ 83 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditDefaultCollectionCell.swift

@@ -0,0 +1,83 @@
+//
+//  PublishEditDefaultCollectionCell.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  编辑发布--添加照片のCell(默认,无图)
+
+import UIKit
+import RxSwift
+
+class PublishEditDefaultCollectionCell: UICollectionViewCell {
+    
+    let disposeBag = DisposeBag()
+    
+    var noteStr: String? {
+        didSet {
+            titleLabel.text = noteStr
+        }
+    }
+    
+    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> PublishEditDefaultCollectionCell {
+        let ID = "PublishEditDefaultCollectionCell.swift"
+        collectionView.register(PublishEditDefaultCollectionCell.self, forCellWithReuseIdentifier: ID)
+        let cell : PublishEditDefaultCollectionCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! PublishEditDefaultCollectionCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    //MARK: - indexPath
+    var indexPath: IndexPath?{
+        didSet {
+            
+        }
+    }
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        backgroundColor = kf7f8faColor
+        cornerRadius = 2
+        masksToBounds = true
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MRAK: - 设置View
+    private func setupViews() {
+        addSubview(addImgView)
+        addSubview(titleLabel)
+    }
+    
+    private func setupLayouts() {
+        addImgView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(28)
+            make.centerX.equalToSuperview()
+            make.size.equalTo(24)
+        }
+        titleLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(addImgView.snp_bottom).offset(6)
+            make.centerX.equalToSuperview()
+            make.height.equalTo(17)
+        }
+    }
+    
+    private lazy var addImgView: UIImageView = {
+        let addImgView = UIImageView()
+        addImgView.image = kImage(name: "order_photo")
+        return addImgView
+    }()
+    
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.textColor = kbbbbbbColor
+        titleLabel.font = kRegularFont12
+        titleLabel.textAlignment = .center
+        titleLabel.numberOfLines = 1
+        return titleLabel
+    }()
+    
+}

+ 4 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditDescribeCell.swift

@@ -50,7 +50,9 @@ class PublishEditDescribeCell: UITableViewCell {
     
     private func setupLayouts() {
         cmtTextView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
+            make.top.bottom.equalToSuperview()
+            make.left.equalTo(14)
+            make.right.equalTo(-14)
         }
     }
     
@@ -60,7 +62,7 @@ class PublishEditDescribeCell: UITableViewCell {
         cmtTextView.textColor = k333333Color
         cmtTextView.font = kRegularFont14
         cmtTextView.placeholder = "说一说你的美好心得..."
-        cmtTextView.placeholderTextColor = k999999Color
+        cmtTextView.placeholderTextColor = kDDDDDDColor
         cmtTextView.delegate = self
         return cmtTextView
     }()

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditTitleCell.swift

@@ -65,10 +65,11 @@ class PublishEditTitleCell: UITableViewCell {
     private lazy var editTextField: UITextField = {
         let editTextField = UITextField()
         editTextField.textColor = k333333Color
-        editTextField.font = kRegularFont16
+        editTextField.font = kRegularFont14
         editTextField.tintColor = kEnabledButtonColor
         editTextField.clearButtonMode = .whileEditing
-        editTextField.placeholder = "标题吸引人,收豆不求人(标题20字,内容详情页不限)"
+//        editTextField.placeholder = "标题吸引人,收豆不求人(标题20字,内容详情页不限)"
+        editTextField.attributedPlaceholder = NSAttributedString.init(string:"标题吸引人,收豆不求人(标题20字,内容详情页不限)", attributes: [NSAttributedString.Key.font:kRegularFont14 as Any, NSAttributedString.Key.foregroundColor:kDDDDDDColor])
         editTextField.rx.text.orEmpty.changed.subscribe(onNext: {
             [weak self] (text) in
             self?.editTextField.text = String(describing: text.prefix(11))