Commit 942abd6db53d273a7f44435faf139782a3b0f895
1 parent
e74826eb
数字简历页面-官方认证-数字资产页-其他证书-改为一排三个多少排都展示
Showing
12 changed files
with
236 additions
and
108 deletions
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumeController.swift
| ... | ... | @@ -168,7 +168,7 @@ class CNLiveDigitalResumeController:CNLiveBaseViewController,UITableViewDataSour |
| 168 | 168 | let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" |
| 169 | 169 | CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in |
| 170 | 170 | if respStatue == .success{ |
| 171 | - if let res = result as? [CNLiveVitaeCertificateModel]{ | |
| 171 | + if let res = result as? [CNLiveVitaeCertificatesModel]{ | |
| 172 | 172 | self.certificatesCount = res.count |
| 173 | 173 | self.tableView.reloadData() |
| 174 | 174 | } | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewSelectRenzhengCerController.swift
| ... | ... | @@ -205,7 +205,7 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 205 | 205 | let cell = CNLiveDigitalResumeSelectCerCell() |
| 206 | 206 | return cell |
| 207 | 207 | } |
| 208 | - let cerListMdl = self.totalDataArray[indexPath.row] as! CNLiveVitaeCertificateModel | |
| 208 | + let cerListMdl = self.totalDataArray[indexPath.row] as! CNLiveVitaeCertificatesModel | |
| 209 | 209 | cell.cerListMdl = cerListMdl |
| 210 | 210 | return cell |
| 211 | 211 | } |
| ... | ... | @@ -268,7 +268,7 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 268 | 268 | }else{ |
| 269 | 269 | var idsArrStr = "" |
| 270 | 270 | for (idx,obj) in self.totalDataArray.enumerated() { |
| 271 | - let model = obj as! CNLiveVitaeCertificateModel | |
| 271 | + let model = obj as! CNLiveVitaeCertificatesModel | |
| 272 | 272 | let cell = self.tableView.cellForRow(at: IndexPath(row: idx, section: 0)) as! CNLiveDigitalResumeSelectCerCell |
| 273 | 273 | if cell.selectBtn.isSelected{ |
| 274 | 274 | idsArrStr = idsArrStr + "\(model.id)," |
| ... | ... | @@ -304,8 +304,8 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 304 | 304 | let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" |
| 305 | 305 | CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in |
| 306 | 306 | if respStatue == .success{ |
| 307 | - if let res = result as? [CNLiveVitaeCertificateModel]{ | |
| 308 | - var arr = Array<CNLiveVitaeCertificateModel>() | |
| 307 | + if let res = result as? [CNLiveVitaeCertificatesModel]{ | |
| 308 | + var arr = Array<CNLiveVitaeCertificatesModel>() | |
| 309 | 309 | var guanlianNum = 0 |
| 310 | 310 | res.forEach { cerMdl in |
| 311 | 311 | if let cerListArr = self.cerListModels{ | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字认证身份相关页面/CNLiveDigitalAssetsController.swift
| ... | ... | @@ -9,7 +9,7 @@ import Foundation |
| 9 | 9 | |
| 10 | 10 | class CNLiveDigitalAssetsController:CNLiveBaseViewController, UITableViewDataSource, UITableViewDelegate{ |
| 11 | 11 | |
| 12 | - var certificatesArr = [CNLiveVitaeCertificateModel]() | |
| 12 | + var certificatesArr = [CNLiveVitaeCertificatesModel]() | |
| 13 | 13 | |
| 14 | 14 | lazy var nextBtn: UIButton = { |
| 15 | 15 | let nextBtn = UIButton(type: .custom) |
| ... | ... | @@ -162,7 +162,15 @@ class CNLiveDigitalAssetsController:CNLiveBaseViewController, UITableViewDataSou |
| 162 | 162 | return adapt_length(length: 53)+100*hang+15 |
| 163 | 163 | } |
| 164 | 164 | }else{ |
| 165 | - return 317+15 | |
| 165 | + var cellH:CGFloat = 317+15+72+15 | |
| 166 | + if self.certificatesArr.count > 0{ | |
| 167 | + let hang:CGFloat = CGFloat((self.certificatesArr.count-1)/3+1) | |
| 168 | + let imgW:CGFloat = CGFloat((KSreenWidth-80-30)/3.0) | |
| 169 | + let imgH:CGFloat = 101*imgW/85.0 | |
| 170 | + return 15+125+(imgH+10)*hang-10+92 | |
| 171 | + }else{ | |
| 172 | + return cellH | |
| 173 | + } | |
| 166 | 174 | } |
| 167 | 175 | } |
| 168 | 176 | deinit { |
| ... | ... | @@ -177,7 +185,7 @@ class CNLiveDigitalAssetsController:CNLiveBaseViewController, UITableViewDataSou |
| 177 | 185 | let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" |
| 178 | 186 | CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in |
| 179 | 187 | if respStatue == .success{ |
| 180 | - if let res = result as? [CNLiveVitaeCertificateModel]{ | |
| 188 | + if let res = result as? [CNLiveVitaeCertificatesModel]{ | |
| 181 | 189 | self.certificatesArr = res |
| 182 | 190 | self.tableView.reloadData() |
| 183 | 191 | } | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/证书相关页面/CNLiveVitaeVocationalCertificateController.swift
| ... | ... | @@ -42,8 +42,8 @@ class CNLiveVitaeVocationalCertificateController:CNLiveBaseViewController,UITabl |
| 42 | 42 | nextBtn.addTarget(self, action: #selector(addCertificateBtnAction), for: .touchUpInside) |
| 43 | 43 | return nextBtn |
| 44 | 44 | }() |
| 45 | - lazy var cerListArr :Array<CNLiveVitaeCertificateModel> = { | |
| 46 | - let dataArray = Array<CNLiveVitaeCertificateModel>() | |
| 45 | + lazy var cerListArr :Array<CNLiveVitaeCertificatesModel> = { | |
| 46 | + let dataArray = Array<CNLiveVitaeCertificatesModel>() | |
| 47 | 47 | return dataArray |
| 48 | 48 | }() |
| 49 | 49 | |
| ... | ... | @@ -116,7 +116,7 @@ class CNLiveVitaeVocationalCertificateController:CNLiveBaseViewController,UITabl |
| 116 | 116 | let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" |
| 117 | 117 | CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in |
| 118 | 118 | if respStatue == .success{ |
| 119 | - if let res = result as? [CNLiveVitaeCertificateModel]{ | |
| 119 | + if let res = result as? [CNLiveVitaeCertificatesModel]{ | |
| 120 | 120 | self.cerListArr = res |
| 121 | 121 | self.tableView.reloadData() |
| 122 | 122 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Certificate/CNLiveCertificateCollectionCell.swift
| ... | ... | @@ -11,8 +11,8 @@ import Kingfisher |
| 11 | 11 | class CNLiveCertificateCollectionCell: UICollectionViewCell { |
| 12 | 12 | |
| 13 | 13 | //cerModel |
| 14 | - var _cerModel : CNLiveVitaeCertificateModel? | |
| 15 | - var cerModel : CNLiveVitaeCertificateModel? { | |
| 14 | + var _cerModel : CNLiveVitaeCertificatesModel? | |
| 15 | + var cerModel : CNLiveVitaeCertificatesModel? { | |
| 16 | 16 | get{ |
| 17 | 17 | _cerModel |
| 18 | 18 | } |
| ... | ... | @@ -64,7 +64,7 @@ class CNLiveCertificateCollectionCell: UICollectionViewCell { |
| 64 | 64 | fatalError("init(coder:) has not been implemented") |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - func setupNewUI(model:CNLiveVitaeCertificateModel){ | |
| 67 | + func setupNewUI(model:CNLiveVitaeCertificatesModel){ | |
| 68 | 68 | self.iconImgView.subviews.forEach { view in |
| 69 | 69 | if view.tag >= 1000{ |
| 70 | 70 | view.removeFromSuperview() | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Certificate/CNLiveVocationalCertificateFirCell.swift
| ... | ... | @@ -16,8 +16,8 @@ class CNLiveVocationalCertificateFirCell: UITableViewCell, UICollectionViewDataS |
| 16 | 16 | var pageNum: NSInteger! = 1 |
| 17 | 17 | |
| 18 | 18 | //cerListArr |
| 19 | - var _cerListArr : Array<CNLiveVitaeCertificateModel>? | |
| 20 | - var cerListArr : Array<CNLiveVitaeCertificateModel>? { | |
| 19 | + var _cerListArr : Array<CNLiveVitaeCertificatesModel>? | |
| 20 | + var cerListArr : Array<CNLiveVitaeCertificatesModel>? { | |
| 21 | 21 | get{ |
| 22 | 22 | _cerListArr |
| 23 | 23 | } |
| ... | ... | @@ -292,11 +292,11 @@ class CNLiveVocationalCertificateFirCell: UITableViewCell, UICollectionViewDataS |
| 292 | 292 | fatalError("init(coder:) has not been implemented") |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - func setupNewUI(cerListArr : Array<CNLiveVitaeCertificateModel>){ | |
| 295 | + func setupNewUI(cerListArr : Array<CNLiveVitaeCertificatesModel>){ | |
| 296 | 296 | self.yuanmaDescLabel.text = "共 \(cerListArr.count) 条" |
| 297 | 297 | self.collectionView.reloadData() |
| 298 | 298 | } |
| 299 | - func setupCerDetailNewUI(cerModel : CNLiveVitaeCertificateModel){ | |
| 299 | + func setupCerDetailNewUI(cerModel : CNLiveVitaeCertificatesModel){ | |
| 300 | 300 | self.cerNameDetailTitleLabel.text = (cerModel.title.count > 0) ? cerModel.title : "无" |
| 301 | 301 | self.cerLevelDetailTitleLabel.text = (cerModel.lv.count > 0) ? cerModel.lv : "无" |
| 302 | 302 | self.cerNumberDetailTitleLabel.text = (cerModel.number.count > 0) ? cerModel.number : "无" | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/关联官方认证或证书cell/CNLiveDigitalResumeSelectCerCell.swift
| ... | ... | @@ -10,8 +10,8 @@ import SnapKit |
| 10 | 10 | |
| 11 | 11 | class CNLiveDigitalResumeSelectCerCell:UITableViewCell{ |
| 12 | 12 | |
| 13 | - var _cerListMdl : CNLiveVitaeCertificateModel? | |
| 14 | - var cerListMdl : CNLiveVitaeCertificateModel? { | |
| 13 | + var _cerListMdl : CNLiveVitaeCertificatesModel? | |
| 14 | + var cerListMdl : CNLiveVitaeCertificatesModel? { | |
| 15 | 15 | get{ |
| 16 | 16 | _cerListMdl |
| 17 | 17 | } |
| ... | ... | @@ -192,7 +192,7 @@ class CNLiveDigitalResumeSelectCerCell:UITableViewCell{ |
| 192 | 192 | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - func setupNewUI(model:CNLiveVitaeCertificateModel){ | |
| 195 | + func setupNewUI(model:CNLiveVitaeCertificatesModel){ | |
| 196 | 196 | |
| 197 | 197 | self.authNameTitleLabel.text = model.title |
| 198 | 198 | self.nameLevelRightTitleLabel.text = model.lv.count > 0 ? model.lv : "无等级" | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/数字资产cell/CNLiveDigitalThreeCell.swift
| ... | ... | @@ -9,16 +9,16 @@ import Foundation |
| 9 | 9 | import Kingfisher |
| 10 | 10 | import SnapKit |
| 11 | 11 | |
| 12 | -class CNLiveDigitalThreeCell: UITableViewCell, UICollectionViewDelegate, UICollectionViewDataSource { | |
| 12 | +class CNLiveDigitalThreeCell: UITableViewCell{//, UICollectionViewDelegate, UICollectionViewDataSource { | |
| 13 | 13 | |
| 14 | - var _certificatesArr : [CNLiveVitaeCertificateModel]? | |
| 15 | - var certificatesArr : [CNLiveVitaeCertificateModel]? { | |
| 14 | + var _certificatesArr : [CNLiveVitaeCertificatesModel]? | |
| 15 | + var certificatesArr : [CNLiveVitaeCertificatesModel]? { | |
| 16 | 16 | get{ |
| 17 | 17 | _certificatesArr |
| 18 | 18 | } |
| 19 | 19 | set{ |
| 20 | 20 | _certificatesArr = newValue! |
| 21 | - setupNewUI(models: _certificatesArr!) | |
| 21 | + setupNewUI(modelsArr: newValue!) | |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| ... | ... | @@ -63,19 +63,19 @@ class CNLiveDigitalThreeCell: UITableViewCell, UICollectionViewDelegate, UIColle |
| 63 | 63 | return titleLabel |
| 64 | 64 | }() |
| 65 | 65 | |
| 66 | - let kCNLiveDigitalThreeCerCollectCellID = "kCNLiveDigitalThreeCerCollectCellID" | |
| 67 | - lazy var threeCollectionView: UICollectionView = { | |
| 68 | - let layout = UICollectionViewFlowLayout() | |
| 69 | - layout.itemSize = CGSizeMake(85, 101) | |
| 70 | - layout.minimumLineSpacing = 20 | |
| 71 | - layout.scrollDirection = .horizontal | |
| 72 | - let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) | |
| 73 | - collectionView.delegate = self | |
| 74 | - collectionView.dataSource = self | |
| 75 | - collectionView.backgroundColor = .clear | |
| 76 | - collectionView.register(CNLiveDigitalThreeCerCollectCell.self, forCellWithReuseIdentifier: kCNLiveDigitalThreeCerCollectCellID) | |
| 77 | - return collectionView | |
| 78 | - }() | |
| 66 | +// let kCNLiveDigitalThreeCerCollectCellID = "kCNLiveDigitalThreeCerCollectCellID" | |
| 67 | +// lazy var threeCollectionView: UICollectionView = { | |
| 68 | +// let layout = UICollectionViewFlowLayout() | |
| 69 | +// layout.itemSize = CGSizeMake(85, 101) | |
| 70 | +// layout.minimumLineSpacing = 20 | |
| 71 | +// layout.scrollDirection = .horizontal | |
| 72 | +// let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) | |
| 73 | +// collectionView.delegate = self | |
| 74 | +// collectionView.dataSource = self | |
| 75 | +// collectionView.backgroundColor = .clear | |
| 76 | +// collectionView.register(CNLiveDigitalThreeCerCollectCell.self, forCellWithReuseIdentifier: kCNLiveDigitalThreeCerCollectCellID) | |
| 77 | +// return collectionView | |
| 78 | +// }() | |
| 79 | 79 | |
| 80 | 80 | lazy var zhengshuNoDescTitleLabel: UILabel = { |
| 81 | 81 | let titleLabel = UILabel() |
| ... | ... | @@ -112,18 +112,23 @@ class CNLiveDigitalThreeCell: UITableViewCell, UICollectionViewDelegate, UIColle |
| 112 | 112 | self.selectionStyle = .none |
| 113 | 113 | |
| 114 | 114 | self.contentView.addSubview(self.whiteView) |
| 115 | + self.whiteView.snp.makeConstraints { make in | |
| 116 | + make.top.equalTo(15) | |
| 117 | + make.bottom.equalToSuperview() | |
| 118 | + make.left.equalTo(15) | |
| 119 | + make.right.equalToSuperview().offset(-15) | |
| 120 | + } | |
| 115 | 121 | self.whiteView.addSubview(self.authNameTitleLabel) |
| 116 | 122 | self.authNameTitleLabel.snp.makeConstraints { make in |
| 123 | + make.top.equalToSuperview().offset(adapt_length(length: 15)) | |
| 117 | 124 | make.left.equalTo(adapt_length(length: 15)) |
| 118 | - make.top.equalTo(adapt_length(length: 15)) | |
| 119 | 125 | } |
| 120 | - | |
| 121 | 126 | self.whiteView.addSubview(self.zhengshuView) |
| 122 | 127 | self.zhengshuView.snp.makeConstraints { make in |
| 123 | 128 | make.left.equalToSuperview().offset(adapt_length(length: 15)) |
| 124 | 129 | make.right.equalToSuperview().offset(adapt_length(length: -15)) |
| 125 | 130 | make.top.equalTo(self.authNameTitleLabel.snp.bottom).offset(adapt_length(length: 15)) |
| 126 | - make.height.equalTo(249) | |
| 131 | + make.bottom.equalToSuperview().offset(-54-15) | |
| 127 | 132 | } |
| 128 | 133 | self.zhengshuView.addSubview(self.zhengshuTitleLabel) |
| 129 | 134 | self.zhengshuTitleLabel.snp.makeConstraints { make in |
| ... | ... | @@ -135,33 +140,82 @@ class CNLiveDigitalThreeCell: UITableViewCell, UICollectionViewDelegate, UIColle |
| 135 | 140 | make.left.equalToSuperview().offset(adapt_length(length: 15)) |
| 136 | 141 | make.top.equalTo(self.zhengshuTitleLabel.snp.bottom).offset(adapt_length(length: 3)) |
| 137 | 142 | } |
| 138 | - self.zhengshuView.addSubview(self.threeCollectionView) | |
| 139 | - self.threeCollectionView.snp.makeConstraints { make in | |
| 140 | - make.left.right.equalToSuperview() | |
| 141 | - make.top.equalTo(self.zhengshuDescTitleLabel.snp.bottom).offset(15) | |
| 142 | - make.height.equalTo(101) | |
| 143 | - make.width.equalToSuperview().offset(-20) | |
| 144 | - } | |
| 145 | - self.zhengshuView.addSubview(self.zhengshuBtn) | |
| 143 | + | |
| 144 | + self.whiteView.addSubview(self.zhengshuBtn) | |
| 146 | 145 | self.zhengshuBtn.snp.makeConstraints { make in |
| 147 | 146 | make.centerX.equalToSuperview() |
| 148 | - make.bottom.equalToSuperview().offset(adapt_length(length: -20)) | |
| 149 | - make.width.equalTo(adapt_length(length: 86)) | |
| 147 | + make.bottom.equalToSuperview().offset(-20) | |
| 148 | + make.width.equalTo(86) | |
| 150 | 149 | make.height.equalTo(34) |
| 151 | 150 | } |
| 152 | 151 | |
| 153 | - self.zhengshuView.addSubview(self.zhengshuNoDescTitleLabel) | |
| 152 | + self.whiteView.addSubview(self.zhengshuNoDescTitleLabel) | |
| 154 | 153 | self.zhengshuNoDescTitleLabel.snp.makeConstraints { make in |
| 155 | 154 | make.centerX.equalToSuperview() |
| 156 | 155 | make.bottom.equalTo(self.zhengshuBtn.snp.top).offset(-10) |
| 157 | 156 | } |
| 158 | - self.zhengshuView.addSubview(self.zhengshuNoIconImgView) | |
| 157 | + self.whiteView.addSubview(self.zhengshuNoIconImgView) | |
| 159 | 158 | self.zhengshuNoIconImgView.snp.makeConstraints { make in |
| 160 | 159 | make.centerX.equalToSuperview() |
| 161 | 160 | make.bottom.equalTo(self.zhengshuNoDescTitleLabel.snp.top).offset(-10) |
| 162 | 161 | make.width.equalTo(60) |
| 163 | 162 | make.height.equalTo(45) |
| 164 | 163 | } |
| 164 | +// self.contentView.backgroundColor = .clear | |
| 165 | +// self.backgroundColor = .clear | |
| 166 | +// self.selectionStyle = .none | |
| 167 | +// | |
| 168 | +// self.contentView.addSubview(self.whiteView) | |
| 169 | +// self.whiteView.addSubview(self.authNameTitleLabel) | |
| 170 | +// self.authNameTitleLabel.snp.makeConstraints { make in | |
| 171 | +// make.left.equalTo(adapt_length(length: 15)) | |
| 172 | +// make.top.equalTo(adapt_length(length: 15)) | |
| 173 | +// } | |
| 174 | +// | |
| 175 | +// self.whiteView.addSubview(self.zhengshuView) | |
| 176 | +// self.zhengshuView.snp.makeConstraints { make in | |
| 177 | +// make.left.equalToSuperview().offset(adapt_length(length: 15)) | |
| 178 | +// make.right.equalToSuperview().offset(adapt_length(length: -15)) | |
| 179 | +// make.top.equalTo(self.authNameTitleLabel.snp.bottom).offset(adapt_length(length: 15)) | |
| 180 | +// make.height.equalTo(249) | |
| 181 | +// } | |
| 182 | +// self.zhengshuView.addSubview(self.zhengshuTitleLabel) | |
| 183 | +// self.zhengshuTitleLabel.snp.makeConstraints { make in | |
| 184 | +// make.left.equalToSuperview().offset(adapt_length(length: 15)) | |
| 185 | +// make.top.equalToSuperview().offset(adapt_length(length: 15)) | |
| 186 | +// } | |
| 187 | +// self.zhengshuView.addSubview(self.zhengshuDescTitleLabel) | |
| 188 | +// self.zhengshuDescTitleLabel.snp.makeConstraints { make in | |
| 189 | +// make.left.equalToSuperview().offset(adapt_length(length: 15)) | |
| 190 | +// make.top.equalTo(self.zhengshuTitleLabel.snp.bottom).offset(adapt_length(length: 3)) | |
| 191 | +// } | |
| 192 | +// self.zhengshuView.addSubview(self.threeCollectionView) | |
| 193 | +// self.threeCollectionView.snp.makeConstraints { make in | |
| 194 | +// make.left.right.equalToSuperview() | |
| 195 | +// make.top.equalTo(self.zhengshuDescTitleLabel.snp.bottom).offset(15) | |
| 196 | +// make.height.equalTo(101) | |
| 197 | +// make.width.equalToSuperview().offset(-20) | |
| 198 | +// } | |
| 199 | +// self.zhengshuView.addSubview(self.zhengshuBtn) | |
| 200 | +// self.zhengshuBtn.snp.makeConstraints { make in | |
| 201 | +// make.centerX.equalToSuperview() | |
| 202 | +// make.bottom.equalToSuperview().offset(adapt_length(length: -20)) | |
| 203 | +// make.width.equalTo(adapt_length(length: 86)) | |
| 204 | +// make.height.equalTo(34) | |
| 205 | +// } | |
| 206 | +// | |
| 207 | +// self.zhengshuView.addSubview(self.zhengshuNoDescTitleLabel) | |
| 208 | +// self.zhengshuNoDescTitleLabel.snp.makeConstraints { make in | |
| 209 | +// make.centerX.equalToSuperview() | |
| 210 | +// make.bottom.equalTo(self.zhengshuBtn.snp.top).offset(-10) | |
| 211 | +// } | |
| 212 | +// self.zhengshuView.addSubview(self.zhengshuNoIconImgView) | |
| 213 | +// self.zhengshuNoIconImgView.snp.makeConstraints { make in | |
| 214 | +// make.centerX.equalToSuperview() | |
| 215 | +// make.bottom.equalTo(self.zhengshuNoDescTitleLabel.snp.top).offset(-10) | |
| 216 | +// make.width.equalTo(60) | |
| 217 | +// make.height.equalTo(45) | |
| 218 | +// } | |
| 165 | 219 | |
| 166 | 220 | |
| 167 | 221 | } |
| ... | ... | @@ -169,36 +223,97 @@ class CNLiveDigitalThreeCell: UITableViewCell, UICollectionViewDelegate, UIColle |
| 169 | 223 | fatalError("init(coder:) has not been implemented") |
| 170 | 224 | } |
| 171 | 225 | |
| 172 | - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | |
| 173 | - self.certificatesArr?.count ?? 0 | |
| 174 | - } | |
| 175 | - | |
| 176 | - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
| 177 | - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveDigitalThreeCerCollectCellID, for: indexPath) as! CNLiveDigitalThreeCerCollectCell | |
| 178 | - cell.cerModel = self.certificatesArr?[indexPath.row] | |
| 179 | - return cell | |
| 180 | - } | |
| 181 | - | |
| 182 | - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | |
| 183 | - navigationViewController().pushViewController(CNLiveVitaeVocationalCertificateController(), animated: true) | |
| 184 | - } | |
| 226 | +// func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | |
| 227 | +// self.certificatesArr?.count ?? 0 | |
| 228 | +// } | |
| 229 | +// | |
| 230 | +// func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
| 231 | +// let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveDigitalThreeCerCollectCellID, for: indexPath) as! CNLiveDigitalThreeCerCollectCell | |
| 232 | +// cell.cerModel = self.certificatesArr?[indexPath.row] | |
| 233 | +// return cell | |
| 234 | +// } | |
| 235 | +// | |
| 236 | +// func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | |
| 237 | +// navigationViewController().pushViewController(CNLiveVitaeVocationalCertificateController(), animated: true) | |
| 238 | +// } | |
| 185 | 239 | |
| 186 | 240 | @objc func zhengshuBtnAction(){ |
| 187 | 241 | //跳转 证书列表页面 |
| 188 | 242 | navigationViewController().pushViewController(CNLiveVitaeVocationalCertificateController(), animated: true) |
| 189 | 243 | } |
| 190 | 244 | |
| 191 | - func setupNewUI(models:[CNLiveVitaeCertificateModel]){ | |
| 192 | - if models.count > 0{ | |
| 193 | - self.threeCollectionView.reloadData() | |
| 194 | - self.threeCollectionView.isHidden = false | |
| 195 | - self.zhengshuNoDescTitleLabel.isHidden = true | |
| 245 | +// func setupNewUI(models:[CNLiveVitaeCertificateModel]){ | |
| 246 | +// if models.count > 0{ | |
| 247 | +// self.threeCollectionView.reloadData() | |
| 248 | +// self.threeCollectionView.isHidden = false | |
| 249 | +// self.zhengshuNoDescTitleLabel.isHidden = true | |
| 250 | +// self.zhengshuNoIconImgView.isHidden = true | |
| 251 | +// | |
| 252 | +// }else{ | |
| 253 | +// self.threeCollectionView.isHidden = true | |
| 254 | +// self.zhengshuNoDescTitleLabel.isHidden = false | |
| 255 | +// self.zhengshuNoIconImgView.isHidden = false | |
| 256 | +// } | |
| 257 | +// } | |
| 258 | + func setupNewUI(modelsArr:[CNLiveVitaeCertificatesModel]){ | |
| 259 | + self.whiteView.subviews.forEach { view in | |
| 260 | + if view.tag >= 1000{ | |
| 261 | + view.removeFromSuperview() | |
| 262 | + } | |
| 263 | + } | |
| 264 | + if modelsArr.count > 0{ | |
| 265 | + //有 证书 | |
| 266 | + //计算几行 ,1行3个 | |
| 267 | + let totalHang:Int = modelsArr.count / 3 | |
| 268 | + if totalHang == 0{ | |
| 269 | + self.whiteView.height = CerHaveDataPreViewCellHeight | |
| 270 | + }else{ | |
| 271 | + self.whiteView.height = CerHaveDataPreViewCellHeight+72+15+CGFloat(totalHang*115) | |
| 272 | + } | |
| 196 | 273 | self.zhengshuNoIconImgView.isHidden = true |
| 197 | - | |
| 274 | + self.zhengshuNoDescTitleLabel.isHidden = true | |
| 275 | + | |
| 276 | + for i in 0..<modelsArr.count { | |
| 277 | + let imgW:Float = Float((KSreenWidth-80-30)/3.0) | |
| 278 | + let imgH:Float = 101*imgW/85.0 | |
| 279 | + let imgGap:Float = 20 | |
| 280 | + let imgLeftGap:Float = 20 | |
| 281 | + let lie = i%3 | |
| 282 | + let hang = i/3 | |
| 283 | + let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgW)*Float(lie)), y: CGFloat((imgH+10)*Float(hang))+125, width: CGFloat(imgW), height: CGFloat(imgH))) | |
| 284 | + imgView.contentMode = .scaleAspectFit | |
| 285 | + imgView.tag = 1000+i | |
| 286 | + let cerModel = modelsArr[i]//CNLiveVitaeCertificateModel | |
| 287 | +// let imgUrl = cerModel.img | |
| 288 | +// imgView.kf.setImage(with: URL(string: imgUrl)) | |
| 289 | + if cerModel.status == 1{ | |
| 290 | + imgView.image = UIImage(named: "mine_jianli_cerBg_authed") | |
| 291 | + }else{ | |
| 292 | + imgView.image = UIImage(named: "mine_jianli_cerBg_unauthed") | |
| 293 | + } | |
| 294 | + imgView.clipsToBounds = true | |
| 295 | + imgView.layer.cornerRadius = 5 | |
| 296 | + self.whiteView.addSubview(imgView) | |
| 297 | + | |
| 298 | + let titleX:Float = 15*imgW/85 | |
| 299 | + let titleY:Float = 19*imgW/85 | |
| 300 | + let titleW:Float = 55*imgW/85 | |
| 301 | + let titleH:Float = 30 | |
| 302 | + let titleLbl = UILabel() | |
| 303 | + titleLbl.frame = CGRect(x: CGFloat(titleX), y: CGFloat(titleY), width: CGFloat(titleW), height: CGFloat(titleH)) | |
| 304 | + titleLbl.numberOfLines = 2 | |
| 305 | + titleLbl.font = BoldFont_11 | |
| 306 | + titleLbl.textColor = HexColor("#333333") | |
| 307 | + titleLbl.textAlignment = .center | |
| 308 | + imgView.addSubview(titleLbl) | |
| 309 | + titleLbl.text = cerModel.title | |
| 310 | + } | |
| 311 | + | |
| 198 | 312 | }else{ |
| 199 | - self.threeCollectionView.isHidden = true | |
| 200 | - self.zhengshuNoDescTitleLabel.isHidden = false | |
| 313 | + //没有 证书 | |
| 314 | + self.whiteView.height = DefaultPreViewCellHeight | |
| 201 | 315 | self.zhengshuNoIconImgView.isHidden = false |
| 316 | + self.zhengshuNoDescTitleLabel.isHidden = false | |
| 202 | 317 | } |
| 203 | 318 | } |
| 204 | 319 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/数字资产cell/CNLiveDigitalThreeCerCollectCell .swift
| ... | ... | @@ -10,8 +10,8 @@ import Kingfisher |
| 10 | 10 | |
| 11 | 11 | class CNLiveDigitalThreeCerCollectCell: UICollectionViewCell { |
| 12 | 12 | |
| 13 | - var _cerModel : CNLiveVitaeCertificateModel? | |
| 14 | - var cerModel : CNLiveVitaeCertificateModel? { | |
| 13 | + var _cerModel : CNLiveVitaeCertificatesModel? | |
| 14 | + var cerModel : CNLiveVitaeCertificatesModel? { | |
| 15 | 15 | get{ |
| 16 | 16 | _cerModel |
| 17 | 17 | } |
| ... | ... | @@ -54,7 +54,7 @@ class CNLiveDigitalThreeCerCollectCell: UICollectionViewCell { |
| 54 | 54 | fatalError("init(coder:) has not been implemented") |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - func setupNewUI(model:CNLiveVitaeCertificateModel){ | |
| 57 | + func setupNewUI(model:CNLiveVitaeCertificatesModel){ | |
| 58 | 58 | if model.status == 1{ |
| 59 | 59 | self.iconImgView.image = UIImage(named: "mine_jianli_cerBg_authed") |
| 60 | 60 | }else{ | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/Vitae/CNLiveVitaeViewModel.swift
| ... | ... | @@ -263,7 +263,7 @@ class CNLiveVitaeViewModel:NSObject{ |
| 263 | 263 | if resp["errorCode"] as! Int == 0{ |
| 264 | 264 | let dataDic = resp["data"] as! NSDictionary |
| 265 | 265 | let shopDetailModel = newDictionaryToModel(dataDic as! [String : Any], CNLiveVitaeCertificateListModel.self) as! CNLiveVitaeCertificateListModel |
| 266 | - resultBlock(shopDetailModel.list ?? [CNLiveVitaeCertificateModel](),.success) | |
| 266 | + resultBlock(shopDetailModel.list ?? [CNLiveVitaeCertificatesModel](),.success) | |
| 267 | 267 | }else{ |
| 268 | 268 | resultBlock(NSNull(),.failed) |
| 269 | 269 | } | ... | ... |
metaCode/Classes/Main/Model/Vitae/CNLiveVitaeCertificateModel.swift
| ... | ... | @@ -8,37 +8,37 @@ |
| 8 | 8 | import Foundation |
| 9 | 9 | |
| 10 | 10 | class CNLiveVitaeCertificateListModel:BaseModel{ |
| 11 | - var list:[CNLiveVitaeCertificateModel]? | |
| 12 | -} | |
| 13 | -class CNLiveVitaeCertificateModel:BaseModel{ | |
| 14 | - ///id | |
| 15 | - var id:String = "" | |
| 16 | - /// | |
| 17 | - var vsid:String = "" | |
| 18 | - /// | |
| 19 | - var img:String = "" | |
| 20 | - /// | |
| 21 | - var title:String = "" | |
| 22 | - /// | |
| 23 | - var uploadTime:String = "" | |
| 24 | - /// | |
| 25 | - var status:Int = 0//0审核中 1审核成功 | |
| 26 | - /// | |
| 27 | - var number:String = "" | |
| 28 | - /// | |
| 29 | - var lv:String = "" | |
| 30 | - /// | |
| 31 | - var time:String = "" | |
| 32 | - /// | |
| 33 | - var organization:String = "" | |
| 34 | - /// | |
| 35 | - var validity:String = "" | |
| 36 | - | |
| 37 | - | |
| 38 | - //预览简历-关联认证时 判断 0未关联 1已关联 -1不可选中 | |
| 39 | - var selectStatus: Int = 0//0未关联 1已关联 -1不可选中 | |
| 40 | - | |
| 11 | + var list:[CNLiveVitaeCertificatesModel]? | |
| 41 | 12 | } |
| 13 | +//class CNLiveVitaeCertificateModel:BaseModel{ | |
| 14 | +// ///id | |
| 15 | +// var id:String = "" | |
| 16 | +// /// | |
| 17 | +// var vsid:String = "" | |
| 18 | +// /// | |
| 19 | +// var img:String = "" | |
| 20 | +// /// | |
| 21 | +// var title:String = "" | |
| 22 | +// /// | |
| 23 | +// var uploadTime:String = "" | |
| 24 | +// /// | |
| 25 | +// var status:Int = 0//0审核中 1审核成功 | |
| 26 | +// /// | |
| 27 | +// var number:String = "" | |
| 28 | +// /// | |
| 29 | +// var lv:String = "" | |
| 30 | +// /// | |
| 31 | +// var time:String = "" | |
| 32 | +// /// | |
| 33 | +// var organization:String = "" | |
| 34 | +// /// | |
| 35 | +// var validity:String = "" | |
| 36 | +// | |
| 37 | +// | |
| 38 | +// //预览简历-关联认证时 判断 0未关联 1已关联 -1不可选中 | |
| 39 | +// var selectStatus: Int = 0//0未关联 1已关联 -1不可选中 | |
| 40 | +// | |
| 41 | +//} | |
| 42 | 42 | /** |
| 43 | 43 | { |
| 44 | 44 | "id": 26, | ... | ... |
metaCode/Classes/Main/Model/Vitae/CNLiveVitaeModel.swift
| ... | ... | @@ -113,6 +113,7 @@ class CNLiveVitaeWorksModel:BaseModel{ |
| 113 | 113 | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | + | |
| 116 | 117 | //简历证书模块 |
| 117 | 118 | class CNLiveVitaeCertificatesModel:BaseModel{ |
| 118 | 119 | /// |
| ... | ... | @@ -137,6 +138,10 @@ class CNLiveVitaeCertificatesModel:BaseModel{ |
| 137 | 138 | var organization:String = "" |
| 138 | 139 | /// |
| 139 | 140 | var validity:String = "" |
| 141 | + | |
| 142 | + //预览简历-关联认证时 判断 0未关联 1已关联 -1不可选中 | |
| 143 | + var selectStatus: Int = 0//0未 | |
| 144 | + | |
| 140 | 145 | } |
| 141 | 146 | |
| 142 | 147 | //简历奖模块 | ... | ... |