Commit 7b75a479 authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  //  搜索按钮替换
  // UI走查
parents ed4dc96c d06900a9
......@@ -376,6 +376,7 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource
let detailItem = item as! YHFamilyMember
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell
cell.isNeedTopLineNoGap = (indexPath.row == 1)
cell.title = detailItem.getTitle()
// cell.detailLabel.textColor = (isNeedShowError && detailItem.notFillNumber != 0 ? .failColor : .labelTextColor2)
......@@ -498,6 +499,23 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.title = formItem.getTitle()
cell.isNeedTopLineNoGap = true
if formItem.type == .addChild {
var hiddenTopLine = false
if let childs = familyMemberInfo?.child, !childs.isEmpty {
hiddenTopLine = true
}
cell.isHiddenTopLine = hiddenTopLine
} else if formItem.type == .addBrother {
var hiddenTopLine = false
if let brothers = familyMemberInfo?.brother, !brothers.isEmpty {
hiddenTopLine = true
}
cell.isHiddenTopLine = hiddenTopLine
}
cell.clickBlock = { [weak self] in
guard let self = self else { return }
if formItem.type == .addBrother {
......
......@@ -14,6 +14,8 @@ class YHFormItemAddCell: UITableViewCell {
let btnTitleColor:UIColor = .brandMainColor
let cornerRadius = 4.0
let horizonalGap = 18.0
let btnSize = CGSize(width: (KScreenWidth-(18+16)*2), height: 44)
var clickBlock:(()->Void)?
......@@ -35,6 +37,32 @@ class YHFormItemAddCell: UITableViewCell {
return btn
}()
private lazy var topLine:UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
view.isHidden = true
return view
}()
var isNeedTopLineNoGap:Bool = false {
didSet {
let margin = isNeedTopLineNoGap ? 0 : horizonalGap
topLine.snp.updateConstraints { make in
make.left.equalToSuperview().offset(margin)
make.right.equalToSuperview().offset(-margin)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
// 是否隐藏顶部分割线
var isHiddenTopLine:Bool = true {
didSet {
topLine.isHidden = isHiddenTopLine
}
}
lazy var dotLineLayer:CAShapeLayer = {
let borderLayer = CAShapeLayer()
......@@ -67,13 +95,21 @@ class YHFormItemAddCell: UITableViewCell {
contentView.addSubview(addBtn)
addBtn.layer.addSublayer(dotLineLayer)
contentView.addSubview(topLine)
addBtn.snp.makeConstraints { make in
make.top.equalToSuperview().offset(18)
make.bottom.equalToSuperview().offset(-18)
make.top.equalToSuperview().offset(horizonalGap)
make.bottom.equalToSuperview().offset(-horizonalGap)
make.size.equalTo(btnSize)
make.centerX.equalToSuperview()
}
topLine.snp.makeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
make.height.equalTo(1.0)
make.top.equalToSuperview()
}
}
@objc func didClickAddBtn() {
......
......@@ -52,6 +52,18 @@ class YHFormItemEnterDetailCell: UITableViewCell {
}
}
}
var isNeedTopLineNoGap:Bool = false {
didSet {
let margin = isNeedTopLineNoGap ? 0 : horizonalGap
topLine.snp.updateConstraints { make in
make.left.equalToSuperview().offset(margin)
make.right.equalToSuperview().offset(-margin)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
private lazy var titleLabel: UILabel = {
let label = UILabel()
......
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