Commit 5e30ed6e authored by David黄金龙's avatar David黄金龙

Merge commit '2abc1d6a' into davidhuang

* commit '2abc1d6a':
  // 家庭成员信息
  // 兄弟姐妹信息
  // 子女信息
  登录注册
  //  子女信息
  // 子女信息
  debug 数据
parents 2a998c1b 2abc1d6a
......@@ -9,14 +9,13 @@
/* Begin PBXBuildFile section */
04010B952B6A1DE90093F3BB /* YHSaveAndSubmitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */; };
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.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 /* YHSpouseInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */; };
041B52982B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift */; };
041B52D62B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */; };
041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */; };
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DC2B60A889007EBCEB /* YHTest.swift */; };
042FBBBB2B62806D00F9DE23 /* YHCertificateInfoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBA2B62806D00F9DE23 /* YHCertificateInfoController.swift */; };
......@@ -25,12 +24,14 @@
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 */; };
042FBBC72B64CFBF00F9DE23 /* YHChildPrimaryInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC62B64CFBF00F9DE23 /* YHChildPrimaryInfoVC.swift */; };
042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */; };
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */; };
042FBBD42B67A2FE00F9DE23 /* YHFormPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBD32B67A2F900F9DE23 /* YHFormPickerView.swift */; };
042FBBD62B67BDD500F9DE23 /* YHBrotherInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBD52B67BDD500F9DE23 /* YHBrotherInfoVC.swift */; };
043955212B70955200955D49 /* YHFormPickerViewType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043955202B70955200955D49 /* YHFormPickerViewType.swift */; };
043955232B70BC2500955D49 /* YHChildInfoContainerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043955222B70BC2500955D49 /* YHChildInfoContainerVC.swift */; };
043955252B70D20300955D49 /* YHFormItemQuestionsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043955242B70D20300955D49 /* YHFormItemQuestionsCell.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 */; };
......@@ -71,7 +72,10 @@
04A7BC8F2B6B2BC2000E8D47 /* YHFamilyRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A7BC8E2B6B2BC2000E8D47 /* YHFamilyRequestViewModel.swift */; };
04A7BC912B6B7B89000E8D47 /* YHTwoOptionAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A7BC902B6B7B89000E8D47 /* YHTwoOptionAlertView.swift */; };
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; };
04D765732B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D765722B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift */; };
04E86E092B707ACE00A35F4B /* YHPhoneLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */; };
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */; };
04E86E0D2B70D51D00A35F4B /* YHWebViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */; };
04E86E0F2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0E2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A51044182B493675006B60BB /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A51044172B493675006B60BB /* README.md */; };
A510441A2B495DD0006B60BB /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51044192B495DD0006B60BB /* UIView+Extension.swift */; };
......@@ -233,14 +237,13 @@
/* Begin PBXFileReference section */
04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSaveAndSubmitView.swift; sourceTree = "<group>"; };
041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.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 /* YHSpouseInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInitialInfoVC.swift; sourceTree = "<group>"; };
041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyMemberInfoVC.swift; sourceTree = "<group>"; };
041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpousePrimaryInfoVC.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>"; };
042FBBBA2B62806D00F9DE23 /* YHCertificateInfoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfoController.swift; sourceTree = "<group>"; };
......@@ -249,12 +252,14 @@
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>"; };
042FBBC62B64CFBF00F9DE23 /* YHChildPrimaryInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildPrimaryInfoVC.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>"; };
042FBBD32B67A2F900F9DE23 /* YHFormPickerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFormPickerView.swift; sourceTree = "<group>"; };
042FBBD52B67BDD500F9DE23 /* YHBrotherInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBrotherInfoVC.swift; sourceTree = "<group>"; };
043955202B70955200955D49 /* YHFormPickerViewType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormPickerViewType.swift; sourceTree = "<group>"; };
043955222B70BC2500955D49 /* YHChildInfoContainerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildInfoContainerVC.swift; sourceTree = "<group>"; };
043955242B70D20300955D49 /* YHFormItemQuestionsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemQuestionsCell.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>"; };
......@@ -295,7 +300,10 @@
04A7BC8E2B6B2BC2000E8D47 /* YHFamilyRequestViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyRequestViewModel.swift; sourceTree = "<group>"; };
04A7BC902B6B7B89000E8D47 /* YHTwoOptionAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTwoOptionAlertView.swift; sourceTree = "<group>"; };
04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; };
04D765722B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInfoContainerVC.swift; sourceTree = "<group>"; };
04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneLoginViewController.swift; sourceTree = "<group>"; };
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebViewViewController.swift; sourceTree = "<group>"; };
04E86E0E2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHSpouseInfoContainerVC.swift; sourceTree = "<group>"; };
58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; };
987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_galaxy.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A51044172B493675006B60BB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
......@@ -474,14 +482,14 @@
path = IM;
sourceTree = "<group>";
};
041B52882B5E13EB007EBCEB /* FamilyMember */ = {
041B52882B5E13EB007EBCEB /* FamilyMember(家庭成员信息表) */ = {
isa = PBXGroup;
children = (
041B52D72B5F8ADA007EBCEB /* M */,
041B52962B5E8E3B007EBCEB /* C */,
041B52892B5E14EB007EBCEB /* View */,
);
path = FamilyMember;
path = "FamilyMember(家庭成员信息表)";
sourceTree = "<group>";
};
041B52892B5E14EB007EBCEB /* View */ = {
......@@ -490,8 +498,8 @@
042FBBD22B67A2F900F9DE23 /* PickerView */,
041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */,
041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */,
041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */,
041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */,
043955242B70D20300955D49 /* YHFormItemQuestionsCell.swift */,
041B528E2B5E620E007EBCEB /* YHFormItemInputTextCell.swift */,
041B52902B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift */,
042FBBBC2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift */,
......@@ -506,13 +514,14 @@
041B52962B5E8E3B007EBCEB /* C */ = {
isa = PBXGroup;
children = (
041B52972B5E8EA0007EBCEB /* YHFamilyMemberFormVC.swift */,
04D765722B6A173C0055ECBB /* YHSpouseInfoContainerVC.swift */,
041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */,
04E86E0E2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift */,
041B52972B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift */,
041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */,
042FBBBA2B62806D00F9DE23 /* YHCertificateInfoController.swift */,
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */,
042FBBC22B63DA4C00F9DE23 /* YHParentInfoVC.swift */,
042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */,
043955222B70BC2500955D49 /* YHChildInfoContainerVC.swift */,
042FBBC62B64CFBF00F9DE23 /* YHChildPrimaryInfoVC.swift */,
042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */,
042FBBD52B67BDD500F9DE23 /* YHBrotherInfoVC.swift */,
);
......@@ -887,6 +896,9 @@
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */,
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */,
0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */,
04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */,
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */,
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -1184,7 +1196,7 @@
A5167B2D2B6A23D10084C08F /* PersonInfoList(个人信息表) */,
A5167B292B6A174B0084C08F /* MyScore(我的评分) */,
0468D43D2B61F68100CFB916 /* MainApplicantInformation */,
041B52882B5E13EB007EBCEB /* FamilyMember */,
041B52882B5E13EB007EBCEB /* FamilyMember(家庭成员信息表) */,
);
path = "ServiceProcess(流程)";
sourceTree = "<group>";
......@@ -1391,6 +1403,7 @@
A5FD63E62B67908000D1D9DA /* YHPersonInfoControllerHoldViewController.swift in Sources */,
A514E5DC2B60A2B700C93951 /* YHServiceCenterSecondViewController.swift in Sources */,
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */,
043955252B70D20300955D49 /* YHFormItemQuestionsCell.swift in Sources */,
0468D4532B6782BE00CFB916 /* YHCardExampleView.swift in Sources */,
04010B952B6A1DE90093F3BB /* YHSaveAndSubmitView.swift in Sources */,
A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */,
......@@ -1456,10 +1469,10 @@
A5FD63CD2B64E2D600D1D9DA /* YHScoreDetailViewController.swift in Sources */,
A5FD63ED2B688A7000D1D9DA /* YHPersonInfoSessionView.swift in Sources */,
A5C5B2FB2B5535DF00A7C5D1 /* YHHomeBannerView.swift in Sources */,
041B528B2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift in Sources */,
A5F78C822B68F39600EEA170 /* YHPersonInfoCommonCell.swift in Sources */,
A5ACE94B2B4564F7002C94D2 /* YHHUDRotatingImageView.swift in Sources */,
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */,
04E86E0F2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift in Sources */,
0468D47E2B68CEA200CFB916 /* YHImagePickerView.swift in Sources */,
A5ACE94F2B4564F7002C94D2 /* YhOverlayView.swift in Sources */,
A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */,
......@@ -1493,15 +1506,15 @@
042FBBC32B63DA4C00F9DE23 /* YHParentInfoVC.swift in Sources */,
A5ACE9392B4564F7002C94D2 /* UIDevice+Extension.swift in Sources */,
041B52912B5E67F3007EBCEB /* YHFormItemEnterDetailCell.swift in Sources */,
04E86E092B707ACE00A35F4B /* YHPhoneLoginViewController.swift in Sources */,
A5ACE9422B4564F7002C94D2 /* AppDelegate+Extension.swift in Sources */,
04D765732B6A173C0055ECBB /* YHSpouseInfoContainerVC.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 /* YHHUDErrorView.swift in Sources */,
04A7BC8F2B6B2BC2000E8D47 /* YHFamilyRequestViewModel.swift in Sources */,
041B52D62B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift in Sources */,
041B52D62B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift in Sources */,
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */,
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */,
A5ACE9552B4564F7002C94D2 /* YHTabBarViewController.swift in Sources */,
......@@ -1528,11 +1541,12 @@
0468D44B2B625AAB00CFB916 /* YHItemModel.swift in Sources */,
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */,
043955212B70955200955D49 /* YHFormPickerViewType.swift in Sources */,
043955232B70BC2500955D49 /* YHChildInfoContainerVC.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 */,
041B52982B5E8EA0007EBCEB /* YHFamilyMemberInfoVC.swift in Sources */,
0468D47B2B68A08600CFB916 /* YHAddressPresentAnimated.swift in Sources */,
A5C382CF2B5F9A9100C5E65C /* YHServiceCenterMainViewModel.swift in Sources */,
0468D4782B68A08600CFB916 /* YHAddressModel.swift in Sources */,
......@@ -1546,14 +1560,16 @@
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */,
A5ACE9582B4564F7002C94D2 /* YHNoDataTipView.swift in Sources */,
042FBBBB2B62806D00F9DE23 /* YHCertificateInfoController.swift in Sources */,
042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */,
042FBBC72B64CFBF00F9DE23 /* YHChildPrimaryInfoVC.swift in Sources */,
A5234E2A2B6E349600A33433 /* YHBasicInfoFillBottomView.swift in Sources */,
04A7BC912B6B7B89000E8D47 /* YHTwoOptionAlertView.swift in Sources */,
04E86E0D2B70D51D00A35F4B /* YHWebViewViewController.swift in Sources */,
0468D4792B68A08600CFB916 /* YHAddressViewController.swift in Sources */,
A5ACE9562B4564F7002C94D2 /* YHBouncesContentView.swift in Sources */,
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */,
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */,
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */,
A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */,
0468D4552B6889A500CFB916 /* YHDatePickView.swift in Sources */,
A5C5B3272B57C8D500A7C5D1 /* YHDavidCell2.swift in Sources */,
......
......@@ -324,7 +324,7 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
navigationController?.pushViewController(vc)
} else if indexPath.row == 1 {
//家庭程序信息
let vc = YHFamilyMemberFormVC(orderId: orderId ?? 0)
let vc = YHFamilyMemberInfoVC(orderId: orderId ?? 0)
navigationController?.pushViewController(vc)
} else if indexPath.row == 2 {
//基本信息
......
......@@ -10,9 +10,16 @@ import UIKit
class YHBrotherInfoVC: YHBaseViewController {
var brotherInfo:YHFamilyMember?
var brotherInfo: YHFamilyMember?
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
let familyRequest:YHFamilyRequestViewModel = YHFamilyRequestViewModel()
var bottomView: YHSaveAndSubmitView = {
let view = YHSaveAndSubmitView.createView()
view.isHiddenSubmit = true
return view
}()
lazy var tableView: UITableView = {
......@@ -48,14 +55,28 @@ class YHBrotherInfoVC: YHBaseViewController {
func createUI() {
view.addSubview(tableView);
view.addSubview(bottomView)
bottomView.saveBlock = {
[weak self] in
guard let self = self else { return }
self.saveInfo()
}
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_safeAreaInsetsBottom())
make.height.equalTo(YHSaveAndSubmitView.height)
}
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.bottom.equalTo(bottomView.snp.top)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
}
loadBasicInfo()
}
func loadBasicInfo() {
......@@ -64,35 +85,63 @@ class YHBrotherInfoVC: YHBaseViewController {
items.removeAll()
// 兄弟姐妹信息
let title0:YHFormItemProtocol = YHFormTitleItem(type: .brotherInfo)
let item00:YHFormItemProtocol = YHFormDetailItem(type: .brotherName)
let item01:YHFormItemProtocol = YHFormDetailItem(type: .birthday)
let item02:YHFormItemProtocol = YHFormDetailItem(type: .birthNation)
let item03:YHFormItemProtocol = YHFormDetailItem(type: .birthCity)
let item04:YHFormItemProtocol = YHFormDetailItem(type: .gender)
let item05:YHFormItemProtocol = YHFormDetailItem(type: .marriageState)
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05]
let title1 = YHFormTitleItem(type: .brotherInfo)
let item10 = YHFormDetailItem(type: .brotherName)
item10.value = brotherInfo.subsetName
let item11 = YHFormDetailItem(type: .birthday)
item11.value = brotherInfo.birthday
let item12 = YHFormDetailItem(type: .birthNation)
item12.value = String(brotherInfo.isBirthOverSeas())
let item13 = YHFormDetailItem(type: .birthCity)
if brotherInfo.isBirthOverSeas() {
item13.value = brotherInfo.birthPlace?.foreign
item13.placeHolder = "请输入".local
} else {
item13.value = brotherInfo.birthPlace?.area?.joined(separator: ",")
item13.placeHolder = "请选择".local
}
let item14 = YHFormDetailItem(type: .gender)
item14.value = brotherInfo.sexName()
let item15 = YHFormDetailItem(type: .marriageState)
item15.value = brotherInfo.married
let arr1:[YHFormItemProtocol] = [title1, item10, item11, item12, item13, item14, item15]
// 职业信息
let title1:YHFormItemProtocol = YHFormTitleItem(type: .occupationInfo)
let item10:YHFormItemProtocol = YHFormDetailItem(type: .occupation)
let arr1:[YHFormItemProtocol] = [title1, item10]
let title2 = YHFormTitleItem(type: .occupationInfo)
let item20 = YHFormDetailItem(type: .occupation)
item20.value = brotherInfo.occupation
item20.placeHolder = "请输入".local
var arr2:[YHFormItemProtocol] = [title2, item20]
// 居住信息
let title2:YHFormItemProtocol = YHFormTitleItem(type: .liveInfo)
let item20:YHFormItemProtocol = YHFormDetailItem(type: .liveNationOrArea)
let arr2:[YHFormItemProtocol] = [title2, item20]
let title3 = YHFormTitleItem(type: .liveInfo)
let item30 = YHFormDetailItem(type: .liveNationOrArea)
item30.value = brotherInfo.liveCountry
let arr3:[YHFormItemProtocol] = [title3, item30]
// 香港身份证
let title3:YHFormItemProtocol = YHFormTitleItem(type: .hkIdentityCardInfo)
let item30:YHFormItemProtocol = YHFormDetailItem(type: .isHaveHkIdentityCard)
let item31:YHFormItemProtocol = YHFormDetailItem(type: .hkIdentityCardNumber)
let arr3:[YHFormItemProtocol] = [title3, item30, item31]
let title4 = YHFormTitleItem(type: .hkIdentityCardInfo)
let item40 = YHFormDetailItem(type: .isHaveHkIdentityCard)
item40.value = String(brotherInfo.isHaveHKIdentityCard())
var arr4:[YHFormItemProtocol] = [title4, item40]
if brotherInfo.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber)
item41.value = brotherInfo.hkIdentityCard
arr4.append(item41)
}
items.append(contentsOf: [arr1, arr2, arr3, arr4])
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr3])
tableView.reloadData()
}
func getCellType(_ item: Any) ->HKFormItemCellType {
......@@ -102,16 +151,27 @@ class YHBrotherInfoVC: YHBaseViewController {
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .fatherName
|| detailItem.type == .motherName
|| detailItem.type == .nationOrArea
|| detailItem.type == .hkIdentityCardNumber
|| detailItem.type == .brotherName
if detailItem.type == .birthCity {
var isBirthOverSeas = false
if let brotherInfo = brotherInfo {
isBirthOverSeas = brotherInfo.isBirthOverSeas()
}
if isBirthOverSeas {
return .inputText
} else {
return .selectSheet
}
}
if detailItem.type == .brotherName
|| detailItem.type == .occupationName
|| detailItem.type == .hkIdentityCardNumber
{
return .inputText
}
if detailItem.type == .birthday
|| detailItem.type == .birthCity
|| detailItem.type == .marriageState
|| detailItem.type == .occupation
|| detailItem.type == .liveNationOrArea
......@@ -119,8 +179,7 @@ class YHBrotherInfoVC: YHBaseViewController {
{
return .selectSheet
}
if detailItem.type == .birthNation
|| detailItem.type == .isHaveHkIdentityCard
if detailItem.type == .birthNation || detailItem.type == .isHaveHkIdentityCard
{
return .twoChoice
}
......@@ -157,46 +216,120 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
return cell
}
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.title = item.getTitle()
return cell
}
if cellType == .selectSheet { // 点击选择列表cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
if cellType == .addItem { // 新增item cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemAddCell.cellReuseIdentifier, for: indexPath) as! YHFormItemAddCell
cell.title = item.getTitle()
return cell
}
if cellType == .twoChoice { // 问答双项选择cell
if item is YHFormDetailItem {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = item.getTitle()
cell.answerArr = nil
let detailItem = item as! YHFormDetailItem
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 {
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.text = detailItem.value
cell.textChange = {
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),
YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
[weak self] (text, isEditEnd) in
guard let self = self else { return }
if detailItem.type == .brotherName {
self.brotherInfo?.subsetName = text
} else if detailItem.type == .birthCity {
self.brotherInfo?.birthPlace?.foreign = text
} else if detailItem.type == .occupationName {
self.brotherInfo?.occupationName = text
} else if detailItem.type == .hkIdentityCardNumber {
self.brotherInfo?.hkIdentityCard = text
}
if isEditEnd {
self.loadBasicInfo()
self.saveInfo()
}
}
return cell
}
return cell
}
if cellType == .degreeDetailInfo { // 学位cell
if cellType == .selectSheet { // 点击选择列表cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDegreeInfoCell
cell.title = item.getTitle()
return cell
if cellType == .twoChoice { // 问答双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed
cell.title = item.getTitle()
cell.answerArr = nil
if detailItem.type == .birthNation { // 出生国家
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "国内".local, isSelect: !select),
YHFormChoiceItem(title: "国外".local, isSelect: select)]
cell.answerArr = answers
cell.answerBlock = {
[weak self] (answers, index) in
guard let self = self else { return }
let selectItem = answers[index]
self.brotherInfo?.setBirthOverSeas(selectItem.title == "国外".local)
self.loadBasicInfo()
self.saveInfo()
}
} else if detailItem.type == .isHaveHkIdentityCard { // 是否办理过香港身份证
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),
YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
cell.answerBlock = {
[weak self] (answers, index) in
guard let self = self else { return }
let selectItem = answers[index]
if detailItem.type == .isHaveHkIdentityCard {
self.brotherInfo?.setHaveHKIdentityCard(selectItem.title == "是".local)
}
self.loadBasicInfo()
self.saveInfo()
}
}
return cell
}
if cellType == .onlyTwoChoice { // 仅有双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemOnlyDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemOnlyDoubleChoiceCell
var isDead = false
if let brotherInfo = brotherInfo, brotherInfo.isDead() { // 已故
isDead = true
}
let answers = [YHFormChoiceItem(title: "健在".local, isSelect: !isDead),
YHFormChoiceItem(title: "已故".local, isSelect: isDead)]
cell.answerArr = answers
cell.answerBlock = { [weak self]
(arr, selectIndex) in
let selectItem:YHFormChoiceItem = arr[selectIndex]
self?.brotherInfo?.setIsDead(selectItem.title == "已故".local)
self?.loadBasicInfo()
self?.saveInfo()
}
return cell
}
}
return createDefaultCell(indexPath)
}
......@@ -254,17 +387,81 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .certificateValidDate ||
detailItem.type == .certificateSignDate { // 届满日期 签发日期
self.view?.endEditing(true)
YHDatePickView.show(type: .yyyymmdd) { date in
let dataArr = date.components(separatedBy: YHDatePickView.separator)
print(date)
if detailItem.type == .birthday { // 出生日期
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
guard let self = self else { return }
if detailItem.type == .birthday {
self.brotherInfo?.birthday = date
}
self.loadBasicInfo()
self.saveInfo()
}
} else if detailItem.type == .birthCity { // 出生城市
var isBirthOverSeas = false
if let brotherInfo = brotherInfo {
isBirthOverSeas = brotherInfo.isOverSeasOver1Year()
}
// 出生国外时 出生城市是输入框
if isBirthOverSeas { return }
let vc = YHAddressViewController()
vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in
guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.brotherInfo?.birthPlace?.area = [string2, string3, string4]
self.loadBasicInfo()
self.saveInfo()
}
self.present(vc, animated: true)
} else if detailItem.type == .occupation { // 职业
let occupation = self.brotherInfo?.occupation ?? ""
YHFormPickerView.show(type: .profession, selectTitle:occupation ) {
[weak self] selectType in
guard let self = self else { return }
self.brotherInfo?.occupation = selectType.title
self.loadBasicInfo()
self.saveInfo()
}
} else if detailItem.type == .marriageState { // 婚姻
let marriage = self.brotherInfo?.married
YHFormPickerView.show(type: .marriage, selectTitle:marriage) {
[weak self] selectType in
guard let self = self else { return }
self.brotherInfo?.married = selectType.title
self.loadBasicInfo()
self.saveInfo()
}
} else if detailItem.type == .liveNationOrArea { // 现居住国家/地区
let vc = YHAddressViewController()
vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in
guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.brotherInfo?.liveCountry = string2
self.loadBasicInfo()
self.saveInfo()
}
self.present(vc, animated: true)
} else if detailItem.type == .gender { // 性别
guard let brotherInfo = brotherInfo else { return }
let isMale = brotherInfo.isMale()
let selectType:YHFormPickerViewSubType = isMale ? .gender(.male) : .gender(.female)
YHFormPickerView.show(type: .gender, selectType:selectType) {
[weak self] selectType in
guard let self = self else { return }
let selectMale = (selectType.index == YHFormPickerViewSubType.gender(.male).index)
self.brotherInfo?.setMale(selectMale)
self.loadBasicInfo()
self.saveInfo()
}
}
return
}
}
......@@ -286,3 +483,24 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
}
}
extension YHBrotherInfoVC {
func saveInfo() {
guard let brotherInfo = brotherInfo else { return }
guard let info = brotherInfo.toDictionary() else { return }
let dict:[String: Any] = ["orderId":brotherInfo.orderId,
"relation":brotherInfo.relationType.rawValue,
"step":brotherInfo.step,
"next":false,
"info":info]
self.familyRequest.addOrSaveFamilyMember(params:dict) { success, error in
if success {
}
}
}
}
......@@ -11,8 +11,7 @@ import UIKit
class YHChildBasicInfoVC: YHBaseViewController {
var child:YHFamilyMember?
var cardInfo: YHCNIdentityCard?
weak var delegate:YHSpouseInfoVCProtocol?
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
......@@ -23,6 +22,8 @@ class YHChildBasicInfoVC: YHBaseViewController {
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
......@@ -49,53 +50,103 @@ class YHChildBasicInfoVC: YHBaseViewController {
func createUI() {
view.addSubview(tableView);
let topHeight = k_Height_NavigationtBarAndStatuBar+YHStepView.height
let bottomHeight = k_Height_safeAreaInsetsBottom() + YHSaveAndSubmitView.height
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalToSuperview().offset(-100)
make.top.equalToSuperview().offset(topHeight)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-bottomHeight)
}
}
func loadBasicInfo() {
guard let child = child else { return }
items.removeAll()
// 子女信息
let title0 = YHFormTitleItem(type: .childInfo)
let item00 = YHFormDetailItem(type: .childName)
let item01 = YHFormDetailItem(type: .everName)
let item02 = YHFormDetailItem(type: .befourMarryFirstName)
item00.value = child.subsetName
item00.placeHolder = "请输入".local
let item01 = YHFormDetailItem(type: .everName, isNeed: false)
item01.value = child.usedName
item01.placeHolder = "请输入".local
let item02 = YHFormDetailItem(type: .befourMarryFirstName, isNeed: false)
item02.value = child.surname
item02.placeHolder = "请输入".local
let item03 = YHFormDetailItem(type: .gender)
item03.value = child.sexName()
let item04 = YHFormDetailItem(type: .marriageState)
item04.value = child.married
let item05 = YHFormDetailItem(type: .birthday)
item05.value = child.birthday
let item06 = YHFormDetailItem(type: .birthNation)
item06.value = String(child.isBirthOverSeas())
let item07 = YHFormDetailItem(type: .birthCity)
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05, item06, item07]
// 职业
if child.isBirthOverSeas() {
item07.value = child.birthPlace?.foreign
item07.placeHolder = "请输入".local
} else {
item07.value = child.birthPlace?.area?.joined(separator: ",")
item07.placeHolder = "请选择".local
}
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]
item10.value = child.occupation
item10.placeHolder = "请选择".local
var arr1:[YHFormItemProtocol] = [title1, item10]
if child.isNowHaveJob() {
let item11 = YHFormDetailItem(type: .occupationName)
item11.value = child.occupationName
item11.placeHolder = "请输入".local
arr1.append(item11)
}
// 婚姻
// 是否前次婚姻子女
let title2 = YHFormTitleItem(type: .isPreviousMarriageChild)
let item20 = YHFormDetailItem(type: .isPreviousMarriageChild)
item20.value = String(child.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]
item30.value = String(child.isNowInHK())
var arr3:[YHFormItemProtocol] = [title3, item30]
if child.isNowInHK() { // 目前在港才显示 逗留期限和在港身份
let item31 = YHFormDetailItem(type: .stayHKDate)
item31.placeHolder = "请选择".local
item31.value = child.childInHk?.info
let item32 = YHFormDetailItem(type: .roleInHK)
item32.placeHolder = "请选择".local
item32.value = child.hkIdentity
arr3.append(contentsOf: [item31, item32])
}
// 香港身份证
let title4 = YHFormTitleItem(type: .hkIdentityCardInfo)
let item40 = YHFormDetailItem(type: .isHaveHkIdentityCard)
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber)
let arr4:[YHFormItemProtocol] = [title4, item40, item41]
item40.value = String(child.isHaveHKIdentityCard())
var arr4:[YHFormItemProtocol] = [title4, item40]
if child.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber)
item41.value = child.hkIdentityCard
arr4.append(item41)
}
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
tableView.reloadData()
......@@ -106,11 +157,21 @@ class YHChildBasicInfoVC: YHBaseViewController {
return .title
}
if item is YHFormAddItem {
return .addItem
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthCity {
var isBirthOverSeas = false
if let child = child {
isBirthOverSeas = child.isBirthOverSeas()
}
if isBirthOverSeas {
return .inputText
} else {
return .selectSheet
}
}
if detailItem.type == .childName
|| detailItem.type == .everName
|| detailItem.type == .befourMarryFirstName
......@@ -120,7 +181,6 @@ class YHChildBasicInfoVC: YHBaseViewController {
return .inputText
}
if detailItem.type == .birthday
|| detailItem.type == .birthCity
|| detailItem.type == .occupation
|| detailItem.type == .stayHKDate
|| detailItem.type == .roleInHK
......@@ -175,39 +235,111 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
return cell
}
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.title = 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
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
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
if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.isMust = detailItem.isNeed
cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle()
cell.text = detailItem.value
cell.textChange = {
[weak self] (text, isEditEnd) in
guard let self = self else { return }
if detailItem.type == .childName {
self.child?.subsetName = text
} else if detailItem.type == .everName {
self.child?.usedName = text
} else if detailItem.type == .befourMarryFirstName {
self.child?.surname = text
} else if detailItem.type == .birthCity {
self.child?.birthPlace?.foreign = text
} else if detailItem.type == .occupationName {
self.child?.occupationName = text
} else if detailItem.type == .hkIdentityCardNumber {
self.child?.hkIdentityCard = text
}
if isEditEnd {
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
}
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDegreeInfoCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDegreeInfoCell
cell.title = item.getTitle()
return cell
if cellType == .selectSheet { // 点击选择列表cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.isMust = detailItem.isNeed
cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
return cell
}
if cellType == .twoChoice { // 双项选择cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed
cell.title = item.getTitle()
cell.answerArr = nil
if detailItem.type == .birthNation { // 出生国家
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "国内".local, isSelect: !select),
YHFormChoiceItem(title: "国外".local, isSelect: select)]
cell.answerArr = answers
cell.answerBlock = {
[weak self] (answers, index) in
guard let self = self else { return }
let selectItem = answers[index]
self.child?.setBirthOverSeas(selectItem.title == "国外".local)
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
} else if detailItem.type == .isHaveHkIdentityCard || detailItem.type == .isNowInHK || detailItem.type == .isPreviousMarriageChild { // 是否办理过香港身份证 是否在岗 是否前次婚姻子女
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),
YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
cell.answerBlock = {
[weak self] (answers, index) in
guard let self = self else { return }
let selectItem = answers[index]
let option = selectItem.title == "是".local
if detailItem.type == .isNowInHK {
self.child?.setNowIsInHK(option)
} else if detailItem.type == .isHaveHkIdentityCard {
self.child?.setHaveHKIdentityCard(option)
} else if detailItem.type == .isPreviousMarriageChild {
self.child?.setPreviousMarriageChild(option)
}
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
}
return cell
}
}
return createDefaultCell(indexPath)
}
......@@ -247,19 +379,120 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
return 52.0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHParentInfoVC()
self.navigationController?.pushViewController(vc)
if !(0..<items.count).contains(indexPath.section) { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if !(0..<arr.count).contains(indexPath.row) { return }
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthday || detailItem.type == .stayHKDate { // 出生日期/获准滞留至
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
guard let self = self else { return }
if detailItem.type == .birthday {
self.child?.birthday = date
} else if detailItem.type == .stayHKDate {
self.child?.childInHk?.info = date
}
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
} else if detailItem.type == .birthCity { // 出生城市
var isBirthOverSeas = false
if let child = child {
isBirthOverSeas = child.isBirthOverSeas()
}
// 出生国外时 出生城市是输入框
if isBirthOverSeas { return }
let vc = YHAddressViewController()
vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in
guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.child?.birthPlace?.area = [string2, string3, string4]
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
self.present(vc, animated: true)
} else if detailItem.type == .roleInHK { // 在港身份
let identity = self.child?.hkIdentity ?? ""
YHFormPickerView.show(type: .identity, selectTitle:identity ) {
[weak self] selectType in
guard let self = self else { return }
self.child?.hkIdentity = selectType.title
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
} else if detailItem.type == .occupation { // 职业
let occupation = self.child?.occupation ?? ""
YHFormPickerView.show(type: .occupation, selectTitle:occupation ) {
[weak self] selectType in
guard let self = self else { return }
self.child?.occupation = selectType.title
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
} else if detailItem.type == .gender { // 性别
guard let child = child else { return }
let isMale = child.isMale()
let selectType:YHFormPickerViewSubType = isMale ? .gender(.male) : .gender(.female)
YHFormPickerView.show(type: .gender, selectType:selectType) {
[weak self] selectType in
guard let self = self else { return }
let selectMale = (selectType.index == YHFormPickerViewSubType.gender(.male).index)
self.child?.setMale(selectMale)
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
} else if detailItem.type == .marriageState { // 婚姻
let marriage = self.child?.married
YHFormPickerView.show(type: .marriage, selectTitle:marriage) {
[weak self] selectType in
guard let self = self else { return }
self.child?.married = selectType.title
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
}
}
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
......
//
// YHChildInfoContainerVC.swift
// galaxy
//
// Created by edy on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
//@objc protocol YHchildInfoVCProtocol {
//
// @objc optional func updateStepView()
// @objc optional func saveInfo()
//}
class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
let familyRequest:YHFamilyRequestViewModel = YHFamilyRequestViewModel()
var orderId:Int = 0
var child:YHFamilyMember? {
didSet {
initalInfoVC.child = child
certificateVC.familyMember = child
basicInfoVC.child = child
}
}
var currentIndex = 0 {
didSet {
currentIndex %= self.children.count
stepView.currentIndex = currentIndex
for (i, vc) in self.children.enumerated() {
vc.view.isHidden = (currentIndex != i)
if currentIndex == i {
}
}
}
}
var stepView:YHStepView = {
let step = YHStepView()
return step
}()
var bottomView: YHSaveAndSubmitView = {
return YHSaveAndSubmitView.createView()
}()
let initalInfoVC = YHChildPrimaryInfoVC()
let uploadVC = UIViewController()
let certificateVC = YHCertificateInfoController()
let basicInfoVC = YHChildBasicInfoVC()
override func viewDidLoad() {
super.viewDidLoad()
createUI()
}
func createUI() {
guard child != nil else { return }
initalInfoVC.delegate = self
certificateVC.delegate = self
basicInfoVC.delegate = self
updateStepView()
currentIndex = 0
view.addSubview(stepView)
view.addSubview(bottomView)
bottomView.submitBlock = {
[weak self] in
guard let self = self else { return }
self.didClickSubmitBtn()
}
bottomView.saveBlock = {
[weak self] in
guard let self = self else { return }
self.saveInfo()
}
stepView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.height.equalTo(YHStepView.height)
}
bottomView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_safeAreaInsetsBottom())
make.height.equalTo(YHSaveAndSubmitView.height)
}
}
func didClickSubmitBtn() {
currentIndex += 1;
}
func updateStepView() {
guard let child = child else { return }
for vc in self.children {
vc.willMove(toParent: nil)
vc.removeFromParent()
}
if child.isFollow() {
self.addChild(initalInfoVC)
self.addChild(uploadVC)
self.addChild(certificateVC)
self.addChild(basicInfoVC)
self.view.addSubview(basicInfoVC.view)
self.view.addSubview(certificateVC.view)
self.view.addSubview(uploadVC.view)
self.view.addSubview(initalInfoVC.view)
stepView.dataSource = ["初始信息".local, "证件上传".local, "证件信息".local, "基本信息".local]
stepView.block = {[weak self] (index) in
guard let self = self else { return }
print("follow:%d", self.orderId)
}
} else {
self.addChild(initalInfoVC)
self.addChild(basicInfoVC)
self.view.addSubview(basicInfoVC.view)
self.view.addSubview(initalInfoVC.view)
stepView.dataSource = ["初始信息".local, "基本信息".local]
stepView.block = {[weak self] (index) in
guard let self = self else { return }
print("follow:%d", self.orderId)
}
}
self.view.bringSubviewToFront(stepView)
self.view.bringSubviewToFront(bottomView)
}
}
extension YHChildInfoContainerVC {
func saveInfo() {
guard let child = child else { return }
guard let info = child.toDictionary() else { return }
let dict:[String: Any] = ["orderId":child.orderId,
"relation":child.relationType.rawValue,
"step":child.step,
"next":false,
"info":info]
self.familyRequest.addOrSaveFamilyMember(params:dict) { [weak self] success, error in
guard let self = self else { return }
if success {
}
}
}
}
......@@ -8,9 +8,10 @@
import UIKit
class YHChildInitialInfoVC: YHBaseViewController {
class YHChildPrimaryInfoVC: YHBaseViewController {
var child:YHFamilyMember?
weak var delegate:YHSpouseInfoVCProtocol?
lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
......@@ -21,6 +22,8 @@ class YHChildInitialInfoVC: YHBaseViewController {
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.estimatedSectionHeaderHeight = 14.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
......@@ -32,50 +35,20 @@ class YHChildInitialInfoVC: YHBaseViewController {
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(YHFormItemQuestionsCell.self, forCellReuseIdentifier: YHFormItemQuestionsCell.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.PFSC_R(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.PFSC_R(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()
loadChildInfo()
}
func loadSponseInfo() {
func loadChildInfo() {
guard let child = child else { return }
......@@ -84,9 +57,11 @@ class YHChildInitialInfoVC: YHBaseViewController {
// 随行
let title0 = YHFormTitleItem(type: .accompany)
let item00 = YHFormDetailItem(type: .ownCustody)
item00.value = String(child.isOwnCustody())
let item01 = YHFormDetailItem(type: .birthday)
item01.value = child.birthday
let item02 = YHFormDetailItem(type: .isAccompanyToHK)
item02.value = String(child.follow == 1)
item02.value = String(child.isFollow())
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02]
items.append(arr0)
......@@ -94,16 +69,54 @@ class YHChildInitialInfoVC: YHBaseViewController {
// 国籍
let title1 = YHFormTitleItem(type: .nationality)
let item10 = YHFormDetailItem(type: .nationOrArea)
item10.value = child.nationality
item10.placeHolder = "请选择".local
let arr1:[YHFormItemProtocol] = [title1, item10]
// 居住信息
var arr2 = [YHFormItemProtocol]()
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type: .isLiveTother)
item20.value = String(child.isLiveTother())
let item21 = YHFormDetailItem(type: .nationOrArea)
let item22 = YHFormDetailItem(type: .liveCity)
let item23 = YHFormDetailItem(type: .detailAddress)
let arr2:[YHFormItemProtocol] = [title2, item20, item21, item22, item23]
arr2.append(title2)
arr2.append(item20)
if !child.isLiveTother() { // 不同住 才需填写国家/地区
let item21 = YHFormDetailItem(type: .nationOrArea)
item21.value = child.address?.country
item21.placeHolder = "请选择".local
arr2.append(item21)
// 国家/地区已填写 才显示现居住城市和详细地址两行
if let address = child.address {
if let country = address.country, !country.isEmpty {
// 居住信息中选择中国才会显示现居住城市
let isLiveInChina = country.contains("中国".local)
if isLiveInChina {
let item22 = YHFormDetailItem(type: .liveCity)
if let area = address.area {
item22.value = area.joined(separator: "/")
}
item22.placeHolder = "请选择城市".local
arr2.append(item22)
}
let item23 = YHFormDetailItem(type: .detailAddress)
item23.value = address.details
item23.placeHolder = (isLiveInChina ? "请填写小区、楼栋、单元室等".local : "请填写国外居住地".local)
arr2.append(item23)
if !isLiveInChina {// 在国外
// 是否在海外居住满1年及以上
let item24 = YHFormDetailItem(type: .isLiveOverSeasMore1Year)
item24.value = String(child.isOverSeasOver1Year())
arr2.append(item24)
}
}
}
}
// 港澳通信证
let title3 = YHFormTitleItem(type: .hkAndMacaoPassport)
......@@ -111,7 +124,6 @@ class YHChildInitialInfoVC: YHBaseViewController {
item30.value = String(child.isNeedHandleHKPassPort())
let arr3:[YHFormItemProtocol] = [title3, item30]
items.append(contentsOf:[arr1, arr2, arr3])
}
tableView.reloadData()
......@@ -120,48 +132,62 @@ class YHChildInitialInfoVC: YHBaseViewController {
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)
}
let topHeight = k_Height_NavigationtBarAndStatuBar+YHStepView.height
let bottomHeight = k_Height_safeAreaInsetsBottom() + YHSaveAndSubmitView.height
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
make.top.equalToSuperview().offset(topHeight)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.bottom.equalToSuperview().offset(-bottomHeight)
}
}
@objc func didClickSubmitBtn() {
}
@objc func didClickSaveBtn() {
func getCellType(_ item: Any) ->HKFormItemCellType {
if item is YHFormTitleItem {
return .title
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthCity {
var isBirthOverSeas = false
if let child = child {
isBirthOverSeas = child.isBirthOverSeas()
}
if isBirthOverSeas {
return .inputText
} else {
return .selectSheet
}
}
if detailItem.type == .detailAddress {
return .inputText
}
if detailItem.type == .nationOrArea
|| detailItem.type == .nationOrArea
|| detailItem.type == .liveCity
|| detailItem.type == .birthday
{
return .selectSheet
}
if detailItem.type == .isAccompanyToHK
|| detailItem.type == .isHandleHKPassPort
|| detailItem.type == .isLiveTother
|| detailItem.type == .isLiveOverSeasMore1Year
|| detailItem.type == .ownCustody
{
return .twoChoice
}
}
return .defaultType
}
}
extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
......@@ -190,10 +216,12 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if item is YHFormDetailItem { // 具体信息
let detailItem = item as! YHFormDetailItem
let cellType = self.getCellType(detailItem)
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother {
if cellType == .twoChoice {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
var select = false
......@@ -209,37 +237,69 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (arr, selectIndex) in
let selectItem:YHFormChoiceItem = arr[selectIndex]
let option = (selectItem.title == "是".local ? true : false)
guard let self = self else { return }
if detailItem.type == .isAccompanyToHK { // 是否随行
let follow = (selectItem.title == "是".local ? 1 : 0)
self?.child?.follow = follow
self?.loadSponseInfo()
self.child?.setFollow(option)
if let delegate = self.delegate {
delegate.updateStepView?()
}
} else if detailItem.type == .isHandleHKPassPort { // 是否办理港澳通行证
let handlePassport = (selectItem.title == "是".local ? 1 : 0)
self?.child?.isHandled = handlePassport
self?.loadSponseInfo()
self.child?.setNeedHandleHKPassPort(option)
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住
let isLiveTother = (selectItem.title == "是".local ? 1 : 0)
self?.child?.finishFollow = (selectItem.title == "是".local ? 1 : 0)
self?.loadSponseInfo()
self.child?.setLiveTother(option)
if option {
self.child?.address?.country = nil
self.child?.address?.details = nil
self.child?.address?.area = nil
}
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.child?.setOverSearsOver1Year(option)
} else if detailItem.type == .ownCustody { // 抚养权
self.child?.setOwnCustody(option)
}
self.loadChildInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
return cell
} else if detailItem.type == .nationOrArea || detailItem.type == .nationOrArea || detailItem.type == .liveCity || detailItem.type == .detailAddress || detailItem.type == .birthday {
} else if cellType == .selectSheet { // 选择列表面板
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.detail = detailItem.value
return cell
} else if detailItem.type == .ownCustody {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemQuestionCell.cellReuseIdentifier, for: indexPath) as! YHFormItemQuestionCell
} else if cellType == .inputText { // 输入文字cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.isMust = detailItem.isNeed
cell.placeHolder = detailItem.placeHolder
cell.title = detailItem.getTitle()
cell.text = detailItem.value
cell.textChange = {
[weak self] (text, isEditEnd) in
guard let self = self else { return }
if detailItem.type == .detailAddress {
self.child?.address?.details = text
}
if isEditEnd {
self.loadChildInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
}
return cell
}
}
......@@ -277,7 +337,9 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
if detailItem.type == .isLiveTother ||
detailItem.type == .isAccompanyToHK ||
detailItem.type == .isHandleHKPassPort ||
detailItem.type == .ownCustody
detailItem.type == .ownCustody ||
detailItem.type == .isLiveOverSeasMore1Year
{
return UITableView.automaticDimension
}
......@@ -285,19 +347,72 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
return 52.0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHChildBasicInfoVC()
self.navigationController?.pushViewController(vc)
if !(0..<items.count).contains(indexPath.section) { return }
let arr:[YHFormItemProtocol] = items[indexPath.section]
if !(0..<arr.count).contains(indexPath.row) { return }
let item = arr[indexPath.row]
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
// 选国籍/现居住城市/详细地址
if detailItem.type == .nationOrArea {
let vc = YHSelectCountryViewController()
vc.backLocationStringController = {
[weak self] country in
guard let self = self else { return }
let title = arr[0] as! YHFormTitleItem
if title.type == .nationality {
self.child?.nationality = country
} else if title.type == .liveInfo {
self.child?.address?.country = country
}
self.loadChildInfo()
}
self.navigationController?.pushViewController(vc)
} else if detailItem.type == .liveCity {
let vc = YHAddressViewController()
vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in
guard let self = self else { return }
print("\(string1)\n\(string2)\n\(string3)\n\(string4)")
self.child?.address?.area = [string2, string3, string4]
self.loadChildInfo()
}
self.present(vc, animated: true)
} else if detailItem.type == .birthday { // 出生日期
YHDatePickView.show(type: .yyyymmdd) { [weak self] date in
guard let self = self else { return }
if detailItem.type == .birthday {
self.child?.birthday = date
}
self.loadChildInfo()
}
}
}
}
func createCorner(cell:UITableViewCell, arr:Array<Any>, indexPath:IndexPath) {
......@@ -318,3 +433,5 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
}
}
......@@ -14,7 +14,7 @@ enum YHFormTitleItemEditType:Int {
case canCancel = 3
}
class YHFamilyMemberFormVC: YHBaseViewController {
class YHFamilyMemberInfoVC: YHBaseViewController {
var orderId:Int
let familyRequest:YHFamilyRequestViewModel = YHFamilyRequestViewModel()
......@@ -186,7 +186,7 @@ class YHFamilyMemberFormVC: YHBaseViewController {
}
}
extension YHFamilyMemberFormVC {
extension YHFamilyMemberInfoVC {
// 请求家庭成员信息
func requestFamilyInfo() {
......@@ -232,7 +232,7 @@ extension YHFamilyMemberFormVC {
}
}
extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
......@@ -456,7 +456,7 @@ extension YHFamilyMemberFormVC : UITableViewDelegate, UITableViewDataSource {
// 子女
if detailItem.relationType == .child {
let vc = YHChildInitialInfoVC()
let vc = YHChildInfoContainerVC()
vc.child = detailItem
self.navigationController?.pushViewController(vc)
return
......
......@@ -267,7 +267,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
[weak self] (text, isEditEnd) in
guard let self = self else { return }
if detailItem.type == .fatherName {
if detailItem.type == .fatherName || detailItem.type == .motherName {
self.parentInfo?.subsetName = text
} else if detailItem.type == .birthCity {
......
......@@ -118,14 +118,16 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
let item10 = YHFormDetailItem(type: .occupation)
item10.value = spouse.occupation
item10.placeHolder = "请输入".local
let item11 = YHFormDetailItem(type: .occupationName)
item11.value = spouse.occupationName
item11.placeHolder = "请输入".local
let arr1:[YHFormItemProtocol] = [title1, item10, item11]
var arr1:[YHFormItemProtocol] = [title1, item10]
// 职业信息
if spouse.isNowHaveJob() {
let item11 = YHFormDetailItem(type: .occupationName)
item11.value = spouse.occupationName
item11.placeHolder = "请输入".local
arr1.append(item11)
}
// 学位信息
let title2 = YHFormTitleItem(type: .degreeInfo)
let item20 = YHFormDetailItem(type: .ownDegree)
item20.placeHolder = "请选择".local
......@@ -306,6 +308,13 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .hkIdentityCardNumber {
self.spouse?.hkIdentityCard = text
}
if isEditEnd {
self.loadBasicInfo()
if let delegate = delegate {
delegate.saveInfo?()
}
}
}
return cell
}
......@@ -503,7 +512,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
var isBirthOverSeas = false
if let spouse = spouse {
isBirthOverSeas = spouse.isOverSeasOver1Year()
isBirthOverSeas = spouse.isBirthOverSeas()
}
// 出生国外时 出生城市是输入框
if isBirthOverSeas { return }
......
......@@ -51,7 +51,7 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
return YHSaveAndSubmitView.createView()
}()
let initalInfoVC = YHSpouseInitialInfoVC()
let initalInfoVC = YHSpousePrimaryInfoVC()
let uploadVC = UIViewController()
let certificateVC = YHCertificateInfoController()
let basicInfoVC = YHSpouseBasicInfoVC()
......@@ -157,22 +157,11 @@ extension YHSpouseInfoContainerVC {
func saveInfo() {
guard let spouse = spouse else { return }
guard var info = spouse.toDictionary() else { return }
// let certi = [ "cnIdentityCard":
// ["id":116871,"number":"421087199005010811","issue_at":"深圳","issue_date_start_at":"2017-01-01","issue_date_end_at":"2029-01-01","img_front":"","img_back":""],
// "passport":["id":116872,"number":"421087199005010811","issue_at":"深圳","issue_date_start_at":"2020-01-01","issue_date_end_at":"2023-01-01","img_front":"","img_back":"","passport_type":3],
// "hkMacaoPass":["id":118182,"number":"P103265(1)","issue_at":"SFAA","issue_date_start_at":"2024-01-31","issue_date_end_at":"2024-01-31","img_front":"","img_back":""]
// ]
//
// if let cer = info["certificates"] {
// info["certificates"] = certi
// }
let cer = info["certificates"]
let dict:[String: Any] = ["orderId":self.orderId,
guard let info = spouse.toDictionary() else { return }
let dict:[String: Any] = ["orderId":spouse.orderId,
"relation":spouse.relationType.rawValue,
"step":0,
"step":spouse.step,
"next":false,
"info":info]
......
......@@ -9,7 +9,7 @@
import UIKit
import SmartCodable
class YHSpouseInitialInfoVC: YHBaseViewController {
class YHSpousePrimaryInfoVC: YHBaseViewController {
var spouse:YHFamilyMember?
weak var delegate:YHSpouseInfoVCProtocol?
......@@ -141,7 +141,7 @@ class YHSpouseInitialInfoVC: YHBaseViewController {
}
extension YHSpouseInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
......
......@@ -483,6 +483,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var id: Int = 0
// 是否已故
var deceased: Int = 0
// 主申请人和现配偶是否拥有孩子抚养权
var custody: Int = 0
// 国籍
var nationality: String?
......@@ -522,7 +523,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var operatorAme: SmartAny?
// 香港身份证号
var hkIdentityCard: String?
// 性别
// 性别 男:1 女:2
var sex: Int = 0
// 婚姻状况
var married: String?
......@@ -533,6 +534,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
// 香港身份证信息
var childHasHkId: YHChildStepchildClass?
// 是否前次婚姻子女
var childStepchild: YHChildStepchildClass?
// 在港信息
var childInHk: YHChildStepchildClass?
......@@ -711,6 +713,43 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
return self.occupation == "在职"
}
// 主申请人和现配偶是否拥有孩子抚养权
func isOwnCustody() -> Bool {
return self.custody == 1
}
func setOwnCustody(_ val:Bool) {
self.custody = val ? 1 : 0
}
// 是否是男性
func isMale() -> Bool {
return self.sex == 1
}
func setMale(_ val: Bool) {
self.sex = (val ? 1 : 2)
}
func sexName() -> String? {
if self.sex == 1 {
return "男".local
} else if self.sex == 2 {
return "女".local
}
return ""
}
// 是否前一次婚姻子女
func isPreviousMarriageChild() -> Bool {
return self.childStepchild?.has == "Y"
}
func setPreviousMarriageChild(_ val: Bool) {
self.childStepchild?.has = (val ? "Y" : "N")
}
var relationType:YHFamilyMemberType {
if relation == "1" {
......
......@@ -22,6 +22,7 @@ class YHFamilyRequestViewModel {
YHHUD.hide()
guard let self = self else { return }
guard let model = NetBaseModel.deserialize(dict: json) else {
let error : YHErrorModel = YHErrorModel(errorCode:YHErrorCode.dictParseError.rawValue,errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,error)
......@@ -29,8 +30,39 @@ class YHFamilyRequestViewModel {
}
printLog("model 是 ==> \(model)")
let dic = model.data?.peel as? [AnyHashable : Any]
let spouse = dic?["spouse"] as? [String: Any]
let arr = spouse?["has_degree_json"]
guard var dic = dic else { return }
#if DEBUG
if let child = dic["child"], child is [[String: Any]] {
var child = child as! [[String: Any]]
for (index, dic) in child.enumerated() {
var d = dic
d["certificates"] = [String: Any]()
child[index] = d
}
dic["child"] = child
}
if let brother = dic["brother"], brother is [[String: Any]] {
var brother = brother as! [[String: Any]]
for (index, dic) in brother.enumerated() {
var d = dic
d["certificates"] = [String: Any]()
// ["cnIdentityCard":"",
// "passport":"",
// "hkMacaoPass":""]
brother[index] = d
}
dic["brother"] = brother
}
#endif
guard let resultModel = YHFamilyMemberGroupInfo.deserialize(dict: dic as? [AnyHashable : Any]) else {
......
//
// YHCheckQuestionCell.swift
// YHFormItemQuestionsCell.swift
// galaxy
//
// Created by edy on 2024/1/22.
// Created by edy on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFormItemQuestionCell: UITableViewCell {
class YHFormItemQuestionsCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormItemQuestionCell"
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
static let cellReuseIdentifier = "YHFormItemQuestionsCell"
var responseBlock:((Bool)->Void)?
private let btnWidth = 70.0
private let btnHeight = 32.0
private let btnTitleSelectColor = UIColor.brandMainColor
private let btnTitleDefaultColor = UIColor.mainTextColor
private let btnBgDefaultColor = UIColor.contentBkgColor
private let btnBgSelectColor = UIColor.brandMainColor.withAlphaComponent(0.08)
private let answerBaseTag = 9527
var title:String? {
didSet {
// 是否必须字段
var isMust:Bool = false
var answerBlock:(([YHFormChoiceItem], Int)->Void)?
var title:String? {
didSet {
if let question = title {
let str = "*"+question
if let title = title, !title.isEmpty {
let str = (isMust ? ("*"+title) : title)
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 14),
.foregroundColor: UIColor(hex:0x222222)
]
.foregroundColor: UIColor.mainTextColor]
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)
if isMust {
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
}
titleLabel.attributedText = questionAttrStr
} else {
titleLabel.text = ""
}
}
}
var response:Bool = false {
// 必须传2个item的arr
var answerArr:[YHFormChoiceItem]? {
didSet {
showResponse(response)
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)
}
}
}
}
lazy var titleLabel: UILabel = {
// 更新答案按钮选中状态
private 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)
}
private lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.textColor = UIColor(hexString:"#333333")
label.textColor = .mainTextColor
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
label.lineBreakMode = .byCharWrapping
return label
}()
lazy var confirmBtn: UIButton = {
private lazy var answer1Btn: UIButton = {
let btn = UIButton()
btn.setTitle("是".local, for: .normal)
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgColor
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 = {
private lazy var answer2Btn: UIButton = {
let btn = UIButton()
btn.setTitle("否".local, for: .normal)
btn.setTitle("", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(btnTitleDefaultColor, for: .normal)
btn.backgroundColor = btnBgColor
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
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
......@@ -98,44 +129,44 @@ class YHFormItemQuestionCell: UITableViewCell {
self.selectionStyle = .none
title = " 1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪?是否曾在香港或其他地方因任何罪行或违法行为被定罪? "
contentView.addSubview(titleLabel)
contentView.addSubview(negativeBtn)
contentView.addSubview(confirmBtn)
// 默认选择否按钮
response = false
contentView.addSubview(answer2Btn)
contentView.addSubview(answer1Btn)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(contentView.snp.top).offset(12)
make.top.equalTo(contentView.snp.top).offset(22)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.bottom.equalTo(answer1Btn.snp.top).offset(-16)
}
negativeBtn.snp.makeConstraints { make in
answer1Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalTo(titleLabel)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.bottom.equalToSuperview().offset(-16)
}
confirmBtn.snp.makeConstraints { make in
answer2Btn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: btnWidth, height: btnHeight))
make.left.equalTo(negativeBtn.snp.right).offset(12)
make.centerY.equalTo(negativeBtn)
make.left.equalTo(answer1Btn.snp.right).offset(16)
make.centerY.equalTo(answer1Btn)
}
}
@objc func didClickResponseBtn(btn: UIButton) {
response = (btn.tag == confirmTag)
if let responseBlock = responseBlock {
responseBlock(btn.tag==confirmTag)
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)
}
}
}
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)
}
}
......@@ -32,6 +32,46 @@ class YHSaveAndSubmitView: UIView {
self.layoutIfNeeded()
}
}
// 是否隐藏提交按钮
var isHiddenSubmit:Bool = false {
didSet {
self.submitBtn.isHidden = isHiddenSubmit
if isHiddenSubmit {
saveBtn.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(16)
make.height.equalTo(Self.submitBtnHeight)
make.right.equalToSuperview().offset(-16)
make.top.equalTo(Self.gap)
}
submitBtn.snp.remakeConstraints { make in
make.width.equalTo(isHiddenSave ? 0 : Self.saveBtnWidth)
make.height.equalTo(Self.submitBtnHeight)
make.centerY.equalTo(saveBtn)
make.right.equalToSuperview()
}
} else {
saveBtn.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(16)
make.height.equalTo(Self.submitBtnHeight)
make.width.equalTo(Self.saveBtnWidth)
make.top.equalTo(Self.gap)
}
submitBtn.snp.remakeConstraints { make in
make.left.equalTo(saveBtn.snp.right).offset(10)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(Self.submitBtnHeight)
make.centerY.equalTo(saveBtn)
}
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
lazy var submitBtn:UIButton = {
let btn = UIButton()
......
//
// YHCodeSueecssViewController.swift
// galaxy
//
// Created by EDY on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCodeSueecssViewController: YHBaseViewController {
var time = 60
var bgImageView: UIImageView!
var closeButton: UIButton!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
var getCodeLabel: UILabel!
var getCodeButton: UIButton!
var smscodeView: YHSmsCodeInputView!
override func viewDidLoad() {
super.viewDidLoad()
gk_navBackgroundColor = .clear
gk_navShadowColor = .clear
gk_navigationBar.isHidden = true
setView()
// Do any additional setup after loading the view.
startClicked()
}
func setView() {
view.backgroundColor = .white
bgImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_phone_bg_image")
imageView.isUserInteractionEnabled = true
return imageView
}()
view.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.left.right.top.equalTo(view)
make.height.equalTo(300)
}
closeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "login_back"), for: .normal)
button.addTarget(self, action: #selector(close), for: .touchUpInside)
return button
}()
view.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.left.equalTo(13)
make.top.equalTo(51)
make.width.height.equalTo(30)
}
loginTitleLabel = {
let label = UILabel()
label.text = "请输入验证码"
label.font = kBoldFont(size: 28)
label.textColor = UIColor(hex:0x222222)
return label
}()
view.addSubview(loginTitleLabel)
loginTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(203)
make.height.equalTo(25)
}
loginSubTitleLabel = {
let label = UILabel()
label.text = "已发送至 +86 188****2882"
label.font = kFont(size: 13)
label.textColor = UIColor(hex:0xc0c0c0)
return label
}()
view.addSubview(loginSubTitleLabel)
loginSubTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(233)
make.height.equalTo(20)
}
smscodeView = {
let view = YHSmsCodeInputView(config: YHSmsCodeViewConfig())
view.complete = { [weak self] code in
self?.dismiss(animated: true)
}
return view
}()
view.addSubview(smscodeView)
smscodeView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(288)
make.height.equalTo(55)
}
getCodeLabel = {
let button = UILabel()
button.font = kBoldFont(size: 12)
button.text = "重新发送(58s)"
button.textColor = UIColor(hex:0xc0c0c0)
button.textAlignment = .center
button.isHidden = false
button.layer.cornerRadius = 4
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0xebeef4).cgColor
return button
}()
view.addSubview(getCodeLabel)
getCodeLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(382)
make.height.equalTo(28)
make.width.equalTo(91)
}
getCodeButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 12)
button.contentHorizontalAlignment = .center
button.setTitle("获取验证码", for: .normal)
button.setTitleColor( UIColor(hex:0x222222), for: .normal)
button.addTarget(self, action: #selector(startClicked), for: .touchUpInside)
button.isHidden = true
button.layer.cornerRadius = 4
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0xebeef4).cgColor
return button
}()
view.addSubview(getCodeButton)
getCodeButton.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(382)
make.height.equalTo(28)
make.width.equalTo(91)
}
//测试
}
@objc func startClicked() {
getCodeLabel.isHidden = false
getCodeButton.isHidden = true
let sourceTimer = DispatchSource.makeTimerSource()
sourceTimer.schedule(deadline: DispatchTime.now(), repeating: DispatchTimeInterval.milliseconds(1000), leeway: DispatchTimeInterval.milliseconds(0))
sourceTimer.setEventHandler {
if self.time != 0 {
self.time -= 1
DispatchQueue.main.async {
self.getCodeLabel?.text = String.localizedStringWithFormat("重新获取(%ds)",self.time)
}
} else if self.time <= 0 {
sourceTimer.cancel()
DispatchQueue.main.async {
// self.getCodeLabel?.text = "获取验证码"
self.time = 60
self.getCodeLabel.isHidden = true
self.getCodeButton.isHidden = false
}
}
}
// 启动定时器
sourceTimer.resume()
}
@objc func close() {
self.navigationController?.popViewController()
}
}
//
// YHPhoneLoginViewController.swift
// galaxy
//
// Created by EDY on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPhoneLoginViewController: YHBaseViewController {
var bgImageView: UIImageView!
var closeButton: UIButton!
var logImageView: UIImageView!
var loginTitleLabel: UILabel!
var loginSubTitleLabel: UILabel!
var phoneMessageView: YHPhoneMessageView!
var getCodeButton: UIButton!
var privacyView: YHLoginPrivacyView!
override func viewDidLoad() {
super.viewDidLoad()
setView()
gk_navBackgroundColor = .clear
gk_navShadowColor = .clear
gk_navigationBar.isHidden = true
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
YHAnalytics.timeStrat("loginTime")
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
YHAnalytics.timeEnd("loginTime")
}
func setView() {
view.backgroundColor = .white
bgImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_phone_bg_image")
imageView.isUserInteractionEnabled = true
return imageView
}()
view.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.left.right.top.equalTo(view)
make.height.equalTo(300)
}
closeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "login_close"), for: .normal)
button.addTarget(self, action: #selector(close), for: .touchUpInside)
return button
}()
view.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.left.equalTo(13)
make.top.equalTo(51)
make.width.height.equalTo(30)
}
logImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "login_phone_log_image")
return imageView
}()
view.addSubview(logImageView)
logImageView.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.height.equalTo(53)
make.top.equalTo(120)
}
loginTitleLabel = {
let label = UILabel()
label.text = "手机号登录"
label.font = kBoldFont(size: 28)
label.textColor = UIColor(hex:0x222222)
return label
}()
view.addSubview(loginTitleLabel)
loginTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(203)
make.height.equalTo(25)
}
loginSubTitleLabel = {
let label = UILabel()
label.text = "手机号首次登录自动注册"
label.font = kFont(size: 13)
label.textColor = UIColor(hex:0xc0c0c0)
return label
}()
view.addSubview(loginSubTitleLabel)
loginSubTitleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(233)
make.height.equalTo(20)
}
phoneMessageView = {
let view = YHPhoneMessageView()
view.backgroundColor = UIColor(hex:0xf8f9fb)
view.layer.cornerRadius = 6
view.layer.borderWidth = 1
view.layer.borderColor = UIColor(hex:0xebeef4).cgColor
return view
}()
view.addSubview(phoneMessageView)
phoneMessageView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(300)
make.height.equalTo(56)
}
getCodeButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x2274ee).withAlphaComponent(0.8)
button.titleLabel?.font = kBoldFont(size: 16)
button.contentHorizontalAlignment = .center
button.setTitle("获取验证码", for: .normal)
button.setTitleColor( UIColor(hex:0x979797), for: .normal)
button.layer.cornerRadius = 6
button.addTarget(self, action: #selector(getCode), for: .touchUpInside)
return button
}()
view.addSubview(getCodeButton)
getCodeButton.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalTo(376)
make.height.equalTo(48)
}
privacyView = {
let view = YHLoginPrivacyView()
return view
}()
view.addSubview(privacyView)
privacyView.snp.makeConstraints { make in
make.top.equalTo(442)
make.left.equalTo(25)
make.height.equalTo(20)
make.width.equalTo(260)
}
//测试
}
@objc func getCode() {
if privacyView.isAgree {
let vc = YHCodeSueecssViewController()
self.navigationController?.pushViewController(vc)
} else {
let view = YHPrivacyAlertView(frame: view.bounds)
view.urlBlock = { [weak self] url in
guard let self = self else { return }
let vc = YHWebViewViewController()
vc.url = url
self.navigationController?.pushViewController(vc)
}
view.agreeBlock = { [weak self] in
guard let self = self else { return }
self.privacyView.isAgree = true
self.getCode()
}
self.view.addSubview(view)
}
}
@objc func close() {
self.dismiss(animated: true)
}
}
//
// YHWebViewViewController.swift
// galaxy
//
// Created by EDY on 2024/2/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import WebKit
class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
var webview = WKWebView()
var progBar = UIProgressView()
var url = "https://www.baidu.com"
override func viewDidLoad() {
super.viewDidLoad()
//获取导航栏高度
let navHeight = self.navigationController?.navigationBar.frame.height
//获取状态栏高度
let statusHeight = k_Height_statusBar()
// 创建wkwebview
webview = WKWebView(frame: CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height))
webview.navigationDelegate = self
// 创建网址
let url = NSURL(string: url)
// 创建请求
let request = NSURLRequest(url: url! as URL)
// 加载请求
webview.load(request as URLRequest)
// 添加wkwebview
self.view.addSubview(webview)
// 加载网页的进度条
progBar = UIProgressView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 30))
progBar.progress = 0.0
progBar.tintColor = UIColor.red
webview.addSubview(progBar)
// 监听网页加载的进度
webview.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
}
override func viewWillDisappear(_ animated: Bool) {
webview.removeObserver(self, forKeyPath: "estimatedProgress")
}
// MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.navigationItem.title = webview.title
}
// MARK: - WKUIDelegate
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
// 实现非安全链接的跳转。如果目标主视图不为空,则允许导航
if !(navigationAction.targetFrame?.isMainFrame != nil) {
webview.load(navigationAction.request)
}
return nil
}
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {
// 修复弹窗弹出的问题
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
completionHandler()
}))
self.present(alert, animated: true, completion: nil)
}
// MARK: - webview function
@objc func toBack() {
if webview.canGoBack {
webview.goBack()
}
}
@objc func toForward() {
if webview.canGoForward {
webview.goForward()
}
}
// MARK: - KVO
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "estimatedProgress" {
self.progBar.alpha = 1.0
progBar.setProgress(Float(webview.estimatedProgress), animated: true)
//进度条的值最大为1.0
if(self.webview.estimatedProgress >= 1.0) {
UIView.animate(withDuration: 0.3, delay: 0.1, options: .curveEaseInOut, animations: { () -> Void in
self.progBar.alpha = 0.0
}, completion: { (finished:Bool) -> Void in
self.progBar.progress = 0
})
}
}
}
override class func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
}
}
......@@ -45,7 +45,7 @@ class YHLoginPrivacyView: UIView {
let label = UILabel()
label.text = "我已阅读并同意"
label.font = kFont(size: 12)
label.textColor = UIColor(hex:0xffffff)
label.textColor = UIColor(hex:0x888f98)
label.textAlignment = .left
return label
}()
......@@ -60,7 +60,8 @@ class YHLoginPrivacyView: UIView {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 12)
button.contentHorizontalAlignment = .center
button.setTitle("《银河服务条款》", for: .normal)
button.setTitle("《隐私协议》", for: .normal)
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .normal)
return button
}()
addSubview(serviceButton)
......@@ -68,13 +69,13 @@ class YHLoginPrivacyView: UIView {
make.left.equalTo(messageLabel.snp.right).offset(1)
make.centerY.equalToSuperview()
make.height.equalTo(20)
make.width.equalTo(96)
make.width.equalTo(80)
}
andLabel = {
let label = UILabel()
label.text = "和"
label.font = kFont(size: 12)
label.textColor = UIColor(hex:0xffffff)
label.textColor = UIColor(hex:0x888f98)
label.textAlignment = .left
return label
}()
......@@ -88,7 +89,8 @@ class YHLoginPrivacyView: UIView {
let button = UIButton(type: .custom)
button.titleLabel?.font = kBoldFont(size: 12)
button.contentHorizontalAlignment = .center
button.setTitle("《银河隐私政策》", for: .normal)
button.setTitle("《用户条款》", for: .normal)
button.setTitleColor(UIColor(hex: 0x2f7ef6), for: .normal)
return button
}()
addSubview(privacyButton)
......@@ -96,7 +98,7 @@ class YHLoginPrivacyView: UIView {
make.left.equalTo(andLabel.snp.right).offset(1)
make.centerY.equalToSuperview()
make.height.equalTo(20)
make.width.equalTo(96)
make.width.equalTo(80)
}
}
......
......@@ -7,10 +7,13 @@
//
import UIKit
import AttributedString
class YHPrivacyAlertView: UIView {
typealias Block = () -> ()
var block: Block?
typealias UrlBlock = (_ url: String) -> ()
typealias AgreeBlock = () -> ()
var urlBlock: UrlBlock?
var agreeBlock: AgreeBlock?
var centerView: UIView!
var titleLabel: UILabel!
var messageLabel: UILabel!
......@@ -45,30 +48,28 @@ class YHPrivacyAlertView: UIView {
make.height.equalTo(187)
}
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: 14)
label.textColor = UIColor(hex:0x222222)
label.textAlignment = .left
label.textAlignment = .center
label.numberOfLines = 0
return label
}()
let aa: ASAttributedString = .init("请先阅读并同意", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let cc: ASAttributedString = .init("《隐私协议》", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.brandMainColor), .action {
if let block = self.urlBlock {
block("https://www.baidu.com")
}
})
let bb: ASAttributedString = .init("和", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let dd: ASAttributedString = .init("《用户条款》", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.brandMainColor), .action {
if let block = self.urlBlock {
block("https://www.baidu.com")
}
})
messageLabel.attributed.text = aa + cc + bb + dd
centerView.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(22)
......@@ -120,10 +121,10 @@ class YHPrivacyAlertView: UIView {
}
@objc func agree() {
if let block = block {
if let block = self.agreeBlock {
block()
dismiss()
}
dismiss()
}
@objc private func handleTap(_ sender: AnyObject?) {
......
......@@ -10,16 +10,16 @@ import UIKit
// 输入框UI显示配置
struct YHSmsCodeViewConfig {
var textColor : UIColor? = .white
var bgColor : UIColor? = .init(white: 1, alpha: 0.3)
var cursorColor : UIColor? = .black
var textColor : UIColor? = UIColor(hex: 0x000000)
var bgColor : UIColor? = UIColor(hex: 0xebeef4)
var cursorColor : UIColor? = UIColor(hex: 0x2f7ef6)
var font: UIFont? = .systemFont(ofSize: 20)
// 展示输入框个数
var count : Int = 6
var width : Double = 45.0
var height : Double = 55.0
var height : Double = 50.0
// 输入框之间间距
var gap:Double = 9
var gap:Double = 10
}
let codeViewBaseTag = 9527
......
......@@ -15,9 +15,12 @@ class YHSmsCodeView: UIView {
if showCursor {
self.cursor.layer .removeAllAnimations()
self.animaitonShow(true)
self.layer.borderWidth = 1
self.layer.borderColor = UIColor(hex: 0x2f7ef6).cgColor
} else {
self.cursor.layer .removeAllAnimations()
self.cursor.isHidden = true
self.layer.borderWidth = 0
}
}
}
......@@ -36,7 +39,7 @@ class YHSmsCodeView: UIView {
var cursor : UIView = {
let cursor = UIView()
cursor.backgroundColor = .black
cursor.backgroundColor = UIColor(hex: 0x2f7ef6)
cursor.isHidden = true
return cursor
}()
......
......@@ -126,9 +126,11 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if (indexPath.row >= items.count) { return }
let vc = YHFamilyMemberFormVC(orderId: 133971)
self.navigationController?.pushViewController(vc)
let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
// let vc = YHFamilyMemberFormVC(orderId: 133971)
// self.navigationController?.pushViewController(vc)
return
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_back@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_close@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_close@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_phone_bg_image@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_phone_bg_image@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "login_phone_log_image@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_phone_log_image@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