Commit a46e9997 authored by Steven杜宇's avatar Steven杜宇

// lint

parent f736ecfc
...@@ -153,7 +153,7 @@ extension YHHomeInformationViewController: CollectionViewWaterfallLayoutDelegate ...@@ -153,7 +153,7 @@ extension YHHomeInformationViewController: CollectionViewWaterfallLayoutDelegate
} }
var row = self.sectionItems.count/3 var row = self.sectionItems.count/3
if self.sectionItems.count%3 != 0 { if self.sectionItems.count%3 != 0 {
row = row + 1 row += 1
} }
let listHeight = Float(Double(row) * kHomeItemHeight) let listHeight = Float(Double(row) * kHomeItemHeight)
let totalHeight = listHeight + 4.0 + 0.5 + 65.0 let totalHeight = listHeight + 4.0 + 0.5 + 65.0
......
...@@ -359,7 +359,7 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource { ...@@ -359,7 +359,7 @@ extension YHSearchInfomationVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
gurad let cell = tableView.dequeueReusableCell(withIdentifier: YHSearchInfoCell.cellReuseIdentifier, for: indexPath) as? YHSearchInfoCell else { return UITableViewCell() } guard let cell = tableView.dequeueReusableCell(withIdentifier: YHSearchInfoCell.cellReuseIdentifier, for: indexPath) as? YHSearchInfoCell else { return UITableViewCell() }
if 0 <= indexPath.section && indexPath.section < items.count { if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section] let item = items[indexPath.section]
......
...@@ -157,7 +157,7 @@ extension YHInvatationShareViewController { ...@@ -157,7 +157,7 @@ extension YHInvatationShareViewController {
guard let combinedImage = combinedImageFrom(imageView: cell.centerImageView) else { return } guard let combinedImage = combinedImageFrom(imageView: cell.centerImageView) else { return }
saveImageToPhotosAlbum(image: combinedImage) saveImageToPhotosAlbum(image: combinedImage)
} else { } else {
let cell = myCollectView.cellForItem(at: IndexPath(row: currentPage, section: 0)) as! YHShareTwoCollectionViewCell guard let cell = myCollectView.cellForItem(at: IndexPath(row: currentPage, section: 0)) as? YHShareTwoCollectionViewCell else { return }
guard let combinedImage = combinedImageFrom(imageView: cell.centerImageView) else { return } guard let combinedImage = combinedImageFrom(imageView: cell.centerImageView) else { return }
saveImageToPhotosAlbum(image: combinedImage) saveImageToPhotosAlbum(image: combinedImage)
} }
......
...@@ -124,7 +124,6 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell { ...@@ -124,7 +124,6 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell {
make.right.equalTo(-15) make.right.equalTo(-15)
make.height.equalTo(20) make.height.equalTo(20)
} }
titleImageView = { titleImageView = {
let view = UIImageView() let view = UIImageView()
view.image = UIImage(named: "invitation_with_gifts_second_title") view.image = UIImage(named: "invitation_with_gifts_second_title")
...@@ -137,7 +136,6 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell { ...@@ -137,7 +136,6 @@ class YHInvitationWithGiftsSecondTableViewCell: UITableViewCell {
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.height.equalTo(20) make.height.equalTo(20)
} }
timeLabel = { timeLabel = {
let view = UILabel() let view = UILabel()
view.text = "您的推荐周期:2023-11-20 至2024-11-19" view.text = "您的推荐周期:2023-11-20 至2024-11-19"
......
...@@ -429,13 +429,14 @@ class YHInvitationWithGiftsSelectItemCell: UITableViewCell { ...@@ -429,13 +429,14 @@ class YHInvitationWithGiftsSelectItemCell: UITableViewCell {
} }
guard let data = dataSource else { return } guard let data = dataSource else { return }
for i in 0..<data.count { for i in 0..<data.count {
let button = centerView.viewWithTag(1000+i) as! UIButton if let button = centerView.viewWithTag(1000+i) as? UIButton {
if sender.tag == 1000 + i { if sender.tag == 1000 + i {
button.isSelected = true button.isSelected = true
button.layer.borderWidth = 1 button.layer.borderWidth = 1
} else { } else {
button.isSelected = false button.isSelected = false
button.layer.borderWidth = 0 button.layer.borderWidth = 0
}
} }
} }
selectIndex = sender.tag - 1000 selectIndex = sender.tag - 1000
......
...@@ -296,7 +296,9 @@ extension YHLifeViewController: UICollectionViewDelegate, UICollectionViewDataSo ...@@ -296,7 +296,9 @@ extension YHLifeViewController: UICollectionViewDelegate, UICollectionViewDataSo
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionFooter { if kind == UICollectionView.elementKindSectionFooter {
let footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: YHlifeCollectionReusableView.reuseIdentifier, for: indexPath) as! YHlifeCollectionReusableView guard let footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: YHlifeCollectionReusableView.reuseIdentifier, for: indexPath) as? YHlifeCollectionReusableView else {
return YHlifeCollectionReusableView()
}
// 配置 footerView // 配置 footerView
footerView.dataSource = self.viewModel.schedulLiveArr footerView.dataSource = self.viewModel.schedulLiveArr
return footerView return footerView
......
...@@ -268,7 +268,7 @@ extension YHHomeCollectionViewCell { ...@@ -268,7 +268,7 @@ extension YHHomeCollectionViewCell {
guard let self = self else { return } guard let self = self else { return }
if success { if success {
listModel.is_like = false listModel.is_like = false
listModel.like_count = listModel.like_count - 1 listModel.like_count -= 1
self.updataSubViews() self.updataSubViews()
} }
} }
......
...@@ -109,7 +109,7 @@ extension YHHomeInfoSectionHeadView: UICollectionViewDelegate, UICollectionViewD ...@@ -109,7 +109,7 @@ extension YHHomeInfoSectionHeadView: UICollectionViewDelegate, UICollectionViewD
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeInfoSectionCell.cellReuseIdentifier, for: indexPath) as! YHHomeInfoSectionCell guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHHomeInfoSectionCell.cellReuseIdentifier, for: indexPath) as? YHHomeInfoSectionCell else { return UICollectionViewCell() }
if 0 <= indexPath.row, indexPath.row < self.items.count { if 0 <= indexPath.row, indexPath.row < self.items.count {
if let item = self.items[indexPath.row] { if let item = self.items[indexPath.row] {
cell.updateModel(item) cell.updateModel(item)
......
...@@ -288,7 +288,7 @@ extension YHHomePageViewModel { ...@@ -288,7 +288,7 @@ extension YHHomePageViewModel {
self.totalCount = result.total self.totalCount = result.total
self.arrHomeNewsData = result.data self.arrHomeNewsData = result.data
} else { } else {
self.curPageIndex = self.curPageIndex + 1 self.curPageIndex += 1
self.arrHomeNewsData?.append(contentsOf: result.data) self.arrHomeNewsData?.append(contentsOf: result.data)
} }
......
...@@ -126,12 +126,10 @@ extension YHServiceOrderProgressTableViewCell { ...@@ -126,12 +126,10 @@ extension YHServiceOrderProgressTableViewCell {
titleLabel.text = "赴港办证预约" titleLabel.text = "赴港办证预约"
messageLabel.text = "请填写意向办证时间,银河代预约~" messageLabel.text = "请填写意向办证时间,银河代预约~"
} }
if model.type == 23 { if model.type == 23 {
titleLabel.text = "电子签证缴费" titleLabel.text = "电子签证缴费"
messageLabel.text = "请根据指引缴费领取电子签证~" messageLabel.text = "请根据指引缴费领取电子签证~"
} }
if model.type == 25 { if model.type == 25 {
titleLabel.text = "赴港行程指引" titleLabel.text = "赴港行程指引"
messageLabel.text = "请根据指引清单提前规划赴港行程" messageLabel.text = "请根据指引清单提前规划赴港行程"
......
...@@ -288,13 +288,13 @@ extension YHAdopterNewPeopleViewController: UITableViewDelegate, UITableViewData ...@@ -288,13 +288,13 @@ extension YHAdopterNewPeopleViewController: UITableViewDelegate, UITableViewData
if isShow && message.count == 0 && isNeed { if isShow && message.count == 0 && isNeed {
h = h + 72 + 20 h = h + 72 + 20
} else { } else {
h = h + 72 h += 72
} }
} else { } else {
if isShow && message.count == 0 && isNeed { if isShow && message.count == 0 && isNeed {
h = h + 52 + 20 h += (52 + 20)
} else { } else {
h = h + 52 h += 52
} }
} }
} }
......
...@@ -191,7 +191,7 @@ class YHAdopterAddNewTableViewCell: UITableViewCell { ...@@ -191,7 +191,7 @@ class YHAdopterAddNewTableViewCell: UITableViewCell {
make.height.equalTo(51) make.height.equalTo(51)
make.right.equalTo(-18) make.right.equalTo(-18)
} }
total = total + 51 total += 51
} }
} }
......
...@@ -382,7 +382,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa ...@@ -382,7 +382,9 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
if item.type == .warmTips { if item.type == .warmTips {
// 温馨提示 // 温馨提示
let cell = tableView.dequeueReusableCell(withIdentifier: YHAppointWarmTipsCell.cellReuseIdentifier, for: indexPath) as! YHAppointWarmTipsCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHAppointWarmTipsCell.cellReuseIdentifier, for: indexPath) as? YHAppointWarmTipsCell else {
return UITableViewCell()
}
return cell return cell
} }
......
...@@ -242,9 +242,9 @@ extension YHReAppointViewController { ...@@ -242,9 +242,9 @@ extension YHReAppointViewController {
return $0.isSelected == true return $0.isSelected == true
} }
let users = self.waitAppointMembers.map { let users = self.waitAppointMembers.map {
let dict = ["id": $0.id, guard let dict = ["id": $0.id,
"type": $0.type, "type": $0.type,
"name": $0.name] as! [String: Any] "name": $0.name] as? [String: Any] else { return [:]}
return dict return dict
} }
......
...@@ -155,7 +155,9 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat ...@@ -155,7 +155,9 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
return approveCell return approveCell
} }
if indexPath.section == 2 { if indexPath.section == 2 {
let certificateInfoCell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoPhotoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoPhotoCell guard let certificateInfoCell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoPhotoCell.cellReuseIdentifier, for: indexPath) as? YHCertificateInfoPhotoCell else {
return UITableViewCell()
}
return certificateInfoCell return certificateInfoCell
} }
} }
......
...@@ -391,7 +391,7 @@ extension YHTravelDocsPreparationDetailVC: UITableViewDelegate, UITableViewDataS ...@@ -391,7 +391,7 @@ extension YHTravelDocsPreparationDetailVC: UITableViewDelegate, UITableViewDataS
let item = sectionItems[indexPath.section] let item = sectionItems[indexPath.section]
if item.type == .tips { if item.type == .tips {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as! YHTravelCertificateTipsCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as? YHTravelCertificateTipsCell else { return UITableViewCell() }
cell.userName = self.dataModel.name cell.userName = self.dataModel.name
cell.tipsArr = item.tipsArr cell.tipsArr = item.tipsArr
return cell return cell
......
...@@ -106,7 +106,9 @@ extension YHTravelDocsPreparationListViewController: UITableViewDelegate, UITabl ...@@ -106,7 +106,9 @@ extension YHTravelDocsPreparationListViewController: UITableViewDelegate, UITabl
return approveCell return approveCell
} else if viewModel.arrTravelDocs.count > 0, indexPath.section < viewModel.arrTravelDocs.count { } else if viewModel.arrTravelDocs.count > 0, indexPath.section < viewModel.arrTravelDocs.count {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHTravelDocsPreparationListCell.cellReuseIdentifier, for: indexPath) as! YHTravelDocsPreparationListCell guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHTravelDocsPreparationListCell.cellReuseIdentifier, for: indexPath) as? YHTravelDocsPreparationListCell else {
return UITableViewCell()
}
approveCell.dataModel = viewModel.arrTravelDocs[indexPath.section] approveCell.dataModel = viewModel.arrTravelDocs[indexPath.section]
return approveCell return approveCell
} }
......
...@@ -146,7 +146,9 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource { ...@@ -146,7 +146,9 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 { if indexPath.row == 0 {
let warningCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateTitleCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateTitleCell guard let warningCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateTitleCell.cellReuseIdentifier, for: indexPath) as? YHUploadCertificateTitleCell else {
return UITableViewCell()
}
var title = "" var title = ""
if indexPath.section == 0 { if indexPath.section == 0 {
......
...@@ -368,7 +368,9 @@ extension YHOfficialApprovalResultVC: FSPagerViewDataSource, FSPagerViewDelegate ...@@ -368,7 +368,9 @@ extension YHOfficialApprovalResultVC: FSPagerViewDataSource, FSPagerViewDelegate
} }
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell { public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: YHOfficailLetterColledtionCell.cellReuseIdentifier, at: index) as! YHOfficailLetterColledtionCell guard let cell = pagerView.dequeueReusableCell(withReuseIdentifier: YHOfficailLetterColledtionCell.cellReuseIdentifier, at: index) as? YHOfficailLetterColledtionCell else {
return FSPagerViewCell()
}
if index < dataArr.count { if index < dataArr.count {
cell.dataModel = dataArr[index] cell.dataModel = dataArr[index]
} }
......
...@@ -134,7 +134,7 @@ private extension YHOffivialApprovalGuildLineCheckView { ...@@ -134,7 +134,7 @@ private extension YHOffivialApprovalGuildLineCheckView {
@objc func timerFired() { @objc func timerFired() {
// 定时器触发时执行的代码 // 定时器触发时执行的代码
print("Timer fired") print("Timer fired")
self.maxCount = self.maxCount - 1 self.maxCount -= 1
if self.maxCount < 1 { if self.maxCount < 1 {
self.stopTimer() self.stopTimer()
self.setButtonEnable(true) self.setButtonEnable(true)
......
...@@ -79,7 +79,7 @@ class YHOffivialApprovalSuccessView: UIView { ...@@ -79,7 +79,7 @@ class YHOffivialApprovalSuccessView: UIView {
make.height.equalTo(1) make.height.equalTo(1)
} }
h = h + 26 + 10 h = h + 26 + 10
index = index + 1 index += 1
arrViews.append(label) arrViews.append(label)
arrViews.append(line) arrViews.append(line)
......
...@@ -125,7 +125,9 @@ extension YHPrincipleApprovedMailViewController: UITableViewDelegate, UITableVie ...@@ -125,7 +125,9 @@ extension YHPrincipleApprovedMailViewController: UITableViewDelegate, UITableVie
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if 0 <= indexPath.row && indexPath.row < items.count { if 0 <= indexPath.row && indexPath.row < items.count {
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()
}
let m = items[indexPath.row] let m = items[indexPath.row]
if m is YHPrincipleWaitResultModel { if m is YHPrincipleWaitResultModel {
let model = m as! YHPrincipleWaitResultModel let model = m as! YHPrincipleWaitResultModel
......
...@@ -115,7 +115,9 @@ extension YHPrincipleApprovedWaitSubmitVC: UITableViewDelegate, UITableViewDataS ...@@ -115,7 +115,9 @@ extension YHPrincipleApprovedWaitSubmitVC: UITableViewDelegate, UITableViewDataS
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as? YHPrincipleEnvelopeCell 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]
cell.updateModel(model) cell.updateModel(model)
......
...@@ -346,7 +346,9 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -346,7 +346,9 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) as! UITableViewCell guard let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) as? UITableViewCell else {
return UITableViewCell()
}
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]
......
...@@ -253,7 +253,9 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec ...@@ -253,7 +253,9 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec
} }
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHPrinciplePhotoCollectCell.cellReuseIdentifier, for: indexPath) as! YHPrinciplePhotoCollectCell guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHPrinciplePhotoCollectCell.cellReuseIdentifier, for: indexPath) as? YHPrinciplePhotoCollectCell else {
return UICollectionViewCell()
}
cell.isSinglePhoto = items.count == 1 cell.isSinglePhoto = items.count == 1
if 0 <= indexPath.item, indexPath.item < items.count { if 0 <= indexPath.item, indexPath.item < items.count {
let model = items[indexPath.item] let model = items[indexPath.item]
......
...@@ -213,7 +213,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -213,7 +213,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
self.statusLabel.textColor = self.getUploadTitleColor(status: model.check_status) self.statusLabel.textColor = self.getUploadTitleColor(status: model.check_status)
self.statusLabel.backgroundColor = self.getUploadBgColor(status: model.check_status) self.statusLabel.backgroundColor = self.getUploadBgColor(status: model.check_status)
let status: ASAttributedString = " \(.view(self.statusLabel, .original(.center)))" let status: ASAttributedString = " \(.view(self.statusLabel, .original(.center)))"
titleStr = titleStr + status titleStr += status
} }
titleLabel.attributed.text = titleStr titleLabel.attributed.text = titleStr
......
...@@ -298,7 +298,9 @@ extension YHMyFileListViewController: UITableViewDelegate, UITableViewDataSource ...@@ -298,7 +298,9 @@ extension YHMyFileListViewController: UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let noneCell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListNoneCell.cellReuseIdentifier, for: indexPath) as! YHMyFileListNoneCell guard let noneCell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListNoneCell.cellReuseIdentifier, for: indexPath) as? YHMyFileListNoneCell else {
return UITableViewCell()
}
if 0 <= indexPath.section && indexPath.section < items.count { if 0 <= indexPath.section && indexPath.section < items.count {
let model = items[indexPath.section] let model = items[indexPath.section]
if model.supplement_list.count > 0 { if model.supplement_list.count > 0 {
......
...@@ -73,11 +73,15 @@ extension YHFileListContentView { ...@@ -73,11 +73,15 @@ extension YHFileListContentView {
if let iii = item { if let iii = item {
var view: UIView = YHFileListItemsView() var view: UIView = YHFileListItemsView()
if iii.type == 0 { if iii.type == 0 {
(view as! YHFileListItemsView).dataModel = item if let view = view as? YHFileListItemsView {
view.dataModel = item
}
} else { } else {
// if item?.type == 1 // if item?.type == 1
view = YHFileListItemsView2() view = YHFileListItemsView2()
(view as! YHFileListItemsView2).dataModel = item if let view = view as? YHFileListItemsView2 {
view.dataModel = item
}
} }
addSubview(view) addSubview(view)
......
...@@ -108,8 +108,9 @@ class YHSegmentView: UIView { ...@@ -108,8 +108,9 @@ class YHSegmentView: UIView {
self.selectIndex = index self.selectIndex = index
for subView in self.subviews { for subView in self.subviews {
if subView is YHSegmentItemView { if subView is YHSegmentItemView {
let subItemView = subView as! YHSegmentItemView if let subItemView = subView as? YHSegmentItemView {
subItemView.isSelect = subItemView.tag == index+self.itemBaseTag subItemView.isSelect = subItemView.tag == index+self.itemBaseTag
}
} }
} }
} }
......
...@@ -80,7 +80,7 @@ extension YHCertificateListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -80,7 +80,7 @@ extension YHCertificateListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as? YHCertificateInfoCell else { return UITableViewCell() }
if 0 <= indexPath.section && indexPath.section < items.count { if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section] let item = items[indexPath.section]
......
...@@ -114,7 +114,7 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat ...@@ -114,7 +114,7 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as? YHCertificateInfoCell else { return UITableViewCell() }
if 0 <= indexPath.section && indexPath.section < items.count { if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section] let item = items[indexPath.section]
......
...@@ -228,7 +228,7 @@ extension YHCertificateUploadContentListVC: UITableViewDelegate, UITableViewData ...@@ -228,7 +228,7 @@ extension YHCertificateUploadContentListVC: UITableViewDelegate, UITableViewData
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else { return UITableViewCell() }
cell.update(bottomMargin: 15) cell.update(bottomMargin: 15)
if 0 <= indexPath.row && indexPath.row < templateArr.count { if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templatePath = templateArr[indexPath.row] cell.templatePath = templateArr[indexPath.row]
......
...@@ -89,9 +89,9 @@ private extension YHCertificateEntryHeadView { ...@@ -89,9 +89,9 @@ private extension YHCertificateEntryHeadView {
} else { } else {
tmp = dataModel.user_name tmp = dataModel.user_name
if dataModel.sex == 1 { if dataModel.sex == 1 {
tmp = tmp + "先生" tmp += "先生"
} else if dataModel.sex == 2 { } else if dataModel.sex == 2 {
tmp = tmp + "女士" tmp += "女士"
} else { } else {
} }
......
...@@ -335,7 +335,9 @@ extension YHCertificateFilterView: UICollectionViewDataSource, UICollectionViewD ...@@ -335,7 +335,9 @@ extension YHCertificateFilterView: UICollectionViewDataSource, UICollectionViewD
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionHeader { if kind == UICollectionView.elementKindSectionHeader {
let headerView: YHCertificateFilterTypeView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: YHCertificateFilterTypeView.reuseIdentifier, for: indexPath) as! YHCertificateFilterTypeView guard let headerView: YHCertificateFilterTypeView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: YHCertificateFilterTypeView.reuseIdentifier, for: indexPath) as? YHCertificateFilterTypeView else {
return YHCertificateFilterTypeView()
}
if 0 <= indexPath.section && indexPath.section < items.count { if 0 <= indexPath.section && indexPath.section < items.count {
let sectionInfo = items[indexPath.section] let sectionInfo = items[indexPath.section]
......
...@@ -222,7 +222,9 @@ extension YHCertificateTemplateSheetView: UITableViewDelegate, UITableViewDataSo ...@@ -222,7 +222,9 @@ extension YHCertificateTemplateSheetView: UITableViewDelegate, UITableViewDataSo
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else {
return UITableViewCell()
}
cell.update(bottomMargin: 20) cell.update(bottomMargin: 20)
if 0 <= indexPath.row && indexPath.row < templateArr.count { if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templatePath = templateArr[indexPath.row] cell.templatePath = templateArr[indexPath.row]
......
...@@ -305,7 +305,9 @@ extension YHCertificateUploadSheetView: UITableViewDelegate, UITableViewDataSour ...@@ -305,7 +305,9 @@ extension YHCertificateUploadSheetView: UITableViewDelegate, UITableViewDataSour
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateUploadTypeCell.cellReuseIdentifier, for: indexPath) as! YHCertificateUploadTypeCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateUploadTypeCell.cellReuseIdentifier, for: indexPath) as? YHCertificateUploadTypeCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < uploadTypeArr.count { if 0 <= indexPath.row && indexPath.row < uploadTypeArr.count {
cell.item = uploadTypeArr[indexPath.row] cell.item = uploadTypeArr[indexPath.row]
} }
......
...@@ -149,7 +149,7 @@ class YHDocumentUploadTableViewCell: UITableViewCell { ...@@ -149,7 +149,7 @@ class YHDocumentUploadTableViewCell: UITableViewCell {
make.height.equalTo(1) make.height.equalTo(1)
make.right.equalTo(-18) make.right.equalTo(-18)
} }
y = y + 1 y += 1
let data = dataSource.writing_document.doc_sign.doc_return_manual[i] let data = dataSource.writing_document.doc_sign.doc_return_manual[i]
let h = 70 let h = 70
let itemView = YHDocumentFileItemView() let itemView = YHDocumentFileItemView()
......
...@@ -247,7 +247,9 @@ extension YHDocumentUploadView: UITableViewDelegate, UITableViewDataSource { ...@@ -247,7 +247,9 @@ extension YHDocumentUploadView: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateUploadTypeCell.cellReuseIdentifier, for: indexPath) as! YHCertificateUploadTypeCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateUploadTypeCell.cellReuseIdentifier, for: indexPath) as? YHCertificateUploadTypeCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < uploadTypeArr.count { if 0 <= indexPath.row && indexPath.row < uploadTypeArr.count {
cell.item = uploadTypeArr[indexPath.row] cell.item = uploadTypeArr[indexPath.row]
} }
......
...@@ -351,9 +351,9 @@ private extension YHHKPlanItemView { ...@@ -351,9 +351,9 @@ private extension YHHKPlanItemView {
if scalar.value >= 0x4E00 && scalar.value <= 0x9FFF { if scalar.value >= 0x4E00 && scalar.value <= 0x9FFF {
// 中文字符的Unicode范围 // 中文字符的Unicode范围
if isPreDone == false { if isPreDone == false {
totalNumber = totalNumber + 1 totalNumber += 1
} }
totalNumber = totalNumber + 1 totalNumber += 1
isPreDone = true isPreDone = true
} else if scalar.isASCII && (scalar >= "a" && scalar <= "z" || scalar >= "A" && scalar <= "Z") { } else if scalar.isASCII && (scalar >= "a" && scalar <= "z" || scalar >= "A" && scalar <= "Z") {
...@@ -367,7 +367,7 @@ private extension YHHKPlanItemView { ...@@ -367,7 +367,7 @@ private extension YHHKPlanItemView {
} else { } else {
if isPreDone == false { if isPreDone == false {
totalNumber = totalNumber + 1 totalNumber += 1
} else { } else {
} }
...@@ -376,7 +376,7 @@ private extension YHHKPlanItemView { ...@@ -376,7 +376,7 @@ private extension YHHKPlanItemView {
if index == stringLength - 1 { if index == stringLength - 1 {
if isPreDone == false { if isPreDone == false {
totalNumber = totalNumber + 1 totalNumber += 1
} }
} }
} }
......
...@@ -166,9 +166,9 @@ extension YHMyDocListHeaderView { ...@@ -166,9 +166,9 @@ extension YHMyDocListHeaderView {
} else { } else {
var tmp = "您好," + model.username var tmp = "您好," + model.username
if model.sex == 1 { if model.sex == 1 {
tmp = tmp + "先生" tmp += "先生"
} else if model.sex == 2 { } else if model.sex == 2 {
tmp = tmp + "女士" tmp += "女士"
} }
titleLable.text = tmp titleLable.text = tmp
} }
......
...@@ -290,7 +290,9 @@ extension YHImproveSchemeViewController: UITableViewDelegate, UITableViewDataSou ...@@ -290,7 +290,9 @@ extension YHImproveSchemeViewController: UITableViewDelegate, UITableViewDataSou
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 1 { if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHIHKIdentityPlanCell.cellReuseIdentifier, for: indexPath) as! YHIHKIdentityPlanCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHIHKIdentityPlanCell.cellReuseIdentifier, for: indexPath) as? YHIHKIdentityPlanCell else {
return UITableViewCell()
}
return cell return cell
} }
......
...@@ -419,7 +419,9 @@ extension YHMyNewSchemeViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -419,7 +419,9 @@ extension YHMyNewSchemeViewController: UITableViewDelegate, UITableViewDataSourc
let item = arr[indexPath.row] let item = arr[indexPath.row]
if item.type == .evaluate { if item.type == .evaluate {
let cell = tableView.dequeueReusableCell(withIdentifier: YHComprehensiveEvaluationCell.cellReuseIdentifier, for: indexPath) as! YHComprehensiveEvaluationCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHComprehensiveEvaluationCell.cellReuseIdentifier, for: indexPath) as? YHComprehensiveEvaluationCell else {
return UITableViewCell()
}
cell.tipsType = self.tipsType cell.tipsType = self.tipsType
targetCell = cell targetCell = cell
} }
......
...@@ -157,7 +157,9 @@ extension YHImproveSchemeTemplateListView: UITableViewDelegate, UITableViewDataS ...@@ -157,7 +157,9 @@ extension YHImproveSchemeTemplateListView: UITableViewDelegate, UITableViewDataS
if 0 <= indexPath.row && indexPath.row < items.count { if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row] let item = items[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveSchemeTemplateListCell.cellReuseIdentifier, for: indexPath) as! YHImproveSchemeTemplateListCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveSchemeTemplateListCell.cellReuseIdentifier, for: indexPath) as? YHImproveSchemeTemplateListCell else {
return UITableViewCell()
}
cell.titleLabel.text = "\(indexPath.row+1)\(item.name)" cell.titleLabel.text = "\(indexPath.row+1)\(item.name)"
cell.model = item cell.model = item
cell.clickBlock = { cell.clickBlock = {
......
...@@ -150,7 +150,7 @@ class YHSignatureUploadTableViewCell: UITableViewCell { ...@@ -150,7 +150,7 @@ class YHSignatureUploadTableViewCell: UITableViewCell {
make.height.equalTo(1) make.height.equalTo(1)
make.right.equalTo(-18) make.right.equalTo(-18)
} }
y = y + 1 y += 1
let data = dataSource.doc_return_manual[i] let data = dataSource.doc_return_manual[i]
let h = 70 let h = 70
let itemView = YHDocumentFileItemView() let itemView = YHDocumentFileItemView()
......
...@@ -212,7 +212,9 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData ...@@ -212,7 +212,9 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if state == 0 { if state == 0 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateOneTableViewCell.cellReuseIdentifier, for: indexPath) as! YHLookResignResultStateOneTableViewCell guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateOneTableViewCell.cellReuseIdentifier, for: indexPath) as? YHLookResignResultStateOneTableViewCell else {
return UITableViewCell()
}
approveCell.title = "第" + convertNumberToChineseText(self.viewModel.dataModel.data.data[indexPath.section].number) + "批" approveCell.title = "第" + convertNumberToChineseText(self.viewModel.dataModel.data.data[indexPath.section].number) + "批"
approveCell.dataSource = self.viewModel.dataModel.data.data[indexPath.section] approveCell.dataSource = self.viewModel.dataModel.data.data[indexPath.section]
return approveCell return approveCell
......
...@@ -135,7 +135,7 @@ private extension YHLookResignGuideLineView { ...@@ -135,7 +135,7 @@ private extension YHLookResignGuideLineView {
@objc func timerFired() { @objc func timerFired() {
// 定时器触发时执行的代码 // 定时器触发时执行的代码
print("Timer fired") print("Timer fired")
self.maxCount = self.maxCount - 1 self.maxCount -= 1
if self.maxCount < 1 { if self.maxCount < 1 {
self.stopTimer() self.stopTimer()
self.setButtonEnable(true) self.setButtonEnable(true)
......
...@@ -176,7 +176,7 @@ class YHLookResignResultStateOneTableViewCell: UITableViewCell { ...@@ -176,7 +176,7 @@ class YHLookResignResultStateOneTableViewCell: UITableViewCell {
var i = 0 var i = 0
for item in dataSource.users { for item in dataSource.users {
if i == 0 { if i == 0 {
names = names + item names += item
} else { } else {
names = names + "、" + item names = names + "、" + item
} }
......
...@@ -168,7 +168,7 @@ class YHLookResignResultStateThreePeopleTableViewCell: UITableViewCell { ...@@ -168,7 +168,7 @@ class YHLookResignResultStateThreePeopleTableViewCell: UITableViewCell {
var i = 0 var i = 0
for item in dataSource.users { for item in dataSource.users {
if i == 0 { if i == 0 {
names = names + item names += item
} else { } else {
names = names + "、" + item names = names + "、" + item
} }
......
...@@ -131,7 +131,7 @@ class YHLookResignResultStateThreeTableViewCell: UITableViewCell { ...@@ -131,7 +131,7 @@ class YHLookResignResultStateThreeTableViewCell: UITableViewCell {
make.width.equalTo(140.fix) make.width.equalTo(140.fix)
make.height.equalTo(101) make.height.equalTo(101)
} }
count = count + 1 count += 1
} }
} }
} }
......
...@@ -136,7 +136,7 @@ class YHLookResignResultStateTwoTableViewCell: UITableViewCell { ...@@ -136,7 +136,7 @@ class YHLookResignResultStateTwoTableViewCell: UITableViewCell {
make.width.equalTo(140.fix) make.width.equalTo(140.fix)
make.height.equalTo(101) make.height.equalTo(101)
} }
count = count + 1 count += 1
} }
} }
} }
......
...@@ -267,7 +267,9 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl ...@@ -267,7 +267,9 @@ extension YHResignCertificateDetailHkViewController: UITableViewDelegate, UITabl
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as! YHTravelCertificateTipsCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as? YHTravelCertificateTipsCell else {
return UITableViewCell()
}
cell.userName = self.dataModel.name cell.userName = self.dataModel.name
cell.tipsArr = tipsArr cell.tipsArr = tipsArr
return cell return cell
......
...@@ -246,7 +246,9 @@ extension YHResignCertificateDetailPassPortViewController: UITableViewDelegate, ...@@ -246,7 +246,9 @@ extension YHResignCertificateDetailPassPortViewController: UITableViewDelegate,
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as! YHTravelCertificateTipsCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as? YHTravelCertificateTipsCell else {
return UITableViewCell()
}
cell.userName = self.dataModel.name cell.userName = self.dataModel.name
cell.tipsArr = tipsArr cell.tipsArr = tipsArr
return cell return cell
......
...@@ -262,7 +262,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell { ...@@ -262,7 +262,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
view.layer.cornerRadius = kCornerRadius6 view.layer.cornerRadius = kCornerRadius6
return view return view
}() }()
contentView.addSubview(centerView) contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in centerView.snp.makeConstraints { make in
make.left.equalTo(16) make.left.equalTo(16)
...@@ -270,7 +269,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell { ...@@ -270,7 +269,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
make.top.equalTo(0) make.top.equalTo(0)
make.bottom.equalTo(0) make.bottom.equalTo(0)
} }
titleLabel = { titleLabel = {
let label = UILabel() let label = UILabel()
// label.font = UIFont.PFSC_M(ofSize: 17) // label.font = UIFont.PFSC_M(ofSize: 17)
...@@ -292,7 +290,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell { ...@@ -292,7 +290,6 @@ class YHResignCertificateHKTableViewCell: UITableViewCell {
make.top.equalTo(16) make.top.equalTo(16)
make.height.equalTo(20) make.height.equalTo(20)
} }
exampleButton = { exampleButton = {
let button = UIButton(type: .custom) let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08) button.backgroundColor = UIColor.brandMainColor.withAlphaComponent(0.08)
......
...@@ -93,7 +93,7 @@ class YHResignCertificateListTableViewCell: UITableViewCell { ...@@ -93,7 +93,7 @@ class YHResignCertificateListTableViewCell: UITableViewCell {
make.height.equalTo(0.5) make.height.equalTo(0.5)
make.right.equalTo(-18) make.right.equalTo(-18)
} }
total = total + 1 total += 1
let itemView = YHResignCertificateView() let itemView = YHResignCertificateView()
itemView.index = index itemView.index = index
itemView.clickBlock = {[weak self] model in itemView.clickBlock = {[weak self] model in
......
...@@ -280,9 +280,11 @@ class YHResignAppointScheduleListViewController: YHBaseViewController { ...@@ -280,9 +280,11 @@ class YHResignAppointScheduleListViewController: YHBaseViewController {
if status != .haveConfirmHK { // 非已确认在港 if status != .haveConfirmHK { // 非已确认在港
// 先讲所有需分批用户设置为未选择状态 // 先讲所有需分批用户设置为未选择状态
let users = lastLeftUnselectUsers.map { let users = lastLeftUnselectUsers.map {
let m = $0.copy() as! YHResignAppointMember if let m = $0.copy() as? YHResignAppointMember {
m.isSelected = false m.isSelected = false
return m return m
}
return YHResignAppointMember()
} }
// group.user_list 表示当前批已选用户组 更新已选择状态 // group.user_list 表示当前批已选用户组 更新已选择状态
......
...@@ -151,7 +151,9 @@ extension YHResignAppointTimeModifyViewController: UITableViewDelegate, UITableV ...@@ -151,7 +151,9 @@ extension YHResignAppointTimeModifyViewController: UITableViewDelegate, UITableV
return cell1 return cell1
} }
// 可编辑是否一起递交 // 可编辑是否一起递交
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignAppointOptionCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointOptionCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignAppointOptionCell.cellReuseIdentifier, for: indexPath) as? YHResignAppointOptionCell else {
return UITableViewCell()
}
cell.isSelectTogether = self.isTogether cell.isSelectTogether = self.isTogether
cell.selectBlock = { cell.selectBlock = {
[weak self] index in [weak self] index in
......
...@@ -231,13 +231,14 @@ class YHResignAppointTimeViewController: YHBaseViewController { ...@@ -231,13 +231,14 @@ class YHResignAppointTimeViewController: YHBaseViewController {
} else { // 如果操作的当前批次不是最后一批 需要更新后面几批的选中状态 } else { // 如果操作的当前批次不是最后一批 需要更新后面几批的选中状态
let nextGroupIndex = groupLevel+1 let nextGroupIndex = groupLevel+1
let newMember = currentMember.copy() as! YHResignAppointMember if let newMember = currentMember.copy() as? YHResignAppointMember {
newMember.isSelected = true newMember.isSelected = true
if 0 <= groupLevel, groupLevel < selectGroupArr.count { if 0 <= groupLevel, groupLevel < selectGroupArr.count {
let item = selectGroupArr[nextGroupIndex] let item = selectGroupArr[nextGroupIndex]
var members = item.users var members = item.users
members.append(newMember) members.append(newMember)
item.users = members item.users = members
}
} }
} }
} else { // 如果操作是选中 } else { // 如果操作是选中
......
...@@ -157,8 +157,9 @@ extension Array where Element == YHResignAppointUser { ...@@ -157,8 +157,9 @@ extension Array where Element == YHResignAppointUser {
func deepCopy() -> [YHResignAppointUser] { func deepCopy() -> [YHResignAppointUser] {
var results: [YHResignAppointUser] = [] var results: [YHResignAppointUser] = []
for item in self { for item in self {
let newItem = item.copy() if let newItem = item.copy() as? YHResignAppointUser {
results.append(newItem as! YHResignAppointUser) results.append(newItem)
}
} }
return results return results
} }
......
...@@ -15,8 +15,9 @@ extension Array where Element == YHResignAppointMember { ...@@ -15,8 +15,9 @@ extension Array where Element == YHResignAppointMember {
func deepCopy() -> [YHResignAppointMember] { func deepCopy() -> [YHResignAppointMember] {
var results: [YHResignAppointMember] = [] var results: [YHResignAppointMember] = []
for item in self { for item in self {
let newItem = item.copy() if let newItem = item.copy() as? YHResignAppointMember {
results.append(newItem as! YHResignAppointMember) results.append(newItem)
}
} }
return results return results
} }
......
...@@ -179,7 +179,9 @@ extension YHRangeDatePickerView2 { ...@@ -179,7 +179,9 @@ extension YHRangeDatePickerView2 {
} }
func calendar(_ calendar: FSCalendar, cellFor date: Date, at monthPosition: FSCalendarMonthPosition) -> FSCalendarCell { func calendar(_ calendar: FSCalendar, cellFor date: Date, at monthPosition: FSCalendarMonthPosition) -> FSCalendarCell {
let cell: YHRangeDatePickerCell2 = calendar.dequeueReusableCell(withIdentifier: YHRangeDatePickerCell2.cellReuseIdentifier, for: date, at: monthPosition) as! YHRangeDatePickerCell2 guard let cell: YHRangeDatePickerCell2 = calendar.dequeueReusableCell(withIdentifier: YHRangeDatePickerCell2.cellReuseIdentifier, for: date, at: monthPosition) as? YHRangeDatePickerCell2 else {
return FSCalendarCell()
}
return cell return cell
} }
......
...@@ -135,7 +135,7 @@ private extension YHResignAppointGuideLineView { ...@@ -135,7 +135,7 @@ private extension YHResignAppointGuideLineView {
@objc func timerFired() { @objc func timerFired() {
// 定时器触发时执行的代码 // 定时器触发时执行的代码
print("Timer fired") print("Timer fired")
self.maxCount = self.maxCount - 1 self.maxCount -= 1
if self.maxCount < 1 { if self.maxCount < 1 {
self.stopTimer() self.stopTimer()
self.setButtonEnable(true) self.setButtonEnable(true)
......
...@@ -439,7 +439,9 @@ extension YHResignAppointTimeMultipleCell: UICollectionViewDelegate, UICollectio ...@@ -439,7 +439,9 @@ extension YHResignAppointTimeMultipleCell: UICollectionViewDelegate, UICollectio
// 返回自定义单元格 // 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignSelectApplicantCollectCell.cellReuseIdentifier, for: indexPath) as! YHResignSelectApplicantCollectCell guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignSelectApplicantCollectCell.cellReuseIdentifier, for: indexPath) as? YHResignSelectApplicantCollectCell else {
return UICollectionViewCell()
}
if 0 <= indexPath.item && indexPath.item < arr.count { if 0 <= indexPath.item && indexPath.item < arr.count {
let applicant = arr[indexPath.item] let applicant = arr[indexPath.item]
cell.updateApplicantInfo(applicant) cell.updateApplicantInfo(applicant)
......
...@@ -134,7 +134,9 @@ extension YHResignAppointedScheduleLineView: UICollectionViewDelegate, UICollect ...@@ -134,7 +134,9 @@ extension YHResignAppointedScheduleLineView: UICollectionViewDelegate, UICollect
// 返回自定义单元格 // 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignScheduleLineCollectCell.cellReuseIdentifier, for: indexPath) as! YHResignScheduleLineCollectCell guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignScheduleLineCollectCell.cellReuseIdentifier, for: indexPath) as? YHResignScheduleLineCollectCell else {
return UICollectionViewCell()
}
if 0 <= indexPath.item && indexPath.item < steps.count { if 0 <= indexPath.item && indexPath.item < steps.count {
let model = steps[indexPath.item] let model = steps[indexPath.item]
model.index = indexPath.item+1 model.index = indexPath.item+1
......
...@@ -148,7 +148,9 @@ extension YHResignConfirmInfoListViewController: UITableViewDelegate, UITableVie ...@@ -148,7 +148,9 @@ extension YHResignConfirmInfoListViewController: UITableViewDelegate, UITableVie
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyMemberInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignFamilyMemberInfoCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyMemberInfoCell.cellReuseIdentifier, for: indexPath) as? YHResignFamilyMemberInfoCell else {
return UITableViewCell()
}
if 0 <= indexPath.row && indexPath.row < familyArr.count { if 0 <= indexPath.row && indexPath.row < familyArr.count {
let model = familyArr[indexPath.row] let model = familyArr[indexPath.row]
......
...@@ -202,7 +202,9 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV ...@@ -202,7 +202,9 @@ extension YHResignInfoConfirmModifyViewController: UITableViewDelegate, UITableV
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyInfoListCell.cellReuseIdentifier, for: indexPath) as! YHResignFamilyInfoListCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignFamilyInfoListCell.cellReuseIdentifier, for: indexPath) as? YHResignFamilyInfoListCell else {
return UITableViewCell()
}
cell.familyInfo = self.detailMember cell.familyInfo = self.detailMember
if indexPath.row == 0 { if indexPath.row == 0 {
......
...@@ -91,7 +91,7 @@ extension YHResignMaterialListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -91,7 +91,7 @@ extension YHResignMaterialListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignMaterialCell.cellReuseIdentifier, for: indexPath) as! YHResignMaterialCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignMaterialCell.cellReuseIdentifier, for: indexPath) as? YHResignMaterialCell else { return UITableViewCell() }
if 0 <= indexPath.section && indexPath.section < items.count { if 0 <= indexPath.section && indexPath.section < items.count {
let list = items[indexPath.section] let list = items[indexPath.section]
......
...@@ -218,7 +218,7 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource { ...@@ -218,7 +218,7 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else { return UITableViewCell() }
cell.update(bottomMargin: 15) cell.update(bottomMargin: 15)
if 0 <= indexPath.row && indexPath.row < templateArr.count { if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templateModel = templateArr[indexPath.row] cell.templateModel = templateArr[indexPath.row]
......
...@@ -203,7 +203,7 @@ extension YHResignTemplateSheetView: UITableViewDelegate, UITableViewDataSource ...@@ -203,7 +203,7 @@ extension YHResignTemplateSheetView: UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else { return UITableViewCell() }
cell.update(bottomMargin: 14) cell.update(bottomMargin: 14)
if 0 <= indexPath.row && indexPath.row < templateArr.count { if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templateModel = templateArr[indexPath.row] cell.templateModel = templateArr[indexPath.row]
......
...@@ -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
var params = [ guard var params = [
"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] ] as? [String: Any] else { return }
var info: [[String: Any]] = [] var info: [[String: Any]] = []
......
...@@ -254,7 +254,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie ...@@ -254,7 +254,7 @@ extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableVie
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as? YHCertificateTemplateCell else { return UITableViewCell() }
cell.update(bottomMargin: 15) cell.update(bottomMargin: 15)
if 0 <= indexPath.row && indexPath.row < templateArr.count { if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.resignUploadDetailTemplateListModel = templateArr[indexPath.row] cell.resignUploadDetailTemplateListModel = templateArr[indexPath.row]
......
...@@ -206,7 +206,7 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD ...@@ -206,7 +206,7 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if self.viewModel.mainModel.supplement_voucher_url.count == 0 { if self.viewModel.mainModel.supplement_voucher_url.count == 0 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadDocListCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadDocListCell guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadDocListCell.cellReuseIdentifier, for: indexPath) as? YHResignUploadDocListCell else { return UITableViewCell() }
approveCell.section = indexPath.section approveCell.section = indexPath.section
if indexPath.section == 0 { if indexPath.section == 0 {
approveCell.title = "资料上传" approveCell.title = "资料上传"
......
...@@ -126,7 +126,7 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -126,7 +126,7 @@ class YHResignUploadDocListCell: UITableViewCell {
make.right.equalTo(-18) make.right.equalTo(-18)
} }
} }
total = total + 1 total += 1
let itemView = YHResignUploadDocItemView() let itemView = YHResignUploadDocItemView()
itemView.clickBlock = {[weak self] model in itemView.clickBlock = {[weak self] model in
guard let self = self else { return } guard let self = self else { return }
...@@ -148,7 +148,7 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -148,7 +148,7 @@ class YHResignUploadDocListCell: UITableViewCell {
make.height.equalTo(height + 31) make.height.equalTo(height + 31)
make.right.equalTo(-18) make.right.equalTo(-18)
} }
total = total + Int(height + 31) total += Int(height + 31)
} }
} }
......
...@@ -157,7 +157,9 @@ extension YHResignUploadTravelCardListViewController: UITableViewDelegate, UITab ...@@ -157,7 +157,9 @@ extension YHResignUploadTravelCardListViewController: UITableViewDelegate, UITab
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelCardListTableViewCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadTravelCardListTableViewCell guard let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelCardListTableViewCell.cellReuseIdentifier, for: indexPath) as? YHResignUploadTravelCardListTableViewCell else {
return UITableViewCell()
}
approveCell.dataModel = viewModel.arrTravelDocs.list[indexPath.section] approveCell.dataModel = viewModel.arrTravelDocs.list[indexPath.section]
return approveCell return approveCell
} }
......
...@@ -237,13 +237,13 @@ extension YHResignUploadTravelHKViewController: UITableViewDelegate, UITableView ...@@ -237,13 +237,13 @@ extension YHResignUploadTravelHKViewController: UITableViewDelegate, UITableView
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as! YHTravelCertificateTipsCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHTravelCertificateTipsCell.cellReuseIdentifier, for: indexPath) as? YHTravelCertificateTipsCell else { return UITableViewCell() }
cell.userName = self.dataModel.name cell.userName = self.dataModel.name
cell.tipsArr = tipsArr cell.tipsArr = tipsArr
return cell return cell
} }
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelHKTableViewCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadTravelHKTableViewCell guard let cell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelHKTableViewCell.cellReuseIdentifier, for: indexPath) as? YHResignUploadTravelHKTableViewCell else { return UITableViewCell() }
cell.firstImageName = "service_adopter_card_travel_front" cell.firstImageName = "service_adopter_card_travel_front"
cell.lastImageName = "service_adopter_card_travel_back" cell.lastImageName = "service_adopter_card_travel_back"
cell.firstLabelName = "港澳通行证正面" cell.firstLabelName = "港澳通行证正面"
......
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