Commit 3e25de7a 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:
  新增受养人部分接口调试
  //  赴港
  //  赴港
parents a1e323ca f4b6313e
...@@ -123,12 +123,15 @@ ...@@ -123,12 +123,15 @@
0430E6862C76DF6A000511E2 /* YHAdopterMainModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6852C76DF6A000511E2 /* YHAdopterMainModel.swift */; }; 0430E6862C76DF6A000511E2 /* YHAdopterMainModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6852C76DF6A000511E2 /* YHAdopterMainModel.swift */; };
0430E6882C771B06000511E2 /* YHAdopterItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6872C771B06000511E2 /* YHAdopterItemView.swift */; }; 0430E6882C771B06000511E2 /* YHAdopterItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6872C771B06000511E2 /* YHAdopterItemView.swift */; };
0430E68A2C77415D000511E2 /* YHAdopterAddModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6892C77415D000511E2 /* YHAdopterAddModel.swift */; }; 0430E68A2C77415D000511E2 /* YHAdopterAddModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E6892C77415D000511E2 /* YHAdopterAddModel.swift */; };
0430E68C2C786257000511E2 /* YHAdopterIncomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E68B2C786257000511E2 /* YHAdopterIncomeViewModel.swift */; };
0430E68E2C7875F4000511E2 /* YHAdopterDependentDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0430E68D2C7875F4000511E2 /* YHAdopterDependentDataModel.swift */; };
04358E042C77322700811928 /* YHHaveGrabbedNumberListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E032C77322700811928 /* YHHaveGrabbedNumberListCell.swift */; }; 04358E042C77322700811928 /* YHHaveGrabbedNumberListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E032C77322700811928 /* YHHaveGrabbedNumberListCell.swift */; };
04358E062C77334B00811928 /* YHHaveGrabbedNumberInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E052C77334B00811928 /* YHHaveGrabbedNumberInfoView.swift */; }; 04358E062C77334B00811928 /* YHHaveGrabbedNumberInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E052C77334B00811928 /* YHHaveGrabbedNumberInfoView.swift */; };
04358E082C77657000811928 /* YHReAppointViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E072C77657000811928 /* YHReAppointViewController.swift */; }; 04358E082C77657000811928 /* YHReAppointViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E072C77657000811928 /* YHReAppointViewController.swift */; };
04358E0A2C7835B000811928 /* YHMakeCertificatePlaceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E092C7835B000811928 /* YHMakeCertificatePlaceModel.swift */; }; 04358E0A2C7835B000811928 /* YHMakeCertificatePlaceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E092C7835B000811928 /* YHMakeCertificatePlaceModel.swift */; };
04358E0C2C7836BB00811928 /* YHSelectHKPlaceListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E0B2C7836BB00811928 /* YHSelectHKPlaceListView.swift */; }; 04358E0C2C7836BB00811928 /* YHSelectHKPlaceListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E0B2C7836BB00811928 /* YHSelectHKPlaceListView.swift */; };
04358E0E2C78395200811928 /* YHHKPlaceInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E0D2C78395200811928 /* YHHKPlaceInfoCell.swift */; }; 04358E0E2C78395200811928 /* YHHKPlaceInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E0D2C78395200811928 /* YHHKPlaceInfoCell.swift */; };
04358E102C78819F00811928 /* YHCancelAppointAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04358E0F2C78819F00811928 /* YHCancelAppointAlertView.swift */; };
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; }; 0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; };
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; }; 0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.swift */; }; 0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.swift */; };
...@@ -874,12 +877,15 @@ ...@@ -874,12 +877,15 @@
0430E6852C76DF6A000511E2 /* YHAdopterMainModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterMainModel.swift; sourceTree = "<group>"; }; 0430E6852C76DF6A000511E2 /* YHAdopterMainModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterMainModel.swift; sourceTree = "<group>"; };
0430E6872C771B06000511E2 /* YHAdopterItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterItemView.swift; sourceTree = "<group>"; }; 0430E6872C771B06000511E2 /* YHAdopterItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterItemView.swift; sourceTree = "<group>"; };
0430E6892C77415D000511E2 /* YHAdopterAddModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterAddModel.swift; sourceTree = "<group>"; }; 0430E6892C77415D000511E2 /* YHAdopterAddModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterAddModel.swift; sourceTree = "<group>"; };
0430E68B2C786257000511E2 /* YHAdopterIncomeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterIncomeViewModel.swift; sourceTree = "<group>"; };
0430E68D2C7875F4000511E2 /* YHAdopterDependentDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAdopterDependentDataModel.swift; sourceTree = "<group>"; };
04358E032C77322700811928 /* YHHaveGrabbedNumberListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHaveGrabbedNumberListCell.swift; sourceTree = "<group>"; }; 04358E032C77322700811928 /* YHHaveGrabbedNumberListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHaveGrabbedNumberListCell.swift; sourceTree = "<group>"; };
04358E052C77334B00811928 /* YHHaveGrabbedNumberInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHaveGrabbedNumberInfoView.swift; sourceTree = "<group>"; }; 04358E052C77334B00811928 /* YHHaveGrabbedNumberInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHaveGrabbedNumberInfoView.swift; sourceTree = "<group>"; };
04358E072C77657000811928 /* YHReAppointViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHReAppointViewController.swift; sourceTree = "<group>"; }; 04358E072C77657000811928 /* YHReAppointViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHReAppointViewController.swift; sourceTree = "<group>"; };
04358E092C7835B000811928 /* YHMakeCertificatePlaceModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakeCertificatePlaceModel.swift; sourceTree = "<group>"; }; 04358E092C7835B000811928 /* YHMakeCertificatePlaceModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakeCertificatePlaceModel.swift; sourceTree = "<group>"; };
04358E0B2C7836BB00811928 /* YHSelectHKPlaceListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectHKPlaceListView.swift; sourceTree = "<group>"; }; 04358E0B2C7836BB00811928 /* YHSelectHKPlaceListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectHKPlaceListView.swift; sourceTree = "<group>"; };
04358E0D2C78395200811928 /* YHHKPlaceInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKPlaceInfoCell.swift; sourceTree = "<group>"; }; 04358E0D2C78395200811928 /* YHHKPlaceInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKPlaceInfoCell.swift; sourceTree = "<group>"; };
04358E0F2C78819F00811928 /* YHCancelAppointAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCancelAppointAlertView.swift; sourceTree = "<group>"; };
0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView.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>"; }; 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>"; }; 0435FA822BA2DEB100024EAE /* YHCardButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardButton.swift; sourceTree = "<group>"; };
...@@ -1682,6 +1688,7 @@ ...@@ -1682,6 +1688,7 @@
04256DEF2C733B2D00A37BA4 /* YHGrabNumberInfoView.swift */, 04256DEF2C733B2D00A37BA4 /* YHGrabNumberInfoView.swift */,
04256DF32C73626900A37BA4 /* YHServiceSelectAlertView.swift */, 04256DF32C73626900A37BA4 /* YHServiceSelectAlertView.swift */,
04358E0B2C7836BB00811928 /* YHSelectHKPlaceListView.swift */, 04358E0B2C7836BB00811928 /* YHSelectHKPlaceListView.swift */,
04358E0F2C78819F00811928 /* YHCancelAppointAlertView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1782,6 +1789,7 @@ ...@@ -1782,6 +1789,7 @@
0430E65B2C744187000511E2 /* YHAdopterCardModel.swift */, 0430E65B2C744187000511E2 /* YHAdopterCardModel.swift */,
0430E6852C76DF6A000511E2 /* YHAdopterMainModel.swift */, 0430E6852C76DF6A000511E2 /* YHAdopterMainModel.swift */,
0430E6892C77415D000511E2 /* YHAdopterAddModel.swift */, 0430E6892C77415D000511E2 /* YHAdopterAddModel.swift */,
0430E68D2C7875F4000511E2 /* YHAdopterDependentDataModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1837,6 +1845,7 @@ ...@@ -1837,6 +1845,7 @@
0430E6592C7436CD000511E2 /* YHAdopterNewPeopleViewModel.swift */, 0430E6592C7436CD000511E2 /* YHAdopterNewPeopleViewModel.swift */,
0430E6632C7482DD000511E2 /* YHYHAdopterTravelViewModel.swift */, 0430E6632C7482DD000511E2 /* YHYHAdopterTravelViewModel.swift */,
0430E6832C76D702000511E2 /* YHAddpterViewModel.swift */, 0430E6832C76D702000511E2 /* YHAddpterViewModel.swift */,
0430E68B2C786257000511E2 /* YHAdopterIncomeViewModel.swift */,
); );
path = VM; path = VM;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -4177,6 +4186,7 @@ ...@@ -4177,6 +4186,7 @@
A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */, A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */,
048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */, 048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */,
A5D0012A2BABC84A001F003C /* YHFileListHeaerView.swift in Sources */, A5D0012A2BABC84A001F003C /* YHFileListHeaerView.swift in Sources */,
0430E68C2C786257000511E2 /* YHAdopterIncomeViewModel.swift in Sources */,
044414052BC3B9DE00784A14 /* YHServiceTableFootView.swift in Sources */, 044414052BC3B9DE00784A14 /* YHServiceTableFootView.swift in Sources */,
045EEEEF2B9F171A0022A143 /* YHCertificateInfoController.swift in Sources */, 045EEEEF2B9F171A0022A143 /* YHCertificateInfoController.swift in Sources */,
045EEEDA2B9F171A0022A143 /* YHEducationInfoListVC.swift in Sources */, 045EEEDA2B9F171A0022A143 /* YHEducationInfoListVC.swift in Sources */,
...@@ -4681,6 +4691,7 @@ ...@@ -4681,6 +4691,7 @@
0430E6422C72E120000511E2 /* YHAddAdoptersViewController.swift in Sources */, 0430E6422C72E120000511E2 /* YHAddAdoptersViewController.swift in Sources */,
A5CA3F5C2C74C4C200EB22F5 /* YHHKCardTemplateView.swift in Sources */, A5CA3F5C2C74C4C200EB22F5 /* YHHKCardTemplateView.swift in Sources */,
044D0C022C216AAF00C5CF5E /* YHInformationAuthorizeViewModel.swift in Sources */, 044D0C022C216AAF00C5CF5E /* YHInformationAuthorizeViewModel.swift in Sources */,
0430E68E2C7875F4000511E2 /* YHAdopterDependentDataModel.swift in Sources */,
A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */, A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */,
A51D14EB2C75E98500E2820C /* UINavigationController+Extension.swift in Sources */, A51D14EB2C75E98500E2820C /* UINavigationController+Extension.swift in Sources */,
A59B43CB2C4A151200B28379 /* YHStatusAdvantageVC.swift in Sources */, A59B43CB2C4A151200B28379 /* YHStatusAdvantageVC.swift in Sources */,
...@@ -4787,6 +4798,7 @@ ...@@ -4787,6 +4798,7 @@
045EEECA2B9F171A0022A143 /* YHMyDocumentsListViewController.swift in Sources */, 045EEECA2B9F171A0022A143 /* YHMyDocumentsListViewController.swift in Sources */,
049D62C52C6F272800E811A1 /* YHRiskWarningCell.swift in Sources */, 049D62C52C6F272800E811A1 /* YHRiskWarningCell.swift in Sources */,
04358E062C77334B00811928 /* YHHaveGrabbedNumberInfoView.swift in Sources */, 04358E062C77334B00811928 /* YHHaveGrabbedNumberInfoView.swift in Sources */,
04358E102C78819F00811928 /* YHCancelAppointAlertView.swift in Sources */,
045EEF052B9F171A0022A143 /* YHFormItemExpireDateCell.swift in Sources */, 045EEF052B9F171A0022A143 /* YHFormItemExpireDateCell.swift in Sources */,
043B0A352C1190C6008A9BBA /* YHSelectFileSheetView.swift in Sources */, 043B0A352C1190C6008A9BBA /* YHSelectFileSheetView.swift in Sources */,
0430E6462C73171E000511E2 /* YHAdopterStepTableViewCell.swift in Sources */, 0430E6462C73171E000511E2 /* YHAdopterStepTableViewCell.swift in Sources */,
......
...@@ -24,6 +24,11 @@ class YHAddAdoptersViewController: YHBaseViewController { ...@@ -24,6 +24,11 @@ class YHAddAdoptersViewController: YHBaseViewController {
getData() getData()
} }
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
getData()
}
func getData() { func getData() {
viewModel.getAddpterMainData(orderId: orderId) {[weak self] success, error in viewModel.getAddpterMainData(orderId: orderId) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
...@@ -139,6 +144,7 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -139,6 +144,7 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc
self.viewModel.postManagementAdd(isSpouse: 1, orderId: orderId) {[weak self] success, error in self.viewModel.postManagementAdd(isSpouse: 1, orderId: orderId) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
let vc = YHAdopterNewPeopleViewController() let vc = YHAdopterNewPeopleViewController()
vc.id = self.viewModel.addModel?.id ?? 0
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
...@@ -146,6 +152,7 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -146,6 +152,7 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc
self.viewModel.postManagementAdd(isSpouse: 0, orderId: orderId) {[weak self] success, error in self.viewModel.postManagementAdd(isSpouse: 0, orderId: orderId) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
let vc = YHAdopterNewPeopleViewController() let vc = YHAdopterNewPeopleViewController()
vc.id = self.viewModel.addModel?.id ?? 0
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
...@@ -163,7 +170,9 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -163,7 +170,9 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc
} }
cell.clickBlock = { [weak self] model in cell.clickBlock = { [weak self] model in
guard let self = self else { return } guard let self = self else { return }
let vc = YHAdopterNewPeopleViewController()
vc.id = model.id
self.navigationController?.pushViewController(vc)
} }
return cell return cell
} else { } else {
...@@ -172,6 +181,8 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc ...@@ -172,6 +181,8 @@ extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSourc
cell.clickBlock = { [weak self] index in cell.clickBlock = { [weak self] index in
guard let self = self else { return } guard let self = self else { return }
let vc = YHAdopterIncomeDetailViewController() let vc = YHAdopterIncomeDetailViewController()
vc.data = self.viewModel.model?.deposit ?? YHAdopterDepositModel()
vc.orderId = orderId
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
return cell return cell
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
import UIKit import UIKit
import IQKeyboardManagerSwift
class YHAdopterIncomeDetailViewController: YHBaseViewController { class YHAdopterIncomeDetailViewController: YHBaseViewController {
...@@ -14,7 +15,15 @@ class YHAdopterIncomeDetailViewController: YHBaseViewController { ...@@ -14,7 +15,15 @@ class YHAdopterIncomeDetailViewController: YHBaseViewController {
var nextButton: UIButton! var nextButton: UIButton!
var clickIndex = -1 var clickIndex = -1
var file: [YHWorkExperienceFileModel] = [] var file: [YHWorkExperienceFileModel] = []
var viewModel = YHBaseViewModel() var data: YHAdopterDepositModel = YHAdopterDepositModel()
var viewModel: YHAdopterIncomeViewModel = YHAdopterIncomeViewModel()
var orderId: Int = 0
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self)
return tool
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navTitle = "上传存款证明" gk_navTitle = "上传存款证明"
...@@ -23,6 +32,16 @@ class YHAdopterIncomeDetailViewController: YHBaseViewController { ...@@ -23,6 +32,16 @@ class YHAdopterIncomeDetailViewController: YHBaseViewController {
} }
func getData() { func getData() {
guard let resultModels = [YHAdopterFileModel].deserialize(json: data.urls) else {
return
}
for item in resultModels {
var tempFile = YHWorkExperienceFileModel()
tempFile.fileName = item?.name ?? ""
tempFile.fileUrl = item?.url ?? ""
tempFile.uploadedAt = item?.upload_date ?? ""
file.append(tempFile)
}
tableView.reloadData() tableView.reloadData()
} }
...@@ -65,14 +84,30 @@ class YHAdopterIncomeDetailViewController: YHBaseViewController { ...@@ -65,14 +84,30 @@ class YHAdopterIncomeDetailViewController: YHBaseViewController {
make.height.equalTo(48) make.height.equalTo(48)
} }
if data.status == 0 || data.status == 1 {
nextButton.isHidden = true
}
} }
@objc func nextStep() { @objc func nextStep() {
viewModel.postDepositUpload(file: file, orderId: orderId) {[weak self] success, error in
guard let self = self else { return }
self.navigationController?.popViewController(animated: true)
}
} }
@objc func submit() {
func getFileNameWithoutSuffix(_ string: String) -> String {
if string.isEmpty {
return string
}
if !string.contains(".") {
return string
}
if !string.pathExtension.isEmpty {
let fileName = (string as NSString).deletingPathExtension
return fileName
}
return ""
} }
func uploadImage(_ img: UIImage, imageName:String, callBack:((Bool, String)->())?) { func uploadImage(_ img: UIImage, imageName:String, callBack:((Bool, String)->())?) {
...@@ -137,17 +172,76 @@ class YHAdopterIncomeDetailViewController: YHBaseViewController { ...@@ -137,17 +172,76 @@ class YHAdopterIncomeDetailViewController: YHBaseViewController {
extension YHAdopterIncomeDetailViewController: UITableViewDelegate, UITableViewDataSource { extension YHAdopterIncomeDetailViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if data.status == 0 || data.status == 1 {
return 2
}
return 4 return 4
} }
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 cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeTitleTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeTitleTableViewCell.self)
cell.dataSource = data
return cell return cell
} }
if indexPath.row == 1 { if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeFileTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeFileTableViewCell.self)
cell.dataSource = self.file cell.dataSource = self.file
cell.experienceListBlock = {[weak self] model, type in
guard let self = self else { return }
if type == .click {
self.viewModel.getPublicImageUrl(model.fileUrl) { success, error in
YHHUD.hide()
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName: "")
}
}
}
if type == .delete {
var items = [YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.rename, title:"重命名"),
YHCertificateEditItem(type:.delete, title:"删除"),
YHCertificateEditItem(type:.cancel, title:"取消")]
if data.status == 0 || data.status == 1 {
items = [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 {
IQKeyboardManager.shared.enable = false
var name = getFileNameWithoutSuffix(model.fileName)
if name.count > 30 {
name = name[safe: ..<30]!
}
let view = YHPrincipleFileRenameView.renameView(name: name)
view.confirmBlock = {
[weak self] text in
guard let self = self else { return }
model.fileName = text
self.tableView.reloadData()
}
view.show()
} else if editType == .delete { // 删除
for (index, item) in file.enumerated() {
if item.fileUrl == model.fileUrl {
file.remove(at: index)
}
}
self.tableView.reloadData()
} else if editType == .preview { // 预览
self.viewModel.getPublicImageUrl(model.fileUrl) { success, error in
YHHUD.hide()
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName: "")
}
}
}
}.show()
}
}
return cell return cell
} }
if indexPath.row == 2 { if indexPath.row == 2 {
...@@ -225,6 +319,7 @@ extension YHAdopterIncomeDetailViewController: UITableViewDelegate, UITableViewD ...@@ -225,6 +319,7 @@ extension YHAdopterIncomeDetailViewController: UITableViewDelegate, UITableViewD
} }
if indexPath.row == 3 { if indexPath.row == 3 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeFileCountTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeFileCountTableViewCell.self)
cell.setContentData(self.file.count)
return cell return cell
} }
...@@ -233,7 +328,11 @@ extension YHAdopterIncomeDetailViewController: UITableViewDelegate, UITableViewD ...@@ -233,7 +328,11 @@ extension YHAdopterIncomeDetailViewController: UITableViewDelegate, UITableViewD
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 { if indexPath.row == 0 {
return 119 if self.data.status == 2 {
return 119
} else {
return 66
}
} }
if indexPath.row == 1 { if indexPath.row == 1 {
let count = self.file.count let count = self.file.count
......
...@@ -16,7 +16,7 @@ class YHAdopterNewPeopleViewController: YHBaseViewController { ...@@ -16,7 +16,7 @@ class YHAdopterNewPeopleViewController: YHBaseViewController {
var dataSource: [YHSectionItemModel] = [] var dataSource: [YHSectionItemModel] = []
var cardDataSource: [YHAdopterCardModel] = [] var cardDataSource: [YHAdopterCardModel] = []
var isShowPrompt: Bool = false var isShowPrompt: Bool = false
var orderId: Int = 0 var id: Int = 0
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -31,17 +31,10 @@ class YHAdopterNewPeopleViewController: YHBaseViewController { ...@@ -31,17 +31,10 @@ class YHAdopterNewPeopleViewController: YHBaseViewController {
func getData() { func getData() {
self.updateDataSource() self.updateDataSource()
// viewModel.requestMainInformation("\(orderId)") {[weak self] success, error in viewModel.getDependentsData(id: id) {[weak self] success, error in
// guard let self = self else { return } guard let self = self else { return }
// self.stepView.maxIndex = self.viewModel.mainModel.step self.updateDataSource()
// self.stepView.currentIndex = self.viewModel.mainModel.step }
// self.updateDataSource()
// if self.stepView.currentIndex == 3 {
// self.bottomView.nextButton.setTitle("提交", for: .normal)
// } else {
// self.bottomView.nextButton.setTitle("下一步", for: .normal)
// }
// }
} }
func updateDataSource() { func updateDataSource() {
...@@ -96,25 +89,80 @@ class YHAdopterNewPeopleViewController: YHBaseViewController { ...@@ -96,25 +89,80 @@ class YHAdopterNewPeopleViewController: YHBaseViewController {
bottomView = { bottomView = {
let bottom = YHBottomNextView() let bottom = YHBottomNextView()
bottom.saveButton.setTitle("上一步", for: .normal)
bottom.saveButton.isHidden = true
bottom.nextButton.snp.remakeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(10)
make.height.equalTo(44)
make.left.equalTo(16)
}
bottom.nextblock = { [weak self] in bottom.nextblock = { [weak self] in
// bottom.nextButton.isEnabled = false bottom.nextButton.isEnabled = false
guard let self = self else { return } guard let self = self else { return }
self.stepView.currentIndex = self.stepView.currentIndex + 1 if self.viewModel.isCanNext(self.stepView.currentIndex) {
self.updateDataSource() self.viewModel.postDependentsAdd(id: id) {[weak self] success, error in
// if self.viewModel.isCanNext(self.stepView.currentIndex) { guard let self = self else { return }
bottom.nextButton.isEnabled = true
bottom.saveButton.isHidden = false
bottom.nextButton.setTitle("确认,保存", for: .normal)
bottom.nextButton.snp.remakeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(10)
make.height.equalTo(44)
make.left.equalTo(bottom.saveButton.snp.right).offset(10)
}
self.stepView.currentIndex = self.stepView.currentIndex + 1
let view = YHAdopterCardOtherGuideView.sheetView()
view.ischeckBeforeFlag = false
view.block = {
}
view.show()
}
// self.viewModel.mainModel.step = self.stepView.currentIndex // self.viewModel.mainModel.step = self.stepView.currentIndex
// } else { // self.viewModel.updateMainInformation(.submit, self.orderId, self.stepView.currentIndex) {[weak self] success, error in
// // guard let self = self else { return }
// } // if let error = error {
let view = YHAdopterCardOtherGuideView.sheetView() // YHHUD.flash(message: error.errorMsg )
view.ischeckBeforeFlag = false // } else {
view.block = { // YHHUD.hideFlashMessage()
// self.stepView.currentIndex = self.stepView.currentIndex + 1
// self.isShowPrompt = false
// self.stepView.currentIndex = self.stepView.currentIndex
// if self.stepView.currentIndex == 3 {
// self.bottomView.nextButton.setTitle("提交", for: .normal)
// } else {
// self.bottomView.nextButton.setTitle("下一步", for: .normal)
// }
// if self.stepView.currentIndex == self.stepView.dataSource?.count {
// YHHUD.flash(message: "提交成功")
// self.navigationController?.popViewController()
// } else {
// self.updateDataSource()
// }
// }
// }
} else {
bottom.nextButton.isEnabled = true
self.isShowPrompt = true
self.updateDataSource()
YHHUD.flash(message: "您还有信息未填写")
} }
view.show()
} }
bottom.saveBlock = { [weak self] in bottom.saveBlock = { [weak self] in
guard let self = self else { return } guard let self = self else { return }
self.stepView.currentIndex = 0
self.getData()
bottom.saveButton.setTitle("上一步", for: .normal)
bottom.saveButton.isHidden = true
bottom.nextButton.snp.remakeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(10)
make.height.equalTo(44)
make.left.equalTo(16)
}
} }
return bottom return bottom
}() }()
...@@ -143,15 +191,10 @@ extension YHAdopterNewPeopleViewController: UITableViewDelegate, UITableViewData ...@@ -143,15 +191,10 @@ extension YHAdopterNewPeopleViewController: UITableViewDelegate, UITableViewData
return cell return cell
} else { } else {
let cell = tableView.dequeueReusableCell(withClass: YHMainInformationTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHMainInformationTableViewCell.self)
cell.country = self.viewModel.mainModel.address.country
cell.dataSource = dataSource[indexPath.row] cell.dataSource = dataSource[indexPath.row]
cell.informationBlock = {[weak self] model in cell.informationBlock = {[weak self] model in
guard let self = self else { return } guard let self = self else { return }
// self.viewModel.updateModel(model) self.viewModel.updateModel(model)
// let id = model.id
// if id != .id32 && id != .id4 && id != .id8 && id != .id9 && id != .id12 && id != .id13 && id != .id17 && id != .id18 && id != .id21 && id != .id22 && id != .id23 && id != .id34 && id != .id29 && id != .id30 && id != .id35 {
// self.updateDataSource()
// }
} }
return cell return cell
} }
......
//
// YHAdopterDependentModel.swift
// galaxy
//
// Created by EDY on 2024/8/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHAdopterDependentDataModel: SmartCodable {
var info : YHAdopterDependentDataInfoModel = YHAdopterDependentDataInfoModel()
var docList : [YHAdopterDependentDataDocModel] = []
required init() {
}
}
class YHAdopterDependentDataInfoModel: SmartCodable {
var id : Int = 0
var order_sn : String = ""
var applicant_name : String = ""
var order_id : Int = 0
var dep_name : String = ""
var dep_nationality : Int = 5 //随迁人国籍0大陆1台湾2澳门3海外
var status : Int = 0 //状态0待完善,1审核中,2已驳回,3已完成
var sync_status : Int = 0 //状态0待完善, 0未同步 1已同步
var created_at : String = ""
var updated_at : String = ""
var deleted_at : String = ""
var is_spouse : Int = 0
var sync_subset_id : Int = 0
required init() {
}
}
class YHAdopterDependentDataDocModel: SmartCodable {
var id : Int = 0
var dep_name : String = ""
var dep_type : Int = 0
var dep_id : Int = 0
var order_id : Int = 0
var dep_nationality : Int = 0
var is_spouse : Int = 0
var status : Int = 0
var created_at : String = ""
var updated_at : String = ""
var deleted_at : String = ""
var reject_reason : String = ""
var require : String = ""
var certificates_info : String = ""
var url : [String] = []
required init() {
}
}
...@@ -69,3 +69,12 @@ class YHAdopterDepositModel: SmartCodable { ...@@ -69,3 +69,12 @@ class YHAdopterDepositModel: SmartCodable {
required init() { required init() {
} }
} }
class YHAdopterFileModel: SmartCodable {
var upload_date : String = ""
var name : String = ""
var url: String = ""
required init() {
}
}
...@@ -11,7 +11,7 @@ import AttributedString ...@@ -11,7 +11,7 @@ import AttributedString
class YHAdopterIncomeFileCountTableViewCell: UITableViewCell { class YHAdopterIncomeFileCountTableViewCell: UITableViewCell {
var alertLabel: UILabel! var alertLabel: UILabel!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
// Initialization code // Initialization code
...@@ -55,4 +55,11 @@ class YHAdopterIncomeFileCountTableViewCell: UITableViewCell { ...@@ -55,4 +55,11 @@ class YHAdopterIncomeFileCountTableViewCell: UITableViewCell {
make.right.equalTo(-18) make.right.equalTo(-18)
} }
} }
func setContentData(_ count: Int) {
let a: ASAttributedString = .init("已上传 ", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.labelTextColor2))
let b: ASAttributedString = .init(" \(count)/10", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor(hex: 0x222222)))
let c: ASAttributedString = .init(" 张图片或文件", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.labelTextColor2))
alertLabel.attributed.text = a + b + c
}
} }
...@@ -11,9 +11,7 @@ import UIKit ...@@ -11,9 +11,7 @@ import UIKit
class YHAdopterIncomeFileTableViewCell: UITableViewCell { class YHAdopterIncomeFileTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> () typealias ExperienceListBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> ()
typealias AddIntroductionBlock = () -> ()
var experienceListBlock: ExperienceListBlock? var experienceListBlock: ExperienceListBlock?
var selectIntroductionBlock: AddIntroductionBlock?
var mainItemView: UIView! var mainItemView: UIView!
var dataSource: [YHWorkExperienceFileModel]?{ var dataSource: [YHWorkExperienceFileModel]?{
didSet { didSet {
......
...@@ -14,7 +14,12 @@ class YHAdopterIncomeTitleTableViewCell: UITableViewCell { ...@@ -14,7 +14,12 @@ class YHAdopterIncomeTitleTableViewCell: UITableViewCell {
var alertLabel: UILabel! var alertLabel: UILabel!
var failLabel: UILabel! var failLabel: UILabel!
var failImageView: UIImageView! var failImageView: UIImageView!
var dataSource: YHAdopterDepositModel? {
didSet {
updateContent()
}
}
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
// Initialization code // Initialization code
...@@ -110,7 +115,7 @@ class YHAdopterIncomeTitleTableViewCell: UITableViewCell { ...@@ -110,7 +115,7 @@ class YHAdopterIncomeTitleTableViewCell: UITableViewCell {
failImageView = { failImageView = {
let view = UIImageView() let view = UIImageView()
view.image = UIImage(named: "service_adopter_income_fail") view.image = UIImage(named: "service_adopter_income_fail_alert")
return view return view
}() }()
contentView.addSubview(failImageView) contentView.addSubview(failImageView)
...@@ -122,4 +127,36 @@ class YHAdopterIncomeTitleTableViewCell: UITableViewCell { ...@@ -122,4 +127,36 @@ class YHAdopterIncomeTitleTableViewCell: UITableViewCell {
} }
func updateContent() {
guard let data = dataSource else { return }
if data.status == 4 {
subTitleLabel.textColor = UIColor.brandMainColor
subTitleLabel.backgroundColor = UIColor(hex: 0xf0f4fb)
failImageView.isHidden = true
failLabel.isHidden = true
subTitleLabel.text = "待上传"
}
if data.status == 0 {
subTitleLabel.textColor = UIColor(hex: 0xff8000)
subTitleLabel.backgroundColor = UIColor(hex: 0xfff5eb)
failImageView.isHidden = true
failLabel.isHidden = true
subTitleLabel.text = "审核中"
}
if data.status == 1 {
subTitleLabel.textColor = UIColor(hex: 0x3cc694)
subTitleLabel.backgroundColor = UIColor(hex: 0xf0fbf7)
failImageView.isHidden = true
failLabel.isHidden = true
subTitleLabel.text = "已完成"
}
if data.status == 2 {
subTitleLabel.textColor = UIColor(hex: 0xf81d22)
subTitleLabel.backgroundColor = UIColor(hex: 0xfff2f2)
failImageView.isHidden = false
failLabel.isHidden = false
subTitleLabel.text = "已驳回"
}
failLabel.text = data.remark
}
} }
...@@ -110,7 +110,11 @@ class YHAdopterItemView: UIView { ...@@ -110,7 +110,11 @@ class YHAdopterItemView: UIView {
func updateAllViews() { func updateAllViews() {
guard let dataSource = dataSource else { return } guard let dataSource = dataSource else { return }
titleLabel.text = dataSource.applicant_name var spouse = "子女"
if dataSource.has_spouse {
spouse = "配偶"
}
titleLabel.text = spouse + "(\(dataSource.dep_name))"
if dataSource.status == 0 { if dataSource.status == 0 {
explainLabel.text = "待上传" explainLabel.text = "待上传"
explainLabel.textColor = UIColor.brandMainColor explainLabel.textColor = UIColor.brandMainColor
......
//
// YHAdopterIncomeViewModel.swift
// galaxy
//
// Created by EDY on 2024/8/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterIncomeViewModel: YHBaseViewModel {
func postDepositUpload(file: [YHWorkExperienceFileModel], orderId: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
var urls: [Any] = []
for item in file {
let file = ["name": item.fileName, "url": item.fileUrl, "upload_date": item.uploadedAt]
urls.append(file)
}
let params: [String: Any] = ["urls": urls,
"order_id": orderId]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Adopter.depositUpload
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
}
...@@ -9,15 +9,25 @@ ...@@ -9,15 +9,25 @@
import UIKit import UIKit
class YHAdopterNewPeopleViewModel: YHBaseViewModel { class YHAdopterNewPeopleViewModel: YHBaseViewModel {
var mainModel: YHMainInformationModel = YHMainInformationModel() var mainModel: YHAdopterDependentDataModel = YHAdopterDependentDataModel()
override init() { override init() {
super.init() super.init()
} }
func getBaseDataSource(_ isShowPrompt: Bool) -> [YHSectionItemModel] { func getBaseDataSource(_ isShowPrompt: Bool) -> [YHSectionItemModel] {
let item = YHItemModel(id: .id1, isNeed: true, title: "姓名", isUserKeyBoard: true, prompts: "请输入", message: "", isShowPrompts: isShowPrompt, alertMessage:"请选择国家/地区") let item = YHItemModel(id: .id1, isNeed: true, title: "姓名", isUserKeyBoard: true, prompts: "请输入", message: mainModel.info.dep_name, isShowPrompts: isShowPrompt, alertMessage:"请输入姓名")
let item1 = YHItemModel(id: .id1, isNeed: true, title: "国家/地区", isUserKeyBoard: false, prompts: "请选择", message: "", type: .selectAddress, isShowPrompts: isShowPrompt, alertMessage:"请选择国家/地区") var string = ""
if mainModel.info.dep_nationality == 0 {
string = "中国大陆"
} else if mainModel.info.dep_nationality == 1 {
string = "中国澳门"
} else if mainModel.info.dep_nationality == 2 {
string = "中国台湾"
} else if mainModel.info.dep_nationality == 3 {
string = "海外地区"
}
let item1 = YHItemModel(id: .id2, isNeed: true, title: "国家/地区", isUserKeyBoard: false, prompts: "请选择", message: string, type: .selectAddress, isShowPrompts: isShowPrompt, alertMessage:"请选择国家/地区")
let section = YHSectionItemModel(title: "配偶信息", models: [item, item1]) let section = YHSectionItemModel(title: "配偶信息", models: [item, item1])
return [section] return [section]
} }
...@@ -35,4 +45,89 @@ class YHAdopterNewPeopleViewModel: YHBaseViewModel { ...@@ -35,4 +45,89 @@ class YHAdopterNewPeopleViewModel: YHBaseViewModel {
return [item, item1, item2, item3, item4, item5, item6, item7, item8] return [item, item1, item2, item3, item4, item5, item6, item7, item8]
} }
func updateModel(_ item: YHItemModel) {
guard let type = item.id else { return }
switch type {
case .id1:
mainModel.info.dep_name = item.message ?? ""
case .id2:
mainModel.info.dep_nationality = item.value?.first?.int ?? 0
default:
break
}
}
func isCanNext(_ step: Int) -> Bool {
let depname = mainModel.info.dep_name
let depnationality = mainModel.info.dep_nationality
guard depname.count > 0 else { return false }
guard depnationality < 4 else { return false }
return true
}
func getDependentsData(id: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let params: [String: Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Adopter.dependents
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let resultModel = YHAdopterDependentDataModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,err)
return
}
self.mainModel = resultModel
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
func postDependentsAdd(id: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let params: [String: Any] = ["id": id,
"is_spouse": mainModel.info.is_spouse,
"order_id": mainModel.info.order_id,
"dep_nationality": mainModel.info.dep_nationality,
"dep_name": mainModel.info.dep_name]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Adopter.dependentsAdd
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let resultModel = YHAdopterDependentDataModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,err)
return
}
self.mainModel = resultModel
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
} }
...@@ -328,15 +328,28 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa ...@@ -328,15 +328,28 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
[weak self] groupModel in [weak self] groupModel in
guard let self = self else { return } guard let self = self else { return }
// 抢号中点击取消预约 // 抢号中点击取消预约
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.cancelAppoint(orderId: orderId, reservationId: groupModel.id) { success in let alert = YHCancelAppointAlertView.alertView()
YHHUD.hide() alert.memberNamesText = groupModel.getMemberNames()
if !success { alert.selectBlock = {
YHHUD.flash(message: "取消失败") [weak self] sure in
return guard let self = self else { return }
if !sure {
return
}
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.cancelAppoint(orderId: orderId, reservationId: groupModel.id) { success in
YHHUD.hide()
if !success {
YHHUD.flash(message: "取消失败")
return
}
self.requestData()
}
} }
self.requestData() alert.show()
}
} }
return cell return cell
} }
......
//
// YHCancelAppointAlertView.swift
// galaxy
//
// Created by edy on 2024/8/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHCancelAppointAlertView: UIView {
let baseTag = 9527
var selectBlock:((Bool)->())?
var memberNamesText: String = "" {
didSet {
let a: ASAttributedString = .init("取消预约后,不可恢复,您可重新预约!成员:", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor(alpha: 0.7)))
let b: ASAttributedString = .init("\(memberNamesText)", .font(UIFont.PFSC_B(ofSize: 14)),.foreground(UIColor.brandMainColor))
detailLabel.attributed.text = a+b
}
}
// 底层蒙版
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 iconImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "cs_family_risk"))
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textAlignment = .center
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "取消预约"
return label
}()
lazy var detailLabel: UILabel = {
var label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14.0)
return label
}()
lazy var cancelBtn: UIButton = {
let button = UIButton()
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.setTitle("否", for: .normal)
button.setTitleColor(UIColor.white, for: .normal)
button.backgroundColor = .brandMainColor
button.tag = baseTag + 0
button.layer.cornerRadius = kCornerRadius3
return button
}()
lazy var confirmBtn: UIButton = {
let button = UIButton()
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.setTitle("是", for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.backgroundColor = .white
button.layer.borderWidth = 1.0
button.tag = baseTag + 1
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.layer.cornerRadius = kCornerRadius3
return button
}()
@objc func didConfirmBtnClicked(_ sender:UIButton) {
let tag = sender.tag-self.baseTag
dismiss()
selectBlock?(tag == 1)
}
static func alertView() -> YHCancelAppointAlertView {
let view = YHCancelAppointAlertView(frame: UIScreen.main.bounds)
return view
}
@objc func show() {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
@objc func dismiss() {
self.removeFromSuperview()
}
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)
whiteContentView.addSubview(iconImgView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(detailLabel)
whiteContentView.addSubview(confirmBtn)
whiteContentView.addSubview(cancelBtn)
confirmBtn.addTarget(self, action: #selector(didConfirmBtnClicked(_:)), for: .touchUpInside)
cancelBtn.addTarget(self, action: #selector(didConfirmBtnClicked(_:)), for: .touchUpInside)
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(38)
make.right.equalTo(-38)
make.centerY.equalToSuperview()
}
iconImgView.snp.makeConstraints { make in
make.width.height.equalTo(53)
make.top.equalTo(30)
make.centerX.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(iconImgView.snp.bottom).offset(16)
make.height.equalTo(24)
make.left.equalTo(21)
make.right.equalTo(-21)
}
detailLabel.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.top.equalTo(titleLabel.snp.bottom).offset(8)
}
confirmBtn.snp.makeConstraints { make in
make.top.equalTo(detailLabel.snp.bottom).offset(30)
make.left.equalTo(21)
make.right.equalTo(cancelBtn.snp.left).offset(-8)
make.bottom.equalTo(-21)
make.height.equalTo(45)
make.width.equalTo(cancelBtn)
}
cancelBtn.snp.makeConstraints { make in
make.centerY.equalTo(confirmBtn)
make.height.equalTo(45)
make.right.equalTo(-21)
}
}
}
...@@ -295,6 +295,7 @@ extension YHSelectApplicantGroupCell: UICollectionViewDelegate, UICollectionView ...@@ -295,6 +295,7 @@ extension YHSelectApplicantGroupCell: UICollectionViewDelegate, UICollectionView
} }
if selectArr.count == 1, member.isSelected == true, member.id == selectArr[0].id { if selectArr.count == 1, member.isSelected == true, member.id == selectArr[0].id {
// 分组中仅有一个选中用户 且点击的是该用户 // 分组中仅有一个选中用户 且点击的是该用户
YHHUD.flash(message: "一个批次最少需要选中一个申请个人")
return return
} }
selectBlock?(member, !member.isSelected, dataModel.itemIndex) selectBlock?(member, !member.isSelected, dataModel.itemIndex)
......
...@@ -425,20 +425,20 @@ class YHConstantArrayData { ...@@ -425,20 +425,20 @@ class YHConstantArrayData {
static let arrSelectAddress = [ static let arrSelectAddress = [
[ [
"id":"中国大陆", "id": "0",
"title" : "中国大陆", "title" : "中国大陆",
], ],
[ [
"id" : "中国澳门", "id" : "1",
"title" : "中国澳门", "title" : "中国澳门",
], ],
[ [
"id" : "中国台湾", "id" : "2",
"title" : "中国台湾", "title" : "中国台湾",
], ],
[ [
"id":"外国地区", "id": "3",
"title" : "外国地区", "title" : "海外地区",
] ]
] ]
//通过 id 获取 title //通过 id 获取 title
......
...@@ -464,6 +464,11 @@ class YHAllApiName { ...@@ -464,6 +464,11 @@ class YHAllApiName {
static let del = "super-app/order/information/dependents/del" static let del = "super-app/order/information/dependents/del"
static let depositUpload = "super-app/order/information/deposit/upload"
static let dependents = "super-app/order/information/dependents/get"
static let dependentsAdd = "super-app/order/information/dependents/add"
} }
} }
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