Kaynağa Gözat

编辑发布相关 -- to be continued

Chris 5 yıl önce
ebeveyn
işleme
b68d49e574

+ 48 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddAddress/PublishAddAddressController.swift

@@ -6,4 +6,51 @@
 //  Copyright © 2019 RainbowPlanet. All rights reserved.
 //
 
-import Foundation
+import UIKit
+
+class PublishAddAddressController: BaseViewController {
+    
+    typealias DidSelectBlock = (_ latitude:String,_ longitude:String,_ address:String) -> Void
+    var didSelectBlock : DidSelectBlock?
+    var locationAddress: String?
+    /// 纬度
+    var latitude : String = LocationModel.shared().getLocationModel()?.latitude ?? "34.20840377740726"
+    /// 经度
+    var longitude : String = LocationModel.shared().getLocationModel()?.longitude ?? "108.96265686107972"
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+        
+    }
+    
+    override func setupViews() {
+        navigationBar.title = "选择默认地址"
+        view.addSubview(addressPOIView)
+        addressPOIView.locationAddress = locationAddress
+        addressPOIView.longitude = longitude
+        addressPOIView.latitude = latitude
+        
+    }
+    
+    override func setupLayouts() {
+        addressPOIView.snp.makeConstraints { (make) in
+            make.top.equalTo(navigationBar.snp.bottom)
+            make.left.right.bottom.equalToSuperview()
+        }
+    }
+    
+    private lazy var addressPOIView: AddressPOIView = {
+        let addressPOIView = AddressPOIView()
+        addressPOIView.didSelectBlock = { [weak self] (latitude:String,longitude:String,address:String) in
+            if let didSelectBlock = self?.didSelectBlock {
+                didSelectBlock(latitude ,longitude ,address)
+                self?.navigationController?.popViewController(animated: true)
+            }
+            
+        }
+        return addressPOIView
+    }()
+    
+}

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddTopic/Controller/PublishAddTopicController.swift

@@ -22,7 +22,7 @@ class PublishAddTopicController: BaseViewController {
     override func setupViews() {
         self.view.backgroundColor = kffffffColor
         
-        navigationBar.title = ""
+        navigationBar.title = "添加话题"
         navigationBar.wr_setRightButton(title: "完成(x/5)", titleColor: k333333Color)
         navigationBar.onClickRightButton = {
             [weak self] in
@@ -75,7 +75,7 @@ extension PublishAddTopicController : UITableViewDelegate, UITableViewDataSource
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         switch indexPath.section {
         case 0:
-            let picCell = PublishEditAddPicCell.cellWith(tableView: tableView, indexPath: indexPath)
+            let picCell = PublishTopicTypeCell.cellWith(tableView: tableView, indexPath: indexPath)
             return picCell
         case 1:
             let titleCell = PublishEditTitleCell.cellWith(tableView: tableView, indexPath: indexPath)

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddTopic/View/PublishTopicTypeCell.swift

@@ -52,9 +52,9 @@ class PublishTopicTypeCell: UITableViewCell {
     }
     
     private func setupLayouts() {
-        collectionView.snp.remakeConstraints { (make) in
-            make.top.equalTo(15)
-            make.bottom.equalTo(-15)
+        collectionView.snp.makeConstraints { (make) in
+            make.top.equalTo(10)
+            make.bottom.equalTo(-10)
             make.left.right.equalToSuperview()
         }
     }

+ 2 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishAddTopic/View/PublishTopicTypeItemCollectionCell.swift

@@ -4,7 +4,7 @@
 //
 //  Created by Christopher on 2019/6/17.
 //  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  编辑发布--添加照片のCell(有图)
+//  添加话题--话题类别のCell
 
 import UIKit
 import RxSwift
@@ -89,6 +89,7 @@ class PublishTopicTypeItemCollectionCell: UICollectionViewCell {
     
     private lazy var titleLabel: UILabel = {
         let titleLabel = UILabel()
+        titleLabel.text = "文艺电影"
         titleLabel.textColor = kffffffColor
         titleLabel.font = kMediumFont14
         titleLabel.textAlignment = .center

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

@@ -111,9 +111,9 @@ extension PublishEditController : UITableViewDelegate, UITableViewDataSource {
         case 3:
             let vc = PublishAddTopicController()
             self.navigationController?.pushViewController(vc, animated: true)
-//        case 4:
-//            let addrCell = PublishEditAddAddressCell.cellWith(tableView: tableView, indexPath: indexPath)
-//            return addrCell
+        case 4:
+            let vc = PublishAddAddressController()
+            self.navigationController?.pushViewController(vc, animated: true)
         default:
             print("----点击了-\(indexPath.row)")
         }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishEditController/View/PublishEditDefaultCollectionCell.swift

@@ -67,7 +67,7 @@ class PublishEditDefaultCollectionCell: UICollectionViewCell {
     
     private lazy var addImgView: UIImageView = {
         let addImgView = UIImageView()
-        addImgView.image = kImage(name: "order_photo")
+        addImgView.image = kImage(name: "edit_ico_add_pic")
         return addImgView
     }()
     

+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/edit_ico_add_pic.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/edit_ico_add_pic.imageset/edit_ico_add_pic@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/edit_ico_add_pic.imageset/edit_ico_add_pic@3x.png