Commit 2b27d488 authored by pete谢兆麟's avatar pete谢兆麟

Merge branch 'develop' into xiezhaolin

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
#	galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/MainApplicantInformation/C/YHMainApplicantInformationViewController.swift
parents 52312b82 2f3cc4ef
......@@ -85,6 +85,8 @@ target 'galaxy' do
############# 网易云信 IM相关 end #############
#富文本库
pod 'AttributedString','3.3.5'
end
......
......@@ -8,17 +8,26 @@
/* Begin PBXBuildFile section */
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; };
041B528B2B5E15F1007EBCEB /* YHDoubleChoiceQuestionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528A2B5E15F1007EBCEB /* YHDoubleChoiceQuestionCell.swift */; };
041B528D2B5E58FA007EBCEB /* YHDoubleChoiceFormCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528C2B5E58FA007EBCEB /* YHDoubleChoiceFormCell.swift */; };
041B528F2B5E620E007EBCEB /* YHSingleLineInputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */; };
041B52912B5E67F3007EBCEB /* YHSingleLineSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */; };
041B52932B5E6CBA007EBCEB /* YHFormTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */; };
041B52952B5E7037007EBCEB /* YHFormAddInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */; };
041B528B2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */; };
041B528D2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */; };
041B528F2B5E620E007EBCEB /* YHFormItemInputTextCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528E2B5E620E007EBCEB /* YHFormItemInputTextCell.swift */; };
041B52912B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */; };
041B52932B5E6CBA007EBCEB /* YHFormItemTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */; };
041B52952B5E7037007EBCEB /* YHFormItemAddCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */; };
041B52982B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */; };
041B52D62B5F899E007EBCEB /* YHSpouseFormVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpouseFormVC.swift */; };
041B52D92B5F8B07007EBCEB /* YHConsortInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D82B5F8B07007EBCEB /* YHConsortInfo.swift */; };
041B52D62B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */; };
041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */; };
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DC2B60A889007EBCEB /* YHTest.swift */; };
042FBBB92B627C0F00F9DE23 /* YHCertificateInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */; };
042FBBBB2B62806D00F9DE23 /* YHCertificateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBA2B62806D00F9DE23 /* YHCertificateViewController.swift */; };
042FBBBD2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBC2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift */; };
042FBBBF2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */; };
042FBBC12B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */; };
042FBBC32B63DA4C00F9DE23 /* YHParentInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */; };
042FBBC52B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */; };
042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */; };
042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */; };
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */; };
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
......@@ -127,6 +136,23 @@
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */; };
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */; };
A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63BC2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift */; };
A5FD63BF2B6250BC00D1D9DA /* YHInformationPerfectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63BE2B6250BC00D1D9DA /* YHInformationPerfectCell.swift */; };
A5FD63C12B62616D00D1D9DA /* YHInformationPerfectModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */; };
A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */; };
A5FD63C52B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C42B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift */; };
A5FD63C72B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C62B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift */; };
A5FD63C92B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63C82B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift */; };
A5FD63CB2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63CA2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift */; };
A5FD63CD2B64E2D600D1D9DA /* YHScoreDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63CC2B64E2D600D1D9DA /* YHScoreDetailViewController.swift */; };
A5FD63CF2B64E32400D1D9DA /* YHMyInformationListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63CE2B64E32400D1D9DA /* YHMyInformationListViewController.swift */; };
A5FD63D22B650BA700D1D9DA /* YHScorePersonInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D12B650BA700D1D9DA /* YHScorePersonInfoCell.swift */; };
A5FD63D42B65F99500D1D9DA /* YHScoreItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D32B65F99500D1D9DA /* YHScoreItemCell.swift */; };
A5FD63D62B65FCA400D1D9DA /* YHScoreTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */; };
A5FD63D82B6603A500D1D9DA /* YHScoreResultView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */; };
A5FD63DA2B66060800D1D9DA /* YHScoreOptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */; };
A5FD63DC2B6628F600D1D9DA /* scoreOptionData.plist in Resources */ = {isa = PBXBuildFile; fileRef = A5FD63DB2B6628F600D1D9DA /* scoreOptionData.plist */; };
A5FD63DF2B6639AD00D1D9DA /* YHScoreDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63DE2B6639AD00D1D9DA /* YHScoreDataModel.swift */; };
A5FD63E12B66592300D1D9DA /* YHScoreItemCellForAge.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FD63E02B66592300D1D9DA /* YHScoreItemCellForAge.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -162,17 +188,26 @@
/* Begin PBXFileReference section */
041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; };
041B528A2B5E15F1007EBCEB /* YHDoubleChoiceQuestionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDoubleChoiceQuestionCell.swift; sourceTree = "<group>"; };
041B528C2B5E58FA007EBCEB /* YHDoubleChoiceFormCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDoubleChoiceFormCell.swift; sourceTree = "<group>"; };
041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSingleLineInputCell.swift; sourceTree = "<group>"; };
041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSingleLineSelectCell.swift; sourceTree = "<group>"; };
041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormTitleCell.swift; sourceTree = "<group>"; };
041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormAddInfoCell.swift; sourceTree = "<group>"; };
041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemQuestionCell.swift; sourceTree = "<group>"; };
041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDoubleChoiceCell.swift; sourceTree = "<group>"; };
041B528E2B5E620E007EBCEB /* YHFormItemInputTextCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemInputTextCell.swift; sourceTree = "<group>"; };
041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemEnterDetailCell.swift; sourceTree = "<group>"; };
041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemTitleCell.swift; sourceTree = "<group>"; };
041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemAddCell.swift; sourceTree = "<group>"; };
041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyMemberFormVC.swift; sourceTree = "<group>"; };
041B52D52B5F899E007EBCEB /* YHSpouseFormVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseFormVC.swift; sourceTree = "<group>"; };
041B52D82B5F8B07007EBCEB /* YHConsortInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHConsortInfo.swift; sourceTree = "<group>"; };
041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInitialInfoVC.swift; sourceTree = "<group>"; };
041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyInitialInfo.swift; sourceTree = "<group>"; };
041B52DC2B60A889007EBCEB /* YHTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTest.swift; sourceTree = "<group>"; };
042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfo.swift; sourceTree = "<group>"; };
042FBBBA2B62806D00F9DE23 /* YHCertificateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateViewController.swift; sourceTree = "<group>"; };
042FBBBC2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemSelectSheetCell.swift; sourceTree = "<group>"; };
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseBasicInfoVC.swift; sourceTree = "<group>"; };
042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDegreeInfoCell.swift; sourceTree = "<group>"; };
042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHParentInfoVC.swift; sourceTree = "<group>"; };
042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemOnlyDoubleChoiceCell.swift; sourceTree = "<group>"; };
042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildInitialInfoVC.swift; sourceTree = "<group>"; };
042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemExpireDateCell.swift; sourceTree = "<group>"; };
042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildBasicInfoVC.swift; sourceTree = "<group>"; };
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; };
......@@ -286,6 +321,23 @@
A5D6AB1A2B46A1CC001C10A5 /* YHHomeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeModel.swift; sourceTree = "<group>"; };
A5D6AB1C2B46AAFB001C10A5 /* YHHomePageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomePageViewModel.swift; sourceTree = "<group>"; };
A5FD63BC2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationPerfectListVC.swift; sourceTree = "<group>"; };
A5FD63BE2B6250BC00D1D9DA /* YHInformationPerfectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationPerfectCell.swift; sourceTree = "<group>"; };
A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationPerfectModel.swift; sourceTree = "<group>"; };
A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHContactMainItemStatusModel.swift; sourceTree = "<group>"; };
A5FD63C42B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSubmitAllInfoCheckView.swift; sourceTree = "<group>"; };
A5FD63C62B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSubmintAllInfoSuccessTipView.swift; sourceTree = "<group>"; };
A5FD63C82B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationFillTipsAlertView.swift; sourceTree = "<group>"; };
A5FD63CA2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationFillTipsCell.swift; sourceTree = "<group>"; };
A5FD63CC2B64E2D600D1D9DA /* YHScoreDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreDetailViewController.swift; sourceTree = "<group>"; };
A5FD63CE2B64E32400D1D9DA /* YHMyInformationListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyInformationListViewController.swift; sourceTree = "<group>"; };
A5FD63D12B650BA700D1D9DA /* YHScorePersonInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScorePersonInfoCell.swift; sourceTree = "<group>"; };
A5FD63D32B65F99500D1D9DA /* YHScoreItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreItemCell.swift; sourceTree = "<group>"; };
A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreTitleView.swift; sourceTree = "<group>"; };
A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultView.swift; sourceTree = "<group>"; };
A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreOptionsView.swift; sourceTree = "<group>"; };
A5FD63DB2B6628F600D1D9DA /* scoreOptionData.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = scoreOptionData.plist; sourceTree = "<group>"; };
A5FD63DE2B6639AD00D1D9DA /* YHScoreDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreDataModel.swift; sourceTree = "<group>"; };
A5FD63E02B66592300D1D9DA /* YHScoreItemCellForAge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreItemCellForAge.swift; sourceTree = "<group>"; };
B6BB01E4C5DB87B66F0ECE84 /* Pods-galaxy.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.release.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -340,12 +392,16 @@
041B52892B5E14EB007EBCEB /* View */ = {
isa = PBXGroup;
children = (
041B528A2B5E15F1007EBCEB /* YHDoubleChoiceQuestionCell.swift */,
041B528C2B5E58FA007EBCEB /* YHDoubleChoiceFormCell.swift */,
041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */,
041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */,
041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */,
041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */,
041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */,
041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */,
041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */,
041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */,
041B528E2B5E620E007EBCEB /* YHFormItemInputTextCell.swift */,
041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */,
042FBBBC2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift */,
042FBBC02B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift */,
042FBBC42B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift */,
042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */,
);
path = View;
sourceTree = "<group>";
......@@ -354,7 +410,12 @@
isa = PBXGroup;
children = (
041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */,
041B52D52B5F899E007EBCEB /* YHSpouseFormVC.swift */,
041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */,
042FBBBA2B62806D00F9DE23 /* YHCertificateViewController.swift */,
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */,
042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */,
042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */,
042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -362,8 +423,8 @@
041B52D72B5F8ADA007EBCEB /* M */ = {
isa = PBXGroup;
children = (
041B52D82B5F8B07007EBCEB /* YHConsortInfo.swift */,
041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */,
042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */,
041B52DC2B60A889007EBCEB /* YHTest.swift */,
);
path = M;
......@@ -725,7 +786,10 @@
A5ACE9172B4564F7002C94D2 /* M */ = {
isa = PBXGroup;
children = (
A5FD63DD2B66397C00D1D9DA /* 我的评分 */,
A5C382D02B5FAAB300C5E65C /* YHContactItemModel.swift */,
A5FD63C02B62616D00D1D9DA /* YHInformationPerfectModel.swift */,
A5FD63C22B63438A00D1D9DA /* YHContactMainItemStatusModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -736,6 +800,8 @@
A5ACE9192B4564F7002C94D2 /* YHServiceCenterMainViewController.swift */,
A514E5DB2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift */,
A5FD63BC2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift */,
A5FD63CC2B64E2D600D1D9DA /* YHScoreDetailViewController.swift */,
A5FD63CE2B64E32400D1D9DA /* YHMyInformationListViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -743,9 +809,15 @@
A5ACE91A2B4564F7002C94D2 /* V */ = {
isa = PBXGroup;
children = (
A5FD63D02B65010F00D1D9DA /* 我的评分 */,
A5C382C92B5E1F4C00C5E65C /* YHLoginTipsView.swift */,
A5C382CB2B5EA11800C5E65C /* YHContractCell.swift */,
A56D2D602B62020C009C83A8 /* YHContractMainItemStatusCell.swift */,
A5FD63BE2B6250BC00D1D9DA /* YHInformationPerfectCell.swift */,
A5FD63C42B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift */,
A5FD63C62B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift */,
A5FD63C82B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift */,
A5FD63CA2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -867,6 +939,28 @@
path = VM;
sourceTree = "<group>";
};
A5FD63D02B65010F00D1D9DA /* 我的评分 */ = {
isa = PBXGroup;
children = (
A5FD63D12B650BA700D1D9DA /* YHScorePersonInfoCell.swift */,
A5FD63D32B65F99500D1D9DA /* YHScoreItemCell.swift */,
A5FD63D52B65FCA400D1D9DA /* YHScoreTitleView.swift */,
A5FD63D72B6603A500D1D9DA /* YHScoreResultView.swift */,
A5FD63D92B66060800D1D9DA /* YHScoreOptionsView.swift */,
A5FD63DB2B6628F600D1D9DA /* scoreOptionData.plist */,
A5FD63E02B66592300D1D9DA /* YHScoreItemCellForAge.swift */,
);
path = "我的评分";
sourceTree = "<group>";
};
A5FD63DD2B66397C00D1D9DA /* 我的评分 */ = {
isa = PBXGroup;
children = (
A5FD63DE2B6639AD00D1D9DA /* YHScoreDataModel.swift */,
);
path = "我的评分";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -977,6 +1071,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A5FD63DC2B6628F600D1D9DA /* scoreOptionData.plist in Resources */,
04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */,
A5C5B2EE2B4F9B8800A7C5D1 /* Localizable.xcstrings in Resources */,
A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */,
......@@ -1057,29 +1152,34 @@
A5ACE9332B4564F7002C94D2 /* NetBaseModel.swift in Sources */,
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */,
A5C5B3002B55623800A7C5D1 /* ContentBaseViewController.swift in Sources */,
041B52D92B5F8B07007EBCEB /* YHConsortInfo.swift in Sources */,
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */,
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
A5FD63DF2B6639AD00D1D9DA /* YHScoreDataModel.swift in Sources */,
A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */,
A5FD63BD2B623C2C00D1D9DA /* YHInformationPerfectListVC.swift in Sources */,
041B52932B5E6CBA007EBCEB /* YHFormTitleCell.swift in Sources */,
041B52952B5E7037007EBCEB /* YHFormAddInfoCell.swift in Sources */,
041B52932B5E6CBA007EBCEB /* YHFormItemTitleCell.swift in Sources */,
041B52952B5E7037007EBCEB /* YHFormItemAddCell.swift in Sources */,
A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */,
041B528D2B5E58FA007EBCEB /* YHDoubleChoiceFormCell.swift in Sources */,
041B528D2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift in Sources */,
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */,
A5ACE9452B4564F7002C94D2 /* BsHUDContainerView.swift in Sources */,
A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */,
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */,
042FBBBF2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift in Sources */,
A5C5B2E82B4EC95600A7C5D1 /* YHDavidTestCollectionViewCell.swift in Sources */,
042FBBC52B64AE3D00F9DE23 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */,
041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */,
A5FD63D22B650BA700D1D9DA /* YHScorePersonInfoCell.swift in Sources */,
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */,
0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
A5ACE94A2B4564F7002C94D2 /* BsHUDProgressView.swift in Sources */,
A5FD63C52B637EE000D1D9DA /* YHSubmitAllInfoCheckView.swift in Sources */,
A5ACE9442B4564F7002C94D2 /* Array+Extension.swift in Sources */,
0468D4282B50D4AF00CFB916 /* YHPrivacyAlertView.swift in Sources */,
0468D4342B56587B00CFB916 /* YHOSSManager.swift in Sources */,
A5C382D12B5FAAB300C5E65C /* YHContactItemModel.swift in Sources */,
A5FD63CF2B64E32400D1D9DA /* YHMyInformationListViewController.swift in Sources */,
A5ACE9522B4564F7002C94D2 /* YHServiceCenterMainViewController.swift in Sources */,
A5C5B2FD2B55361700A7C5D1 /* YHBannerModel.swift in Sources */,
A5ACE9462B4564F7002C94D2 /* BsHUDSquareBaseView.swift in Sources */,
......@@ -1088,8 +1188,9 @@
A5C382CA2B5E1F4C00C5E65C /* YHLoginTipsView.swift in Sources */,
0468D4452B62064700CFB916 /* YHStepView.swift in Sources */,
A5C5B3232B57BF8F00A7C5D1 /* YHDavidCell1.swift in Sources */,
A5FD63CD2B64E2D600D1D9DA /* YHScoreDetailViewController.swift in Sources */,
A5C5B2FB2B5535DF00A7C5D1 /* YHHomeBannerView.swift in Sources */,
041B528B2B5E15F1007EBCEB /* YHDoubleChoiceQuestionCell.swift in Sources */,
041B528B2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift in Sources */,
A5ACE94B2B4564F7002C94D2 /* BsHUDRotatingImageView.swift in Sources */,
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */,
A5ACE94F2B4564F7002C94D2 /* YhOverlayView.swift in Sources */,
......@@ -1099,27 +1200,33 @@
A5ACE92E2B4564F7002C94D2 /* YHValidateCodeInputView.swift in Sources */,
A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */,
A5ACE93B2B4564F7002C94D2 /* UIFont+Extension.swift in Sources */,
A5FD63C92B63A35B00D1D9DA /* YHInformationFillTipsAlertView.swift in Sources */,
A5ACE9282B4564F7002C94D2 /* YHSmsCodeView.swift in Sources */,
0468D4432B61F76800CFB916 /* YHMainApplicantInformationViewController.swift in Sources */,
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */,
A5C5B32D2B57D66000A7C5D1 /* YHBbxCollectionViewCell.swift in Sources */,
A5FD63D82B6603A500D1D9DA /* YHScoreResultView.swift in Sources */,
A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */,
A5ACE9502B4564F7002C94D2 /* YhCacheTool.swift in Sources */,
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */,
042FBBB92B627C0F00F9DE23 /* YHCertificateInfo.swift in Sources */,
A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */,
A5FD63E12B66592300D1D9DA /* YHScoreItemCellForAge.swift in Sources */,
A5ACE9472B4564F7002C94D2 /* YHHUD.swift in Sources */,
A5ACE9412B4564F7002C94D2 /* Dictionary+Extension.swift in Sources */,
A5C5B3102B57677300A7C5D1 /* YHGestureTableView.swift in Sources */,
A5ACE9312B4564F7002C94D2 /* YHPersonalCenterCell.swift in Sources */,
A5ACE9532B4564F7002C94D2 /* YHBaseViewController.swift in Sources */,
042FBBC32B63DA4C00F9DE23 /* YHParentInfoVC.swift in Sources */,
A5ACE9392B4564F7002C94D2 /* UIDevice+Extension.swift in Sources */,
041B52912B5E67F3007EBCEB /* YHSingleLineSelectCell.swift in Sources */,
041B52912B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift in Sources */,
A5ACE9422B4564F7002C94D2 /* AppDelegate+Extension.swift in Sources */,
A5FD63BF2B6250BC00D1D9DA /* YHInformationPerfectCell.swift in Sources */,
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */,
A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */,
0468D4472B624AF000CFB916 /* YHBottomNextView.swift in Sources */,
A5ACE94C2B4564F7002C94D2 /* BsHUDErrorView.swift in Sources */,
041B52D62B5F899E007EBCEB /* YHSpouseFormVC.swift in Sources */,
041B52D62B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift in Sources */,
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */,
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */,
A5ACE9552B4564F7002C94D2 /* YHTabBarViewController.swift in Sources */,
......@@ -1128,31 +1235,45 @@
0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */,
0468D4492B6258A900CFB916 /* YHItemView.swift in Sources */,
041B528F2B5E620E007EBCEB /* YHSingleLineInputCell.swift in Sources */,
A5FD63C72B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift in Sources */,
041B528F2B5E620E007EBCEB /* YHFormItemInputTextCell.swift in Sources */,
A5ACE9402B4564F7002C94D2 /* String+Extension.swift in Sources */,
A5ACE9482B4564F7002C94D2 /* BsHUDWariningView.swift in Sources */,
A5C5B3252B57C74900A7C5D1 /* YHDavidCell3.swift in Sources */,
A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */,
042FBBC12B63B21700F9DE23 /* YHFormItemDegreeInfoCell.swift in Sources */,
A5ACE9492B4564F7002C94D2 /* BsHUDSuccessView.swift in Sources */,
A5FD63D42B65F99500D1D9DA /* YHScoreItemCell.swift in Sources */,
A5ACE9432B4564F7002C94D2 /* UILable+Extension.swift in Sources */,
A5ACE9382B4564F7002C94D2 /* UIApplication+Extension.swift in Sources */,
0468D44B2B625AAB00CFB916 /* YHItemModel.swift in Sources */,
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */,
0468D42B2B55019900CFB916 /* YHAnalytics.swift in Sources */,
A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */,
042FBBBD2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift in Sources */,
A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */,
041B52982B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift in Sources */,
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */,
A5C5B2EA2B4ECA4D00A7C5D1 /* YHDavidModel0.swift in Sources */,
A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */,
042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */,
A5FD63C12B62616D00D1D9DA /* YHInformationPerfectModel.swift in Sources */,
A5C5B3292B57CCBE00A7C5D1 /* YHDavidCell4.swift in Sources */,
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */,
A5ACE9582B4564F7002C94D2 /* YHNoDataTipView.swift in Sources */,
042FBBBB2B62806D00F9DE23 /* YHCertificateViewController.swift in Sources */,
042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */,
A5ACE9562B4564F7002C94D2 /* YHBouncesContentView.swift in Sources */,
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */,
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */,
A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */,
A5C5B3272B57C8D500A7C5D1 /* YHDavidCell2.swift in Sources */,
A5FD63D62B65FCA400D1D9DA /* YHScoreTitleView.swift in Sources */,
A5FD63DA2B66060800D1D9DA /* YHScoreOptionsView.swift in Sources */,
A5ACE9372B4564F7002C94D2 /* YHBaseUrlManager.swift in Sources */,
A5ACE9352B4564F7002C94D2 /* YHNetRequest.swift in Sources */,
A5FD63CB2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift in Sources */,
A5ACE9272B4564F7002C94D2 /* YHLoginViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......
......@@ -109,7 +109,7 @@ extension AppDelegate {
UITextView.appearance().tintColor = .mainColor
//1.2设置UINavigationBar title的字体和颜色
let titleTextAttributes = [NSAttributedString.Key.font : UIFont.PFSCM(ofSize: 16) , NSAttributedString.Key.foregroundColor : UIColor.commonColor100]
let titleTextAttributes = [NSAttributedString.Key.font : UIFont.PingFangScM(ofSize: 16) , NSAttributedString.Key.foregroundColor : UIColor.commonColor100]
UINavigationBar.appearance().titleTextAttributes = titleTextAttributes
UINavigationBar.appearance().tintColor = .white
......
......@@ -18,7 +18,7 @@ class YHBasicContentView: ESTabBarItemContentView {
iconColor = UIColor.init(white: 175.0 / 255.0, alpha: 1.0)
highlightIconColor = .commonColor100
titleLabel.font = UIFont.PFSCR(ofSize: 10)
titleLabel.font = UIFont.PingFangScR(ofSize: 10)
}
public required init?(coder aDecoder: NSCoder) {
......
......@@ -20,17 +20,17 @@ class YHNoDataTipView: UIView {
}()
private lazy var titleLabel: UILabel = {
let label = UILabel(text: "暂无数据", font: UIFont.PFSCR(ofSize: 14), color: UIColor.commonColor45)
let label = UILabel(text: "暂无数据", font: UIFont.PingFangScR(ofSize: 14), color: UIColor.commonColor45)
return label
}()
private lazy var descLabel: UILabel = {
let label = UILabel(text: "", font: UIFont.PFSCR(ofSize: 12), color: UIColor.commonColor45)
let label = UILabel(text: "", font: UIFont.PingFangScR(ofSize: 12), color: UIColor.commonColor45)
return label
}()
private lazy var reloadBtn: UIButton = {
let btn = UIButton.bs_button(title: "重新加载", font: UIFont.PFSCM(ofSize: 12), normalColor: UIColor.commonColor100)
let btn = UIButton.bs_button(title: "重新加载", font: UIFont.PingFangScM(ofSize: 12), normalColor: UIColor.commonColor100)
btn.layer.cornerRadius = 6
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
......
......@@ -29,10 +29,10 @@ class ContentBaseViewController: UIViewController {
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PFSCM(ofSize: 16)
dataSource.titleNormalFont = UIFont.PingFangScM(ofSize: 16)
dataSource.titleNormalColor = .commonColor25
dataSource.titleSelectedFont = UIFont.PFSCM(ofSize: 18)
dataSource.titleSelectedFont = UIFont.PingFangScM(ofSize: 18)
dataSource.titleSelectedColor = .commonColor100
dataSource.isItemSpacingAverageEnabled = false
......
......@@ -108,10 +108,10 @@ class YHHomeViewController: YHBaseViewController {
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PFSCM(ofSize: 16)
dataSource.titleNormalFont = UIFont.PingFangScM(ofSize: 16)
dataSource.titleNormalColor = .commonColor25
dataSource.titleSelectedFont = UIFont.PFSCM(ofSize: 18)
dataSource.titleSelectedFont = UIFont.PingFangScM(ofSize: 18)
dataSource.titleSelectedColor = .commonColor100
dataSource.isItemSpacingAverageEnabled = false
......
......@@ -13,14 +13,30 @@ import UIKit
*/
class YHInformationPerfectListVC: YHBaseViewController {
// private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
private var unfoldFlag : Bool = true //是否展开
private lazy var downArrowImagev : UIImageView = {
let imagV = UIImageView(frame: CGRect(x: KScreenWidth - 16 - 32, y: 17, width: 24, height: 24))
imagV.image = UIImage(named: "service_center_down_arrow")
imagV.contentMode = .scaleAspectFill
return imagV
private var arrData : [YHInformationPerfectModel] = []
private var myTargetIndex : Int32 = 1 //for test hjl
private var hasSubmitFlag : Bool = false {
didSet {
submitBtn.isHidden = hasSubmitFlag
submitHoldView.isHidden = !hasSubmitFlag
if hasSubmitFlag == true {
headerTitleDesLable.text = "您已提交信息表"
} else {
headerTitleDesLable.text = "您好,DavidHuang先生"
}
}
}
private lazy var headerTitleDesLable : UILabel = {
let titleLable = UILabel(text: "您好,黄先生")
titleLable.font = UIFont.PingFangScM(ofSize: 21)
return titleLable
}()
private lazy var topBkg : UIView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "service_center_head_bkg")
......@@ -35,47 +51,46 @@ class YHInformationPerfectListVC: YHBaseViewController {
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.register(YHContractMainItemStatusCell.self,forCellReuseIdentifier: YHContractMainItemStatusCell.cellReuseIdentifier)
tableView.register(YHInformationPerfectCell.self,forCellReuseIdentifier: YHInformationPerfectCell.cellReuseIdentifier)
return tableView
}()
var myHeadView : UIView = {
let view = UIView()
view.backgroundColor = .purple
let titleLable = UILabel(text: "您好,黄先生")
titleLable.font = kFont(size: 21)
view.addSubview(titleLable)
titleLable.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(24)
make.right.equalTo(-24)
make.height.equalTo(26)
}
let desLable = UILabel(text: "此表由主申请人填写,我们将会根据您的个人信息制作资料清单,请按顺序填写,提交后1-2个工作日内联系您哦~")
desLable.font = kFont(size: 12)
desLable.numberOfLines = 0
desLable.lineBreakMode = .byWordWrapping
view.addSubview(desLable)
desLable.snp.makeConstraints { make in
make.top.equalTo(titleLable.snp.bottom).offset(10)
make.left.equalTo(24)
make.right.equalTo(-24)
// make.bottom.equalToSuperview().offset(-16)
}
return view
}()
var myBottomView : UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
var submitHoldView : UIView = {
let view = UIView()
view.backgroundColor = .clear
return view
}()
var submitBtn: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
YHInformationFillTipsAlertView.showCheckView { agree in
if agree == true {
printLog("点击了 确认 按钮")
} else {
printLog("点击了 取消 按钮")
}
}
}
}
extension YHInformationPerfectListVC {
......@@ -88,11 +103,69 @@ extension YHInformationPerfectListVC {
// }
}
@objc func goScoreVC() {
//我的评分
navigationController?.pushViewController(YHScoreDetailViewController())
}
@objc func goInfoListVC() {
//个人信息表
navigationController?.pushViewController(YHMyInformationListViewController())
}
@objc func clickSubmitBtn() {
YHSubmitAllInfoCheckView.showCheckView { agree in
if agree == true {
printLog("点击了 确认 按钮")
YHSubmintAllInfoSuccessTipView.showCheckView { agree in
self.hasSubmitFlag = true
if agree == true {
self.goScoreVC()
} else {
}
}
} else {
printLog("点击了 取消 按钮")
}
}
}
func setupUI() {
gk_navTitle = "信息完善"
gk_navBarAlpha = 1.0
gk_navLineHidden = true
let arr = [1,2,3,4,5,6]
let target = myTargetIndex //for test hjl 待填写的项目
for item in arr {
let model = YHInformationPerfectModel()
model.type = item
arrData.append(model)
if item < target {
model.isFinished = true
} else {
model.isFinished = false
}
if item == target {
model.isDoing = true
}
if item == target + 1 {
model.isNextDoingCell = true
} else {
model.isNextDoingCell = false
}
}
view.addSubview(topBkg)
topBkg.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
......@@ -100,33 +173,117 @@ extension YHInformationPerfectListVC {
}
view.addSubview(myBottomView)
myBottomView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.left.right.equalToSuperview()
make.height.equalTo(84)
}
submitBtn = UIButton(type: .custom)
submitBtn.layer.opacity = 0.4
submitBtn.setTitle("提交信息", for: .normal)
submitBtn.setTitleColor(UIColor.white, for: .normal)
submitBtn.setBackgroundImage(UIImage.from(color: UIColor(hex: 0x4D9FF8, alpha: 1.0)), for: .normal)
submitBtn.layer.cornerRadius = 8
submitBtn.clipsToBounds = true
myBottomView.addSubview(submitBtn)
submitBtn.addTarget(self, action: #selector(clickSubmitBtn), for: .touchUpInside)
submitBtn.snp.makeConstraints { make in
make.top.equalTo(8)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(48)
}
submitBtn.isHidden = hasSubmitFlag
submitHoldView.isHidden = !hasSubmitFlag
myBottomView.addSubview(submitHoldView)
submitHoldView.snp.makeConstraints { make in
make.top.equalTo(8)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(48)
}
let scoreButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("我的评分", for: .normal)
button.setTitleColor( UIColor(hex:0x3c86f8), for: .normal)
button.layer.cornerRadius = 8
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x3c86f8).cgColor
button.addTarget(self, action: #selector(goScoreVC), for: .touchUpInside)
return button
}()
submitHoldView.addSubview(scoreButton)
scoreButton.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview()
make.right.equalTo(submitHoldView.snp.centerX).offset(-6)
}
let infoButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x3c86f8)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("个人信息表", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 8
button.addTarget(self, action: #selector(goInfoListVC), for: .touchUpInside)
return button
}()
submitHoldView.addSubview(infoButton)
infoButton.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.left.equalTo(submitHoldView.snp.centerX).offset(6)
}
homeTableView.delegate = self
homeTableView.dataSource = self
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview()
make.bottom.equalTo(myBottomView.snp.top)
}
view.layoutIfNeeded()
myHeadView.addSubview(headerTitleDesLable)
headerTitleDesLable.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(24)
make.right.equalTo(-24)
make.height.equalTo(26)
}
let desLable = UILabel(text: "此表由主申请人填写,我们将会根据您的个人信息制作资料清单,请按顺序填写,提交后1-2个工作日内联系您哦~")
desLable.font = UIFont.PingFangScR(ofSize: 12)
desLable.numberOfLines = 0
desLable.lineBreakMode = .byWordWrapping
myHeadView.addSubview(desLable)
desLable.snp.makeConstraints { make in
make.top.equalTo(headerTitleDesLable.snp.bottom).offset(10)
make.left.equalTo(24)
make.right.equalTo(-24)
}
myHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 96)
homeTableView.tableHeaderView = myHeadView
}
@objc func clickUnfoldView() {
unfoldFlag = !unfoldFlag
if unfoldFlag == true {
UIView.animate(withDuration: 0.25) {
self.downArrowImagev.transform = CGAffineTransform.identity
}
} else {
UIView.animate(withDuration: 0.25) {
self.downArrowImagev.transform = CGAffineTransform(rotationAngle: .pi)
}
}
homeTableView.reloadSections(IndexSet(integer: 0), with: UITableView.RowAnimation.automatic)
homeTableView.reloadData()
}
}
......@@ -137,55 +294,29 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if unfoldFlag == true {
return 10
}
return 0
return 6
}
// func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
// return 0
// }
//
// func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
// let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 60))
// view.backgroundColor = .clear
//
// let lable = UILabel(frame: CGRect(x: 16, y: 0, width: 200, height: 60))
// lable.text = "身份申请"
// lable.font = kFont(size: 17)
// view.addSubview(lable)
// view.addSubview(self.downArrowImagev)
//
// let tap = UITapGestureRecognizer(target: self, action: #selector(clickUnfoldView))
// view.addGestureRecognizer(tap)
// return UIView()
// }
//
// 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 YHContractMainItemStatusCell.cellHeight
return YHInformationPerfectCell.cellHeight
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let newCell = tableView.dequeueReusableCell(withClass: YHContractMainItemStatusCell.self)
let newCell = tableView.dequeueReusableCell(withClass: YHInformationPerfectCell.self)
newCell.selectionStyle = .none
newCell.dataModel = arrData[indexPath.row]
return newCell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 \(indexPath.section)section --- \(indexPath.row)row")
navigationController?.pushViewController(YHMainApplicantInformationViewController())
let model = arrData[indexPath.row]
if (indexPath.row + 1 > myTargetIndex) {
let message = "请先完成" + model.name + "填写"
YHHUD.flash(message: message)
} else {
navigationController?.pushViewController(YHMainApplicantInformationViewController())
}
}
}
//
// YHMyInformationListViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
*个人信息表
*/
class YHMyInformationListViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
//
// YHScoreDetailViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import GKNavigationBarSwift
/*
我的评分 / 评分详情
*/
class YHScoreDetailViewController: YHBaseViewController {
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
//头部背景图片
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "score_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
var homeTableView: YHGestureTableView = {
let tableView = YHGestureTableView(frame: .zero, style:.plain)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.register(YHScorePersonInfoCell.self,forCellReuseIdentifier: YHScorePersonInfoCell.cellReuseIdentifier)
tableView.register(YHScoreItemCell.self,forCellReuseIdentifier: YHScoreItemCell.cellReuseIdentifier)
tableView.register(YHScoreItemCellForAge.self,forCellReuseIdentifier: YHScoreItemCellForAge.cellReuseIdentifier)
// tableView.register(YHDavidCell1.self,forCellReuseIdentifier: YHDavidCell1.cellReuseIdentifier)
// tableView.register(YHDavidCell3.self,forCellReuseIdentifier: YHDavidCell3.cellReuseIdentifier)
// tableView.register(YHDavidCell2.self,forCellReuseIdentifier: YHDavidCell2.cellReuseIdentifier)
// tableView.register(YHDavidCell4.self,forCellReuseIdentifier: YHDavidCell4.cellReuseIdentifier)
// tableView.register(YHDavidCell5.self,forCellReuseIdentifier: YHDavidCell5.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
//0.0
serviceCenterMainReqVM.loadLocalScoreData()
//1.0
initView()
}
}
// MARK: - private methods
extension YHScoreDetailViewController {
private func initView()->Void {
gk_navigationBar.isHidden = false
gk_backStyle = .white
gk_navTitle = "我的评分"
gk_navBackgroundColor = UIColor(hex: 0x528bf1)
gk_navTitleColor = .white
gk_navBarAlpha = 1
view.addSubview(headBkgImagV)
headBkgImagV.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalToSuperview()
make.height.equalTo(326)
}
homeTableView.delegate = self
homeTableView.dataSource = self
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview()
make.left.equalTo(16)
make.right.equalTo(-16)
}
// homeTableView.backgroundColor = .purple //for test hjl
}
}
// MARK: - delegates
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHScoreDetailViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 6
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
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 UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHScorePersonInfoCell.self)
return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHScoreItemCellForAge.self)
cell.optionData = self.serviceCenterMainReqVM.localScoreData?[indexPath.row]
return cell
}
let cell = tableView.dequeueReusableCell(withClass: YHScoreItemCell.self)
cell.optionData = self.serviceCenterMainReqVM.localScoreData?[indexPath.row]
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.row)")
}
}
......@@ -12,6 +12,8 @@ import UIKit
class YHServiceCenterSecondViewController: YHBaseViewController {
// private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
private var arrData : [YHContactMainItemStatusModel] = []
private var unfoldFlag : Bool = true //是否展开
private lazy var downArrowImagev : UIImageView = {
let imagV = UIImageView(frame: CGRect(x: KScreenWidth - 16 - 32, y: 17, width: 24, height: 24))
......@@ -61,6 +63,14 @@ extension YHServiceCenterSecondViewController {
gk_navBarAlpha = 1.0
gk_navLineHidden = false
let arr = [1,2,3]
for item in arr {
let model = YHContactMainItemStatusModel()
model.type = item
model.isFinished = false
arrData.append(model)
}
view.addSubview(topBkg)
topBkg.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
......@@ -101,9 +111,8 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if unfoldFlag == true {
return 10
return arrData.count
}
return 0
}
......@@ -143,6 +152,8 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let newCell = tableView.dequeueReusableCell(withClass: YHContractMainItemStatusCell.self)
newCell.selectionStyle = .none
newCell.dataModel = arrData[indexPath.row]
return newCell
}
......
//
// YHContactMainItemStatusModel.swift
// galaxy
//
// Created by davidhuangA on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHContactMainItemStatusModel {
var type : Int = -1 {
didSet {
if type == 1 {
iconName = "service_center_sfsq_xxws_icon"
itemName = "信息完善"
} else if type == 2 {
iconName = "service_center_sfsq_zlsc_icon"
itemName = "资料上传"
} else if type == 3 {
iconName = "service_center_sfsq_wdpf_icon"
itemName = "我的评分"
}
}
}
var isFinished : Bool = false
var iconName : String = ""
var itemName : String = ""
}
//
// YHInformationPerectModel.swift
// galaxy
//
// Created by davidhuangA on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHInformationPerfectModel {
var icon : String = ""
var name : String = ""
var type : Int = -1 {
didSet{
isFirstCell = false
isLastestCell = false
if type == 1 {
isFirstCell = true
name = "主申请人信息"
icon = "zsqrxx_icon"
} else if type == 2 {
name = "家庭成员信息"
icon = "jtcyxx_icon"
} else if type == 3 {
name = "基本资料"
icon = "jbzl_icon"
} else if type == 4 {
name = "学历/专业资格"
icon = "xlzyzg_icon"
} else if type == 5 {
name = "工作经验"
icon = "gzjy_icon"
} else if type == 6 {
name = "其他信息"
icon = "qtxx_icon"
isLastestCell = true
}
}
}
var status : String = ""
var color : UIColor = .red
var statusColor : UIColor = .red
var isFinished : Bool = false {
didSet {
status = isFinished ? "已完成" : "待完善"
color = isFinished ? UIColor(hex: 0x222222, alpha: 1.0) : UIColor(hex: 0x888F98, alpha: 1.0)
statusColor = isFinished ? UIColor(hex: 0x3ECDC3, alpha: 1.0) : UIColor(hex: 0x888F98, alpha: 1.0)
if type != 1 {
icon = isFinished ? icon : (icon + "_grey")
}
}
}
var isDoing : Bool = false {
didSet {
color = isDoing ? UIColor(hex: 0x222222, alpha: 1.0) : UIColor(hex: 0x888F98, alpha: 1.0)
statusColor = isDoing ? UIColor(hex: 0x3F8BF8, alpha: 1.0) : UIColor(hex: 0x888F98, alpha: 1.0)
if type != 1 {
icon = isDoing ? icon : (icon + "_grey")
}
}
}
var isNextDoingCell : Bool = false
var isFirstCell : Bool = false
var isLastestCell : Bool = false
}
//
// YHScoreDataModel.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHScoreDataModel: SmartCodable {
var age_score : YHScoreSessionModel?
var language_score : YHScoreSessionModel?
var background_score : YHScoreSessionModel?
var work_experience_score : YHScoreSessionModel?
var education_score : YHScoreSessionModel?
var talent_list_score : YHScoreSessionModel?
required init() {
}
subscript(_ index : Int) -> YHScoreSessionModel? {
if index == 1 {
return age_score
} else if index == 2 {
return language_score
} else if index == 3 {
return background_score
} else if index == 4 {
return work_experience_score
} else if index == 5 {
return education_score
} else if index == 6 {
return talent_list_score
}
return nil
}
}
class YHScoreOptiosModel : SmartCodable {
var isSelected : Bool = false
var scoreName : String = ""
var scoreValue : String = ""
required init() {
}
}
class YHScoreSessionModel : SmartCodable {
var name : String = "" //"年龄得分"
var score : String = "" //(最高30分)
var options : [YHScoreOptiosModel] = []
required init() {
}
}
//
// YHCertificateViewController.swift
// galaxy
//
// Created by edy on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateViewController: YHBaseViewController {
var spouse:YHSpouse?
var cardInfo: YHCNIdentityCard?
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemExpireDateCell.self, forCellReuseIdentifier: YHFormItemExpireDateCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "配偶信息填写".local
createUI()
loadCertificateInfo()
}
func createUI() {
view.addSubview(tableView);
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
}
func loadCertificateInfo() {
let title0 = YHFormTitleItem(type: .chinaIdCardInfo)
let item01 = YHFormDetailItem(type: .certificateNumber)
let item02 = YHFormDetailItem(type: .certificateSignPlace)
let item03 = YHFormDetailItem(type: .certificateSignDate)
let item04 = YHFormDetailItem(type: .certificateValidDate)
let arr0:[YHFormItemProtocol] = [title0, item01, item02, item03, item04]
let title1 = YHFormTitleItem(type: .passPortInfo)
let item10 = YHFormDetailItem(type: .cetificateType)
let item11 = YHFormDetailItem(type: .certificateNumber)
let item12 = YHFormDetailItem(type: .certificateSignPlace)
let item13 = YHFormDetailItem(type: .certificateSignDate)
let item14 = YHFormDetailItem(type: .certificateValidDate)
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13, item14]
items.append(contentsOf: [arr0, arr1])
tableView.reloadData()
}
}
extension YHCertificateViewController : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section >= items.count { return 0 }
let arr = items[section]
return arr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section >= items.count { return createDefaultCell(indexPath) }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return createDefaultCell(indexPath) }
let item:YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.titleLabel.text = item.getTitle()
return cell
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .certificateNumber || detailItem.type == .certificateSignPlace { // 证件号码和签发地需要填写
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
let titleItem = arr[0] as! YHFormTitleItem
if detailItem.type == .certificateNumber {
cell.titleLabel.text = (titleItem.type == .chinaIdCardInfo ? "中国身份证号" : "证件号码")
} else {
cell.titleLabel.text = detailItem.getTitle()
}
return cell
}
if detailItem.type == .cetificateType || detailItem.type == .certificateSignDate {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.title = detailItem.getTitle()
cell.detail = "中国"
return cell
}
if detailItem.type == .certificateValidDate {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemExpireDateCell.cellReuseIdentifier, for: indexPath) as! YHFormItemExpireDateCell
cell.title = detailItem.getTitle()
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell
cell.titleLabel.text = detailItem.getTitle()
return cell
}
return createDefaultCell(indexPath)
}
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return }
createCorner(cell: cell, arr: arr, indexPath: indexPath)
}
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section >= items.count { return 0.0 }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return 0.0 }
let item = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
return 52.0
}
if item is YHFormDetailItem {
return UITableView.automaticDimension
}
return 52.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHSpouseBasicInfoVC()
self.navigationController?.pushViewController(vc)
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 复用时需清理
cell.layer.mask = nil
// 设置每块section圆角
if (indexPath.row == 0) {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else if (indexPath.row == arr.count-1) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
}
//
// YHChildBasicInfoVC.swift
// galaxy
//
// Created by edy on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHChildBasicInfoVC: YHBaseViewController {
var child:YHChild?
var cardInfo: YHCNIdentityCard?
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemDegreeInfoCell.self, forCellReuseIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "子女基本信息填写".local
createUI()
loadBasicInfo()
}
func createUI() {
view.addSubview(tableView);
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
}
func loadBasicInfo() {
// 子女信息
let title0 = YHFormTitleItem(type: .childInfo)
let item00 = YHFormDetailItem(type: .childName)
let item01 = YHFormDetailItem(type: .everName)
let item02 = YHFormDetailItem(type: .befourMarryFirstName)
let item03 = YHFormDetailItem(type: .gender)
let item04 = YHFormDetailItem(type: .marriageState)
let item05 = YHFormDetailItem(type: .birthday)
let item06 = YHFormDetailItem(type: .birthNation)
let item07 = YHFormDetailItem(type: .birthCity)
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05, item06, item07]
// 职业
let title1 = YHFormTitleItem(type: .occupationInfo)
let item10 = YHFormDetailItem(type: .occupation)
let item11 = YHFormDetailItem(type: .occupationName)
let arr1:[YHFormItemProtocol] = [title1, item10, item11]
// 婚姻
let title2 = YHFormTitleItem(type: .isPreviousMarriageChild)
let item20 = YHFormDetailItem(type: .isPreviousMarriageChild)
let arr2:[YHFormItemProtocol] = [title2, item20]
// 在港信息
let title3 = YHFormTitleItem(type: .inHongKongInfo)
let item30 = YHFormDetailItem(type: .isNowInHK)
let item31 = YHFormDetailItem(type: .stayHKDate)
let item32 = YHFormDetailItem(type: .roleInHK)
let arr3:[YHFormItemProtocol] = [title3, item30, item31, item32]
// 香港身份证
let title4 = YHFormTitleItem(type: .hkIdentityCardInfo)
let item40 = YHFormDetailItem(type: .isHaveHkIdentityCard)
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber)
let arr4:[YHFormItemProtocol] = [title4, item40, item41]
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
tableView.reloadData()
}
func getCellType(_ item: Any) ->HKFormItemCellType {
if item is YHFormTitleItem {
return .title
}
if item is YHFormAddItem {
return .addItem
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .childName
|| detailItem.type == .everName
|| detailItem.type == .befourMarryFirstName
|| detailItem.type == .occupationName
|| detailItem.type == .hkIdentityCardNumber
{
return .inputText
}
if detailItem.type == .birthday
|| detailItem.type == .birthCity
|| detailItem.type == .occupation
|| detailItem.type == .stayHKDate
|| detailItem.type == .roleInHK
|| detailItem.type == .ownDegree
|| detailItem.type == .gender
|| detailItem.type == .marriageState
{
return .selectSheet
}
if detailItem.type == .birthNation
|| detailItem.type == .isNowInHK
|| detailItem.type == .isHaveHkIdentityCard
|| detailItem.type == .isPreviousMarriageChild
{
return .twoChoice
}
if detailItem.type == .degreeDetailInfo
{
return .degreeDetailInfo
}
}
return .defaultType
}
}
extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section >= items.count { return 0 }
let arr = items[section]
return arr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section >= items.count { return createDefaultCell(indexPath) }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return createDefaultCell(indexPath) }
let item:YHFormItemProtocol = arr[indexPath.row]
let cellType = getCellType(item)
if cellType == .title { // 标题
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.titleLabel.text = item.getTitle()
return cell
}
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.titleLabel.text = item.getTitle()
return cell
}
if cellType == .selectSheet { // 点击选择列表cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.title = item.getTitle()
return cell
}
if cellType == .twoChoice { // 双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = item.getTitle()
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),
YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
return cell
}
if cellType == .addItem { // 新增item cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.title = item.getTitle()
return cell
}
if cellType == .degreeDetailInfo { // 学位cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDegreeInfoCell
cell.title = item.getTitle()
return cell
}
return createDefaultCell(indexPath)
}
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return }
createCorner(cell: cell, arr: arr, indexPath: indexPath)
}
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section >= items.count { return 0.0 }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return 0.0 }
let item = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
return 52.0
}
if item is YHFormAddItem {
return 70.0
}
if item is YHFormDetailItem {
return UITableView.automaticDimension
}
return 52.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHParentInfoVC()
self.navigationController?.pushViewController(vc)
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 复用时需清理
cell.layer.mask = nil
// 设置每块section圆角
if (indexPath.row == 0) {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else if (indexPath.row == arr.count-1) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
}
//
// YHChildInitialInfoVC.swift
// galaxy
//
// Created by edy on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHChildInitialInfoVC: YHBaseViewController {
var child:YHChild?
lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemQuestionCell.self, forCellReuseIdentifier: YHFormItemQuestionCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
return tableView
}()
lazy var submitBtn:UIButton = {
let btn = UIButton()
btn.setTitle("提交".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSubmitBtn), for: .touchUpInside)
return btn
}()
lazy var saveBtn:UIButton = {
let btn = UIButton()
btn.setTitle("保存", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(UIColor(hexString:"#222222"), for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSaveBtn), for: .touchUpInside)
return btn
}()
lazy var bottomView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(submitBtn)
view.addSubview(saveBtn)
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "子女信息填写".local
createUI()
loadSponseInfo()
}
func loadSponseInfo() {
guard let child = child else { return }
items.removeAll()
// 随行
let title0 = YHFormTitleItem(type: .accompany)
let item00 = YHFormDetailItem(type: .ownCustody)
let item01 = YHFormDetailItem(type: .birthday)
let item02 = YHFormDetailItem(type: .isAccompanyToHK)
item02.isAccompany = (child.follow == 1)
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02]
items.append(arr0)
if item02.isAccompany { // 随行才加后面的信息
// 国籍
let title1 = YHFormTitleItem(type: .country)
let item10 = YHFormDetailItem(type: .nationOrArea)
let arr1:[YHFormItemProtocol] = [title1, item10]
// 居住信息
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type: .isLiveTother)
item20.isLiveTogether = (child.finishFollow == 1)
let item21 = YHFormDetailItem(type: .nationOrArea)
let item22 = YHFormDetailItem(type: .liveCity)
let item23 = YHFormDetailItem(type: .detailAddress)
let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23]
// 港澳通信证
let title3 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item30 = YHFormDetailItem(type: .isHandleHKPassPort)
item30.isHandleHkPassport = (child.isHandled == 1)
let arr3:[YHFormItemProtocol] = [title3, item30]
items.append(contentsOf:[arr1, arr2, arr3])
}
tableView.reloadData()
}
func createUI() {
view.addSubview(tableView);
view.addSubview(bottomView)
let submitBtnHeight = 48.0
let gap = 8.0
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(view)
make.height.equalTo(submitBtnHeight+gap*2+k_Height_safeAreaInsetsBottom())
}
saveBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.size.equalTo(CGSize(width: 86.0, height: 48.0))
make.top.equalTo(8)
}
submitBtn.snp.makeConstraints { make in
make.left.equalTo(saveBtn.snp.right).offset(10)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(48)
make.centerY.equalTo(saveBtn)
}
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
}
@objc func didClickSubmitBtn() {
}
@objc func didClickSaveBtn() {
}
}
extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section >= items.count { return 0 }
let arr = items[section]
return arr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section >= items.count { return createDefaultCell(indexPath) }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return createDefaultCell(indexPath) }
let item:YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.titleLabel.text = item.getTitle()
return cell
} else if item is YHFormDetailItem { // 具体信息
let detailItem = item as! YHFormDetailItem
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = detailItem.getTitle()
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
if detailItem.type == .isAccompanyToHK {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isAccompany),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isAccompany)]
cell.answerArr = answers
} else if detailItem.type == .isHandleHKPassPort {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isHandleHkPassport),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isHandleHkPassport)]
cell.answerArr = answers
} else if detailItem.type == .isLiveTother {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isLiveTogether),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isLiveTogether)]
cell.answerArr = answers
}
cell.answerBlock = {
[weak self] (arr, selectIndex) in
let selectItem:YHFormChoiceItem = arr[selectIndex]
if detailItem.type == .isAccompanyToHK { // 是否随行
let follow = (selectItem.title == "是".local ? 1 : 0)
self?.child?.follow = follow
self?.loadSponseInfo()
} else if detailItem.type == .isHandleHKPassPort { // 是否办理港澳通行证
let handlePassport = (selectItem.title == "是".local ? 1 : 0)
self?.child?.isHandled = handlePassport
self?.loadSponseInfo()
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住
let isLiveTother = (selectItem.title == "是".local ? 1 : 0)
self?.child?.finishFollow = (selectItem.title == "是".local ? 1 : 0)
self?.loadSponseInfo()
}
}
return cell
} else if detailItem.type == .nationOrArea || detailItem.type == .nationOrArea || detailItem.type == .liveCity || detailItem.type == .detailAddress || detailItem.type == .birthday {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
return cell
} else if detailItem.type == .ownCustody {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemQuestionCell.cellReuseIdentifier, for: indexPath) as! YHFormItemQuestionCell
cell.title = detailItem.getTitle()
return cell
}
}
return createDefaultCell(indexPath)
}
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return }
createCorner(cell: cell, arr: arr, indexPath: indexPath)
}
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section >= items.count { return 0.0 }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return 0.0 }
let item = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
return 52.0
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .isLiveTother ||
detailItem.type == .isAccompanyToHK ||
detailItem.type == .isHandleHKPassPort ||
detailItem.type == .ownCustody
{
return UITableView.automaticDimension
}
}
return 52.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHChildBasicInfoVC()
self.navigationController?.pushViewController(vc)
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 复用时需清理
cell.layer.mask = nil
// 设置每块section圆角
if (indexPath.row == 0) {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else if (indexPath.row == arr.count-1) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
}
......@@ -8,7 +8,7 @@
import UIKit
enum YHFamilyMemberEditType:Int {
enum YHFormTitleItemEditType:Int {
case none = 1
case canEdit = 2
case canCancel = 3
......@@ -17,10 +17,10 @@ enum YHFamilyMemberEditType:Int {
class YHFamilyMemberFormVC: YHBaseViewController {
var familyMemberInfo: YHFamilyMemberInfo?
var isChildsEditMode: YHFamilyMemberEditType = .none
var isBrothersEditMode: YHFamilyMemberEditType = .none
var isChildsEditMode: YHFormTitleItemEditType = .none
var isBrothersEditMode: YHFormTitleItemEditType = .none
var items:[[YHFamilyMemberProtocol]] = []
var items:[[YHFormItemProtocol]] = []
lazy var tableView: UITableView = {
......@@ -29,21 +29,26 @@ class YHFamilyMemberFormVC: YHBaseViewController {
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHDoubleChoiceFormCell.self, forCellReuseIdentifier: YHDoubleChoiceFormCell.cellReuseIdentifier)
tableView.register(YHSingleLineInputCell.self, forCellReuseIdentifier: YHSingleLineInputCell.cellReuseIdentifier)
tableView.register(YHSingleLineSelectCell.self, forCellReuseIdentifier: YHSingleLineSelectCell.cellReuseIdentifier)
tableView.register(YHFormTitleCell.self, forCellReuseIdentifier: YHFormTitleCell.cellReuseIdentifier)
tableView.register(YHFormAddInfoCell.self, forCellReuseIdentifier: YHFormAddInfoCell.cellReuseIdentifier)
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
return tableView
}()
lazy var submitBtn:UIButton = {
let btn = UIButton.bs_button(title: "提交".local, font: UIFont.PFSCR(ofSize: 14), normalColor: .white)
let btn = UIButton()
btn.setTitle("提交".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSubmitBtn), for: .touchUpInside)
......@@ -59,7 +64,7 @@ class YHFamilyMemberFormVC: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.gk_navTitle = "家庭成员信息填写"
self.gk_navTitle = "家庭成员信息填写".local
view.backgroundColor = UIColor(hexString:"#F8F8F8")
createUI()
loadData()
......@@ -274,12 +279,12 @@ class YHFamilyMemberFormVC: YHBaseViewController {
// 配偶section
if let sponse = familyMemberInfo?.spouse {
let sponseArray:[YHFamilyMemberProtocol] = [YHFamilyMemberFormItem(type: .sponse), sponse]
let sponseArray:[YHFormItemProtocol] = [YHFormTitleItem(type: .sponse), sponse]
items.append(sponseArray)
}
// 父母section
var parents = [YHFamilyMemberProtocol]()
var parents = [YHFormItemProtocol]()
if let father = familyMemberInfo?.father {
parents.append(father)
}
......@@ -287,20 +292,20 @@ class YHFamilyMemberFormVC: YHBaseViewController {
parents.append(mother)
}
if !parents.isEmpty {
let item0 = YHFamilyMemberFormItem(type: .parent)
let item0 = YHFormTitleItem(type: .parent)
parents.insert(item0, at: 0)
items.append(parents)
}
// 子女section
var childArr:[YHFamilyMemberProtocol] = [YHFamilyMemberFormItem(type: .child), YHFamilyMemberFormItem(type: .addChild)]
var childArr:[YHFormItemProtocol] = [YHFormTitleItem(type: .child), YHFormAddItem(type: .addChild)]
if let childs = familyMemberInfo?.child, !childs.isEmpty {
childArr.insert(contentsOf: childs, at:1)
}
items.append(childArr)
// 兄妹section
var brotherArr:[YHFamilyMemberProtocol] = [YHFamilyMemberFormItem(type: .brother), YHFamilyMemberFormItem(type: .addBrother)]
var brotherArr:[YHFormItemProtocol] = [YHFormTitleItem(type: .brother), YHFormAddItem(type: .addBrother)]
if let brothers = familyMemberInfo?.brother, !brothers.isEmpty {
brotherArr.insert(contentsOf: brothers, at:1)
}
......@@ -486,27 +491,14 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let arr = items[indexPath.section]
let item:YHFamilyMemberProtocol = arr[indexPath.row]
let item:YHFormItemProtocol = arr[indexPath.row]
if item is YHFamilyMemberFormItem { // 是标题或添加项目
if item is YHFormTitleItem { // 是标题
let formItem = item as! YHFormTitleItem
let formItem = item as! YHFamilyMemberFormItem
if formItem.type == .addChild || formItem.type == .addBrother { // 新增子女/兄弟姐妹
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormAddInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormAddInfoCell
createCorner(cell: cell, arr: arr, indexPath: indexPath)
cell.clickBlock = { [weak self] in
if formItem.type == .addBrother {
self?.addBrother()
} else if formItem.type == .addChild {
self?.addChild()
}
}
return cell
}
// 配偶父母子女兄妹title
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, arr: arr, indexPath: indexPath)
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.titleLabel.text = formItem.getTitle()
cell.subTitleLabel.text = formItem.getSubTitle()
......@@ -539,12 +531,11 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
}
return cell
}
// 配偶父母子女兄妹具体条目
if item is YHParent || item is YHChild || item is YHSpouse || item is YHBrother {
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, arr: arr, indexPath: indexPath)
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell
cell.isShowDeleteBtn = false
cell.deleteBlock = nil
if item is YHChild || item is YHBrother {
......@@ -559,8 +550,8 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
cell.deleteBlock = { [weak self] in
if item is YHChild {
let childCount = self?.familyMemberInfo?.child?.count ?? 0
if (indexPath.row < childCount) {
// 因为子女兄妹section第一行都是标题所以row-1
// 因为子女兄妹section第一行都是标题所以row-1
if (indexPath.row-1 < childCount) {
self?.familyMemberInfo?.child?.remove(at: indexPath.row-1)
self?.isChildsEditMode = .none
self?.isBrothersEditMode = .none
......@@ -568,8 +559,8 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
} else if item is YHBrother {
let brotherCount = self?.familyMemberInfo?.brother?.count ?? 0
if (indexPath.row < brotherCount) {
// 因为子女兄妹section第一行都是标题所以row-1
// 因为子女兄妹section第一行都是标题所以row-1
if (indexPath.row-1 < brotherCount) {
self?.familyMemberInfo?.brother?.remove(at: indexPath.row-1)
self?.isChildsEditMode = .none
self?.isBrothersEditMode = .none
......@@ -581,25 +572,49 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
return cell
}
// 新增子女/兄弟姐妹
if item is YHFormAddItem {
let formItem = item as! YHFormAddItem
if formItem.type == .addChild || formItem.type == .addBrother {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.clickBlock = { [weak self] in
if formItem.type == .addBrother {
self?.addBrother()
} else if formItem.type == .addChild {
self?.addChild()
}
}
return cell
}
}
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
createCorner(cell: cell, arr: arr, indexPath: indexPath)
return cell
}
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return }
createCorner(cell: cell, arr: arr, indexPath: indexPath)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let arr = items[indexPath.section]
let item:YHFamilyMemberProtocol = arr[indexPath.row]
let item:YHFormItemProtocol = arr[indexPath.row]
if item is YHFamilyMemberFormItem { // 是标题或添加项目
let titleItem = item as! YHFamilyMemberFormItem
if titleItem.type == .addChild || titleItem.type == .addBrother {
return 77.0
}
if item is YHFormTitleItem { // 是标题
return 52.0
} else if item is YHFormAddItem { // 新增子女兄妹
return 70.0
}
return 64.0
return 50.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
......@@ -612,8 +627,50 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHSpouseFormVC()
self.navigationController?.pushViewController(vc)
let arr = items[indexPath.section]
let item:YHFormItemProtocol = arr[indexPath.row]
// 标题
if item is YHFormTitleItem {
return
}
// 新增子女兄妹
if item is YHFormAddItem {
let detailItem = item as! YHFormAddItem
if detailItem.type == .addChild {
} else if detailItem.type == .addBrother {
}
return
}
// 父母
if item is YHParent {
let parent = item as! YHParent
let vc = YHParentInfoVC()
vc.parentInfo = parent
self.navigationController?.pushViewController(vc)
return
}
// 配偶
if item is YHSpouse {
let spouse = item as! YHSpouse
let vc = YHSpouseInitialInfoVC()
vc.spouse = spouse
self.navigationController?.pushViewController(vc)
return
}
// 子女
if item is YHChild {
let child = item as! YHChild
let vc = YHChildInitialInfoVC()
vc.child = child
self.navigationController?.pushViewController(vc)
return
}
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
......
//
// YHParentViewController.swift
// galaxy
//
// Created by edy on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHParentInfoVC: YHBaseViewController {
var parentInfo: YHParent?
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemOnlyDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "父母信息填写".local
createUI()
loadBasicInfo()
}
func createUI() {
view.addSubview(tableView);
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
loadBasicInfo()
}
func loadBasicInfo() {
guard let parentInfo = parentInfo else { return }
items.removeAll()
// 基本信息
let title0:YHFormItemProtocol = YHFormTitleItem(type: .basicInfo)
let item00:YHFormItemProtocol = YHFormDetailItem(type: .onlyDoubleChoice)
let arr0:[YHFormItemProtocol] = [title0, item00]
// 父母亲信息
var arr1 = [YHFormItemProtocol]()
if parentInfo.sex == -1 { // 父亲
let title1:YHFormItemProtocol = YHFormTitleItem(type: .fatherInfo)
let item10:YHFormItemProtocol = YHFormDetailItem(type: .fatherName)
arr1.append(contentsOf: [title1, item10])
} else { // 母亲
let title1:YHFormItemProtocol = YHFormTitleItem(type: .motherInfo)
let item10:YHFormItemProtocol = YHFormDetailItem(type: .motherName)
arr1.append(contentsOf: [title1, item10])
}
let item11:YHFormItemProtocol = YHFormDetailItem(type: .birthday)
let item12:YHFormItemProtocol = YHFormDetailItem(type: .birthNation)
let item13:YHFormItemProtocol = YHFormDetailItem(type: .birthCity)
arr1.append(contentsOf: [item11, item12, item13])
if parentInfo.deceased != 1 { // 健在
let item14:YHFormItemProtocol = YHFormDetailItem(type: .marriageState)
arr1.append(item14)
}
// 职业信息
let title2:YHFormItemProtocol = YHFormTitleItem(type: .occupationInfo)
let item20:YHFormItemProtocol = YHFormDetailItem(type: .occupation)
let arr2:[YHFormItemProtocol] = [title2, item20]
// 居住信息
let title3:YHFormItemProtocol = YHFormTitleItem(type: .liveInfo)
let item30:YHFormItemProtocol = YHFormDetailItem(type: .liveNationOrArea)
let arr3:[YHFormItemProtocol] = [title3, item30]
// 香港身份证
let title4:YHFormItemProtocol = YHFormTitleItem(type: .hkIdentityCardInfo)
let item40:YHFormItemProtocol = YHFormDetailItem(type: .isHaveHkIdentityCard)
let item41:YHFormItemProtocol = YHFormDetailItem(type: .hkIdentityCardNumber)
let arr4:[YHFormItemProtocol] = [title4, item40, item41]
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
tableView.reloadData()
}
func getCellType(_ item: Any) ->HKFormItemCellType {
if item is YHFormTitleItem {
return .title
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .fatherName
|| detailItem.type == .motherName
|| detailItem.type == .nationOrArea
|| detailItem.type == .hkIdentityCardNumber
{
return .inputText
}
if detailItem.type == .birthday
|| detailItem.type == .birthCity
|| detailItem.type == .marriageState
|| detailItem.type == .occupation
|| detailItem.type == .liveNationOrArea
{
return .selectSheet
}
if detailItem.type == .birthNation
|| detailItem.type == .isHaveHkIdentityCard
{
return .twoChoice
}
if detailItem.type == .onlyDoubleChoice
{
return .onlyTwoChoice
}
}
return .defaultType
}
}
extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section >= items.count { return 0 }
let arr = items[section]
return arr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section >= items.count { return createDefaultCell(indexPath) }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return createDefaultCell(indexPath) }
let item:YHFormItemProtocol = arr[indexPath.row]
let cellType = getCellType(item)
if cellType == .title { // 标题
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.titleLabel.text = item.getTitle()
return cell
}
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.titleLabel.text = item.getTitle()
return cell
}
if cellType == .selectSheet { // 点击选择列表cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.title = item.getTitle()
return cell
}
if cellType == .twoChoice { // 问答双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = item.getTitle()
cell.answerArr = nil
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthNation {
let answers = [YHFormChoiceItem(title: "国内".local, isSelect: true),
YHFormChoiceItem(title: "国外".local, isSelect: false)]
cell.answerArr = answers
} else if detailItem.type == .isHaveHkIdentityCard {
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),
YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
}
}
return cell
}
if cellType == .onlyTwoChoice { // 仅有双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemOnlyDoubleChoiceCell
var isDead = 0
if let dead = parentInfo?.deceased, dead == 1 { // 已故
isDead = 1
}
let answers = [YHFormChoiceItem(title: "健在".local, isSelect: isDead != 1),
YHFormChoiceItem(title: "已故".local, isSelect: isDead == 1)]
cell.answerArr = answers
cell.answerBlock = { [weak self]
(arr, selectIndex) in
let selectItem:YHFormChoiceItem = arr[selectIndex]
self?.parentInfo?.deceased = (selectItem.title == "已故" ? 1 : 0)
self?.loadBasicInfo()
}
return cell
}
if cellType == .addItem { // 新增item cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.title = item.getTitle()
return cell
}
if cellType == .degreeDetailInfo { // 学位cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDegreeInfoCell
cell.title = item.getTitle()
return cell
}
return createDefaultCell(indexPath)
}
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return }
createCorner(cell: cell, arr: arr, indexPath: indexPath)
}
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section >= items.count { return 0.0 }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return 0.0 }
let item = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
return 52.0
}
if item is YHFormAddItem {
return 70.0
}
if item is YHFormDetailItem {
return UITableView.automaticDimension
}
return 52.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 复用时需清理
cell.layer.mask = nil
// 设置每块section圆角
if (indexPath.row == 0) {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else if (indexPath.row == arr.count-1) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
}
//
// YHSpouseBasicInfoVC.swift
// galaxy
//
// Created by edy on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
enum HKFormItemCellType: Int {
case defaultType = 0
case title = 1
case enterDetail = 2
case inputText = 3
case selectSheet = 4
case twoChoice = 5
case addItem = 6
case degreeDetailInfo = 7
case onlyTwoChoice = 8
}
class YHSpouseBasicInfoVC: YHBaseViewController {
var spouse:YHSpouse?
var cardInfo: YHCNIdentityCard?
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemDegreeInfoCell.self, forCellReuseIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "配偶基本信息填写".local
createUI()
loadBasicInfo()
}
func createUI() {
view.addSubview(tableView);
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
}
func loadBasicInfo() {
let title0 = YHFormTitleItem(type: .spouseInfo)
let item01 = YHFormDetailItem(type: .everName)
let item02 = YHFormDetailItem(type: .befourMarryFirstName)
let item03 = YHFormDetailItem(type: .birthday)
let item04 = YHFormDetailItem(type: .birthNation)
let item05 = YHFormDetailItem(type: .birthCity)
let arr0:[YHFormItemProtocol] = [title0, item01, item02, item03, item04, item05]
let title1 = YHFormTitleItem(type: .occupationInfo)
let item10 = YHFormDetailItem(type: .occupation)
let item11 = YHFormDetailItem(type: .occupationName)
let arr1:[YHFormItemProtocol] = [title1, item10, item11]
let title2 = YHFormTitleItem(type: .degreeInfo)
let item20 = YHFormDetailItem(type: .ownDegree)
let item21 = YHFormDetailItem(type: .degreeDetailInfo)
let item22 = YHFormDetailItem(type: .degreeDetailInfo)
let item23 = YHFormAddItem(type: .addDegree)
let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23]
let title3 = YHFormTitleItem(type: .hkIdentityCardInfo)
let item30 = YHFormDetailItem(type: .isHaveHkIdentityCard)
let item31 = YHFormDetailItem(type: .hkIdentityCardNumber)
let arr3:[YHFormItemProtocol] = [title3, item30, item31]
items.append(contentsOf: [arr0, arr1, arr2, arr3])
tableView.reloadData()
}
func getCellType(_ item: Any) ->HKFormItemCellType {
if item is YHFormTitleItem {
return .title
}
if item is YHFormAddItem {
return .addItem
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .spouseName
|| detailItem.type == .everName
|| detailItem.type == .befourMarryFirstName
|| detailItem.type == .occupationName
|| detailItem.type == .hkIdentityCardNumber
{
return .inputText
}
if detailItem.type == .birthday
|| detailItem.type == .birthCity
|| detailItem.type == .occupation
|| detailItem.type == .stayHKDate
|| detailItem.type == .roleInHK
|| detailItem.type == .ownDegree
{
return .selectSheet
}
if detailItem.type == .birthNation
|| detailItem.type == .isNowInHK
|| detailItem.type == .isHaveHkIdentityCard
{
return .twoChoice
}
if detailItem.type == .degreeDetailInfo
{
return .degreeDetailInfo
}
}
return .defaultType
}
}
extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section >= items.count { return 0 }
let arr = items[section]
return arr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section >= items.count { return createDefaultCell(indexPath) }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return createDefaultCell(indexPath) }
let item:YHFormItemProtocol = arr[indexPath.row]
let cellType = getCellType(item)
if cellType == .title { // 标题
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.titleLabel.text = item.getTitle()
return cell
}
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.titleLabel.text = item.getTitle()
return cell
}
if cellType == .selectSheet { // 点击选择列表cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.title = item.getTitle()
return cell
}
if cellType == .twoChoice { // 双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = item.getTitle()
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),
YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
return cell
}
if cellType == .addItem { // 新增item cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.title = item.getTitle()
return cell
}
if cellType == .degreeDetailInfo { // 学位cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDegreeInfoCell
cell.title = item.getTitle()
return cell
}
return createDefaultCell(indexPath)
}
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return }
createCorner(cell: cell, arr: arr, indexPath: indexPath)
}
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section >= items.count { return 0.0 }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return 0.0 }
let item = arr[indexPath.row]
if item is YHFormTitleItem { // 标题
return 52.0
}
if item is YHFormAddItem {
return 70.0
}
if item is YHFormDetailItem {
return UITableView.automaticDimension
}
return 52.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHParentInfoVC()
self.navigationController?.pushViewController(vc)
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 复用时需清理
cell.layer.mask = nil
// 设置每块section圆角
if (indexPath.row == 0) {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else if (indexPath.row == arr.count-1) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else {
cell.layer.mask = nil
}
}
}
......@@ -8,10 +8,12 @@
import UIKit
class YHSpouseFormVC: YHBaseViewController {
class YHSpouseInitialInfoVC: YHBaseViewController {
var spouse:YHSpouse?
lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var items:[YHTableItemInfo] = [YHTableItemInfo]()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
......@@ -19,21 +21,25 @@ class YHSpouseFormVC: YHBaseViewController {
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHDoubleChoiceFormCell.self, forCellReuseIdentifier: YHDoubleChoiceFormCell.cellReuseIdentifier)
tableView.register(YHSingleLineInputCell.self, forCellReuseIdentifier: YHSingleLineInputCell.cellReuseIdentifier)
tableView.register(YHSingleLineSelectCell.self, forCellReuseIdentifier: YHSingleLineSelectCell.cellReuseIdentifier)
tableView.register(YHFormTitleCell.self, forCellReuseIdentifier: YHFormTitleCell.cellReuseIdentifier)
tableView.register(YHFormAddInfoCell.self, forCellReuseIdentifier: YHFormAddInfoCell.cellReuseIdentifier)
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
return tableView
}()
lazy var submitBtn:UIButton = {
let btn = UIButton.bs_button(title: "提交".local, font: UIFont.PFSCR(ofSize: 14), normalColor: .white)
let btn = UIButton()
btn.setTitle("提交".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString:"#4388FF")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSubmitBtn), for: .touchUpInside)
......@@ -41,7 +47,10 @@ class YHSpouseFormVC: YHBaseViewController {
}()
lazy var saveBtn:UIButton = {
let btn = UIButton.bs_button(title: "保存".local, font: UIFont.PFSCR(ofSize: 14), normalColor: UIColor(hexString:"#222222"))
let btn = UIButton()
btn.setTitle("保存", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(UIColor(hexString:"#222222"), for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.layer.cornerRadius = 8.0
btn.addTarget(self, action: #selector(didClickSaveBtn), for: .touchUpInside)
......@@ -58,19 +67,49 @@ class YHSpouseFormVC: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "配偶信息填写".local
createUI()
loadData()
loadSponseInfo()
}
func loadData() {
func loadSponseInfo() {
guard let spouse = spouse else { return }
items.removeAll()
// 随行
let title0 = YHFormTitleItem(type: .accompany)
let item0 = YHFormDetailItem(type: .isAccompanyToHK)
item0.isAccompany = (spouse.follow == 1)
let arr0:[YHFormItemProtocol] = [title0, item0]
items.append(arr0)
let item1 = YHTableItemInfo(type: .accompany)
let item2 = YHTableItemInfo(type: .country)
let item3 = YHTableItemInfo(type: .address)
let item4 = YHTableItemInfo(type: .hongkongMacaouPassport)
items.append(contentsOf: [item1, item2, item3, item4])
if item0.isAccompany { // 随行才加后面的信息
// 国籍
let title1 = YHFormTitleItem(type: .country)
let item10 = YHFormDetailItem(type: .nationOrArea)
item10.country = "中国"
let arr1:[YHFormItemProtocol] = [title1, item10]
// 居住信息
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type: .isLiveTother)
item20.isLiveTogether = (spouse.finishFollow == 1)
let item21 = YHFormDetailItem(type: .nationOrArea)
let item22 = YHFormDetailItem(type: .liveCity)
let item23 = YHFormDetailItem(type: .detailAddress)
let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23]
// 港澳通信证
let title3 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item30 = YHFormDetailItem(type: .isHandleHKPassPort)
item30.isHandleHkPassport = (spouse.isHandled == 1)
let arr3:[YHFormItemProtocol] = [title3, item30]
items.append(contentsOf:[arr1, arr2, arr3])
}
tableView.reloadData()
}
......@@ -118,7 +157,7 @@ class YHSpouseFormVC: YHBaseViewController {
}
extension YHSpouseFormVC : UITableViewDelegate, UITableViewDataSource {
extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
......@@ -126,74 +165,124 @@ extension YHSpouseFormVC : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section >= items.count { return 0 }
let item:YHTableItemInfo = items[section]
return item.getSubItems().count
let arr = items[section]
return arr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section >= items.count { return UITableViewCell() }
let item:YHTableItemInfo = items[indexPath.section]
if indexPath.row >= item.getSubItems().count { return UITableViewCell() }
if indexPath.section >= items.count { return createDefaultCell(indexPath) }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return createDefaultCell(indexPath) }
let subItem:YHTableSubItemInfo = item.getSubItems()[indexPath.row]
let item:YHFormItemProtocol = arr[indexPath.row]
switch subItem.type {
if item is YHFormTitleItem { // 标题
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormItemTitleCell
cell.titleLabel.text = item.getTitle()
return cell
case .subTitle:
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormTitleCell.cellReuseIdentifier, for: indexPath) as! YHFormTitleCell
createCorner(cell: cell, indexPath: indexPath)
cell.titleLabel.text = item.title
return cell
} else if item is YHFormDetailItem { // 具体信息
case .subAcompany:
let cell = tableView.dequeueReusableCell(withIdentifier: YHDoubleChoiceFormCell.cellReuseIdentifier, for: indexPath) as! YHDoubleChoiceFormCell
createCorner(cell: cell, indexPath: indexPath)
cell.question = subItem.title
return cell
case .subCountry:
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, indexPath: indexPath)
cell.isMust = subItem.isMust
cell.title = subItem.title
return cell
let detailItem = item as! YHFormDetailItem
case .subIsLiveTogether, .subHongkongMacaouPassport:
let cell = tableView.dequeueReusableCell(withIdentifier: YHDoubleChoiceFormCell.cellReuseIdentifier, for: indexPath) as! YHDoubleChoiceFormCell
createCorner(cell: cell, indexPath: indexPath)
cell.question = subItem.title
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = detailItem.getTitle()
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
if detailItem.type == .isAccompanyToHK {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isAccompany),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isAccompany)]
cell.answerArr = answers
} else if detailItem.type == .isHandleHKPassPort {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isHandleHkPassport),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isHandleHkPassport)]
cell.answerArr = answers
} else if detailItem.type == .isLiveTother {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isLiveTogether),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isLiveTogether)]
cell.answerArr = answers
}
cell.answerBlock = {
[weak self] (arr, selectIndex) in
let selectItem:YHFormChoiceItem = arr[selectIndex]
if detailItem.type == .isAccompanyToHK { // 是否随行
let follow = (selectItem.title == "是".local ? 1 : 0)
self?.spouse?.follow = follow
self?.loadSponseInfo()
} else if detailItem.type == .isHandleHKPassPort { // 是否办理港澳通行证
let handlePassport = (selectItem.title == "是".local ? 1 : 0)
self?.spouse?.isHandled = handlePassport
self?.loadSponseInfo()
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住
let isLiveTother = (selectItem.title == "是".local ? 1 : 0)
self?.spouse?.finishFollow = (selectItem.title == "是".local ? 1 : 0)
self?.loadSponseInfo()
}
}
return cell
case .subLiveNation, .subLiveCity, .subDetailAddress:
let cell = tableView.dequeueReusableCell(withIdentifier: YHSingleLineSelectCell.cellReuseIdentifier, for: indexPath) as! YHSingleLineSelectCell
createCorner(cell: cell, indexPath: indexPath)
cell.isMust = subItem.isMust
cell.title = subItem.title
} else if detailItem.type == .nationOrArea || detailItem.type == .nationOrArea || detailItem.type == .liveCity || detailItem.type == .detailAddress {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
return cell
}
}
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
createCorner(cell: cell, indexPath: indexPath)
return createDefaultCell(indexPath)
}
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if indexPath.section >= items.count { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return }
createCorner(cell: cell, arr: arr, indexPath: indexPath)
}
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section >= items.count { return 0 }
let item:YHTableItemInfo = items[indexPath.section]
if indexPath.section >= items.count { return 0.0 }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if indexPath.row >= arr.count { return 0.0 }
if indexPath.row >= item.getSubItems().count { return 0 }
let subItem = item.getSubItems()[indexPath.row]
let item = arr[indexPath.row]
if subItem.type == .subIsLiveTogether ||
subItem.type == .subAcompany ||
subItem.type == .subHongkongMacaouPassport
{ return UITableView.automaticDimension }
if item is YHFormTitleItem { // 标题
return 52.0
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .isLiveTother ||
detailItem.type == .isAccompanyToHK ||
detailItem.type == .isHandleHKPassPort
{
return UITableView.automaticDimension
}
}
return 52.0
}
......@@ -208,15 +297,19 @@ extension YHSpouseFormVC : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHCertificateViewController()
self.navigationController?.pushViewController(vc)
}
func createCorner(cell:UITableViewCell, indexPath:IndexPath) {
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
// 复用时需清理
cell.layer.mask = nil
// 设置每块section圆角
if (indexPath.row == 0) {
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
} else if (indexPath.row == 2) {
} else if (indexPath.row == arr.count-1) {
let corner = UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue)
cell.createCorner(CGSizeMake(12.0, 12.0), corner)
......
//
// YHCertificateInfo.swift
// galaxy
//
// Created by edy on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateInfo: NSObject {
}
//
// YHConsortInfo.swift
// galaxy
//
// Created by edy on 2024/1/23.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHConsortInfo {
}
public enum YHTableItemType : Int32 {
// 是否随行
case accompany = 0
// 国籍
case country = 1
// 居住信息
case address = 2
// 港澳通信证
case hongkongMacaouPassport = 3
}
//表单条目信息
class YHTableItemInfo {
var type:YHTableItemType
var title:String {
return getTitle()
}
init(type: YHTableItemType) {
self.type = type
}
var subTitleItems:[YHTableSubItemInfo]? = Array()
func getTitle()-> String {
switch self.type {
case .accompany:
return "随行".local
case .country:
return "国籍".local
case .address:
return "居住信息".local
case .hongkongMacaouPassport:
return "港澳通信证".local
}
}
func getSubItems()->[YHTableSubItemInfo] {
let item0 = YHTableSubItemInfo(type: .subTitle)
var res = [item0]
switch self.type {
case .accompany:
res.append(YHTableSubItemInfo(type: .subAcompany))
case .country:
res.append(YHTableSubItemInfo(type: .subCountry))
case .address:
let item1 = YHTableSubItemInfo(type: .subIsLiveTogether, isMust: true)
let item2 = YHTableSubItemInfo(type: .subLiveNation, isMust: true)
let item3 = YHTableSubItemInfo(type: .subDetailAddress, isMust: true)
res.append(contentsOf:[item1, item2, item3])
case .hongkongMacaouPassport:
res.append(YHTableSubItemInfo(type: .subHongkongMacaouPassport, isMust: true))
}
return res
}
}
public enum YHTableSubItemType : Int32 {
// 标题
case subTitle = 0
// 是否随行
case subAcompany = 1
// 国籍
case subCountry = 2
/* 居住信息 */
// 是否与主申请人同住
case subIsLiveTogether = 3
// 居住国家/地区
case subLiveNation = 4
// 现居住城市
case subLiveCity = 5
// 详细地址
case subDetailAddress = 6
// 港澳通信证
case subHongkongMacaouPassport = 7
}
class YHTableSubItemInfo {
var type:YHTableSubItemType
// 是否必填
var isMust:Bool
// 是否随行
var isAccompany:Bool = false
// 港澳通信证
var isHongKongMacouPassport:Bool = false
// 国籍
var nation:String? = ""
/** 居住信息 **/
// 是否与主申请人同住
var isLiveTogether:Bool = false
// 现居住国家
var liveContry:String? = ""
// 现居住城市
var liveCity:String? = ""
// 现居住详细地址
var liveAddress:String? = ""
var title:String {
return getTitle()
}
init(type: YHTableSubItemType, isMust:Bool = true) {
self.type = type
self.isMust = isMust
}
func getTitle()-> String {
switch self.type {
case .subTitle:
return "".local
case .subAcompany:
return "是否随行至香港".local
case .subCountry:
return "国家/地区".local
case .subIsLiveTogether:
return "是否与主申请人同住".local
case .subLiveNation:
return "国家/地区".local
case .subLiveCity:
return "现居住城市".local
case .subDetailAddress:
return "现居住地址".local
case .subHongkongMacaouPassport:
return "是否办理".local
}
}
}
......@@ -9,28 +9,182 @@
import UIKit
import SmartCodable
enum YHFamilyMemberItemType:Int {
protocol YHFormItemProtocol {
func getTitle() -> String
func getSubTitle() -> String
}
// 表单标题类型
enum YHFormTitleItemType:Int {
// 配偶
case sponse = 1
// 父母
case parent = 2
// 子女
case child = 3
// 兄弟姐妹
case brother = 4
case addChild = 5
case addBrother = 6
// 随行
case accompany = 5
// 国籍
case country = 6
// 居住信息
case liveInfo = 7
// 港澳通信证
case hkAndMacaoPassport = 8
// 中国身份证
case chinaIdCardInfo = 9
// 护照
case passPortInfo = 10
// 配偶信息
case spouseInfo = 11
// 职业信息
case occupationInfo = 12
// 学历学位信息
case degreeInfo = 13
// 在港信息
case inHongKongInfo = 14
// 香港身份证
case hkIdentityCardInfo = 15
// 父亲信息
case fatherInfo = 16
// 母亲信息
case motherInfo = 17
// 基本信息
case basicInfo = 18
// 子女信息
case childInfo = 19
// 是否前次婚姻子女
case isPreviousMarriageChild = 20
}
// 表单添加条目类型
enum YHFormAddItemType:Int {
case addChild = 1
case addBrother = 2
case addDegree = 3
}
protocol YHFamilyMemberProtocol {
// 表单具体条目类型
enum YHFormDetailItemType:Int {
func getTitle() -> String
func getSubTitle() -> String
// 是否随行至香港
case isAccompanyToHK = 1
// 是否与主申请人同住
case isLiveTother = 3
// 国家/地区
case nationOrArea = 4
// 现居住城市
case liveCity = 5
// 详细地址
case detailAddress = 6
// 是否办理
case isHandleHKPassPort = 7
// 证件类别
case cetificateType = 8
// 证件号码
case certificateNumber = 9
// 签发日期
case certificateSignDate = 10
// 届满日期
case certificateValidDate = 11
// 签发地
case certificateSignPlace = 12
// 配偶姓名
case spouseName = 13
// 曾用名
case everName = 14
// 婚前姓氏
case befourMarryFirstName = 15
// 出生日期
case birthday = 16
// 出生国家/地区
case birthNation = 17
// 出生城市
case birthCity = 18
// 职业
case occupation = 19
// 职业名称
case occupationName = 20
// 是否拥有学位
case ownDegree = 21
// 目前是否在港
case isNowInHK = 22
// 获准逗留至
case stayHKDate = 23
// 在港身份
case roleInHK = 24
// 是否办理过(香港身份证)
case isHaveHkIdentityCard = 25
// 香港身份证号码
case hkIdentityCardNumber = 26
// 学位信息X
case degreeDetailInfo = 27
// 父亲姓名
case fatherName = 28
// 母亲姓名
case motherName = 29
// 婚姻状况
case marriageState = 30
// 现居住国家/地区
case liveNationOrArea = 31
// 仅有两个按钮 标题数组有外部提供
case onlyDoubleChoice = 32
// 主申请人和现配偶是否拥有孩子抚养权
case ownCustody = 33
// 子女姓名
case childName = 34
// 性别
case gender = 35
// 是否为前次婚姻子女
case isPreviousMarriageChild = 36
}
class YHFamilyMemberFormItem : YHFamilyMemberProtocol {
//添加item
class YHFormAddItem : YHFormItemProtocol
{
var type: YHFormAddItemType
var type: YHFamilyMemberItemType
init(type: YHFormAddItemType) {
self.type = type
}
func getTitle() -> String {
switch self.type {
case .addChild:
return "新增子女".local
case .addBrother:
return "新增兄弟姐妹".local
case .addDegree:
return "增加学位信息".local
}
}
func getSubTitle() -> String {
return ""
}
}
init(type: YHFamilyMemberItemType) {
// 标题item
class YHFormTitleItem : YHFormItemProtocol {
var type: YHFormTitleItemType
init(type: YHFormTitleItemType) {
self.type = type
}
......@@ -44,10 +198,39 @@ class YHFamilyMemberFormItem : YHFamilyMemberProtocol {
return "兄弟姐妹".local
case .child:
return "子女".local
case .addChild:
return "新增子女".local
case .addBrother:
return "新增兄弟姐妹".local
case .accompany:
return "随行".local
case .country:
return "国籍".local
case .liveInfo:
return "居住信息".local
case .hkAndMacaoPassport:
return "港澳通行证".local
case .chinaIdCardInfo:
return "中国身份证".local
case .passPortInfo:
return String(format: "%@(%@)", "护照及其他旅行证件".local, "选填".local)
case .spouseInfo:
return "配偶信息".local
case .occupationInfo:
return "职业信息".local
case .degreeInfo:
return "学历学位信息".local
case .inHongKongInfo:
return "在港信息".local
case .hkIdentityCardInfo:
return "香港身份证".local
case .fatherInfo:
return "父亲信息".local
case .motherInfo:
return "母亲信息".local
case .basicInfo:
return "基本信息".local
case .childInfo:
return "子女信息".local
case .isPreviousMarriageChild:
return "是否前次婚姻子女".local
}
}
......@@ -61,14 +244,174 @@ class YHFamilyMemberFormItem : YHFamilyMemberProtocol {
return String(format: "(%@)", "如无可不填".local)
case .child:
return String(format: "(%@)", "如无可不填".local)
case .addChild:
return ""
case .addBrother:
return ""
case .isPreviousMarriageChild:
return "".local
case .accompany:
return "".local
case .country:
return "".local
case .liveInfo:
return "".local
case .hkAndMacaoPassport:
return "".local
case .chinaIdCardInfo:
return "".local
case .passPortInfo:
return "".local
case .spouseInfo:
return "".local
case .occupationInfo:
return "".local
case .degreeInfo:
return "".local
case .inHongKongInfo:
return "".local
case .hkIdentityCardInfo:
return "".local
case .fatherInfo:
return "".local
case .motherInfo:
return "".local
case .basicInfo:
return "".local
case .childInfo:
return "".local
}
}
}
// 具体item
class YHFormDetailItem : YHFormItemProtocol {
var type: YHFormDetailItemType
// 是否是必填项
var isNeed: Bool = true
// 是否随行
var isAccompany:Bool = false
// 是否办理港澳通信证
var isHandleHkPassport:Bool = false
// 国籍
var country:String? = ""
/** 居住信息 **/
// 是否与主申请人同住
var isLiveTogether:Bool = false
// 现居住国家
var liveContry:String? = ""
// 现居住城市
var liveCity:String? = ""
// 现居住详细地址
var liveAddress:String? = ""
init(type: YHFormDetailItemType, isNeed:Bool = true) {
self.type = type
self.isNeed = isNeed
}
func getTitle() -> String {
switch type {
case .isAccompanyToHK:
return "是否随行至香港".local
case .isLiveTother:
return "是否与主申请人同住".local
case .nationOrArea:
return String(format: "%@/%@", "国家".local, "地区".local)
case .liveCity:
return "现居住城市".local
case .detailAddress:
return "详细地址".local
case .isHandleHKPassPort:
return "是否办理".local
// 证件类别
case .cetificateType:
return "证件类别".local
// 证件号码
case .certificateNumber:
return "中国身份证号".local
// 签发日期
case .certificateSignDate:
return "签发日期".local
// 届满日期
case .certificateValidDate:
return "届满日期".local
case .certificateSignPlace:
return "签发地".local
// 配偶姓名
case .spouseName:
return "配偶姓名".local
// 曾用名
case .everName:
return "曾用名".local
// 婚前姓氏
case .befourMarryFirstName:
return "婚前姓氏".local
// 出生日期
case .birthday:
return "出生日期".local
// 出生国家/地区
case .birthNation:
return "出生国家/地区".local
// 出生城市
case .birthCity:
return "出生城市".local
// 职业
case .occupation:
return "职业".local
// 职业名称
case .occupationName:
return "职业名称".local
// 是否拥有学位
case .ownDegree:
return "是否拥有学位".local
// 目前是否在港
case .isNowInHK:
return "目前是否在港".local
// 获准逗留至
case .stayHKDate:
return "获准逗留至".local
// 在港身份
case .roleInHK:
return "在港身份".local
// 是否办理过(香港身份证)
case .isHaveHkIdentityCard:
return "是否办理过".local
// 香港身份证号码
case .hkIdentityCardNumber:
return "香港身份证号码".local
case .degreeDetailInfo:
return "学位信息X".local
case .fatherName:
return "父亲姓名".local
case .motherName:
return "母亲姓名".local
case .marriageState:
return "婚姻状况".local
case .liveNationOrArea:
return "现居住国家/地区".local
case .ownCustody:
return "主申请人和现配偶是否拥有孩子抚养权".local
case .childName:
return "子女姓名".local
case .gender:
return "性别".local
case .isPreviousMarriageChild:
return "是否前次婚姻子女".local
case .onlyDoubleChoice:
return "".local
}
}
func getSubTitle() -> String {
return ""
}
}
/* ***** ***** ***** ***** ***** ***** ***** ***** */
// MARK: - YHWelcome
......@@ -112,7 +455,7 @@ class YHFamilyMemberInfo: SmartCodable {
}
// MARK: - 子女初始信息 YHChild
class YHChild: SmartCodable, YHFamilyMemberProtocol {
class YHChild: SmartCodable, YHFormItemProtocol {
var id: Int = -1
var deceased: Int = -1
......@@ -209,7 +552,7 @@ class YHChild: SmartCodable, YHFamilyMemberProtocol {
}
// MARK: - YHBrother
class YHBrother: SmartCodable, YHFamilyMemberProtocol {
class YHBrother: SmartCodable, YHFormItemProtocol {
var id: Int? = -1
var deceased: Int? = -1
var custody: Int? = -1
......@@ -354,7 +697,7 @@ class YHSubsetNamePinyin: SmartCodable {
}
// MARK: - 父母信息 YHParent
class YHParent: SmartCodable, YHFamilyMemberProtocol {
class YHParent: SmartCodable, YHFormItemProtocol {
var id: Int = -1
var deceased: Int = -1
var custody: Int = -1
......@@ -451,7 +794,7 @@ class YHParent: SmartCodable, YHFamilyMemberProtocol {
}
// MARK: - 配偶 YHSpouse
class YHSpouse: SmartCodable, YHFamilyMemberProtocol {
class YHSpouse: SmartCodable, YHFormItemProtocol {
var id: Int = -1
var deceased: Int = -1
var custody: Int = -1
......
......@@ -8,9 +8,9 @@
import UIKit
class YHFormAddInfoCell: UITableViewCell {
class YHFormItemAddCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormAddInfoCell"
static let cellReuseIdentifier = "YHFormItemAddCell"
let btnTitleColor = UIColor(hexString:"#4388FF")
let btnHeight = 44.0
......@@ -18,9 +18,19 @@ class YHFormAddInfoCell: UITableViewCell {
var clickBlock:(()->Void)?
var title:String? {
didSet {
addBtn.setTitle(title, for: .normal)
}
}
lazy var addBtn: UIButton = {
let btn = UIButton.bs_button(title: "新增信息", font: UIFont.PFSCR(ofSize: 14), normalColor: btnTitleColor)
btn.iconInLeft(spacing: 10)
let btn = UIButton()
btn.setTitle("新增信息".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(btnTitleColor, for: .normal)
btn.iconInLeft(spacing: 6)
btn.setImage(UIImage(named: "form_add_info"), for: .normal)
btn.addTarget(self, action: #selector(didClickAddBtn), for: .touchUpInside)
return btn
......
//
// YHFormItemDegreeInfoCell.swift
// galaxy
//
// Created by edy on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFormItemDegreeInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormItemDegreeInfoCell"
var deleteBlock: (()->Void)?
var title:String? {
didSet {
if let title = title {
let str = "*"+title
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
titleLabel.attributedText = questionAttrStr
}
}
}
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 16)
return label
}()
lazy var deleteButton: UIButton = {
let btn = UIButton()
btn.setTitle("删除", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0xF81D22), for: .normal)
btn.addTarget(self, action: #selector(didClickDeleteBtn(btn:)), for: .touchUpInside)
// btn.isHidden = true
return btn
}()
lazy var degreeView:HKDegreeInfoItemView = {
let view = HKDegreeInfoItemView(frame: .zero)
return view
}()
lazy var areaView:HKDegreeInfoItemView = {
let view = HKDegreeInfoItemView(frame: .zero)
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.addSubview(titleLabel)
contentView.addSubview(deleteButton)
contentView.addSubview(degreeView)
contentView.addSubview(areaView)
titleLabel.text = "学位信息"
titleLabel.snp.makeConstraints { make in
make.height.equalTo(52)
make.top.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.right.equalTo(deleteButton.snp.left)
}
deleteButton.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 64, height: 52))
make.centerY.equalTo(titleLabel)
make.right.equalToSuperview()
}
degreeView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(titleLabel.snp.bottom)
make.height.equalTo(52)
}
areaView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(degreeView.snp.bottom)
make.height.equalTo(52)
make.bottom.equalToSuperview()
}
}
@objc func didClickDeleteBtn(btn:UIButton) {
if let deleteBlock = deleteBlock {
deleteBlock()
}
}
}
class HKDegreeInfoItemView: UIView {
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.isHidden = true
return label
}()
private lazy var tipsLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#C0C0C0")
label.text = "请选择".local
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.isHidden = false
return label
}()
lazy var arrowImgView: UIImageView = {
let imgView = UIImageView(image: UIImage(named: "form_right_arrow"))
return imgView
}()
lazy var topLineView:UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xF0F0F0)
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
func createUI() {
self.addSubview(titleLabel)
self.addSubview(detailLabel)
self.addSubview(tipsLabel)
self.addSubview(arrowImgView)
self.addSubview(topLineView)
titleLabel.text = "XXXXXX"
detailLabel.text = "xxxxxxxx"
topLineView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.top.equalToSuperview()
make.height.equalTo(1.0)
}
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalTo(detailLabel.snp.left).offset(-8)
make.width.equalTo(120)
make.centerY.equalToSuperview()
}
detailLabel.snp.makeConstraints { make in
make.right.equalTo(arrowImgView.snp.left)
make.centerY.equalToSuperview()
}
tipsLabel.snp.makeConstraints { make in
make.edges.equalTo(detailLabel)
}
arrowImgView.snp.makeConstraints { make in
make.size.equalTo(CGSizeMake(20, 20))
make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview()
}
}
}
......@@ -8,36 +8,79 @@
import UIKit
class YHDoubleChoiceFormCell: UITableViewCell {
// 选择项
class YHFormChoiceItem {
static let cellReuseIdentifier = "YHDoubleChoiceFormCell"
var title:String
// 是否被选中
var isSelect:Bool
init(title: String, isSelect: Bool) {
self.title = title
self.isSelect = isSelect
}
}
class YHFormItemDoubleChoiceCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormItemDoubleChoiceCell"
let btnWidth = 70.0
let btnHeight = 32.0
let btnTitleSelectColor = UIColor(hex: 0x4487F9)
let btnTitleDefaultColor = UIColor(hex:0x222222)
let btnBgColor = UIColor(hex:0xF8F9FB)
let confirmTag = 9527
let negativeTag = 9528
let btnBgDefaultColor = UIColor(hex:0xF8F9FB)
let btnBgSelectColor = UIColor(hex:0x4487F9, alpha: 0.08)
let answerBaseTag = 9527
var answerBlock:(([YHFormChoiceItem], Int)->Void)?
var question:String? {
var title:String? {
didSet {
if let question = question {
if let question = title {
let str = "*"+question
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSCR(ofSize: 14),
.font: UIFont.PingFangScR(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
questionLabel.attributedText = questionAttrStr
titleLabel.attributedText = questionAttrStr
}
}
}
lazy var questionLabel: UILabel = {
// 必须传2个item的arr
var answerArr:[YHFormChoiceItem]? {
didSet {
if let answerArr = answerArr, answerArr.count == 2 {
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
let item = answerArr[i]
answerBtn.setTitle(item.title, for: .normal)
updateAnswerButton(answerBtn, item.isSelect)
}
} else {
// 重置所有答案状态
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
answerBtn.setTitle("", for: .normal)
updateAnswerButton(answerBtn, false)
}
}
}
}
// 更新答案按钮选中状态
func updateAnswerButton(_ btn:UIButton, _ isSelect:Bool) {
btn.layer.borderColor = (isSelect ? btnTitleSelectColor : .clear).cgColor
btn.setTitleColor((isSelect ? btnTitleSelectColor : btnTitleDefaultColor), for: .normal)
btn.backgroundColor = (isSelect ? btnBgSelectColor : btnBgDefaultColor)
}
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
......@@ -46,24 +89,33 @@ class YHDoubleChoiceFormCell: UITableViewCell {
return label
}()
lazy var confirmBtn: UIButton = {
let btn = UIButton.bs_button(title: "是".local, font: UIFont.PFSCR(ofSize: 14), normalColor: btnTitleDefaultColor)
btn.backgroundColor = btnBgColor
lazy var answer1Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.tag = confirmTag
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
lazy var negativeBtn: UIButton = {
let btn = UIButton.bs_button(title: "否".local, font: UIFont.PFSCR(ofSize: 14), normalColor: btnTitleDefaultColor)
btn.backgroundColor = btnBgColor
lazy var answer2Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.tag = negativeTag
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag+1
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
......@@ -82,42 +134,45 @@ class YHDoubleChoiceFormCell: UITableViewCell {
self.selectionStyle = .none
question = " 1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪? "
title = " 1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪? "
contentView.addSubview(questionLabel)
contentView.addSubview(negativeBtn)
contentView.addSubview(confirmBtn)
// 默认选择否按钮
didClickResponseBtn(btn: negativeBtn)
contentView.addSubview(titleLabel)
contentView.addSubview(answer2Btn)
contentView.addSubview(answer1Btn)
questionLabel.snp.makeConstraints { make in
titleLabel.snp.makeConstraints { make in
make.top.equalTo(contentView.snp.top).offset(22)
make.left.equalToSuperview().offset(16)
make.right.equalTo(confirmBtn.snp.left).offset(-8)
make.right.equalTo(answer1Btn.snp.left).offset(-8)
make.bottom.equalTo(contentView.snp.bottom).offset(-22)
}
negativeBtn.snp.makeConstraints { make in
answer2Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.right.equalToSuperview().offset(-16)
make.top.equalToSuperview().offset(16)
}
confirmBtn.snp.makeConstraints { make in
answer1Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.right.equalTo(negativeBtn.snp.left).offset(-8)
make.top.equalTo(negativeBtn)
make.right.equalTo(answer2Btn.snp.left).offset(-8)
make.top.equalTo(answer2Btn)
}
}
@objc func didClickResponseBtn(btn: UIButton) {
let isConfirm = (btn.tag == confirmTag)
confirmBtn.layer.borderColor = (isConfirm ? btnTitleSelectColor : .clear).cgColor
confirmBtn.setTitleColor((isConfirm ? btnTitleSelectColor : btnTitleDefaultColor), for: .normal)
negativeBtn.layer.borderColor = (isConfirm ? .clear : btnTitleSelectColor).cgColor
negativeBtn.setTitleColor((isConfirm ? btnTitleDefaultColor: btnTitleSelectColor), for: .normal)
let selectIndex = btn.tag-answerBaseTag
if let resultArr = answerArr, resultArr.count == 2 {
for i in 0...1 {
let item = resultArr[i]
item.isSelect = (i == selectIndex)
}
answerArr = resultArr
if let answerBlock = answerBlock {
answerBlock(resultArr, selectIndex)
}
}
}
}
......@@ -8,9 +8,9 @@
import UIKit
class YHSingleLineSelectCell: UITableViewCell {
class YHFormItemEnterDetailCell: UITableViewCell {
static let cellReuseIdentifier = "YHSingleLineSelectCell"
static let cellReuseIdentifier = "YHFormItemEnterDetailCell"
// 是否必填 如必填title会展示红色*
var isMust = false
......@@ -29,7 +29,7 @@ class YHSingleLineSelectCell: UITableViewCell {
if let title = title {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSCR(ofSize: 14),
.font: UIFont.PingFangScR(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
......@@ -44,19 +44,21 @@ class YHSingleLineSelectCell: UITableViewCell {
lazy var titleLabel: UILabel = {
let label = UILabel()
label.text = "XXXXXXX"
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSCR(ofSize: 14)
label.font = UIFont.PingFangScR(ofSize: 14)
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString:"#333333")
label.text = "XXXXXXX"
label.textColor = UIColor(hexString: "#888F98")
label.textAlignment = .right
label.numberOfLines = 0
label.font = UIFont.PFSCR(ofSize: 14)
label.font = UIFont.PingFangScR(ofSize: 14)
return label
}()
......@@ -66,7 +68,11 @@ class YHSingleLineSelectCell: UITableViewCell {
}()
lazy var deleteButton: UIButton = {
let btn = UIButton.bs_button(title: "删除".local, font: UIFont.PFSCR(ofSize: 14), normalColor: UIColor(hex: 0xF81D22))
let btn = UIButton()
btn.setTitle("删除".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0xF81D22), for: .normal)
btn.addTarget(self, action: #selector(didClickDeleteBtn(btn:)), for: .touchUpInside)
btn.isHidden = true
return btn
......@@ -89,8 +95,6 @@ class YHSingleLineSelectCell: UITableViewCell {
contentView.addSubview(arrowImgView)
contentView.addSubview(deleteButton)
title = "婚姻状况"
detailLabel.text = "沙发上发顺丰"
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalTo(detailLabel.snp.left).offset(-8)
......
//
// YHFormItemExpireDateCell.swift
// galaxy
//
// Created by edy on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFormItemExpireDateCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormItemExpireDateCell"
let longTimeBtnWidth = 40.0
// 是否必填 如必填title会展示红色*
var isMust = false
var clickBlock:(()->Void)?
var title:String? {
didSet {
if let title = title {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
if isMust {
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
}
titleLabel.attributedText = questionAttrStr
}
}
}
var isLontTime:Bool = false {
didSet {
updateUI()
}
}
var tips:String? {
didSet {
tipsLabel.text = tips
}
}
var detail:String? {
didSet {
detailLabel.text = detail
if let detail = detail, !detail.isEmpty {
tipsLabel.isHidden = true
detailLabel.isHidden = false
} else {
tipsLabel.isHidden = false
detailLabel.isHidden = true
}
}
}
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
return label
}()
private lazy var detailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.isHidden = true
return label
}()
private lazy var tipsLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#C0C0C0")
label.text = "请选择".local
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.isHidden = false
return label
}()
lazy var longTimeBtn: UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("长期".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x222222), for: .normal)
btn.iconInLeft(spacing: 6)
btn.setImage(UIImage(named: "form_square_unselect"), for: .normal)
btn.setImage(UIImage(named: "form_square_select"), for: .selected)
btn.addTarget(self, action: #selector(didClickLongTimeBtn), for: .touchUpInside)
return btn
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.addSubview(titleLabel)
contentView.addSubview(detailLabel)
contentView.addSubview(tipsLabel)
contentView.addSubview(longTimeBtn)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalTo(detailLabel.snp.left).offset(-6)
make.width.equalTo(120)
make.centerY.equalToSuperview()
}
detailLabel.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-longTimeBtnWidth-16-6)
make.centerY.equalToSuperview()
}
tipsLabel.snp.makeConstraints { make in
make.edges.equalTo(detailLabel)
}
longTimeBtn.snp.makeConstraints { make in
make.size.equalTo(CGSizeMake(longTimeBtnWidth, 40))
make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview()
}
}
func updateUI() {
detailLabel.isHidden = isLontTime
tipsLabel.isHidden = isLontTime
longTimeBtn.snp.remakeConstraints { make in
make.size.equalTo(CGSizeMake(longTimeBtnWidth, 40))
make.centerY.equalToSuperview()
if isLontTime {
make.left.equalTo(detailLabel)
} else {
make.right.equalToSuperview().offset(-16)
}
}
}
@objc func didClickLongTimeBtn() {
longTimeBtn.isSelected = !longTimeBtn.isSelected
isLontTime = longTimeBtn.isSelected
if let clickBlock = clickBlock {
clickBlock()
}
}
}
......@@ -8,9 +8,9 @@
import UIKit
class YHSingleLineInputCell: UITableViewCell {
class YHFormItemInputTextCell: UITableViewCell {
static let cellReuseIdentifier = "YHSingleLineInputCell"
static let cellReuseIdentifier = "YHFormItemInputTextCell"
// 是否必填 如必填title会展示红色*
var isMust = false
......@@ -21,10 +21,10 @@ class YHSingleLineInputCell: UITableViewCell {
if let title = title {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSCR(ofSize: 14),
.font: UIFont.PingFangScR(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
var questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
if isMust {
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
......@@ -40,7 +40,7 @@ class YHSingleLineInputCell: UITableViewCell {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSCR(ofSize: 14)
label.font = UIFont.PingFangScR(ofSize: 14)
return label
}()
......@@ -48,7 +48,7 @@ class YHSingleLineInputCell: UITableViewCell {
let textField = UITextField()
textField.backgroundColor = .clear
textField.placeholder = "请如实填写"
textField.font = UIFont.PFSCR(ofSize: 14)
textField.font = UIFont.PingFangScR(ofSize: 14)
textField.tintColor = UIColor(hex: 0xC0C0C0)
textField.textColor = UIColor(hex: 0x222222)
// textField.delegate = self
......@@ -72,17 +72,17 @@ class YHSingleLineInputCell: UITableViewCell {
contentView.addSubview(textField)
isMust = true
title = "曾用名"
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalTo(textField.snp.left).offset(-8)
make.width.equalTo(120)
make.centerY.equalToSuperview()
}
textField.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(contentView.snp.right).offset(-16)
make.left.equalTo(titleLabel.snp.right).offset(10)
}
}
......
//
// YHFormItemOnlyDoubleChoiceCell.swift
// galaxy
//
// Created by edy on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFormItemOnlyDoubleChoiceCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormItemOnlyDoubleChoiceCell"
let btnWidth = 70.0
let btnHeight = 32.0
let btnTitleSelectColor = UIColor(hex: 0x4487F9)
let btnTitleDefaultColor = UIColor(hex:0x222222)
let btnBgDefaultColor = UIColor(hex:0xF8F9FB)
let btnBgSelectColor = UIColor(hex:0x4487F9, alpha: 0.08)
let answerBaseTag = 9527
var answerBlock:(([YHFormChoiceItem], Int)->Void)?
// 必须传2个item的arr
var answerArr:[YHFormChoiceItem]? {
didSet {
if let answerArr = answerArr, answerArr.count == 2 {
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
let item = answerArr[i]
answerBtn.setTitle(item.title, for: .normal)
updateAnswerButton(answerBtn, item.isSelect)
}
} else {
// 重置所有答案状态
for i in 0...1 {
let answerBtn = self.viewWithTag(answerBaseTag+i) as! UIButton
answerBtn.setTitle("", for: .normal)
updateAnswerButton(answerBtn, false)
}
}
}
}
// 更新答案按钮选中状态
func updateAnswerButton(_ btn:UIButton, _ isSelect:Bool) {
btn.layer.borderColor = (isSelect ? btnTitleSelectColor : .clear).cgColor
btn.setTitleColor((isSelect ? btnTitleSelectColor : btnTitleDefaultColor), for: .normal)
btn.backgroundColor = (isSelect ? btnBgSelectColor : btnBgDefaultColor)
}
lazy var answer1Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
lazy var answer2Btn: UIButton = {
let btn = UIButton()
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgDefaultColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
btn.layer.borderWidth = 1
btn.layer.borderColor = UIColor.clear.cgColor
btn.tag = answerBaseTag+1
btn.addTarget(self, action: #selector(didClickResponseBtn(btn:)), for: .touchUpInside)
return btn
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.addSubview(answer1Btn)
contentView.addSubview(answer2Btn)
answer1Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalToSuperview().offset(16)
make.centerY.equalToSuperview()
}
answer2Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalTo(answer1Btn.snp.right).offset(10)
make.centerY.equalTo(answer1Btn)
}
}
@objc func didClickResponseBtn(btn: UIButton) {
let selectIndex = btn.tag-answerBaseTag
if let resultArr = answerArr, resultArr.count == 2 {
for i in 0...1 {
let item = resultArr[i]
item.isSelect = (i == selectIndex)
}
answerArr = resultArr
if let answerBlock = answerBlock {
answerBlock(resultArr, selectIndex)
}
}
}
}
......@@ -9,9 +9,11 @@
import UIKit
class YHDoubleChoiceQuestionCell: UITableViewCell {
class YHFormItemQuestionCell: UITableViewCell {
static let cellReuseIdentifier = "YHDoubleChoiceQuestionCell"
static let cellReuseIdentifier = "YHFormItemQuestionCell"
let btnWidth = 70.0
let btnHeight = 32.0
let btnTitleSelectColor = UIColor(hex: 0x4487F9)
......@@ -20,37 +22,46 @@ class YHDoubleChoiceQuestionCell: UITableViewCell {
let confirmTag = 9527
let negativeTag = 9528
var question:String? {
didSet {
var responseBlock:((Bool)->Void)?
var title:String? {
didSet {
if let question = question {
if let question = title {
let str = "*"+question
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSCR(ofSize: 14),
.font: UIFont.PingFangScR(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
questionLabel.attributedText = questionAttrStr
titleLabel.attributedText = questionAttrStr
}
}
}
var selectBlock:((Bool) ->Void)?
var response:Bool = false {
didSet {
showResponse(response)
}
}
lazy var questionLabel: UILabel = {
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.font = UIFont.PFSCR(ofSize: 14)
label.font = UIFont.PingFangScR(ofSize: 14)
return label
}()
lazy var confirmBtn: UIButton = {
let btn = UIButton.bs_button(title: "是".local, font: UIFont.PFSCR(ofSize: 14), normalColor: btnTitleDefaultColor)
let btn = UIButton()
btn.setTitle("是".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
......@@ -61,7 +72,10 @@ class YHDoubleChoiceQuestionCell: UITableViewCell {
}()
lazy var negativeBtn: UIButton = {
let btn = UIButton.bs_button(title: "否".local, font: UIFont.PFSCR(ofSize: 14), normalColor: btnTitleDefaultColor)
let btn = UIButton()
btn.setTitle("否".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgColor
btn.layer.cornerRadius = btnHeight/2.0
btn.layer.masksToBounds = true
......@@ -84,14 +98,14 @@ class YHDoubleChoiceQuestionCell: UITableViewCell {
self.selectionStyle = .none
question = " 1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪? "
contentView.addSubview(questionLabel)
title = " 1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪? "
contentView.addSubview(titleLabel)
contentView.addSubview(negativeBtn)
contentView.addSubview(confirmBtn)
// 默认选择否按钮
didClickResponseBtn(btn: negativeBtn)
response = false
questionLabel.snp.makeConstraints { make in
titleLabel.snp.makeConstraints { make in
make.top.equalTo(contentView.snp.top).offset(12)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
......@@ -99,8 +113,8 @@ class YHDoubleChoiceQuestionCell: UITableViewCell {
negativeBtn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalTo(questionLabel)
make.top.equalTo(questionLabel.snp.bottom).offset(12)
make.left.equalTo(titleLabel)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.bottom.equalToSuperview().offset(-16)
}
......@@ -112,12 +126,16 @@ class YHDoubleChoiceQuestionCell: UITableViewCell {
}
@objc func didClickResponseBtn(btn: UIButton) {
let isConfirm = (btn.tag == confirmTag)
response = (btn.tag == confirmTag)
if let responseBlock = responseBlock {
responseBlock(btn.tag==confirmTag)
}
}
func showResponse(_ isConfirm: Bool) {
confirmBtn.layer.borderColor = (isConfirm ? btnTitleSelectColor : .clear).cgColor
confirmBtn.setTitleColor((isConfirm ? btnTitleSelectColor : btnTitleDefaultColor), for: .normal)
negativeBtn.layer.borderColor = (isConfirm ? .clear : btnTitleSelectColor).cgColor
negativeBtn.setTitleColor((isConfirm ? btnTitleDefaultColor: btnTitleSelectColor), for: .normal)
}
}
//
// YHSheetSelectCell.swift
// galaxy
//
// Created by edy on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFormItemSelectSheetCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormItemSelectSheetCell"
// 是否必填 如必填title会展示红色*
var isMust = false
var title:String? {
didSet {
if let title = title {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PingFangScR(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
if isMust {
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
}
titleLabel.attributedText = questionAttrStr
}
}
}
var tips:String? {
didSet {
tipsLabel.text = tips
}
}
var detail:String? {
didSet {
detailLabel.text = detail
if let detail = detail, !detail.isEmpty {
tipsLabel.isHidden = true
detailLabel.isHidden = false
} else {
tipsLabel.isHidden = false
detailLabel.isHidden = true
}
}
}
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PingFangScR(ofSize: 14)
return label
}()
private lazy var detailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#222222")
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.isHidden = true
return label
}()
private lazy var tipsLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#C0C0C0")
label.text = "请选择".local
label.textAlignment = .left
label.font = UIFont.PingFangScR(ofSize: 14)
label.isHidden = false
return label
}()
lazy var arrowImgView: UIImageView = {
let imgView = UIImageView(image: UIImage(named: "form_right_arrow"))
return imgView
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.addSubview(titleLabel)
contentView.addSubview(detailLabel)
contentView.addSubview(tipsLabel)
contentView.addSubview(arrowImgView)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalTo(detailLabel.snp.left).offset(-8)
make.width.equalTo(120)
make.centerY.equalToSuperview()
}
detailLabel.snp.makeConstraints { make in
make.right.equalTo(arrowImgView.snp.left)
make.centerY.equalToSuperview()
}
tipsLabel.snp.makeConstraints { make in
make.edges.equalTo(detailLabel)
}
arrowImgView.snp.makeConstraints { make in
make.size.equalTo(CGSizeMake(20, 20))
make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview()
}
}
}
......@@ -8,13 +8,13 @@
import UIKit
class YHFormTitleCell: UITableViewCell {
class YHFormItemTitleCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormTitleCell"
static let cellReuseIdentifier = "YHFormItemTitleCell"
let editTag = 9527
let cancelTag = 9528
var rightClickBlock:((YHFamilyMemberEditType)->Void)?
var rightClickBlock:((YHFormTitleItemEditType)->Void)?
lazy var titleLabel: UILabel = {
......@@ -22,7 +22,7 @@ class YHFormTitleCell: UITableViewCell {
label.textColor = UIColor(hexString:"#333333")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSCR(ofSize: 16)
label.font = UIFont.PingFangScR(ofSize: 16)
return label
}()
......@@ -31,12 +31,16 @@ class YHFormTitleCell: UITableViewCell {
label.textColor = UIColor(hexString:"#888F98")
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSCR(ofSize: 14)
label.font = UIFont.PingFangScR(ofSize: 14)
return label
}()
lazy var cancelButton: UIButton = {
let btn = UIButton.bs_button(title: "取消操作".local, font: UIFont.PFSCR(ofSize: 14), normalColor: UIColor(hex: 0x4487F9))
let btn = UIButton()
btn.setTitle("取消操作".local, for: .normal)
btn.titleLabel?.font = UIFont.PingFangScR(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x4487F9), for: .normal)
btn.tag = cancelTag
btn.addTarget(self, action: #selector(didClickOperatorBtn(btn:)), for: .touchUpInside)
btn.isHidden = true
......@@ -111,7 +115,7 @@ class YHFormTitleCell: UITableViewCell {
}
}
func showEditType(type: YHFamilyMemberEditType) {
func showEditType(type: YHFormTitleItemEditType) {
switch type {
case .none:
cancelButton.isHidden = true
......
......@@ -41,14 +41,14 @@ class YHContractCell: UITableViewCell {
let lable = UILabel()
lable.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable.font = kFont(name: "PingFangSC-Medium", size: 17)
lable.text = "香港优秀人才计划-张先生"
lable.text = ""
return lable
}()
lazy var contractIdLable = {
let lable = UILabel()
lable.font = kFont(name: "PingFangSC-Medium", size: 17)
lable.text = "订单号:10936"
lable.text = ""
lable.textColor = UIColor(red: 0.533, green: 0.561, blue: 0.596, alpha: 1)
lable.font = kFont(name: "PingFangSC-Regular", size: 12)
return lable
......@@ -64,7 +64,8 @@ class YHContractCell: UITableViewCell {
extension YHContractCell {
func updateUI() {
contractNameLable.text = dataModel?.productName ?? "-"
contractIdLable.text = dataModel?.orderSn ?? "-"
let str = "订单号:" + (dataModel?.id ?? "-")
contractIdLable.text = str
}
func setupUI() {
......
......@@ -14,7 +14,7 @@ class YHContractMainItemStatusCell: UITableViewCell {
static let cellReuseIdentifier = "YHContractMainItemStatusCell"
static let cellHeight :CGFloat = 97.0
var dataModel : YHContactItemModel? {
var dataModel : YHContactMainItemStatusModel? {
didSet {
updateUI()
}
......@@ -39,7 +39,7 @@ class YHContractMainItemStatusCell: UITableViewCell {
private lazy var iconImageV : UIImageView = {
let nextImgV = UIImageView()
nextImgV.image = UIImage(named: "service_center_finish_info_icon")
nextImgV.image = UIImage(named: "service_center_sfsq_xxws_icon")
nextImgV.contentMode = .scaleAspectFill
return nextImgV
}()
......@@ -89,8 +89,11 @@ class YHContractMainItemStatusCell: UITableViewCell {
extension YHContractMainItemStatusCell {
func updateUI() {
// contractNameLable.text = dataModel?.productName ?? "-"
// contractIdLable.text = dataModel?.orderSn ?? "-"
iconImageV.image = UIImage(named: dataModel?.iconName ?? "")
itemNameLable.text = dataModel?.itemName ?? ""
gofinishHoldView.isHidden = !(dataModel?.isFinished ?? false)
goUnfinishHoldView.isHidden = dataModel?.isFinished ?? false
}
func setupUI() {
......@@ -134,7 +137,6 @@ extension YHContractMainItemStatusCell {
make.height.equalTo(34)
make.width.equalTo(76)
}
// goUnfinishHoldView.isHidden = true
gofinishHoldView.isHidden = true
......
//
// YHInformationFillTipsAlertView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
//import AttributedString
class YHInformationFillTipsAlertView: UIView {
typealias Block = (Bool) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
//头部背景图片
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "submit_success_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
//头部背景图片
lazy var successIcon: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "submit_success_icon")
imagV.contentMode = .scaleAspectFill
return imagV
}()
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .plain)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = true
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
// tableView.estimatedRowHeight = 100
tableView.register(YHInformationFillTipsCell.self,forCellReuseIdentifier: YHInformationFillTipsCell.cellReuseIdentifier)
return tableView
}()
//类方法
static func showCheckView(callBack: @escaping Block) {
let view = YHInformationFillTipsAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.block = callBack
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
// let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
// tap.delegate = self
// addGestureRecognizer(tap)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
return view
}()
addSubview(centerView)
let viewH = KScreenHeight > 680 ? 680 : (KScreenHeight - 64)
centerView.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(viewH)
}
let bottomView = UIView()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
}
let checkBtn = UIButton(type: .custom)
checkBtn.setBackgroundImage(UIImage.from(color: UIColor(hex:0x4D9FF8)), for: .normal)
checkBtn.setTitle("准备完毕", for: .normal)
checkBtn.setTitleColor(.white, for: .normal)
checkBtn.addTarget(self, action: #selector(onClickReadyBtn), for: .touchUpInside)
checkBtn.layer.cornerRadius = 8
checkBtn.clipsToBounds = true
bottomView.addSubview(checkBtn)
checkBtn.snp.makeConstraints { make in
make.bottom.equalToSuperview().offset(-40)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(48)
}
let lable00 = UILabel(text: "我确认我所提供的材料真实有效,并知悉其中内容。")
lable00.font = kFont(size: 12)
lable00.textColor = UIColor(red: 0.533, green: 0.561, blue: 0.596, alpha: 1)
let tap = UITapGestureRecognizer(target: self, action: #selector(onClickAgree))
lable00.isUserInteractionEnabled = true
lable00.addGestureRecognizer(tap)
bottomView.addSubview(lable00)
lable00.snp.makeConstraints { make in
make.bottom.equalTo(checkBtn.snp.top).offset(-14)
make.left.equalTo(41)
make.right.equalTo(-16)
make.height.equalTo(20)
make.top.equalTo(16)
}
let selectedBtn = UIButton(type: .custom)
selectedBtn.setImage(UIImage(named: "selected_icon_0"), for: .normal)
selectedBtn.setImage(UIImage(named: "selected_icon_1"), for: .selected)
selectedBtn.addTarget(self, action: #selector(onClickAgree), for: .touchUpInside)
bottomView.addSubview(selectedBtn)
selectedBtn.snp.makeConstraints { make in
make.centerY.equalTo(lable00)
make.left.equalTo(21)
make.height.width.equalTo(12)
}
agreeButton = selectedBtn
let topView = UIView()
centerView.addSubview(topView)
topView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
}
let lable01 = UILabel(text: "信息填写提示")
lable01.font = UIFont.PingFangScB(ofSize: 18)
lable01.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
topView.addSubview(lable01)
lable01.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.top.equalTo(16)
make.height.equalTo(24)
}
let line = UIView()
line.backgroundColor = UIColor(red: 0.941, green: 0.941, blue: 0.941, alpha: 1)
topView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.top.equalTo(lable01.snp.bottom).offset(12)
make.height.equalTo(0.5)
make.bottom.equalToSuperview()
}
//middle view
let middleView = UIView()
centerView.addSubview(middleView)
middleView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(topView.snp.bottom).offset(-20)
make.bottom.equalTo(bottomView.snp.top)
}
middleView.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.edges.equalTo(0)
}
homeTableView.delegate = self
homeTableView.dataSource = self
}
@objc func onClickReadyBtn() {
if agreeButton.isSelected == true {
block?(true)
dismiss()
} else {
YHHUD.flash(message: "请先勾选确认知悉内容")
}
}
@objc func onClickAgree() {
agreeButton.isSelected = !agreeButton.isSelected
}
@objc func agree() {
block?(true)
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func disagree() {
block?(false)
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHInformationFillTipsAlertView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHInformationFillTipsAlertView : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
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 UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHInformationFillTipsCell.self)
cell.selectionStyle = .none
return cell
}
}
//
// YHInformationFillTipsCell.swift
// galaxy
//
// Created by davidhuangA on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHInformationFillTipsCell: UITableViewCell {
static let cellReuseIdentifier = "YHInformationFillTipsCell"
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
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")
}
}
extension YHInformationFillTipsCell {
func setupUI() {
let holdView = UIView()
holdView.backgroundColor = .clear
backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(21)
make.right.equalTo(-21)
}
//添加元素
let lable0 = UILabel(text: " 您好!欢迎来到香港优才申请系统,请按照实际情况填写。")
lable0.font = kFont(size: 14)
lable0.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable0.numberOfLines = 0
lable0.lineBreakMode = .byWordWrapping
holdView.addSubview(lable0)
lable0.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.right.equalToSuperview()
}
let lable1 = UILabel(text: " 1. 如您填写途中想离开系统,记得点击保存,在您有空闲的时间再继续进行填写;")
lable1.font = UIFont.PingFangScR(ofSize: 14)
lable1.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable1.numberOfLines = 0
lable1.lineBreakMode = .byWordWrapping
let a: ASAttributedString = .init(" 1. 如您填写途中想离开系统,", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
let b: ASAttributedString = .init("记得点击保存", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(hex:0x3271F5)))
let c: ASAttributedString = .init(",在您有空闲的时间再继续进行填写;", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
lable1.attributed.text = a + b + c
holdView.addSubview(lable1)
lable1.snp.makeConstraints { make in
make.top.equalTo(lable0.snp.bottom).offset(12)
make.left.right.equalToSuperview()
}
let lable2 = UILabel(text: " 2. 此次填写将花费您30-40分钟,系统将根据您所填写的信息,形成详细资料清单,一起为香港身份起航吧~")
lable2.font = UIFont.PingFangScR(ofSize: 14)
lable2.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable2.numberOfLines = 0
lable2.lineBreakMode = .byWordWrapping
let aa: ASAttributedString = .init(" 2. 此次填写将花费您", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
let bb: ASAttributedString = .init("30-40分钟", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(hex:0x3271F5)))
let cc: ASAttributedString = .init(",系统将根据您所填写的信息,形成详细资料清单,一起为香港身份起航吧~", .font(UIFont.PingFangScR(ofSize: 14)),.foreground(UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)))
lable2.attributed.text = aa + bb + cc
holdView.addSubview(lable2)
lable2.snp.makeConstraints { make in
make.top.equalTo(lable1.snp.bottom).offset(12)
make.left.right.equalToSuperview()
// make.bottom.equalToSuperview().offset(-16)//for test hjl
}
let holdView2 = UIView()
holdView2.backgroundColor = UIColor(red: 0.973, green: 0.976, blue: 0.984, alpha: 1)
holdView2.layer.cornerRadius = 8
holdView2.clipsToBounds = true
holdView.addSubview(holdView2)
holdView2.snp.makeConstraints { make in
make.top.equalTo(lable2.snp.bottom).offset(12)
make.left.right.equalToSuperview()
}
let view0 = UIView()
view0.backgroundColor = UIColor(red: 0.196, green: 0.443, blue: 0.961, alpha: 1)
holdView2.addSubview(view0)
view0.snp.makeConstraints { make in
make.top.equalTo(15.5)
make.left.equalToSuperview()
make.width.equalTo(4)
make.height.equalTo(14)
}
let lable3 = UILabel(text: "准备材料:")
lable3.font = UIFont.PingFangScM(ofSize: 14)
lable3.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable3)
lable3.snp.makeConstraints { make in
make.centerY.equalTo(view0)
make.left.equalTo(view0.snp.right).offset(12)
make.height.equalTo(20)
make.right.equalTo(-16)
}
let imageV0 = UIImageView()
imageV0.image = UIImage(named: "right_gou")
imageV0.contentMode = .scaleAspectFill
holdView2.addSubview(imageV0)
imageV0.snp.makeConstraints { make in
make.top.equalTo(lable3.snp.bottom).offset(16)
make.left.equalTo(lable3.snp.left)
make.width.height.equalTo(12)
}
let lable4 = UILabel(text: "身份证正反面照片(外国国籍准备护照)")
lable4.font = UIFont.PingFangScR(ofSize: 14)
lable4.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable4)
lable4.snp.makeConstraints { make in
make.centerY.equalTo(imageV0)
make.left.equalTo(imageV0.snp.right).offset(8)
make.height.equalTo(17)
make.right.equalToSuperview()
}
let imageV1 = UIImageView()
imageV1.image = UIImage(named: "right_gou")
imageV1.contentMode = .scaleAspectFill
holdView2.addSubview(imageV1)
imageV1.snp.makeConstraints { make in
make.top.equalTo(imageV0.snp.bottom).offset(12.5)
make.left.equalTo(imageV0.snp.left)
make.width.height.equalTo(12)
}
let lable5 = UILabel(text: "护照(如有)")
lable5.font = UIFont.PingFangScR(ofSize: 14)
lable5.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable5)
lable5.snp.makeConstraints { make in
make.centerY.equalTo(imageV1)
make.left.equalTo(imageV1.snp.right).offset(8)
make.height.equalTo(17)
make.right.equalToSuperview()
}
let imageV2 = UIImageView()
imageV2.image = UIImage(named: "right_gou")
imageV2.contentMode = .scaleAspectFill
holdView2.addSubview(imageV2)
imageV2.snp.makeConstraints { make in
make.top.equalTo(imageV1.snp.bottom).offset(12.5)
make.left.equalTo(lable3.snp.left)
make.width.height.equalTo(12)
}
let lable6 = UILabel(text: "港澳通行证正反面照片(如有)")
lable6.font = UIFont.PingFangScR(ofSize: 14)
lable6.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable6)
lable6.snp.makeConstraints { make in
make.centerY.equalTo(imageV2)
make.left.equalTo(imageV2.snp.right).offset(8)
make.height.equalTo(17)
make.right.equalToSuperview()
}
let imageV3 = UIImageView()
imageV3.image = UIImage(named: "right_gou")
imageV3.contentMode = .scaleAspectFill
holdView2.addSubview(imageV3)
imageV3.snp.makeConstraints { make in
make.top.equalTo(imageV2.snp.bottom).offset(12.5)
make.left.equalTo(lable3.snp.left)
make.width.height.equalTo(12)
}
let lable7 = UILabel(text: "简历/工作总结")
lable7.font = UIFont.PingFangScR(ofSize: 14)
lable7.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
holdView2.addSubview(lable7)
lable7.snp.makeConstraints { make in
make.centerY.equalTo(imageV3)
make.left.equalTo(imageV3.snp.right).offset(8)
make.height.equalTo(17)
make.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-24)
}
let holdView3 = UIView()
holdView3.backgroundColor = UIColor(red: 0.973, green: 0.976, blue: 0.984, alpha: 1)
holdView3.layer.cornerRadius = 8
holdView3.clipsToBounds = true
holdView.addSubview(holdView3)
holdView3.snp.makeConstraints { make in
make.top.equalTo(holdView2.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-8)//for test hjl
}
let imageV4 = UIImageView()
imageV4.image = UIImage(named: "tips_icon")
imageV4.contentMode = .scaleAspectFill
holdView3.addSubview(imageV4)
imageV4.snp.makeConstraints { make in
make.top.equalTo(14)
make.left.equalTo(16)
make.width.height.equalTo(14)
}
let lable8 = UILabel(text: "温馨提示:")
lable8.font = UIFont.PingFangScR(ofSize: 12)
lable8.textColor = UIColor(red: 0.263, green: 0.533, blue: 1, alpha: 1)
holdView3.addSubview(lable8)
lable8.snp.makeConstraints { make in
make.centerY.equalTo(imageV4)
make.left.equalTo(imageV4.snp.right).offset(8)
make.height.equalTo(17)
make.right.equalToSuperview()
}
let lable9 = UILabel(text: "请确认您所上传的资料真实有效,避免因递交资料存在问题给您造成不便。")
lable9.numberOfLines = 0
lable9.lineBreakMode = .byWordWrapping
lable9.font = UIFont.PingFangScR(ofSize: 12)
lable9.textColor = UIColor(red: 0.263, green: 0.533, blue: 1, alpha: 1)
holdView3.addSubview(lable9)
lable9.snp.makeConstraints { make in
make.top.equalTo(lable8.snp.bottom).offset(7)
make.left.equalTo(imageV4.snp.left)
// make.height.equalTo(28)
make.right.equalToSuperview().offset(-16)
}
let lable10 = UILabel(text: "* 申请过程中有任何疑问,请随时联系专属服务群内的专业文案老师为您解答护航。")
lable10.numberOfLines = 0
lable10.lineBreakMode = .byWordWrapping
lable10.font = UIFont.PingFangScR(ofSize: 12)
lable10.textColor = UIColor(red: 0.533, green: 0.561, blue: 0.596, alpha: 1)
holdView3.addSubview(lable10)
lable10.snp.makeConstraints { make in
make.top.equalTo(lable9.snp.bottom).offset(7)
make.left.equalTo(lable9.snp.left)
make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-18)
}
}
}
//
// YHInformationPerfectCell.swift
// galaxy
//
// Created by davidhuangA on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHInformationPerfectCell: UITableViewCell {
static let cellReuseIdentifier = "YHInformationPerfectCell"
static let cellHeight :CGFloat = 82
var dataModel : YHInformationPerfectModel? {
didSet {
updateUI()
}
}
private lazy var topImagV : UIImageView = {
let nextImgV = UIImageView()
nextImgV.image = UIImage(named: "top_image")
nextImgV.contentMode = .scaleAspectFill
nextImgV.clipsToBounds = true
return nextImgV
}()
private lazy var midImagV : UIImageView = {
let nextImgV = UIImageView()
nextImgV.image = UIImage(named: "mid_image")
nextImgV.contentMode = .scaleAspectFill
nextImgV.clipsToBounds = true
return nextImgV
}()
private lazy var bottomImagV : UIImageView = {
let nextImgV = UIImageView()
nextImgV.image = UIImage(named: "bottom_image")
nextImgV.contentMode = .scaleAspectFill
nextImgV.clipsToBounds = true
return nextImgV
}()
private lazy var itemImagV : UIImageView = {
let nextImgV = UIImageView()
nextImgV.image = UIImage(named: "zsqr_icon")
nextImgV.contentMode = .scaleAspectFill
return nextImgV
}()
private lazy var itemNameLable : UILabel = {
let lable = UILabel()
lable.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable.font = UIFont(name: "PingFangSC-Medium", size: 17)
lable.text = "主申请人信息"
return lable
}()
private lazy var itemStatusLable : UILabel = {
let lable = UILabel()
lable.textColor = UIColor(red: 0.133, green: 0.133, blue: 0.133, alpha: 1)
lable.font = UIFont(name: "PingFangSC-Medium", size: 17)
lable.text = "已完成"
lable.textAlignment = .right
return lable
}()
private lazy var nextImgV : UIImageView = {
let nextImgV = UIImageView()
nextImgV.image = UIImage(named: "service_center_right_next_icon")
nextImgV.contentMode = .scaleAspectFill
return nextImgV
}()
override func awakeFromNib() {
super.awakeFromNib()
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
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")
}
}
extension YHInformationPerfectCell {
func updateUI() {
itemNameLable.text = dataModel?.name
itemNameLable.textColor = dataModel?.color
itemStatusLable.text = dataModel?.status
itemStatusLable.textColor = dataModel?.statusColor
itemImagV.image = UIImage(named: dataModel?.icon ?? "")
//topImagV
if dataModel?.isFirstCell == true {
topImagV.isHidden = true
} else {
topImagV.isHidden = false
if dataModel?.isFinished == true {
topImagV.image = UIImage(named: "top_image")
} else {
if dataModel?.isDoing == true {
topImagV.image = UIImage(named: "top_image")
} else {
topImagV.image = UIImage(named: "bottom_image")
}
}
}
//middle
if dataModel?.isFinished == true {
midImagV.image = UIImage(named: "mid_image")
contentView.layer.opacity = 1.0
} else {
if dataModel?.isDoing == true {
midImagV.image = UIImage(named: "mid_image1")
contentView.layer.opacity = 1.0
} else {
midImagV.image = UIImage(named: "mid_image2")
contentView.layer.opacity = 0.4
}
}
//bottom
if dataModel?.isLastestCell == true {
bottomImagV.isHidden = true
} else {
if dataModel?.isFinished == true {
bottomImagV.image = UIImage(named: "top_image")
} else {
bottomImagV.image = UIImage(named: "bottom_image")
}
}
}
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(midImagV)
midImagV.layer.zPosition = 10
midImagV.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(16)
make.width.height.equalTo(14)
}
contentView.addSubview(topImagV)
topImagV.snp.makeConstraints { make in
make.centerX.equalTo(midImagV)
make.top.equalToSuperview()
make.bottom.equalTo(midImagV.snp.top)
make.width.equalTo(4)
}
contentView.addSubview(bottomImagV)
bottomImagV.snp.makeConstraints { make in
make.centerX.equalTo(midImagV)
make.top.equalTo(midImagV.snp.bottom)
make.width.equalTo(4)
make.bottom.equalToSuperview()
}
let holdView = UIView()
holdView.backgroundColor = .white
holdView.layer.cornerRadius = 12
holdView.clipsToBounds = true
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.height.equalTo(68)
make.right.equalTo(-16)
make.left.equalTo(midImagV.snp.right).offset(16)
}
holdView.addSubview(itemImagV)
itemImagV.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(21)
make.width.height.equalTo(21)
}
holdView.addSubview(nextImgV)
nextImgV.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(-18)
make.width.height.equalTo(16)
}
holdView.addSubview(itemStatusLable)
itemStatusLable.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(nextImgV.snp.left).offset(-4)
make.height.equalTo(20)
}
holdView.addSubview(itemNameLable)
itemNameLable.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(itemStatusLable.snp.left).offset(-10)
make.height.equalTo(20)
make.left.equalTo(itemImagV.snp.right).offset(12)
}
}
}
//
// YHSubmintAllInfoSuccessTipView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHSubmintAllInfoSuccessTipView: UIView {
typealias Block = (Bool) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
//头部背景图片
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "submit_success_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
//头部背景图片
lazy var successIcon: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "submit_success_icon")
imagV.contentMode = .scaleAspectFill
return imagV
}()
static func showCheckView(callBack: @escaping Block) {
let view = YHSubmintAllInfoSuccessTipView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.block = callBack
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(338)
}
centerView.addSubview(headBkgImagV)
headBkgImagV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(159)
}
centerView.addSubview(successIcon)
successIcon.snp.makeConstraints { make in
make.top.equalTo(39)
make.centerX.equalToSuperview()
make.height.width.equalTo(73)
}
let lable = UILabel(text: "提交成功")
lable.textAlignment = .center
lable.font = kFont(name: "PingFangSC-Medium", size: 17)
lable.textColor = UIColor(hex:0x222222)
headBkgImagV.addSubview(lable)
lable.snp.makeConstraints { make in
make.bottom.equalToSuperview().offset(6)
make.left.right.equalToSuperview()
}
let lable2 = UILabel(text: "根据您填写的资料,您的评分如下:")
lable2.textAlignment = .center
lable2.font = kFont(name: "PingFangSC-Medium", size: 14)
lable2.textColor = UIColor(hex:0x222222)
centerView.addSubview(lable2)
lable2.snp.makeConstraints { make in
make.top.equalTo(headBkgImagV.snp.bottom).offset(10)
make.left.right.equalToSuperview()
}
messageLabel = {
let label = UILabel()
label.text = "90分"
label.textAlignment = .center
label.numberOfLines = 1
return label
}()
messageLabel.backgroundColor = .clear//for test hjl
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.top.equalTo(lable2.snp.bottom).offset(10)
make.left.right.equalToSuperview()
make.height.equalTo(50)
}
let a: ASAttributedString = .init("90", .font(UIFont.PingFangScR(ofSize: 32)),.foreground(UIColor(hex:0xFF9900)))
let b: ASAttributedString = .init("分", .font(UIFont.PingFangScR(ofSize: 12)),.foreground(UIColor(hex:0x888F98)))
messageLabel.attributed.text = a + b
disAgressButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("取消", for: .normal)
button.setTitleColor( UIColor(hex:0x3c86f8), for: .normal)
button.layer.cornerRadius = 8
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x3c86f8).cgColor
button.addTarget(self, action: #selector(disagree), for: .touchUpInside)
return button
}()
centerView.addSubview(disAgressButton)
disAgressButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
agreeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x3c86f8)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("评分详情", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 8
button.addTarget(self, action: #selector(agree), for: .touchUpInside)
return button
}()
centerView.addSubview(agreeButton)
agreeButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
}
@objc func agree() {
block?(true)
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func disagree() {
block?(false)
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHSubmintAllInfoSuccessTipView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
//
// YHSubmitAllInfoCheckView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSubmitAllInfoCheckView: UIView {
typealias Block = (Bool) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var messageLabel: UILabel!
var agreeButton: UIButton!
var disAgressButton: UIButton!
static func showCheckView(callBack: @escaping Block) {
let view = YHSubmitAllInfoCheckView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
view.block = callBack
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(165)
}
// titleLabel = {
// let label = UILabel()
// label.text = "同意隐私协议"
// label.font = kFont(size: 16)
// label.textColor = UIColor(hex:0x222222)
// label.textAlignment = .center
// return label
// }()
// centerView.addSubview(titleLabel)
// titleLabel.snp.makeConstraints { make in
// make.left.right.equalToSuperview()
// make.height.equalTo(19)
// make.top.equalTo(27)
// }
messageLabel = {
let label = UILabel()
label.text = "确定是否提交信息?提交后将不能修改"
label.font = kFont(size: 16)
label.textColor = UIColor(hex:0x222222)
label.textAlignment = .left
label.numberOfLines = 0
return label
}()
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(42)
make.top.equalTo(40)
}
disAgressButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xffffff)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("取消", for: .normal)
button.setTitleColor( UIColor(hex:0x3c86f8), for: .normal)
button.layer.cornerRadius = 8
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x3c86f8).cgColor
button.addTarget(self, action: #selector(disagree), for: .touchUpInside)
return button
}()
centerView.addSubview(disAgressButton)
disAgressButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
agreeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x3c86f8)
button.titleLabel?.font = kBoldFont(size: 14)
button.contentHorizontalAlignment = .center
button.setTitle("确认", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 8
button.addTarget(self, action: #selector(agree), for: .touchUpInside)
return button
}()
centerView.addSubview(agreeButton)
agreeButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.bottom.equalTo(-21)
make.width.equalTo(128)
make.height.equalTo(45)
}
}
@objc func agree() {
block?(true)
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
print("处理点击手势")
dismiss()
}
@objc func disagree() {
block?(false)
dismiss()
}
func dismiss() {
removeFromSuperview()
}
}
extension YHSubmitAllInfoCheckView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
//
// YHScoreItemCell.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHScoreItemCell: UITableViewCell {
static let cellReuseIdentifier = "YHScoreItemCell"
// var dataModel : YHContactItemModel? {
// didSet {
//// updateUI()
// }
// }
var optionData : YHScoreSessionModel? {
didSet {
updateUI()
}
}
private lazy var holdView : UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
view.clipsToBounds = true
return view
}()
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
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")
}
var titleView : YHScoreTitleView!
private var scoreOptionsView1 : YHScoreOptionsView!
private var scoreOptionsView2 : YHScoreOptionsView!
private var scoreOptionsView3 : YHScoreOptionsView!
private var scoreOptionsView4 : YHScoreOptionsView!
}
extension YHScoreItemCell {
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.right.left.equalToSuperview()
make.bottom.equalToSuperview().offset(-14)
}
//
let view1 = UIView()
holdView.addSubview(view1)
view1.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
}
titleView = YHScoreTitleView()
holdView.addSubview(titleView)
titleView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(YHScoreTitleView.viewH)
}
let resultView = YHScoreResultView()
holdView.addSubview(resultView)
resultView.snp.makeConstraints { make in
make.top.equalTo(titleView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.height.equalTo(YHScoreTitleView.viewH)
}
scoreOptionsView1 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView1)
scoreOptionsView1.snp.makeConstraints { make in
make.top.equalTo(resultView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView2 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView2)
scoreOptionsView2.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView1.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView3 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView3)
scoreOptionsView3.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView2.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView4 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView4)
scoreOptionsView4.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView3.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.bottom.equalToSuperview()
}
}
func updateUI() {
guard let arrData = optionData?.options else {
return
}
titleView.updateWith(optionData?.name, optionData?.score)
for (index,item) in arrData.enumerated() {
if index == 0 {
scoreOptionsView1.nameLable.text = item.scoreName
} else if index == 1 {
scoreOptionsView2.nameLable.text = item.scoreName
} else if index == 2 {
scoreOptionsView3.nameLable.text = item.scoreName
} else if index == 3 {
scoreOptionsView4.nameLable.text = item.scoreName
}
}
}
}
//
// YHScoreItemCellForAge.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHScoreItemCellForAge: UITableViewCell {
static let cellReuseIdentifier = "YHScoreItemCellForAge"
var optionData : YHScoreSessionModel? {
didSet {
updateUI()
}
}
private lazy var holdView : UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
view.clipsToBounds = true
return view
}()
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
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")
}
var titleView : YHScoreTitleView!
private var scoreOptionsView1 : YHScoreOptionsView!
private var scoreOptionsView2 : YHScoreOptionsView!
private var scoreOptionsView3 : YHScoreOptionsView!
private var scoreOptionsView4 : YHScoreOptionsView!
}
extension YHScoreItemCellForAge {
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.right.left.equalToSuperview()
make.bottom.equalToSuperview().offset(-14)
}
titleView = YHScoreTitleView()
holdView.addSubview(titleView)
titleView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(YHScoreTitleView.viewH)
}
let resultView = YHScoreResultView()
holdView.addSubview(resultView)
resultView.snp.makeConstraints { make in
make.top.equalTo(titleView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.height.equalTo(YHScoreTitleView.viewH)
}
scoreOptionsView1 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView1)
scoreOptionsView1.snp.makeConstraints { make in
make.top.equalTo(resultView.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView2 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView2)
scoreOptionsView2.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView1.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView3 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView3)
scoreOptionsView3.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView2.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
}
scoreOptionsView4 = YHScoreOptionsView()
holdView.addSubview(scoreOptionsView4)
scoreOptionsView4.snp.makeConstraints { make in
make.top.equalTo(scoreOptionsView3.snp.bottom)
make.left.equalTo(titleView.snp.left)
make.right.equalTo(titleView.snp.right)
make.bottom.equalToSuperview()
}
}
func updateUI() {
guard let arrData = optionData?.options else {
return
}
titleView.updateWith(optionData?.name, optionData?.score)
for (index,item) in arrData.enumerated() {
if index == 0 {
scoreOptionsView1.nameLable.text = item.scoreName
} else if index == 1 {
scoreOptionsView2.nameLable.text = item.scoreName
} else if index == 2 {
scoreOptionsView3.nameLable.text = item.scoreName
} else if index == 3 {
scoreOptionsView4.nameLable.text = item.scoreName
}
}
}
}
//
// YHScoreOptionsView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHScoreOptionsView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
lazy var nameLable : UILabel = {
let lable0 = UILabel()
lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScR(ofSize: 14)
lable0.numberOfLines = 0
lable0.lineBreakMode = .byWordWrapping
return lable0
}()
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex:0xF0F0F0)
return view
}()
}
private extension YHScoreOptionsView {
func setupUI() {
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(0.5)
}
addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.right.equalToSuperview()
make.bottom.equalTo(bottomLine.snp.top).offset(-16)
}
}
}
//
// YHScorePersonInfoCell.swift
// galaxy
//
// Created by davidhuangA on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHScorePersonInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHScorePersonInfoCell"
// var dataModel : YHContactItemModel? {
// didSet {
//// updateUI()
// }
// }
//头像
private lazy var headImagV : UIImageView = {
let imageV = UIImageView(image: UIImage(named: "score_header_default"))
imageV.contentMode = .scaleAspectFit
return imageV
}()
//姓名
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "DavidHuang")
lable0.textColor = UIColor(hex: 0x222222)
lable0.font = UIFont.PingFangScM(ofSize: 16)
return lable0
}()
//电话号码
private lazy var phoneLable : UILabel = {
let lable0 = UILabel(text: "15818743775")
lable0.textColor = UIColor(hex: 0x888F98)
lable0.font = UIFont.PingFangScR(ofSize: 12)
return lable0
}()
//综合得分
private lazy var scoreLable : UILabel = {
let lable0 = UILabel(text: "92 分")
lable0.textColor = UIColor(hex: 0x3C86F8)
lable0.font = UIFont.PingFangScB(ofSize: 43)
lable0.textAlignment = .right
return lable0
}()
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
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")
}
}
extension YHScorePersonInfoCell {
func setupUI() {
backgroundColor = .clear
contentView.backgroundColor = .clear
let lable0 = UILabel(text: "香港优才评分报告")
lable0.textColor = .white
lable0.font = UIFont.PingFangScB(ofSize: 24)
contentView.addSubview(lable0)
lable0.snp.makeConstraints { make in
make.top.equalTo(32)
make.left.equalTo(8)
make.right.equalTo(-8)
make.height.equalTo(34)
}
let lable1 = UILabel(text: "根据您填写的资料情况生成")
lable1.textColor = UIColor(hex: 0xffffff,alpha: 0.8)
lable1.font = UIFont.PingFangScR(ofSize: 12)
contentView.addSubview(lable1)
lable1.snp.makeConstraints { make in
make.top.equalTo(lable0.snp.bottom).offset(6)
make.left.equalTo(lable0.snp.left)
make.right.equalTo(lable0.snp.right)
make.height.equalTo(17)
}
let holdView = UIView()
holdView.backgroundColor = .white
holdView.layer.cornerRadius = 12
holdView.clipsToBounds = true
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.equalTo(lable1.snp.bottom).offset(30)
make.left.right.equalToSuperview()
make.height.equalTo(89)
make.bottom.equalToSuperview().offset(-14)
}
let bkgImageV = UIImageView(image: UIImage(named: "scroe_icon_bkg"))
bkgImageV.contentMode = .scaleAspectFill
holdView.addSubview(bkgImageV)
bkgImageV.snp.makeConstraints { make in
make.top.right.bottom.equalToSuperview()
make.width.equalTo(178)
}
let interHoldView = UIView()
interHoldView.layer.borderWidth = 1
interHoldView.layer.borderColor = UIColor(red: 0.235, green: 0.525, blue: 0.973, alpha: 0.2).cgColor
interHoldView.layer.cornerRadius = 10
interHoldView.clipsToBounds = true
holdView.addSubview(interHoldView)
interHoldView.snp.makeConstraints { make in
make.top.left.equalTo(4)
make.right.bottom.equalTo(-4)
}
// 头像 名称 电话号码 得分
holdView.addSubview(headImagV)
headImagV.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(21)
make.width.height.equalTo(42)
}
holdView.addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.top.equalTo(headImagV.snp.top)
make.left.equalTo(headImagV.snp.right).offset(12)
make.height.equalTo(24)
make.width.equalTo(200)
}
holdView.addSubview(phoneLable)
phoneLable.snp.makeConstraints { make in
make.top.equalTo(nameLable.snp.bottom)
make.left.equalTo(headImagV.snp.right).offset(12)
make.height.equalTo(20)
make.width.equalTo(200)
}
holdView.addSubview(scoreLable)
scoreLable.snp.makeConstraints { make in
make.top.equalTo(10)
make.right.equalToSuperview().offset(-21)
make.height.equalTo(50)
}
let a: ASAttributedString = .init("95", .font(UIFont.PingFangScR(ofSize: 43)),.foreground(UIColor(hex:0x3C86F8)))
let b: ASAttributedString = .init("分", .font(UIFont.PingFangScR(ofSize: 12)),.foreground(UIColor(hex:0x3C86F8)))
scoreLable.attributed.text = a + b
let lable3 = UILabel(text: "综合得分")
lable3.textColor = UIColor(hex: 0x888F98)
lable3.font = UIFont.PingFangScR(ofSize: 12)
lable3.textAlignment = .right
contentView.addSubview(lable3)
lable3.snp.makeConstraints { make in
make.top.equalTo(scoreLable.snp.bottom).offset(-4)
make.right.equalTo(scoreLable.snp.right)
make.height.equalTo(20)
}
}
}
//
// YHScoreResultView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHScoreResultView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
//固定高度
static let viewH : CGFloat = 52.0
//icon
private lazy var iconImageV : UIImageView = {
let imageV = UIImageView(image: UIImage(named: "score_satisfy_0"))
imageV.contentMode = .scaleAspectFit
return imageV
}()
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "年龄:32")
lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScM(ofSize: 14)
return lable0
}()
private lazy var desLable : UILabel = {
let lable0 = UILabel(text: "得分:30分")
lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScM(ofSize: 14)
return lable0
}()
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex:0xF0F0F0)
return view
}()
}
private extension YHScoreResultView {
func setupUI() {
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(0.5)
}
addSubview(iconImageV)
iconImageV.snp.makeConstraints { make in
make.left.equalToSuperview()
make.centerY.equalToSuperview().offset(-0.5)
make.width.height.equalTo(14)
}
addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.centerY.equalTo(iconImageV.snp.centerY)
make.left.equalTo(iconImageV.snp.right).offset(12)
make.bottom.equalTo(bottomLine.snp.top)
}
addSubview(desLable)
desLable.snp.makeConstraints { make in
make.centerY.equalTo(nameLable.snp.centerY)
make.left.equalTo(nameLable.snp.right).offset(6)
}
}
}
//
// YHScoreTitleView.swift
// galaxy
//
// Created by davidhuangA on 2024/1/28.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHScoreTitleView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
//固定高度
static let viewH : CGFloat = 52.0
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "年龄得分")
lable0.textColor = UIColor(hex: 0x222222)
lable0.font = UIFont.PingFangScM(ofSize: 17)
return lable0
}()
private lazy var desLable : UILabel = {
let lable0 = UILabel(text: "(最高30分)")
lable0.textColor = UIColor(hex: 0x888F98)
lable0.font = UIFont.PingFangScR(ofSize: 14)
return lable0
}()
private lazy var bottomLine : UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex:0xF0F0F0)
return view
}()
}
private extension YHScoreTitleView {
func setupUI() {
addSubview(bottomLine)
bottomLine.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(0.5)
}
addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.top.left.equalToSuperview()
make.bottom.equalTo(bottomLine.snp.top)
}
addSubview(desLable)
desLable.snp.makeConstraints { make in
make.centerY.equalTo(nameLable.snp.centerY)
make.left.equalTo(nameLable.snp.right).offset(6)
}
}
}
extension YHScoreTitleView {
func updateWith(_ name: String?,_ text : String?) {
nameLable.text = name ?? "-"
desLable.text = text ?? "-"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>age_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>30</string>
<key>scoreName</key>
<string>118-39</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>240-44</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>345-50</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>450+</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>年龄得分</string>
<key>score</key>
<string>(最高30分)</string>
</dict>
<key>education_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>40</string>
<key>scoreName</key>
<string>1)博士学位/2个或以上硕士学位</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>2)硕士学位/2个或以上学士学位</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>10</string>
<key>scoreName</key>
<string>3)学士学位/由国家或国际认可或著名的专业团队颁授,证明持有人具有极高水平的专业知识或专业技能的专业资格</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>30</string>
<key>scoreName</key>
<string>4)如学士或以上程度的学位是由国际认可的著名院校颁授,可额外获取分数</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>学历/专业资格</string>
<key>score</key>
<string>(最高70分)</string>
</dict>
<key>work_experience_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>0</string>
<key>scoreName</key>
<string>1)获得最低学位证以后,拥有不超过2年工作经验</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>5</string>
<key>scoreName</key>
<string>2)不少于2年相当于学位程度或专家水平的工作经验</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>3)不少于5年相当于学位程度或专家水平的工作经验</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>30</string>
<key>scoreName</key>
<string>4)不少于5年相当于学位程度或专家水平的工作经验,当中最少2年担任高级职位</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>40</string>
<key>scoreName</key>
<string>5)不少于10年相当于学位程度或专家水平的工作经验,当中最少5年担任高级职位</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>6)如拥有不少于2年相当于学位程度或专家水平及在你原居国家/地区以外地方的国际工作经验,可额外获取分数</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>7)如拥有不少于3年相当于学位程度或专家水平的跨国公司或知名企业的工作经验,如上市公司或位列《福布斯》全球企业2000强、《财富》世界500強和胡润中国500强企业,可额外获取分数</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>工作经验</string>
<key>score</key>
<string>(最高75分)</string>
</dict>
<key>talent_list_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>30</string>
<key>scoreName</key>
<string>1)如符合人才清单内相关专业的规格,可额外获取分数</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>人才清单</string>
<key>score</key>
<string>(最高30分)</string>
</dict>
<key>language_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>1)中文及英文 —— 国外大学(英语国家)毕业,英文授课,获得学位证。(如为中外联合办学,在中国上课的,不算)</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>20</string>
<key>scoreName</key>
<string>2)中文及英文 —— 有近两年的雅思或托福成绩单(雅思考试G类或A类总分达6分;托福笔试达550分,计算机达213分,网考达80)</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>15</string>
<key>scoreName</key>
<string>3)中文及另一种外语 —— 非英文的外语,如:法文、日文等(需提供相关证书) </string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>10</string>
<key>scoreName</key>
<string>4)仅中文</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>10</string>
<key>scoreName</key>
<string>5)仅英文</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>语言能力</string>
<key>score</key>
<string>(最高20分)</string>
</dict>
<key>background_score</key>
<dict>
<key>options</key>
<array>
<dict>
<key>scoreValue</key>
<string>5</string>
<key>scoreName</key>
<string>1)至少一名直系家庭(已婚配偶、父母、兄弟姊妹、子女)是现居于香港的香港永久性居民</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>5</string>
<key>scoreName</key>
<string>2)随行已婚配偶的学历相当于大学学位或以上的水平</string>
<key>isSelected</key>
<false/>
</dict>
<dict>
<key>scoreValue</key>
<string>10</string>
<key>scoreName</key>
<string>3)每名随行的18岁以下未婚及受养的子女得5分,最高得10</string>
<key>isSelected</key>
<false/>
</dict>
</array>
<key>name</key>
<string>家庭背景</string>
<key>score</key>
<string>(最高20分)</string>
</dict>
</dict>
</plist>
......@@ -11,8 +11,12 @@ import SmartCodable
class YHServiceCenterMainViewModel: YHBaseViewModel {
//合同列表 数据
var arrContactList : [YHContactItemModel] = []
//评分相关的 本地数据
var localScoreData : YHScoreDataModel?
}
//请求接口
extension YHServiceCenterMainViewModel {
//请求合同项
func getContactList(callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
......@@ -41,8 +45,32 @@ extension YHServiceCenterMainViewModel {
}
}
//其他方法
extension YHServiceCenterMainViewModel {
//加载本地 plist数据
func loadLocalScoreData() {
if let path = Bundle.main.path(forResource: "scoreOptionData", ofType: "plist") {
if let plistData = FileManager.default.contents(atPath: path) {
do {
let listDictionary = try PropertyListSerialization.propertyList(from: plistData, options: [], format: nil) as! [String: Any]
guard let model = YHScoreDataModel.deserialize(dict: listDictionary) else {
localScoreData = nil
return
}
localScoreData = model
} catch {
localScoreData = nil
}
} else {
localScoreData = nil
}
} else {
localScoreData = nil
}
}
}
//合同数据结构
struct YHContactItemHoldModel : SmartCodable {
var orders : [YHContactItemModel] = []
}
......@@ -31,6 +31,7 @@ class YHPrivacyAlertView: UIView {
}
func setView() {
backgroundColor = UIColor(hex: 0x0000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
......
......@@ -18,7 +18,7 @@ extension AppDelegate{
func setNavigationBarAppearanceWhenContainedInInstancesOf(containers: [UIAppearanceContainer.Type]){
let navigationBarAppearance = UINavigationBar.appearance(whenContainedInInstancesOf: containers)
navigationBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.commonColor100,NSAttributedString.Key.font:UIFont.PFSCM(ofSize: 16)]
navigationBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.commonColor100,NSAttributedString.Key.font:UIFont.PingFangScM(ofSize: 16)]
navigationBarAppearance.barTintColor = UIColor.yellow
navigationBarAppearance.tintColor = UIColor.commonColor100
navigationBarAppearance.backIndicatorImage = UIImage(named: "back_icon")
......
......@@ -9,18 +9,35 @@
import UIKit
extension UIFont {
// PingFangSC-ExtraLight 苹方 特细
// PingFangSC-Light 苹方 细体
// PingFangSC-Regular 苹方 常规
// PingFangSC-Medium 苹方 中等
// PingFangSC-Bold 苹方 粗体
// PingFangSC-Heavy 苹方 特粗
// MARK: - 苹果字体
class func PFSCR(ofSize size : CGFloat = 15) -> UIFont {
//特细
class func PingFangScEL(ofSize size : CGFloat = 17) -> UIFont {
return UIFont(name: "PingFangSC-Thin", size: size)!
}
//细体
class func PingFangScL(ofSize size : CGFloat = 17) -> UIFont {
return UIFont(name: "PingFangSC-Light", size: size)!
}
//常规
class func PingFangScR(ofSize size : CGFloat = 17) -> UIFont {
return UIFont(name: "PingFangSC-Regular", size: size)!
}
class func PFSCM(ofSize size : CGFloat = 15) -> UIFont {
//中等
class func PingFangScM(ofSize size : CGFloat = 17) -> UIFont {
return UIFont(name: "PingFangSC-Medium", size: size)!
}
// static func PFSCB(ofSize size : CGFloat = 15) -> UIFont {
// return UIFont(name: "PingFangSC-Bold", size: size)!
// }
//粗体
static func PingFangScB(ofSize size : CGFloat = 17) -> UIFont {
return UIFont(name: "PingFangSC-Semibold", size: size)!
}
}
......@@ -13,7 +13,7 @@ extension UILabel {
let temp = UILabel()
temp.textColor = UIColor(hexString: "#333333", transparency: 0.45)
temp.textAlignment = .center
temp.font = UIFont.PFSCM(ofSize: 10)
temp.font = UIFont.PingFangScM(ofSize: 10)
temp.backgroundColor = UIColor(hexString: "#333333", transparency: 0.04)
temp.layer.cornerRadius = 2
temp.clipsToBounds = true
......
......@@ -21,8 +21,8 @@ extension UIView {
let gradientLayer = CAGradientLayer()
gradientLayer.colors = colors
gradientLayer.locations = [0, 1.0]
gradientLayer.startPoint = CGPoint(x: 0.02, y: 0.5)
gradientLayer.endPoint = CGPoint(x: 1.0, y: 0.5)
gradientLayer.startPoint = CGPoint(x: 0.12, y: 0.25)
gradientLayer.endPoint = CGPoint(x: 0.38, y: 0.25)
gradientLayer.frame = self.bounds
self.layer.addSublayer(gradientLayer)
}
......
......@@ -97,7 +97,7 @@ extension UIViewController {
}
if font == nil {
button?.titleLabel?.font = UIFont.PFSCM(ofSize: 16)
button?.titleLabel?.font = UIFont.PingFangScM(ofSize: 16)
} else {
button?.titleLabel?.font = font
}
......@@ -150,13 +150,13 @@ extension UIViewController {
///设置全局标题属性
func bs_setupTitleAttributedAll(font: UIFont = UIFont.PFSCM(ofSize: 16), color: UIColor = .black) {
func bs_setupTitleAttributedAll(font: UIFont = UIFont.PingFangScM(ofSize: 16), color: UIColor = .black) {
let titleDict = [NSAttributedString.Key.font: font, NSAttributedString.Key.foregroundColor: color]
self.navigationController?.navigationBar.titleTextAttributes = titleDict
}
///设置独立标题属性
func bs_setupTitleAttributed(title: String, font: UIFont = UIFont.PFSCM(ofSize: 16), color: UIColor = .black, reset: Bool = false) {
func bs_setupTitleAttributed(title: String, font: UIFont = UIFont.PingFangScM(ofSize: 16), color: UIColor = .black, reset: Bool = false) {
var titleLabel: UILabel?
if let label = self.navigationItem.titleView as? UILabel,
reset == false {
......@@ -208,7 +208,7 @@ extension UIViewController {
}
button?.setImage(image, for: .normal)
button?.setImage(image, for: .highlighted)
button?.titleLabel?.font = UIFont.PFSCM(ofSize: 16)
button?.titleLabel?.font = UIFont.PingFangScM(ofSize: 16)
button?.setTitle(title, for: .normal)
button?.setTitleColor(color, for: .normal)
button?.tintColor = color
......
......@@ -107,7 +107,7 @@ extension YHHUD{
duration:TimeInterval = 0.5,
isRemoveBefore: Bool = true,
insets: UIEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 120, right: 20),
contentInsets: UIEdgeInsets = UIEdgeInsets(top: 8, left: 12, bottom: 8, right: 12),
contentInsets: UIEdgeInsets = UIEdgeInsets(top: 12, left: 21, bottom: 12, right: 21),
containerWindow: UIWindow? = nil,
walk:((UILabel)->Void)? = nil){
if isRemoveBefore{
......
{
"images" : [
{
"filename" : "PlusOutlined.png",
"idiom" : "universal",
"scale" : "1x"
},
......@@ -10,6 +9,7 @@
"scale" : "2x"
},
{
"filename" : "PlusOutlined@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3040@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 2471@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Vector 408.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Vector 408@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Vector 408@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Frame 3459.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 3459@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 3459@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Frame 3459.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 3459@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 3459@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Frame 3457.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 3457@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 3457@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Frame 3457.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 3457@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 3457@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 3431.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3431@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3431@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 3431.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3431@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3431@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 2499.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2499@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2499@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Ellipse 18.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Ellipse 18@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Ellipse 18@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Ellipse 18.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Ellipse 18@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Ellipse 18@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Frame 3459.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 3459@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 3459@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Frame 3459.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 3459@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 3459@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 2849.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2849@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2849@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Rectangle 2490.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 2490@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 2490@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 33334300.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 33334300@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 33334300@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 3380.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3380@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3380@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 3381.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3381@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3381@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Rectangle 2519.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 2519@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 2519@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 3117.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3117@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3117@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "温馨提示.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "温馨提示@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "温馨提示@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Vector 409.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Vector 409@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Vector 409@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 3459@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 3459@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Frame 3459.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 3459@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 3459@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Applicant.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Applicant@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Applicant@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 3460.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 3460@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 3460@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 581.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 581@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 581@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 2918.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2918@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2918@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Group 2919.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2919@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2919@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "我的评分-卡片背景图.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "我的评分-卡片背景图@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "我的评分-卡片背景图@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment