Commit 93d6d856 authored by DavidHuang's avatar DavidHuang

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

parents b6caaf6e 4a7f2882
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
0411CEF32D153FB700644D35 /* YHGCWorkExperienceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CEF22D153FB700644D35 /* YHGCWorkExperienceViewModel.swift */; }; 0411CEF32D153FB700644D35 /* YHGCWorkExperienceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CEF22D153FB700644D35 /* YHGCWorkExperienceViewModel.swift */; };
0411CEF52D1548AF00644D35 /* YHGCWorkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CEF42D1548AF00644D35 /* YHGCWorkModel.swift */; }; 0411CEF52D1548AF00644D35 /* YHGCWorkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CEF42D1548AF00644D35 /* YHGCWorkModel.swift */; };
0411CEF72D15525400644D35 /* YHGCWorkExperienceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CEF62D15525400644D35 /* YHGCWorkExperienceModel.swift */; }; 0411CEF72D15525400644D35 /* YHGCWorkExperienceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CEF62D15525400644D35 /* YHGCWorkExperienceModel.swift */; };
04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; };
045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F4F2D12CA5E00BD2DC0 /* submit_page_scroll.gif */; }; 045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F4F2D12CA5E00BD2DC0 /* submit_page_scroll.gif */; };
045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F762D12CA5E00BD2DC0 /* Localizable.xcstrings */; }; 045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F762D12CA5E00BD2DC0 /* Localizable.xcstrings */; };
045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F5E2D12CA5E00BD2DC0 /* img_0.png */; }; 045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F5E2D12CA5E00BD2DC0 /* img_0.png */; };
...@@ -1100,6 +1101,9 @@ ...@@ -1100,6 +1101,9 @@
047A96832D1674010033BB4E /* YHGCSchemeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A96822D1674010033BB4E /* YHGCSchemeTableViewCell.swift */; }; 047A96832D1674010033BB4E /* YHGCSchemeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A96822D1674010033BB4E /* YHGCSchemeTableViewCell.swift */; };
047A96862D1698150033BB4E /* YHGCMySchemeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A96852D1698150033BB4E /* YHGCMySchemeViewModel.swift */; }; 047A96862D1698150033BB4E /* YHGCMySchemeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A96852D1698150033BB4E /* YHGCMySchemeViewModel.swift */; };
047A96892D169A5F0033BB4E /* YHGCMySchemeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A96882D169A5F0033BB4E /* YHGCMySchemeModel.swift */; }; 047A96892D169A5F0033BB4E /* YHGCMySchemeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A96882D169A5F0033BB4E /* YHGCMySchemeModel.swift */; };
047A968F2D16AA410033BB4E /* YHGCIncomeRecordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A968A2D16AA410033BB4E /* YHGCIncomeRecordViewController.swift */; };
047A96902D16AA410033BB4E /* YHGCIncomeRecordWorkExperienceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A968B2D16AA410033BB4E /* YHGCIncomeRecordWorkExperienceViewController.swift */; };
047A96932D16C0900033BB4E /* YHInfoQuestionSelectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A96922D16C0900033BB4E /* YHInfoQuestionSelectionCell.swift */; };
04AE200F2D12CFAF00891D24 /* YHGCMineSchemeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE1FF82D12CFAF00891D24 /* YHGCMineSchemeViewController.swift */; }; 04AE200F2D12CFAF00891D24 /* YHGCMineSchemeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE1FF82D12CFAF00891D24 /* YHGCMineSchemeViewController.swift */; };
04AE20102D12CFAF00891D24 /* YHGCApplicationTypeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE1FFD2D12CFAF00891D24 /* YHGCApplicationTypeController.swift */; }; 04AE20102D12CFAF00891D24 /* YHGCApplicationTypeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE1FFD2D12CFAF00891D24 /* YHGCApplicationTypeController.swift */; };
04AE20112D12CFAF00891D24 /* YHGCApplicationTypeResultController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE1FFE2D12CFAF00891D24 /* YHGCApplicationTypeResultController.swift */; }; 04AE20112D12CFAF00891D24 /* YHGCApplicationTypeResultController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE1FFE2D12CFAF00891D24 /* YHGCApplicationTypeResultController.swift */; };
...@@ -1126,6 +1130,12 @@ ...@@ -1126,6 +1130,12 @@
04AE203D2D13C14900891D24 /* YHGCEducationDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE203C2D13C14900891D24 /* YHGCEducationDetailVC.swift */; }; 04AE203D2D13C14900891D24 /* YHGCEducationDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE203C2D13C14900891D24 /* YHGCEducationDetailVC.swift */; };
04AE203F2D13C36500891D24 /* YHGCQualificationDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE203E2D13C36500891D24 /* YHGCQualificationDetailVC.swift */; }; 04AE203F2D13C36500891D24 /* YHGCQualificationDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE203E2D13C36500891D24 /* YHGCQualificationDetailVC.swift */; };
04AE20432D1907E300891D24 /* YHGCEducationCerUploadCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE20422D1907E300891D24 /* YHGCEducationCerUploadCell.swift */; }; 04AE20432D1907E300891D24 /* YHGCEducationCerUploadCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE20422D1907E300891D24 /* YHGCEducationCerUploadCell.swift */; };
04AE204E2D1941FC00891D24 /* YHGCCertificateListContainerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE204D2D1941FC00891D24 /* YHGCCertificateListContainerVC.swift */; };
04AE20502D19425900891D24 /* YHGCCertificateListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE204F2D19425900891D24 /* YHGCCertificateListVC.swift */; };
04AE20522D1942E400891D24 /* YHGCCertificateSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE20512D1942E400891D24 /* YHGCCertificateSearchViewController.swift */; };
04AE20542D19434500891D24 /* YHGCCertificateUploadContentListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE20532D19434400891D24 /* YHGCCertificateUploadContentListVC.swift */; };
04AE20562D1943EF00891D24 /* YHGCMineCertificateEntryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE20552D1943EF00891D24 /* YHGCMineCertificateEntryViewController.swift */; };
04AE205A2D1944D600891D24 /* YHGCMyFileListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AE20592D1944D600891D24 /* YHGCMyFileListViewController.swift */; };
04EA376D2BEA06EF00DBAF64 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */; }; 04EA376D2BEA06EF00DBAF64 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */; };
04EA376F2BEA071600DBAF64 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376E2BEA070500DBAF64 /* libc++.tbd */; }; 04EA376F2BEA071600DBAF64 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376E2BEA070500DBAF64 /* libc++.tbd */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; }; 6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
...@@ -1177,6 +1187,7 @@ ...@@ -1177,6 +1187,7 @@
0411CEF22D153FB700644D35 /* YHGCWorkExperienceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkExperienceViewModel.swift; sourceTree = "<group>"; }; 0411CEF22D153FB700644D35 /* YHGCWorkExperienceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkExperienceViewModel.swift; sourceTree = "<group>"; };
0411CEF42D1548AF00644D35 /* YHGCWorkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkModel.swift; sourceTree = "<group>"; }; 0411CEF42D1548AF00644D35 /* YHGCWorkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkModel.swift; sourceTree = "<group>"; };
0411CEF62D15525400644D35 /* YHGCWorkExperienceModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkExperienceModel.swift; sourceTree = "<group>"; }; 0411CEF62D15525400644D35 /* YHGCWorkExperienceModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkExperienceModel.swift; sourceTree = "<group>"; };
04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; };
045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; }; 045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; };
045C0A142D12CA5E00BD2DC0 /* YHBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewController.swift; sourceTree = "<group>"; }; 045C0A142D12CA5E00BD2DC0 /* YHBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewController.swift; sourceTree = "<group>"; };
045C0A152D12CA5E00BD2DC0 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; }; 045C0A152D12CA5E00BD2DC0 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; };
...@@ -2266,6 +2277,9 @@ ...@@ -2266,6 +2277,9 @@
047A96822D1674010033BB4E /* YHGCSchemeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSchemeTableViewCell.swift; sourceTree = "<group>"; }; 047A96822D1674010033BB4E /* YHGCSchemeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSchemeTableViewCell.swift; sourceTree = "<group>"; };
047A96852D1698150033BB4E /* YHGCMySchemeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySchemeViewModel.swift; sourceTree = "<group>"; }; 047A96852D1698150033BB4E /* YHGCMySchemeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySchemeViewModel.swift; sourceTree = "<group>"; };
047A96882D169A5F0033BB4E /* YHGCMySchemeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySchemeModel.swift; sourceTree = "<group>"; }; 047A96882D169A5F0033BB4E /* YHGCMySchemeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySchemeModel.swift; sourceTree = "<group>"; };
047A968A2D16AA410033BB4E /* YHGCIncomeRecordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCIncomeRecordViewController.swift; sourceTree = "<group>"; };
047A968B2D16AA410033BB4E /* YHGCIncomeRecordWorkExperienceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCIncomeRecordWorkExperienceViewController.swift; sourceTree = "<group>"; };
047A96922D16C0900033BB4E /* YHInfoQuestionSelectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInfoQuestionSelectionCell.swift; sourceTree = "<group>"; };
04AE1FF82D12CFAF00891D24 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; }; 04AE1FF82D12CFAF00891D24 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; };
04AE1FFA2D12CFAF00891D24 /* YHGCSchemeTableHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSchemeTableHeadView.swift; sourceTree = "<group>"; }; 04AE1FFA2D12CFAF00891D24 /* YHGCSchemeTableHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSchemeTableHeadView.swift; sourceTree = "<group>"; };
04AE1FFD2D12CFAF00891D24 /* YHGCApplicationTypeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeController.swift; sourceTree = "<group>"; }; 04AE1FFD2D12CFAF00891D24 /* YHGCApplicationTypeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeController.swift; sourceTree = "<group>"; };
...@@ -2290,6 +2304,12 @@ ...@@ -2290,6 +2304,12 @@
04AE203C2D13C14900891D24 /* YHGCEducationDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCEducationDetailVC.swift; sourceTree = "<group>"; }; 04AE203C2D13C14900891D24 /* YHGCEducationDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCEducationDetailVC.swift; sourceTree = "<group>"; };
04AE203E2D13C36500891D24 /* YHGCQualificationDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCQualificationDetailVC.swift; sourceTree = "<group>"; }; 04AE203E2D13C36500891D24 /* YHGCQualificationDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCQualificationDetailVC.swift; sourceTree = "<group>"; };
04AE20422D1907E300891D24 /* YHGCEducationCerUploadCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCEducationCerUploadCell.swift; sourceTree = "<group>"; }; 04AE20422D1907E300891D24 /* YHGCEducationCerUploadCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCEducationCerUploadCell.swift; sourceTree = "<group>"; };
04AE204D2D1941FC00891D24 /* YHGCCertificateListContainerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCCertificateListContainerVC.swift; sourceTree = "<group>"; };
04AE204F2D19425900891D24 /* YHGCCertificateListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCCertificateListVC.swift; sourceTree = "<group>"; };
04AE20512D1942E400891D24 /* YHGCCertificateSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCCertificateSearchViewController.swift; sourceTree = "<group>"; };
04AE20532D19434400891D24 /* YHGCCertificateUploadContentListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCCertificateUploadContentListVC.swift; sourceTree = "<group>"; };
04AE20552D1943EF00891D24 /* YHGCMineCertificateEntryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineCertificateEntryViewController.swift; sourceTree = "<group>"; };
04AE20592D1944D600891D24 /* YHGCMyFileListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMyFileListViewController.swift; sourceTree = "<group>"; };
04EA376C2BEA06EF00DBAF64 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
04EA376E2BEA070500DBAF64 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 04EA376E2BEA070500DBAF64 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = ATAuthSDK.bundle; path = "galaxy/Classes/Modules/AutoLogin(一键登录)/framework/ATAuthSDK_D.framework/ATAuthSDK.bundle"; sourceTree = "<group>"; }; 04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = ATAuthSDK.bundle; path = "galaxy/Classes/Modules/AutoLogin(一键登录)/framework/ATAuthSDK_D.framework/ATAuthSDK.bundle"; sourceTree = "<group>"; };
...@@ -4732,6 +4752,7 @@ ...@@ -4732,6 +4752,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
045C0DB32D12CA5E00BD2DC0 /* YHSheetPickerView.swift */, 045C0DB32D12CA5E00BD2DC0 /* YHSheetPickerView.swift */,
04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */,
045C0DB42D12CA5E00BD2DC0 /* YHSheetPickerViewType.swift */, 045C0DB42D12CA5E00BD2DC0 /* YHSheetPickerViewType.swift */,
); );
path = PickerView; path = PickerView;
...@@ -5925,6 +5946,32 @@ ...@@ -5925,6 +5946,32 @@
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
047A968D2D16AA410033BB4E /* C */ = {
isa = PBXGroup;
children = (
047A968A2D16AA410033BB4E /* YHGCIncomeRecordViewController.swift */,
047A968B2D16AA410033BB4E /* YHGCIncomeRecordWorkExperienceViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
047A968E2D16AA410033BB4E /* IncomeRecord(收入记录) */ = {
isa = PBXGroup;
children = (
047A96942D1900D00033BB4E /* V */,
047A968D2D16AA410033BB4E /* C */,
);
path = "IncomeRecord(收入记录)";
sourceTree = "<group>";
};
047A96942D1900D00033BB4E /* V */ = {
isa = PBXGroup;
children = (
047A96922D16C0900033BB4E /* YHInfoQuestionSelectionCell.swift */,
);
path = V;
sourceTree = "<group>";
};
04AE1FF92D12CFAF00891D24 /* C */ = { 04AE1FF92D12CFAF00891D24 /* C */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -6019,6 +6066,7 @@ ...@@ -6019,6 +6066,7 @@
04AE200D2D12CFAF00891D24 /* ServiceProcess(我的信息流程) */ = { 04AE200D2D12CFAF00891D24 /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
047A968E2D16AA410033BB4E /* IncomeRecord(收入记录) */,
0411CEE32D15063F00644D35 /* WorkExperience(工作经验) */, 0411CEE32D15063F00644D35 /* WorkExperience(工作经验) */,
0411CED92D14000D00644D35 /* MainApplicantInformation(主申请人信息) */, 0411CED92D14000D00644D35 /* MainApplicantInformation(主申请人信息) */,
04AE20382D13BAC400891D24 /* Education&Qualification(学历专业资格填写) */, 04AE20382D13BAC400891D24 /* Education&Qualification(学历专业资格填写) */,
...@@ -6032,6 +6080,8 @@ ...@@ -6032,6 +6080,8 @@
04AE200E2D12CFAF00891D24 /* TTPS(高才) */ = { 04AE200E2D12CFAF00891D24 /* TTPS(高才) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04AE20572D19448800891D24 /* FileList(文件清单) */,
04AE20442D1940C700891D24 /* MyCertificates(我的证书) */,
04AE1FFC2D12CFAF00891D24 /* MyScheme(我的方案) */, 04AE1FFC2D12CFAF00891D24 /* MyScheme(我的方案) */,
04AE200D2D12CFAF00891D24 /* ServiceProcess(我的信息流程) */, 04AE200D2D12CFAF00891D24 /* ServiceProcess(我的信息流程) */,
); );
...@@ -6137,6 +6187,58 @@ ...@@ -6137,6 +6187,58 @@
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
04AE20442D1940C700891D24 /* MyCertificates(我的证书) */ = {
isa = PBXGroup;
children = (
04AE20482D19413F00891D24 /* V */,
04AE20462D19412700891D24 /* C */,
04AE20452D19411700891D24 /* M */,
);
path = "MyCertificates(我的证书)";
sourceTree = "<group>";
};
04AE20452D19411700891D24 /* M */ = {
isa = PBXGroup;
children = (
);
path = M;
sourceTree = "<group>";
};
04AE20462D19412700891D24 /* C */ = {
isa = PBXGroup;
children = (
04AE204D2D1941FC00891D24 /* YHGCCertificateListContainerVC.swift */,
04AE204F2D19425900891D24 /* YHGCCertificateListVC.swift */,
04AE20512D1942E400891D24 /* YHGCCertificateSearchViewController.swift */,
04AE20532D19434400891D24 /* YHGCCertificateUploadContentListVC.swift */,
04AE20552D1943EF00891D24 /* YHGCMineCertificateEntryViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
04AE20482D19413F00891D24 /* V */ = {
isa = PBXGroup;
children = (
);
path = V;
sourceTree = "<group>";
};
04AE20572D19448800891D24 /* FileList(文件清单) */ = {
isa = PBXGroup;
children = (
04AE20582D1944A400891D24 /* C */,
);
path = "FileList(文件清单)";
sourceTree = "<group>";
};
04AE20582D1944A400891D24 /* C */ = {
isa = PBXGroup;
children = (
04AE20592D1944D600891D24 /* YHGCMyFileListViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
04E86E212B81E9FA00A35F4B /* Recovered References */ = { 04E86E212B81E9FA00A35F4B /* Recovered References */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -6558,6 +6660,7 @@ ...@@ -6558,6 +6660,7 @@
045C10142D12CA5F00BD2DC0 /* YHResignCertificateDetailViewModel.swift in Sources */, 045C10142D12CA5F00BD2DC0 /* YHResignCertificateDetailViewModel.swift in Sources */,
045C10152D12CA5F00BD2DC0 /* YHAdopterTravelCardTableViewCell.swift in Sources */, 045C10152D12CA5F00BD2DC0 /* YHAdopterTravelCardTableViewCell.swift in Sources */,
045C10162D12CA5F00BD2DC0 /* YHOtherServiceViewController.swift in Sources */, 045C10162D12CA5F00BD2DC0 /* YHOtherServiceViewController.swift in Sources */,
047A96932D16C0900033BB4E /* YHInfoQuestionSelectionCell.swift in Sources */,
045C10172D12CA5F00BD2DC0 /* YHHKImmigrationEditRecordModel.swift in Sources */, 045C10172D12CA5F00BD2DC0 /* YHHKImmigrationEditRecordModel.swift in Sources */,
045C10182D12CA5F00BD2DC0 /* YHMyFileMethodTableViewCell.swift in Sources */, 045C10182D12CA5F00BD2DC0 /* YHMyFileMethodTableViewCell.swift in Sources */,
045C10192D12CA5F00BD2DC0 /* YHVisaRenewalPresenceStatus.swift in Sources */, 045C10192D12CA5F00BD2DC0 /* YHVisaRenewalPresenceStatus.swift in Sources */,
...@@ -6697,6 +6800,7 @@ ...@@ -6697,6 +6800,7 @@
045C10912D12CA5F00BD2DC0 /* YHDocumentFileItemView.swift in Sources */, 045C10912D12CA5F00BD2DC0 /* YHDocumentFileItemView.swift in Sources */,
045C10922D12CA5F00BD2DC0 /* YHPreviewInfoHoldView.swift in Sources */, 045C10922D12CA5F00BD2DC0 /* YHPreviewInfoHoldView.swift in Sources */,
045C10932D12CA5F00BD2DC0 /* YHResignAppointGuideLineView.swift in Sources */, 045C10932D12CA5F00BD2DC0 /* YHResignAppointGuideLineView.swift in Sources */,
04AE205A2D1944D600891D24 /* YHGCMyFileListViewController.swift in Sources */,
045C10942D12CA5F00BD2DC0 /* YHWorkItemListViewModel.swift in Sources */, 045C10942D12CA5F00BD2DC0 /* YHWorkItemListViewModel.swift in Sources */,
045C10952D12CA5F00BD2DC0 /* YHHomeInfoSectionCell.swift in Sources */, 045C10952D12CA5F00BD2DC0 /* YHHomeInfoSectionCell.swift in Sources */,
045C10962D12CA5F00BD2DC0 /* YHShareViewOnTablebarView.swift in Sources */, 045C10962D12CA5F00BD2DC0 /* YHShareViewOnTablebarView.swift in Sources */,
...@@ -6780,6 +6884,7 @@ ...@@ -6780,6 +6884,7 @@
045C10E32D12CA5F00BD2DC0 /* YHRiskWarningCell.swift in Sources */, 045C10E32D12CA5F00BD2DC0 /* YHRiskWarningCell.swift in Sources */,
045C10E42D12CA5F00BD2DC0 /* YHFileRenameInputView.swift in Sources */, 045C10E42D12CA5F00BD2DC0 /* YHFileRenameInputView.swift in Sources */,
045C10E52D12CA5F00BD2DC0 /* YHLookResignResultFootView.swift in Sources */, 045C10E52D12CA5F00BD2DC0 /* YHLookResignResultFootView.swift in Sources */,
04AE204E2D1941FC00891D24 /* YHGCCertificateListContainerVC.swift in Sources */,
045C10E62D12CA5F00BD2DC0 /* YHInvitationWithGiftsViewController.swift in Sources */, 045C10E62D12CA5F00BD2DC0 /* YHInvitationWithGiftsViewController.swift in Sources */,
045C10E72D12CA5F00BD2DC0 /* YHContractMainItemStatusCell.swift in Sources */, 045C10E72D12CA5F00BD2DC0 /* YHContractMainItemStatusCell.swift in Sources */,
045C10E82D12CA5F00BD2DC0 /* YHMessageDetailListVC.swift in Sources */, 045C10E82D12CA5F00BD2DC0 /* YHMessageDetailListVC.swift in Sources */,
...@@ -6867,6 +6972,7 @@ ...@@ -6867,6 +6972,7 @@
045C113A2D12CA5F00BD2DC0 /* YHAIViewModel.swift in Sources */, 045C113A2D12CA5F00BD2DC0 /* YHAIViewModel.swift in Sources */,
045C113B2D12CA5F00BD2DC0 /* YHButlerServiceMessageHandler.swift in Sources */, 045C113B2D12CA5F00BD2DC0 /* YHButlerServiceMessageHandler.swift in Sources */,
045C113C2D12CA5F00BD2DC0 /* YHResignScheduleLineCollectCell.swift in Sources */, 045C113C2D12CA5F00BD2DC0 /* YHResignScheduleLineCollectCell.swift in Sources */,
04AE20502D19425900891D24 /* YHGCCertificateListVC.swift in Sources */,
045C113D2D12CA5F00BD2DC0 /* YHMyFileListCell.swift in Sources */, 045C113D2D12CA5F00BD2DC0 /* YHMyFileListCell.swift in Sources */,
045C113E2D12CA5F00BD2DC0 /* YHLookResignResultModel.swift in Sources */, 045C113E2D12CA5F00BD2DC0 /* YHLookResignResultModel.swift in Sources */,
045C113F2D12CA5F00BD2DC0 /* YHIncomeTypeSelectCell.swift in Sources */, 045C113F2D12CA5F00BD2DC0 /* YHIncomeTypeSelectCell.swift in Sources */,
...@@ -6874,6 +6980,8 @@ ...@@ -6874,6 +6980,8 @@
045C11412D12CA5F00BD2DC0 /* AppDelegate.swift in Sources */, 045C11412D12CA5F00BD2DC0 /* AppDelegate.swift in Sources */,
045C11422D12CA5F00BD2DC0 /* YHEditHonorViewController.swift in Sources */, 045C11422D12CA5F00BD2DC0 /* YHEditHonorViewController.swift in Sources */,
045C11432D12CA5F00BD2DC0 /* YHMyFriendsNoDataView.swift in Sources */, 045C11432D12CA5F00BD2DC0 /* YHMyFriendsNoDataView.swift in Sources */,
047A968F2D16AA410033BB4E /* YHGCIncomeRecordViewController.swift in Sources */,
047A96902D16AA410033BB4E /* YHGCIncomeRecordWorkExperienceViewController.swift in Sources */,
045C11442D12CA5F00BD2DC0 /* YHLoginStyleButton.swift in Sources */, 045C11442D12CA5F00BD2DC0 /* YHLoginStyleButton.swift in Sources */,
045C11452D12CA5F00BD2DC0 /* YHListViewModel.swift in Sources */, 045C11452D12CA5F00BD2DC0 /* YHListViewModel.swift in Sources */,
045C11462D12CA5F00BD2DC0 /* YHSearchInfoHistoryView.swift in Sources */, 045C11462D12CA5F00BD2DC0 /* YHSearchInfoHistoryView.swift in Sources */,
...@@ -6986,6 +7094,7 @@ ...@@ -6986,6 +7094,7 @@
045C11AC2D12CA5F00BD2DC0 /* YHSpousePrimaryInfoVC.swift in Sources */, 045C11AC2D12CA5F00BD2DC0 /* YHSpousePrimaryInfoVC.swift in Sources */,
045C11AD2D12CA5F00BD2DC0 /* YHLiveMessageListView.swift in Sources */, 045C11AD2D12CA5F00BD2DC0 /* YHLiveMessageListView.swift in Sources */,
045C11AE2D12CA5F00BD2DC0 /* YHItemModel.swift in Sources */, 045C11AE2D12CA5F00BD2DC0 /* YHItemModel.swift in Sources */,
04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */,
045C11AF2D12CA5F00BD2DC0 /* YHHUD.swift in Sources */, 045C11AF2D12CA5F00BD2DC0 /* YHHUD.swift in Sources */,
045C11B02D12CA5F00BD2DC0 /* YHResignDocumentCell.swift in Sources */, 045C11B02D12CA5F00BD2DC0 /* YHResignDocumentCell.swift in Sources */,
045C11B12D12CA5F00BD2DC0 /* YHYHAdopterTravelViewModel.swift in Sources */, 045C11B12D12CA5F00BD2DC0 /* YHYHAdopterTravelViewModel.swift in Sources */,
...@@ -7081,6 +7190,7 @@ ...@@ -7081,6 +7190,7 @@
045C120A2D12CA5F00BD2DC0 /* YHScoreResultBaseModel.swift in Sources */, 045C120A2D12CA5F00BD2DC0 /* YHScoreResultBaseModel.swift in Sources */,
045C120B2D12CA5F00BD2DC0 /* YHCancelAppointAlertView.swift in Sources */, 045C120B2D12CA5F00BD2DC0 /* YHCancelAppointAlertView.swift in Sources */,
045C120C2D12CA5F00BD2DC0 /* YHOneKeyLoginManager.swift in Sources */, 045C120C2D12CA5F00BD2DC0 /* YHOneKeyLoginManager.swift in Sources */,
04AE20542D19434500891D24 /* YHGCCertificateUploadContentListVC.swift in Sources */,
045C120D2D12CA5F00BD2DC0 /* YHResignDocumentStage.swift in Sources */, 045C120D2D12CA5F00BD2DC0 /* YHResignDocumentStage.swift in Sources */,
045C120E2D12CA5F00BD2DC0 /* YHResignDocumentManagementVC.swift in Sources */, 045C120E2D12CA5F00BD2DC0 /* YHResignDocumentManagementVC.swift in Sources */,
045C120F2D12CA5F00BD2DC0 /* YHLocalizable.swift in Sources */, 045C120F2D12CA5F00BD2DC0 /* YHLocalizable.swift in Sources */,
...@@ -7174,6 +7284,7 @@ ...@@ -7174,6 +7284,7 @@
045C12662D12CA5F00BD2DC0 /* YHScorePersonInfoCell.swift in Sources */, 045C12662D12CA5F00BD2DC0 /* YHScorePersonInfoCell.swift in Sources */,
045C12672D12CA5F00BD2DC0 /* YHServiceOrderTipsView.swift in Sources */, 045C12672D12CA5F00BD2DC0 /* YHServiceOrderTipsView.swift in Sources */,
045C12682D12CA5F00BD2DC0 /* YHWorkExampleMessageView.swift in Sources */, 045C12682D12CA5F00BD2DC0 /* YHWorkExampleMessageView.swift in Sources */,
04AE20522D1942E400891D24 /* YHGCCertificateSearchViewController.swift in Sources */,
045C12692D12CA5F00BD2DC0 /* YHResignGuidelinesExampleViewController.swift in Sources */, 045C12692D12CA5F00BD2DC0 /* YHResignGuidelinesExampleViewController.swift in Sources */,
045C126A2D12CA5F00BD2DC0 /* YHPlayerTransitionAnimator.swift in Sources */, 045C126A2D12CA5F00BD2DC0 /* YHPlayerTransitionAnimator.swift in Sources */,
045C126B2D12CA5F00BD2DC0 /* YHLookResignResultViewController.swift in Sources */, 045C126B2D12CA5F00BD2DC0 /* YHLookResignResultViewController.swift in Sources */,
...@@ -7244,6 +7355,7 @@ ...@@ -7244,6 +7355,7 @@
045C12AC2D12CA5F00BD2DC0 /* YHSearchInfomationVC.swift in Sources */, 045C12AC2D12CA5F00BD2DC0 /* YHSearchInfomationVC.swift in Sources */,
045C12AD2D12CA5F00BD2DC0 /* YHResignUploadTravelCardFootViewController.swift in Sources */, 045C12AD2D12CA5F00BD2DC0 /* YHResignUploadTravelCardFootViewController.swift in Sources */,
045C12AE2D12CA5F00BD2DC0 /* YHOffivialApprovalSuccessCheckView.swift in Sources */, 045C12AE2D12CA5F00BD2DC0 /* YHOffivialApprovalSuccessCheckView.swift in Sources */,
04AE20562D1943EF00891D24 /* YHGCMineCertificateEntryViewController.swift in Sources */,
045C12AF2D12CA5F00BD2DC0 /* YHFamilyMemberInfoCell.swift in Sources */, 045C12AF2D12CA5F00BD2DC0 /* YHFamilyMemberInfoCell.swift in Sources */,
045C12B02D12CA5F00BD2DC0 /* YHAdopterAddNewTableViewCell.swift in Sources */, 045C12B02D12CA5F00BD2DC0 /* YHAdopterAddNewTableViewCell.swift in Sources */,
045C12B12D12CA5F00BD2DC0 /* YHMyDocumentsDetailViewController.swift in Sources */, 045C12B12D12CA5F00BD2DC0 /* YHMyDocumentsDetailViewController.swift in Sources */,
......
...@@ -150,7 +150,7 @@ extension YHHomeInformationViewController : CollectionViewWaterfallLayoutDelegat ...@@ -150,7 +150,7 @@ extension YHHomeInformationViewController : CollectionViewWaterfallLayoutDelegat
return 0.0 return 0.0
} }
var row = self.sectionItems.count/3 var row = self.sectionItems.count/3
if row%3 != 0 { if self.sectionItems.count%3 != 0 {
row = row + 1 row = row + 1
} }
let listHeight = Float(Double(row) * kHomeItemHeight) let listHeight = Float(Double(row) * kHomeItemHeight)
......
...@@ -20,7 +20,7 @@ class YHHomeInfoSectionHeadView: UICollectionReusableView { ...@@ -20,7 +20,7 @@ class YHHomeInfoSectionHeadView: UICollectionReusableView {
didSet { didSet {
self.collectView.reloadData() self.collectView.reloadData()
var row = items.count/3 var row = items.count/3
if row%3 != 0 { if items.count%3 != 0 {
row = row + 1 row = row + 1
} }
let totalHeight = Double(row) * kHomeItemHeight let totalHeight = Double(row) * kHomeItemHeight
......
...@@ -619,11 +619,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -619,11 +619,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
self.showTipsAlert() self.showTipsAlert()
return return
} }
if serviceCenterMainReqVM.myInfoFillStep > 0 { gotoApplyTypeVC()
gotoApplyTypeVC(.typeA)
} else {
gotoApplyTypeVC(nil)
}
//高A- 申请类别 //高A- 申请类别
} else if tapIndex == 1 { } else if tapIndex == 1 {
//高A- 主申请人信息 //高A- 主申请人信息
...@@ -661,17 +657,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -661,17 +657,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
self.showTipsAlert() self.showTipsAlert()
return return
} }
if serviceCenterMainReqVM.myInfoFillStep > 0 { gotoApplyTypeVC()
var type: YHGCApplicationType = .typeB
if productType == 2 {
type = .typeB
} else if productType == 3 {
type = .typeC
}
gotoApplyTypeVC(type)
} else {
gotoApplyTypeVC(nil)
}
//高才BC- 申请类别 //高才BC- 申请类别
} else if tapIndex == 1 { } else if tapIndex == 1 {
//高才BC- 主申请人信息 //高才BC- 主申请人信息
...@@ -710,13 +696,29 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -710,13 +696,29 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
} }
} }
private func gotoApplyTypeVC(_ type: YHGCApplicationType?) { private func gotoApplyTypeVC() {
let orderId = orderId ?? 0
YHHUD.show(.progress(message: "加载中..."))
YHGCApplicationTypeViewModel().getApplyType(orderId: orderId) { [weak self] model, error in
YHHUD.hide()
guard let self = self else {
return
}
guard let model = model else {
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg)
}
return
}
let type = YHGCApplicationType(rawValue: model.apply_type)
if let type = type { if let type = type {
let ctl = YHGCApplicationTypeResultController(type: type) let ctl = YHGCApplicationTypeResultController(type: type)
navigationController?.pushViewController(ctl) self.navigationController?.pushViewController(ctl)
} else { } else {
let ctl = YHGCApplicationTypeController(orderId: orderId ?? 0) let ctl = YHGCApplicationTypeController(orderId: orderId)
navigationController?.pushViewController(ctl) self.navigationController?.pushViewController(ctl)
}
} }
} }
} }
...@@ -283,8 +283,13 @@ class YHServiceOrderListViewController: YHBaseViewController { ...@@ -283,8 +283,13 @@ class YHServiceOrderListViewController: YHBaseViewController {
} else if type == 202 { } else if type == 202 {
//高才我的方案 //高才我的方案
} else if type == 203 { } else if type == 203 {
//高才我的证件 //高才我的证件
let vc = YHGCMineCertificateEntryViewController()
vc.orderId = orderId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 204 { } else if type == 204 {
//高才我的签字 //高才我的签字
} }
......
...@@ -44,6 +44,8 @@ class YHEducationInfo: SmartCodable { ...@@ -44,6 +44,8 @@ class YHEducationInfo: SmartCodable {
var admissionTime: String? var admissionTime: String?
var graduateTime: String? var graduateTime: String?
var vacantNum: Int = 0 var vacantNum: Int = 0
var majorOther: String?
var hasBachelorDegree: Int = 0
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case id = "id" case id = "id"
...@@ -53,11 +55,30 @@ class YHEducationInfo: SmartCodable { ...@@ -53,11 +55,30 @@ class YHEducationInfo: SmartCodable {
case admissionTime = "admission_time" case admissionTime = "admission_time"
case graduateTime = "graduate_time" case graduateTime = "graduate_time"
case vacantNum = "vacant_num" case vacantNum = "vacant_num"
case majorOther = "major_other"
case hasBachelorDegree = "has_bachelor_degree"
} }
required init() { required init() {
} }
func getDegree() -> String {
if hasBachelorDegree == 1 {
return "学士学位"
}
if hasBachelorDegree == 2 {
return "无学位"
}
return ""
}
func getRealMajor() -> String? {
if let major = major, major == "其他" {
return majorOther
}
return major
}
} }
class YHQualificationInfo: SmartCodable { class YHQualificationInfo: SmartCodable {
...@@ -94,6 +115,20 @@ class YHEducationDetailInfo: SmartCodable { ...@@ -94,6 +115,20 @@ class YHEducationDetailInfo: SmartCodable {
// 证件提供确认 0 未选择 1 是 2 否 // 证件提供确认 0 未选择 1 是 2 否
var certConfirm: Int = 0 var certConfirm: Int = 0
func isNeedInputMajor() -> Bool {
return major == "其他"
}
func getDegree() -> String {
if hasBachelorDegree == 1 {
return "学士学位"
}
if hasBachelorDegree == 2 {
return "无学位"
}
return ""
}
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case id = "id" case id = "id"
......
...@@ -182,6 +182,8 @@ enum YHFormDetailItemType:Int { ...@@ -182,6 +182,8 @@ enum YHFormDetailItemType:Int {
case graduateTime case graduateTime
// 专业 // 专业
case educationMajor case educationMajor
// 具体专业
case detailMajor
// 学位 // 学位
case educationDegree case educationDegree
// 学位类型 // 学位类型
...@@ -508,6 +510,8 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -508,6 +510,8 @@ class YHFormDetailItem : YHFormItemProtocol {
return "毕业年月".local return "毕业年月".local
case .educationMajor: case .educationMajor:
return "专业".local return "专业".local
case .detailMajor:
return "具体专业".local
case .educationDegree: case .educationDegree:
return "学位".local return "学位".local
case .degreeType: case .degreeType:
......
//
// YHDynamicSheetPickerView.swift
// galaxy
//
// Created by alexzzw on 2024/12/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHDynamicSheetPickerView: UIView {
let dataSource: [String]
// 选择的行
var selectRow: Int = 0
private var selectBlock: ((Int) -> Void)?
var title: String? {
didSet {
titleLabel.text = title
}
}
lazy var pickerView: UIPickerView = {
let view = UIPickerView()
view.dataSource = self
view.delegate = self
return view
}()
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var topView: UIView = {
let view = UIView()
view.addSubview(titleLabel)
view.addSubview(cancelBtn)
view.addSubview(confirmBtn)
view.addSubview(topLineView)
titleLabel.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
cancelBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(21)
make.centerY.equalToSuperview()
make.size.equalTo(CGSizeMake(30, 20))
}
confirmBtn.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-21)
make.centerY.equalToSuperview()
make.size.equalTo(CGSizeMake(30, 20))
}
topLineView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(21)
make.right.equalToSuperview().offset(-21)
make.bottom.equalToSuperview()
make.height.equalTo(1)
}
return view
}()
lazy var topLineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#F0F0F0")
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.font = UIFont.PFSC_M(ofSize: 17)
label.text = "请选择"
return label
}()
lazy var cancelBtn: UIButton = {
let btn = UIButton()
btn.setTitle("取消".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(UIColor.mainTextColor, for: .normal)
btn.addTarget(self, action: #selector(didClickCancelButton), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
lazy var confirmBtn: UIButton = {
let btn = UIButton()
btn.setTitle("确定".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(UIColor.brandMainColor, for: .normal)
btn.addTarget(self, action: #selector(didClickConfirmButton), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
init(dataSource: [String]) {
self.dataSource = dataSource
super.init(frame: UIScreen.main.bounds)
createUI()
}
func show() {
showSelectRow()
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
func showSelectRow() {
if selectRow < dataSource.count {
pickerView.selectRow(selectRow, inComponent: 0, animated: true)
} else {
selectRow = 0
pickerView.selectRow(0, inComponent: 0, animated: true)
}
}
static func show(dataSource: [String], title: String, selectIndex: Int, callBack: @escaping ((Int) -> Void)) {
let picker = YHDynamicSheetPickerView(dataSource: dataSource)
picker.title = title
picker.selectRow = selectIndex < dataSource.count ? selectIndex : 0
picker.selectBlock = callBack
picker.show()
}
static func show(dataSource: [String], title: String, selectTitle: String?, callBack: @escaping ((Int) -> Void)) {
let picker = YHDynamicSheetPickerView(dataSource: dataSource)
picker.title = title
if let selectTitle = selectTitle, let firstIndex = dataSource.firstIndex(of: selectTitle) {
picker.selectRow = firstIndex
} else {
picker.selectRow = 0
}
picker.selectBlock = callBack
picker.show()
}
func createUI() {
addSubview(blackMaskView)
addSubview(whiteContentView)
whiteContentView.addSubview(topView)
whiteContentView.addSubview(pickerView)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corner, cornerRadii: CGSizeMake(kCornerRadius6, kCornerRadius6))
let layer = CAShapeLayer()
layer.frame = whiteContentView.bounds
layer.path = path.cgPath
whiteContentView.layer.mask = layer
if let title = title {
titleLabel.text = title
}
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
let whiteContentHeight = 322.0
whiteContentView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(whiteContentHeight)
}
topView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(52)
}
pickerView.snp.makeConstraints { make in
make.top.equalTo(topView.snp.bottom)
make.left.right.bottom.equalToSuperview()
}
}
}
extension YHDynamicSheetPickerView {
@objc func didClickCancelButton() {
dismiss()
}
@objc func didClickConfirmButton() {
selectBlock?(selectRow)
dismiss()
}
@objc func dismiss() {
removeFromSuperview()
}
}
// MARK: - UIPickerViewDelegate
extension YHDynamicSheetPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
if !dataSource.isEmpty {
return dataSource.count
}
return 0
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
if 0 <= row && row < dataSource.count {
return dataSource[row]
}
return ""
}
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
if 0 <= row && row < dataSource.count {
selectRow = row
// 刷新picker,看上面的代理
pickerView.reloadComponent(component)
}
}
func pickerView(_ pickerView: UIPickerView, widthForComponent component: Int) -> CGFloat {
return KScreenWidth - 16 * 2
}
func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
return 42.0
}
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .center
label.numberOfLines = 2
label.text = ""
if 0 <= row && row < dataSource.count {
label.text = dataSource[row]
}
if selectRow == row {
label.font = UIFont.PFSC_M(ofSize: 14)
} else {
label.font = UIFont.PFSC_R(ofSize: 14)
}
// 选中背景色
if #available(iOS 14.0, *), pickerView.subviews.count > 1 {
pickerView.subviews[1].backgroundColor = UIColor.brandMainColor6
}
return label
}
}
...@@ -179,6 +179,10 @@ class YHSheetPickerView: UIView { ...@@ -179,6 +179,10 @@ class YHSheetPickerView: UIView {
YHSheetPickerViewItem(title:"硕士学位".local, index:2), YHSheetPickerViewItem(title:"硕士学位".local, index:2),
YHSheetPickerViewItem(title:"博士学位".local, index:3) YHSheetPickerViewItem(title:"博士学位".local, index:3)
], ],
.degree2:
[YHSheetPickerViewItem(title:"无学位".local, index:2),
YHSheetPickerViewItem(title:"学士学位".local, index:1),
],
// 学位2 // 学位2
.educationDegree: .educationDegree:
...@@ -317,6 +321,22 @@ class YHSheetPickerView: UIView { ...@@ -317,6 +321,22 @@ class YHSheetPickerView: UIView {
YHSheetPickerViewItem(title:"社会科学".local, index:10), YHSheetPickerViewItem(title:"社会科学".local, index:10),
YHSheetPickerViewItem(title:"其他".local, index:11), YHSheetPickerViewItem(title:"其他".local, index:11),
], ],
.major:
[YHSheetPickerViewItem(title:"艺术与人文学科".local, index:0),
YHSheetPickerViewItem(title:"经济及工商管理".local, index:1),
YHSheetPickerViewItem(title:"教育".local, index:2),
YHSheetPickerViewItem(title:"法学".local, index:3),
YHSheetPickerViewItem(title:"社会科学".local, index:4),
YHSheetPickerViewItem(title:"电脑科学".local, index:5),
YHSheetPickerViewItem(title:"工程学".local, index:6),
YHSheetPickerViewItem(title:"生命科学及医学".local, index:7),
YHSheetPickerViewItem(title:"物理/自然科学".local, index:8),
YHSheetPickerViewItem(title:"心理学".local, index:9),
YHSheetPickerViewItem(title:"其他".local, index:9),
],
] ]
func createUI() { func createUI() {
...@@ -399,6 +419,8 @@ extension YHSheetPickerView { ...@@ -399,6 +419,8 @@ extension YHSheetPickerView {
return "" return ""
case .degree: case .degree:
return "选择学位" return "选择学位"
case .degree2:
return "选择学位"
case .educationDegree: case .educationDegree:
return "选择学位" return "选择学位"
case .marriageText: case .marriageText:
...@@ -427,6 +449,9 @@ extension YHSheetPickerView { ...@@ -427,6 +449,9 @@ extension YHSheetPickerView {
return "选择学位类型" return "选择学位类型"
case .selectAdress: case .selectAdress:
return "选择国家地区" return "选择国家地区"
case .major:
return "选择专业"
} }
} }
......
...@@ -14,7 +14,8 @@ enum YHSheetPickerViewType: Int { ...@@ -14,7 +14,8 @@ enum YHSheetPickerViewType: Int {
case none = 0 case none = 0
// 学位 // 学位
case degree case degree
// 学位2 (包含无学位类型) case degree2
// 学位(包含无学位类型)
case educationDegree case educationDegree
// 学位有无 // 学位有无
case ownDegree case ownDegree
...@@ -42,6 +43,8 @@ enum YHSheetPickerViewType: Int { ...@@ -42,6 +43,8 @@ enum YHSheetPickerViewType: Int {
case degreeCategory case degreeCategory
// 国家地区 // 国家地区
case selectAdress case selectAdress
// 专业
case major
} }
class YHSheetPickerViewItem { class YHSheetPickerViewItem {
......
...@@ -209,6 +209,25 @@ class YHFormItemDoubleChoiceCell: UITableViewCell { ...@@ -209,6 +209,25 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
func setTips(_ tips:String?, isShow:Bool) { func setTips(_ tips:String?, isShow:Bool) {
tipsLabel.text = tips tipsLabel.text = tips
tipsLabel.isHidden = !isShow tipsLabel.isHidden = !isShow
if isShow {
tipsLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
make.top.equalTo(titleLabel.snp.bottom)
make.bottom.equalToSuperview().offset(-16).priority(.medium)
}
} else {
tipsLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
make.height.equalTo(0)
make.top.equalTo(titleLabel.snp.bottom)
make.bottom.equalToSuperview().offset(-16).priority(.medium)
}
}
self.setNeedsLayout()
self.layoutIfNeeded()
} }
// 更新答案按钮选中状态 // 更新答案按钮选中状态
......
...@@ -88,6 +88,8 @@ extension YHEmploymentVerificationAvailableCell { ...@@ -88,6 +88,8 @@ extension YHEmploymentVerificationAvailableCell {
infoTitleLabel.snp.makeConstraints { make in infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(dotIcon.snp.right).offset(2) make.left.equalTo(dotIcon.snp.right).offset(2)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.top.greaterThanOrEqualToSuperview().offset(16)
make.bottom.lessThanOrEqualToSuperview().offset(-16)
} }
rightArrowIcon.snp.makeConstraints { make in rightArrowIcon.snp.makeConstraints { make in
......
...@@ -132,9 +132,10 @@ class YHOtherPickerView: UIView { ...@@ -132,9 +132,10 @@ class YHOtherPickerView: UIView {
}() }()
init(type: YHOtherPickerViewType) { init(type: YHOtherPickerViewType, _ dataSource: [YHOtherPickerViewItemData] = []) {
super.init(frame: UIScreen.main.bounds) super.init(frame: UIScreen.main.bounds)
self.createUI() self.createUI()
self.arrData = dataSource
self.type = type self.type = type
initDataSource() initDataSource()
...@@ -151,11 +152,11 @@ class YHOtherPickerView: UIView { ...@@ -151,11 +152,11 @@ class YHOtherPickerView: UIView {
UIApplication.shared.yhKeyWindow()?.addSubview(self) UIApplication.shared.yhKeyWindow()?.addSubview(self)
} }
static func show(type:YHOtherPickerViewType, selectTitle: String = "", callBack: @escaping ((YHOtherPickerViewItemData)->Void)) { static func show(type:YHOtherPickerViewType, selectTitle: String = "", _ dataSource: [YHOtherPickerViewItemData] = [],callBack: @escaping ((YHOtherPickerViewItemData)->Void)) {
IQKeyboardManager.shared.resignFirstResponder() IQKeyboardManager.shared.resignFirstResponder()
let picker = YHOtherPickerView(type: type) let picker = YHOtherPickerView(type: type, dataSource)
picker.selectBlock = callBack picker.selectBlock = callBack
picker.show() picker.show()
picker.selectTitle = selectTitle picker.selectTitle = selectTitle
...@@ -250,6 +251,10 @@ class YHOtherPickerView: UIView { ...@@ -250,6 +251,10 @@ class YHOtherPickerView: UIView {
return "选择国家地区" return "选择国家地区"
case .field: case .field:
return "选择经验领域" return "选择经验领域"
case .myCompany:
return "选择可提供的在职公司"
case .position:
return "选择职位界别"
default: default:
return "请选择" return "请选择"
} }
...@@ -277,7 +282,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource { ...@@ -277,7 +282,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat { func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
switch type { switch type {
case .nature,.certificate,.structure,.level,.prove,.idType,.sex,.marry,.constellation,.field: case .nature,.certificate,.structure,.level,.prove,.idType,.sex,.marry,.constellation,.field,.myCompany,.position:
return 50 return 50
default: default:
return 70 return 70
...@@ -287,7 +292,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource { ...@@ -287,7 +292,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
switch type { switch type {
case .nature,.certificate,.structure,.level,.prove,.idType,.travelIdType,.sex,.marry,.constellation,.selectAddress,.field: case .nature,.certificate,.structure,.level,.prove,.idType,.travelIdType,.sex,.marry,.constellation,.selectAddress,.field,.myCompany,.position:
let label = UILabel() let label = UILabel()
label.textColor = UIColor.mainTextColor label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 14) label.font = UIFont.PFSC_M(ofSize: 14)
...@@ -460,6 +465,14 @@ extension YHOtherPickerView { ...@@ -460,6 +465,14 @@ extension YHOtherPickerView {
arrData.append(model) arrData.append(model)
} }
title = getTitle(type: type) title = getTitle(type: type)
case .position:
let arr = YHConstantArrayData.arrposition
arrData.removeAll()
arr.forEach { item in
let model = YHOtherPickerViewItemData(title: item["title"] ?? "-", subTitle: "", index: item["id"] ?? "-")
arrData.append(model)
}
title = getTitle(type: type)
default: default:
return return
} }
......
...@@ -21,6 +21,8 @@ enum YHWorkExperienceSelectType: Int { ...@@ -21,6 +21,8 @@ enum YHWorkExperienceSelectType: Int {
case prove = 9 case prove = 9
case company = 10 case company = 10
case field = 11 case field = 11
case myCompany = 12
case position = 13
} }
enum YHWorkExperienceID: Int { enum YHWorkExperienceID: Int {
......
...@@ -24,6 +24,7 @@ class YHWorkExperienceItemView: UIView { ...@@ -24,6 +24,7 @@ class YHWorkExperienceItemView: UIView {
var country: String = "" var country: String = ""
var workId: Int = 0 var workId: Int = 0
var orderId: Int = 0 var orderId: Int = 0
var companyList: [YHWorkItemListModel] = []
var dataSource: YHWorkExperienceModel? { var dataSource: YHWorkExperienceModel? {
didSet { didSet {
updateAllViews() updateAllViews()
...@@ -260,6 +261,10 @@ class YHWorkExperienceItemView: UIView { ...@@ -260,6 +261,10 @@ class YHWorkExperienceItemView: UIView {
} }
case .field: case .field:
break break
case .myCompany:
break
case .position:
break
} }
} }
nextStepImageView.isHidden = false nextStepImageView.isHidden = false
...@@ -539,6 +544,29 @@ class YHWorkExperienceItemView: UIView { ...@@ -539,6 +544,29 @@ class YHWorkExperienceItemView: UIView {
block(self.dataSource ?? YHWorkExperienceModel()) block(self.dataSource ?? YHWorkExperienceModel())
} }
} }
case .myCompany:
var arrData: [YHOtherPickerViewItemData] = []
companyList.forEach { item in
let model = YHOtherPickerViewItemData(title: item.company_name ?? "", subTitle: "", index: "\(item.id ?? 0)")
arrData.append(model)
}
YHOtherPickerView.show(type: .myCompany, selectTitle: self.dataSource?.message ?? "", arrData) {[weak self] data in
guard let self = self else { return }
self.dataSource?.message = data.title
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHWorkExperienceModel())
}
}
case .position:
YHOtherPickerView.show(type: .position, selectTitle: self.dataSource?.message ?? "") {[weak self] data in
guard let self = self else { return }
self.dataSource?.message = data.title
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHWorkExperienceModel())
}
}
} }
} }
} }
......
...@@ -122,6 +122,12 @@ class YHWorkExperiencePositionListTableViewCell: UITableViewCell { ...@@ -122,6 +122,12 @@ class YHWorkExperiencePositionListTableViewCell: UITableViewCell {
block(model) block(model)
} }
} }
itemView.companyBlock = {[weak self] model in
guard let self = self else { return }
if let block = self.companyBlock {
block(model)
}
}
mainItemView.addSubview(itemView) mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in itemView.snp.makeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
......
//
// YHMyFileListViewController.swift
// galaxy
//
// Created by edy on 2024/7/4.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
import JXSegmentedView
import Photos
import GKNavigationBarSwift
import TYSnapshotScroll
class YHGCMyFileListViewController: YHBaseViewController {
let topSegmentHeight = 48.0
var orderId : Int = 0
var items:[YHFileListModel] = []
lazy var titles:[String] = []
let viewModel: YHCertificateViewModel = YHCertificateViewModel()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .clear
bar.titleColor = .mainTextColor
bar.title = "待完善清单"
bar.backBlock = {
[weak self] in
guard let self = self else { return }
self.navigationController?.popViewController(animated: true)
}
return bar
}()
lazy var navStatusBar:UIView = {
let view = UIView()
view.addSubview(self.navBar)
self.navBar.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_statusBar())
make.height.equalTo(k_Height_NavContentBar)
}
view.clipsToBounds = true
return view
}()
let consentInsetTop = 140+k_Height_NavigationtBarAndStatuBar
lazy var tableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = UIColor.init(hex: 0xDCE4F1)
tableView.separatorStyle = .none
tableView.register(YHMyFileListCell.self, forCellReuseIdentifier: YHMyFileListCell.cellReuseIdentifier)
tableView.register(YHMyFileListNoneCell.self, forCellReuseIdentifier: YHMyFileListNoneCell.cellReuseIdentifier)
tableView.delegate = self
tableView.dataSource = self
tableView.tableHeaderView = self.headerView
return tableView
}()
lazy var fakeTableView: UITableView = {
let tableView = UITableView(frame: CGRect.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = UIColor.init(hex: 0xDCE4F1)
tableView.separatorStyle = .none
tableView.register(YHMyFileListCell.self, forCellReuseIdentifier: YHMyFileListCell.cellReuseIdentifier)
tableView.register(YHMyFileListNoneCell.self, forCellReuseIdentifier: YHMyFileListNoneCell.cellReuseIdentifier)
tableView.delegate = self
tableView.dataSource = self
let view = UIView(frame: self.headerView.frame)
tableView.tableHeaderView = view
return tableView
}()
lazy var bgImgView:UIImageView = {
let bgView = UIImageView(image: UIImage(named: "my_filelist_bg"))
return bgView
}()
lazy var totalLabel: UILabel = {
let label = UILabel()
return label
}()
let originHeaderHeight: CGFloat = 274.0-(88-k_Height_NavigationtBarAndStatuBar)
lazy var headerView:UIView = {
// 是否为刘海屏
let isNotchScreen = GKDevice.isNotchedScreen
let top = 88-k_Height_NavigationtBarAndStatuBar
let myView = UIView(frame: CGRectMake(0, 0, KScreenWidth, originHeaderHeight))
myView.clipsToBounds = true
bgImgView.frame = CGRectMake(0, -top, KScreenWidth, 264)
myView.addSubview(bgImgView)
self.totalLabel.frame = CGRectMake(26.0, 100+k_Height_NavigationtBarAndStatuBar+top, KScreenWidth-26*2, 20)
bgImgView.addSubview(self.totalLabel)
// 选择器背景
let view = UIView(frame: CGRectMake(16, self.consentInsetTop, KScreenWidth-16.0*2, 46))
view.clipsToBounds = true
myView.addSubview(view)
let whiteView = UIView(frame: CGRectMake(0, 0, KScreenWidth-16.0*2, 46.0+7.0))
whiteView.backgroundColor = .white
whiteView.layer.cornerRadius = 7.0
whiteView.clipsToBounds = true
view.addSubview(whiteView)
let grayView = UIView(frame: CGRectMake(1, 1, KScreenWidth-16.0*2-2, 46.0-2.0+6.0))
grayView.backgroundColor = UIColor.init(hex: 0xE5E9F2)
grayView.layer.cornerRadius = 6.0
view.addSubview(grayView)
view.addSubview(self.segmentView)
return myView
}()
lazy var segmentView:YHSegmentView = {
let view = YHSegmentView(frame: CGRect(x: 0, y: 0, width: KScreenWidth-16.0*2, height: 46))
view.items = titles
view.selectBlock = {
[weak self] index in
guard let self = self else { return }
self.scrollToSection(index)
}
return view
}()
lazy var topSegmentView:YHSegmentView = {
let view = YHSegmentView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: self.topSegmentHeight))
view.items = titles
view.isHidden = true
view.selectBlock = {
[weak self] index in
guard let self = self else { return }
self.scrollToSection(index)
}
return view
}()
lazy var bottomView = {
let view = UIView(frame: CGRectMake(0, 0, KScreenWidth, k_Height_safeAreaInsetsBottom()+64))
view.backgroundColor = .white
view.addSubview(self.saveBtn)
self.saveBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(8)
make.height.equalTo(48)
}
return view
}()
lazy var saveBtn:UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("保存清单图", for: .normal)
button.setTitleColor(.white, for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
button.isUserInteractionEnabled = false
button.layer.opacity = 0.3
button.addTarget(self, action: #selector(clickSaveBtn), for: .touchUpInside)
return button
}()
lazy var emptyView: YHFileListEmptyView = {
let view = YHFileListEmptyView()
view.isHidden = true
view.bottomBtnClick = {
[weak self] in
guard let self = self else { return }
NotificationCenter.default.post(name: YhConstant.YhNotification.didClickFileListBackToServiceTabNotifiction, object: nil)
}
return view
}()
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if self.tableView.contentSize != self.fakeTableView.contentSize {
self.tableView.contentSize = self.fakeTableView.contentSize
}
}
override func viewDidLoad() {
super.viewDidLoad()
gk_navigationBar.isHidden = true
self.view.backgroundColor = UIColor.init(hex: 0xDCE4F1)
self.view.addSubview(self.fakeTableView)
self.view.addSubview(self.tableView)
self.view.addSubview(self.bottomView)
self.view.addSubview(self.navStatusBar)
self.view.addSubview(self.topSegmentView)
self.view.addSubview(self.emptyView)
updateCount()
self.navStatusBar.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(k_Height_NavigationtBarAndStatuBar)
}
self.topSegmentView.snp.makeConstraints { make in
make.top.equalTo(self.navStatusBar.snp.bottom)
make.left.right.equalToSuperview()
make.height.equalTo(self.topSegmentHeight)
}
tableView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.right.equalToSuperview()
make.bottom.equalTo(self.bottomView.snp.top)
}
fakeTableView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.right.equalToSuperview()
make.bottom.equalTo(self.bottomView.snp.top)
}
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(k_Height_safeAreaInsetsBottom()+64.0)
}
emptyView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadData()
loadData2()
}
func updateCount() {
let submitCount = self.viewModel.certificateEntryModel?.to_be_submit_num ?? 0
let reuploadCount = self.viewModel.certificateEntryModel?.reject_num ?? 0
let textColor = UIColor.mainTextColor70
let countColor = UIColor.brandMainColor
let textFont = UIFont.PFSC_R(ofSize: 14)
let countFont = UIFont.PFSC_B(ofSize: 16)
let a: ASAttributedString = .init("您有 ", .font(textFont),.foreground(textColor))
let b: ASAttributedString = .init(NSAttributedString(string: String(submitCount)), .font(countFont),.foreground(countColor))
let c: ASAttributedString = .init(" 项待提交,", .font(textFont),.foreground(textColor))
let d: ASAttributedString = .init(NSAttributedString(string: String(reuploadCount)), .font(countFont),.foreground(countColor))
let e: ASAttributedString = .init(" 项需重传", .font(textFont),.foreground(textColor))
totalLabel.attributed.text = a+b+c+d+e
}
func scrollToSection(_ section:Int) {
if 0 <= section && section < self.items.count {
// 自定义布局contentSize计算不准导致setContentOffset失效故采用此方法
// fakeTableView 设计目的 1、每次刷新数据自动滚动到底部才能算完contentSize 2、scrollToRow后更正偏移会有抖动
printLog("fakeTableView.contentSize \(self.fakeTableView.contentSize)")
if self.tableView.contentSize != self.fakeTableView.contentSize {
self.tableView.contentSize = self.fakeTableView.contentSize
}
self.fakeTableView.scrollToRow(at: IndexPath(row: 0, section: section), at: .top, animated: false)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {
var gap = 0.0
// 此处处理内容总长度不够滚到相应tab的差距
let sectionRect = self.fakeTableView.rectForHeader(inSection: section)
if self.fakeTableView.contentOffset.y >= 0.0, sectionRect.origin.y > self.fakeTableView.contentOffset.y {
gap = sectionRect.origin.y - self.fakeTableView.contentOffset.y
}
let offsetY = self.fakeTableView.contentOffset.y-k_Height_NavigationtBarAndStatuBar-self.topSegmentHeight+gap
self.tableView.setContentOffset(CGPointMake(0, offsetY+4), animated: true)
})
}
}
}
extension YHGCMyFileListViewController : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if 0 <= section && section < items.count {
let model = items[section]
if model.supplement_list.count > 0 {
return model.supplement_list.count
}
return 1
}
return 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let noneCell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListNoneCell.cellReuseIdentifier, for: indexPath) as! YHMyFileListNoneCell
if 0 <= indexPath.section && indexPath.section < items.count {
let model = items[indexPath.section]
if model.supplement_list.count > 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyFileListCell.cellReuseIdentifier, for: indexPath) as! YHMyFileListCell
if 0 <= indexPath.row && indexPath.row < model.supplement_list.count {
cell.indexLabel.text = "\(indexPath.row+1)"
cell.model = model.supplement_list[indexPath.row]
cell.isLastCell = indexPath.row == model.supplement_list.count-1
}
return cell
}
}
return noneCell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if 0 <= indexPath.section && indexPath.section < items.count {
let model = items[indexPath.section]
if model.supplement_list.count > 0 {
return UITableView.automaticDimension
}
}
return 72.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
let model = items[indexPath.section]
if model.supplement_list.count > 0 {
let supplement = model.supplement_list[indexPath.row]
if supplement.checkStatus == YHCertificateUploadStatus.preUpload.rawValue { // 待上传
self.viewModel.showUploadSheetView(supplementId: supplement.id) {
[weak self] in
guard let self = self else { return }
DispatchQueue.main.async {
let vc = YHCertificateUploadContentListVC()
vc.orderId = self.orderId
vc.categoryId = model.category_id
vc.supplementId = supplement.id
self.navigationController?.pushViewController(vc)
}
}
return
}
// 非待上传的进入详情
let vc = YHCertificateUploadContentListVC()
vc.orderId = self.orderId
vc.categoryId = model.category_id
vc.supplementId = supplement.id
self.navigationController?.pushViewController(vc)
}
}
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = YHMyFileListHeaderView(frame: .zero)
view.headerView.isHidden = true
view.isShowCorner = items.count <= 1
if 0 <= section && section < items.count {
let model = items[section]
view.titleLabel.text = model.ApplicantName
if model.supplement_list.count > 0 {
view.headerView.isHidden = false
}
}
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if 0 <= section && section < items.count {
let model = items[section]
if model.supplement_list.count > 0 {
return 103.0
}
}
return 68.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == items.count-1 {
let view = YHMyFileListFooterView(frame: .zero)
return view
}
let view = UIView()
let view1 = UIView()
view1.backgroundColor = .white
view.addSubview(view1)
view1.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.bottom.equalToSuperview()
}
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == items.count-1 {
return UITableView.automaticDimension
}
return 0.01
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView == self.fakeTableView {
return
}
printLog("offset: \(scrollView.contentOffset.y)")
let segmentHeight = self.items.count <= 1 ? 0.0 : 46.0
let gap = self.consentInsetTop-k_Height_NavigationtBarAndStatuBar-self.topSegmentHeight+segmentHeight
self.navStatusBar.backgroundColor = scrollView.contentOffset.y > gap ? UIColor.white : UIColor.clear
self.topSegmentView.backgroundColor = scrollView.contentOffset.y > gap ? UIColor.white : UIColor.clear
self.topSegmentView.isHidden = scrollView.contentOffset.y < gap
var find:Bool = false
if items.count > 0 {
for index in 0..<items.count {
let rect = self.tableView.rectForHeader(inSection: index)
// section 到顶部选择tab的距离
let y = rect.origin.y-k_Height_NavigationtBarAndStatuBar-self.topSegmentHeight+24.0-self.tableView.contentOffset.y
if 0.0 <= y, y < self.tableView.height-k_Height_NavigationtBarAndStatuBar-self.topSegmentHeight {
find = true
self.topSegmentView.updateSelectIndex(index)
self.segmentView.updateSelectIndex(index)
break
}
}
}
// section 没有在可见区域出现
if !find {
if let arr = self.tableView.indexPathsForVisibleRows, let lastIndexPath = arr.last {
self.topSegmentView.updateSelectIndex(lastIndexPath.section)
self.segmentView.updateSelectIndex(lastIndexPath.section)
}
}
}
}
extension YHGCMyFileListViewController {
@objc func clickSaveBtn() {
YHHUD.show(.progress(message: "正在生成图片"))
let originY = self.tableView.contentOffset.y
if self.tableView.contentSize != self.fakeTableView.contentSize {
self.tableView.contentSize = self.fakeTableView.contentSize
}
self.tableView.snp.remakeConstraints { make in
make.top.equalToSuperview()
make.left.right.equalToSuperview()
make.height.equalTo(self.tableView.contentSize.height)
}
self.tableView.setNeedsLayout()
self.tableView.layoutIfNeeded()
TYSnapshotScroll.screenSnapshot(self.tableView, addMaskAfter: nil) {
[weak self] image in
YHHUD.hide()
guard let self = self else { return }
self.tableView.snp.remakeConstraints { make in
make.top.equalToSuperview()
make.left.right.equalToSuperview()
make.bottom.equalTo(self.bottomView.snp.top)
}
self.tableView.setNeedsLayout()
self.tableView.layoutIfNeeded()
if let img = image {
// 裁剪
let targetFrame = CGRectMake(0, k_Height_NavigationtBarAndStatuBar-30, img.size.width, img.size.height-k_Height_NavigationtBarAndStatuBar+30)
let croppedImage = img.cropped(to: targetFrame)
self.saveImage(croppedImage)
DispatchQueue.main.async {
self.tableView.setContentOffset(CGPoint(x: 0, y: originY), animated: false)
}
} else {
YHHUD.flash(message: "生成图片失败")
}
}
}
func saveImage(_ image: UIImage) {
// 确保应用有权访问相册
PHPhotoLibrary.requestAuthorization { status in
if status == .authorized {
// 保存图片到相册
DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, self, #selector(self.image(image:didFinishSavingWithError:contextInfo:)), nil)
}
} else {
DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
}
}
}
@objc func image(image: UIImage,didFinishSavingWithError: NSError?,contextInfo: AnyObject) {
if didFinishSavingWithError != nil {
YHHUD.flash(message: "保存失败")
return
}
YHHUD.flash(message: "保存成功")
}
func showEmptyView(_ show:Bool) {
self.emptyView.isHidden = !show
self.navStatusBar.backgroundColor = show ? UIColor.white : UIColor.clear
}
}
extension YHGCMyFileListViewController {
func loadData() {
let param = ["order_id":orderId,
"node":"1",
"state":"1"] as [String : Any]
viewModel.getCertificateFileListData(params: param) { success, error in
self.items.removeAll()
self.titles.removeAll()
var isHaveData = false
if success == true {
for (_, item) in self.viewModel.arrFileListData.enumerated() {
let arr = item?.supplement_list.filter { (item) -> Bool in
return item.checkStatus == 2 || item.checkStatus == 3
}
if let array = arr, array.count > 0 {
isHaveData = true
}
}
for (index, model) in self.viewModel.arrFileListData.enumerated() {
if let model = model {
self.items.append(model)
self.titles.append(model.ApplicantName)
}
}
self.topSegmentView.items = self.titles
self.segmentView.items = self.titles
self.saveBtn.isUserInteractionEnabled = true
self.saveBtn.layer.opacity = 1.0
self.showEmptyView(!isHaveData)
} else {
self.saveBtn.isUserInteractionEnabled = false
self.saveBtn.layer.opacity = 0.3
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
self.segmentView.isHidden = self.items.count <= 1
self.headerView.height = self.items.count > 1 ? self.originHeaderHeight : self.originHeaderHeight-self.topSegmentHeight
self.tableView.reloadData()
self.fakeTableView.tableHeaderView?.height = self.headerView.height
self.fakeTableView.reloadData {
let lastSection = self.items.count-1
if 0 <= lastSection && lastSection < self.items.count {
let model = self.items[lastSection]
var lastRow = model.supplement_list.count-1
if lastRow < 0 {
lastRow = 0
}
self.tableView.setContentOffset(CGPointZero, animated: true)
self.fakeTableView.setContentOffset(CGPoint.zero, animated: false)
self.fakeTableView.scrollToRow(at: IndexPath(row: lastRow, section: lastSection), at: .top, animated: true)
}
}
}
}
func loadData2() {
let param = ["order_id": orderId,
"node": "1",
"state":"1"] as [String : Any]
viewModel.getCertificateStatisticData(params: param) { success, error in
if !success {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
self.updateCount()
}
}
}
//
// YHMaterialListViewController.swift
// galaxy
//
// Created by edy on 2024/3/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHGCCertificateListContainerVC: YHBaseViewController {
static let segmentHeight = 49.0
var orderId : Int?
var filterDict : [String: String] = [:]
var categoryInfo: YHCategoryData = YHCategoryData()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .white
bar.showLeftSecondButtonType(.search)
bar.backBlock = {
[weak self] in
guard let self = self else { return }
self.navigationController?.popViewController(animated: true)
}
bar.leftSecondBtnClick = {
[weak self] in
guard let self = self else { return }
let vc = YHCertificateSearchViewController()
vc.orderId = orderId
self.navigationController?.pushViewController(vc)
}
return bar
}()
var titles = ["全部", "待上传(0)", "已驳回(0)", "审核中(0)", "已完成(0)"]
let categoryItems = [ YHCertificateCategoryItem(type: .all),
YHCertificateCategoryItem(type: .preUpload),
YHCertificateCategoryItem(type: .rejected),
YHCertificateCategoryItem(type: .review),
YHCertificateCategoryItem(type: .finish)]
var itemVCs:[YHGCCertificateListVC] = []
lazy var segmentContainerView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var segmentedView : JXSegmentedView = {
let segview = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: Self.segmentHeight))
segview.dataSource = segmentedDataSource
segview.delegate = self
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorHeight = 4.0
indicator.indicatorColor = .brandMainColor
segview.indicators = [indicator]
segview.backgroundColor = .clear
segview.listContainer = listContainerView
segview.backgroundColor = .white
return segview
}()
lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = titles
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleSelectedColor = UIColor(hexString: "#000000")!
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 24
return dataSource
}()
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
return JXSegmentedListContainerView(dataSource: self, type: .collectionView)
}()
lazy var filterBtn: YHCertificateFilterButton = {
let btn = YHCertificateFilterButton.filterBtn()
btn.clickBlock = {
[weak self] select in
guard let self = self else { return }
filterSheetView.show()
}
return btn
}()
lazy var filterSheetView: YHCertificateFilterView = {
let view = YHCertificateFilterView.sheetView()
view.confirmBlock = {
[weak self] dict in
guard let self = self else { return }
self.filterDict = dict
let allValues = Array(dict.values)
var isNoFilterCondition = true
for value in allValues {
if !value.isEmpty {
isNoFilterCondition = false
}
}
self.filterBtn.isSelect = !isNoFilterCondition
if let vc = itemVCs.first {
vc.requestList(status:vc.status, extra:dict)
}
self.segmentedView.selectItemAt(index: 0)
}
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
self.gk_navigationBar.isHidden = true
self.view.backgroundColor = .white
self.navBar.title = "资料".local
if categoryInfo.categoryId == YHCertificateCategoryId.mainApplicant.rawValue {
self.navBar.title = "主申请人资料".local
} else if categoryInfo.categoryId == YHCertificateCategoryId.spouse.rawValue {
self.navBar.title = "配偶资料".local
} else if categoryInfo.categoryId == YHCertificateCategoryId.child.rawValue {
self.navBar.title = "子女资料".local
}
NotificationCenter.default.addObserver(self, selector: #selector(didCertificateCountStatistics(_:)), name:countStatisticsNotify , object: nil)
for item in categoryItems {
let vc = YHGCCertificateListVC()
vc.orderId = orderId
vc.status = item.type
vc.categoryInfo = categoryInfo
itemVCs.append(vc)
}
view.addSubview(navBar)
view.addSubview(segmentContainerView)
segmentContainerView.addSubview(segmentedView)
segmentContainerView.addSubview(filterBtn)
view.addSubview(listContainerView)
navBar.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_statusBar())
make.height.equalTo(k_Height_NavContentBar)
}
segmentContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(Self.segmentHeight+4)
}
segmentedView.snp.makeConstraints { make in
make.top.left.equalToSuperview()
make.right.equalToSuperview().offset(-21-18)
make.height.equalTo(Self.segmentHeight)
}
filterBtn.snp.makeConstraints { make in
make.width.height.equalTo(YHCertificateFilterButton.width)
make.centerY.equalToSuperview().offset(-2)
make.right.equalToSuperview().offset(-18)
}
listContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(segmentContainerView.snp.bottom)
make.bottom.equalToSuperview()
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
//处于第一个item的时候,才允许屏幕边缘手势返回
navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
// 请求每个tab列表数据计算数量
for (index, vc) in itemVCs.enumerated() {
if index == 0 {
vc.requestList(status: vc.status, extra:self.filterDict)
} else {
vc.requestList(status: vc.status)
}
}
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
//离开页面的时候,需要恢复屏幕边缘手势,不能影响其他页面
navigationController?.interactivePopGestureRecognizer?.isEnabled = true
}
@objc func didCertificateCountStatistics(_ notification: Notification) {
guard let dic = notification.object as? [YHCertificateUploadStatus: Int] else { return }
print(dic)
if let count = dic[YHCertificateUploadStatus.preUpload] {
titles[1] = "待上传(\(count))"
} else if let count = dic[YHCertificateUploadStatus.rejected] {
titles[2] = "已驳回(\(count))"
} else if let count = dic[YHCertificateUploadStatus.review] {
titles[3] = "审核中(\(count))"
} else if let count = dic[YHCertificateUploadStatus.finish] {
titles[4] = "已完成(\(count))"
}
DispatchQueue.main.async {
self.segmentedDataSource.titles = self.titles
self.segmentedView.reloadData()
}
}
deinit {
NotificationCenter.default.removeObserver(self)
}
}
extension YHGCCertificateListContainerVC: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
if 0 <= index && index < itemVCs.count {
let vc = itemVCs[index]
if index == 0 {
vc.requestList(status: vc.status, extra: self.filterDict)
} else {
vc.requestList(status: vc.status)
}
}
}
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
}
}
extension YHGCCertificateListContainerVC: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count
}
return 0
}
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
return itemVCs[index]
}
}
//
// YHCertificateResourceUploadVC.swift
// galaxy
//
// Created by edy on 2024/3/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
import UniformTypeIdentifiers
import IQKeyboardManagerSwift
import SwifterSwift
class YHGCCertificateListVC: YHBaseViewController {
var orderId : Int?
var status: YHCertificateUploadStatus = .all
var items:[YHSupplementInfo] = []
var viewModel: YHCertificateViewModel = YHCertificateViewModel()
var categoryInfo: YHCategoryData!
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self)
return tool
}()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor(hexString:"#F8F8F8")
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateInfoCell.self, forCellReuseIdentifier: YHCertificateInfoCell.cellReuseIdentifier)
tableView.backgroundView = emptyDataTipsView
return tableView
}()
lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("没有找到相关资料哦~", kEmptyCommonBgName)
view.topMargin = 130
view.isHidden = false
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navigationBar.isHidden = true
createUI()
requestList(status: status)
}
func createUI() {
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(KScreenHeight - k_Height_NavigationtBarAndStatuBar - YHCertificateListContainerVC.segmentHeight)
}
}
}
extension YHGCCertificateListVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoCell
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
cell.updateModel(item)
cell.templateBlock = {
[weak self] in
guard let self = self else { return }
let view = YHCertificateTemplateSheetView.templateView(item.templateInfo)
view.scanTemplateBlock = {
[weak self] path in
guard let self = self else { return }
if let url = path?.url, !url.isEmpty {
print(url)
self.previewFileTool.openXLSXRemoteFile(urlString:url, fileName:"预览")
}
}
view.show()
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
if item.checkStatus == YHCertificateUploadStatus.preUpload.rawValue { // 待上传
showUploadSheetView(supplementId:item.id)
return
}
// 非待上传的进入详情
let vc = YHGCCertificateUploadContentListVC()
vc.orderId = orderId ?? 0
vc.categoryId = categoryInfo.categoryId
vc.supplementId = item.id
self.navigationController?.pushViewController(vc)
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
}
// MARK: - JXSegmentedListContainerViewListDelegate
extension YHGCCertificateListVC: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
extension YHGCCertificateListVC {
func requestList(status: YHCertificateUploadStatus, extra:[String:Any] = [:]) {
/*
// 状态
"status_all": "",
// 类型
"template_cate_id": "",
// 搜索
"keywork": "",
*/
var params:[String:Any] = [
"order_id" : orderId ?? 0,
"node": "1",
"state": "1",
"category_id": categoryInfo.categoryId,
"supplement_ids": []]
if !extra.isEmpty {
params += extra
}
print(params)
// state: 3:待上传 2:已驳回 1:已完成 0:审核中
viewModel.getCertificateList(params: params) {
[weak self] listInfo, error in
guard let self = self else { return }
items.removeAll()
if let listInfo = listInfo {
let arr = listInfo.supplementList
var results: [YHSupplementInfo] = []
if status == .all {
results.append(contentsOf:arr)
} else {
for item in arr {
if item.checkStatus == status.rawValue {
results.append(item)
}
}
}
items.append(contentsOf: results)
}
// 数量统计
NotificationCenter.default.post(name: countStatisticsNotify, object: [self.status: items.count])
emptyDataTipsView.isHidden = items.count > 0
self.tableView.reloadData()
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg, duration:3)
}
}
}
func showUploadSheetView(supplementId: Int) {
let orderID = self.orderId ?? 0
self.viewModel.showUploadSheetView(supplementId: supplementId) {
[weak self] in
guard let self = self else { return }
DispatchQueue.main.async {
let vc = YHGCCertificateUploadContentListVC()
vc.orderId = orderID
vc.categoryId = self.categoryInfo.categoryId
vc.supplementId = supplementId
self.navigationController?.pushViewController(vc)
}
}
}
}
//
// YHCertificateSearchViewController.swift
// galaxy
//
// Created by edy on 2024/3/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCCertificateSearchViewController: YHBaseViewController {
var items:[YHSupplementInfo] = []
var viewModel: YHCertificateViewModel = YHCertificateViewModel()
var orderId : Int?
var categoryInfo: YHCategoryData?
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor(hexString:"#F8F8F8")
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateInfoCell.self, forCellReuseIdentifier: YHCertificateInfoCell.cellReuseIdentifier)
tableView.backgroundView = emptyDataTipsView
return tableView
}()
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self)
return tool
}()
lazy var searchView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(searchBar)
searchBar.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.size.equalTo(CGSize(width: KScreenWidth-32.0, height:YHCertificateSearchBar.height))
}
return view
}()
lazy var searchBar: YHCertificateSearchBar = {
let bar = YHCertificateSearchBar(frame:CGRect(x: 0, y: 0, width:KScreenWidth-32, height:YHCertificateSearchBar.height))
bar.searchBlock = {
[weak self] text in
guard let self = self else { return }
requestList(keyWord: text)
}
bar.textChange = {
[weak self] text in
guard let self = self else { return }
if isEmptyString(text) {
requestList(keyWord: "")
}
}
return bar
}()
lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("没有找到相关资料哦~", kEmptySearchBgName)
view.topMargin = 130
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navTitle = "资料搜索".local
createUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.requestList(keyWord: searchBar.textField.text)
}
func createUI() {
view.addSubview(searchView)
view.addSubview(tableView)
searchView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(32+YHCertificateSearchBar.height)
}
tableView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(searchView.snp.bottom)
}
}
}
extension YHGCCertificateSearchViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoCell
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
cell.updateModel(item)
cell.templateBlock = {
[weak self] in
guard let self = self else { return }
let view = YHCertificateTemplateSheetView.templateView(item.templateInfo)
view.scanTemplateBlock = {
[weak self] path in
guard let self = self else { return }
if let url = path?.url, !url.isEmpty {
print(url)
self.previewFileTool.openXLSXRemoteFile(urlString:url, fileName: "预览")
}
}
view.show()
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
let item = items[indexPath.section]
if item.checkStatus == YHCertificateUploadStatus.preUpload.rawValue { // 待上传
showUploadSheetView(supplementId: item.id)
return
}
// 非待上传的进入详情
let vc = YHGCCertificateUploadContentListVC()
vc.orderId = orderId ?? 0
vc.categoryId = self.categoryInfo?.categoryId ?? 0
vc.supplementId = item.id
self.navigationController?.pushViewController(vc)
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
}
extension YHGCCertificateSearchViewController {
func requestList(keyWord:String?) {
/*
// 状态
"status_all": "",
// 类型
"template_cate_id": "",
// 搜索
"keyword": "",
*/
let keywords = keyWord ?? ""
let params:[String:Any] = [
"node": "1",
"state": "1",
"supplement_ids": [],
"order_id" : orderId ?? 0,
"keyword": keywords]
print(params)
// state: 3:待上传 2:已驳回 1:已完成 0:审核中
viewModel.getCertificateList(params: params) {
[weak self] listInfo, error in
guard let self = self else { return }
items.removeAll()
if let listInfo = listInfo {
categoryInfo = listInfo.categoryData
let arr = listInfo.supplementList
items.append(contentsOf: arr)
}
emptyDataTipsView.isHidden = items.count > 0
self.tableView.reloadData()
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg, duration:3)
}
}
}
func showUploadSheetView(supplementId: Int) {
let orderID = self.orderId ?? 0
let categoryId = self.categoryInfo?.categoryId ?? 0
self.viewModel.showUploadSheetView(supplementId: supplementId) {
[weak self] in
guard let self = self else { return }
DispatchQueue.main.async {
let vc = YHGCCertificateUploadContentListVC()
vc.orderId = orderID
vc.categoryId = categoryId
vc.supplementId = supplementId
self.navigationController?.pushViewController(vc)
}
}
}
}
//
// YHUploadContentVC.swift
// galaxy
//
// Created by edy on 2024/3/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import IQKeyboardManagerSwift
import AttributedString
class YHGCCertificateUploadContentListVC: YHBaseViewController {
// 进入该页面以下三个参数必传
var orderId : Int = 0
var categoryId: Int = 0
var supplementId: Int = 0
private var categoryInfo = YHCategoryData()
private var supplementInfo = YHSupplementInfo() {
didSet {
templateArr.removeAll()
if supplementInfo.templateInfo.materialPath.count > 0 {
let template = supplementInfo.templateInfo.materialPath[0]
template.type = 0
templateArr.append(template)
}
if supplementInfo.templateInfo.guideFilePath.count > 0 {
let guide = supplementInfo.templateInfo.guideFilePath[0]
guide.type = 1
templateArr.append(guide)
}
self.tableView.reloadData()
}
}
var viewModel: YHCertificateViewModel = YHCertificateViewModel()
var templateArr:[YHMaterialPath] = []
var items:[YHContentUrl] = []
var selectEditItem: YHContentUrl?
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self)
return tool
}()
var renameInputView: YHFileRenameInputView = {
let view = YHFileRenameInputView.inputView(defalutText: "请输入名称")
return view
}()
lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissed))
view.addGestureRecognizer(tap)
view.isHidden = true
return view
}()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateNameCell.self, forCellReuseIdentifier: YHCertificateNameCell.cellReuseIdentifier)
tableView.register(YHCertificateTemplateCell.self, forCellReuseIdentifier: YHCertificateTemplateCell.cellReuseIdentifier)
return tableView
}()
lazy var uploadBtn:UIButton = {
let btn = UIButton()
btn.setTitle("继续上传".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor.brandMainColor
btn.layer.cornerRadius = kCornerRadius3
btn.addTarget(self, action: #selector(didClickUploadBtn), for: .touchUpInside)
return btn
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navTitle = "上传内容"
addKeyBoardNotify()
createUI()
items.removeAll()
if supplementInfo.contentUrl.count > 0 {
items.append(contentsOf: supplementInfo.contentUrl)
}
tableView.reloadData()
requestList()
renameInputView.editBlock = {
[weak self] text in
guard let self = self else { return }
if let selectEditItem = selectEditItem, var text = text {
// 重命名
text = text + "." + selectEditItem.getFileSuffixName()
YHHUD.show(.progress(message: "重命名中..."))
self.viewModel.updateCertificateItem(supplementsId:supplementInfo.id, urlModels:[selectEditItem], operation: "rename", rename: text) {
success, error in
YHHUD.hide()
if success {
YHHUD.flash(message: "重命名成功")
} else {
var msg = "重命名失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg
}
YHHUD.flash(message:msg)
}
self.requestList()
}
}
}
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
NotificationCenter.default.post(name: YhConstant.YhNotification.refreshCertificateFileListNotifiction, object: nil)
}
deinit {
removeNotify()
}
@objc func didClickUploadBtn() {
if items.count >= 99 {
YHHUD.flash(message: "已达上限\n最多上传99张图片或文件")
return
}
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.uploadTypeArr = [ YHCertificateUploadItem(type:.camera, title:"拍照上传"),
YHCertificateUploadItem(type:.photo, title:"相册上传"),
YHCertificateUploadItem(type:.phoneFile, title:"手机文件上传", subtitle:"从手机文件管理中上传"),
YHCertificateUploadItem(type:.wechatUpload, title:"微信上传"),
YHCertificateUploadItem(type:.cancel, title:"取消")]
sheetView.maxSelectImageCount = 99-items.count
sheetView.uploadFilesBlock = {
[weak self] fileUrl in
guard let self = self else { return }
print(fileUrl)
self.viewModel.uploadFile(fileUrl, supplementId: supplementId) {
[weak self] in
guard let self = self else { return }
self.requestList()
}
}
sheetView.uploadImageBlock = {
[weak self] targetImgArr in
guard let self = self else { return }
self.viewModel.uploadImageArr(targetImgArr, supplementId: supplementId) {
[weak self] in
guard let self = self else { return }
self.requestList()
}
}
sheetView.wechatUploadBlock = {
[weak self] in
guard let self = self else { return }
let token = YHLoginManager.shared.h5Token
let path = "/superApp/pages/wxUpload/wxUpload?param=\(token)&id=\(self.supplementId)&type=my_certificate"
YHShareManager.shared.openMiniProgram(path:path, title: "微信上传")
}
sheetView.show()
}
func createUI() {
view.addSubview(uploadBtn)
view.addSubview(tableView)
view.addSubview(blackMaskView)
view.addSubview(renameInputView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
if supplementInfo.checkStatus == YHCertificateUploadStatus.finish.rawValue {
make.bottom.equalToSuperview()
} else {
make.bottom.equalTo(uploadBtn.snp.top).offset(-34)
}
}
uploadBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(48.0)
make.bottom.equalToSuperview().offset(-8-k_Height_safeAreaInsetsBottom())
}
renameInputView.snp.makeConstraints { make in
make.left.right.equalTo(view)
make.height.equalTo(YHFileRenameInputView.height)
make.bottom.equalToSuperview().offset(YHFileRenameInputView.height)
}
}
}
extension YHGCCertificateUploadContentListVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return templateArr.count
}
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell
cell.update(bottomMargin: 15)
if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templatePath = templateArr[indexPath.row]
}
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateNameCell.cellReuseIdentifier, for: indexPath) as! YHCertificateNameCell
if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row]
cell.updateModel(item)
cell.editBlock = {
[weak self] contentItem in
guard let self = self else { return }
selectEditItem = contentItem
var items = [YHCertificateEditItem(type:.rename, title:"重命名"),
YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.delete, title:"删除"),
YHCertificateEditItem(type:.cancel, title:"取消")]
if supplementInfo.checkStatus == YHCertificateUploadStatus.finish.rawValue {
items = [YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.cancel, title:"取消")]
}
YHCertificateEditSheetView.sheetView(items:items) {
[weak self] editType in
guard let self = self else { return }
print("editType:\(editType.rawValue)")
if editType == .rename { // 重命名
IQKeyboardManager.shared.isEnabled = false
var name = contentItem.getFileNameWithoutSuffix()
if name.count > 30 {
name = name[safe: ..<30]!
}
renameInputView.textField.text = name
renameInputView.textField.becomeFirstResponder()
} else if editType == .delete { // 删除
let msg = "您确定要删除文档\(contentItem.name)吗?"
YHTwoOptionAlertView.showAlertView(message:msg) { sure in
if !sure { return }
// 删除
YHHUD.show(.progress(message: "删除中..."))
self.viewModel.updateCertificateItem(supplementsId:self.supplementInfo.id, urlModels:[contentItem], operation: "del", rename:"") {
success, error in
YHHUD.hide()
if success {
YHHUD.flash(message: "删除成功")
} else {
var msg = "删除失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg
}
YHHUD.flash(message:msg)
}
self.requestList()
}
}
} else if editType == .preview { // 预览
print(contentItem.url)
self.viewModel.getPublicImageUrl(contentItem.url) { success, error in
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:contentItem.name)
}
}
}
}.show()
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
return 77.0
}
return UITableView.automaticDimension
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
if section == 0 {
if supplementInfo.templateInfo.isNeedShowTemplate() {
return UITableView.automaticDimension
}
return 0.0
}
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
if section == 0 { // 证件示例模板
if !supplementInfo.templateInfo.isNeedShowTemplate() {
return view
}
let titlelabel = UILabel()
titlelabel.textColor = UIColor.mainTextColor
titlelabel.textAlignment = .left
titlelabel.font = UIFont.PFSC_M(ofSize:17)
titlelabel.text = "\(supplementInfo.name)示例模板"
titlelabel.numberOfLines = 0
view.addSubview(titlelabel)
titlelabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
}
let tipsLabel = UILabel()
tipsLabel.textColor = UIColor.labelTextColor2
tipsLabel.textAlignment = .left
tipsLabel.font = UIFont.PFSC_R(ofSize:14)
tipsLabel.numberOfLines = 0
if !supplementInfo.templateInfo.description.isEmpty {
tipsLabel.text = "注意事项:\n\(supplementInfo.templateInfo.description)"
}
view.addSubview(tipsLabel)
tipsLabel.snp.makeConstraints { make in
make.top.equalTo(titlelabel.snp.bottom).offset(5)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview().offset(-15)
}
return view
}
// 证件标题和状态
let titlelabel = UILabel()
titlelabel.textColor = UIColor.mainTextColor
titlelabel.textAlignment = .left
titlelabel.font = UIFont.PFSC_M(ofSize:17)
titlelabel.text = supplementInfo.name
titlelabel.numberOfLines = 0
view.addSubview(titlelabel)
let statusLabel = UILabel()
statusLabel.textAlignment = .center
statusLabel.font = UIFont.PFSC_M(ofSize:10)
statusLabel.layer.cornerRadius = kCornerRadius3
statusLabel.clipsToBounds = true
view.addSubview(statusLabel)
var text = ""
var textColor:UIColor = .clear
var bgColor:UIColor = .clear
if supplementInfo.checkStatus == YHCertificateUploadStatus.review.rawValue {
text = "审核中".local
textColor = UIColor(hexString: "#FF9900")!
bgColor = UIColor(hexString: "#FF9900", transparency: 0.08)!
} else if supplementInfo.checkStatus == YHCertificateUploadStatus.preUpload.rawValue {
text = "待上传".local
textColor = UIColor(hexString: "#2F7EF6")!
bgColor = UIColor(hexString: "#2F7EF6", transparency: 0.08)!
} else if supplementInfo.checkStatus == YHCertificateUploadStatus.finish.rawValue {
text = "已完成".local
textColor = UIColor(hexString: "#49D2B1")!
bgColor = UIColor(hexString: "#49D2B1", transparency: 0.08)!
} else if supplementInfo.checkStatus == YHCertificateUploadStatus.rejected.rawValue {
text = "已驳回".local
textColor = UIColor.failColor
bgColor = UIColor(hexString: "#F81D22", transparency: 0.08)!
}
statusLabel.text = text
statusLabel.textColor = textColor
statusLabel.backgroundColor = bgColor
let tipsLabel = UILabel()
tipsLabel.textColor = .labelTextColor2
tipsLabel.font = UIFont.PFSC_R(ofSize:12)
tipsLabel.textAlignment = .left
tipsLabel.numberOfLines = 0
tipsLabel.text = "支持的文件格式为jpg/jpeg、png、doc/docx、pptx、pdf,最多可上传99张图片或文件"
view.addSubview(tipsLabel)
titlelabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.top.equalToSuperview()
}
statusLabel.snp.makeConstraints { make in
make.centerY.equalTo(titlelabel)
make.left.equalTo(titlelabel.snp.right).offset(4)
make.right.lessThanOrEqualTo(view).offset(-20)
make.height.equalTo(16)
make.width.equalTo(38)
}
tipsLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(titlelabel.snp.bottom).offset(7)
make.bottom.equalToSuperview().offset(-15)
}
if supplementInfo.checkStatus != YHCertificateUploadStatus.rejected.rawValue {
return view
}
if supplementInfo.auditContent.isEmpty { // 无驳回理由
return view
}
// 有驳回理由
let rejectView = UIView()
view.addSubview(rejectView)
let warningImgV = UIImageView(image: UIImage(named: "my_cer_upload_warning"))
rejectView.addSubview(warningImgV)
let rejectTitleLabel = UILabel()
rejectTitleLabel.textColor = .failColor
rejectTitleLabel.font = UIFont.PFSC_R(ofSize:12)
rejectTitleLabel.textAlignment = .left
rejectTitleLabel.text = "驳回原因:"
rejectView.addSubview(rejectTitleLabel)
let rejectContentLabel = UILabel()
rejectContentLabel.textColor = .failColor
rejectContentLabel.font = UIFont.PFSC_R(ofSize:12)
rejectContentLabel.numberOfLines = 0
rejectContentLabel.textAlignment = .left
rejectContentLabel.text = supplementInfo.auditContent
rejectView.addSubview(rejectContentLabel)
tipsLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(titlelabel.snp.bottom).offset(7)
make.bottom.equalTo(rejectView.snp.top).offset(-20)
}
rejectView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview().offset(-12)
}
warningImgV.snp.makeConstraints { make in
make.width.height.equalTo(14)
make.left.top.equalTo(0)
}
rejectTitleLabel.snp.makeConstraints { make in
make.centerY.equalTo(warningImgV)
make.left.equalTo(warningImgV.snp.right).offset(4)
}
rejectContentLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(warningImgV.snp.bottom).offset(7)
make.bottom.equalToSuperview()
}
return view
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
if section == 0 {
return 20.0
}
return 60.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
if section == 0 {
return view
}
let label = UILabel(frame: CGRect(x: 0, y: 20, width:KScreenWidth, height:20))
label.textColor = UIColor.labelTextColor2
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize:12)
let tipsFont = UIFont.PFSC_R(ofSize: 12)
let a: ASAttributedString = .init("已上传", .font(tipsFont),.foreground(UIColor.labelTextColor2))
let b: ASAttributedString = .init(" \(items.count)/99 ", .font(UIFont.PFSC_M(ofSize: 12)), .foreground(UIColor.init(hexString:"#2F2F2F")!))
let c: ASAttributedString = .init("张图片或文件", .font(tipsFont), .foreground(UIColor.labelTextColor2))
label.attributed.text = a+b+c
view.addSubview(label)
label.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-20)
}
return view
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 { // 模板列表
if 0 <= indexPath.row && indexPath.row < templateArr.count {
let path = templateArr[indexPath.row]
print(path.url)
if !path.url.isEmpty {
self.previewFileTool.openXLSXRemoteFile(urlString:path.url, fileName:"预览")
}
}
} else if indexPath.section == 1 { // 证件列表
if 0 <= indexPath.row && indexPath.row < items.count {
let cer = items[indexPath.row]
if !cer.url.isEmpty {
print(cer.url)
self.viewModel.getPublicImageUrl(cer.url) { success, error in
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:cer.name)
}
}
}
}
}
}
@objc func dismissed() {
renameInputView.textField.resignFirstResponder()
}
}
extension YHGCCertificateUploadContentListVC {
func addKeyBoardNotify() {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didRefreshData), name: YhConstant.YhNotification.didMyCertificateWeChatFileUploadCallBackNotification, object: nil)
}
@objc func didRefreshData() {
requestList()
}
func removeNotify() {
NotificationCenter.default.removeObserver(self)
}
@objc func handleKeyboardNotification(_ notification: Notification) {
if notification.userInfo != nil {
guard let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as AnyObject).cgRectValue else {return }
let isKeyboardShow = notification.name == UIResponder.keyboardWillShowNotification
self.blackMaskView.isHidden = !isKeyboardShow
let bottomMargin = (isKeyboardShow ? -keyboardFrame.height : YHFileRenameInputView.height)
if !isKeyboardShow {
IQKeyboardManager.shared.isEnabled = true
}
self.renameInputView.snp.updateConstraints { make in
make.bottom.equalToSuperview().offset(bottomMargin)
}
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
}
}
}
extension YHGCCertificateUploadContentListVC {
func requestList() {
let params:[String:Any] = [
"order_id" : orderId,
"node": "1",
"state": "1",
"category_id": categoryId,
"supplement_ids": supplementId]
print(params)
viewModel.getCertificateList(params: params) {
[weak self] listInfo, error in
guard let self = self else { return }
items.removeAll()
if let listInfo = listInfo {
categoryInfo = listInfo.categoryData
let arr = listInfo.supplementList
if arr.count > 0 {
supplementInfo = arr[0]
}
for item in arr {
items.append(contentsOf: item.contentUrl)
}
}
if categoryInfo.checkStatus == YHCertificateUploadStatus.finish.rawValue {
self.uploadBtn.isHidden = true
} else {
self.uploadBtn.isHidden = false
self.uploadBtn.alpha = (items.count >= 99 ? 0.5 : 1.0)
}
self.tableView.reloadData()
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg, duration:3)
}
}
}
}
//
// YHMainCertificateEntryVC.swift
// galaxy
//
// Created by davidhuangA on 2024/3/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
我的证件 主入口页
*/
class YHGCMineCertificateEntryViewController: YHBaseViewController {
var orderId : Int = 0
private let certificateReqVM : YHCertificateViewModel = YHCertificateViewModel()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.title = "我的证件".local
bar.showLeftSecondButtonType(.search)
bar.backBlock = {
[weak self] in
guard let self = self else { return }
self.navigationController?.popViewController(animated: true)
}
bar.leftSecondBtnClick = {
[weak self] in
guard let self = self else { return }
let vc = YHGCCertificateSearchViewController()
vc.orderId = orderId
self.navigationController?.pushViewController(vc)
}
return bar
}()
private lazy var topBkg : UIView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "service_center_head_bkg3")
imagV.contentMode = .scaleAspectFill
return imagV
}()
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.register(YHCertificateEntryCell.self,forCellReuseIdentifier: YHCertificateEntryCell.cellReuseIdentifier)
return tableView
}()
let headerView : YHCertificateEntryHeadView = YHCertificateEntryHeadView()
let bottomView : YHCertificateEntryBottomView = YHCertificateEntryBottomView()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadData()
}
}
extension YHGCMineCertificateEntryViewController {
func loadData() {
if orderId != 0 {
let param = ["order_id":orderId,"node":"1","state":"1"] as [String : Any]
certificateReqVM.getCertificateStatisticData(params: param) { success, error in
if success == true {
self.headerView.dataModel = self.certificateReqVM.certificateEntryModel
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
self.homeTableView.reloadData()
}
}
}
func setupUI() {
gk_navigationBar.isHidden = true
view.addSubview(topBkg)
topBkg.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(240)
}
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(YHCertificateEntryBottomView.viewH)
}
headerView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: YHCertificateEntryHeadView.viewH)
homeTableView.tableHeaderView = headerView
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
}
// 放在最上面
view.addSubview(navBar)
navBar.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_statusBar())
make.height.equalTo(k_Height_NavContentBar)
}
homeTableView.delegate = self
homeTableView.dataSource = self
bottomView.block = { flag in
if flag == 0 {
//问题答疑
let vc = YHQuestionAndAnswerViewController()
self.navigationController?.pushViewController(vc)
} else {
//生成清单
let vc = YHGCMyFileListViewController()
vc.orderId = self.orderId
self.navigationController?.pushViewController(vc)
}
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCMineCertificateEntryViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
guard let model = certificateReqVM.certificateEntryModel else { return 0 }
return model.category_data.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return kMargin
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: kMargin))
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return YHCertificateEntryCell.cellH
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHCertificateEntryCell.self)
cell0.selectionStyle = .none
guard let model = certificateReqVM.certificateEntryModel else { return cell0 }
if indexPath.section < model.category_data.count {
cell0.dataModel = model.category_data[indexPath.section]
}
return cell0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.section)")
guard let model = certificateReqVM.certificateEntryModel else { return }
let vc = YHGCCertificateListContainerVC()
vc.orderId = orderId
if indexPath.section < model.category_data.count {
vc.categoryInfo = model.category_data[indexPath.section]
}
self.navigationController?.pushViewController(vc)
}
}
...@@ -126,6 +126,11 @@ class YHGCEducationDetailVC: YHBaseViewController { ...@@ -126,6 +126,11 @@ class YHGCEducationDetailVC: YHBaseViewController {
item04.placeHolder = "请选择专业".local item04.placeHolder = "请选择专业".local
item04.value = detailInfo.major item04.value = detailInfo.major
let item09 = YHFormDetailItem(type: .detailMajor)
item09.tips = "请输入专业".local
item09.placeHolder = "请输入专业".local
item09.value = detailInfo.majorOther
let item01 = YHFormDetailItem(type: .educationStyle) let item01 = YHFormDetailItem(type: .educationStyle)
item01.tips = "请选择授课形式".local item01.tips = "请选择授课形式".local
item01.placeHolder = "请选择授课形式" item01.placeHolder = "请选择授课形式"
...@@ -134,7 +139,7 @@ class YHGCEducationDetailVC: YHBaseViewController { ...@@ -134,7 +139,7 @@ class YHGCEducationDetailVC: YHBaseViewController {
let item05 = YHFormDetailItem(type: .educationDegree) let item05 = YHFormDetailItem(type: .educationDegree)
item05.tips = "请选择学位".local item05.tips = "请选择学位".local
item05.placeHolder = "请选择学位".local item05.placeHolder = "请选择学位".local
item05.value = detailInfo.degree item05.value = detailInfo.getDegree()
// let item02 = YHFormDetailItem(type: .educationTime) // let item02 = YHFormDetailItem(type: .educationTime)
// item02.tips = "请选择年月".local // item02.tips = "请选择年月".local
...@@ -162,12 +167,16 @@ class YHGCEducationDetailVC: YHBaseViewController { ...@@ -162,12 +167,16 @@ class YHGCEducationDetailVC: YHBaseViewController {
item08.tips = "请选择城市".local item08.tips = "请选择城市".local
} }
let arr0:[YHFormItemProtocol] = [title0, item00, item03, item04, item05, item07, item08]
var arr0:[YHFormItemProtocol] = [title0, item00, item03, item04, item05, item07, item08]
if detailInfo.isNeedInputMajor() {
arr0 = [title0, item00, item03, item04, item09, item05, item07, item08]
}
items.append(arr0) items.append(arr0)
let item10 = YHFormDetailItem(type: .cerUpload) // let item10 = YHFormDetailItem(type: .cerUpload)
let arr1:[YHFormItemProtocol] = [item10] // let arr1:[YHFormItemProtocol] = [item10]
items.append(arr1) // items.append(arr1)
self.tableView.reloadData() self.tableView.reloadData()
} }
...@@ -220,7 +229,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -220,7 +229,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
textField in textField in
var max = -1 var max = -1
if detailItem.type == .educationMajor { if detailItem.type == .detailMajor {
max = 50 max = 50
} else if detailItem.type == .educationCity { } else if detailItem.type == .educationCity {
max = 100 max = 100
...@@ -245,11 +254,11 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -245,11 +254,11 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.schoolAddress.foreign = "" detailInfo.schoolAddress.foreign = ""
} }
} else if detailItem.type == .educationMajor { } else if detailItem.type == .detailMajor {
if let text = text, !text.isEmpty { if let text = text, !text.isEmpty {
detailInfo.major = text detailInfo.majorOther = text
} else { } else {
detailInfo.major = "" detailInfo.majorOther = ""
} }
} else if detailItem.type == .universityFullName { } else if detailItem.type == .universityFullName {
if let text = text, !text.isEmpty { if let text = text, !text.isEmpty {
...@@ -418,10 +427,10 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -418,10 +427,10 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .educationDegree { // 学位 } else if detailItem.type == .educationDegree { // 学位
YHSheetPickerView.show(type:.degree, selectTitle:detailInfo.degree) { YHSheetPickerView.show(type:.degree2, selectTitle:detailInfo.degree) {
[weak self] item in [weak self] item in
guard let self = self else { return } guard let self = self else { return }
detailInfo.degree = item.title detailInfo.hasBachelorDegree = item.index
loadInfo() loadInfo()
saveInfoSilent() saveInfoSilent()
} }
...@@ -472,21 +481,30 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -472,21 +481,30 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .educationMajor { // 专业 } else if detailItem.type == .educationMajor { // 专业
let vc = YHMajorSearchViewController() YHSheetPickerView.show(type:.major, selectTitle: detailInfo.major) {
vc.orderId = self.orderId [weak self] item in
vc.searchMajorName = detailInfo.major
vc.selectBlock = {
[weak self] text in
guard let self = self else { return } guard let self = self else { return }
if let text = text, !text.isEmpty { detailInfo.major = item.title
detailInfo.major = text
} else {
detailInfo.major = ""
}
loadInfo() loadInfo()
saveInfoSilent() saveInfoSilent()
} }
self.navigationController?.pushViewController(vc)
// let vc = YHMajorSearchViewController()
// vc.orderId = self.orderId
// vc.searchMajorName = detailInfo.major
// vc.selectBlock = {
// [weak self] text in
// guard let self = self else { return }
// if let text = text, !text.isEmpty {
// detailInfo.major = text
// } else {
// detailInfo.major = ""
// }
// loadInfo()
// saveInfoSilent()
// }
// self.navigationController?.pushViewController(vc)
} }
} }
} }
...@@ -554,6 +572,10 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -554,6 +572,10 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
return .selectSheet return .selectSheet
} }
if detailItem.type == .detailMajor {
return .inputText
}
if detailItem.type == .educationMajor if detailItem.type == .educationMajor
|| detailItem.type == .educationStyle || detailItem.type == .educationStyle
|| detailItem.type == .educationTime || detailItem.type == .educationTime
...@@ -572,7 +594,8 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -572,7 +594,8 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
extension YHGCEducationDetailVC { extension YHGCEducationDetailVC {
func getDetailInfo() { func getDetailInfo() {
self.educationRequest.getEducationDetailInfo(params: ["id": self.detailId]) { self.educationRequest.getEducationDetailInfo(params: ["id": self.detailId,
"order_id": self.orderId]) {
[weak self] success, error in [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
...@@ -602,8 +625,6 @@ extension YHGCEducationDetailVC { ...@@ -602,8 +625,6 @@ extension YHGCEducationDetailVC {
if detailInfo.college.isEmpty if detailInfo.college.isEmpty
|| detailInfo.graduateTime.isEmpty || detailInfo.graduateTime.isEmpty
|| detailInfo.major.isEmpty
|| detailInfo.degree.isEmpty
|| detailInfo.schoolAddress.country.isEmpty || detailInfo.schoolAddress.country.isEmpty
{ {
return false return false
...@@ -613,6 +634,14 @@ extension YHGCEducationDetailVC { ...@@ -613,6 +634,14 @@ extension YHGCEducationDetailVC {
// return false // return false
// } // }
if detailInfo.getDegree().isEmpty {
return false
}
if detailInfo.isNeedInputMajor(), detailInfo.majorOther.isEmpty {
return false
}
if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty { if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty {
return false return false
} }
......
...@@ -336,13 +336,14 @@ extension YHGCEducationInfoListVC : UITableViewDelegate, UITableViewDataSource { ...@@ -336,13 +336,14 @@ extension YHGCEducationInfoListVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationInfoCell.cellReuseIdentifier, for: indexPath) as! YHEducationInfoCell let cell = tableView.dequeueReusableCell(withIdentifier: YHEducationInfoCell.cellReuseIdentifier, for: indexPath) as! YHEducationInfoCell
cell.titleLabel.text = eduInfo.college cell.titleLabel.text = eduInfo.college
cell.subTitleLabel.text = "" cell.subTitleLabel.text = ""
if let major = eduInfo.major, let degree = eduInfo.degree { let degree = eduInfo.getDegree()
if let major = eduInfo.getRealMajor(), !degree.isEmpty {
cell.subTitleLabel.text = String("\(degree)-\(major)") cell.subTitleLabel.text = String("\(degree)-\(major)")
} }
cell.timeLabel.text = "" cell.timeLabel.text = ""
if let admissionTime = eduInfo.admissionTime, let graduateTime = eduInfo.graduateTime { // if let admissionTime = eduInfo.admissionTime, let graduateTime = eduInfo.graduateTime {
cell.timeLabel.text = String("\(admissionTime) ~ \(graduateTime)") // cell.timeLabel.text = String("\(admissionTime) ~ \(graduateTime)")
} // }
cell.isShowDeleteBtn = (isDegreeEditMode == .canCancel) cell.isShowDeleteBtn = (isDegreeEditMode == .canCancel)
cell.deleteBlock = { cell.deleteBlock = {
var title = "确定删除该学历吗?" var title = "确定删除该学历吗?"
......
//
// YHGCIncomeRecordViewController.swift
// galaxy
//
// Created by alexzzw on 2024/11/13.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import IQKeyboardManagerSwift
import AttributedString
import UIKit
class YHGCIncomeRecordViewController: YHBaseViewController {
enum TableRow {
case incomeSummary(_ isEditing: Bool = false, _ isEditEnable: Bool = false)
case incomeItem(_ isEditState: Bool = false, _ company: String, _ money: String, _ timeStr: String, _ incomeId: Int, _ showBottomLine: Bool)
case addItem
case totalIncome(_ money: ASAttributedString)
case consentForHKTravel(_ title: String, _ detail: ASAttributedString, _ question: String)
case questionSelect(_ question: String)
case employmentVerification
}
private lazy var datas: [[TableRow]] = []
/// 是否超过
private var isOver100OK = true
private var over100IndexPath: IndexPath?
private var selectedEmployment: String?
private var employments: [String] = ["华为科技有限公司有限公司", "阿里巴巴有限公司"]
private lazy var viewModel = YHIncomeRecordViewModel()
private var incomeModel = YHIncomeRecordCompleteModel()
private lazy var saveButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.setTitle("保存", for: .normal)
button.setTitle("保存", for: .highlighted)
button.setTitleColor(.mainTextColor, for: .normal)
button.setTitleColor(.mainTextColor, for: .highlighted)
button.addTarget(self, action: #selector(clickSaveButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .contentBkgColor
return button
}()
private lazy var submitButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.setTitle("提交", for: .normal)
button.setTitle("提交", for: .highlighted)
button.setTitleColor(UIColor(hex: 0xFFFFFF), for: .normal)
button.setTitleColor(UIColor(hex: 0xFFFFFF), for: .highlighted)
button.addTarget(self, action: #selector(clickSubmitButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
private lazy var tableView: UITableView = {
let view = UITableView(frame: .zero, style: .grouped)
view.estimatedSectionHeaderHeight = 16.0
view.estimatedSectionFooterHeight = 0.01
view.sectionHeaderHeight = 16.0
view.sectionFooterHeight = 0.01
view.contentInsetAdjustmentBehavior = .never
view.showsVerticalScrollIndicator = false
view.separatorStyle = .none
view.delegate = self
view.dataSource = self
view.backgroundColor = .clear
view.tableFooterView = UITableViewHeaderFooterView()
view.rowHeight = UITableView.automaticDimension
view.register(YHIncomeRecordSummaryCell.self, forCellReuseIdentifier: YHIncomeRecordSummaryCell.cellReuseIdentifier)
view.register(YHIncomeRecordItemCell.self, forCellReuseIdentifier: YHIncomeRecordItemCell.cellReuseIdentifier)
view.register(YHInfoConsentForHKTravelCell.self, forCellReuseIdentifier: YHInfoConsentForHKTravelCell.cellReuseIdentifier)
view.register(YHTotalIncomeCell.self, forCellReuseIdentifier: YHTotalIncomeCell.cellReuseIdentifier)
view.register(YHAddIncomeRecordCell.self, forCellReuseIdentifier: YHAddIncomeRecordCell.cellReuseIdentifier)
view.register(YHInfoQuestionSelectionCell.self, forCellReuseIdentifier: YHInfoQuestionSelectionCell.cellReuseIdentifier)
view.register(YHEmploymentVerificationAvailableCell.self, forCellReuseIdentifier: YHEmploymentVerificationAvailableCell.cellReuseIdentifier)
view.keyboardDismissMode = .onDrag
return view
}()
private let orderId: Int
init(orderId: Int) {
self.orderId = orderId
super.init(nibName: nil, bundle: nil)
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
requestData(isNeedLoading: true)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
IQKeyboardManager.shared.isEnabled = true
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
IQKeyboardManager.shared.isEnabled = false
}
}
extension YHGCIncomeRecordViewController {
@objc private func clickSaveButton() {
updateIncome(.save)
}
@objc private func clickSubmitButton() {
guard checkInput() else {
return
}
updateIncome(.submit)
}
private func setupUI() {
gk_navTitle = "收入记录信息填写"
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(tableView)
view.addSubview(bottomView)
bottomView.addSubview(saveButton)
bottomView.addSubview(submitButton)
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-64)
}
saveButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.top.equalToSuperview().offset(10)
make.height.equalTo(44)
make.width.equalTo(86)
}
submitButton.snp.makeConstraints { make in
make.left.equalTo(saveButton.snp.right).offset(10)
make.right.equalToSuperview().offset(-16)
make.top.equalToSuperview().offset(10)
make.height.equalTo(44)
}
tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
}
tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 44))
}
private func setupData() {
let hkdFormatter = currencyFormat("")
var money: Double = 0
var firstSection: [TableRow] = [.incomeSummary(false, false)]
let rate = self.incomeModel.rate > 0 ? self.incomeModel.rate : 0.92
let listCount = incomeModel.list.count
incomeModel.list.enumerated().forEach { index, companyModel in
money += companyModel.income_money
let moneyStr = companyModel.income_money == 0 ? "" : "约" + (hkdFormatter.string(from: NSNumber(value: companyModel.income_money / rate)) ?? "0") + "港币"
let timeStr: String = companyModel.fill_status ? "已填写" : "有\(companyModel.unfilled_count)项未填写"
let incomeItem: TableRow = .incomeItem(false, companyModel.company_name, moneyStr, timeStr, companyModel.income_id, index != listCount - 1)
firstSection.append(incomeItem)
}
firstSection.append(.addItem)
if listCount > 0 {
let totalNum = hkdFormatter.string(from: NSNumber(value: money / rate)) ?? "0"
let totalMoney: ASAttributedString = .init(string: "约 ", .font(.PFSC_R(ofSize: 14))) + .init(string: totalNum, .font(UIFont(name: "DINAlternate-Bold", size: 20) ?? UIFont.systemFont(ofSize: 20))) + .init(string: " 港币", .font(.PFSC_R(ofSize: 14)))
firstSection.append(.totalIncome(totalMoney))
} else {
let incomeItem: TableRow = .incomeItem(false, "收入信息1", "", "待填写", 0, false)
firstSection.append(incomeItem)
}
let detail: ASAttributedString = .init(string: "备注:赴港同意书为目前在职公司盖章提供,若目前未就职于任何公司,则由档案所在地人才中心盖章提供,", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor(hexString: "#8993A2") ?? .gray))
let actionStr = ASAttributedString.init(string: "查看示例模板", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor.brandMainColor), .underline(.init(rawValue: 1)), .action {
//
})
var secondSection: [TableRow] = [.consentForHKTravel("赴港同意书提供", detail + actionStr, "在职公司是否可以提供赴港同意书")]
secondSection.append(.questionSelect("人才中心是否可以提供赴港同意书"))
secondSection.append(.employmentVerification)
datas = [firstSection, secondSection]
tableView.reloadData()
}
private func currencyFormat(_ currencySymbol: String) -> NumberFormatter {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.currencySymbol = currencySymbol
formatter.maximumFractionDigits = 0
return formatter
}
}
extension YHGCIncomeRecordViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return datas.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard datas.count > section else {
return 0
}
let sectionArr = datas[section]
return sectionArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.section else {
return UITableViewCell()
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return UITableViewCell()
}
let tableRow = sectionArr[indexPath.row]
switch tableRow {
case let .incomeSummary(isEditState, isEditEnable):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHIncomeRecordSummaryCell.cellReuseIdentifier) as? YHIncomeRecordSummaryCell {
cell.setupCellInfo(isEditState, isEditEnable, showRightButton: false)
return cell
}
case let .incomeItem(isEditState, company, money, timeStr, _, showBottomLine):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHIncomeRecordItemCell.cellReuseIdentifier) as? YHIncomeRecordItemCell {
cell.setupCellInfo(title: company, detail: money, rightText: timeStr, isEditing: isEditState, showBottomLine: showBottomLine)
return cell
}
case let .totalIncome(money):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHTotalIncomeCell.cellReuseIdentifier) as? YHTotalIncomeCell {
cell.setupCellInfo(detail: money)
cell.didClickInfoButton = { [weak self, weak cell] in
guard let self = self else {
return
}
guard let cell = cell else {
return
}
let rate = self.incomeModel.rate > 0 ? self.incomeModel.rate : 0.92
YHWholeScreenTipsView.show(type: .hkdToRmbRateTips("注:按1港币≈\(rate)人民币计算,实际金额按递交时入境处给出的汇率为准"), targetView: cell.infoButton)
}
return cell
}
case let .consentForHKTravel(title, detail, question):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHInfoConsentForHKTravelCell.cellReuseIdentifier) as? YHInfoConsentForHKTravelCell {
over100IndexPath = indexPath
cell.setupCellInfo(title: title, detail: detail, question: question, needShowFailButton: !isOver100OK)
cell.didSelectSureButton = { [weak self] selected in
guard let self = self else {
return
}
switch selected {
case .true:
self.incomeModel.income_over_100 = YHIncomeOver100.true.rawValue
isOver100OK = true
case .false:
self.incomeModel.income_over_100 = YHIncomeOver100.false.rawValue
isOver100OK = true
case .unknown:
self.incomeModel.income_over_100 = YHIncomeOver100.unknown.rawValue
isOver100OK = false
}
self.setupData()
}
let over100Type = YHIncomeOver100(rawValue: incomeModel.income_over_100) ?? .unknown
switch over100Type {
case .true:
cell.selectedSureButton = .true
case .false:
cell.selectedSureButton = .false
case .unknown:
cell.selectedSureButton = .unknown
}
return cell
}
case .addItem:
if let cell = tableView.dequeueReusableCell(withIdentifier: YHAddIncomeRecordCell.cellReuseIdentifier) as? YHAddIncomeRecordCell {
cell.addButtonClickEvent = {
//
}
return cell
}
case let .questionSelect(question):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHInfoQuestionSelectionCell.cellReuseIdentifier) as? YHInfoQuestionSelectionCell {
over100IndexPath = indexPath
cell.setupCellInfo(question: question, needShowFailButton: !isOver100OK)
cell.didSelectSureButton = { [weak self] selected in
guard let self = self else {
return
}
switch selected {
case .true:
self.incomeModel.income_over_100 = YHIncomeOver100.true.rawValue
isOver100OK = true
case .false:
self.incomeModel.income_over_100 = YHIncomeOver100.false.rawValue
isOver100OK = true
case .unknown:
self.incomeModel.income_over_100 = YHIncomeOver100.unknown.rawValue
isOver100OK = false
}
self.setupData()
}
let over100Type = YHIncomeOver100(rawValue: incomeModel.income_over_100) ?? .unknown
switch over100Type {
case .true:
cell.selectedSureButton = .true
case .false:
cell.selectedSureButton = .false
case .unknown:
cell.selectedSureButton = .unknown
}
return cell
}
case .employmentVerification:
if let cell = tableView.dequeueReusableCell(withIdentifier: YHEmploymentVerificationAvailableCell.cellReuseIdentifier) as? YHEmploymentVerificationAvailableCell {
cell.setupCellInfo(detail: selectedEmployment)
return cell
}
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
guard datas.count > indexPath.section else {
return
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return
}
let tableRow = sectionArr[indexPath.row]
if case let .incomeItem(_, _, _, _, incomeId, _) = tableRow {
let ctl = YHGCIncomeRecordWorkExperienceViewController(incomeId: incomeId)
ctl.submitSuccess = { [weak self] in
guard let self = self else {
return
}
self.requestData(isNeedLoading: true, lastSelectedIncomeOver100: self.incomeModel.income_over_100)
}
navigationController?.pushViewController(ctl, animated: true)
} else if case .employmentVerification = tableRow {
guard employments.count > 1 else {
return
}
YHDynamicSheetPickerView.show(dataSource: ["华为科技有限公司有限公司", "阿里巴巴有限公司"], title: "选择可提供的在职公司", selectIndex: 0) { index in
//
}
}
}
}
extension YHGCIncomeRecordViewController {
private func checkInput() -> Bool {
if incomeModel.income_over_100 == YHIncomeOver100.unknown.rawValue {
isOver100OK = false
if let over100IndexPath = over100IndexPath, tableView.numberOfSections > over100IndexPath.section, tableView.numberOfRows(inSection: over100IndexPath.section) > over100IndexPath.row {
tableView.reloadRows(at: [over100IndexPath], with: .none)
}
return false
}
isOver100OK = true
return true
}
private func requestData(isNeedLoading: Bool = false, lastSelectedIncomeOver100: Int? = nil) {
if isNeedLoading {
YHHUD.show(.progress(message: "加载中..."))
}
viewModel.getIncomeList(orderId: orderId) { [weak self] incomeModel, error in
guard let self = self else {
return
}
if isNeedLoading {
YHHUD.hide()
}
guard let incomeModel = incomeModel else {
printLog("YHGCIncomeRecordViewController: 请求失败")
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg)
}
self.datas = []
self.tableView.reloadData()
self.navigationController?.popViewController(animated: true)
return
}
self.incomeModel = incomeModel
if let lastSelectedIncomeOver100 = lastSelectedIncomeOver100 {
self.incomeModel.income_over_100 = lastSelectedIncomeOver100
}
self.setupData()
}
}
private func updateIncome(_ type: YHIncomeRecordUpdateType) {
let msg = type == .save ? "保存中..." : "提交中..."
YHHUD.show(.progress(message: msg))
viewModel.incomeUpdate(orderId: orderId, incomeOver100: incomeModel.income_over_100, type: type) { [weak self] success, error in
guard let self = self else {
return
}
YHHUD.hide()
if success {
let msg = type == .save ? "保存成功" : "提交成功"
YHHUD.flash(message: msg)
if type == .submit {
self.navigationController?.popViewController(animated: true)
} else {
self.requestData(isNeedLoading: true)
}
} else if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg)
}
}
}
}
//
// YHGCIncomeRecordWorkExperienceViewController.swift
// galaxy
//
// Created by alexzzw on 2024/11/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import IQKeyboardManagerSwift
import UIKit
class YHGCIncomeRecordWorkExperienceViewController: YHBaseViewController {
enum TableRow {
case header(_ title: String)
case incomeFrom(_ title: String, _ detail: String)
case incomeTypeSelect(_ title: String, _ detail: String, _ isSelectedOne: Bool)
case incomeTypes(_ types: [YHIncomeType])
case inputMoney(_ title: String, _ detail: String?, _ inputStr: String?, _ showBottomLine: Bool, _ showStar: Bool, _ isIncomeMoney: Bool)
case inputRemark(_ detail: String)
case documentComfirm(_ title: String, _ question: String, _ docs: [String])
}
private lazy var datas: [[TableRow]] = []
private var selectedTypes: [YHIncomeType] = []
private let currencyRate = 0.92
private var isSaving = false
var submitSuccess: (() -> Void)?
// 校验字段控制
/// 是否选定收入类型
private var isIncomeTypeOK = true
private var incomeTypeIndexPath: IndexPath?
/// 是否选定文件
private var isHasAllFileOK = true
private var hasAllFileIndexPath: IndexPath?
/// 是否收入金额已填写
private var isIncomeMoneyOK = true
private var incomMoneyIndexPath: IndexPath?
private lazy var viewModel = YHIncomeRecordViewModel()
private var companyModel = YHIncomeCompanyDetailModel()
private lazy var submitButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.setTitle("提交", for: .normal)
button.setTitle("提交", for: .highlighted)
button.setTitleColor(UIColor(hex: 0xFFFFFF), for: .normal)
button.setTitleColor(UIColor(hex: 0xFFFFFF), for: .highlighted)
button.addTarget(self, action: #selector(clickSubmitButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
private lazy var tableView: UITableView = {
let view = UITableView(frame: .zero, style: .grouped)
view.estimatedSectionHeaderHeight = 16.0
view.estimatedSectionFooterHeight = 0.01
view.sectionHeaderHeight = 16.0
view.sectionFooterHeight = 0.01
view.contentInsetAdjustmentBehavior = .never
view.showsVerticalScrollIndicator = false
view.separatorStyle = .none
view.delegate = self
view.dataSource = self
view.backgroundColor = .clear
view.tableFooterView = UITableViewHeaderFooterView()
view.rowHeight = UITableView.automaticDimension
view.register(YHWorkingHourHeaderCell.self, forCellReuseIdentifier: YHWorkingHourHeaderCell.cellReuseIdentifier)
view.register(YHIncomeRecordFromCell.self, forCellReuseIdentifier: YHIncomeRecordFromCell.cellReuseIdentifier)
view.register(YHIncomeTypeSelectCell.self, forCellReuseIdentifier: YHIncomeTypeSelectCell.cellReuseIdentifier)
view.register(YHIncomeTypesCell.self, forCellReuseIdentifier: YHIncomeTypesCell.cellReuseIdentifier)
view.register(YHIncomeInputMoneyCell.self, forCellReuseIdentifier: YHIncomeInputMoneyCell.cellReuseIdentifier)
view.register(YHIncomeRemarkCell.self, forCellReuseIdentifier: YHIncomeRemarkCell.cellReuseIdentifier)
view.register(YHIncomeDocumentationConfirmationCell.self, forCellReuseIdentifier: YHIncomeDocumentationConfirmationCell.cellReuseIdentifier)
view.keyboardDismissMode = .onDrag
return view
}()
private let incomeId: Int
init(incomeId: Int) {
self.incomeId = incomeId
super.init(nibName: nil, bundle: nil)
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
requestData(isNeedLoading: true)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
IQKeyboardManager.shared.isEnabled = true
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
IQKeyboardManager.shared.isEnabled = false
}
override func backItemClick(_ sender: Any) {
guard !isSaving else {
return
}
isSaving = true
submitIncome(.save) { [weak self] _ in
self?.isSaving = false
}
}
/// 是否可以返回,包括点击返回和手势返回,默认YES
override func navigationShouldPop() -> Bool {
guard !isSaving else {
return false
}
isSaving = true
submitIncome(.save) { [weak self] _ in
self?.isSaving = false
}
return false
}
}
extension YHGCIncomeRecordWorkExperienceViewController {
@objc private func clickSubmitButton() {
submitIncome(.submit, complete: { _ in })
}
private func setupUI() {
gk_navTitle = "收入记录信息填写"
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(tableView)
view.addSubview(bottomView)
bottomView.addSubview(submitButton)
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-64)
}
submitButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.top.equalToSuperview().offset(10)
make.height.equalTo(44)
}
tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
}
tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 44))
}
private func setupData() {
selectedTypes = companyModel.income_type.compactMap {
YHIncomeType(rawValue: $0)
}
var firstSection: [TableRow] = [.header("收入信息"), .incomeFrom("收入来源公司", companyModel.company_name), .incomeTypeSelect("收入类型(多选)", "请选择", selectedTypes.count > 0)]
if selectedTypes.count > 0 {
firstSection.append(.incomeTypes(selectedTypes))
}
let hkdFmt = currencyFormat("")
let rmbFmt = currencyFormat("¥")
let rate = companyModel.rate > 0 ? companyModel.rate : 0.92
if selectedTypes.contains(.incomeOfMainland) || selectedTypes.contains(.incomeOfHKCompanies) || selectedTypes.contains(.incomeOfMacauCompanies) || selectedTypes.contains(.incomeOfOtherOverseasCompanies) {
firstSection.append(.inputMoney("公司营业额(近一年)", "约\(hkdFmt.string(from: NSNumber(value: companyModel.corporate_turnover / rate)) ?? "0")港币", rmbFmt.string(from: NSNumber(value: companyModel.corporate_turnover)) ?? "0", true, false, false))
}
firstSection.append(.inputMoney("收入金额", "约\(hkdFmt.string(from: NSNumber(value: companyModel.income_money / rate)) ?? "0")港币", rmbFmt.string(from: NSNumber(value: companyModel.income_money)) ?? "0", false, true, true))
firstSection.append(.inputRemark("注:按1港币≈\(rate)人民币计算,实际金额按递交时入境处给出的汇率为准"))
let set = Set(selectedTypes.map { $0.docsArray() }.flatMap { $0 })
var arr = Array(set)
if set.count == 0 {
arr = YHIncomeType.defaultDocs()
}
let secondSection: [TableRow] = [.documentComfirm("证件提供确认", "您是否可以提供以下所有证明文件", arr)]
datas = [firstSection, secondSection]
tableView.reloadData()
}
private func showSelectIncomeTypePopVC(selectedTypes: [YHIncomeType]) {
let ctl = YHIncomeTypeSelectViewController(selectedTypes: selectedTypes)
let bpc = YHBottomPresentationController(presentedViewController: ctl, presenting: self)
bpc.customRadius = 8.0
ctl.transitioningDelegate = bpc
ctl.sureButtonEvent = { [weak self] selectedTypes in
guard let self = self else {
return
}
self.selectedTypes = selectedTypes
self.updateSelectTypes()
}
present(ctl, animated: true, completion: nil)
}
private func updateSelectTypes() {
companyModel.income_type = selectedTypes.map { $0.rawValue }
if companyModel.income_type.count > 0 {
isIncomeTypeOK = true
}
var incomeTypesIndexPath: IndexPath?
var incomeTypeSelectIndexPath: IndexPath?
var docIndexPath: IndexPath?
var incomeCompanyIndexPath: IndexPath?
datas = datas.enumerated().map { section, sectionArr in
sectionArr.enumerated().map { row, tableRow in
switch tableRow {
case .incomeTypes:
incomeTypesIndexPath = IndexPath(row: row, section: section)
return .incomeTypes(selectedTypes)
case let .incomeTypeSelect(title, detail, _):
incomeTypeSelectIndexPath = IndexPath(row: row, section: section)
return .incomeTypeSelect(title, detail, selectedTypes.count > 0)
case let .documentComfirm(title, question, _):
docIndexPath = IndexPath(row: row, section: section)
let set = Set(selectedTypes.map { $0.docsArray() }.flatMap { $0 })
if set.count > 0 {
return .documentComfirm(title, question, Array(set))
} else {
return .documentComfirm(title, question, YHIncomeType.defaultDocs())
}
case let .inputMoney(_, _, _, _, _, isIncomeMoney):
if !isIncomeMoney {
incomeCompanyIndexPath = IndexPath(row: row, section: section)
}
return tableRow
default:
return tableRow
}
}
}
guard let incomeTypeSelectIndexPath = incomeTypeSelectIndexPath else {
return
}
if selectedTypes.count > 0 {
if incomeTypesIndexPath == nil {
var sectionArr = datas[incomeTypeSelectIndexPath.section]
sectionArr.insert(.incomeTypes(selectedTypes), at: incomeTypeSelectIndexPath.row + 1)
datas[incomeTypeSelectIndexPath.section] = sectionArr
}
} else {
guard let incomeTypesIndexPath = incomeTypesIndexPath else {
return
}
var sectionArr = datas[incomeTypesIndexPath.section]
sectionArr.remove(at: incomeTypesIndexPath.row)
datas[incomeTypesIndexPath.section] = sectionArr
}
if selectedTypes.contains(.incomeOfMainland) || selectedTypes.contains(.incomeOfHKCompanies) || selectedTypes.contains(.incomeOfMacauCompanies) || selectedTypes.contains(.incomeOfOtherOverseasCompanies) {
if incomeCompanyIndexPath == nil {
var sectionArr = datas[incomeTypeSelectIndexPath.section]
if let incomeIndex = sectionArr.firstIndex(where: { tableRow in
if case let .inputMoney(_, _, _, _, _, isIncomeMoney) = tableRow, isIncomeMoney == true {
return true
} else {
return false
}
}) {
let newIndex = incomeIndex //> 1 ? incomeIndex - 1 : 0
let hkdFmt = currencyFormat("")
let rmbFmt = currencyFormat("¥")
let rate = companyModel.rate > 0 ? companyModel.rate : 0.92
sectionArr.insert(.inputMoney("公司营业额(近一年)", "约\(hkdFmt.string(from: NSNumber(value: companyModel.corporate_turnover / rate)) ?? "0")港币", rmbFmt.string(from: NSNumber(value: companyModel.corporate_turnover)) ?? "0", true, false, false), at: newIndex)
datas[incomeTypeSelectIndexPath.section] = sectionArr
}
}
} else {
if incomeCompanyIndexPath != nil {
var sectionArr = datas[incomeTypeSelectIndexPath.section]
if let companyIndex = sectionArr.firstIndex(where: { tableRow in
if case let .inputMoney(_, _, _, _, _, isIncomeMoney) = tableRow, isIncomeMoney == false {
return true
} else {
return false
}
}) {
sectionArr.remove(at: companyIndex)
datas[incomeTypeSelectIndexPath.section] = sectionArr
}
}
}
if let secondSection = docIndexPath?.section {
tableView.performBatchUpdates { [weak tableView] in
tableView?.reloadSections(IndexSet(arrayLiteral: incomeTypeSelectIndexPath.section, secondSection), with: .automatic)
}
} else {
tableView.performBatchUpdates { [weak tableView] in
tableView?.reloadSections(IndexSet(integer: incomeTypeSelectIndexPath.section), with: .automatic)
}
}
}
private func currencyFormat(_ currencySymbol: String) -> NumberFormatter {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.currencySymbol = currencySymbol
formatter.maximumFractionDigits = 0
return formatter
}
}
extension YHGCIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return datas.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard datas.count > section else {
return 0
}
let sectionArr = datas[section]
return sectionArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.section else {
return UITableViewCell()
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return UITableViewCell()
}
let tableRow = sectionArr[indexPath.row]
switch tableRow {
case let .header(title):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHWorkingHourHeaderCell.cellReuseIdentifier) as? YHWorkingHourHeaderCell {
cell.setupCellInfo(title)
return cell
}
case let .incomeFrom(title, detail):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHIncomeRecordFromCell.cellReuseIdentifier) as? YHIncomeRecordFromCell {
cell.setupCellInfo(title: title, detail: detail, showBottomLine: true)
return cell
}
case let .incomeTypeSelect(title, detail, isSelectedOne):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHIncomeTypeSelectCell.cellReuseIdentifier) as? YHIncomeTypeSelectCell {
cell.setupCellInfo(title: title, detail: detail, isSelectedOne: isSelectedOne, showBottomLine: !isSelectedOne, needShowFailButton: !isIncomeTypeOK)
incomeTypeIndexPath = indexPath
return cell
}
case let .incomeTypes(types):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHIncomeTypesCell.cellReuseIdentifier) as? YHIncomeTypesCell {
cell.setupCellInfo(types: types.map { $0.nameString() })
cell.didClickTypeView = { [weak self] index in
guard let self = self else {
return
}
self.selectedTypes.remove(at: index)
self.updateSelectTypes()
}
return cell
}
case let .inputMoney(title, detail, inputStr, showBottomLine, showStar, isIncomeMoney):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHIncomeInputMoneyCell.cellReuseIdentifier) as? YHIncomeInputMoneyCell {
var needShowFailButton = false
if isIncomeMoney {
incomMoneyIndexPath = indexPath
needShowFailButton = !isIncomeMoneyOK
}
cell.setupCellInfo(title: title, detail: detail, inputValue: inputStr, showBottomLine: showBottomLine, showStarIcon: showStar, needShowFailButton: needShowFailButton)
cell.didBeginEditing = { textField in
var text = textField.text ?? ""
text = text.replacingOccurrences(of: "¥", with: "")
text = text.replacingOccurrences(of: ",", with: "")
if text == "0" {
text = ""
}
textField.text = text
}
cell.didEndEditing = { [weak self] textField in
guard let self = self else {
return
}
guard let text = textField.text, text.count > 0 else {
if self.datas.count > indexPath.section {
let sectionArr = self.datas[indexPath.section]
if sectionArr.count > indexPath.row {
let currentRow = sectionArr[indexPath.row]
if case let .inputMoney(title, _, _, showBottomLine, showStar, isIncomeMoney) = currentRow {
self.datas[indexPath.section][indexPath.row] = .inputMoney(title, nil, nil, showBottomLine, showStar, isIncomeMoney)
self.tableView.reloadRows(at: [indexPath], with: .automatic)
if isIncomeMoney {
self.companyModel.income_money = 0
} else {
self.companyModel.corporate_turnover = 0
}
}
}
}
return
}
// 转换为数字
let number = Double(text) ?? 0
// 格式化为带货币符号和千分位
let detail = number / self.currencyRate
if isIncomeMoney {
self.isIncomeMoneyOK = true
self.companyModel.income_money = number
} else {
self.companyModel.corporate_turnover = number
}
let rmbFormatter = self.currencyFormat("¥")
let hkdFormatter = self.currencyFormat("")
if let formattedString = rmbFormatter.string(from: NSNumber(value: number)) {
textField.text = formattedString
let detailStr = "约" + (hkdFormatter.string(from: NSNumber(value: detail)) ?? "") + "港币"
if self.datas.count > indexPath.section {
let sectionArr = self.datas[indexPath.section]
if sectionArr.count > indexPath.row {
let currentRow = sectionArr[indexPath.row]
if case let .inputMoney(title, _, _, showBottomLine, showStar, isIncomeMoney) = currentRow {
self.datas[indexPath.section][indexPath.row] = .inputMoney(title, detailStr, formattedString, showBottomLine, showStar, isIncomeMoney)
self.tableView.reloadRows(at: [indexPath], with: .automatic)
}
}
}
}
}
return cell
}
case let .inputRemark(detail):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHIncomeRemarkCell.cellReuseIdentifier) as? YHIncomeRemarkCell {
cell.setupCellInfo(detail)
return cell
}
case let .documentComfirm(title, question, docs):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHIncomeDocumentationConfirmationCell.cellReuseIdentifier) as? YHIncomeDocumentationConfirmationCell {
hasAllFileIndexPath = indexPath
cell.selectedSureButton = YHIncomeRecordHasAllFile(rawValue: companyModel.has_all_file) ?? .unknown
cell.setupCellInfo(title: title, question: question, documents: docs, needShowFailButton: !isHasAllFileOK)
cell.didSelectSureButton = { [weak self] flag in
guard let self = self else {
return
}
self.companyModel.has_all_file = flag.rawValue
self.isHasAllFileOK = flag != .unknown
self.tableView.reloadRows(at: [indexPath], with: .automatic)
}
return cell
}
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
guard datas.count > indexPath.section else {
return
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return
}
let tableRow = sectionArr[indexPath.row]
if case .incomeTypeSelect = tableRow {
showSelectIncomeTypePopVC(selectedTypes: selectedTypes)
}
}
}
extension YHGCIncomeRecordWorkExperienceViewController {
private func checkInput() -> Bool {
var retValue = true
var updateRows: [IndexPath] = []
if companyModel.has_all_file == YHIncomeRecordHasAllFile.unknown.rawValue {
isHasAllFileOK = false
if let hasAllFileIndexPath = hasAllFileIndexPath, tableView.numberOfSections > hasAllFileIndexPath.section, tableView.numberOfRows(inSection: hasAllFileIndexPath.section) > hasAllFileIndexPath.row {
updateRows.append(hasAllFileIndexPath)
}
retValue = false
}
if companyModel.income_type.count == 0 {
isIncomeTypeOK = false
if let incomeTypeIndexPath = incomeTypeIndexPath, tableView.numberOfSections > incomeTypeIndexPath.section, tableView.numberOfRows(inSection: incomeTypeIndexPath.section) > incomeTypeIndexPath.row {
updateRows.append(incomeTypeIndexPath)
}
retValue = false
}
if companyModel.income_money == 0 {
isIncomeMoneyOK = false
if let incomMoneyIndexPath = incomMoneyIndexPath, tableView.numberOfSections > incomMoneyIndexPath.section, tableView.numberOfRows(inSection: incomMoneyIndexPath.section) > incomMoneyIndexPath.row {
updateRows.append(incomMoneyIndexPath)
}
retValue = false
}
if updateRows.count > 0 {
tableView.reloadRows(at: updateRows, with: .none)
isHasAllFileOK = true
isIncomeTypeOK = true
isIncomeMoneyOK = true
}
return retValue
}
private func requestData(isNeedLoading: Bool = false) {
if isNeedLoading {
YHHUD.show(.progress(message: "加载中..."))
}
viewModel.getIncomeDetail(incomeId: incomeId) { [weak self] companyModel, error in
guard let self = self else {
return
}
if isNeedLoading {
YHHUD.hide()
}
guard let companyModel = companyModel else {
printLog("YHGCIncomeRecordWorkExperienceViewController: 请求失败")
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg)
}
self.datas = []
self.tableView.reloadData()
return
}
self.companyModel = companyModel
self.setupData()
}
}
private func submitIncome(_ type: YHIncomeRecordUpdateType, complete: @escaping (Bool) -> Void) {
view.endEditing(true)
let msg = type == .save ? "保存中..." : "提交中..."
if type == .submit {
if checkInput() == false {
return
}
}
YHHUD.show(.progress(message: msg))
viewModel.updateDetail(incomeId: incomeId, incomeMoney: companyModel.income_money, corporateTurnover: companyModel.corporate_turnover, incomeType: companyModel.income_type, hasAllFile: companyModel.has_all_file) { [weak self] success, error in
guard let self = self else {
complete(false)
return
}
YHHUD.hide()
complete(success)
if success {
let msg = type == .save ? "保存成功" : "提交成功"
YHHUD.flash(message: msg)
self.submitSuccess?()
self.navigationController?.popViewController(animated: true)
} else {
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg)
}
if type == .save {
self.navigationController?.popViewController(animated: true)
}
}
}
}
}
//
// YHInfoQuestionSelectionCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/21.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHInfoQuestionSelectionCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHInfoQuestionSelectionCell"
var didSelectSureButton: ((YHCheckboxSelectType) -> Void)?
var selectedSureButton: YHCheckboxSelectType = .unknown {
didSet {
updateButtonsState(selectedSureButton)
}
}
private lazy var dotIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "red_dot_6"))
return imageView
}()
private lazy var infoQuestionLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.numberOfLines = 0
label.lineBreakMode = .byWordWrapping
return label
}()
private lazy var sureButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = .PFSC_M(ofSize: 13)
button.setTitle("是", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.setTitleColor(.brandMainColor, for: .selected)
button.addTarget(self, action: #selector(sureButtonDidClick(_:)), for: .touchUpInside)
button.layer.cornerRadius = 16.0
button.clipsToBounds = true
return button
}()
private lazy var cancelButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = .PFSC_M(ofSize: 13)
button.setTitle("否", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.setTitleColor(.brandMainColor, for: .selected)
button.addTarget(self, action: #selector(cancelButtonDidClick(_:)), for: .touchUpInside)
button.layer.cornerRadius = 16
button.clipsToBounds = true
return button
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupCellInfo(question: String, showBottomLine: Bool = false, needShowFailButton: Bool) {
infoQuestionLabel.text = question
updateFailLabel(needShowFailButton)
}
}
extension YHInfoQuestionSelectionCell {
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
infoFailLabel.isHidden = false
infoQuestionLabel.snp.remakeConstraints { make in
make.left.equalTo(dotIcon.snp.right).offset(2)
make.top.equalToSuperview().offset(16)
make.height.greaterThanOrEqualTo(40)
make.width.lessThanOrEqualTo(113)
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoQuestionLabel.snp.bottom).offset(6)
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
} else {
infoFailLabel.isHidden = true
infoQuestionLabel.snp.remakeConstraints { make in
make.left.equalTo(dotIcon.snp.right).offset(2)
make.top.equalToSuperview().offset(16)
make.height.greaterThanOrEqualTo(40)
make.width.lessThanOrEqualTo(113)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
}
}
@objc private func cancelButtonDidClick(_ sender: UIButton) {
guard !sender.isSelected else {
return
}
selectedSureButton = .false
didSelectSureButton?(.false)
}
@objc private func sureButtonDidClick(_ sender: UIButton) {
guard !sender.isSelected else {
return
}
selectedSureButton = .true
didSelectSureButton?(.true)
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoQuestionLabel)
subContainerView.addSubview(sureButton)
subContainerView.addSubview(cancelButton)
subContainerView.addSubview(infoFailLabel)
sureButton.setContentCompressionResistancePriority(.required, for: .horizontal)
cancelButton.setContentCompressionResistancePriority(.required, for: .horizontal)
infoQuestionLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.height.width.equalTo(6)
make.top.equalTo(infoQuestionLabel.snp.top).offset(7)
}
infoQuestionLabel.snp.makeConstraints { make in
make.left.equalTo(dotIcon.snp.right).offset(2)
make.top.equalToSuperview().offset(16)
make.height.greaterThanOrEqualTo(40)
make.width.lessThanOrEqualTo(113)
make.bottom.equalToSuperview().offset(-16)
}
cancelButton.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-18)
make.height.equalTo(32)
make.width.equalTo(69)
make.centerY.equalTo(infoQuestionLabel)
}
sureButton.snp.makeConstraints { make in
make.right.equalTo(cancelButton.snp.left).offset(-8)
make.height.equalTo(32)
make.width.equalTo(69)
make.centerY.equalTo(infoQuestionLabel)
make.left.greaterThanOrEqualTo(infoQuestionLabel.snp.right).offset(8)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
selectedSureButton = .unknown
}
private func updateButtonsState(_ state: YHCheckboxSelectType) {
switch state {
case .unknown:
sureButton.isSelected = false
sureButton.backgroundColor = .contentBkgColor
sureButton.layer.borderColor = nil
sureButton.layer.borderWidth = 0
cancelButton.isSelected = false
cancelButton.backgroundColor = .contentBkgColor
cancelButton.layer.borderColor = nil
cancelButton.layer.borderWidth = 0
case .true:
sureButton.isSelected = true
sureButton.backgroundColor = UIColor(hexString: "#EBF0F9")
sureButton.layer.borderColor = UIColor.brandMainColor.cgColor
sureButton.layer.borderWidth = 1
cancelButton.isSelected = false
cancelButton.backgroundColor = .contentBkgColor
cancelButton.layer.borderColor = nil
cancelButton.layer.borderWidth = 0
case .false:
cancelButton.isSelected = true
cancelButton.backgroundColor = UIColor(hexString: "#EBF0F9")
cancelButton.layer.borderColor = UIColor.brandMainColor.cgColor
cancelButton.layer.borderWidth = 1
sureButton.isSelected = false
sureButton.backgroundColor = .contentBkgColor
sureButton.layer.borderColor = nil
sureButton.layer.borderWidth = 0
}
}
}
//
// YHInfoQuestionSelectionCell.swift
// galaxy
//
// Created by alexzzw on 2024/12/21.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHInfoQuestionSelectionCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHInfoQuestionSelectionCell"
var didSelectSureButton: ((YHCheckboxSelectType) -> Void)?
var selectedSureButton: YHCheckboxSelectType = .unknown {
didSet {
updateButtonsState(selectedSureButton)
}
}
private lazy var dotIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "red_dot_6"))
return imageView
}()
private lazy var infoQuestionLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.numberOfLines = 0
label.lineBreakMode = .byWordWrapping
return label
}()
private lazy var sureButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = .PFSC_M(ofSize: 13)
button.setTitle("是", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.setTitleColor(.brandMainColor, for: .selected)
button.addTarget(self, action: #selector(sureButtonDidClick(_:)), for: .touchUpInside)
button.layer.cornerRadius = 16.0
button.clipsToBounds = true
return button
}()
private lazy var cancelButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = .PFSC_M(ofSize: 13)
button.setTitle("否", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.setTitleColor(.brandMainColor, for: .selected)
button.addTarget(self, action: #selector(cancelButtonDidClick(_:)), for: .touchUpInside)
button.layer.cornerRadius = 16
button.clipsToBounds = true
return button
}()
private lazy var infoFailLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_R(ofSize: 12)
label.textColor = .failColor
label.text = "请选择"
return label
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupCellInfo(question: String, showBottomLine: Bool = false, needShowFailButton: Bool) {
infoQuestionLabel.text = question
updateFailLabel(needShowFailButton)
}
}
extension YHInfoQuestionSelectionCell {
private func updateFailLabel(_ needShowFailButton: Bool) {
if needShowFailButton {
infoFailLabel.isHidden = false
infoQuestionLabel.snp.remakeConstraints { make in
make.left.equalTo(dotIcon.snp.right).offset(2)
make.top.equalToSuperview().offset(16)
make.height.greaterThanOrEqualTo(40)
make.width.lessThanOrEqualTo(113)
}
infoFailLabel.snp.remakeConstraints { make in
make.top.equalTo(infoQuestionLabel.snp.bottom).offset(6)
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
} else {
infoFailLabel.isHidden = true
infoQuestionLabel.snp.remakeConstraints { make in
make.left.equalTo(dotIcon.snp.right).offset(2)
make.top.equalToSuperview().offset(16)
make.height.greaterThanOrEqualTo(40)
make.width.lessThanOrEqualTo(113)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
}
}
@objc private func cancelButtonDidClick(_ sender: UIButton) {
guard !sender.isSelected else {
return
}
selectedSureButton = .false
didSelectSureButton?(.false)
}
@objc private func sureButtonDidClick(_ sender: UIButton) {
guard !sender.isSelected else {
return
}
selectedSureButton = .true
didSelectSureButton?(.true)
}
private func setupUI() {
updateCellCorner(.mid)
subContainerView.addSubview(dotIcon)
subContainerView.addSubview(infoQuestionLabel)
subContainerView.addSubview(sureButton)
subContainerView.addSubview(cancelButton)
subContainerView.addSubview(infoFailLabel)
sureButton.setContentCompressionResistancePriority(.required, for: .horizontal)
cancelButton.setContentCompressionResistancePriority(.required, for: .horizontal)
infoQuestionLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
dotIcon.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.height.width.equalTo(6)
make.top.equalTo(infoQuestionLabel.snp.top).offset(7)
}
infoQuestionLabel.snp.makeConstraints { make in
make.left.equalTo(dotIcon.snp.right).offset(2)
make.top.equalToSuperview().offset(16)
make.height.greaterThanOrEqualTo(40)
make.width.lessThanOrEqualTo(113)
make.bottom.equalToSuperview().offset(-16)
}
cancelButton.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-18)
make.height.equalTo(32)
make.width.equalTo(69)
make.centerY.equalTo(infoQuestionLabel)
}
sureButton.snp.makeConstraints { make in
make.right.equalTo(cancelButton.snp.left).offset(-8)
make.height.equalTo(32)
make.width.equalTo(69)
make.centerY.equalTo(infoQuestionLabel)
make.left.greaterThanOrEqualTo(infoQuestionLabel.snp.right).offset(8)
}
infoFailLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.right.lessThanOrEqualToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-16)
}
infoFailLabel.isHidden = true
selectedSureButton = .unknown
}
private func updateButtonsState(_ state: YHCheckboxSelectType) {
switch state {
case .unknown:
sureButton.isSelected = false
sureButton.backgroundColor = .contentBkgColor
sureButton.layer.borderColor = nil
sureButton.layer.borderWidth = 0
cancelButton.isSelected = false
cancelButton.backgroundColor = .contentBkgColor
cancelButton.layer.borderColor = nil
cancelButton.layer.borderWidth = 0
case .true:
sureButton.isSelected = true
sureButton.backgroundColor = UIColor(hexString: "#EBF0F9")
sureButton.layer.borderColor = UIColor.brandMainColor.cgColor
sureButton.layer.borderWidth = 1
cancelButton.isSelected = false
cancelButton.backgroundColor = .contentBkgColor
cancelButton.layer.borderColor = nil
cancelButton.layer.borderWidth = 0
case .false:
cancelButton.isSelected = true
cancelButton.backgroundColor = UIColor(hexString: "#EBF0F9")
cancelButton.layer.borderColor = UIColor.brandMainColor.cgColor
cancelButton.layer.borderWidth = 1
sureButton.isSelected = false
sureButton.backgroundColor = .contentBkgColor
sureButton.layer.borderColor = nil
sureButton.layer.borderWidth = 0
}
}
}
...@@ -36,17 +36,18 @@ class YHGCWorkExperienceListViewController: YHBaseViewController { ...@@ -36,17 +36,18 @@ class YHGCWorkExperienceListViewController: YHBaseViewController {
} }
func getData() { func getData() {
baseData = viewModel.getBaseDataSource(showPrompt)
docData = viewModel.getDocDataSource(showPrompt)
viewModel?.requestWorkList("\(orderId)", callBackBlock: {[weak self] success, error in viewModel?.requestWorkList("\(orderId)", callBackBlock: {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.dataSource = success self.dataSource = success
self.baseData = viewModel.getBaseDataSource(showPrompt)
self.docData = viewModel.getDocDataSource(showPrompt)
self.tableView.reloadData() self.tableView.reloadData()
}) })
} }
func updateDataSource() { func updateDataSource() {
self.baseData = viewModel.getBaseDataSource(showPrompt)
self.docData = viewModel.getDocDataSource(showPrompt)
self.tableView.reloadData() self.tableView.reloadData()
} }
...@@ -131,6 +132,14 @@ class YHGCWorkExperienceListViewController: YHBaseViewController { ...@@ -131,6 +132,14 @@ class YHGCWorkExperienceListViewController: YHBaseViewController {
extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableViewDataSource { extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// var count = 1
// if self.viewModel.mainModel.has_work_experience == 1 {
// count = count + 1
// }
// if self.viewModel.mainModel.is_consent_required == 1 {
// count = count + 1
// }
// return count
return 3 return 3
} }
...@@ -140,11 +149,8 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -140,11 +149,8 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
cell.dataSource = baseData cell.dataSource = baseData
cell.workExperienceBlock = {[weak self] model in cell.workExperienceBlock = {[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 self.updateDataSource()
// if id != .id1 {
// self.updateDataSource()
// }
} }
return cell return cell
} else if indexPath.row == 1 { } else if indexPath.row == 1 {
...@@ -158,7 +164,6 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -158,7 +164,6 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
} }
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 firstModel = self.dataSource?.first
let vc = YHGCWorkExperienceViewController() let vc = YHGCWorkExperienceViewController()
vc.workID = model.id ?? 0 vc.workID = model.id ?? 0
vc.orderID = self.orderId vc.orderID = self.orderId
...@@ -193,14 +198,13 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -193,14 +198,13 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
return cell return cell
} else if indexPath.row == 2 { } else if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHGCWorkListHasDocTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHGCWorkListHasDocTableViewCell.self)
cell.companyList = self.viewModel.mainModel.list ?? []
cell.url = self.viewModel.mainModel.consent_template_url
cell.dataSource = docData cell.dataSource = docData
cell.workExperienceBlock = {[weak self] model in cell.workExperienceBlock = {[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 self.updateDataSource()
// if id != .id1 {
// self.updateDataSource()
// }
} }
return cell return cell
} }
...@@ -215,7 +219,7 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -215,7 +219,7 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
let data = array[i] let data = array[i]
let message = data.message ?? "" let message = data.message ?? ""
let isShow = data.isShowPrompts ?? false let isShow = data.isShowPrompts ?? false
h = h + 52 h = h + 62
if isShow && message.count == 0 { if isShow && message.count == 0 {
h = h + 20 h = h + 20
} }
...@@ -230,7 +234,7 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -230,7 +234,7 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
let data = array[i] let data = array[i]
let message = data.message ?? "" let message = data.message ?? ""
let isShow = data.isShowPrompts ?? false let isShow = data.isShowPrompts ?? false
h = h + 52 h = h + 62
if isShow && message.count == 0 { if isShow && message.count == 0 {
h = h + 20 h = h + 20
} }
......
...@@ -18,7 +18,6 @@ class YHGCWorkExperienceViewController: YHBaseViewController { ...@@ -18,7 +18,6 @@ class YHGCWorkExperienceViewController: YHBaseViewController {
var fileDataSource: [YHWorkExperienceFileModel]? var fileDataSource: [YHWorkExperienceFileModel]?
var workID: Int = 0 var workID: Int = 0
var orderID: Int = 0 var orderID: Int = 0
var positionId: Int = 0
var isMore: Bool = false var isMore: Bool = false
var isShowPrompt: Bool = false var isShowPrompt: Bool = false
var isShowMessageSelect: Bool = true var isShowMessageSelect: Bool = true
...@@ -138,10 +137,14 @@ extension YHGCWorkExperienceViewController: UITableViewDelegate, UITableViewData ...@@ -138,10 +137,14 @@ extension YHGCWorkExperienceViewController: UITableViewDelegate, UITableViewData
guard let self = self else { return } guard let self = self else { return }
self.viewModel.updateModel(model) self.viewModel.updateModel(model)
let id = model.id let id = model.id
if id != .id1 && id != .id2 && id != .id6 && id != .id10 && id != .id11 { if id != .id4 && id != .id5 && id != .id8 {
self.updateDataSource() self.updateDataSource()
} }
} }
cell.companyBlock = {[weak self] model in
guard let self = self else { return }
self.viewModel.updateCompanyModel(model.company_name ?? "")
}
return cell return cell
} }
...@@ -154,7 +157,7 @@ extension YHGCWorkExperienceViewController: UITableViewDelegate, UITableViewData ...@@ -154,7 +157,7 @@ extension YHGCWorkExperienceViewController: UITableViewDelegate, UITableViewData
let data = array[i] let data = array[i]
let message = data.message ?? "" let message = data.message ?? ""
let isShow = data.isShowPrompts ?? false let isShow = data.isShowPrompts ?? false
if data.id == .id7 { if data.id == .id6 {
h = h + 72 h = h + 72
} else { } else {
h = h + 52 h = h + 52
......
...@@ -23,7 +23,7 @@ class YHGCWorkModel: SmartCodable { ...@@ -23,7 +23,7 @@ class YHGCWorkModel: SmartCodable {
var why_work_time_overlap: String = "" //高才使用 关于工作时间重叠的说明 var why_work_time_overlap: String = "" //高才使用 关于工作时间重叠的说明
var has_work_experience: Int = 0 //高BC使用 是否有工作经历 0.未知 1.是 2.否 var has_work_experience: Int = 0 //高BC使用 是否有工作经历 0.未知 1.是 2.否
var is_consent_required: Int = 0 //高才使用 是否必须提供赴港同意书 0-否 1-是 var is_consent_required: Int = 0 //高才使用 是否必须提供赴港同意书 0-否 1-是
var consent_template_url: String = ""
var list: [YHWorkItemListModel]? var list: [YHWorkItemListModel]?
required init() { required init() {
} }
......
...@@ -18,6 +18,8 @@ class YHGCWorkListHasDocTableViewCell: UITableViewCell { ...@@ -18,6 +18,8 @@ class YHGCWorkListHasDocTableViewCell: UITableViewCell {
var mainItemView: UIView! var mainItemView: UIView!
var workId: Int = 0 var workId: Int = 0
var orderId: Int = 0 var orderId: Int = 0
var url: String = ""
var companyList: [YHWorkItemListModel] = []
var dataSource: YHSectionWorkExperienceModel?{ var dataSource: YHSectionWorkExperienceModel?{
didSet { didSet {
updateAllViews() updateAllViews()
...@@ -135,11 +137,12 @@ class YHGCWorkListHasDocTableViewCell: UITableViewCell { ...@@ -135,11 +137,12 @@ class YHGCWorkListHasDocTableViewCell: UITableViewCell {
let data = dataSource?.models?[i] let data = dataSource?.models?[i]
let isShow = data?.isShowPrompts ?? false let isShow = data?.isShowPrompts ?? false
let message = data?.message ?? "" let message = data?.message ?? ""
var h = 51 var h = 61
if isShow && message.count == 0 { if isShow && message.count == 0 {
h = h + 20 h = h + 20
} }
let itemView = YHWorkExperienceItemView() let itemView = YHWorkExperienceItemView()
itemView.companyList = companyList
itemView.dataSource = data itemView.dataSource = data
itemView.workId = workId itemView.workId = workId
itemView.orderId = orderId itemView.orderId = orderId
......
...@@ -105,7 +105,7 @@ class YHGCWorkListHasWorkExperienceTableViewCell: UITableViewCell { ...@@ -105,7 +105,7 @@ class YHGCWorkListHasWorkExperienceTableViewCell: UITableViewCell {
let data = dataSource?.models?[i] let data = dataSource?.models?[i]
let isShow = data?.isShowPrompts ?? false let isShow = data?.isShowPrompts ?? false
let message = data?.message ?? "" let message = data?.message ?? ""
var h = 51 var h = 61
if isShow && message.count == 0 { if isShow && message.count == 0 {
h = h + 20 h = h + 20
} }
......
...@@ -33,8 +33,8 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel { ...@@ -33,8 +33,8 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel {
let item4 = YHWorkExperienceModel(id: .id23, isNeed: true, title: "开始就职年月", isUserKeyBoard: false, prompts: "请选择", message: position.entry_time, type: .time) let item4 = YHWorkExperienceModel(id: .id23, isNeed: true, title: "开始就职年月", isUserKeyBoard: false, prompts: "请选择", message: position.entry_time, type: .time)
let item5 = YHWorkExperienceModel(id: .id24, isNeed: true, title: "结束就职年月", isUserKeyBoard: false, prompts: "请选择", message: position.departure_time, type: .time) let item5 = YHWorkExperienceModel(id: .id24, isNeed: true, title: "结束就职年月", isUserKeyBoard: false, prompts: "请选择", message: position.departure_time, type: .time)
let item6 = YHWorkExperienceModel(id: .id6, isNeed: true, title: "工作证明是否可以提供", isUserKeyBoard: false, prompts: "", message: "\(position.has_work_certificate)", leftButtonString: "是", rightButtonString: "否") let item6 = YHWorkExperienceModel(id: .id6, isNeed: true, title: "工作证明是否可以提供", isUserKeyBoard: false, prompts: "", message: "\(position.has_work_certificate)", leftButtonString: "是", rightButtonString: "否")
let item7 = YHWorkExperienceModel(id: .id7, isNeed: true, title: "职业界别", isUserKeyBoard: false, prompts: "请选择", message: position.company_type, type: .field, isShowPrompts: isShowPrompt, alertMessage:"请选择") let item7 = YHWorkExperienceModel(id: .id7, isNeed: true, title: "职业界别", isUserKeyBoard: false, prompts: "请选择", message: position.company_type, type: .position, isShowPrompts: isShowPrompt, alertMessage:"请选择")
let item77 = YHWorkExperienceModel(id: .id8, isNeed: true, title: "具体经验领域", isUserKeyBoard: true, prompts: "请输入", message: position.company_type_other, type: .country, isShowPrompts: isShowPrompt, alertMessage:"请输入") let item77 = YHWorkExperienceModel(id: .id8, isNeed: true, title: "具体经验领域", isUserKeyBoard: true, prompts: "请输入", message: position.company_type_other, isShowPrompts: isShowPrompt, alertMessage:"请输入")
let addressCountry = position.location.country let addressCountry = position.location.country
...@@ -57,6 +57,10 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel { ...@@ -57,6 +57,10 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel {
return [section] return [section]
} }
func updateCompanyModel(_ value: String) {
position.company_name = value
}
func updateModel(_ item: YHWorkExperienceModel) { func updateModel(_ item: YHWorkExperienceModel) {
guard let type = item.id else { return } guard let type = item.id else { return }
switch type { switch type {
...@@ -145,7 +149,7 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel { ...@@ -145,7 +149,7 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel {
} }
func requestWorkPositionDetail(_ workId: Int, callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) { func requestWorkPositionDetail(_ workId: Int, callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) {
let param: [String: Any] = ["work_id": workId] let param: [String: Any] = ["id": workId]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.gcworkDetail let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.gcworkDetail
let _ = YHNetRequest.getRequest(url: strUrl, params: param) { [weak self] json, code in let _ = YHNetRequest.getRequest(url: strUrl, params: param) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
......
...@@ -17,18 +17,54 @@ class YHGCWorkItemListViewModel: YHBaseViewModel { ...@@ -17,18 +17,54 @@ class YHGCWorkItemListViewModel: YHBaseViewModel {
} }
func getBaseDataSource(_ isShowPrompt: Bool) -> YHSectionWorkExperienceModel { func getBaseDataSource(_ isShowPrompt: Bool) -> YHSectionWorkExperienceModel {
let item = YHWorkExperienceModel(id: .id1, isNeed: true, title: "主申请人是否有工作经验", isUserKeyBoard: false, prompts: "", message: "", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择") var has_work_experience = 2
if mainModel.has_work_experience == 1 {
has_work_experience = 1
} else if mainModel.has_work_experience == 2 {
has_work_experience = 0
}
let item = YHWorkExperienceModel(id: .id1, isNeed: true, title: "主申请人是否有工作经验", isUserKeyBoard: false, prompts: "", message: "\(has_work_experience)", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择")
let section = YHSectionWorkExperienceModel(title: "工作经验", models: [item]) let section = YHSectionWorkExperienceModel(title: "工作经验", models: [item])
return section return section
} }
func getDocDataSource(_ isShowPrompt: Bool) -> YHSectionWorkExperienceModel { func getDocDataSource(_ isShowPrompt: Bool) -> YHSectionWorkExperienceModel {
let item = YHWorkExperienceModel(id: .id2, isNeed: true, title: "在职公司是否可以提供赴港同意书", isUserKeyBoard: false, prompts: "", message: "", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择") var has_company_consent = 2
let item1 = YHWorkExperienceModel(id: .id2, isNeed: true, title: "人才中心是否可以提供赴港同意书?", isUserKeyBoard: false, prompts: "", message: "", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择") if mainModel.has_company_consent == 1 {
let item2 = YHWorkExperienceModel(id: .id2, isNeed: true, title: "公司基本情况", isUserKeyBoard: false, prompts: "请选择", message: "", type: .unit, isShowPrompts: isShowPrompt, alertMessage:"请选择") has_company_consent = 1
let section = YHSectionWorkExperienceModel(title: "赴港同意书提供", models: [item,item1,item2]) } else if mainModel.has_company_consent == 2 {
has_company_consent = 0
}
let item = YHWorkExperienceModel(id: .id2, isNeed: true, title: "在职公司是否可以提供赴港同意书", isUserKeyBoard: false, prompts: "", message: "\(has_company_consent)", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择")
var has_center_consent = 2
if mainModel.has_center_consent == 1 {
has_center_consent = 1
} else if mainModel.has_center_consent == 2 {
has_center_consent = 0
}
let item1 = YHWorkExperienceModel(id: .id3, isNeed: true, title: "人才中心是否可以提供赴港同意书?", isUserKeyBoard: false, prompts: "", message: "\(has_center_consent)", leftButtonString: "是", rightButtonString: "否", isShowPrompts: isShowPrompt, alertMessage:"请选择")
var company = ""
let array = mainModel.list ?? []
for item in array {
if mainModel.consent_work_id == item.id {
company = item.company_name ?? ""
}
}
let item2 = YHWorkExperienceModel(id: .id4, isNeed: true, title: "可提供的在职公司", isUserKeyBoard: false, prompts: "请选择", message: company, type: .myCompany, isShowPrompts: isShowPrompt, alertMessage:"请选择")
if has_company_consent == 2 {
let section = YHSectionWorkExperienceModel(title: "赴港同意书提供", models: [item])
return section
} else if has_company_consent == 1 {
let section = YHSectionWorkExperienceModel(title: "赴港同意书提供", models: [item, item2])
return section
} else if has_company_consent == 0 {
let section = YHSectionWorkExperienceModel(title: "赴港同意书提供", models: [item, item1])
return section
} else {
let section = YHSectionWorkExperienceModel(title: "赴港同意书提供", models: [item])
return section return section
} }
}
func requestWorkList(_ orderId: String, callBackBlock:@escaping (_ success: [YHWorkItemListModel]?, _ error:YHErrorModel?)->()) { func requestWorkList(_ orderId: String, callBackBlock:@escaping (_ success: [YHWorkItemListModel]?, _ error:YHErrorModel?)->()) {
// let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.list + "?order_id=\(orderId)" // let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.list + "?order_id=\(orderId)"
...@@ -120,4 +156,40 @@ class YHGCWorkItemListViewModel: YHBaseViewModel { ...@@ -120,4 +156,40 @@ class YHGCWorkItemListViewModel: YHBaseViewModel {
callBackBlock(0,err) callBackBlock(0,err)
} }
} }
func updateModel(_ model: YHWorkExperienceModel) {
switch model.id {
case .id1:
let value = model.value?.first?.int ?? 0
if value == 0 {
mainModel.has_work_experience = 2
} else if value == 1 {
mainModel.has_work_experience = 1
}
case .id2:
let value = model.value?.first?.int ?? 0
if value == 0 {
mainModel.has_company_consent = 2
} else if value == 1 {
mainModel.has_company_consent = 1
}
case .id3:
let value = model.value?.first?.int ?? 0
if value == 0 {
mainModel.has_center_consent = 2
} else if value == 1 {
mainModel.has_center_consent = 1
}
case .id4:
let array = mainModel.list ?? []
for item in array {
if model.message == item.company_name {
mainModel.consent_work_id = item.id ?? 0
}
}
default:
break
}
}
} }
...@@ -347,6 +347,7 @@ class YHLivePlayerViewController: YHBasePlayerViewController { ...@@ -347,6 +347,7 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
// MARK: - Chat Room Methods // MARK: - Chat Room Methods
private func joinChatRoom(roomId: String) { private func joinChatRoom(roomId: String) {
func joinRoom() {
YHIMHelper.shared.joinChatRoom(roomID: roomId, leaveOtherRooms: true) { [weak self] error in YHIMHelper.shared.joinChatRoom(roomID: roomId, leaveOtherRooms: true) { [weak self] error in
guard let self = self else { return } guard let self = self else { return }
...@@ -358,6 +359,15 @@ class YHLivePlayerViewController: YHBasePlayerViewController { ...@@ -358,6 +359,15 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
} }
} }
if !YHIMHelper.shared.isCurrentUserLogin {
YHIMHelper.shared.registerAndLoginCurrentUser { _ in
joinRoom()
}
} else {
joinRoom()
}
}
private func loadHistoryMessages(roomId: String) { private func loadHistoryMessages(roomId: String) {
YHIMHelper.shared.fetchHistoryMessage(roomID: roomId) { [weak self] list, _ in YHIMHelper.shared.fetchHistoryMessage(roomID: roomId) { [weak self] list, _ in
guard let self = self, let messages = list else { return } guard let self = self, let messages = list else { return }
......
...@@ -43,6 +43,10 @@ enum YHOtherPickerViewType: Int { ...@@ -43,6 +43,10 @@ enum YHOtherPickerViewType: Int {
case selectAddress case selectAddress
//选择经验领域 //选择经验领域
case field case field
//选择我的公司
case myCompany
//职位界别
case position
} }
...@@ -494,6 +498,120 @@ class YHConstantArrayData { ...@@ -494,6 +498,120 @@ class YHConstantArrayData {
"title" : "其他", "title" : "其他",
] ]
] ]
static let arrposition = [
[
"id": "1",
"title" : "学术研究及教育",
],
[
"id" : "2",
"title" : "会计服务",
],
[
"id" : "3",
"title" : "农务",
],
[
"id": "4",
"title" : "建筑及测量",
],
[
"id": "5",
"title" : "艺术及文化",
],
[
"id" : "6",
"title" : "航空业",
],
[
"id" : "7",
"title" : "广播及娱乐",
],
[
"id": "8",
"title" : "商业支援及人力资源",
],
[
"id": "9",
"title" : "餐饮服务",
],
[
"id" : "10",
"title" : "商业及贸易",
],
[
"id" : "11",
"title" : "创意产业和表演艺术",
],
[
"id": "12",
"title" : "工程及建造",
],
[
"id": "13",
"title" : "环境技术服务",
],
[
"id" : "14",
"title" : "金融服务",
],
[
"id" : "15",
"title" : "政府相关",
],
[
"id": "16",
"title" : "资讯及通讯科技服务",
],
[
"id": "17",
"title" : "创新及科技",
],
[
"id" : "18",
"title" : "保险/经纪服务",
],
[
"id" : "19",
"title" : "法律及争议解决服务关",
],
[
"id": "20",
"title" : "物流及运输",
],
[
"id": "21",
"title" : "工业制造",
],
[
"id" : "22",
"title" : "海运服务",
],
[
"id" : "23",
"title" : "市场营销/公共关系",
],
[
"id": "24",
"title" : "医疗保健服务(包括中医及兽医)",
],
[
"id": "25",
"title" : "康复及体育运动",
],
[
"id" : "26",
"title" : "宗教团体",
],
[
"id" : "27",
"title" : "旅游",
],
[
"id": "28",
"title" : "其他",
]
]
//通过 id 获取 title //通过 id 获取 title
static func getShowNameBy(indexStr:String,type : YHOtherPickerViewType) -> String { static func getShowNameBy(indexStr:String,type : YHOtherPickerViewType) -> String {
if indexStr.isEmpty { if indexStr.isEmpty {
......
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