|
@@ -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
|
|
|
+ }()
|
|
|
+
|
|
|
+}
|