Commit e563927a75f9356d4b7cd2fb54e600760fd46f51
1 parent
ee2711a5
选择 认证, 选择证书 UI搭建
Showing
8 changed files
with
328 additions
and
97 deletions
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewController.swift
| ... | ... | @@ -369,21 +369,6 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 369 | 369 | print("moreNavBtnAction") |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - // MARK: - 获取证书数量 | |
| 373 | -// func getCetList(){ | |
| 374 | -// let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" | |
| 375 | -// CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in | |
| 376 | -// if respStatue == .success{ | |
| 377 | -// if let res = result as? [CNLiveVitaeCertificateModel]{ | |
| 378 | -// self.threeCerDataArray = res | |
| 379 | -// self.tableView.reloadData() | |
| 380 | -// } | |
| 381 | -// }else{ | |
| 382 | -// showMessage(message: "数据异常") | |
| 383 | -// } | |
| 384 | -// | |
| 385 | -// } | |
| 386 | -// } | |
| 387 | 372 | // MARK: - 获取简历数据 |
| 388 | 373 | func getVitae(){ |
| 389 | 374 | |
| ... | ... | @@ -451,33 +436,6 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 451 | 436 | } |
| 452 | 437 | } |
| 453 | 438 | } |
| 454 | -// func getAuthInfoList(){ | |
| 455 | -// CNLiveMineViewModel.requestsGETAuthInfoList(page: 1) { [weak self] result, respStatue in | |
| 456 | -// if respStatue == .success { | |
| 457 | -// let listBaseModel = result as! MineAuthListBaseModel | |
| 458 | -// if self != nil{ | |
| 459 | -// var arr = Array<MineAuthListModel>() | |
| 460 | -// var sussArr = Array<MineAuthListModel>() | |
| 461 | -// listBaseModel.list.forEach { listMdl in | |
| 462 | -// if listMdl.userStatus == 1{ | |
| 463 | -// arr.insert(listMdl, at: 0) | |
| 464 | -// sussArr.append(listMdl) | |
| 465 | -// }else{ | |
| 466 | -// arr.append(listMdl) | |
| 467 | -// } | |
| 468 | -// } | |
| 469 | -// self!.secTotalDataArray.removeAllObjects() | |
| 470 | -// self!.secTotalDataArray.addObjects(from: arr) | |
| 471 | -// self!.succDataArray.removeAllObjects() | |
| 472 | -// self!.succDataArray.addObjects(from: sussArr) | |
| 473 | -// self!.tableView.reloadData() | |
| 474 | -// } | |
| 475 | -// }else { | |
| 476 | -// | |
| 477 | -// } | |
| 478 | -// } | |
| 479 | -// } | |
| 480 | - | |
| 481 | 439 | |
| 482 | 440 | func saveUpdateVitae(isSave:Bool){ |
| 483 | 441 | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewSelectRenzhengCerController.swift
| ... | ... | @@ -18,11 +18,36 @@ enum CNLiveViateSelectRenzhengCerType { |
| 18 | 18 | class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ |
| 19 | 19 | |
| 20 | 20 | var renzhengCerType:CNLiveViateSelectRenzhengCerType = .renzheng |
| 21 | - | |
| 22 | - lazy var dataArray :NSMutableArray = { | |
| 23 | - let dataArray = NSMutableArray() | |
| 21 | + //简历里 认证列表的数据 | |
| 22 | + var _digitalListModels : [CNLiveVitaeIdentitiesModel]? | |
| 23 | + var digitalListModels : [CNLiveVitaeIdentitiesModel]? { | |
| 24 | + get{ | |
| 25 | + _digitalListModels | |
| 26 | + } | |
| 27 | + set{ | |
| 28 | + _digitalListModels = newValue! | |
| 29 | + setupNewUI(models: _digitalListModels!) | |
| 30 | + } | |
| 31 | + } | |
| 32 | + | |
| 33 | + //简历里 证书列表的数据 | |
| 34 | + var _cerListModels : [CNLiveVitaeCertificatesModel]? | |
| 35 | + var cerListModels : [CNLiveVitaeCertificatesModel]? { | |
| 36 | + get{ | |
| 37 | + _cerListModels | |
| 38 | + } | |
| 39 | + set{ | |
| 40 | + _cerListModels = newValue! | |
| 41 | + setupCerNewUI(models: _cerListModels!) | |
| 42 | + } | |
| 43 | + } | |
| 44 | + | |
| 45 | + //认证和证书 数据源 | |
| 46 | + lazy var totalDataArray: NSMutableArray = { | |
| 47 | + var dataArray = NSMutableArray() | |
| 24 | 48 | return dataArray |
| 25 | 49 | }() |
| 50 | + | |
| 26 | 51 | let kCNLiveDigitalResumeGuanfangRenzhengCellIdentifier = "kCNLiveDigitalResumeGuanfangRenzhengCellIdentifier" |
| 27 | 52 | let kCNLiveDigitalResumeSelectCerCellIdentifier = "kCNLiveDigitalResumeSelectCerCellIdentifier" |
| 28 | 53 | |
| ... | ... | @@ -82,7 +107,11 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 82 | 107 | |
| 83 | 108 | override func viewWillAppear(_ animated: Bool) { |
| 84 | 109 | super.viewWillAppear(animated) |
| 85 | -// self.getCetList() | |
| 110 | + if self.renzhengCerType == .renzheng{ | |
| 111 | + self.getAuthInfoList() | |
| 112 | + }else{ | |
| 113 | + self.getCerList() | |
| 114 | + } | |
| 86 | 115 | } |
| 87 | 116 | |
| 88 | 117 | override func viewDidLoad() { |
| ... | ... | @@ -90,9 +119,11 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 90 | 119 | if self.renzhengCerType == .renzheng{ |
| 91 | 120 | titleName = "选择官方认证" |
| 92 | 121 | self.renzhengCerLabel.text = "官方认证" |
| 122 | + self.addBtn.setTitle("添加官方认证", for: .normal) | |
| 93 | 123 | }else{ |
| 94 | 124 | titleName = "选择证书" |
| 95 | 125 | self.renzhengCerLabel.text = "技能证书" |
| 126 | + self.addBtn.setTitle("添加证书", for: .normal) | |
| 96 | 127 | } |
| 97 | 128 | navigationBarHidden = false |
| 98 | 129 | self.view.backgroundColor = HexColor("#F5F6FB") |
| ... | ... | @@ -127,11 +158,20 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 127 | 158 | } |
| 128 | 159 | |
| 129 | 160 | self.view.addSubview(self.addBtn) |
| 130 | - self.addBtn.snp.makeConstraints { make in | |
| 131 | - make.top.equalTo(KNavigationHeight) | |
| 132 | - make.right.equalToSuperview().offset(-15) | |
| 133 | - make.width.equalTo(70) | |
| 134 | - make.height.equalTo(53) | |
| 161 | + if self.renzhengCerType == .renzheng{ | |
| 162 | + self.addBtn.snp.makeConstraints { make in | |
| 163 | + make.top.equalTo(KNavigationHeight) | |
| 164 | + make.right.equalToSuperview().offset(-15) | |
| 165 | + make.width.equalTo(100) | |
| 166 | + make.height.equalTo(53) | |
| 167 | + } | |
| 168 | + }else{ | |
| 169 | + self.addBtn.snp.makeConstraints { make in | |
| 170 | + make.top.equalTo(KNavigationHeight) | |
| 171 | + make.right.equalToSuperview().offset(-15) | |
| 172 | + make.width.equalTo(70) | |
| 173 | + make.height.equalTo(53) | |
| 174 | + } | |
| 135 | 175 | } |
| 136 | 176 | self.view.addSubview(self.renzhengCerLabel) |
| 137 | 177 | self.renzhengCerLabel.snp.makeConstraints { make in |
| ... | ... | @@ -146,17 +186,18 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 146 | 186 | } |
| 147 | 187 | |
| 148 | 188 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| 149 | - return 2 | |
| 189 | + return self.totalDataArray.count | |
| 150 | 190 | } |
| 151 | 191 | |
| 152 | 192 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| 153 | - if indexPath.row == 0{ | |
| 193 | + if self.renzhengCerType == .renzheng{ | |
| 154 | 194 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumeGuanfangRenzhengCellIdentifier) as? CNLiveDigitalResumeGuanfangRenzhengCell |
| 155 | 195 | else { |
| 156 | 196 | let cell = CNLiveDigitalResumeGuanfangRenzhengCell() |
| 157 | 197 | return cell |
| 158 | 198 | } |
| 159 | - | |
| 199 | + let authListMdl = self.totalDataArray[indexPath.row] as! MineAuthListModel | |
| 200 | + cell.authListModel = authListMdl | |
| 160 | 201 | return cell |
| 161 | 202 | }else{ |
| 162 | 203 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumeSelectCerCellIdentifier) as? CNLiveDigitalResumeSelectCerCell |
| ... | ... | @@ -164,8 +205,11 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 164 | 205 | let cell = CNLiveDigitalResumeSelectCerCell() |
| 165 | 206 | return cell |
| 166 | 207 | } |
| 208 | + let cerListMdl = self.totalDataArray[indexPath.row] as! CNLiveVitaeCertificateModel | |
| 209 | + cell.cerListMdl = cerListMdl | |
| 167 | 210 | return cell |
| 168 | 211 | } |
| 212 | + | |
| 169 | 213 | } |
| 170 | 214 | |
| 171 | 215 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| ... | ... | @@ -180,6 +224,23 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 180 | 224 | } |
| 181 | 225 | } |
| 182 | 226 | |
| 227 | + func setupNewUI(models:[CNLiveVitaeIdentitiesModel]){ | |
| 228 | + if models.count > 0{ | |
| 229 | + | |
| 230 | + }else{ | |
| 231 | + | |
| 232 | + } | |
| 233 | + } | |
| 234 | + | |
| 235 | + func setupCerNewUI(models:[CNLiveVitaeCertificatesModel]){ | |
| 236 | + if models.count > 0{ | |
| 237 | + | |
| 238 | + }else{ | |
| 239 | + | |
| 240 | + } | |
| 241 | + } | |
| 242 | + | |
| 243 | + // MARK: - ButtonAction | |
| 183 | 244 | @objc func settingBtnAction(){ |
| 184 | 245 | //取消 |
| 185 | 246 | |
| ... | ... | @@ -193,4 +254,93 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro |
| 193 | 254 | |
| 194 | 255 | } |
| 195 | 256 | |
| 257 | + // MARK: - 获取证书数量 | |
| 258 | + func getCerList(){ | |
| 259 | + let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" | |
| 260 | + CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in | |
| 261 | + if respStatue == .success{ | |
| 262 | + if let res = result as? [CNLiveVitaeCertificateModel]{ | |
| 263 | + var arr = Array<CNLiveVitaeCertificateModel>() | |
| 264 | + var guanlianNum = 0 | |
| 265 | + res.forEach { cerMdl in | |
| 266 | + if let cerListArr = self.cerListModels{ | |
| 267 | + for (_,mdl) in cerListArr.enumerated() { | |
| 268 | + let model = mdl | |
| 269 | + if cerMdl.id == model.id{ | |
| 270 | + //已关联 | |
| 271 | + if cerMdl.status == 0{//审核中:不可关联 | |
| 272 | + cerMdl.selectStatus = -1 | |
| 273 | + }else{//审核成功:可关联 | |
| 274 | + cerMdl.selectStatus = 1 | |
| 275 | + } | |
| 276 | + guanlianNum = guanlianNum + 1 | |
| 277 | + }else{ | |
| 278 | + //未关联 | |
| 279 | + } | |
| 280 | + } | |
| 281 | + } | |
| 282 | + arr.append(cerMdl) | |
| 283 | + | |
| 284 | + } | |
| 285 | + self.renzhengCerLabel.text = "技能证书(\(guanlianNum)本)" | |
| 286 | + | |
| 287 | + self.totalDataArray.removeAllObjects() | |
| 288 | + self.totalDataArray.addObjects(from: arr) | |
| 289 | + self.tableView.reloadData() | |
| 290 | + } | |
| 291 | + }else{ | |
| 292 | + showMessage(message: "数据异常") | |
| 293 | + } | |
| 294 | + | |
| 295 | + } | |
| 296 | + } | |
| 297 | + //获取认证信息 | |
| 298 | + func getAuthInfoList(){ | |
| 299 | + CNLiveMineViewModel.requestsGETAuthInfoList(page: 1) { [weak self] result, respStatue in | |
| 300 | + if respStatue == .success { | |
| 301 | + let listBaseModel = result as! MineAuthListBaseModel | |
| 302 | + if self != nil{ | |
| 303 | + var arr = Array<MineAuthListModel>() | |
| 304 | + var sussArr = Array<MineAuthListModel>() | |
| 305 | + var guanlianNum = 0 | |
| 306 | + listBaseModel.list.forEach { listMdl in | |
| 307 | + if let idListArr = self!.digitalListModels{ | |
| 308 | + | |
| 309 | + for (_,mdl) in idListArr.enumerated() { | |
| 310 | + let model = mdl | |
| 311 | + if listMdl.identityId == model.identityId{ | |
| 312 | + //已关联 | |
| 313 | + if listMdl.userStatus == 0{//审核中:不可关联 | |
| 314 | + listMdl.selectStatus = -1 | |
| 315 | + }else{//审核成功:可关联 | |
| 316 | + listMdl.selectStatus = 1 | |
| 317 | + } | |
| 318 | + guanlianNum = guanlianNum + 1 | |
| 319 | + }else{ | |
| 320 | + //未关联 | |
| 321 | + // listMdl.selectStatus = 0 | |
| 322 | + } | |
| 323 | + } | |
| 324 | + } | |
| 325 | + | |
| 326 | + if listMdl.userStatus == 1{ | |
| 327 | + | |
| 328 | + arr.insert(listMdl, at: 0) | |
| 329 | + sussArr.append(listMdl) | |
| 330 | + }else{ | |
| 331 | + arr.append(listMdl) | |
| 332 | + } | |
| 333 | + } | |
| 334 | + self?.renzhengCerLabel.text = "官方认证(\(guanlianNum)条)" | |
| 335 | + self!.totalDataArray.removeAllObjects() | |
| 336 | + self!.totalDataArray.addObjects(from: arr) | |
| 337 | + self!.tableView.reloadData() | |
| 338 | + } | |
| 339 | + }else { | |
| 340 | + | |
| 341 | + } | |
| 342 | + } | |
| 343 | + } | |
| 344 | + | |
| 345 | + | |
| 196 | 346 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreViewSecCell.swift
| ... | ... | @@ -172,8 +172,8 @@ class CNLiveDigitalResumePreViewSecCell: UITableViewCell, UICollectionViewDelega |
| 172 | 172 | //跳转 选择官方认证身份页面 |
| 173 | 173 | let vc = CNLiveDigitalResumePreViewSelectRenzhengCerController() |
| 174 | 174 | vc.renzhengCerType = .renzheng |
| 175 | + vc.digitalListModels = self.digitalListModels | |
| 175 | 176 | navigationViewController().pushViewController(vc, animated: true) |
| 176 | - | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/关联官方认证或证书cell/CNLiveDigitalResumeGuanfangRenzhengCell.swift
| ... | ... | @@ -7,19 +7,20 @@ |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | import SnapKit |
| 10 | +import Kingfisher | |
| 10 | 11 | |
| 11 | 12 | class CNLiveDigitalResumeGuanfangRenzhengCell:UITableViewCell{ |
| 12 | 13 | |
| 13 | -// var _userMdl : MineGetUserMsgVerifyUsersModel? | |
| 14 | -// var userMdl : MineGetUserMsgVerifyUsersModel? { | |
| 15 | -// get{ | |
| 16 | -// _userMdl | |
| 17 | -// } | |
| 18 | -// set{ | |
| 19 | -// _userMdl = newValue! | |
| 20 | -// setupNewUI(model: _userMdl!) | |
| 21 | -// } | |
| 22 | -// } | |
| 14 | + var _authListModel : MineAuthListModel? | |
| 15 | + var authListModel : MineAuthListModel? { | |
| 16 | + get{ | |
| 17 | + _authListModel | |
| 18 | + } | |
| 19 | + set{ | |
| 20 | + _authListModel = newValue! | |
| 21 | + setupNewUI(model: _authListModel!) | |
| 22 | + } | |
| 23 | + } | |
| 23 | 24 | |
| 24 | 25 | lazy var whiteView :UIView = { |
| 25 | 26 | let whiteView = UIView(frame: CGRect(x: 15, y:0, width: KSreenWidth-15-50, height:75 )) |
| ... | ... | @@ -52,21 +53,44 @@ class CNLiveDigitalResumeGuanfangRenzhengCell:UITableViewCell{ |
| 52 | 53 | whiteView.backgroundColor = .lightGray |
| 53 | 54 | return whiteView |
| 54 | 55 | }() |
| 55 | - lazy var authedBtn: UIButton = { | |
| 56 | - let closeBtn = UIButton(type: .custom) | |
| 57 | - closeBtn.frame = CGRect(x: 0, y: 0, width: 46, height: 15) | |
| 58 | - closeBtn.setTitle("已验证", for: .normal) | |
| 59 | - closeBtn.setTitleColor(HexColor("#C58733"), for: .normal) | |
| 60 | - closeBtn.backgroundColor = HexColor("#FBF3EC") | |
| 61 | - closeBtn.setImage(UIImage(named: "mine_jianli_preview_authed"), for: .normal) | |
| 62 | - closeBtn.setTitle("审核中", for: .selected) | |
| 63 | - closeBtn.setTitleColor(HexColor("#6DD400"), for: .selected) | |
| 64 | - closeBtn.titleLabel?.font = Font_11 | |
| 65 | - closeBtn.layer.cornerRadius = 4 | |
| 66 | - closeBtn.clipsToBounds = true | |
| 67 | - closeBtn.setupButtonImageAndTitlePossitionWith(padding: 2, style: .left) | |
| 68 | - return closeBtn | |
| 56 | + | |
| 57 | + lazy var authBgView :UIView = { | |
| 58 | + let whiteView = UIView(frame: CGRect(x: 15, y:0, width: KSreenWidth-15-50, height:75 )) | |
| 59 | + whiteView.backgroundColor = HexColor("#FBF3EC") | |
| 60 | + whiteView.layer.cornerRadius = 4 | |
| 61 | + whiteView.clipsToBounds = true | |
| 62 | + return whiteView | |
| 63 | + }() | |
| 64 | + lazy var authIconImageView :UIImageView = { | |
| 65 | + let whiteView = UIImageView() | |
| 66 | + whiteView.image = UIImage(named: "mine_jianli_preview_authed") | |
| 67 | + return whiteView | |
| 68 | + }() | |
| 69 | + lazy var authTitleLabel: UILabel = { | |
| 70 | + let titleLabel = UILabel() | |
| 71 | + titleLabel.textColor = HexColor("#333333") | |
| 72 | + titleLabel.textAlignment = .center | |
| 73 | + titleLabel.text = "已验证" | |
| 74 | + titleLabel.font = Font_11 | |
| 75 | + titleLabel.textColor = HexColor("#C58733") | |
| 76 | + return titleLabel | |
| 69 | 77 | }() |
| 78 | +// lazy var authedBtn: UIButton = { | |
| 79 | +// let closeBtn = UIButton(type: .custom) | |
| 80 | +// closeBtn.frame = CGRect(x: 0, y: 0, width: 46, height: 15) | |
| 81 | +// closeBtn.setTitle("已验证", for: .normal) | |
| 82 | +// closeBtn.setTitleColor(HexColor("#C58733"), for: .normal) | |
| 83 | +// closeBtn.backgroundColor = HexColor("#FBF3EC") | |
| 84 | +// closeBtn.setImage(UIImage(named: "mine_jianli_preview_authed"), for: .normal) | |
| 85 | +// closeBtn.setImage(UIImage(named: ""), for: .selected) | |
| 86 | +// closeBtn.setTitle("审核中", for: .selected) | |
| 87 | +// closeBtn.setTitleColor(HexColor("#6DD400"), for: .selected) | |
| 88 | +// closeBtn.titleLabel?.font = Font_11 | |
| 89 | +// closeBtn.layer.cornerRadius = 4 | |
| 90 | +// closeBtn.clipsToBounds = true | |
| 91 | +// closeBtn.setupButtonImageAndTitlePossitionWith(padding: 2, style: .left) | |
| 92 | +// return closeBtn | |
| 93 | +// }() | |
| 70 | 94 | |
| 71 | 95 | |
| 72 | 96 | override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { |
| ... | ... | @@ -112,19 +136,88 @@ class CNLiveDigitalResumeGuanfangRenzhengCell:UITableViewCell{ |
| 112 | 136 | make.right.lessThanOrEqualToSuperview().offset(-60) |
| 113 | 137 | } |
| 114 | 138 | |
| 115 | - self.whiteView.addSubview(self.authedBtn) | |
| 116 | - self.authedBtn.snp.makeConstraints { make in | |
| 139 | + self.whiteView.addSubview(self.authBgView) | |
| 140 | + self.authBgView.snp.makeConstraints { make in | |
| 117 | 141 | make.left.equalTo(self.nameTitleLabel.snp.right).offset(5) |
| 118 | 142 | make.centerY.equalTo(self.iconImageView.snp.centerY) |
| 119 | 143 | make.width.equalTo(60) |
| 120 | 144 | make.height.equalTo(20) |
| 121 | 145 | } |
| 146 | + self.authBgView.addSubview(self.authIconImageView) | |
| 147 | + self.authIconImageView.snp.makeConstraints { make in | |
| 148 | + make.left.equalTo(4) | |
| 149 | + make.centerY.equalToSuperview() | |
| 150 | + make.width.equalTo(11) | |
| 151 | + make.height.equalTo(11) | |
| 152 | + } | |
| 153 | + self.authBgView.addSubview(self.authTitleLabel) | |
| 154 | + self.authTitleLabel.snp.makeConstraints { make in | |
| 155 | + make.left.equalTo(self.authIconImageView.snp.right).offset(2) | |
| 156 | + make.centerY.equalToSuperview() | |
| 157 | + make.right.equalToSuperview() | |
| 158 | + } | |
| 122 | 159 | |
| 123 | 160 | } |
| 124 | 161 | |
| 125 | - func setupNewUI(model:MineGetUserMsgVerifyUsersModel){ | |
| 162 | + func setupNewUI(model:MineAuthListModel){ | |
| 126 | 163 | //默认未选择 |
| 127 | - | |
| 164 | + self.iconImageView.kf.setImage(with: URL(string: model.icon ?? "")) | |
| 165 | + self.nameTitleLabel.text = model.name ?? "" | |
| 166 | + if model.userStatus == 0{ | |
| 167 | + //0审核中 | |
| 168 | + self.authIconImageView.isHidden = true | |
| 169 | + self.authBgView.backgroundColor = HexColor("#EBFFD7") | |
| 170 | + self.authTitleLabel.text = "审核中" | |
| 171 | + self.authTitleLabel.textColor = HexColor("#6DD400") | |
| 172 | + self.authBgView.snp.remakeConstraints { make in | |
| 173 | + make.left.equalTo(self.nameTitleLabel.snp.right).offset(5) | |
| 174 | + make.centerY.equalTo(self.iconImageView.snp.centerY) | |
| 175 | + make.width.equalTo(43) | |
| 176 | + make.height.equalTo(20) | |
| 177 | + } | |
| 178 | + self.authTitleLabel.snp.remakeConstraints { make in | |
| 179 | + make.centerX.equalToSuperview() | |
| 180 | + make.centerY.equalToSuperview() | |
| 181 | + } | |
| 182 | + }else if model.userStatus == 1{ | |
| 183 | + //1审核成功 | |
| 184 | + self.authIconImageView.isHidden = false | |
| 185 | + self.authBgView.backgroundColor = HexColor("#FBF3EC") | |
| 186 | + self.authTitleLabel.text = "已验证" | |
| 187 | + self.authTitleLabel.textColor = HexColor("#C58733") | |
| 188 | + self.authBgView.snp.remakeConstraints { make in | |
| 189 | + make.left.equalTo(self.nameTitleLabel.snp.right).offset(5) | |
| 190 | + make.centerY.equalTo(self.iconImageView.snp.centerY) | |
| 191 | + make.width.equalTo(54) | |
| 192 | + make.height.equalTo(20) | |
| 193 | + } | |
| 194 | + self.authIconImageView.snp.remakeConstraints { make in | |
| 195 | + make.left.equalTo(4) | |
| 196 | + make.centerY.equalToSuperview() | |
| 197 | + make.width.equalTo(11) | |
| 198 | + make.height.equalTo(11) | |
| 199 | + } | |
| 200 | + self.authTitleLabel.snp.remakeConstraints { make in | |
| 201 | + make.centerY.equalToSuperview() | |
| 202 | + make.left.equalTo(15) | |
| 203 | + } | |
| 204 | + }else{ | |
| 205 | + | |
| 206 | + } | |
| 207 | + if model.selectStatus == 0{ | |
| 208 | + //未关联 | |
| 209 | + self.selectBtn.isHidden = false | |
| 210 | + self.selectBtn.isSelected = false | |
| 211 | + }else if model.selectStatus == 1{ | |
| 212 | + //已关联 | |
| 213 | + self.selectBtn.isHidden = false | |
| 214 | + self.selectBtn.isSelected = true | |
| 215 | + }else if model.selectStatus == -1{ | |
| 216 | + //不可选择 | |
| 217 | + self.selectBtn.isHidden = true | |
| 218 | + }else{ | |
| 219 | + | |
| 220 | + } | |
| 128 | 221 | |
| 129 | 222 | } |
| 130 | 223 | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/关联官方认证或证书cell/CNLiveDigitalResumeSelectCerCell.swift
| ... | ... | @@ -10,16 +10,17 @@ import SnapKit |
| 10 | 10 | |
| 11 | 11 | class CNLiveDigitalResumeSelectCerCell:UITableViewCell{ |
| 12 | 12 | |
| 13 | -// var _userMdl : MineGetUserMsgVerifyUsersModel? | |
| 14 | -// var userMdl : MineGetUserMsgVerifyUsersModel? { | |
| 15 | -// get{ | |
| 16 | -// _userMdl | |
| 17 | -// } | |
| 18 | -// set{ | |
| 19 | -// _userMdl = newValue! | |
| 20 | -// setupNewUI(model: _userMdl!) | |
| 21 | -// } | |
| 22 | -// } | |
| 13 | + var _cerListMdl : CNLiveVitaeCertificateModel? | |
| 14 | + var cerListMdl : CNLiveVitaeCertificateModel? { | |
| 15 | + get{ | |
| 16 | + _cerListMdl | |
| 17 | + } | |
| 18 | + set{ | |
| 19 | + _cerListMdl = newValue! | |
| 20 | + setupNewUI(model: _cerListMdl!) | |
| 21 | + } | |
| 22 | + } | |
| 23 | + | |
| 23 | 24 | |
| 24 | 25 | lazy var whiteView :UIView = { |
| 25 | 26 | let whiteView = UIView(frame: CGRect(x: 15, y:0, width: KSreenWidth-15-50, height:157 )) |
| ... | ... | @@ -190,11 +191,31 @@ class CNLiveDigitalResumeSelectCerCell:UITableViewCell{ |
| 190 | 191 | } |
| 191 | 192 | |
| 192 | 193 | } |
| 193 | - | |
| 194 | - func setupNewUI(model:MineGetUserMsgVerifyUsersModel){ | |
| 194 | + | |
| 195 | + func setupNewUI(model:CNLiveVitaeCertificateModel){ | |
| 196 | + | |
| 197 | + self.authNameTitleLabel.text = model.title | |
| 198 | + self.nameLevelRightTitleLabel.text = model.lv.count > 0 ? model.lv : "无等级" | |
| 199 | + self.nameNumberRightTitleLabel.text = model.number.count > 0 ? model.number : "无编号" | |
| 200 | + self.nameJiGouRightTitleLabel.text = model.organization.count > 0 ? model.organization : "无机构" | |
| 201 | + if model.selectStatus == 0{ | |
| 202 | + //未关联 | |
| 203 | + self.selectBtn.isHidden = false | |
| 204 | + self.selectBtn.isSelected = false | |
| 205 | + }else if model.selectStatus == 1{ | |
| 206 | + //已关联 | |
| 207 | + self.selectBtn.isHidden = false | |
| 208 | + self.selectBtn.isSelected = true | |
| 209 | + }else if model.selectStatus == -1{ | |
| 210 | + //不可选择 | |
| 211 | + self.selectBtn.isHidden = true | |
| 212 | + }else{ | |
| 213 | + | |
| 214 | + } | |
| 195 | 215 | |
| 196 | 216 | } |
| 197 | 217 | |
| 218 | + | |
| 198 | 219 | @objc func selectBtnAction(button:UIButton){ |
| 199 | 220 | button.isSelected = !button.isSelected |
| 200 | 221 | if !button.isSelected{ | ... | ... |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
| ... | ... | @@ -376,6 +376,10 @@ final class MineAuthListModel: BaseModel {//,TableCodable { |
| 376 | 376 | var identityId: Int = 0 |
| 377 | 377 | var userStatus: Int = 0//0审核中 1审核成功 |
| 378 | 378 | |
| 379 | + //预览简历-关联认证时 判断 0未关联 1已关联 -1不可选中 | |
| 380 | + var selectStatus: Int = 0//0未关联 1已关联 -1不可选中 | |
| 381 | + | |
| 382 | + | |
| 379 | 383 | // enum CodingKeys: String, CodingTableKey { |
| 380 | 384 | // |
| 381 | 385 | // typealias Root = MineAuthListModel | ... | ... |
metaCode/Classes/Main/Model/Vitae/CNLiveVitaeCertificateModel.swift
| ... | ... | @@ -22,7 +22,7 @@ class CNLiveVitaeCertificateModel:BaseModel{ |
| 22 | 22 | /// |
| 23 | 23 | var uploadTime:String = "" |
| 24 | 24 | /// |
| 25 | - var status:Int = 0 | |
| 25 | + var status:Int = 0//0审核中 1审核成功 | |
| 26 | 26 | /// |
| 27 | 27 | var number:String = "" |
| 28 | 28 | /// |
| ... | ... | @@ -33,6 +33,11 @@ class CNLiveVitaeCertificateModel:BaseModel{ |
| 33 | 33 | var organization:String = "" |
| 34 | 34 | /// |
| 35 | 35 | var validity:String = "" |
| 36 | + | |
| 37 | + | |
| 38 | + //预览简历-关联认证时 判断 0未关联 1已关联 -1不可选中 | |
| 39 | + var selectStatus: Int = 0//0未关联 1已关联 -1不可选中 | |
| 40 | + | |
| 36 | 41 | } |
| 37 | 42 | /** |
| 38 | 43 | { | ... | ... |
metaCode/Classes/Main/Model/Vitae/CNLiveVitaeModel.swift