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

// lint

parent 313466e4
......@@ -226,7 +226,10 @@ extension YHInvatationShareViewController: UICollectionViewDelegate, UICollectio
}
return cell
} 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
}
......
......@@ -407,7 +407,9 @@ extension YHHomePageViewModel {
callBackBlock(false, nil)
return
}
self.hkList = (result as! [YHHKEventModel])
if let result = result as? [YHHKEventModel] {
self.hkList = result
}
callBackBlock(true, nil)
} else {
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
......
......@@ -220,9 +220,10 @@ class YHAdopterAddNewTableViewCell: UITableViewCell {
cannalButton.isHidden = true
}
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)
}
}
if let block = isMoreBlock {
block(true)
}
......
......@@ -397,7 +397,7 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
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.selectBlock = {
[weak self] isAllGo in
......@@ -410,7 +410,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
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.clickBlock = {
......
......@@ -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
}
......
......@@ -149,7 +149,7 @@ extension YHPrincipleApprovedMailViewController: UITableViewDelegate, UITableVie
if 0 <= indexPath.row && indexPath.row < items.count {
let m = items[indexPath.row]
if m is YHPrincipleEnvelopeModel {
let model = m as! YHPrincipleEnvelopeModel
if let model = m as? YHPrincipleEnvelopeModel {
cell.updateModel(model)
cell.expandClick = {
[weak self] isUnfold in
......@@ -159,6 +159,7 @@ extension YHPrincipleApprovedMailViewController: UITableViewDelegate, UITableVie
}
}
}
}
return cell
}
......
......@@ -374,8 +374,10 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
if m is YHPrincipleEnvelopeModel {
// 已获得港府甄选名额 信封cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell
let model = m as! YHPrincipleEnvelopeModel
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as? YHPrincipleEnvelopeCell else {
return UITableViewCell()
}
if let model = m as? YHPrincipleEnvelopeModel {
cell.updateModel(model)
// 点击展开
cell.expandClick = {
......@@ -384,14 +386,16 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
model.isUnfold = isUnfold
self.tableView.reloadData()
}
}
return cell
}
if m is YHPrincipleAgreementModel {
// 上传文件 cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
let model = m as! YHPrincipleAgreementModel
guard let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as? YHPrincipleUploadStatusCell else {
return UITableViewCell()
}
if let model = m as? YHPrincipleAgreementModel {
if isNeedShowSubmitCheckError, model.isMust == true, model.content_url.count <= 0 {
model.isShowRedTips = true
} else {
......@@ -442,6 +446,7 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
self.showPreviewAndMailList(model)
}
}
return cell
}
}
......
......@@ -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 {
let model = items[indexPath.row]
......
......@@ -446,7 +446,7 @@ private extension YHHKPlanItemView {
}
} else {
isPreDone = true
returStrn = returStrn + String(scalar)
returStrn += String(scalar)
}
}
......
......@@ -171,7 +171,7 @@ class YHSignatureUploadTableViewCell: UITableViewCell {
make.height.equalTo(h)
make.right.equalTo(-18)
}
y = y + h
y += h
}
}
......
......@@ -219,7 +219,9 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
approveCell.dataSource = self.viewModel.dataModel.data.data[indexPath.section]
return approveCell
} 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
let model = YHLookResignResultDataLettersModel()
model.result_file = self.viewModel.dataModel.data.result_file
......
......@@ -373,7 +373,7 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl
let message = item.message ?? ""
let isNeed = item.isNeed ?? false
if isShow && message.count == 0 && isNeed {
tatol = tatol + 20
tatol += 20
}
}
return CGFloat(649 + tatol)
......
......@@ -427,7 +427,9 @@ extension YHResignAppointScheduleListViewController: UITableViewDelegate, UITabl
if 0 <= indexPath.row && indexPath.row < scheduleArr.count {
let model = scheduleArr[indexPath.row]
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.clickConfirmBtnBlock = {
......@@ -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
cell2.updateModel(model)
cell2.clickConfirmBtnBlock = {
......
......@@ -209,12 +209,12 @@ class YHResignMaterialViewModel: YHBaseViewModel {
func updateMaterials(material: YHMaterialModel, addInfoArr: [YHMaterialModelItemModel], callback: ((_ success: Bool, _ error: YHErrorModel?) -> Void)?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignMaterial.uploadMaterials
guard var params = [
var params: [String: Any] = [
"material_id": "\(material.id)",
"template_id": "\(material.template_id)",
"status": material.status,
"audit_remark": material.audit_remark
] as? [String: Any] else { return }
]
var info: [[String: Any]] = []
......
......@@ -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))
let template: ASAttributedString = " \(.view(statusLabel, .original(.center)))"
cerName = cerName + template
cerName += template
titlelabel.attributed.text = cerName
view.addSubview(noLabel)
......
......@@ -257,17 +257,17 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD
if indexPath.section == 0 {
var height: CGFloat = 0
for item in self.viewModel.mainModel.upload_list {
height = height + 32
height += 32
let value = getHeight(item.name)
height = height + value
height += value
}
return CGFloat(52 + height)
} else {
var height: CGFloat = 0
for item in self.viewModel.mainModel.doc_list {
height = height + 32
height += 32
let value = getHeight(item.name)
height = height + value
height += value
}
return CGFloat(52 + height)
}
......
......@@ -264,7 +264,7 @@ extension YHResignUploadTravelPassportViewController: UITableViewDelegate, UITab
let message = item.message ?? ""
let isNeed = item.isNeed ?? false
if isShow && message.count == 0 && isNeed {
tatol = tatol + 20
tatol += 20
}
}
return CGFloat(333 + tatol)
......
......@@ -188,7 +188,7 @@ extension YHResignUploadTravelCardListfootView: JXSegmentedListContainerViewData
}
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 vc
......
......@@ -15,7 +15,7 @@ class YHBasicInfoCellModel {
var needCheckFlag: Bool = false
var model: backgroundModel?
var model: BackgroundModel?
var type: Int = 0 // 0- 输入型 1-选择型
init(question: String, answer: String, info: String, type: Int = 0, needCheckFlag: Bool = false) {
self.question = question
......
......@@ -15,7 +15,7 @@ class YHBasicInfoFillModel: SmartCodable {
var spouse: SpouseModel?
var child: [SpouseModel]?
var brother: [SpouseModel]?
var background: backgroundModel?
var background: BackgroundModel?
var order_id: String = ""
required init() {
......@@ -23,16 +23,16 @@ class YHBasicInfoFillModel: SmartCodable {
}
}
class backgroundModel: SmartCodable {
var subset: [subsetModel] = []
var background_member: background_memberModel?
class BackgroundModel: SmartCodable {
var subset: [SubsetModel] = []
var background_member: Background_memberModel?
required init() {
}
}
class subsetModel: SmartCodable {
class SubsetModel: SmartCodable {
var id: Int = 0
var subset_name: String = ""
......@@ -41,7 +41,7 @@ class subsetModel: SmartCodable {
}
}
class background_memberModel: SmartCodable {
class Background_memberModel: SmartCodable {
var has: String = ""
var info: String = ""
......@@ -53,8 +53,8 @@ class background_memberModel: SmartCodable {
class SpouseModel: SmartCodable {
var id: Int = 0
var subset_name: String = ""
var child_departure: background_memberModel?
var child_deny: background_memberModel?
var child_departure: Background_memberModel?
var child_deny: Background_memberModel?
required init() {
}
......@@ -62,11 +62,11 @@ class SpouseModel: SmartCodable {
class ApplicantModel: SmartCodable {
var id: Int = 0
var has_conviction: background_memberModel?
var has_departure: background_memberModel?
var has_deny: background_memberModel?
var has_breaking_law: background_memberModel?
var has_other_id: background_memberModel?
var has_conviction: Background_memberModel?
var has_departure: Background_memberModel?
var has_deny: Background_memberModel?
var has_breaking_law: Background_memberModel?
var has_other_id: Background_memberModel?
required init() {
......
......@@ -22,7 +22,7 @@ class YHChoiceButtonHoldView: UIView {
private var arrCheckBtns: [UIButton] = []
var targetId: Int = -1
var dataModel: [subsetModel] = [] {
var dataModel: [SubsetModel] = [] {
didSet {
updateView()
}
......
......@@ -189,9 +189,12 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
if item is YHFormTitleItem { // 是标题
let formItem = item as! 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()
}
if let formItem = item as? YHFormTitleItem {
cell.setTitleAndSubTitle(title: formItem.getTitle())
}
return cell
}
......@@ -200,7 +203,9 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
let cellType = getCellType(detailItem)
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
if let value = detailItem.value, !value.isEmpty {
isValueValid = true
......@@ -261,7 +266,9 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
return cell
} 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.tipsBtnClickBlock = {
YHWholeScreenTipsView.show(type: .degreeType, targetView: cell.tipsButton)
......@@ -279,7 +286,7 @@ extension YHEducationDetailVC: UITableViewDelegate, UITableViewDataSource {
} 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
var isSelectTrue = false
......
......@@ -129,7 +129,9 @@ extension YHMajorSearchViewController: UITableViewDelegate, UITableViewDataSourc
}
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 {
let college: YHMajorInfo = majors[indexPath.row]
......
......@@ -587,7 +587,7 @@ extension YHGCFamilyMemberInfoListVC: UITableViewDelegate, UITableViewDataSource
}
if item is YHFamilyMember {
guard let detailItem = item as! YHFamilyMember else { return }
guard let detailItem = item as? YHFamilyMember else { return }
// 配偶
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