Commit 82f94367 authored by Steven杜宇's avatar Steven杜宇

// 家庭成员

parent 97a50cd5
......@@ -73,12 +73,10 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
item00.tips = "请输入子女姓名".local
let item01 = YHFormDetailItem(type: .everName, isNeed: false)
item01.value = child.usedName
item01.tips = "请输入曾用名".local
item01.placeHolder = "请输入曾用名".local
let item02 = YHFormDetailItem(type: .befourMarryFirstName, isNeed: false)
item02.value = child.surname
item02.placeHolder = "请输入婚前姓氏".local
item02.tips = "请输入婚前姓氏".local
let item03 = YHFormDetailItem(type: .gender)
item03.value = child.sexName()
item03.tips = "请选择性别".local
......
......@@ -169,7 +169,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
var select = false
if let value = detailItem.value {
select = Bool(value)!
......
......@@ -171,7 +171,9 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
make.top.equalTo(contentView.snp.top).offset(16)
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalTo(answer1Btn.snp.left).offset(-8)
make.height.greaterThanOrEqualTo(btnHeight)
}
answer1Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.right.equalTo(answer2Btn.snp.left).offset(-8)
......@@ -194,29 +196,14 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
make.top.equalTo(titleLabel.snp.bottom)
make.height.equalTo(0)
make.bottom.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-16).priority(.medium)
}
setTips("", isShow: false)
}
func setTips(_ tips:String?, isShow:Bool) {
tipsLabel.text = tips
tipsLabel.isHidden = !isShow
var tipsHeight = 0.0
if let tips = tips, tips.count > 0 {
var bounds = CGRect()
let maxWidth = KScreenWidth-16*2-horizonalGap*2
bounds = NSString(string:tips).boundingRect(with: CGSize(width:maxWidth, height: .greatestFiniteMagnitude), options: [.usesLineFragmentOrigin], attributes: [.font : titleFont], context: nil)
tipsHeight = ceill(bounds.size.height)
}
tipsLabel.snp.updateConstraints { make in
make.height.equalTo(tipsHeight)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
// 更新答案按钮选中状态
......
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