Commit 2e7f589c authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  //  UI
  // 赴港办证
  收入证明
  // 赴港办证UI
parents fa8c112c 6e08dfc9
......@@ -51,6 +51,13 @@
04256DE62C7310BE00A37BA4 /* YHSelectApplicantGroupCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DE52C7310BE00A37BA4 /* YHSelectApplicantGroupCell.swift */; };
04256DE82C7314B500A37BA4 /* YHSelectApplicantCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DE72C7314B500A37BA4 /* YHSelectApplicantCell.swift */; };
04256DEA2C73263A00A37BA4 /* YHInfoItemSelectSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DE92C73263A00A37BA4 /* YHInfoItemSelectSheetView.swift */; };
04256DEC2C732F6900A37BA4 /* YHGrabNumberListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DEB2C732F6900A37BA4 /* YHGrabNumberListView.swift */; };
04256DEE2C73338200A37BA4 /* YHGrabNumberListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DED2C73338200A37BA4 /* YHGrabNumberListCell.swift */; };
04256DF02C733B2D00A37BA4 /* YHGrabNumberInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DEF2C733B2D00A37BA4 /* YHGrabNumberInfoView.swift */; };
04256DF22C734E7E00A37BA4 /* YHGrabFileCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DF12C734E7E00A37BA4 /* YHGrabFileCell.swift */; };
04256DF42C73626900A37BA4 /* YHServiceSelectAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DF32C73626900A37BA4 /* YHServiceSelectAlertView.swift */; };
04256DF62C736A0800A37BA4 /* YHServiceItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DF52C736A0800A37BA4 /* YHServiceItemCell.swift */; };
04256DF82C73726C00A37BA4 /* YHCerAppointViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DF72C73726C00A37BA4 /* YHCerAppointViewModel.swift */; };
0425E63D2BA9345200A5E763 /* YHSchemeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */; };
0425E6402BA9357D00A5E763 /* YHScemeItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */; };
0425E6422BA95B1B00A5E763 /* YHSchemeTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */; };
......@@ -64,6 +71,11 @@
0430E6482C731B0A000511E2 /* YHAdopterAddNewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6472C731B0A000511E2 /* YHAdopterAddNewTableViewCell.swift */; };
0430E64A2C731E02000511E2 /* YHAdopterIncomeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6492C731E02000511E2 /* YHAdopterIncomeTableViewCell.swift */; };
0430E64C2C732821000511E2 /* YHNoAdopterAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E64B2C732821000511E2 /* YHNoAdopterAlertView.swift */; };
0430E64E2C733477000511E2 /* YHAdopterIncomeDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E64D2C733477000511E2 /* YHAdopterIncomeDetailViewController.swift */; };
0430E6502C73376A000511E2 /* YHAdopterIncomeTitleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E64F2C733769000511E2 /* YHAdopterIncomeTitleTableViewCell.swift */; };
0430E6522C733D82000511E2 /* YHAdopterIncomeFileTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6512C733D82000511E2 /* YHAdopterIncomeFileTableViewCell.swift */; };
0430E6542C73400A000511E2 /* YHAdopterUploadTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6532C73400A000511E2 /* YHAdopterUploadTableViewCell.swift */; };
0430E6562C7342AB000511E2 /* YHAdopterIncomeFileCountTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6552C7342AB000511E2 /* YHAdopterIncomeFileCountTableViewCell.swift */; };
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; };
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.swift */; };
......@@ -733,6 +745,13 @@
04256DE52C7310BE00A37BA4 /* YHSelectApplicantGroupCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectApplicantGroupCell.swift; sourceTree = "<group>"; };
04256DE72C7314B500A37BA4 /* YHSelectApplicantCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectApplicantCell.swift; sourceTree = "<group>"; };
04256DE92C73263A00A37BA4 /* YHInfoItemSelectSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInfoItemSelectSheetView.swift; sourceTree = "<group>"; };
04256DEB2C732F6900A37BA4 /* YHGrabNumberListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGrabNumberListView.swift; sourceTree = "<group>"; };
04256DED2C73338200A37BA4 /* YHGrabNumberListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGrabNumberListCell.swift; sourceTree = "<group>"; };
04256DEF2C733B2D00A37BA4 /* YHGrabNumberInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGrabNumberInfoView.swift; sourceTree = "<group>"; };
04256DF12C734E7E00A37BA4 /* YHGrabFileCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGrabFileCell.swift; sourceTree = "<group>"; };
04256DF32C73626900A37BA4 /* YHServiceSelectAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceSelectAlertView.swift; sourceTree = "<group>"; };
04256DF52C736A0800A37BA4 /* YHServiceItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceItemCell.swift; sourceTree = "<group>"; };
04256DF72C73726C00A37BA4 /* YHCerAppointViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCerAppointViewModel.swift; sourceTree = "<group>"; };
0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableViewCell.swift; sourceTree = "<group>"; };
0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScemeItemModel.swift; sourceTree = "<group>"; };
0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableFooterView.swift; sourceTree = "<group>"; };
......@@ -746,6 +765,11 @@
0430E6472C731B0A000511E2 /* YHAdopterAddNewTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterAddNewTableViewCell.swift; sourceTree = "<group>"; };
0430E6492C731E02000511E2 /* YHAdopterIncomeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterIncomeTableViewCell.swift; sourceTree = "<group>"; };
0430E64B2C732821000511E2 /* YHNoAdopterAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNoAdopterAlertView.swift; sourceTree = "<group>"; };
0430E64D2C733477000511E2 /* YHAdopterIncomeDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterIncomeDetailViewController.swift; sourceTree = "<group>"; };
0430E64F2C733769000511E2 /* YHAdopterIncomeTitleTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterIncomeTitleTableViewCell.swift; sourceTree = "<group>"; };
0430E6512C733D82000511E2 /* YHAdopterIncomeFileTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterIncomeFileTableViewCell.swift; sourceTree = "<group>"; };
0430E6532C73400A000511E2 /* YHAdopterUploadTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterUploadTableViewCell.swift; sourceTree = "<group>"; };
0430E6552C7342AB000511E2 /* YHAdopterIncomeFileCountTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterIncomeFileCountTableViewCell.swift; sourceTree = "<group>"; };
0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView.swift; sourceTree = "<group>"; };
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileMethodTableViewCell.swift; sourceTree = "<group>"; };
0435FA822BA2DEB100024EAE /* YHCardButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardButton.swift; sourceTree = "<group>"; };
......@@ -1504,6 +1528,7 @@
04256DD82C72D9F000A37BA4 /* VM */ = {
isa = PBXGroup;
children = (
04256DF72C73726C00A37BA4 /* YHCerAppointViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
......@@ -1522,8 +1547,14 @@
04256DE12C72E1EA00A37BA4 /* YHCertificateAppointOptionCell.swift */,
04256DE52C7310BE00A37BA4 /* YHSelectApplicantGroupCell.swift */,
04256DE72C7314B500A37BA4 /* YHSelectApplicantCell.swift */,
04256DED2C73338200A37BA4 /* YHGrabNumberListCell.swift */,
04256DF12C734E7E00A37BA4 /* YHGrabFileCell.swift */,
04256DF52C736A0800A37BA4 /* YHServiceItemCell.swift */,
04256DE32C72E3FA00A37BA4 /* YHInfoItemOptionView.swift */,
04256DE92C73263A00A37BA4 /* YHInfoItemSelectSheetView.swift */,
04256DEB2C732F6900A37BA4 /* YHGrabNumberListView.swift */,
04256DEF2C733B2D00A37BA4 /* YHGrabNumberInfoView.swift */,
04256DF32C73626900A37BA4 /* YHServiceSelectAlertView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -1583,6 +1614,10 @@
0430E6472C731B0A000511E2 /* YHAdopterAddNewTableViewCell.swift */,
0430E6492C731E02000511E2 /* YHAdopterIncomeTableViewCell.swift */,
0430E64B2C732821000511E2 /* YHNoAdopterAlertView.swift */,
0430E64F2C733769000511E2 /* YHAdopterIncomeTitleTableViewCell.swift */,
0430E6512C733D82000511E2 /* YHAdopterIncomeFileTableViewCell.swift */,
0430E6532C73400A000511E2 /* YHAdopterUploadTableViewCell.swift */,
0430E6552C7342AB000511E2 /* YHAdopterIncomeFileCountTableViewCell.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -1591,6 +1626,7 @@
isa = PBXGroup;
children = (
0430E6412C72E120000511E2 /* YHAddAdoptersViewController.swift */,
0430E64D2C733477000511E2 /* YHAdopterIncomeDetailViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -3895,6 +3931,7 @@
044867B82BA1C75700DFAD4A /* YHCertificateUploadFailTipsView.swift in Sources */,
04256DE02C72DC0600A37BA4 /* YHCertificateAppointOptionView.swift in Sources */,
044D0C062C22736F00C5CF5E /* YHSetExplainView.swift in Sources */,
04256DF02C733B2D00A37BA4 /* YHGrabNumberInfoView.swift in Sources */,
04213B252C48C15400797900 /* YHHomeIdentityViewController.swift in Sources */,
0472E25C2C521E64008EAB6E /* YHHomeIdentityListVC.swift in Sources */,
045EEF002B9F171A0022A143 /* YHFormItemEnterDetailCell.swift in Sources */,
......@@ -3913,6 +3950,7 @@
045EEEE52B9F171A0022A143 /* YHMySignatureDetailViewController.swift in Sources */,
A5ACE92F2B4564F7002C94D2 /* YHMyViewController.swift in Sources */,
A5ACE9332B4564F7002C94D2 /* NetBaseModel.swift in Sources */,
04256DF62C736A0800A37BA4 /* YHServiceItemCell.swift in Sources */,
A5FF0F3A2C32F20A0069852B /* YHActivityDetailCell0.swift in Sources */,
045EEE9B2B9F171A0022A143 /* YHWorkExperienceViewModel.swift in Sources */,
04AD31772C22DE6600DF5655 /* YHEditInterestViewController.swift in Sources */,
......@@ -3949,6 +3987,7 @@
04F5F86C2C1A9B52004A463C /* YHOtherServiceListViewController.swift in Sources */,
04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */,
045EEEA32B9F171A0022A143 /* YHCompanyModel.swift in Sources */,
0430E64E2C733477000511E2 /* YHAdopterIncomeDetailViewController.swift in Sources */,
045EEEC62B9F171A0022A143 /* YHOtherTextViewItemView.swift in Sources */,
046A95312C6EFB980059326A /* YHFamilyMemberRiskWarningAlertView.swift in Sources */,
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */,
......@@ -3961,6 +4000,7 @@
04256DD42C70538400A37BA4 /* YHFamilyInfoUpdateViewController.swift in Sources */,
04FD85702C21646200BEF9C5 /* YHMyInterestTopicCell.swift in Sources */,
04A7BD172BA43A0F00BD35A2 /* YHMyDocumentsDetailViewModel.swift in Sources */,
04256DF82C73726C00A37BA4 /* YHCerAppointViewModel.swift in Sources */,
045EEEB32B9F171A0022A143 /* YHWorkFileSyncTableViewCell.swift in Sources */,
045EEEF12B9F171A0022A143 /* YHChildInfoContainerVC.swift in Sources */,
045EEF0B2B9F171A0022A143 /* YHBasicInfoFillViewController.swift in Sources */,
......@@ -3995,6 +4035,7 @@
A53B61122BB128AF0010B573 /* YHFileListItemsView2.swift in Sources */,
044D0BF62C2154CA00C5CF5E /* YHAllowUseMyInfoViewController.swift in Sources */,
0485DFE12C6A0B6200B50293 /* YHPrincipleApprovedResultVC.swift in Sources */,
04256DF42C73626900A37BA4 /* YHServiceSelectAlertView.swift in Sources */,
04F5F8702C1AC4C2004A463C /* YHHKEventWebViewController.swift in Sources */,
045EEE892B9F171A0022A143 /* YHPreviewBaseViewController.swift in Sources */,
045EEEA42B9F171A0022A143 /* YHImageResultViewController.swift in Sources */,
......@@ -4019,6 +4060,7 @@
04FD856C2C2153F000BEF9C5 /* YHMyEducationCell.swift in Sources */,
A5DE0D3C2BB9016200976FE1 /* YHEmailInputAlertView.swift in Sources */,
04256DE42C72E3FA00A37BA4 /* YHInfoItemOptionView.swift in Sources */,
04256DF22C734E7E00A37BA4 /* YHGrabFileCell.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
04FD85662C2124AF00BEF9C5 /* YHNameCardViewController.swift in Sources */,
0430E63B2C6DA106000511E2 /* CGFloat+Extention.swift in Sources */,
......@@ -4170,6 +4212,7 @@
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */,
04256DD02C7041C700A37BA4 /* YHInfoItemView.swift in Sources */,
A5ACE9312B4564F7002C94D2 /* YHPersonalCenterCell.swift in Sources */,
0430E6562C7342AB000511E2 /* YHAdopterIncomeFileCountTableViewCell.swift in Sources */,
045EEE9A2B9F171A0022A143 /* YHWorkIntroductionViewModel.swift in Sources */,
044D0C1C2C22C30B00C5CF5E /* YHEditSchoolViewController.swift in Sources */,
A5ACE9532B4564F7002C94D2 /* YHBaseViewController.swift in Sources */,
......@@ -4204,6 +4247,7 @@
A5EF21332BA6E030005027E6 /* YHFileListViewController.swift in Sources */,
045EEF1E2B9F171A0022A143 /* YHBottomNextView.swift in Sources */,
A567E59E2BD7643D00D5D5A0 /* YHHomePageViewController.swift in Sources */,
0430E6502C73376A000511E2 /* YHAdopterIncomeTitleTableViewCell.swift in Sources */,
0485DFD82C66036600B50293 /* YHPrincipleFileRenameView.swift in Sources */,
045EEEBA2B9F171A0022A143 /* YHWorkResponsibilitiesTableViewCell.swift in Sources */,
047AA3ED2C4A70F6009C4554 /* YHHeadView.swift in Sources */,
......@@ -4220,6 +4264,7 @@
04CE1AD22C2AD91F001CB80A /* YHActivityModel.swift in Sources */,
0445E6AF2BE9CFF6003C52F9 /* YHAppVersionForceUpdateView.swift in Sources */,
04213B272C48C95E00797900 /* YHHomeIdentityCell.swift in Sources */,
0430E6542C73400A000511E2 /* YHAdopterUploadTableViewCell.swift in Sources */,
04CE1AD32C2AD91F001CB80A /* YHTravelModel.swift in Sources */,
04213B372C4F87C600797900 /* YHHomeLifeCategoryDetailModel.swift in Sources */,
04B9EE5A2C06CC3100A4018D /* YHCodeSueecssViewController.swift in Sources */,
......@@ -4254,6 +4299,7 @@
044D0C1A2C22B40B00C5CF5E /* YHEditPersonalProfileViewController.swift in Sources */,
047AA3E82C4A6D69009C4554 /* YHListViewController.swift in Sources */,
048787D92BCF68530036E221 /* YHProgressView.swift in Sources */,
04256DEE2C73338200A37BA4 /* YHGrabNumberListCell.swift in Sources */,
045EEEEC2B9F171A0022A143 /* YHBrotherInfoVC.swift in Sources */,
0477E17A2BA41C7E00436346 /* YHCertificateModel.swift in Sources */,
045EEF242B9F171A0022A143 /* YHStepView.swift in Sources */,
......@@ -4334,6 +4380,7 @@
045EEEEB2B9F171A0022A143 /* YHTest.swift in Sources */,
04CE1AD12C2AD91F001CB80A /* YHActivityTravelModel.swift in Sources */,
044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */,
04256DEC2C732F6900A37BA4 /* YHGrabNumberListView.swift in Sources */,
045EEEAC2B9F171A0022A143 /* YHWorkExperienceTableViewCell.swift in Sources */,
A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */,
A567E5A82BD7643D00D5D5A0 /* YHHomeWebBottomButton.swift in Sources */,
......@@ -4393,6 +4440,7 @@
04C85DE32C368B45008B20D6 /* YHMyFileListViewController.swift in Sources */,
045EEEF82B9F171A0022A143 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */,
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */,
0430E6522C733D82000511E2 /* YHAdopterIncomeFileTableViewCell.swift in Sources */,
045EEE8B2B9F171A0022A143 /* YHPreviewMainApplicantInfoViewController.swift in Sources */,
045EEE922B9F171A0022A143 /* YHPreviewInfoNameAndSubNameItemView.swift in Sources */,
0430E6482C731B0A000511E2 /* YHAdopterAddNewTableViewCell.swift in Sources */,
......
......@@ -116,9 +116,33 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc
return cell
} else if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterAddNewTableViewCell.self)
cell.newAdopterBlock = {[weak self] in
guard let self = self else { return }
let items = [YHCertificateEditItem(type:.rename, title:"新增配偶"),
YHCertificateEditItem(type:.preview, title:"新增子女"),
YHCertificateEditItem(type:.cancel, title:"取消")]
YHCertificateEditSheetView.sheetView(items:items) {
[weak self] editType in
guard let self = self else { return }
if editType == .rename {
}
if editType == .preview {
}
if editType == .delete {
}
}.show()
}
return cell
} else {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeTableViewCell.self)
cell.clickBlock = { [weak self] index in
guard let self = self else { return }
let vc = YHAdopterIncomeDetailViewController()
self.navigationController?.pushViewController(vc)
}
return cell
}
......
//
// YHAdopterIncomeDetailViewController.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterIncomeDetailViewController: YHBaseViewController {
var tableView: UITableView!
var nextButton: UIButton!
var clickIndex = -1
var file: [YHWorkExperienceFileModel] = []
var viewModel = YHBaseViewModel()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "上传存款证明"
setView()
getData()
}
func getData() {
tableView.reloadData()
}
func setView() {
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHAdopterIncomeTitleTableViewCell.self)
tableView.register(cellWithClass: YHAdopterIncomeFileTableViewCell.self)
tableView.register(cellWithClass: YHAdopterUploadTableViewCell.self)
tableView.register(cellWithClass: YHAdopterIncomeFileCountTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 8)
make.bottom.left.right.equalTo(view)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("确认", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
return button
}()
view.addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom())
make.height.equalTo(48)
}
}
@objc func nextStep() {
}
@objc func submit() {
}
func uploadImage(_ img: UIImage, imageName:String, callBack:((Bool, String)->())?) {
// 先OSS上传得到URL
self.viewModel.uploadImage(img) {
[weak self] url, error in
guard self != nil else { return }
if let url = url, !url.isEmpty {
callBack?(true, url)
return
}
callBack?(false, "")
}
}
func uploadFile(_ fileUrl:URL) {
if let fileData = try? Data(contentsOf: fileUrl) {
// 将文件数据上传到服务器
let size = String(format: "%.2fM", Double(fileData.count)/(1024.0 * 1024.0))
// print("\(size)")
// 先OSS上传得到URL
YHHUD.show(.progress(message: "上传中..."))
self.viewModel.uploadFile(fileUrl.absoluteString) {
[weak self] successUrl, error in
YHHUD.hide()
guard let self = self else { return }
// 再调用业务接口
if let successUrl = successUrl, !successUrl.isEmpty {
var fileName = fileUrl.lastPathComponent
if fileName.isEmpty {
fileName = successUrl.lastPathComponent
}
let suffixName = successUrl.pathExtension.lowercased()
let timestamp = Date().timeIntervalSince1970
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy.MM.dd HH:mm:ss"
let currentDate = Date()
let formattedDate = dateFormatter.string(from: currentDate)
let model = YHWorkExperienceFileModel()
model.fileUrl = successUrl
model.fileName = fileName
model.uploadedAt = formattedDate
self.file.append(model)
self.tableView.reloadData()
YHHUD.flash(message: "上传成功")
return
}
var msg = "上传文件失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg
}
YHHUD.flash(message: msg)
}
} else {
YHHUD.flash(message: "识别文件失败")
}
}
}
extension YHAdopterIncomeDetailViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 4
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeTitleTableViewCell.self)
return cell
}
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeFileTableViewCell.self)
cell.dataSource = self.file
return cell
}
if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterUploadTableViewCell.self)
cell.newFileBlock = {[weak self] in
guard let self = self else { return }
let count = self.file.count
if count >= 10 {
YHHUD.flash(message: "最多上传10个图片或文件")
return
}
var maxCount = 10 - count
if maxCount > 9 {
maxCount = 9
}
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectImageCount = maxCount
sheetView.uploadFilesBlock = {
[weak self] fileUrl in
guard let self = self else { return }
print(fileUrl)
uploadFile(fileUrl)
}
sheetView.uploadImageBlock = {
[weak self] imgArr in
guard let self = self else { return }
let group = DispatchGroup()
var successArr:[String] = []
var failArr:[YHSelectImageItem] = []
YHHUD.show(.progress(message: "上传中..."))
for item in imgArr {
if let image = item.data {
group.enter()
uploadImage(image, imageName:item.name) {
success, url in
if success {
successArr.append(url)
} else {
failArr.append(item)
}
group.leave()
}
}
}
// 等待所有任务完成
group.notify(queue: .main) {
YHHUD.hide()
// 所有任务完成,回到主线程继续执行
if imgArr.count == successArr.count {
YHHUD.flash(message: "上传成功")
for item in successArr {
let timestamp = Date().timeIntervalSince1970
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy.MM.dd HH:mm:ss"
let currentDate = Date()
let formattedDate = dateFormatter.string(from: currentDate)
let model = YHWorkExperienceFileModel()
model.fileUrl = item
model.fileName = "\(UInt64(timestamp))" + ".jpg"
model.uploadedAt = formattedDate
self.file.append(model)
}
self.tableView.reloadData()
} else {
YHHUD.flash(message: "\(successArr.count)张照片上传成功\n\(failArr.count)张照片上传失败")
}
}
}
sheetView.show()
}
return cell
}
if indexPath.row == 3 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeFileCountTableViewCell.self)
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 119
}
if indexPath.row == 1 {
let count = self.file.count
if count == 0 {
return 0
} else {
return CGFloat(55 * count + 16)
}
}
if indexPath.row == 2 {
return 71
}
return 45
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
......@@ -11,11 +11,11 @@ import UIKit
class YHAdopterAddNewTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ model: YHWorkItemListModel) -> ()
typealias IsMoreBlock = (_ isMore: Bool) -> ()
typealias NewWorkBlock = () -> ()
typealias NewAdopterBlock = () -> ()
var clickBlock: ExperienceListBlock?
var deleteBlock: ExperienceListBlock?
var isMoreBlock: IsMoreBlock?
var newWorkBlock: NewWorkBlock?
var newAdopterBlock: NewAdopterBlock?
var centerView: UIView!
var titleLabel: UILabel!
var cannalButton: UIButton!
......@@ -143,7 +143,7 @@ class YHAdopterAddNewTableViewCell: UITableViewCell {
view.addBtn.setTitle("新增受养人".local, for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.newWorkBlock {
if let block = self.newAdopterBlock {
block()
}
}
......
//
// YHAdopterIncomeFileCountTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHAdopterIncomeFileCountTableViewCell: UITableViewCell {
var alertLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
alertLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.mainTextColor50
label.textAlignment = .center
label.numberOfLines = 0
let a: ASAttributedString = .init("已上传 ", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.labelTextColor2))
let b: ASAttributedString = .init(" 0/10", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex: 0x222222)))
let c: ASAttributedString = .init(" 张图片或文件", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.labelTextColor2))
label.attributed.text = a + b + c
return label
}()
contentView.addSubview(alertLabel)
alertLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.bottom.equalTo(0)
make.right.equalTo(-18)
}
}
}
//
// YHAdopterIncomeFileTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterIncomeFileTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> ()
typealias AddIntroductionBlock = () -> ()
var experienceListBlock: ExperienceListBlock?
var selectIntroductionBlock: AddIntroductionBlock?
var mainItemView: UIView!
var dataSource: [YHWorkExperienceFileModel]?{
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
mainItemView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
contentView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
make.top.equalTo(16)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
for i in 0 ..< (dataSource?.count ?? 0) {
let itemView = YHWorkFileItemView()
itemView.backgroundColor = UIColor.pageBkgColor
itemView.dataSource = dataSource?[i]
itemView.block = {[weak self] model, type in
guard let self = self else { return }
if let block = self.experienceListBlock {
block(model, type)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(55 * i)
make.height.equalTo(55)
}
}
}
}
//
// YHAdopterIncomeTitleTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterIncomeTitleTableViewCell: UITableViewCell {
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var alertLabel: UILabel!
var failLabel: UILabel!
var failImageView: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "存款证明"
return label
}()
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
}
subTitleLabel = {
let label = UILabel()
label.text = "已完成"
label.font = UIFont.PFSC_R(ofSize: 10)
label.textColor = UIColor(hex: 0x3cc694)
label.backgroundColor = UIColor(hex: 0xf0fbf7)
//带上传
// label.textColor = UIColor.brandMainColor
// label.backgroundColor = UIColor(hex: 0xf0f4fb)
//审核中
// label.textColor = UIColor(hex: 0xff8000)
// label.backgroundColor = UIColor(hex: 0xfff5eb)
//已驳回
// label.textColor = UIColor(hex: 0xf81d22)
// label.backgroundColor = UIColor(hex: 0xfff2f2)
return label
}()
contentView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(titleLabel.snp.right).offset(4)
make.width.equalTo(38)
make.height.equalTo(16)
make.centerY.equalTo(titleLabel.snp.centerY)
}
alertLabel = {
let label = UILabel()
label.text = "存款证明有效期为3个月,并且存款金额为每个成员(包括额外新增受养人)最低为12万"
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor50
label.numberOfLines = 0
return label
}()
contentView.addSubview(alertLabel)
alertLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(46)
make.right.equalTo(-18)
}
failLabel = {
let label = UILabel()
label.text = "驳回原因:存款证明钱不够"
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor(hex: 0xf81d22)
return label
}()
contentView.addSubview(failLabel)
failLabel.snp.makeConstraints { make in
make.left.equalTo(36)
make.bottom.equalTo(0)
make.height.equalTo(17)
make.right.equalToSuperview()
}
failImageView = {
let view = UIImageView()
view.image = UIImage(named: "service_adopter_income_fail")
return view
}()
contentView.addSubview(failImageView)
failImageView.snp.makeConstraints { make in
make.left.equalTo(20)
make.width.height.equalTo(12)
make.centerY.equalTo(failLabel.snp.centerY)
}
}
}
//
// YHAdopterUploadTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterUploadTableViewCell: UITableViewCell {
typealias NewFileBlock = () -> ()
var newFileBlock: NewFileBlock?
var bottomView: YHWorkItemAddView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
bottomView = {
let view = YHWorkItemAddView()
view.addBtn.setTitle("上传".local, for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.newFileBlock {
block()
}
}
return view
}()
contentView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(18)
make.height.equalTo(45)
make.bottom.equalToSuperview()
}
}
}
......@@ -10,7 +10,9 @@ import UIKit
class YHCertificateAppointViewController: YHBaseViewController {
var items = ["", ""]
var items = ["", "", ""]
let viewModel = YHCerAppointViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 16.0
......@@ -21,9 +23,11 @@ class YHCertificateAppointViewController: YHBaseViewController {
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor(hex: 0xF8F9FB)
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateAppointOptionCell.self, forCellReuseIdentifier: YHCertificateAppointOptionCell.cellReuseIdentifier)
tableView.register(YHSelectApplicantGroupCell.self, forCellReuseIdentifier: YHSelectApplicantGroupCell.cellReuseIdentifier)
tableView.register(YHGrabNumberListCell.self, forCellReuseIdentifier: YHGrabNumberListCell.cellReuseIdentifier)
return tableView
}()
......@@ -60,8 +64,13 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHSelectApplicantGroupCell.cellReuseIdentifier, for: indexPath) as! YHSelectApplicantGroupCell
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHSelectApplicantGroupCell.cellReuseIdentifier, for: indexPath) as! YHSelectApplicantGroupCell
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHGrabNumberListCell.cellReuseIdentifier, for: indexPath) as! YHGrabNumberListCell
return cell
}
......@@ -71,6 +80,16 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.viewModel.getServicelist { success, error in
let view = YHServiceSelectAlertView.alertView()
view.items = self.viewModel.serviceArr
view.confirmBlock = {
[weak self] ids in
printLog("\(ids)")
}
view.show()
}
if 0 <= indexPath.section && indexPath.section < items.count {
}
......
//
// YHGrabFileCell.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGrabFileCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHGrabFileCell"
lazy var selectImgView:UIImageView = {
let view = UIImageView(image: UIImage(named: ""))
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.layer.cornerRadius = 5.0
self.layer.borderWidth = 0.5
self.layer.borderColor = UIColor.init(hex: 0xD8D8D8).cgColor
}
}
//
// YHGrabNumberInfoView.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
enum YHGrabItemViewType: Int {
case info
case grab
case files
}
class YHGrabItem {
var type: YHGrabItemViewType = .info
var title: String = ""
var detail: String = ""
var files:[String] = []
required init() {
}
init(type: YHGrabItemViewType, title: String, detail: String, files:[String] = []) {
self.type = type
self.title = title
self.detail = detail
self.files = files
}
}
class YHGrabNumberInfoItemView: UIView {
let dotWidth = 4.0
let titleMaxWidth = 112.0
let grabNumColor = UIColor.brandMainColor
let infoColor = UIColor.mainTextColor
let gap = 8.0
let fileWidth = floorl((KScreenWidth-48.0*2.0-8.0*3.0)/4.0)
var item: YHGrabItem = YHGrabItem()
lazy var collectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .vertical
layout.minimumInteritemSpacing = 8.0
layout.minimumLineSpacing = 16
let collectView = UICollectionView(frame:.zero, collectionViewLayout: layout)
collectView.delegate = self
collectView.dataSource = self
collectView.backgroundColor = .clear
// 注册自定义单元格
collectView.register(YHGrabFileCell.self, forCellWithReuseIdentifier: YHGrabFileCell.cellReuseIdentifier)
return collectView
}()
func updateItem(_ item: YHGrabItem) {
self.item = item
titleLabel.text = item.title
detailLabel.text = item.detail
if item.type == .grab {
detailLabel.textColor = grabNumColor
} else {
detailLabel.textColor = infoColor
}
dotView.isHidden = (item.type != .grab)
collectionView.isHidden = item.type != .files
collectionView.reloadData()
var rowCount = item.files.count/4
if item.files.count%4 != 0 {
rowCount += 1
}
collectionView.snp.remakeConstraints { make in
make.left.right.bottom.equalTo(0)
make.top.equalTo(detailLabel.snp.bottom).offset(16)
if item.type == .files {
make.height.equalTo((fileWidth+16.0)*Double(rowCount))
} else {
make.height.equalTo(0)
}
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
lazy var dotView: UIView = {
let view = UIView()
view.backgroundColor = .brandMainColor
view.layer.cornerRadius = self.dotWidth/2.0
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .mainTextColor(alpha: 0.5)
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.textAlignment = .right
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = self.infoColor
return label
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(titleLabel)
self.addSubview(detailLabel)
self.addSubview(dotView)
self.addSubview(collectionView)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(0)
make.width.equalTo(titleMaxWidth)
}
detailLabel.snp.makeConstraints { make in
make.right.equalTo(0)
make.top.equalTo(0)
make.height.greaterThanOrEqualTo(20.0)
}
dotView.snp.makeConstraints { make in
make.width.height.equalTo(dotWidth)
make.centerY.equalTo(detailLabel)
make.right.equalTo(detailLabel.snp.left).offset(-4)
make.left.greaterThanOrEqualTo(titleLabel.snp.right).offset(0)
}
collectionView.snp.makeConstraints { make in
make.left.right.equalTo(0)
make.top.equalTo(detailLabel.snp.bottom).offset(16)
make.height.equalTo(fileWidth)
make.bottom.equalTo(0)
}
}
}
class YHGrabNumberInfoView: UIView {
var items:[YHGrabItem] = []
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.backgroundColor = UIColor.init(hex: 0xF8F9FB)
self.layer.cornerRadius = kCornerRadius4
self.clipsToBounds = true
self.addSubview(titleLabel)
self.addSubview(lineView)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(14)
make.top.equalTo(16)
}
lineView.snp.makeConstraints { make in
make.left.equalTo(14)
make.right.equalTo(-14)
make.height.equalTo(0.5)
make.top.equalTo(titleLabel.snp.bottom).offset(10)
}
}
func updateItems(_ items: [YHGrabItem]) {
self.items = items
var lastView: YHGrabNumberInfoItemView? = nil
for (index, item) in items.enumerated() {
let itemView = YHGrabNumberInfoItemView(frame: .zero)
self.addSubview(itemView)
itemView.updateItem(item)
itemView.snp.makeConstraints { make in
make.left.equalTo(14)
make.right.equalTo(-14)
if let last = lastView {
make.top.equalTo(last.snp.bottom).offset(0)
} else {
make.top.equalTo(lineView.snp.bottom).offset(12)
}
if index == items.count-1 {
make.bottom.equalTo(0)
}
}
lastView = itemView
}
}
}
extension YHGrabNumberInfoItemView: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
// 返回单元格数量
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return item.files.count
}
// 返回每个单元格的大小
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: fileWidth, height: fileWidth)
}
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHGrabFileCell.cellReuseIdentifier, for: indexPath) as! YHGrabFileCell
if 0 <= indexPath.item && indexPath.item < item.files.count {
let applicant = item.files[indexPath.item]
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < item.files.count {
let text = item.files[indexPath.item]
}
}
}
//
// YHGrabNumberListCell.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGrabNumberListCell: UITableViewCell {
static let cellReuseIdentifier = "YHGrabNumberListCell"
var items:[String] = ["", ""]
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.textColor = .mainTextColor
label.font = UIFont.PFSC_M(ofSize: 17)
label.text = "赴港办理抢号中批次"
return label
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(lineView)
whiteContentView.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(0)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(18)
make.left.equalTo(18)
make.right.equalTo(-18)
}
lineView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
}
var lastView: YHGrabNumberListView? = nil
for (index, _) in items.enumerated() {
let listView = YHGrabNumberListView(frame: .zero)
let chineseNum = convertNumberToChineseText(index+1)
listView.titleLabel.text = "第\(chineseNum)批"
listView.membersLabel.text = "成员:刘德华德成员:刘德华德、刘德华德、刘德华德、刘德华德、刘德华德、刘德华德、刘德华德、刘德华德、刘德华德"
whiteContentView.addSubview(listView)
listView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
if let last = lastView {
make.top.equalTo(last.snp.bottom)
} else {
make.top.equalTo(lineView.snp.bottom)
}
if index == items.count-1 {
make.bottom.equalTo(-16)
}
}
lastView = listView
}
}
//阿拉伯数字转文字
func convertNumberToChineseText(_ number: Int) -> String {
let numberFormatter = NumberFormatter()
numberFormatter.locale = Locale(identifier: "zh_CN")
numberFormatter.numberStyle = .spellOut
return numberFormatter.string(from: NSNumber(value: number)) ?? ""
}
}
//
// YHGrabNumberListView.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGrabNumberListView: UIView {
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var markView:UIView = {
let view = UIView()
view.backgroundColor = .brandMainColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 16)
label.textColor = .mainTextColor
return label
}()
lazy var cancelAppointBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .white
btn.titleLabel?.font = .PFSC_M(ofSize: 12)
btn.setTitle("取消预约", for: .normal)
btn.setTitleColor(.brandMainColor, for: .normal)
btn.layer.cornerRadius = kCornerRadius3
btn.layer.borderWidth = 1.0
btn.layer.borderColor = UIColor.brandMainColor.cgColor
return btn
}()
lazy var membersLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
label.text = "成员:"
label.textColor = .mainTextColor(alpha: 0.7)
return label
}()
lazy var grabInfoView: YHGrabNumberInfoView = {
let view = YHGrabNumberInfoView(frame: .zero)
view.titleLabel.text = "抢号信息"
let items = [YHGrabItem(type: .grab, title: "赴港时间:", detail: "抢号中"),
YHGrabItem(type: .grab, title: "香港入境处:", detail: "抢号中"),
YHGrabItem(type: .grab, title: "抢号反馈回执:", detail: "抢号中"),]
view.updateItems(items)
return view
}()
lazy var intentionInfoView: UIView = {
let view = YHGrabNumberInfoView(frame: .zero)
view.titleLabel.text = "意向信息"
let items = [YHGrabItem(type: .info, title: "期望赴港时间:", detail: "2023-07-17 ~ 2023-08-22"),
YHGrabItem(type: .info, title: "期望香港办证点:", detail: "屯门办事处(屯门)"),
YHGrabItem(type: .files, title: "抢号反馈回执:", detail: "", files: ["","","","",""]),]
view.updateItems(items)
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(lineView)
self.addSubview(markView)
self.addSubview(titleLabel)
self.addSubview(cancelAppointBtn)
self.addSubview(membersLabel)
self.addSubview(grabInfoView)
self.addSubview(intentionInfoView)
lineView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(0.5)
}
cancelAppointBtn.snp.makeConstraints { make in
make.top.equalTo(12)
make.right.equalTo(-18)
make.size.equalTo(CGSizeMake(70, 32))
}
markView.snp.makeConstraints { make in
make.size.equalTo(CGSizeMake(3, 14))
make.left.equalTo(0)
make.centerY.equalTo(cancelAppointBtn)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(markView.snp.right).offset(6)
make.height.equalTo(22)
make.centerY.equalTo(cancelAppointBtn)
}
membersLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
grabInfoView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(membersLabel.snp.bottom).offset(16)
// make.height.equalTo(166)
}
intentionInfoView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(grabInfoView.snp.bottom).offset(16)
// make.height.equalTo(130)
make.bottom.equalTo(-16)
}
}
}
//
// YHServiceItemCell.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHServiceItemCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHServiceItemCell"
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 13)
label.textColor = .mainTextColor
label.textAlignment = .center
return label
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func updateItem(_ item: YHServiceItem) {
titleLabel.text = item.name
if item.isSelect {
self.layer.borderWidth = 1.0
self.layer.borderColor = UIColor.brandMainColor.cgColor
titleLabel.textColor = UIColor.brandMainColor
} else {
self.layer.borderWidth = 0.0
self.layer.borderColor = nil
titleLabel.textColor = UIColor.mainTextColor
}
}
func createUI() {
self.layer.cornerRadius = kCornerRadius3
self.backgroundColor = UIColor.init(hex: 0xF4F6FA)
self.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
}
}
//
// YHServiceSelectAlertView.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
import SmartCodable
class YHServiceItem: SmartCodable {
var id: Int = 0
var name: String = ""
var isSelect: Bool = false
required init() {
}
init(id: Int = 0, name: String = "") {
self.id = id
self.name = name
}
}
class YHServiceSelectAlertView: UICollectionViewCell {
var items:[YHServiceItem] = [] {
didSet {
var rowCount = items.count/3
if items.count%3 != 0 {
rowCount += 1
}
var height = 0.0
if rowCount > 0 {
height = 42.0 * Double(rowCount) + 16.0 * Double(rowCount-1)
}
collectionView.reloadData()
collectionView.snp.updateConstraints { make in
make.height.equalTo(height)
}
}
}
var confirmBlock:(([Int])->())?
// 底层蒙版
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = .alertMaskColor
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
lazy var bgImgView: UIView = {
let view = UIImageView(image: UIImage(named: "service_list_bg"))
return view
}()
lazy var iconImgView: UIView = {
let view = UIImageView(image: UIImage(named: "service_list_icon"))
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("期望银河在", .font(UIFont.PFSC_B(ofSize: 18)),.foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("办证阶段", .font(UIFont.PFSC_B(ofSize: 18)),.foreground(UIColor.brandMainColor))
let c: ASAttributedString = .init("\n提供哪些服务", .font(UIFont.PFSC_B(ofSize: 18)),.foreground(UIColor.mainTextColor))
label.attributed.text = a+b+c
return label
}()
lazy var collectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .vertical
layout.minimumInteritemSpacing = 8.0
layout.minimumLineSpacing = 16
let collectView = UICollectionView(frame:.zero, collectionViewLayout: layout)
collectView.delegate = self
collectView.dataSource = self
collectView.backgroundColor = .clear
// 注册自定义单元格
collectView.register(YHServiceItemCell.self, forCellWithReuseIdentifier: YHServiceItemCell.cellReuseIdentifier)
return collectView
}()
lazy var confirmBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .brandMainColor
btn.titleLabel?.font = .PFSC_M(ofSize: 14)
btn.setTitle("确认", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.layer.cornerRadius = kCornerRadius3
btn.addTarget(self, action: #selector(didConfirmBtnClicked), for: .touchUpInside)
return btn
}()
lazy var closeBtn:UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named: "update_close"), for: .normal)
btn.addTarget(self, action: #selector(didCloseBtnClicked), for: .touchUpInside)
return btn
}()
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
func createUI() {
self.addSubview(blackMaskView)
self.addSubview(whiteContentView)
self.addSubview(closeBtn)
whiteContentView.addSubview(bgImgView)
whiteContentView.addSubview(iconImgView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(confirmBtn)
whiteContentView.addSubview(collectionView)
whiteContentView.addSubview(confirmBtn)
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(38)
make.right.equalTo(-38)
make.centerX.equalToSuperview()
make.centerY.equalToSuperview().offset(-24)
}
bgImgView.snp.makeConstraints { make in
make.left.right.top.equalTo(0)
make.height.equalTo(153)
}
iconImgView.snp.makeConstraints { make in
make.width.equalTo(102)
make.height.equalTo(84)
make.top.equalTo(16)
make.right.equalTo(-16)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(34)
make.left.equalTo(18)
make.right.equalTo(iconImgView.snp.left)
}
collectionView.snp.makeConstraints { make in
make.top.equalTo(iconImgView.snp.bottom).offset(20)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(0)
make.bottom.equalTo(confirmBtn.snp.top).offset(-30)
}
confirmBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-16)
make.height.equalTo(45)
}
closeBtn.snp.makeConstraints { make in
make.width.height.equalTo(24)
make.top.equalTo(whiteContentView.snp.bottom).offset(24)
make.centerX.equalTo(whiteContentView)
}
}
static func alertView() -> YHServiceSelectAlertView {
let alertView = YHServiceSelectAlertView(frame:UIScreen.main.bounds)
return alertView
}
@objc func show() {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
@objc func dismiss() {
self.removeFromSuperview()
}
@objc func didConfirmBtnClicked() {
var ids = [Int]()
for item in items {
if item.isSelect {
ids.append(item.id)
}
}
confirmBlock?(ids)
dismiss()
}
@objc func didCloseBtnClicked() {
dismiss()
}
}
extension YHServiceSelectAlertView: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
// 返回单元格数量
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
// 返回每个单元格的大小
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let width = floorl((KScreenWidth-54.0*2.0-10.0*2.0)/3.0)
return CGSize(width: width, height: 42)
}
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceItemCell.cellReuseIdentifier, for: indexPath) as! YHServiceItemCell
if 0 <= indexPath.item && indexPath.item < items.count {
let item = items[indexPath.item]
cell.updateItem(item)
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < items.count {
let item = items[indexPath.item]
item.isSelect = !item.isSelect
collectionView.reloadData()
}
}
}
//
// YHCerAppointViewModel.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCerAppointViewModel: NSObject {
var serviceArr:[YHServiceItem] = []
func getServicelist(_ callBack: @escaping (_ success: Bool,_ error: YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.MakeCertificate.servicelist
let _ = YHNetRequest.getRequest(url: strUrl) {
[weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog(json)
if json.code == 200 {
let dic = json.data
guard let list = [YHServiceItem].deserialize(array: dic as? [Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
self.serviceArr = []
callBack(false, err)
return
}
self.serviceArr.removeAll()
for item in list {
if let item = item {
self.serviceArr.append(item)
}
}
callBack(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
self.serviceArr = []
callBack(false, error)
}
} failBlock: { err in
self.serviceArr = []
callBack(false, err)
}
}
}
......@@ -19,5 +19,6 @@ class YHFileListModel: SmartCodable {
var arrTxt : [String] = [] //type=1时使用的内容
required init() {
}
}
......@@ -341,6 +341,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
}
if true {
// test dy
let vc = YHCertificateAppointViewController()
self.navigationController?.pushViewController(vc)
return
......
......@@ -403,4 +403,10 @@ class YHAllApiName {
static let sendMail = "infoflow/file/send-mail"
}
struct MakeCertificate {
// 获取香港服务列表
static let servicelist = "super-app/order/customer/journey/journey-service"
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Mask group@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Mask group@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033195689@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033195689@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_adopter_income_fail@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_adopter_income_fail@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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