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

// 底部分割线显示逻辑

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