Commit b87b45fc authored by pete谢兆麟's avatar pete谢兆麟

代码修改

parent 8f612d8a
......@@ -33,7 +33,7 @@ class YHEducationCertificateConfirmCell: UITableViewCell {
var isSelectTrue: Bool?
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
guard let answerBtn = self.viewWithTag(answerBaseTag+i) as? UIButton else { return }
let item = answerArr[i]
answerBtn.setTitle(item.title, for: .normal)
updateAnswerButton(answerBtn, item.isSelect)
......@@ -69,7 +69,7 @@ class YHEducationCertificateConfirmCell: UITableViewCell {
} else {
// 重置所有答案状态
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
guard let answerBtn = self.viewWithTag(answerBaseTag+i) as? UIButton else { return }
answerBtn.setTitle("", for: .normal)
updateAnswerButton(answerBtn, false)
}
......
......@@ -208,8 +208,8 @@ extension YHCertificateInfoController: UITableViewDelegate, UITableViewDataSourc
let item: YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
let titleItem = item as! YHFormTitleItem
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
guard let titleItem = item as? YHFormTitleItem else { return UITableViewCell() }
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else { return UITableViewCell() }
// var isNeedText = ""
// if titleItem.type == .chinaIdCardInfo {
......@@ -242,11 +242,11 @@ extension YHCertificateInfoController: UITableViewDelegate, UITableViewDataSourc
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
let title = arr[0] as! YHFormTitleItem
guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell() }
guard let title = arr[0] as? YHFormTitleItem else { return UITableViewCell() }
if detailItem.type == .chinaIdentityCardNumber || detailItem.type == .certificateSignPlace || detailItem.type == .traverlPassportNumber || detailItem.type == .certificateNumber { // 证件号码和签发地需要填写
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as? YHFormItemInputTextCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle()
......@@ -312,7 +312,7 @@ extension YHCertificateInfoController: UITableViewDelegate, UITableViewDataSourc
if detailItem.type == .certificateType || detailItem.type == .certificateSignDate {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as? YHFormItemSelectSheetCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
......@@ -323,7 +323,7 @@ extension YHCertificateInfoController: UITableViewDelegate, UITableViewDataSourc
if detailItem.type == .certificateValidDate { // 届满日期
if title.type == .chinaIdCardInfo { // 身份证
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemExpireDateCell.cellReuseIdentifier, for: indexPath) as! YHFormItemExpireDateCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemExpireDateCell.cellReuseIdentifier, for: indexPath) as? YHFormItemExpireDateCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = (detailItem.value == YHCNIdentityCard.longTime ? "" : detailItem.value)
......@@ -343,7 +343,7 @@ extension YHCertificateInfoController: UITableViewDelegate, UITableViewDataSourc
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as? YHFormItemSelectSheetCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
......@@ -400,8 +400,8 @@ extension YHCertificateInfoController: UITableViewDelegate, UITableViewDataSourc
return
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
let titleItem = arr[0] as! YHFormTitleItem
guard let detailItem = item as? YHFormDetailItem else { return }
guard let titleItem = arr[0] as? YHFormTitleItem else { return }
if detailItem.type == .certificateValidDate ||
detailItem.type == .certificateSignDate { // 届满日期 签发日期
......
......@@ -175,7 +175,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return .defaultType }
if detailItem.type == .birthCity {
return .inputText
......@@ -244,16 +244,16 @@ extension YHChildBasicInfoVC: UITableViewDelegate, UITableViewDataSource {
let cellType = getCellType(item)
if cellType == .title { // 标题
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else { return UITableViewCell() }
cell.setTitleAndSubTitle(title: item.getTitle())
return cell
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell() }
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as? YHFormItemInputTextCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle()
......@@ -345,7 +345,7 @@ extension YHChildBasicInfoVC: UITableViewDelegate, UITableViewDataSource {
}
if cellType == .selectSheet { // 点击选择列表cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as? YHFormItemSelectSheetCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle()
......@@ -356,7 +356,7 @@ extension YHChildBasicInfoVC: UITableViewDelegate, UITableViewDataSource {
if cellType == .twoChoice { // 双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as? YHFormItemDoubleChoiceCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = item.getTitle()
cell.answerArr = nil
......@@ -459,7 +459,7 @@ extension YHChildBasicInfoVC: UITableViewDelegate, UITableViewDataSource {
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return }
if detailItem.type == .stayHKDate { // 出生日期/获准滞留至
var title = ""
......
......@@ -152,7 +152,7 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return .defaultType }
if detailItem.type == .birthCity {
var isBirthOverSeas = false
......@@ -209,19 +209,19 @@ extension YHChildPrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
let item: YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else { return UITableViewCell() }
cell.setTitleAndSubTitle(title: item.getTitle())
return cell
} else if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell() }
let cellType = self.getCellType(detailItem)
if cellType == .twoChoice {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as? YHFormItemDoubleChoiceCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.enableEdit = true
......@@ -276,7 +276,7 @@ extension YHChildPrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
} else if cellType == .selectSheet {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as? YHFormItemSelectSheetCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
......@@ -284,7 +284,7 @@ extension YHChildPrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
return cell
} else if cellType == .inputText {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as? YHFormItemInputTextCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle()
......@@ -368,13 +368,13 @@ extension YHChildPrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return }
if detailItem.type == .nationOrArea {
let vc = YHSelectCountryViewController()
vc.backLocationStringController = {
[weak self] country in
guard let self = self else { return }
let title = arr[0] as! YHFormTitleItem
guard let title = arr[0] as? YHFormTitleItem else { return }
if title.type == .F {
self.child?.nationality = country
......
......@@ -141,7 +141,7 @@ class YHBrotherInfoVC: YHBaseViewController {
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return .defaultType }
if detailItem.type == .birthCity {
var isBirthOverSeas = false
......@@ -199,23 +199,23 @@ extension YHBrotherInfoVC: UITableViewDelegate, UITableViewDataSource {
let cellType = getCellType(item)
if cellType == .title {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else { return UITableViewCell() }
cell.setTitleAndSubTitle(title: item.getTitle())
return cell
}
if cellType == .addItem {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as? YHFormItemAddCell else { return UITableViewCell() }
cell.title = item.getTitle()
return cell
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell() }
if cellType == .inputText {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as? YHFormItemInputTextCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.text = detailItem.value
......@@ -280,7 +280,7 @@ extension YHBrotherInfoVC: UITableViewDelegate, UITableViewDataSource {
}
if cellType == .selectSheet {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as? YHFormItemSelectSheetCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
......@@ -290,7 +290,7 @@ extension YHBrotherInfoVC: UITableViewDelegate, UITableViewDataSource {
if cellType == .twoChoice {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as? YHFormItemDoubleChoiceCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = item.getTitle()
cell.answerArr = nil
......@@ -340,7 +340,7 @@ extension YHBrotherInfoVC: UITableViewDelegate, UITableViewDataSource {
if cellType == .onlyTwoChoice {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemOnlyDoubleChoiceCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as? YHFormItemOnlyDoubleChoiceCell else { return UITableViewCell() }
var isDead = false
if let brotherInfo = brotherInfo, brotherInfo.isDead() {
......@@ -410,7 +410,7 @@ extension YHBrotherInfoVC: UITableViewDelegate, UITableViewDataSource {
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return }
if detailItem.type == .birthday {
YHDatePickView.show(type: .yyyymmdd, title: "选择出生日期".local, lastIsTaday: true, currentDay: self.brotherInfo?.birthday ?? "") { [weak self] dateStr in
......
......@@ -180,7 +180,7 @@ class YHParentInfoVC: YHBaseViewController {
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return .defaultType }
if detailItem.type == .birthCity {
var isBirthOverSeas = false
......@@ -241,24 +241,24 @@ extension YHParentInfoVC: UITableViewDelegate, UITableViewDataSource {
let cellType = getCellType(item)
if cellType == .title {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else { return UITableViewCell() }
cell.setTitleAndSubTitle(title: item.getTitle())
return cell
}
if cellType == .addItem {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as? YHFormItemAddCell else { return UITableViewCell() }
cell.title = item.getTitle()
return cell
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell() }
if cellType == .inputText {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as? YHFormItemInputTextCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.text = detailItem.value
......@@ -326,7 +326,7 @@ extension YHParentInfoVC: UITableViewDelegate, UITableViewDataSource {
}
if cellType == .selectSheet {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as? YHFormItemSelectSheetCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
......@@ -336,7 +336,7 @@ extension YHParentInfoVC: UITableViewDelegate, UITableViewDataSource {
if cellType == .twoChoice {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as? YHFormItemDoubleChoiceCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = item.getTitle()
cell.answerArr = nil
......@@ -386,7 +386,7 @@ extension YHParentInfoVC: UITableViewDelegate, UITableViewDataSource {
if cellType == .onlyTwoChoice {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemOnlyDoubleChoiceCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as? YHFormItemOnlyDoubleChoiceCell else { return UITableViewCell() }
var isDead = false
if let parentInfo = parentInfo, parentInfo.isDead() {
......@@ -456,7 +456,7 @@ extension YHParentInfoVC: UITableViewDelegate, UITableViewDataSource {
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return }
if detailItem.type == .birthday {
YHDatePickView.show(type: .yyyymmdd, title: "选择出生日期".local, lastIsTaday: true, currentDay: self.parentInfo?.birthday ?? "") { [weak self] dateStr in
......
......@@ -663,7 +663,7 @@ extension YHSpouseBasicInfoVC: UITableViewDelegate, UITableViewDataSource {
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return }
if detailItem.type == .birthday || detailItem.type == .stayHKDate { // 出生日期/获准滞留至
var title = ""
......
......@@ -172,17 +172,17 @@ extension YHSpousePrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
let item: YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else { return UITableViewCell() }
cell.setTitleAndSubTitle(title: item.getTitle())
return cell
} else if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return UITableViewCell() }
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother || detailItem.type == .isLiveOverSeasMore1Year {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as? YHFormItemDoubleChoiceCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
......@@ -221,9 +221,6 @@ extension YHSpousePrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
}
self.loadInfo()
} else if detailItem.type == .isLiveOverSeasMore1Year {
self.spouse?.setOverSearsOver1Year(option)
self.loadInfo()
} else if detailItem.type == .isLiveOverSeasMore1Year {
self.spouse?.setOverSearsOver1Year(option)
self.loadInfo()
......@@ -235,7 +232,7 @@ extension YHSpousePrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
if detailItem.type == .nationOrArea || detailItem.type == .liveCity {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as? YHFormItemSelectSheetCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.placeHolder = detailItem.placeHolder
......@@ -245,7 +242,7 @@ extension YHSpousePrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
}
if detailItem.type == .detailAddress {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as? YHFormItemInputTextCell else { return UITableViewCell() }
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.text = detailItem.value
......@@ -331,13 +328,13 @@ extension YHSpousePrimaryInfoVC: UITableViewDelegate, UITableViewDataSource {
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
guard let detailItem = item as? YHFormDetailItem else { return }
if detailItem.type == .nationOrArea {
let vc = YHSelectCountryViewController()
vc.backLocationStringController = {
[weak self] country in
guard let self = self else { return }
let title = arr[0] as! YHFormTitleItem
guard let title = arr[0] as? YHFormTitleItem else { return }
if title.type == .F {
self.spouse?.nationality = country
......
......@@ -335,10 +335,10 @@ extension YHFamilyMemberInfoListVC: UITableViewDelegate, UITableViewDataSource {
if item is YHFormTitleItem { // 是标题
let formItem = item as! YHFormTitleItem
guard let formItem = item as? YHFormTitleItem else { return UITableViewCell() }
// 配偶父母子女兄妹title
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else { return UITableViewCell() }
cell.setTitleAndSubTitle(title: formItem.getTitle(), subTitle: formItem.getSubTitle())
// 决定右边按钮显示样式
......@@ -378,8 +378,8 @@ extension YHFamilyMemberInfoListVC: UITableViewDelegate, UITableViewDataSource {
// 配偶父母子女兄妹具体条目
if item is YHFamilyMember {
let detailItem = item as! YHFamilyMember
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell
guard let detailItem = item as? YHFamilyMember else { return UITableViewCell() }
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as? YHFormItemEnterDetailCell else { return UITableViewCell() }
cell.isNeedTopLineNoGap = (indexPath.row == 1)
cell.title = detailItem.getTitle()
// cell.detailLabel.textColor = (isNeedShowError && detailItem.notFillNumber != 0 ? .failColor : .labelTextColor2)
......@@ -498,10 +498,10 @@ extension YHFamilyMemberInfoListVC: UITableViewDelegate, UITableViewDataSource {
// 新增子女/兄弟姐妹
if item is YHFormAddItem {
let formItem = item as! YHFormAddItem
guard let formItem = item as? YHFormAddItem else { return UITableViewCell() }
if formItem.type == .addChild || formItem.type == .addBrother {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as? YHFormItemAddCell else { return UITableViewCell() }
cell.title = formItem.getTitle()
cell.isNeedTopLineNoGap = true
......@@ -581,7 +581,7 @@ extension YHFamilyMemberInfoListVC: UITableViewDelegate, UITableViewDataSource {
}
// 新增子女兄妹
if item is YHFormAddItem {
let detailItem = item as! YHFormAddItem
guard let detailItem = item as? YHFormAddItem else { return }
if detailItem.type == .addChild {
} else if detailItem.type == .addBrother {
......@@ -591,7 +591,7 @@ extension YHFamilyMemberInfoListVC: UITableViewDelegate, UITableViewDataSource {
}
if item is YHFamilyMember {
let detailItem = item as! YHFamilyMember
guard let detailItem = item as? YHFamilyMember else { return }
// 配偶
if detailItem.relationType == .spouse {
......
......@@ -71,7 +71,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
if let answerArr = answerArr, answerArr.count == 2 {
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
guard let answerBtn = self.viewWithTag(answerBaseTag+i) as? UIButton else { return }
let item = answerArr[i]
answerBtn.setTitle(item.title, for: .normal)
updateAnswerButton(answerBtn, item.isSelect)
......@@ -79,7 +79,7 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
} else {
// 重置所有答案状态
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
guard let answerBtn = self.viewWithTag(answerBaseTag+i) as? UIButton else { return }
answerBtn.setTitle("", for: .normal)
updateAnswerButton(answerBtn, false)
}
......
......@@ -28,7 +28,7 @@ class YHFormItemOnlyDoubleChoiceCell: UITableViewCell {
if let answerArr = answerArr, answerArr.count == 2 {
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
guard let answerBtn = self.viewWithTag(answerBaseTag+i) as? UIButton else { return }
let item = answerArr[i]
answerBtn.setTitle(item.title, for: .normal)
updateAnswerButton(answerBtn, item.isSelect)
......@@ -36,7 +36,7 @@ class YHFormItemOnlyDoubleChoiceCell: UITableViewCell {
} else {
// 重置所有答案状态
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
guard let answerBtn = self.viewWithTag(answerBaseTag+i) as? UIButton else { return }
answerBtn.setTitle("", for: .normal)
updateAnswerButton(answerBtn, false)
}
......
......@@ -18,14 +18,14 @@ class YHAcademicPreviewModel: SmartCodable {
var is_married: Int = 0
var is_name_same: Bool = false
var edu_list: [eduListModel]?
var qla_list: [qlaListModel]?
var edu_list: [EduListModel]?
var qla_list: [QlaListModel]?
required init() {
}
}
class eduListModel: SmartCodable {
class EduListModel: SmartCodable {
var id: Int = -1
var school_address_aboard: Int = -1
......@@ -37,7 +37,7 @@ class eduListModel: SmartCodable {
var background: String = ""
var degree_type: String = ""
var cert_confirm: Int = 0
var school_address: schoolAddressModel?
var school_address: SchoolAddressModel?
var major_other: String = ""
var has_bachelor_degree: Int = 0
var college_id: Int = 0
......@@ -46,19 +46,19 @@ class eduListModel: SmartCodable {
}
}
class qlaListModel: SmartCodable {
class QlaListModel: SmartCodable {
var id: Int = -1
var qualification: String = ""
var college: String = ""
var promulgation: Int = -1
var college_address: schoolAddressModel?
var college_address: SchoolAddressModel?
var college_address_aboard: Int = -1
required init() {
}
}
class schoolAddressModel: SmartCodable {
class SchoolAddressModel: SmartCodable {
var country: String = ""
var area: [String] = []
var foreign: String = ""
......
......@@ -10,15 +10,15 @@ import UIKit
import SmartCodable
// 优才新政 - 2024优才新政
class YHWorkExpInfoPreview_NewModel: SmartCodable {
var list: [YHWorkExpInfoPreviewDetail_NewModel]?
class YHWorkExpInfoPreviewNewModel: SmartCodable {
var list: [YHWorkExpInfoPreviewDetailNewModel]?
var why_work_time_overlap: String = ""
var why_work_time_empty: String = ""
required init() {
}
}
class YHWorkExpInfoPreviewDetail_NewModel: SmartCodable {
class YHWorkExpInfoPreviewDetailNewModel: SmartCodable {
var work_id: Int = 0
var company_name: String = ""
var is_ipo_company: Bool = false
......@@ -34,13 +34,13 @@ class YHWorkExpInfoPreviewDetail_NewModel: SmartCodable {
var work_highlights: String = ""
var company_location: String = ""
var attachment_list: [WorkExpFilePreviewModel] = []
var position_list: [YHWorkExpPosition_NewModel] = []
var position_list: [YHWorkExpPositionNewModel] = []
required init() {
}
}
class YHWorkExpFilePreview_NewModel: SmartCodable {
class YHWorkExpFilePreviewNewModel: SmartCodable {
var file_name: String = ""
var file_url: String = ""
var file_size: Int = 0
......@@ -48,7 +48,7 @@ class YHWorkExpFilePreview_NewModel: SmartCodable {
}
}
class YHWorkExpPosition_NewModel: SmartCodable {
class YHWorkExpPositionNewModel: SmartCodable {
var position_name: String = ""
var wduty: String = ""
......
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