Commit 6cd7d132 authored by Steven杜宇's avatar Steven杜宇

// 家庭成员

parent 48851957
...@@ -212,7 +212,8 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -212,7 +212,8 @@ 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.isCanEdit = true cell.enableEdit = true
cell.disableEditTips = nil
var select = false var select = false
if let value = detailItem.value { if let value = detailItem.value {
...@@ -221,7 +222,8 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -221,7 +222,8 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
if detailItem.type == .isAccompanyToHK, let child = child, child.is18YearsOld() { // 是否随行至香港 if detailItem.type == .isAccompanyToHK, let child = child, child.is18YearsOld() { // 是否随行至香港
// 年满18岁不能随行 随行按钮不可编辑固定为否 // 年满18岁不能随行 随行按钮不可编辑固定为否
cell.isCanEdit = isFollowCanEdit cell.enableEdit = isFollowCanEdit
cell.disableEditTips = "年满十八岁的子女不能随行至香港"
} }
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)] let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
......
...@@ -39,12 +39,9 @@ class YHFormItemDoubleChoiceCell: UITableViewCell { ...@@ -39,12 +39,9 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
var isMust:Bool = false var isMust:Bool = false
var answerBlock:(([YHFormChoiceItem], Int)->Void)? var answerBlock:(([YHFormChoiceItem], Int)->Void)?
// 是否能点击两个按钮 // 是否能点击两个按钮
var isCanEdit:Bool = true { var enableEdit:Bool = true
didSet { // 不能编辑时的提示语
answer1Btn.isUserInteractionEnabled = isCanEdit var disableEditTips:String?
answer2Btn.isUserInteractionEnabled = isCanEdit
}
}
var title:String? { var title:String? {
didSet { didSet {
...@@ -222,6 +219,15 @@ class YHFormItemDoubleChoiceCell: UITableViewCell { ...@@ -222,6 +219,15 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
@objc func didClickResponseBtn(btn: UIButton) { @objc func didClickResponseBtn(btn: UIButton) {
if !enableEdit {
if let tips = disableEditTips, !tips.isEmpty {
YHHUD.flash(message: tips)
} else {
YHHUD.flash(message: "不可点击")
}
return
}
let selectIndex = btn.tag-answerBaseTag let selectIndex = btn.tag-answerBaseTag
if let resultArr = answerArr, resultArr.count == 2 { if let resultArr = answerArr, resultArr.count == 2 {
......
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