|
@@ -30,70 +30,85 @@ class PublishAddressPOIView: BaseView {
|
|
|
|
|
|
|
|
|
override func setupViews() {
|
|
|
+ addSubview(disableShowBgView)
|
|
|
+ disableShowBgView.addSubview(disableShowLabel)
|
|
|
+ disableShowBgView.addSubview(disableShowImage)
|
|
|
+ disableShowBgView.addSubview(bottomLine)
|
|
|
+ disableShowBgView.addSubview(disableShowButton)
|
|
|
|
|
|
- addSubview(searchBgView)
|
|
|
-
|
|
|
- searchBgView.addSubview(bottomLine)
|
|
|
- searchBgView.addSubview(addressLabel)
|
|
|
addSubview(tableView)
|
|
|
|
|
|
}
|
|
|
|
|
|
override func setupLayouts() {
|
|
|
- searchBgView.snp.makeConstraints { (make) in
|
|
|
+ disableShowBgView.snp.makeConstraints { (make) in
|
|
|
make.top.left.right.equalToSuperview()
|
|
|
make.height.equalTo(kScaleValue(value: 60))
|
|
|
}
|
|
|
+ disableShowLabel.snp.makeConstraints { (make) in
|
|
|
+ make.left.equalTo(14)
|
|
|
+ make.centerY.equalToSuperview()
|
|
|
+ make.height.equalTo(21)
|
|
|
+ }
|
|
|
+ disableShowImage.snp.makeConstraints { (make) in
|
|
|
+ make.right.equalTo(-14)
|
|
|
+ make.centerY.equalToSuperview()
|
|
|
+ make.width.equalTo(16)
|
|
|
+ make.height.equalTo(11)
|
|
|
+ }
|
|
|
bottomLine.snp.makeConstraints { (make) in
|
|
|
- make.left.right.bottom.equalToSuperview()
|
|
|
+ make.left.equalTo(14)
|
|
|
+ make.right.equalTo(-14)
|
|
|
+ make.bottom.equalToSuperview()
|
|
|
make.height.equalTo(0.5)
|
|
|
}
|
|
|
-
|
|
|
- addressLabel.snp.remakeConstraints { (make) in
|
|
|
- make.centerY.equalTo(searchBgView.snp.centerY)
|
|
|
- make.left.equalTo(kScaleValue(value: 8))
|
|
|
+ disableShowButton.snp.makeConstraints { (make) in
|
|
|
+ make.edges.equalToSuperview()
|
|
|
}
|
|
|
|
|
|
tableView.snp.makeConstraints { (make) in
|
|
|
- make.top.equalTo(searchBgView.snp.bottom)
|
|
|
+ make.top.equalTo(disableShowBgView.snp.bottom)
|
|
|
make.left.right.bottom.equalToSuperview()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ func searchPOI(_ searchText: String) {
|
|
|
+ BaiduMapManager.shared.suggestionSearchPoi(cityname:LocationModel.shared().getLocationModel()?.city ?? "西安市", keyword: searchText)
|
|
|
+ BaiduMapManager.shared.suggestionSearchSuccessBlock = {
|
|
|
+ [weak self] (suggestionList:Array<BMKSuggestionInfo>) in
|
|
|
+ self?.suggestionList = suggestionList
|
|
|
+ self?.tableView.reloadSections([1], with: UITableView.RowAnimation.fade)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- private lazy var searchBgView: UIView = {
|
|
|
- let searchBgView = UIView()
|
|
|
- searchBgView.backgroundColor = kffffffColor
|
|
|
- return searchBgView
|
|
|
+ private lazy var disableShowBgView: UIView = {
|
|
|
+ let disableShowBgView = UIView()
|
|
|
+ disableShowBgView.backgroundColor = kffffffColor
|
|
|
+ return disableShowBgView
|
|
|
}()
|
|
|
|
|
|
- private lazy var addressLabel: UILabel = {
|
|
|
- let addressLabel = UILabel()
|
|
|
- addressLabel.text = LocationModel.shared().getLocationModel()?.city ?? "西安市"
|
|
|
- addressLabel.textColor = k999999Color
|
|
|
- addressLabel.font = kScaleRegularFont14
|
|
|
- return addressLabel
|
|
|
+ private lazy var disableShowLabel: UILabel = {
|
|
|
+ let disableShowLabel = UILabel()
|
|
|
+ disableShowLabel.text = "不显示所在位置"
|
|
|
+ disableShowLabel.textColor = k333333Color
|
|
|
+ disableShowLabel.font = kMediumFont15
|
|
|
+ return disableShowLabel
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var disableShowImage: UIImageView = {
|
|
|
+ let disableShowImage = UIImageView()
|
|
|
+ disableShowImage.image = kImage(name: "disableShowImage")
|
|
|
+ return disableShowImage
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var disableShowButton: UIButton = {
|
|
|
+ let disableShowButton = UIButton(type: UIButton.ButtonType.custom)
|
|
|
+ disableShowButton.rx.tap.subscribe(onNext: { [weak self] in
|
|
|
+ print("----点击-不显示")
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ return disableShowButton
|
|
|
}()
|
|
|
|
|
|
-// private lazy var searchTextField: UITextField = {
|
|
|
-// let searchTextField = UITextField()
|
|
|
-// searchTextField.placeholder = "输入地理位置"
|
|
|
-// searchTextField.tintColor = kFFA42FColor
|
|
|
-// searchTextField.textColor = k333333Color
|
|
|
-// searchTextField.returnKeyType = .done
|
|
|
-// searchTextField.font = kScaleRegularFont14
|
|
|
-// searchTextField.borderStyle = .none
|
|
|
-// searchTextField.rx.text.orEmpty.changed.subscribe(onNext: { (text) in
|
|
|
-//
|
|
|
-// BaiduMapManager.shared.suggestionSearchPoi(cityname:LocationModel.shared().getLocationModel()?.city ?? "西安市", keyword: text)
|
|
|
-// BaiduMapManager.shared.suggestionSearchSuccessBlock = {
|
|
|
-// [weak self] (suggestionList:Array<BMKSuggestionInfo>) in
|
|
|
-// self?.suggestionList = suggestionList
|
|
|
-// self?.tableView.reloadSections([1], with: UITableView.RowAnimation.fade)
|
|
|
-// }
|
|
|
-// }).disposed(by: disposeBag)
|
|
|
-// return searchTextField
|
|
|
-// }()
|
|
|
|
|
|
private lazy var bottomLine: UILabel = {
|
|
|
let bottomLine = UILabel()
|
|
@@ -106,7 +121,6 @@ class PublishAddressPOIView: BaseView {
|
|
|
tableView.delegate = self
|
|
|
tableView.dataSource = self
|
|
|
tableView.backgroundColor = kffffffColor
|
|
|
- tableView.estimatedRowHeight = kScaleValue(value: 48)
|
|
|
tableView.separatorStyle = .none
|
|
|
return tableView
|
|
|
}()
|
|
@@ -136,7 +150,7 @@ extension PublishAddressPOIView:UITableViewDataSource,UITableViewDelegate {
|
|
|
}
|
|
|
|
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
|
|
- let cell = AddressPOITableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cell = PublishAddressPOICell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
switch indexPath.section {
|
|
|
case 0:
|
|
|
cell.locationAddress = locationAddress
|
|
@@ -181,4 +195,8 @@ extension PublishAddressPOIView:UITableViewDataSource,UITableViewDelegate {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
|
|
+ return 60
|
|
|
+ }
|
|
|
+
|
|
|
}
|