Commit c3bdc5571b292236ae80ac26c292c1ae9ef51de4
1 parent
23f29594
预览简历-第一个实名cell
Showing
10 changed files
with
807 additions
and
2 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -10,6 +10,12 @@ |
| 10 | 10 | 1909DC962C6309EC001E7986 /* CNLiveDigitalResumePreViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DC952C6309EC001E7986 /* CNLiveDigitalResumePreViewController.swift */; }; |
| 11 | 11 | 1909DC982C6342C4001E7986 /* CNLiveDigitalThreeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DC972C6342C3001E7986 /* CNLiveDigitalThreeCell.swift */; }; |
| 12 | 12 | 1909DC9B2C634D6F001E7986 /* CNLiveDigitalThreeCerCollectCell .swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DC9A2C634D6F001E7986 /* CNLiveDigitalThreeCerCollectCell .swift */; }; |
| 13 | + 1909DC9E2C637339001E7986 /* CNLiveDigitalResumePreViewFirCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DC9D2C637339001E7986 /* CNLiveDigitalResumePreViewFirCell.swift */; }; | |
| 14 | + 1909DCA02C637349001E7986 /* CNLiveDigitalResumePreViewSecCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DC9F2C637349001E7986 /* CNLiveDigitalResumePreViewSecCell.swift */; }; | |
| 15 | + 1909DCA22C637353001E7986 /* CNLiveDigitalResumePreviewThreeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DCA12C637353001E7986 /* CNLiveDigitalResumePreviewThreeCell.swift */; }; | |
| 16 | + 1909DCA52C63736C001E7986 /* CNLiveDigitalResumePreviewFourCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DCA42C63736C001E7986 /* CNLiveDigitalResumePreviewFourCell.swift */; }; | |
| 17 | + 1909DCA72C637378001E7986 /* CNLiveDigitalResumePreviewFiveCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DCA62C637378001E7986 /* CNLiveDigitalResumePreviewFiveCell.swift */; }; | |
| 18 | + 1909DCA92C63738C001E7986 /* CNLiveDigitalResumePreviewSixCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1909DCA82C63738C001E7986 /* CNLiveDigitalResumePreviewSixCell.swift */; }; | |
| 13 | 19 | 19123FC12ABC11170075C883 /* CNWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19123FC02ABC11170075C883 /* CNWebViewController.swift */; }; |
| 14 | 20 | 1917328E2B032583007BCC04 /* CNLiveRoundedRectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1917328D2B032583007BCC04 /* CNLiveRoundedRectView.swift */; }; |
| 15 | 21 | 191732902B0348F6007BCC04 /* CNLiveSwitchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1917328F2B0348F6007BCC04 /* CNLiveSwitchView.swift */; }; |
| ... | ... | @@ -350,6 +356,12 @@ |
| 350 | 356 | 1909DC952C6309EC001E7986 /* CNLiveDigitalResumePreViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumePreViewController.swift; sourceTree = "<group>"; }; |
| 351 | 357 | 1909DC972C6342C3001E7986 /* CNLiveDigitalThreeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalThreeCell.swift; sourceTree = "<group>"; }; |
| 352 | 358 | 1909DC9A2C634D6F001E7986 /* CNLiveDigitalThreeCerCollectCell .swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CNLiveDigitalThreeCerCollectCell .swift"; sourceTree = "<group>"; }; |
| 359 | + 1909DC9D2C637339001E7986 /* CNLiveDigitalResumePreViewFirCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumePreViewFirCell.swift; sourceTree = "<group>"; }; | |
| 360 | + 1909DC9F2C637349001E7986 /* CNLiveDigitalResumePreViewSecCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumePreViewSecCell.swift; sourceTree = "<group>"; }; | |
| 361 | + 1909DCA12C637353001E7986 /* CNLiveDigitalResumePreviewThreeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumePreviewThreeCell.swift; sourceTree = "<group>"; }; | |
| 362 | + 1909DCA42C63736C001E7986 /* CNLiveDigitalResumePreviewFourCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumePreviewFourCell.swift; sourceTree = "<group>"; }; | |
| 363 | + 1909DCA62C637378001E7986 /* CNLiveDigitalResumePreviewFiveCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumePreviewFiveCell.swift; sourceTree = "<group>"; }; | |
| 364 | + 1909DCA82C63738C001E7986 /* CNLiveDigitalResumePreviewSixCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumePreviewSixCell.swift; sourceTree = "<group>"; }; | |
| 353 | 365 | 19123FC02ABC11170075C883 /* CNWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNWebViewController.swift; sourceTree = "<group>"; }; |
| 354 | 366 | 1917328D2B032583007BCC04 /* CNLiveRoundedRectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveRoundedRectView.swift; sourceTree = "<group>"; }; |
| 355 | 367 | 1917328F2B0348F6007BCC04 /* CNLiveSwitchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveSwitchView.swift; sourceTree = "<group>"; }; |
| ... | ... | @@ -754,6 +766,19 @@ |
| 754 | 766 | path = "数字资产cell"; |
| 755 | 767 | sourceTree = "<group>"; |
| 756 | 768 | }; |
| 769 | + 1909DC9C2C637323001E7986 /* 我的简历cell */ = { | |
| 770 | + isa = PBXGroup; | |
| 771 | + children = ( | |
| 772 | + 1909DC9D2C637339001E7986 /* CNLiveDigitalResumePreViewFirCell.swift */, | |
| 773 | + 1909DC9F2C637349001E7986 /* CNLiveDigitalResumePreViewSecCell.swift */, | |
| 774 | + 1909DCA12C637353001E7986 /* CNLiveDigitalResumePreviewThreeCell.swift */, | |
| 775 | + 1909DCA42C63736C001E7986 /* CNLiveDigitalResumePreviewFourCell.swift */, | |
| 776 | + 1909DCA62C637378001E7986 /* CNLiveDigitalResumePreviewFiveCell.swift */, | |
| 777 | + 1909DCA82C63738C001E7986 /* CNLiveDigitalResumePreviewSixCell.swift */, | |
| 778 | + ); | |
| 779 | + path = "我的简历cell"; | |
| 780 | + sourceTree = "<group>"; | |
| 781 | + }; | |
| 757 | 782 | 191732F62B08AAD4007BCC04 /* ShopClassify */ = { |
| 758 | 783 | isa = PBXGroup; |
| 759 | 784 | children = ( |
| ... | ... | @@ -1290,6 +1315,7 @@ |
| 1290 | 1315 | 19C735C82C1063A000CACF4E /* DigitalAuthViews */ = { |
| 1291 | 1316 | isa = PBXGroup; |
| 1292 | 1317 | children = ( |
| 1318 | + 1909DC9C2C637323001E7986 /* 我的简历cell */, | |
| 1293 | 1319 | 1909DC992C634D59001E7986 /* 数字资产cell */, |
| 1294 | 1320 | 192ED46E2C5217A00057244C /* Vitae */, |
| 1295 | 1321 | 19DFE6472C44BE9500E428AE /* DigitalResume */, |
| ... | ... | @@ -2079,6 +2105,7 @@ |
| 2079 | 2105 | 19BB1FEE2AF0E1EC0094D962 /* CNLiveShopDetailViewModel.swift in Sources */, |
| 2080 | 2106 | 1917334C2B2BE9CA007BCC04 /* CNLiveCreateCouponTypeMoneyView.swift in Sources */, |
| 2081 | 2107 | 191733002B0B58E5007BCC04 /* CNLiveSelectUploadImageModel.swift in Sources */, |
| 2108 | + 1909DCA72C637378001E7986 /* CNLiveDigitalResumePreviewFiveCell.swift in Sources */, | |
| 2082 | 2109 | 19F1C2332AB5728B0083D06C /* CNIDCardView.swift in Sources */, |
| 2083 | 2110 | 19C0F7692BD9F9F70097CC8F /* CNThreeLoginViewController.swift in Sources */, |
| 2084 | 2111 | 191732F32B084DBC007BCC04 /* CNLiveShopClassifySwitchTableViewCell.swift in Sources */, |
| ... | ... | @@ -2154,6 +2181,7 @@ |
| 2154 | 2181 | 790D019F2A2DD66E00C5978D /* CNLiveLoginViewModel.swift in Sources */, |
| 2155 | 2182 | 1926C2912AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift in Sources */, |
| 2156 | 2183 | 1938BD452B4E49CA00390A34 /* CNLiveDuanjuTitleCell.swift in Sources */, |
| 2184 | + 1909DCA02C637349001E7986 /* CNLiveDigitalResumePreViewSecCell.swift in Sources */, | |
| 2157 | 2185 | 7C7C62F62A4D72E9007A912E /* CNLiveIdentityDB.swift in Sources */, |
| 2158 | 2186 | 1941348C2C20261C004FC047 /* CNLiveDigitalSecCell.swift in Sources */, |
| 2159 | 2187 | 19CC4D4F2ADD0FC200308E2A /* CNUpSlideDetailScrollView.swift in Sources */, |
| ... | ... | @@ -2222,6 +2250,7 @@ |
| 2222 | 2250 | 19BB1FE12AEB5C220094D962 /* CNLiveShopConsoleController.swift in Sources */, |
| 2223 | 2251 | 7C4931382A307BDB000E44B4 /* CNHomePageGuideView.swift in Sources */, |
| 2224 | 2252 | 7CD6753E2A2740B0008354C1 /* CNUpSlideView.swift in Sources */, |
| 2253 | + 1909DCA52C63736C001E7986 /* CNLiveDigitalResumePreviewFourCell.swift in Sources */, | |
| 2225 | 2254 | 191733582B319552007BCC04 /* CNLiveCouponGoodsListView.swift in Sources */, |
| 2226 | 2255 | 7CD675402A2740B0008354C1 /* CNDownSlideView.swift in Sources */, |
| 2227 | 2256 | 19BB1FE32AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift in Sources */, |
| ... | ... | @@ -2311,6 +2340,7 @@ |
| 2311 | 2340 | 79396EED2A319F220053E1AF /* NSObject+CNLiveExtensions.swift in Sources */, |
| 2312 | 2341 | 1917331B2B10A0EF007BCC04 /* CNLivePlayerLoadingView.swift in Sources */, |
| 2313 | 2342 | 19FA201B2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift in Sources */, |
| 2343 | + 1909DCA22C637353001E7986 /* CNLiveDigitalResumePreviewThreeCell.swift in Sources */, | |
| 2314 | 2344 | 192ED47E2C538CA30057244C /* CNLiveVitaeCertificateAddInfoCell.swift in Sources */, |
| 2315 | 2345 | 7C4931312A2F142F000E44B4 /* CNHomePageBackgroupView.swift in Sources */, |
| 2316 | 2346 | 19BB1FF22AF21A950094D962 /* CNLliveShopDetailBannerCell.swift in Sources */, |
| ... | ... | @@ -2341,6 +2371,7 @@ |
| 2341 | 2371 | 790B1FB42A4153E90074CF00 /* CNLiveMineBaseModel.swift in Sources */, |
| 2342 | 2372 | 197563772C5C80D9004E0F42 /* HeroNetworkImageProvider.swift in Sources */, |
| 2343 | 2373 | 794294AA2B4D4381008AAFA0 /* CNLiveShortVideoCommentListView.swift in Sources */, |
| 2374 | + 1909DC9E2C637339001E7986 /* CNLiveDigitalResumePreViewFirCell.swift in Sources */, | |
| 2344 | 2375 | 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */, |
| 2345 | 2376 | 19AD65AC2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift in Sources */, |
| 2346 | 2377 | 191733022B0C4EAB007BCC04 /* CNLiveSelUplSingleImageView.swift in Sources */, |
| ... | ... | @@ -2372,6 +2403,7 @@ |
| 2372 | 2403 | 794FF1072B01FC9800385E85 /* CNLiveShopOrderSearchListViewController.swift in Sources */, |
| 2373 | 2404 | 798A44E82A30134400815935 /* CNLiveMineHeaderView.swift in Sources */, |
| 2374 | 2405 | 19C0F7712BDE1A3B0097CC8F /* CNLiveMineChangePhoneController.swift in Sources */, |
| 2406 | + 1909DCA92C63738C001E7986 /* CNLiveDigitalResumePreviewSixCell.swift in Sources */, | |
| 2375 | 2407 | 7C49312D2A2DB9FA000E44B4 /* UITabBar+CNLiveExtensions.swift in Sources */, |
| 2376 | 2408 | 79A267832AF8D7BC0088D9F6 /* CNLiveShopBodyCustomView.swift in Sources */, |
| 2377 | 2409 | 1917335E2B328495007BCC04 /* CNLiveCouponListTableViewCell.swift in Sources */, | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewController.swift
| ... | ... | @@ -6,3 +6,281 @@ |
| 6 | 6 | // 数字简历预览页面 |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | + | |
| 10 | +class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ | |
| 11 | + | |
| 12 | + //简历model | |
| 13 | + var vitaeModel:CNLiveVitaeModel? | |
| 14 | + | |
| 15 | + lazy var bgImgView :UIImageView = { | |
| 16 | + let iconImgView = UIImageView() | |
| 17 | + iconImgView.width = KSreenWidth | |
| 18 | + iconImgView.height = KSreenWidth*234/375 | |
| 19 | + // fillCode | |
| 20 | + let bgLayer1 = CAGradientLayer() | |
| 21 | + bgLayer1.colors = [UIColor(red: 0.16, green: 0.45, blue: 0.99, alpha: 1).cgColor, UIColor(red: 0.96, green: 0.96, blue: 0.98, alpha: 1).cgColor] | |
| 22 | + bgLayer1.locations = [0, 1] | |
| 23 | + bgLayer1.frame = iconImgView.bounds | |
| 24 | + bgLayer1.startPoint = CGPoint(x: 0.5, y: 0) | |
| 25 | + bgLayer1.endPoint = CGPoint(x: 1, y: 1) | |
| 26 | + iconImgView.layer.addSublayer(bgLayer1) | |
| 27 | + return iconImgView | |
| 28 | + }() | |
| 29 | + | |
| 30 | + let kCNLiveDigitalResumePreViewFirCellIdentifier = "kCNLiveDigitalResumePreViewFirCellIdentifier" | |
| 31 | + let kCNLiveDigitalResumePreViewSecCellIdentifier = "kCNLiveDigitalResumePreViewSecCellIdentifier" | |
| 32 | + let kCNLiveDigitalResumePreviewThreeCellIdentifier = "kCNLiveDigitalResumePreviewThreeCellIdentifier" | |
| 33 | + let kCNLiveDigitalResumePreviewFourCellIdentifier = "kCNLiveDigitalResumePreviewFourCellIdentifier" | |
| 34 | + let kCNLiveDigitalResumePreviewFiveCellIdentifier = "kCNLiveDigitalResumePreviewFiveCellIdentifier" | |
| 35 | + let kCNLiveDigitalResumePreviewSixCellIdentifier = "kCNLiveDigitalResumePreviewSixCellIdentifier" | |
| 36 | + | |
| 37 | + lazy var tableView : UITableView = { | |
| 38 | + let tableView = UITableView(frame: .zero, style: .plain) | |
| 39 | + tableView.dataSource = self | |
| 40 | + tableView.delegate = self | |
| 41 | + tableView.separatorStyle = .none | |
| 42 | + tableView.tableFooterView = UIView.init() | |
| 43 | + tableView.register(CNLiveDigitalResumePreViewFirCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreViewFirCellIdentifier) | |
| 44 | + tableView.register(CNLiveDigitalResumePreViewSecCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreViewSecCellIdentifier) | |
| 45 | + tableView.register(CNLiveDigitalResumePreviewThreeCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewThreeCellIdentifier) | |
| 46 | + tableView.register(CNLiveDigitalResumePreviewFourCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewFourCellIdentifier) | |
| 47 | + tableView.register(CNLiveDigitalResumePreviewFiveCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewFiveCellIdentifier) | |
| 48 | + tableView.register(CNLiveDigitalResumePreviewSixCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewSixCellIdentifier) | |
| 49 | + tableView.backgroundColor = .clear | |
| 50 | + return tableView | |
| 51 | + }() | |
| 52 | + lazy var bottomZhiNanWhiteView :UIView = { | |
| 53 | + let bottomNavView = UIView() | |
| 54 | + bottomNavView.backgroundColor = .white | |
| 55 | + return bottomNavView | |
| 56 | + }() | |
| 57 | + lazy var settingBtn: UIButton = { | |
| 58 | + let nextBtn = UIButton(type: .custom) | |
| 59 | + nextBtn.setTitle("设置", for: .normal) | |
| 60 | + nextBtn.setTitleColor(HexColor("#333333"), for: .normal) | |
| 61 | + nextBtn.titleLabel?.font = BoldFont_17 | |
| 62 | + nextBtn.addTarget(self, action: #selector(settingBtnAction), for: .touchUpInside) | |
| 63 | + return nextBtn | |
| 64 | + }() | |
| 65 | + lazy var previewBtn: UIButton = { | |
| 66 | + let nextBtn = UIButton(type: .custom) | |
| 67 | + nextBtn.setTitle("预览数字简历", for: .normal) | |
| 68 | + nextBtn.setTitleColor(.white, for: .normal) | |
| 69 | + nextBtn.backgroundColor = HexColor("#1961FE") | |
| 70 | + nextBtn.layer.cornerRadius = 20 | |
| 71 | + nextBtn.clipsToBounds = true | |
| 72 | + nextBtn.addTarget(self, action: #selector(previewBtnAction), for: .touchUpInside) | |
| 73 | + return nextBtn | |
| 74 | + }() | |
| 75 | + | |
| 76 | + override func viewWillAppear(_ animated: Bool) { | |
| 77 | + super.viewWillAppear(animated) | |
| 78 | + self.getVitae() | |
| 79 | + self.getCetList() | |
| 80 | + } | |
| 81 | + override func viewDidLoad() { | |
| 82 | + super.viewDidLoad() | |
| 83 | + titleName = "数字简历" | |
| 84 | + navigationBarHidden = false | |
| 85 | + self.view.backgroundColor = HexColor("#F5F6FB") | |
| 86 | + | |
| 87 | + self.view.addSubview(self.bgImgView) | |
| 88 | + self.bgImgView.snp.makeConstraints { make in | |
| 89 | + make.top.equalTo(KNavigationHeight) | |
| 90 | + make.left.right.equalToSuperview() | |
| 91 | + make.height.equalTo(KSreenWidth*234/375) | |
| 92 | + } | |
| 93 | + | |
| 94 | + self.view.addSubview(self.tableView) | |
| 95 | + self.tableView.snp.makeConstraints { make in | |
| 96 | + make.top.equalTo(KNavigationHeight) | |
| 97 | + make.left.right.equalToSuperview() | |
| 98 | + make.height.equalToSuperview().offset(-KNavigationHeight-60) | |
| 99 | + } | |
| 100 | + | |
| 101 | + self.view.addSubview(self.bottomZhiNanWhiteView) | |
| 102 | + self.bottomZhiNanWhiteView.snp.makeConstraints { make in | |
| 103 | + make.top.equalTo(self.tableView.snp.bottom) | |
| 104 | + make.bottom.left.right.equalToSuperview() | |
| 105 | + } | |
| 106 | + | |
| 107 | + self.bottomZhiNanWhiteView.addSubview(self.previewBtn) | |
| 108 | + self.previewBtn.snp.makeConstraints { make in | |
| 109 | + make.left.equalTo(100) | |
| 110 | + make.right.equalToSuperview().offset(-15) | |
| 111 | + make.top.equalTo(10) | |
| 112 | + make.height.equalTo(40) | |
| 113 | + } | |
| 114 | + | |
| 115 | + } | |
| 116 | + | |
| 117 | + deinit { | |
| 118 | + } | |
| 119 | + | |
| 120 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
| 121 | + return 6 | |
| 122 | + } | |
| 123 | + | |
| 124 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| 125 | + if indexPath.row == 0{ | |
| 126 | + //我的简历-fir姓名等Cell | |
| 127 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreViewFirCellIdentifier) as? CNLiveDigitalResumePreViewFirCell | |
| 128 | + else { | |
| 129 | + let cell = CNLiveDigitalResumePreViewFirCell() | |
| 130 | + return cell | |
| 131 | + } | |
| 132 | + cell.updateViateDataBlock = { | |
| 133 | + self.vitaeModel = nil | |
| 134 | + self.getVitae() | |
| 135 | + self.getCetList() | |
| 136 | + } | |
| 137 | + if self.vitaeModel?.vitae?.id ?? 0 > 0{ | |
| 138 | + cell.vitaeModel = self.vitaeModel! | |
| 139 | + } | |
| 140 | + return cell | |
| 141 | + }else if indexPath.row == 1{ | |
| 142 | + //官方验证 | |
| 143 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreViewSecCellIdentifier) as? CNLiveDigitalResumePreViewSecCell | |
| 144 | + else { | |
| 145 | + let cell = CNLiveDigitalResumePreViewSecCell() | |
| 146 | + return cell | |
| 147 | + } | |
| 148 | + return cell | |
| 149 | + }else if indexPath.row == 2{ | |
| 150 | + //其他证书 | |
| 151 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewThreeCellIdentifier) as? CNLiveDigitalResumePreviewThreeCell | |
| 152 | + else { | |
| 153 | + let cell = CNLiveDigitalResumePreviewThreeCell() | |
| 154 | + return cell | |
| 155 | + } | |
| 156 | + return cell | |
| 157 | + }else if indexPath.row == 3{ | |
| 158 | + //工作记录 | |
| 159 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewFourCellIdentifier) as? CNLiveDigitalResumePreviewFourCell | |
| 160 | + else { | |
| 161 | + let cell = CNLiveDigitalResumePreviewFourCell() | |
| 162 | + return cell | |
| 163 | + } | |
| 164 | + return cell | |
| 165 | + }else if indexPath.row == 4{ | |
| 166 | + //获奖情况 | |
| 167 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewFiveCellIdentifier) as? CNLiveDigitalResumePreviewFiveCell | |
| 168 | + else { | |
| 169 | + let cell = CNLiveDigitalResumePreviewFiveCell() | |
| 170 | + return cell | |
| 171 | + } | |
| 172 | + return cell | |
| 173 | + }else if indexPath.row == 5{ | |
| 174 | + //自我介绍 | |
| 175 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewSixCellIdentifier) as? CNLiveDigitalResumePreviewSixCell | |
| 176 | + else { | |
| 177 | + let cell = CNLiveDigitalResumePreviewSixCell() | |
| 178 | + return cell | |
| 179 | + } | |
| 180 | + return cell | |
| 181 | + }else { | |
| 182 | + //未知cell | |
| 183 | + return UITableViewCell() | |
| 184 | + } | |
| 185 | + } | |
| 186 | + | |
| 187 | + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
| 188 | + | |
| 189 | + } | |
| 190 | + | |
| 191 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | |
| 192 | + if indexPath.row == 0{ | |
| 193 | + return 177+51 | |
| 194 | + }else if indexPath.row == 1{ | |
| 195 | + return 218+15 | |
| 196 | + }else if indexPath.row == 2{ | |
| 197 | + return 227+15 | |
| 198 | + }else if indexPath.row == 3{ | |
| 199 | + return 396+15 | |
| 200 | + }else if indexPath.row == 4{ | |
| 201 | + return 396+15 | |
| 202 | + }else if indexPath.row == 5{ | |
| 203 | + return 209+15 | |
| 204 | + }else { | |
| 205 | + return 50 | |
| 206 | + } | |
| 207 | + } | |
| 208 | + | |
| 209 | + @objc func settingBtnAction(){ | |
| 210 | + | |
| 211 | + } | |
| 212 | + @objc func previewBtnAction(){ | |
| 213 | + | |
| 214 | + } | |
| 215 | + | |
| 216 | + | |
| 217 | + // MARK: - 获取证书数量 | |
| 218 | + func getCetList(){ | |
| 219 | + let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" | |
| 220 | + CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in | |
| 221 | + if respStatue == .success{ | |
| 222 | + if let res = result as? [CNLiveVitaeCertificateModel]{ | |
| 223 | + self.tableView.reloadData() | |
| 224 | + } | |
| 225 | + }else{ | |
| 226 | + showMessage(message: "数据异常") | |
| 227 | + } | |
| 228 | + | |
| 229 | + } | |
| 230 | + } | |
| 231 | + // MARK: - 获取简历数据 | |
| 232 | + func getVitae(){ | |
| 233 | + | |
| 234 | + CNLiveVitaeViewModel.getVitae(vsid: UserInfoManager.shared.userInfo.currentUser?.vsid ?? "", type: 1) { result, status in | |
| 235 | + if status == .success{ | |
| 236 | + if let model = result as? CNLiveVitaeModel{ | |
| 237 | + if model.vitae == nil{ | |
| 238 | + //没有简历-保存简历 | |
| 239 | + self.saveUpdateVitae(isSave: true) | |
| 240 | + }else{ | |
| 241 | + //有简历-刷新页面 | |
| 242 | + self.vitaeModel = model | |
| 243 | + self.saveViateModel() | |
| 244 | + self.tableView.reloadData() | |
| 245 | + } | |
| 246 | + }else{ | |
| 247 | + | |
| 248 | + } | |
| 249 | + } | |
| 250 | + } | |
| 251 | + } | |
| 252 | + func saveUpdateVitae(isSave:Bool){ | |
| 253 | + | |
| 254 | + CNLiveVitaeViewModel.saveVitae(city: "", icon: "", isSave: isSave, id: "0", phone: "", profession: "", professionId: "0", selfIntroduction: "", showAddress: true, showAge: true, showAwards: true, showPhone: true, updateTime: "", vsid: UserInfoManager.shared.userInfo.currentUser?.vsid ?? "", workTime: "") { result, status in | |
| 255 | + if status == .success{ | |
| 256 | + | |
| 257 | + } | |
| 258 | + } | |
| 259 | + } | |
| 260 | + | |
| 261 | + func saveViateModel(){ | |
| 262 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 263 | + | |
| 264 | + userDic.updateValue(String(format: "%d", self.vitaeModel!.vitae?.id ?? 0), forKey: "jianli_vitaeId") | |
| 265 | + userDic.updateValue(String(format: "%d", self.vitaeModel!.vitae?.vsid ?? 0), forKey: "vsid") | |
| 266 | + userDic.updateValue(self.vitaeModel!.vitae?.city ?? "", forKey: "jianli_city") | |
| 267 | + userDic.updateValue(self.vitaeModel!.vitae?.profession ?? "", forKey: "jianli_profession") | |
| 268 | + userDic.updateValue(self.vitaeModel!.vitae?.professionId ?? "", forKey: "jianli_professionId") | |
| 269 | + userDic.updateValue(self.vitaeModel!.vitae?.icon ?? "", forKey: "jianli_icon") | |
| 270 | + userDic.updateValue(self.vitaeModel!.vitae?.phone ?? "", forKey: "jianli_phone") | |
| 271 | + userDic.updateValue(self.vitaeModel!.vitae?.selfIntroduction ?? "", forKey: "jianli_selfIntroduction") | |
| 272 | + userDic.updateValue(self.vitaeModel!.vitae?.workTime ?? "", forKey: "jianli_workTime") | |
| 273 | + userDic.updateValue(self.vitaeModel!.vitae?.showAge ?? false, forKey: "jianli_showAge") | |
| 274 | + userDic.updateValue(self.vitaeModel!.vitae?.showAddress ?? false, forKey: "jianli_showAddress") | |
| 275 | + userDic.updateValue(self.vitaeModel!.vitae?.showAwards ?? false, forKey: "jianli_showAwards") | |
| 276 | + userDic.updateValue(self.vitaeModel!.vitae?.updateTime ?? "", forKey: "jianli_updateTime") | |
| 277 | + UserDefaults.standard.setValue(userDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 278 | + UserDefaults.standard.synchronize() | |
| 279 | + }else{ | |
| 280 | + let tempDic = NSMutableDictionary() | |
| 281 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 282 | + UserDefaults.standard.synchronize() | |
| 283 | + } | |
| 284 | + } | |
| 285 | + | |
| 286 | +} | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/DigitalResume/CNLiveDigitalResumeCell.swift
| ... | ... | @@ -749,7 +749,15 @@ class CNLiveDigitalResumeCell: UITableViewCell { |
| 749 | 749 | currentViewController()?.navigationController?.pushViewController(vc, animated: true) |
| 750 | 750 | } |
| 751 | 751 | @objc func chakanBtnAction(){ |
| 752 | - | |
| 752 | + if self.vitaeModel?.vitae?.profession.count ?? 0 > 0{ | |
| 753 | + //设置了行业->预览简历页 | |
| 754 | + let vc = CNLiveDigitalResumePreViewController() | |
| 755 | + currentViewController()?.navigationController?.pushViewController(vc, animated: true) | |
| 756 | + }else{ | |
| 757 | + //没设置行业->行业 | |
| 758 | + navigationViewController().pushViewController(CNLiveSelectHangYeController(), animated: true) | |
| 759 | + | |
| 760 | + } | |
| 753 | 761 | } |
| 754 | 762 | |
| 755 | 763 | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreViewFirCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDigitalResumePreViewFirCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/8/7. | |
| 6 | +// 数字简历-fir 实名cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import Kingfisher | |
| 10 | +import SnapKit | |
| 11 | + | |
| 12 | +class CNLiveDigitalResumePreViewFirCell: UITableViewCell { | |
| 13 | + | |
| 14 | + var updateViateDataBlock:UpdateViateDataBlock? | |
| 15 | + | |
| 16 | + //简历Model | |
| 17 | + var _vitaeModel : CNLiveVitaeModel? | |
| 18 | + var vitaeModel : CNLiveVitaeModel? { | |
| 19 | + get{ | |
| 20 | + _vitaeModel | |
| 21 | + } | |
| 22 | + set{ | |
| 23 | + _vitaeModel = newValue! | |
| 24 | + setupNewUI(model: _vitaeModel!) | |
| 25 | + } | |
| 26 | + } | |
| 27 | + | |
| 28 | + lazy var whiteBgView :UIView = { | |
| 29 | + let whiteView = UIView(frame: CGRect(x: 15, y:51, width: KSreenWidth-30, height: 177)) | |
| 30 | + whiteView.backgroundColor = .white | |
| 31 | + whiteView.layer.cornerRadius = 12 | |
| 32 | + whiteView.clipsToBounds = true | |
| 33 | + return whiteView | |
| 34 | + }() | |
| 35 | + lazy var updateTimeTitleLabel: UILabel = { | |
| 36 | + let titleLabel = UILabel() | |
| 37 | + titleLabel.textColor = HexColor("#C2D7FF") | |
| 38 | + titleLabel.textAlignment = .left | |
| 39 | + titleLabel.text = "最后更新时间:2024.09.12 12:34" | |
| 40 | + titleLabel.font = Font_13 | |
| 41 | + titleLabel.adjustsFontSizeToFitWidth = true | |
| 42 | + return titleLabel | |
| 43 | + }() | |
| 44 | + lazy var jianliIconBgView :UIView = { | |
| 45 | + let whiteBgView = UIView() | |
| 46 | + whiteBgView.backgroundColor = .white | |
| 47 | + whiteBgView.layer.cornerRadius = 12 | |
| 48 | + whiteBgView.clipsToBounds = true | |
| 49 | + return whiteBgView | |
| 50 | + }() | |
| 51 | + lazy var jianliIconImgView :UIImageView = { | |
| 52 | + let iconImgView = UIImageView() | |
| 53 | + iconImgView.image = UIImage(named: "mine_jianli_icon") | |
| 54 | + iconImgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(jianliIconAction))) | |
| 55 | + iconImgView.isUserInteractionEnabled = true | |
| 56 | + iconImgView.contentMode = .scaleAspectFit | |
| 57 | + return iconImgView | |
| 58 | + }() | |
| 59 | + //名字 | |
| 60 | + lazy var authNameTitleLabel: UILabel = { | |
| 61 | + let titleLabel = UILabel() | |
| 62 | + titleLabel.textColor = HexColor("#333333") | |
| 63 | + titleLabel.textAlignment = .center | |
| 64 | + titleLabel.text = "" | |
| 65 | + titleLabel.font = BoldFont_24 | |
| 66 | + return titleLabel | |
| 67 | + }() | |
| 68 | + lazy var authGuanfangIconImgView :UIImageView = { | |
| 69 | + let iconImgView = UIImageView() | |
| 70 | + iconImgView.image = UIImage(named: "mine_jianli_guanfnagAuth") | |
| 71 | + return iconImgView | |
| 72 | + }() | |
| 73 | + lazy var phoneTitleLabel: UILabel = { | |
| 74 | + let titleLabel = UILabel() | |
| 75 | + titleLabel.textColor = HexColor("#999999") | |
| 76 | + titleLabel.textAlignment = .left | |
| 77 | + titleLabel.text = "男 | xx岁 | 10000000000" | |
| 78 | + titleLabel.font = Font_14 | |
| 79 | + return titleLabel | |
| 80 | + }() | |
| 81 | + lazy var weizhiTitleLabel: UILabel = { | |
| 82 | + let titleLabel = UILabel() | |
| 83 | + titleLabel.textColor = HexColor("#999999") | |
| 84 | + titleLabel.textAlignment = .left | |
| 85 | + titleLabel.text = " | 位置未授权" | |
| 86 | + titleLabel.font = Font_14 | |
| 87 | + return titleLabel | |
| 88 | + }() | |
| 89 | + lazy var workTitleLabel: UILabel = { | |
| 90 | + let titleLabel = UILabel() | |
| 91 | + titleLabel.textColor = HexColor("#999999") | |
| 92 | + titleLabel.textAlignment = .left | |
| 93 | + titleLabel.text = "参加工作时间未设置 >" | |
| 94 | + titleLabel.font = Font_14 | |
| 95 | + return titleLabel | |
| 96 | + }() | |
| 97 | + //性别 年龄 手机号 位置 工作年限整体的点击tap | |
| 98 | + lazy var phoneWorkTapView :UIView = { | |
| 99 | + let bottomNavView = UIView() | |
| 100 | + bottomNavView.backgroundColor = .clear | |
| 101 | + bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(workTitleLabelAciton))) | |
| 102 | + return bottomNavView | |
| 103 | + }() | |
| 104 | + | |
| 105 | + lazy var lineView :UIView = { | |
| 106 | + let bottomNavView = UIView() | |
| 107 | + bottomNavView.backgroundColor = HexColor("#EBEBEB") | |
| 108 | + return bottomNavView | |
| 109 | + }() | |
| 110 | + lazy var hangyeTitleLabel: UILabel = { | |
| 111 | + let titleLabel = UILabel() | |
| 112 | + titleLabel.textColor = HexColor("#333333") | |
| 113 | + titleLabel.textAlignment = .left | |
| 114 | + titleLabel.text = "行业" | |
| 115 | + titleLabel.font = BoldFont_14 | |
| 116 | + return titleLabel | |
| 117 | + }() | |
| 118 | + lazy var hangyeImgView :UIImageView = { | |
| 119 | + let iconImgView = UIImageView() | |
| 120 | + iconImgView.image = UIImage(named: "mine_jianli_zhenshi") | |
| 121 | + return iconImgView | |
| 122 | + }() | |
| 123 | + | |
| 124 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 125 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 126 | + self.contentView.backgroundColor = .clear | |
| 127 | + self.backgroundColor = .clear | |
| 128 | + self.selectionStyle = .none | |
| 129 | + | |
| 130 | + self.contentView.addSubview(self.whiteBgView) | |
| 131 | + | |
| 132 | + self.contentView.addSubview(self.jianliIconBgView) | |
| 133 | + self.jianliIconBgView.snp.makeConstraints { make in | |
| 134 | + make.top.equalTo(21) | |
| 135 | + make.right.equalToSuperview().offset(adapt_length(length: -42)) | |
| 136 | + make.width.height.equalTo(90) | |
| 137 | + } | |
| 138 | + self.jianliIconBgView.addSubview(self.jianliIconImgView) | |
| 139 | + self.jianliIconImgView.snp.makeConstraints { make in | |
| 140 | + make.width.height.equalTo(70) | |
| 141 | + make.center.equalToSuperview() | |
| 142 | + } | |
| 143 | + self.contentView.addSubview(self.updateTimeTitleLabel) | |
| 144 | + self.updateTimeTitleLabel.snp.makeConstraints { make in | |
| 145 | + make.top.equalTo(20) | |
| 146 | + make.left.equalTo(15) | |
| 147 | + make.right.equalTo(self.jianliIconBgView.snp.left).offset(-5) | |
| 148 | + } | |
| 149 | + | |
| 150 | + self.whiteBgView.addSubview(self.authNameTitleLabel) | |
| 151 | + self.authNameTitleLabel.snp.makeConstraints { make in | |
| 152 | + make.left.equalTo(adapt_length(length: 15)) | |
| 153 | + make.top.equalTo(20) | |
| 154 | + } | |
| 155 | + self.authNameTitleLabel.text = UserInfoManager.shared.userInfo.currentUser?.name | |
| 156 | + | |
| 157 | + self.whiteBgView.addSubview(self.authGuanfangIconImgView) | |
| 158 | + self.authGuanfangIconImgView.snp.makeConstraints { make in | |
| 159 | + make.left.equalTo(self.authNameTitleLabel.snp.right).offset(5) | |
| 160 | + make.centerY.equalTo(self.authNameTitleLabel.snp.centerY) | |
| 161 | + } | |
| 162 | + | |
| 163 | + self.whiteBgView.addSubview(self.phoneTitleLabel) | |
| 164 | + let (gender, age) = self.extractGenderAndAge(fromIDCardNumber: UserInfoManager.shared.userInfo.currentUser?.idNo ?? "") | |
| 165 | + let ageStr = String(format: "%d", age ?? 0) | |
| 166 | + self.phoneTitleLabel.text = gender+" | "+ageStr+"岁"+" | "+UserInfoManager.shared.userInfo.mobile | |
| 167 | + self.phoneTitleLabel.sizeToFit() | |
| 168 | + self.phoneTitleLabel.snp.makeConstraints { make in | |
| 169 | + make.left.equalTo(adapt_length(length: 15)) | |
| 170 | + make.top.equalTo(self.authNameTitleLabel.snp.bottom).offset(8) | |
| 171 | + make.width.equalTo(self.phoneTitleLabel.size.width) | |
| 172 | + make.height.equalTo(self.phoneTitleLabel.size.height) | |
| 173 | + } | |
| 174 | + | |
| 175 | + self.whiteBgView.addSubview(self.weizhiTitleLabel) | |
| 176 | + self.weizhiTitleLabel.snp.makeConstraints { make in | |
| 177 | + make.left.equalTo(self.phoneTitleLabel.snp.right) | |
| 178 | + make.right.equalToSuperview().offset(-5) | |
| 179 | + make.top.equalTo(self.phoneTitleLabel.snp.top) | |
| 180 | + } | |
| 181 | + self.whiteBgView.addSubview(self.workTitleLabel) | |
| 182 | + self.workTitleLabel.snp.makeConstraints { make in | |
| 183 | + make.left.equalTo(adapt_length(length: 15)) | |
| 184 | + make.top.equalTo(self.phoneTitleLabel.snp.bottom).offset(4) | |
| 185 | + } | |
| 186 | + self.whiteBgView.addSubview(self.phoneWorkTapView) | |
| 187 | + self.phoneWorkTapView.snp.makeConstraints { make in | |
| 188 | + make.left.equalTo(self.phoneTitleLabel.snp.left) | |
| 189 | + make.top.equalTo(self.phoneTitleLabel.snp.top) | |
| 190 | + make.bottom.equalTo(self.workTitleLabel.snp.bottom) | |
| 191 | + make.right.equalTo(self.weizhiTitleLabel.snp.right) | |
| 192 | + | |
| 193 | + } | |
| 194 | + | |
| 195 | + | |
| 196 | + self.whiteBgView.addSubview(self.lineView) | |
| 197 | + self.lineView.snp.makeConstraints { make in | |
| 198 | + make.left.equalTo(adapt_length(length: 15)) | |
| 199 | + make.right.equalToSuperview().offset(adapt_length(length: -15)) | |
| 200 | + make.top.equalTo(self.workTitleLabel.snp.bottom).offset(15) | |
| 201 | + make.height.equalTo(0.5) | |
| 202 | + } | |
| 203 | + | |
| 204 | + self.whiteBgView.addSubview(self.hangyeTitleLabel) | |
| 205 | + self.hangyeTitleLabel.snp.makeConstraints { make in | |
| 206 | + make.left.equalTo(adapt_length(length: 15)) | |
| 207 | + make.top.equalTo(self.lineView.snp.bottom).offset(20) | |
| 208 | + } | |
| 209 | + self.whiteBgView.addSubview(self.hangyeImgView) | |
| 210 | + self.hangyeImgView.snp.makeConstraints { make in | |
| 211 | + make.left.equalTo(self.hangyeTitleLabel.snp.right).offset(5) | |
| 212 | + make.centerY.equalTo(self.hangyeTitleLabel.snp.centerY) | |
| 213 | + make.width.equalTo(83) | |
| 214 | + make.height.equalTo(16) | |
| 215 | + } | |
| 216 | + | |
| 217 | + | |
| 218 | + } | |
| 219 | + required init?(coder: NSCoder) { | |
| 220 | + fatalError("init(coder:) has not been implemented") | |
| 221 | + } | |
| 222 | + | |
| 223 | + func setupNewUI(model:CNLiveVitaeModel){ | |
| 224 | + let updateDateString = convertTimestampStringToDateString(timestampString: model.vitae?.updateTime ?? "") | |
| 225 | + self.updateTimeTitleLabel.text = "最后更新时间:\(updateDateString ?? "")" | |
| 226 | + self.jianliIconImgView.kf.setImage(with: URL(string: model.vitae?.icon ?? ""), placeholder: UIImage(named: "mine_jianli_icon")) | |
| 227 | + let name = UserInfoManager.shared.userInfo.currentUser?.name ?? "" | |
| 228 | + self.authNameTitleLabel.text = name | |
| 229 | + let idNo = UserInfoManager.shared.userInfo.currentUser?.idNo ?? "" | |
| 230 | + let (gender, age) = self.extractGenderAndAge(fromIDCardNumber: idNo) | |
| 231 | + let ageStr = String(format: "%d", age ?? 0) | |
| 232 | + self.phoneTitleLabel.text = gender+" | "+ageStr+"岁"+" | "+UserInfoManager.shared.userInfo.mobile | |
| 233 | + | |
| 234 | + if model.vitae?.profession.count ?? 0 > 0{ | |
| 235 | + self.hangyeTitleLabel.text = model.vitae?.profession | |
| 236 | + } | |
| 237 | + if model.vitae?.city.count ?? 0 > 0 && model.vitae?.showAddress == true{ | |
| 238 | + self.weizhiTitleLabel.text = " | "+model.vitae!.city | |
| 239 | + }else{ | |
| 240 | + self.weizhiTitleLabel.text = " | 位置未授权" | |
| 241 | + } | |
| 242 | + if model.vitae?.workTime.count ?? 0 > 0{ | |
| 243 | + self.workTitleLabel.text = model.vitae!.workTime | |
| 244 | + }else{ | |
| 245 | + self.workTitleLabel.text = "参加工作时间未设置 >" | |
| 246 | + } | |
| 247 | + | |
| 248 | + } | |
| 249 | + | |
| 250 | + func convertTimestampStringToDateString(timestampString: String) -> String? { | |
| 251 | + // 首先,将毫秒时间戳字符串转换为TimeInterval(秒) | |
| 252 | + guard let timestampMilliseconds = Double(timestampString) else { | |
| 253 | + return nil | |
| 254 | + } | |
| 255 | + let timestampSeconds = timestampMilliseconds / 1000.0 | |
| 256 | + | |
| 257 | + // 然后,将TimeInterval转换为Date对象 | |
| 258 | + let date = Date(timeIntervalSince1970: timestampSeconds) | |
| 259 | + | |
| 260 | + // 接着,设置DateFormatter的格式 | |
| 261 | + let formatter = DateFormatter() | |
| 262 | + formatter.dateFormat = "yyyy.MM.dd HH:mm" // 设置为你想要的日期格式 | |
| 263 | + | |
| 264 | + // 最后,使用DateFormatter将Date对象格式化为字符串 | |
| 265 | + return formatter.string(from: date) | |
| 266 | + } | |
| 267 | + | |
| 268 | + //身份证号提取 性别和年龄 | |
| 269 | + func extractGenderAndAge(fromIDCardNumber idCardNumber: String) -> (gender: String, age: Int?) { | |
| 270 | + guard idCardNumber.count == 18 else { | |
| 271 | + return ("未知", nil) | |
| 272 | + } | |
| 273 | + | |
| 274 | + // 提取出生年份(身份证号码的第7位到第14位) | |
| 275 | + let birthYearStr = idCardNumber.subString(start: 6, length: 4) | |
| 276 | + guard let birthYear = Int(birthYearStr) else { | |
| 277 | + return ("未知", nil) | |
| 278 | + } | |
| 279 | + | |
| 280 | + // 计算年龄 | |
| 281 | + let currentYear = Calendar.current.component(.year, from: Date()) | |
| 282 | + let age = currentYear - birthYear | |
| 283 | + | |
| 284 | + // 提取性别(身份证号码的第17位,奇数代表男,偶数代表女) | |
| 285 | + let genderCode = Int(String(idCardNumber[idCardNumber.index(idCardNumber.startIndex, offsetBy: 16)])) | |
| 286 | + let gender = genderCode != nil && genderCode! % 2 == 0 ? "女" : "男" | |
| 287 | + | |
| 288 | + return (gender, age >= 0 ? age : nil) | |
| 289 | + } | |
| 290 | + | |
| 291 | + | |
| 292 | + // MARK: - buttonAction | |
| 293 | + @objc func jianliIconAction(){ | |
| 294 | + //换简历头像 | |
| 295 | + let vc = CNLiveMineInfoViewController.init(mineIconType: .mineViateIcon, result: { image in | |
| 296 | + self.jianliIconImgView.image = image | |
| 297 | + self.updateViateDataBlock?() | |
| 298 | + }) | |
| 299 | + navigationViewController().pushViewController(vc, animated: true) | |
| 300 | + } | |
| 301 | + @objc func workTitleLabelAciton(){ | |
| 302 | + let vc = CNLiveDigitalResumeInfoController() | |
| 303 | + currentViewController()?.navigationController?.pushViewController(vc, animated: true) | |
| 304 | + } | |
| 305 | + | |
| 306 | + | |
| 307 | +} | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreViewSecCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDigitalResumePreViewSecCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/8/7. | |
| 6 | +// 数字简历-sec 官方验证cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import Kingfisher | |
| 10 | +import SnapKit | |
| 11 | + | |
| 12 | +class CNLiveDigitalResumePreViewSecCell: UITableViewCell { | |
| 13 | + | |
| 14 | + lazy var whiteView :UIView = { | |
| 15 | + let whiteView = UIView(frame: CGRect(x: 15, y:adapt_length(length: 20), width: KSreenWidth-30, height: adapt_length(length: 121))) | |
| 16 | + whiteView.backgroundColor = .white | |
| 17 | + whiteView.layer.cornerRadius = 12 | |
| 18 | + whiteView.clipsToBounds = true | |
| 19 | + return whiteView | |
| 20 | + }() | |
| 21 | + | |
| 22 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 23 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 24 | + self.contentView.backgroundColor = .clear | |
| 25 | + self.backgroundColor = .clear | |
| 26 | + self.selectionStyle = .none | |
| 27 | + | |
| 28 | + self.contentView.addSubview(self.whiteView) | |
| 29 | + | |
| 30 | + | |
| 31 | + } | |
| 32 | + required init?(coder: NSCoder) { | |
| 33 | + fatalError("init(coder:) has not been implemented") | |
| 34 | + } | |
| 35 | + | |
| 36 | +} | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewFiveCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDigitalResumePreviewFiveCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/8/7. | |
| 6 | +// 数字简历-Five 获奖情况cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import Kingfisher | |
| 10 | +import SnapKit | |
| 11 | + | |
| 12 | +class CNLiveDigitalResumePreviewFiveCell: UITableViewCell { | |
| 13 | + | |
| 14 | + lazy var whiteView :UIView = { | |
| 15 | + let whiteView = UIView(frame: CGRect(x: 15, y:adapt_length(length: 20), width: KSreenWidth-30, height: adapt_length(length: 121))) | |
| 16 | + whiteView.backgroundColor = .white | |
| 17 | + whiteView.layer.cornerRadius = 12 | |
| 18 | + whiteView.clipsToBounds = true | |
| 19 | + return whiteView | |
| 20 | + }() | |
| 21 | + | |
| 22 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 23 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 24 | + self.contentView.backgroundColor = .clear | |
| 25 | + self.backgroundColor = .clear | |
| 26 | + self.selectionStyle = .none | |
| 27 | + | |
| 28 | + self.contentView.addSubview(self.whiteView) | |
| 29 | + | |
| 30 | + | |
| 31 | + } | |
| 32 | + required init?(coder: NSCoder) { | |
| 33 | + fatalError("init(coder:) has not been implemented") | |
| 34 | + } | |
| 35 | + | |
| 36 | +} | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewFourCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDigitalResumePreviewFourCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/8/7. | |
| 6 | +// 数字简历-Four 工作记录cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import Kingfisher | |
| 10 | +import SnapKit | |
| 11 | + | |
| 12 | +class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | |
| 13 | + | |
| 14 | + lazy var whiteView :UIView = { | |
| 15 | + let whiteView = UIView(frame: CGRect(x: 15, y:adapt_length(length: 20), width: KSreenWidth-30, height: adapt_length(length: 121))) | |
| 16 | + whiteView.backgroundColor = .white | |
| 17 | + whiteView.layer.cornerRadius = 12 | |
| 18 | + whiteView.clipsToBounds = true | |
| 19 | + return whiteView | |
| 20 | + }() | |
| 21 | + | |
| 22 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 23 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 24 | + self.contentView.backgroundColor = .clear | |
| 25 | + self.backgroundColor = .clear | |
| 26 | + self.selectionStyle = .none | |
| 27 | + | |
| 28 | + self.contentView.addSubview(self.whiteView) | |
| 29 | + | |
| 30 | + | |
| 31 | + } | |
| 32 | + required init?(coder: NSCoder) { | |
| 33 | + fatalError("init(coder:) has not been implemented") | |
| 34 | + } | |
| 35 | + | |
| 36 | +} | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewSixCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDigitalResumePreviewSixCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/8/7. | |
| 6 | +// 数字简历-Six 自我介绍cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import Kingfisher | |
| 10 | +import SnapKit | |
| 11 | + | |
| 12 | +class CNLiveDigitalResumePreviewSixCell: UITableViewCell { | |
| 13 | + | |
| 14 | + lazy var whiteView :UIView = { | |
| 15 | + let whiteView = UIView(frame: CGRect(x: 15, y:adapt_length(length: 20), width: KSreenWidth-30, height: adapt_length(length: 121))) | |
| 16 | + whiteView.backgroundColor = .white | |
| 17 | + whiteView.layer.cornerRadius = 12 | |
| 18 | + whiteView.clipsToBounds = true | |
| 19 | + return whiteView | |
| 20 | + }() | |
| 21 | + | |
| 22 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 23 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 24 | + self.contentView.backgroundColor = .clear | |
| 25 | + self.backgroundColor = .clear | |
| 26 | + self.selectionStyle = .none | |
| 27 | + | |
| 28 | + self.contentView.addSubview(self.whiteView) | |
| 29 | + | |
| 30 | + | |
| 31 | + } | |
| 32 | + required init?(coder: NSCoder) { | |
| 33 | + fatalError("init(coder:) has not been implemented") | |
| 34 | + } | |
| 35 | + | |
| 36 | +} | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewThreeCell.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDigitalResumePreviewThreeCell.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/8/7. | |
| 6 | +// 数字简历-three 其他证书cell | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import Kingfisher | |
| 10 | +import SnapKit | |
| 11 | + | |
| 12 | +class CNLiveDigitalResumePreviewThreeCell: UITableViewCell { | |
| 13 | + | |
| 14 | + lazy var whiteView :UIView = { | |
| 15 | + let whiteView = UIView(frame: CGRect(x: 15, y:adapt_length(length: 20), width: KSreenWidth-30, height: adapt_length(length: 121))) | |
| 16 | + whiteView.backgroundColor = .white | |
| 17 | + whiteView.layer.cornerRadius = 12 | |
| 18 | + whiteView.clipsToBounds = true | |
| 19 | + return whiteView | |
| 20 | + }() | |
| 21 | + | |
| 22 | + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 23 | + super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 24 | + self.contentView.backgroundColor = .clear | |
| 25 | + self.backgroundColor = .clear | |
| 26 | + self.selectionStyle = .none | |
| 27 | + | |
| 28 | + self.contentView.addSubview(self.whiteView) | |
| 29 | + | |
| 30 | + | |
| 31 | + } | |
| 32 | + required init?(coder: NSCoder) { | |
| 33 | + fatalError("init(coder:) has not been implemented") | |
| 34 | + } | |
| 35 | + | |
| 36 | +} | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/数字资产cell/CNLiveDigitalThreeCell.swift
| ... | ... | @@ -180,7 +180,7 @@ class CNLiveDigitalThreeCell: UITableViewCell, UICollectionViewDelegate, UIColle |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| 183 | - | |
| 183 | + navigationViewController().pushViewController(CNLiveVitaeVocationalCertificateController(), animated: true) | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | @objc func zhengshuBtnAction(){ | ... | ... |