Commit 68d3daab authored by Steven杜宇's avatar Steven杜宇

// 底部分割线显示逻辑

parent 301ba51d
...@@ -265,6 +265,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -265,6 +265,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.setTips(detailItem.tips, isShow: detailItem.isShowTips) cell.setTips(detailItem.tips, isShow: detailItem.isShowTips)
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.text = detailItem.value cell.text = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
guard let self = self else { return } guard let self = self else { return }
...@@ -304,6 +305,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -304,6 +305,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.setTips(detailItem.tips, isShow: detailItem.isShowTips) cell.setTips(detailItem.tips, isShow: detailItem.isShowTips)
return cell return cell
} }
...@@ -315,6 +317,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -315,6 +317,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.title = item.getTitle() cell.title = item.getTitle()
cell.answerArr = nil cell.answerArr = nil
cell.setTips(detailItem.tips, isShow: detailItem.isShowTips) cell.setTips(detailItem.tips, isShow: detailItem.isShowTips)
cell.isShowBottomLine = indexPath.row != arr.count-1
if detailItem.type == .birthNation { // 出生国家 if detailItem.type == .birthNation { // 出生国家
var select = false var select = false
......
...@@ -223,6 +223,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -223,6 +223,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.isShowBottomLine = indexPath.row != arr.count-1
var select = false var select = false
if let value = detailItem.value { if let value = detailItem.value {
...@@ -276,6 +277,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -276,6 +277,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
return cell return cell
} else if cellType == .inputText { // 输入文字cell } else if cellType == .inputText { // 输入文字cell
...@@ -284,6 +286,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -284,6 +286,7 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.text = detailItem.value cell.text = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
guard let self = self else { return } guard let self = self else { return }
......
...@@ -292,6 +292,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -292,6 +292,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.text = detailItem.value cell.text = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
guard let self = self else { return } guard let self = self else { return }
...@@ -325,6 +327,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -325,6 +327,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
return cell return cell
} }
...@@ -333,6 +337,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -333,6 +337,8 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = item.getTitle() cell.title = item.getTitle()
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.answerArr = nil cell.answerArr = nil
if detailItem.type == .birthNation { // 出生国家 if detailItem.type == .birthNation { // 出生国家
......
...@@ -182,6 +182,8 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -182,6 +182,8 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.setTips(detailItem.tips, isShow: detailItem.isShowTips) cell.setTips(detailItem.tips, isShow: detailItem.isShowTips)
cell.isShowBottomLine = indexPath.row != arr.count-1
var select = false var select = false
if let value = detailItem.value { if let value = detailItem.value {
...@@ -236,6 +238,8 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -236,6 +238,8 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.setTips(detailItem.tips, isShow: detailItem.isShowTips) cell.setTips(detailItem.tips, isShow: detailItem.isShowTips)
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
return cell return cell
} }
...@@ -247,7 +251,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -247,7 +251,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.text = detailItem.value cell.text = detailItem.value
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.setTips(detailItem.tips, isShow:detailItem.isShowTips) cell.setTips(detailItem.tips, isShow:detailItem.isShowTips)
cell.isShowLine = indexPath.row != arr.count-1 cell.isShowBottomLine = indexPath.row != arr.count-1
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
guard let self = self else { return } guard let self = self else { return }
......
...@@ -231,6 +231,8 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -231,6 +231,8 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.text = detailItem.value cell.text = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
...@@ -261,6 +263,7 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -261,6 +263,7 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
return cell return cell
} }
...@@ -269,6 +272,7 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -269,6 +272,7 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = item.getTitle() cell.title = item.getTitle()
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.answerArr = nil cell.answerArr = nil
if detailItem.type == .birthNation { // 出生国家 if detailItem.type == .birthNation { // 出生国家
......
...@@ -181,6 +181,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour ...@@ -181,6 +181,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.text = detailItem.value cell.text = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
...@@ -220,6 +221,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour ...@@ -220,6 +221,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
return cell return cell
} }
...@@ -229,6 +231,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour ...@@ -229,6 +231,7 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
return cell return cell
} }
} }
......
...@@ -296,6 +296,7 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -296,6 +296,7 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFamilyMember let detailItem = item as! YHFamilyMember
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.isShowBottomLine = indexPath.row != arr.count-1
if detailItem.notFillNum > 0 { if detailItem.notFillNum > 0 {
cell.detailLabel.text = String(format: "有%d项未填写".local, detailItem.notFillNum) cell.detailLabel.text = String(format: "有%d项未填写".local, detailItem.notFillNum)
} else { } else {
......
...@@ -263,6 +263,8 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -263,6 +263,8 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.text = detailItem.value cell.text = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
...@@ -293,6 +295,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -293,6 +295,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1
return cell return cell
} }
...@@ -301,6 +304,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -301,6 +304,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = item.getTitle() cell.title = item.getTitle()
cell.isShowBottomLine = indexPath.row != arr.count-1
cell.answerArr = nil cell.answerArr = nil
if detailItem.type == .birthNation { // 出生国家 if detailItem.type == .birthNation { // 出生国家
...@@ -343,7 +347,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -343,7 +347,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
if cellType == .onlyTwoChoice { // 仅有双项选择cell if cellType == .onlyTwoChoice { // 仅有双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemOnlyDoubleChoiceCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemOnlyDoubleChoiceCell
var isDead = false var isDead = false
if let parentInfo = parentInfo, parentInfo.isDead() { // 已故 if let parentInfo = parentInfo, parentInfo.isDead() { // 已故
isDead = true isDead = true
......
...@@ -81,10 +81,10 @@ class YHFormItemDoubleChoiceCell: UITableViewCell { ...@@ -81,10 +81,10 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
} }
} }
// 是否展示分割线 // 是否展示底部分割线
var isShowLine:Bool = false { var isShowBottomLine:Bool = false {
didSet { didSet {
bottomLine.isHidden = !isShowLine bottomLine.isHidden = !isShowBottomLine
} }
} }
......
...@@ -11,7 +11,8 @@ import UIKit ...@@ -11,7 +11,8 @@ import UIKit
class YHFormItemEnterDetailCell: UITableViewCell { class YHFormItemEnterDetailCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormItemEnterDetailCell" static let cellReuseIdentifier = "YHFormItemEnterDetailCell"
let horizonalGap = 18.0
private let titleFont: UIFont = UIFont.PFSC_M(ofSize: 14) private let titleFont: UIFont = UIFont.PFSC_M(ofSize: 14)
private let titleColor:UIColor = .mainTextColor private let titleColor:UIColor = .mainTextColor
// 是否必填 如必填title会展示红色* // 是否必填 如必填title会展示红色*
...@@ -24,6 +25,12 @@ class YHFormItemEnterDetailCell: UITableViewCell { ...@@ -24,6 +25,12 @@ class YHFormItemEnterDetailCell: UITableViewCell {
arrowImgView.isHidden = isShowDeleteBtn arrowImgView.isHidden = isShowDeleteBtn
} }
} }
// 是否展示底部分割线
var isShowBottomLine:Bool = false {
didSet {
bottomLine.isHidden = !isShowBottomLine
}
}
var title:String? { var title:String? {
didSet { didSet {
...@@ -82,6 +89,13 @@ class YHFormItemEnterDetailCell: UITableViewCell { ...@@ -82,6 +89,13 @@ class YHFormItemEnterDetailCell: UITableViewCell {
return btn return btn
}() }()
private lazy var bottomLine:UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
view.isHidden = true
return view
}()
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
super.init(coder: coder) super.init(coder: coder)
} }
...@@ -98,9 +112,11 @@ class YHFormItemEnterDetailCell: UITableViewCell { ...@@ -98,9 +112,11 @@ class YHFormItemEnterDetailCell: UITableViewCell {
contentView.addSubview(detailLabel) contentView.addSubview(detailLabel)
contentView.addSubview(arrowImgView) contentView.addSubview(arrowImgView)
contentView.addSubview(deleteButton) contentView.addSubview(deleteButton)
contentView.addSubview(bottomLine)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16) make.left.equalToSuperview().offset(horizonalGap)
make.right.equalTo(detailLabel.snp.left).offset(-8) make.right.equalTo(detailLabel.snp.left).offset(-8)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
} }
...@@ -112,7 +128,7 @@ class YHFormItemEnterDetailCell: UITableViewCell { ...@@ -112,7 +128,7 @@ class YHFormItemEnterDetailCell: UITableViewCell {
arrowImgView.snp.makeConstraints { make in arrowImgView.snp.makeConstraints { make in
make.size.equalTo(CGSizeMake(20, 20)) make.size.equalTo(CGSizeMake(20, 20))
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-horizonalGap)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
} }
...@@ -121,6 +137,13 @@ class YHFormItemEnterDetailCell: UITableViewCell { ...@@ -121,6 +137,13 @@ class YHFormItemEnterDetailCell: UITableViewCell {
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.right.equalToSuperview() make.right.equalToSuperview()
} }
bottomLine.snp.makeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
make.height.equalTo(1.0)
make.bottom.equalToSuperview()
}
} }
@objc func didClickDeleteBtn(btn:UIButton) { @objc func didClickDeleteBtn(btn:UIButton) {
......
...@@ -21,6 +21,12 @@ class YHFormItemExpireDateCell: UITableViewCell { ...@@ -21,6 +21,12 @@ class YHFormItemExpireDateCell: UITableViewCell {
var placeHolder:String? = "请选择" var placeHolder:String? = "请选择"
var clickBlock:(()->Void)? var clickBlock:(()->Void)?
// 是否展示底部分割线
var isShowBottomLine:Bool = false {
didSet {
bottomLine.isHidden = !isShowBottomLine
}
}
var title:String? { var title:String? {
didSet { didSet {
......
...@@ -14,10 +14,10 @@ class YHFormItemInputTextCell: UITableViewCell { ...@@ -14,10 +14,10 @@ class YHFormItemInputTextCell: UITableViewCell {
let horizonalGap = 18.0 let horizonalGap = 18.0
// 是否必填 如必填title会展示红色* // 是否必填 如必填title会展示红色*
var isMust = false var isMust = false
// 是否展示分割线 // 是否展示底部分割线
var isShowLine:Bool = false { var isShowBottomLine:Bool = false {
didSet { didSet {
bottomLine.isHidden = !isShowLine bottomLine.isHidden = !isShowBottomLine
} }
} }
// BOOL值表示编辑是否结束 // BOOL值表示编辑是否结束
......
...@@ -56,13 +56,12 @@ class YHFormItemSelectSheetCell: UITableViewCell { ...@@ -56,13 +56,12 @@ class YHFormItemSelectSheetCell: UITableViewCell {
} }
} }
// 是否展示分割线 // 是否展示底部分割线
var isShowLine:Bool = false { var isShowBottomLine:Bool = false {
didSet { didSet {
bottomLine.isHidden = !isShowLine bottomLine.isHidden = !isShowBottomLine
} }
} }
private lazy var titleLabel: UILabel = { private lazy var titleLabel: UILabel = {
let label = 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