Commit 7845195c authored by pete谢兆麟's avatar pete谢兆麟

列表

parent 17fd5442
...@@ -57,15 +57,40 @@ class YHWorkExperienceListViewController: YHBaseViewController { ...@@ -57,15 +57,40 @@ class YHWorkExperienceListViewController: YHBaseViewController {
bottomView = { bottomView = {
let bottom = UIView() let bottom = UIView()
bottom.backgroundColor = .white
return bottom return bottom
}() }()
view.addSubview(bottomView) view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalTo(view) make.left.right.bottom.equalToSuperview()
make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64) make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64)
} }
bottomButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x2274ee)
button.titleLabel?.font = kBoldFont(size: 16)
button.contentHorizontalAlignment = .center
button.setTitle("提交", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 6
button.addTarget(self, action: #selector(submit), for: .touchUpInside)
return button
}()
bottomView.addSubview(bottomButton)
bottomButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(8)
make.height.equalTo(48)
make.left.equalTo(16)
}
} }
@objc func submit() {
}
} }
extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDataSource { extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDataSource {
......
...@@ -151,18 +151,18 @@ class YHWorkExperienceListTableViewCell: UITableViewCell { ...@@ -151,18 +151,18 @@ class YHWorkExperienceListTableViewCell: UITableViewCell {
func updateAllViews() { func updateAllViews() {
mainItemView.removeSubviews() mainItemView.removeSubviews()
for i in 0 ..< (dataSource?.count ?? 0) { guard let dataSource = dataSource else {
let line = UIView() let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0) line.backgroundColor = UIColor(hex: 0xf0f0f0)
mainItemView.addSubview(line) mainItemView.addSubview(line)
line.snp.makeConstraints { make in line.snp.makeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
make.top.equalTo(52 * i) make.top.equalToSuperview()
make.height.equalTo(1) make.height.equalTo(1)
make.right.equalTo(-18) make.right.equalTo(-18)
} }
let itemView = YHWorkItemView() let itemView = YHWorkItemView()
itemView.dataSource = dataSource?[i] itemView.dataSource = YHWorkItemListModel(title: "工作经历1", subTitle: "", message: "有16项未填写", isShowDelete: false)
itemView.block = {[weak self] model in itemView.block = {[weak self] model in
guard let self = self else { return } guard let self = self else { return }
if let block = self.experienceListBlock { if let block = self.experienceListBlock {
...@@ -172,10 +172,38 @@ class YHWorkExperienceListTableViewCell: UITableViewCell { ...@@ -172,10 +172,38 @@ class YHWorkExperienceListTableViewCell: UITableViewCell {
mainItemView.addSubview(itemView) mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in itemView.snp.makeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
make.top.equalTo(52 * i + 1) make.top.equalTo(1)
make.height.equalTo(51) make.height.equalTo(51)
make.right.equalTo(-18) make.right.equalTo(-18)
} }
return
}
for i in 0 ..< dataSource.count {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(76 * i)
make.height.equalTo(1)
make.right.equalTo(-18)
}
let itemView = YHWorkItemView()
itemView.dataSource = dataSource[i]
itemView.block = {[weak self] model in
guard let self = self else { return }
if let block = self.experienceListBlock {
block(model)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(76 * i + 1)
make.height.equalTo(75)
make.right.equalTo(-18)
}
} }
} }
......
...@@ -44,8 +44,10 @@ class YHWorkItemView: UIView { ...@@ -44,8 +44,10 @@ class YHWorkItemView: UIView {
}() }()
addSubview(titleLabel) addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview() make.left.equalToSuperview()
make.top.equalTo(16)
make.width.equalTo(112) make.width.equalTo(112)
make.height.equalTo(20)
} }
subTitleLabel = { subTitleLabel = {
......
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