Commit b1596fa7 authored by Steven杜宇's avatar Steven杜宇

// 选择地点

parent ccf179f2
...@@ -40,16 +40,15 @@ class YHInfoItemSelectSheetView: UIView { ...@@ -40,16 +40,15 @@ class YHInfoItemSelectSheetView: UIView {
var isShowDetailOneline:Bool = false { var isShowDetailOneline:Bool = false {
didSet { didSet {
detailLabel.textAlignment = isShowDetailOneline ? .right : .left // detailLabel.textAlignment = isShowDetailOneline ? .right : .left
detailLabel.numberOfLines = isShowDetailOneline ? 1 : 0 detailLabel.numberOfLines = isShowDetailOneline ? 1 : 0
detailLabel.snp.remakeConstraints { make in detailLabel.snp.remakeConstraints { make in
make.top.equalTo(16) make.top.equalTo(16)
make.left.equalTo(titleLabel.snp.right)
make.right.equalTo(arrowImgView.snp.left) make.right.equalTo(arrowImgView.snp.left)
make.bottom.equalTo(-16) make.bottom.equalTo(-16)
if isShowDetailOneline { if isShowDetailOneline {
make.height.equalTo(20) make.height.equalTo(20)
} else {
make.left.equalTo(titleLabel.snp.right)
} }
} }
self.setNeedsLayout() self.setNeedsLayout()
......
...@@ -304,9 +304,8 @@ private extension YHSelectApplicantGroupCell { ...@@ -304,9 +304,8 @@ private extension YHSelectApplicantGroupCell {
titleLabel.attributed.text = a+b titleLabel.attributed.text = a+b
collectionView.reloadData() collectionView.reloadData()
collectionView.snp.updateConstraints { make in let isShowSelectList = self.isShowSelectUserView
make.height.equalTo(self.getCollectionViewHeight()) self.isShowSelectUserView = isShowSelectList
}
// 时间选择UI更新 // 时间选择UI更新
optionsView.selectIndex = 0 optionsView.selectIndex = 0
......
...@@ -15,6 +15,7 @@ class YHSelectHKPlaceListView: UIView { ...@@ -15,6 +15,7 @@ class YHSelectHKPlaceListView: UIView {
return view return view
} }
var selectModel: YHMakeCertificatePlaceModel? = nil
var selectBlock: ((YHMakeCertificatePlaceModel)->())? var selectBlock: ((YHMakeCertificatePlaceModel)->())?
var listArr:[YHMakeCertificatePlaceModel] = [] { var listArr:[YHMakeCertificatePlaceModel] = [] {
...@@ -70,7 +71,6 @@ class YHSelectHKPlaceListView: UIView { ...@@ -70,7 +71,6 @@ class YHSelectHKPlaceListView: UIView {
button.contentHorizontalAlignment = .center button.contentHorizontalAlignment = .center
button.setTitle("取消", for: .normal) button.setTitle("取消", for: .normal)
button.setTitleColor( UIColor.mainTextColor, for: .normal) button.setTitleColor( UIColor.mainTextColor, for: .normal)
button.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return button return button
}() }()
...@@ -80,7 +80,6 @@ class YHSelectHKPlaceListView: UIView { ...@@ -80,7 +80,6 @@ class YHSelectHKPlaceListView: UIView {
button.contentHorizontalAlignment = .center button.contentHorizontalAlignment = .center
button.setTitle("确定", for: .normal) button.setTitle("确定", for: .normal)
button.setTitleColor( UIColor.brandMainColor, for: .normal) button.setTitleColor( UIColor.brandMainColor, for: .normal)
button.addTarget(self, action: #selector(sure), for: .touchUpInside)
return button return button
}() }()
...@@ -99,7 +98,10 @@ class YHSelectHKPlaceListView: UIView { ...@@ -99,7 +98,10 @@ class YHSelectHKPlaceListView: UIView {
} }
@objc func sure() { @objc func sure() {
if let model = self.selectModel {
selectBlock?(model)
}
self.dismiss()
} }
override init(frame: CGRect) { override init(frame: CGRect) {
...@@ -120,6 +122,10 @@ class YHSelectHKPlaceListView: UIView { ...@@ -120,6 +122,10 @@ class YHSelectHKPlaceListView: UIView {
whiteContentView.addSubview(lineView) whiteContentView.addSubview(lineView)
whiteContentView.addSubview(tableView) whiteContentView.addSubview(tableView)
cancelBtn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
confirmBtn.addTarget(self, action: #selector(sure), for: .touchUpInside)
blackMaskView.snp.makeConstraints { make in blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview() make.edges.equalToSuperview()
} }
...@@ -190,6 +196,7 @@ extension YHSelectHKPlaceListView: UITableViewDelegate, UITableViewDataSource { ...@@ -190,6 +196,7 @@ extension YHSelectHKPlaceListView: UITableViewDelegate, UITableViewDataSource {
if 0 <= indexPath.row && indexPath.row < listArr.count { if 0 <= indexPath.row && indexPath.row < listArr.count {
let model = listArr[indexPath.row] let model = listArr[indexPath.row]
selectModel = model
for item in listArr { for item in listArr {
item.isSelect = (model.id == item.id) item.isSelect = (model.id == item.id)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment