Commit 421dcb5e authored by Steven杜宇's avatar Steven杜宇

// 显示选择人列表

parent b803f424
...@@ -51,7 +51,7 @@ class YHSelectApplicantGroupCell: UITableViewCell { ...@@ -51,7 +51,7 @@ class YHSelectApplicantGroupCell: UITableViewCell {
collectionView.snp.updateConstraints { make in collectionView.snp.updateConstraints { make in
make.top.equalTo(isShowSelectUserView ? 14 : 0) make.top.equalTo(isShowSelectUserView ? 14 : 0)
make.bottom.equalTo(isShowSelectUserView ? -14 : 0) make.bottom.equalTo(isShowSelectUserView ? -14 : 0)
make.height.equalTo(isShowSelectUserView ? 56 : 0) make.height.equalTo(isShowSelectUserView ? self.getCollectionViewHeight() : 0)
} }
optionsView.snp.updateConstraints { make in optionsView.snp.updateConstraints { make in
...@@ -62,13 +62,6 @@ class YHSelectApplicantGroupCell: UITableViewCell { ...@@ -62,13 +62,6 @@ class YHSelectApplicantGroupCell: UITableViewCell {
self.layoutIfNeeded() self.layoutIfNeeded()
} }
} }
// lazy var selecters:[YHSelectApplicantInfo] = {
// return [YHSelectApplicantInfo(name: "李小龙", isSelect: true),
// YHSelectApplicantInfo(name: "成龙", isSelect: true),
// YHSelectApplicantInfo(name: "甄子丹", isSelect: true),
// YHSelectApplicantInfo(name: "吉田双阴", isSelect: false),]
// }()
lazy var whiteContentView: UIView = { lazy var whiteContentView: UIView = {
let view = UIView() let view = UIView()
...@@ -283,8 +276,27 @@ private extension YHSelectApplicantGroupCell { ...@@ -283,8 +276,27 @@ private extension YHSelectApplicantGroupCell {
let a: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.failColor)) let a: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.failColor))
let b: ASAttributedString = .init("请您确认第\(model.itemIndex + 1)批赴港信息", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor)) let b: ASAttributedString = .init("请您确认第\(model.itemIndex + 1)批赴港信息", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
titleLabel.attributed.text = a+b titleLabel.attributed.text = a+b
collectionView.reloadData() collectionView.reloadData()
collectionView.snp.updateConstraints { make in
make.height.equalTo(self.getCollectionViewHeight())
}
}
func getCollectionViewHeight() -> CGFloat {
if let arr = dataModel?.model?.arr {
let rowHeight = 20.0
let gap = 16.0
var rowCount = arr.count/3
if arr.count%3 != 0 {
rowCount += 1
}
var height = 0.0
if rowCount > 0 {
height = rowHeight * Double(rowCount) + gap * Double(rowCount-1)
}
return height
}
return 0.0
} }
} }
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