Commit 938011eb authored by Steven杜宇's avatar Steven杜宇

// lint

parent 313466e4
...@@ -226,7 +226,10 @@ extension YHInvatationShareViewController: UICollectionViewDelegate, UICollectio ...@@ -226,7 +226,10 @@ extension YHInvatationShareViewController: UICollectionViewDelegate, UICollectio
} }
return cell return cell
} else { } else {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHShareTwoCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHShareTwoCollectionViewCell guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHShareTwoCollectionViewCell.cellReuseIdentifier, for: indexPath) as? YHShareTwoCollectionViewCell else {
return UICollectionViewCell()
}
return cell return cell
} }
......
...@@ -407,7 +407,9 @@ extension YHHomePageViewModel { ...@@ -407,7 +407,9 @@ extension YHHomePageViewModel {
callBackBlock(false, nil) callBackBlock(false, nil)
return return
} }
self.hkList = (result as! [YHHKEventModel]) if let result = result as? [YHHKEventModel] {
self.hkList = result
}
callBackBlock(true, nil) callBackBlock(true, nil)
} else { } else {
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg) let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
......
...@@ -220,8 +220,9 @@ class YHAdopterAddNewTableViewCell: UITableViewCell { ...@@ -220,8 +220,9 @@ class YHAdopterAddNewTableViewCell: UITableViewCell {
cannalButton.isHidden = true cannalButton.isHidden = true
} }
for i in 0..<(dataSource?.count ?? 0) { for i in 0..<(dataSource?.count ?? 0) {
let view = mainItemView.viewWithTag(4000 + i) as! YHAdopterItemView if let view = mainItemView.viewWithTag(4000 + i) as? YHAdopterItemView {
view.isShowDelete(i, isShow: true) view.isShowDelete(i, isShow: true)
}
} }
if let block = isMoreBlock { if let block = isMoreBlock {
block(true) block(true)
......
...@@ -397,7 +397,7 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa ...@@ -397,7 +397,7 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
if item.type == .activeVisa { if item.type == .activeVisa {
// 赴港激活签证 // 赴港激活签证
let cell = tableView.dequeueReusableCell(withIdentifier: YHActivateHKVisaCell.cellReuseIdentifier, for: indexPath) as! YHActivateHKVisaCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHActivateHKVisaCell.cellReuseIdentifier, for: indexPath) as? YHActivateHKVisaCell else { return UITableViewCell() }
cell.isAllGo = self.isAllMembersGo cell.isAllGo = self.isAllMembersGo
cell.selectBlock = { cell.selectBlock = {
[weak self] isAllGo in [weak self] isAllGo in
...@@ -410,7 +410,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa ...@@ -410,7 +410,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
if item.type == .needReAppointMembers { if item.type == .needReAppointMembers {
// 待预约赴港成员 // 待预约赴港成员
let cell = tableView.dequeueReusableCell(withIdentifier: YHWaitAppointMembersCell.cellReuseIdentifier, for: indexPath) as! YHWaitAppointMembersCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHWaitAppointMembersCell.cellReuseIdentifier, for: indexPath) as? YHWaitAppointMembersCell else {
return UITableViewCell()
}
cell.members = waitAppointMembers cell.members = waitAppointMembers
cell.clickBlock = { cell.clickBlock = {
......
...@@ -162,7 +162,7 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat ...@@ -162,7 +162,7 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
} }
} }
guard let warmTipsCell = tableView.dequeueReusableCell(withIdentifier: YHFamilyWarmTipsCell.cellReuseIdentifier, for: indexPath) as? YHFamilyWarmTipsCell else { return UITableViewCell } guard let warmTipsCell = tableView.dequeueReusableCell(withIdentifier: YHFamilyWarmTipsCell.cellReuseIdentifier, for: indexPath) as? YHFamilyWarmTipsCell else { return UITableViewCell() }
return warmTipsCell return warmTipsCell
} }
......
...@@ -149,13 +149,14 @@ extension YHPrincipleApprovedMailViewController: UITableViewDelegate, UITableVie ...@@ -149,13 +149,14 @@ extension YHPrincipleApprovedMailViewController: UITableViewDelegate, UITableVie
if 0 <= indexPath.row && indexPath.row < items.count { if 0 <= indexPath.row && indexPath.row < items.count {
let m = items[indexPath.row] let m = items[indexPath.row]
if m is YHPrincipleEnvelopeModel { if m is YHPrincipleEnvelopeModel {
let model = m as! YHPrincipleEnvelopeModel if let model = m as? YHPrincipleEnvelopeModel {
cell.updateModel(model) cell.updateModel(model)
cell.expandClick = { cell.expandClick = {
[weak self] isUnfold in [weak self] isUnfold in
guard let self = self else { return } guard let self = self else { return }
model.isUnfold = isUnfold model.isUnfold = isUnfold
self.tableView.reloadData() self.tableView.reloadData()
}
} }
} }
} }
......
...@@ -374,73 +374,78 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -374,73 +374,78 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
if m is YHPrincipleEnvelopeModel { if m is YHPrincipleEnvelopeModel {
// 已获得港府甄选名额 信封cell // 已获得港府甄选名额 信封cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as? YHPrincipleEnvelopeCell else {
let model = m as! YHPrincipleEnvelopeModel return UITableViewCell()
cell.updateModel(model) }
// 点击展开 if let model = m as? YHPrincipleEnvelopeModel {
cell.expandClick = { cell.updateModel(model)
[weak self] isUnfold in // 点击展开
guard let self = self else { return } cell.expandClick = {
model.isUnfold = isUnfold [weak self] isUnfold in
self.tableView.reloadData() guard let self = self else { return }
model.isUnfold = isUnfold
self.tableView.reloadData()
}
} }
return cell return cell
} }
if m is YHPrincipleAgreementModel { if m is YHPrincipleAgreementModel {
// 上传文件 cell // 上传文件 cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as? YHPrincipleUploadStatusCell else {
let model = m as! YHPrincipleAgreementModel return UITableViewCell()
if isNeedShowSubmitCheckError, model.isMust == true, model.content_url.count <= 0 {
model.isShowRedTips = true
} else {
model.isShowRedTips = false
}
cell.updateModel(model)
// 点击展开
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
model.isUnfold = isUnfold
self.tableView.reloadData()
}
// 文件操作
cell.fileEditBlock = {
[weak self] _, index in
guard let self = self else { return }
self.showFileOperationAlertView(index, itemModel: model)
} }
// 点击文件直接预览 if let model = m as? YHPrincipleAgreementModel {
cell.fileClickBlock = { if isNeedShowSubmitCheckError, model.isMust == true, model.content_url.count <= 0 {
[weak self] fileModel, _ in model.isShowRedTips = true
guard let self = self else { return } } else {
// 直接点击文件所在行进行预览 model.isShowRedTips = false
let fileUrl = !fileModel.url.isEmpty ? fileModel.url : fileModel.fileUrl }
YHHUD.show(.progress(message: "加载中...")) cell.updateModel(model)
self.viewModel.getRealUsefulUrl(fileUrl) { // 点击展开
[weak self] resultUrl in cell.expandClick = {
YHHUD.hide() [weak self] isUnfold in
guard let self = self else { return } guard let self = self else { return }
self.previewFileTool.openXLSXRemoteFile(urlString: resultUrl, fileName: model.name) model.isUnfold = isUnfold
self.tableView.reloadData()
} }
} // 文件操作
// 上传文件点击 cell.fileEditBlock = {
cell.uploadBtnClick = { [weak self] _, index in
[weak self] _ in guard let self = self else { return }
guard let self = self else { return } self.showFileOperationAlertView(index, itemModel: model)
if model.content_url.count >= 10 { }
YHHUD.flash(message: "最多上传10张照片或文件") // 点击文件直接预览
return cell.fileClickBlock = {
[weak self] fileModel, _ in
guard let self = self else { return }
// 直接点击文件所在行进行预览
let fileUrl = !fileModel.url.isEmpty ? fileModel.url : fileModel.fileUrl
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getRealUsefulUrl(fileUrl) {
[weak self] resultUrl in
YHHUD.hide()
guard let self = self else { return }
self.previewFileTool.openXLSXRemoteFile(urlString: resultUrl, fileName: model.name)
}
}
// 上传文件点击
cell.uploadBtnClick = {
[weak self] _ in
guard let self = self else { return }
if model.content_url.count >= 10 {
YHHUD.flash(message: "最多上传10张照片或文件")
return
}
self.showSelectImageAndFileView(model)
}
// 点击模板
cell.templateBtnClick = {
[weak self] _ in
guard let self = self else { return }
self.showPreviewAndMailList(model)
} }
self.showSelectImageAndFileView(model)
}
// 点击模板
cell.templateBtnClick = {
[weak self] _ in
guard let self = self else { return }
self.showPreviewAndMailList(model)
} }
return cell return cell
} }
......
...@@ -188,7 +188,9 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD ...@@ -188,7 +188,9 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
} }
} }
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleProfileListCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleProfileListCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleProfileListCell.cellReuseIdentifier, for: indexPath) as? YHPrincipleProfileListCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < items.count { if 0 <= indexPath.row && indexPath.row < items.count {
let model = items[indexPath.row] let model = items[indexPath.row]
......
...@@ -446,7 +446,7 @@ private extension YHHKPlanItemView { ...@@ -446,7 +446,7 @@ private extension YHHKPlanItemView {
} }
} else { } else {
isPreDone = true isPreDone = true
returStrn = returStrn + String(scalar) returStrn += String(scalar)
} }
} }
......
...@@ -171,7 +171,7 @@ class YHSignatureUploadTableViewCell: UITableViewCell { ...@@ -171,7 +171,7 @@ class YHSignatureUploadTableViewCell: UITableViewCell {
make.height.equalTo(h) make.height.equalTo(h)
make.right.equalTo(-18) make.right.equalTo(-18)
} }
y = y + h y += h
} }
} }
......
...@@ -219,7 +219,9 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData ...@@ -219,7 +219,9 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
approveCell.dataSource = self.viewModel.dataModel.data.data[indexPath.section] approveCell.dataSource = self.viewModel.dataModel.data.data[indexPath.section]
return approveCell return approveCell
} else if state == 1 { } else if state == 1 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateTwoTableViewCell.cellReuseIdentifier, for: indexPath) as! YHLookResignResultStateTwoTableViewCell guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateTwoTableViewCell.cellReuseIdentifier, for: indexPath) as? YHLookResignResultStateTwoTableViewCell else {
return UITableViewCell()
}
approveCell.state = state approveCell.state = state
let model = YHLookResignResultDataLettersModel() let model = YHLookResignResultDataLettersModel()
model.result_file = self.viewModel.dataModel.data.result_file model.result_file = self.viewModel.dataModel.data.result_file
......
...@@ -373,7 +373,7 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl ...@@ -373,7 +373,7 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl
let message = item.message ?? "" let message = item.message ?? ""
let isNeed = item.isNeed ?? false let isNeed = item.isNeed ?? false
if isShow && message.count == 0 && isNeed { if isShow && message.count == 0 && isNeed {
tatol = tatol + 20 tatol += 20
} }
} }
return CGFloat(649 + tatol) return CGFloat(649 + tatol)
......
...@@ -427,7 +427,9 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl ...@@ -427,7 +427,9 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl
if 0 <= indexPath.row && indexPath.row < scheduleArr.count { if 0 <= indexPath.row && indexPath.row < scheduleArr.count {
let model = scheduleArr[indexPath.row] let model = scheduleArr[indexPath.row]
if scheduleArr.count <= 1 { if scheduleArr.count <= 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignScheduleSingleInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignScheduleSingleInfoCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignScheduleSingleInfoCell.cellReuseIdentifier, for: indexPath) as? YHResignScheduleSingleInfoCell else {
return UITableViewCell()
}
cell.updateModel(model) cell.updateModel(model)
// 点击确认在港或未确认在港按钮 // 点击确认在港或未确认在港按钮
cell.clickConfirmBtnBlock = { cell.clickConfirmBtnBlock = {
...@@ -452,7 +454,9 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl ...@@ -452,7 +454,9 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl
} }
// 分组 // 分组
let cell2 = tableView.dequeueReusableCell(withIdentifier: YHResignScheduleMultipleInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignScheduleMultipleInfoCell guard let cell2 = tableView.dequeueReusableCell(withIdentifier: YHResignScheduleMultipleInfoCell.cellReuseIdentifier, for: indexPath) as? YHResignScheduleMultipleInfoCell else {
return UITableViewCell()
}
model.batchIndex = indexPath.row+1 model.batchIndex = indexPath.row+1
cell2.updateModel(model) cell2.updateModel(model)
cell2.clickConfirmBtnBlock = { cell2.clickConfirmBtnBlock = {
......
...@@ -209,12 +209,12 @@ class YHResignMaterialViewModel: YHBaseViewModel { ...@@ -209,12 +209,12 @@ class YHResignMaterialViewModel: YHBaseViewModel {
func updateMaterials(material: YHMaterialModel, addInfoArr: [YHMaterialModelItemModel], callback: ((_ success: Bool, _ error: YHErrorModel?) -> Void)?) { func updateMaterials(material: YHMaterialModel, addInfoArr: [YHMaterialModelItemModel], callback: ((_ success: Bool, _ error: YHErrorModel?) -> Void)?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignMaterial.uploadMaterials let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignMaterial.uploadMaterials
guard var params = [ var params: [String: Any] = [
"material_id": "\(material.id)", "material_id": "\(material.id)",
"template_id": "\(material.template_id)", "template_id": "\(material.template_id)",
"status": material.status, "status": material.status,
"audit_remark": material.audit_remark "audit_remark": material.audit_remark
] as? [String: Any] else { return } ]
var info: [[String: Any]] = [] var info: [[String: Any]] = []
......
...@@ -588,7 +588,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie ...@@ -588,7 +588,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
var cerName: ASAttributedString = .init(string: self.materialModel.name, .font(UIFont.PFSC_M(ofSize: 17)), .foreground(UIColor.mainTextColor)) var cerName: ASAttributedString = .init(string: self.materialModel.name, .font(UIFont.PFSC_M(ofSize: 17)), .foreground(UIColor.mainTextColor))
let template: ASAttributedString = " \(.view(statusLabel, .original(.center)))" let template: ASAttributedString = " \(.view(statusLabel, .original(.center)))"
cerName = cerName + template cerName += template
titlelabel.attributed.text = cerName titlelabel.attributed.text = cerName
view.addSubview(noLabel) view.addSubview(noLabel)
......
...@@ -257,17 +257,17 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD ...@@ -257,17 +257,17 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD
if indexPath.section == 0 { if indexPath.section == 0 {
var height: CGFloat = 0 var height: CGFloat = 0
for item in self.viewModel.mainModel.upload_list { for item in self.viewModel.mainModel.upload_list {
height = height + 32 height += 32
let value = getHeight(item.name) let value = getHeight(item.name)
height = height + value height += value
} }
return CGFloat(52 + height) return CGFloat(52 + height)
} else { } else {
var height: CGFloat = 0 var height: CGFloat = 0
for item in self.viewModel.mainModel.doc_list { for item in self.viewModel.mainModel.doc_list {
height = height + 32 height += 32
let value = getHeight(item.name) let value = getHeight(item.name)
height = height + value height += value
} }
return CGFloat(52 + height) return CGFloat(52 + height)
} }
......
...@@ -264,7 +264,7 @@ extension YHResignUploadTravelPassportViewController: UITableViewDelegate, UITab ...@@ -264,7 +264,7 @@ extension YHResignUploadTravelPassportViewController: UITableViewDelegate, UITab
let message = item.message ?? "" let message = item.message ?? ""
let isNeed = item.isNeed ?? false let isNeed = item.isNeed ?? false
if isShow && message.count == 0 && isNeed { if isShow && message.count == 0 && isNeed {
tatol = tatol + 20 tatol += 20
} }
} }
return CGFloat(333 + tatol) return CGFloat(333 + tatol)
......
...@@ -188,7 +188,7 @@ extension YHResignUploadTravelCardListfootView: JXSegmentedListContainerViewData ...@@ -188,7 +188,7 @@ extension YHResignUploadTravelCardListfootView: JXSegmentedListContainerViewData
} }
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate { func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
if let vc = arrItemVCs[index] as? JXSegmentedListContainerViewListDelegate else { guard let vc = arrItemVCs[index] as? JXSegmentedListContainerViewListDelegate else {
return YHResignUploadTravelCardFootViewController() return YHResignUploadTravelCardFootViewController()
} }
return vc return vc
......
...@@ -15,7 +15,7 @@ class YHBasicInfoCellModel { ...@@ -15,7 +15,7 @@ class YHBasicInfoCellModel {
var needCheckFlag: Bool = false var needCheckFlag: Bool = false
var model: backgroundModel? var model: BackgroundModel?
var type: Int = 0 // 0- 输入型 1-选择型 var type: Int = 0 // 0- 输入型 1-选择型
init(question: String, answer: String, info: String, type: Int = 0, needCheckFlag: Bool = false) { init(question: String, answer: String, info: String, type: Int = 0, needCheckFlag: Bool = false) {
self.question = question self.question = question
......
...@@ -15,7 +15,7 @@ class YHBasicInfoFillModel: SmartCodable { ...@@ -15,7 +15,7 @@ class YHBasicInfoFillModel: SmartCodable {
var spouse: SpouseModel? var spouse: SpouseModel?
var child: [SpouseModel]? var child: [SpouseModel]?
var brother: [SpouseModel]? var brother: [SpouseModel]?
var background: backgroundModel? var background: BackgroundModel?
var order_id: String = "" var order_id: String = ""
required init() { required init() {
...@@ -23,16 +23,16 @@ class YHBasicInfoFillModel: SmartCodable { ...@@ -23,16 +23,16 @@ class YHBasicInfoFillModel: SmartCodable {
} }
} }
class backgroundModel: SmartCodable { class BackgroundModel: SmartCodable {
var subset: [subsetModel] = [] var subset: [SubsetModel] = []
var background_member: background_memberModel? var background_member: Background_memberModel?
required init() { required init() {
} }
} }
class subsetModel: SmartCodable { class SubsetModel: SmartCodable {
var id: Int = 0 var id: Int = 0
var subset_name: String = "" var subset_name: String = ""
...@@ -41,7 +41,7 @@ class subsetModel: SmartCodable { ...@@ -41,7 +41,7 @@ class subsetModel: SmartCodable {
} }
} }
class background_memberModel: SmartCodable { class Background_memberModel: SmartCodable {
var has: String = "" var has: String = ""
var info: String = "" var info: String = ""
...@@ -53,8 +53,8 @@ class background_memberModel: SmartCodable { ...@@ -53,8 +53,8 @@ class background_memberModel: SmartCodable {
class SpouseModel: SmartCodable { class SpouseModel: SmartCodable {
var id: Int = 0 var id: Int = 0
var subset_name: String = "" var subset_name: String = ""
var child_departure: background_memberModel? var child_departure: Background_memberModel?
var child_deny: background_memberModel? var child_deny: Background_memberModel?
required init() { required init() {
} }
...@@ -62,11 +62,11 @@ class SpouseModel: SmartCodable { ...@@ -62,11 +62,11 @@ class SpouseModel: SmartCodable {
class ApplicantModel: SmartCodable { class ApplicantModel: SmartCodable {
var id: Int = 0 var id: Int = 0
var has_conviction: background_memberModel? var has_conviction: Background_memberModel?
var has_departure: background_memberModel? var has_departure: Background_memberModel?
var has_deny: background_memberModel? var has_deny: Background_memberModel?
var has_breaking_law: background_memberModel? var has_breaking_law: Background_memberModel?
var has_other_id: background_memberModel? var has_other_id: Background_memberModel?
required init() { required init() {
......
...@@ -22,7 +22,7 @@ class YHChoiceButtonHoldView: UIView { ...@@ -22,7 +22,7 @@ class YHChoiceButtonHoldView: UIView {
private var arrCheckBtns: [UIButton] = [] private var arrCheckBtns: [UIButton] = []
var targetId: Int = -1 var targetId: Int = -1
var dataModel: [subsetModel] = [] { var dataModel: [SubsetModel] = [] {
didSet { didSet {
updateView() updateView()
} }
......
...@@ -189,9 +189,12 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -189,9 +189,12 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
if item is YHFormTitleItem { // 是标题 if item is YHFormTitleItem { // 是标题
let formItem = item as! YHFormTitleItem guard let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as? YHFormItemTitleCell else {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell return UITableViewCell()
cell.setTitleAndSubTitle(title: formItem.getTitle()) }
if let formItem = item as? YHFormTitleItem {
cell.setTitleAndSubTitle(title: formItem.getTitle())
}
return cell return cell
} }
...@@ -200,7 +203,9 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -200,7 +203,9 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem let detailItem = item as! YHFormDetailItem
let cellType = getCellType(detailItem) let cellType = getCellType(detailItem)
if cellType == .inputText { 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()
}
var isValueValid = false var isValueValid = false
if let value = detailItem.value, !value.isEmpty { if let value = detailItem.value, !value.isEmpty {
isValueValid = true isValueValid = true
...@@ -261,7 +266,9 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -261,7 +266,9 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
return cell return cell
} else if cellType == .selectSheet { } 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.isShowTipsButton = (detailItem.type == .degreeType) cell.isShowTipsButton = (detailItem.type == .degreeType)
cell.tipsBtnClickBlock = { cell.tipsBtnClickBlock = {
YHWholeScreenTipsView.show(type: .degreeType, targetView: cell.tipsButton) YHWholeScreenTipsView.show(type: .degreeType, targetView: cell.tipsButton)
...@@ -279,7 +286,7 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource { ...@@ -279,7 +286,7 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
} else if cellType == .cerConfirm { } else if cellType == .cerConfirm {
let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationCertificateConfirmCell.cellReuseIdentifier, for: indexPath) as! YHEducationCertificateConfirmCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationCertificateConfirmCell.cellReuseIdentifier, for: indexPath) as? YHEducationCertificateConfirmCell else { return UITableViewCell() }
cell.isCheck = isNeedShowError cell.isCheck = isNeedShowError
var isSelectTrue = false var isSelectTrue = false
......
...@@ -129,7 +129,9 @@ extension YHMajorSearchViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -129,7 +129,9 @@ extension YHMajorSearchViewController: UITableViewDelegate, UITableViewDataSourc
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMajorNameCell.cellReuseIdentifier, for: indexPath) as! YHMajorNameCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHMajorNameCell.cellReuseIdentifier, for: indexPath) as? YHMajorNameCell else {
return UITableViewCell()
}
if indexPath.row < majors.count { if indexPath.row < majors.count {
let college: YHMajorInfo = majors[indexPath.row] let college: YHMajorInfo = majors[indexPath.row]
......
...@@ -587,7 +587,7 @@ extension YHGCFamilyMemberInfoListVC: UITableViewDelegate, UITableViewDataSource ...@@ -587,7 +587,7 @@ extension YHGCFamilyMemberInfoListVC: UITableViewDelegate, UITableViewDataSource
} }
if item is YHFamilyMember { if item is YHFamilyMember {
guard let detailItem = item as! YHFamilyMember else { return } guard let detailItem = item as? YHFamilyMember else { return }
// 配偶 // 配偶
if detailItem.relationType == .spouse { if detailItem.relationType == .spouse {
......
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