Commit c65a958cda273d53924cd567741f3198bfe93bb6
1 parent
9ba0bf0a
预览时数据变更
Showing
5 changed files
with
183 additions
and
73 deletions
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumeController.swift
| ... | ... | @@ -7,19 +7,8 @@ |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | |
| 10 | -///数字简历页面类型 | |
| 11 | -enum CNLiveResumeType { | |
| 12 | - ///默认状态 | |
| 13 | - case normal | |
| 14 | - ///我的简历 | |
| 15 | - case mineResume | |
| 16 | - ///预览简历 | |
| 17 | - case previewResume | |
| 18 | -} | |
| 19 | - | |
| 20 | 10 | class CNLiveDigitalResumeController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ |
| 21 | 11 | |
| 22 | - var resumeType:CNLiveResumeType = .normal | |
| 23 | 12 | var certificatesCount:Int = 0//证书数量 |
| 24 | 13 | |
| 25 | 14 | //简历model | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewController.swift
| ... | ... | @@ -24,8 +24,18 @@ enum CNLiveViatePreviewCellType { |
| 24 | 24 | ///自我介绍 |
| 25 | 25 | case mineJieShao |
| 26 | 26 | } |
| 27 | +///数字简历页面类型 | |
| 28 | +enum CNLiveResumeType { | |
| 29 | + ///默认数字简历 | |
| 30 | + case normal | |
| 31 | + ///预览简历 | |
| 32 | + case previewResume | |
| 33 | +} | |
| 34 | + | |
| 27 | 35 | class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ |
| 28 | 36 | |
| 37 | + var resumeType:CNLiveResumeType = .normal | |
| 38 | + | |
| 29 | 39 | //简历model |
| 30 | 40 | var vitaeModel:CNLiveVitaeModel? |
| 31 | 41 | var sixCellHeight:CGFloat = DefaultPreViewCellHeight+15 |
| ... | ... | @@ -61,12 +71,28 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 61 | 71 | var dataArray = NSMutableArray() |
| 62 | 72 | return dataArray |
| 63 | 73 | }() |
| 74 | + //所有cell的preView type | |
| 75 | + lazy var totalPreViewDataArray: NSMutableArray = { | |
| 76 | + var dataArray = NSMutableArray() | |
| 77 | + return dataArray | |
| 78 | + }() | |
| 79 | + //workPreView的数据源 | |
| 80 | + lazy var workPreViewDataArray: NSMutableArray = { | |
| 81 | + var dataArray = NSMutableArray() | |
| 82 | + return dataArray | |
| 83 | + }() | |
| 84 | + //awardPreView的数据源 | |
| 85 | + lazy var awardPreViewDataArray: NSMutableArray = { | |
| 86 | + var dataArray = NSMutableArray() | |
| 87 | + return dataArray | |
| 88 | + }() | |
| 64 | 89 | |
| 65 | 90 | //简历-官方认证数据 |
| 66 | 91 | lazy var succDataArray: NSMutableArray = { |
| 67 | 92 | var dataArray = NSMutableArray() |
| 68 | 93 | return dataArray |
| 69 | 94 | }() |
| 95 | + //简历-证书数据 | |
| 70 | 96 | lazy var threeCerDataArray:[CNLiveVitaeCertificatesModel] = { |
| 71 | 97 | var dataArray = [CNLiveVitaeCertificatesModel]() |
| 72 | 98 | return dataArray |
| ... | ... | @@ -119,6 +145,8 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 119 | 145 | let nextBtn = UIButton(type: .custom) |
| 120 | 146 | nextBtn.setTitle("预览数字简历", for: .normal) |
| 121 | 147 | nextBtn.setTitleColor(.white, for: .normal) |
| 148 | + nextBtn.setTitle("退出预览", for: .selected) | |
| 149 | + nextBtn.setTitleColor(.white, for: .selected) | |
| 122 | 150 | nextBtn.backgroundColor = HexColor("#1961FE") |
| 123 | 151 | nextBtn.layer.cornerRadius = 20 |
| 124 | 152 | nextBtn.clipsToBounds = true |
| ... | ... | @@ -179,11 +207,20 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 179 | 207 | } |
| 180 | 208 | |
| 181 | 209 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| 182 | - return self.totalDataArray.count | |
| 210 | + if self.resumeType == .normal{ | |
| 211 | + return self.totalDataArray.count | |
| 212 | + }else{ | |
| 213 | + return self.totalPreViewDataArray.count | |
| 214 | + } | |
| 183 | 215 | } |
| 184 | 216 | |
| 185 | 217 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| 186 | - let cellType = self.totalDataArray[indexPath.row] as! CNLiveViatePreviewCellType | |
| 218 | + var cellType = CNLiveViatePreviewCellType.realName | |
| 219 | + if self.resumeType == .normal{ | |
| 220 | + cellType = self.totalDataArray[indexPath.row] as! CNLiveViatePreviewCellType | |
| 221 | + }else{ | |
| 222 | + cellType = self.totalPreViewDataArray[indexPath.row] as! CNLiveViatePreviewCellType | |
| 223 | + } | |
| 187 | 224 | if cellType == .realName{ |
| 188 | 225 | //我的简历-fir姓名等Cell |
| 189 | 226 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreViewFirCellIdentifier) as? CNLiveDigitalResumePreViewFirCell |
| ... | ... | @@ -192,9 +229,7 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 192 | 229 | return cell |
| 193 | 230 | } |
| 194 | 231 | cell.updateViateDataBlock = { |
| 195 | - | |
| 196 | 232 | self.getVitae() |
| 197 | -// self.getCetList() | |
| 198 | 233 | } |
| 199 | 234 | if self.vitaeModel?.vitae?.id ?? 0 > 0{ |
| 200 | 235 | cell.vitaeModel = self.vitaeModel! |
| ... | ... | @@ -225,10 +260,22 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 225 | 260 | let cell = CNLiveDigitalResumePreviewFourCell() |
| 226 | 261 | return cell |
| 227 | 262 | } |
| 228 | - if let workMdl = self.workDataArray[indexPath.row] as? CNLiveVitaeWorksModel{ | |
| 263 | + cell.cellType = .work | |
| 264 | + var workModel:CNLiveVitaeWorksModel? = nil | |
| 265 | + if self.resumeType == .normal{ | |
| 266 | + workModel = self.workDataArray[indexPath.row] as? CNLiveVitaeWorksModel | |
| 267 | + }else{ | |
| 268 | + workModel = self.workPreViewDataArray[indexPath.row] as? CNLiveVitaeWorksModel | |
| 269 | + } | |
| 270 | + if let workMdl = workModel{ | |
| 229 | 271 | cell.workMdl = workMdl |
| 230 | 272 | cell.vitaePreviewWorkCellChangedBlock = { workCell,jianjieHeight,isExpand in |
| 231 | - let res = self.workDataArray | |
| 273 | + var res = self.workDataArray | |
| 274 | + if self.resumeType == .normal{ | |
| 275 | + res = self.workDataArray | |
| 276 | + }else{ | |
| 277 | + res = self.workPreViewDataArray | |
| 278 | + } | |
| 232 | 279 | var tempArr = Array<Any>() |
| 233 | 280 | let idxPath = tableView.indexPath(for: workCell) |
| 234 | 281 | for (idx,mdl) in res.enumerated() { |
| ... | ... | @@ -240,7 +287,11 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 240 | 287 | tempArr.append(mdl) |
| 241 | 288 | } |
| 242 | 289 | } |
| 243 | - self.workDataArray = NSMutableArray(array: tempArr) | |
| 290 | + if self.resumeType == .normal{ | |
| 291 | + self.workDataArray = NSMutableArray(array: tempArr) | |
| 292 | + }else{ | |
| 293 | + self.workPreViewDataArray = NSMutableArray(array: tempArr) | |
| 294 | + } | |
| 244 | 295 | self.tableView.reloadData() |
| 245 | 296 | } |
| 246 | 297 | cell.vitaeWorkPreviewVideoPhotoBlock = { images , index in |
| ... | ... | @@ -263,10 +314,22 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 263 | 314 | let cell = CNLiveDigitalResumePreviewFourCell() |
| 264 | 315 | return cell |
| 265 | 316 | } |
| 266 | - if let awardMdl = self.awardDataArray[indexPath.row] as? CNLiveVitaeAwardsModel{ | |
| 317 | + cell.cellType = .award | |
| 318 | + var awardModel:CNLiveVitaeAwardsModel? | |
| 319 | + if self.resumeType == .normal{ | |
| 320 | + awardModel = self.awardDataArray[indexPath.row] as? CNLiveVitaeAwardsModel | |
| 321 | + }else{ | |
| 322 | + awardModel = self.awardPreViewDataArray[indexPath.row] as? CNLiveVitaeAwardsModel | |
| 323 | + } | |
| 324 | + if let awardMdl = awardModel{ | |
| 267 | 325 | cell.awardModel = awardMdl |
| 268 | 326 | cell.vitaePreviewWorkCellChangedBlock = { workCell,jianjieHeight ,isExpand in |
| 269 | - let res = self.awardDataArray | |
| 327 | + var res = self.awardDataArray | |
| 328 | + if self.resumeType == .normal{ | |
| 329 | + res = self.awardDataArray | |
| 330 | + }else{ | |
| 331 | + res = self.awardPreViewDataArray | |
| 332 | + } | |
| 270 | 333 | var tempArr = Array<Any>() |
| 271 | 334 | let idxPath = tableView.indexPath(for: workCell) |
| 272 | 335 | for (idx,mdl) in res.enumerated() { |
| ... | ... | @@ -278,7 +341,11 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 278 | 341 | tempArr.append(mdl) |
| 279 | 342 | } |
| 280 | 343 | } |
| 281 | - self.awardDataArray = NSMutableArray(array: tempArr) | |
| 344 | + if self.resumeType == .normal{ | |
| 345 | + self.awardDataArray = NSMutableArray(array: tempArr) | |
| 346 | + }else{ | |
| 347 | + self.awardPreViewDataArray = NSMutableArray(array: tempArr) | |
| 348 | + } | |
| 282 | 349 | self.tableView.reloadData() |
| 283 | 350 | } |
| 284 | 351 | cell.vitaeWorkPreviewVideoPhotoBlock = { images , index in |
| ... | ... | @@ -301,7 +368,7 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 301 | 368 | let cell = CNLiveDigitalResumePreviewSixCell() |
| 302 | 369 | return cell |
| 303 | 370 | } |
| 304 | - | |
| 371 | + cell.vitaeMdl = self.vitaeModel | |
| 305 | 372 | cell.vitaePreviewSixCellChangedBlock = { sixCell,jianjieHeight,isExpand in |
| 306 | 373 | self.vitaeModel?.vitae?.isExpand = isExpand |
| 307 | 374 | self.sixCellHeight = jianjieHeight+69 |
| ... | ... | @@ -317,12 +384,14 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 317 | 384 | } |
| 318 | 385 | } |
| 319 | 386 | |
| 320 | - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
| 321 | - | |
| 322 | - } | |
| 323 | - | |
| 324 | 387 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 325 | - let cellType = self.totalDataArray[indexPath.row] as! CNLiveViatePreviewCellType | |
| 388 | + var cellType = CNLiveViatePreviewCellType.realName | |
| 389 | + if self.resumeType == .normal{ | |
| 390 | + cellType = self.totalDataArray[indexPath.row] as! CNLiveViatePreviewCellType | |
| 391 | + }else{ | |
| 392 | + cellType = self.totalPreViewDataArray[indexPath.row] as! CNLiveViatePreviewCellType | |
| 393 | + } | |
| 394 | + | |
| 326 | 395 | if cellType == .realName{ |
| 327 | 396 | return 177+51 |
| 328 | 397 | }else if cellType == .guanFang{ |
| ... | ... | @@ -332,16 +401,26 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 332 | 401 | }else if cellType == .work{ |
| 333 | 402 | if self.vitaeModel?.works.count ?? 0 > 0{ |
| 334 | 403 | //有多个workcell |
| 335 | - let model = self.workDataArray[indexPath.row] as! CNLiveVitaeWorksModel | |
| 336 | - return CGFloat(model.cellH) | |
| 404 | + if self.resumeType == .normal{ | |
| 405 | + let model = self.workDataArray[indexPath.row] as! CNLiveVitaeWorksModel | |
| 406 | + return CGFloat(model.cellH) | |
| 407 | + }else{ | |
| 408 | + let model = self.workPreViewDataArray[indexPath.row] as! CNLiveVitaeWorksModel | |
| 409 | + return CGFloat(model.cellH) | |
| 410 | + } | |
| 337 | 411 | }else{ |
| 338 | 412 | return DefaultPreViewCellHeight+15//396+15 |
| 339 | 413 | } |
| 340 | 414 | }else if cellType == .award{ |
| 341 | 415 | if self.vitaeModel?.awards.count ?? 0 > 0{ |
| 342 | 416 | //有多个awardcell |
| 343 | - let model = self.awardDataArray[indexPath.row] as! CNLiveVitaeAwardsModel | |
| 344 | - return CGFloat(model.cellH) | |
| 417 | + if self.resumeType == .normal{ | |
| 418 | + let model = self.awardDataArray[indexPath.row] as! CNLiveVitaeAwardsModel | |
| 419 | + return CGFloat(model.cellH) | |
| 420 | + }else{ | |
| 421 | + let model = self.awardPreViewDataArray[indexPath.row] as! CNLiveVitaeAwardsModel | |
| 422 | + return CGFloat(model.cellH) | |
| 423 | + } | |
| 345 | 424 | }else{ |
| 346 | 425 | return DefaultPreViewCellHeight+15//396+15 |
| 347 | 426 | } |
| ... | ... | @@ -358,7 +437,16 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 358 | 437 | currentViewController()?.navigationController?.pushViewController(vc, animated: true) |
| 359 | 438 | } |
| 360 | 439 | @objc func previewBtnAction(){ |
| 361 | - | |
| 440 | + if self.resumeType == .normal{ | |
| 441 | + //预览数字简历 | |
| 442 | + self.resumeType = .previewResume | |
| 443 | + self.previewBtn.isSelected = true | |
| 444 | + }else{ | |
| 445 | + //退出预览数字简历 | |
| 446 | + self.resumeType = .normal | |
| 447 | + self.previewBtn.isSelected = false | |
| 448 | + } | |
| 449 | + self.tableView.reloadData() | |
| 362 | 450 | } |
| 363 | 451 | |
| 364 | 452 | @objc func moreNavBtnAction(){ |
| ... | ... | @@ -382,7 +470,6 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 382 | 470 | |
| 383 | 471 | //官方认证 |
| 384 | 472 | var arr = Array<CNLiveVitaeIdentitiesModel>() |
| 385 | - var sussArr = Array<CNLiveVitaeIdentitiesModel>() | |
| 386 | 473 | model.identities.forEach { listMdl in |
| 387 | 474 | arr.append(listMdl) |
| 388 | 475 | } |
| ... | ... | @@ -394,29 +481,57 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 394 | 481 | |
| 395 | 482 | self.saveViateModel() |
| 396 | 483 | self.totalDataArray.removeAllObjects() |
| 484 | + self.totalPreViewDataArray.removeAllObjects() | |
| 397 | 485 | self.workDataArray.removeAllObjects() |
| 398 | 486 | self.awardDataArray.removeAllObjects() |
| 487 | + self.workPreViewDataArray.removeAllObjects() | |
| 488 | + self.awardPreViewDataArray.removeAllObjects() | |
| 399 | 489 | self.totalDataArray.addObjects(from: [CNLiveViatePreviewCellType.realName,CNLiveViatePreviewCellType.guanFang,CNLiveViatePreviewCellType.cer]) |
| 490 | + self.totalPreViewDataArray.add(CNLiveViatePreviewCellType.realName) | |
| 491 | + self.workPreViewDataArray.add(CNLiveViatePreviewCellType.realName) | |
| 492 | + self.awardPreViewDataArray.add(CNLiveViatePreviewCellType.realName) | |
| 493 | + | |
| 494 | + if self.succDataArray.count > 0{ | |
| 495 | + self.totalPreViewDataArray.add(CNLiveViatePreviewCellType.guanFang) | |
| 496 | + self.workPreViewDataArray.add(CNLiveViatePreviewCellType.guanFang) | |
| 497 | + self.awardPreViewDataArray.add(CNLiveViatePreviewCellType.guanFang) | |
| 498 | + } | |
| 499 | + if self.threeCerDataArray.count > 0{ | |
| 500 | + self.totalPreViewDataArray.add(CNLiveViatePreviewCellType.cer) | |
| 501 | + self.workPreViewDataArray.add(CNLiveViatePreviewCellType.cer) | |
| 502 | + self.awardPreViewDataArray.add(CNLiveViatePreviewCellType.cer) | |
| 503 | + } | |
| 400 | 504 | self.workDataArray.addObjects(from: [CNLiveViatePreviewCellType.realName,CNLiveViatePreviewCellType.guanFang,CNLiveViatePreviewCellType.cer]) |
| 401 | 505 | self.awardDataArray.addObjects(from: [CNLiveViatePreviewCellType.realName,CNLiveViatePreviewCellType.guanFang,CNLiveViatePreviewCellType.cer]) |
| 402 | 506 | for (_,mdl) in self.vitaeModel!.works.enumerated() { |
| 403 | 507 | self.totalDataArray.add(CNLiveViatePreviewCellType.work) |
| 404 | - | |
| 508 | + self.totalPreViewDataArray.add(CNLiveViatePreviewCellType.work) | |
| 509 | + | |
| 405 | 510 | let layout = CNLiveViateWorkModelLayout(model: mdl ,descH: Float(40.0),isPreview: true, isExpand: false) |
| 406 | 511 | let newWorkModel = layout.getCellHModel() |
| 407 | 512 | self.workDataArray.add(newWorkModel) |
| 408 | 513 | self.awardDataArray.add(CNLiveViatePreviewCellType.work) |
| 514 | + self.workPreViewDataArray.add(newWorkModel) | |
| 515 | + self.awardPreViewDataArray.add(CNLiveViatePreviewCellType.work) | |
| 409 | 516 | } |
| 410 | 517 | for (_,mdl) in self.vitaeModel!.awards.enumerated() { |
| 411 | 518 | self.totalDataArray.add(CNLiveViatePreviewCellType.award) |
| 519 | + self.totalPreViewDataArray.add(CNLiveViatePreviewCellType.award) | |
| 412 | 520 | let layout = CNLiveViateAwardModelLayout(model: mdl ,descH: Float(40.0),isPreview: true, isExpand: false) |
| 413 | 521 | let newWorkModel = layout.getCellHModel() |
| 414 | 522 | self.awardDataArray.add(newWorkModel) |
| 415 | 523 | self.workDataArray.add(CNLiveViatePreviewCellType.award) |
| 524 | + self.awardPreViewDataArray.add(newWorkModel) | |
| 525 | + self.workPreViewDataArray.add(CNLiveViatePreviewCellType.award) | |
| 416 | 526 | } |
| 417 | 527 | self.totalDataArray.add(CNLiveViatePreviewCellType.mineJieShao) |
| 418 | 528 | self.workDataArray.add(CNLiveViatePreviewCellType.mineJieShao) |
| 419 | 529 | self.awardDataArray.add(CNLiveViatePreviewCellType.mineJieShao) |
| 530 | + if model.vitae?.selfIntroduction.count ?? 0 > 0{ | |
| 531 | + self.totalPreViewDataArray.add(CNLiveViatePreviewCellType.mineJieShao) | |
| 532 | + self.workPreViewDataArray.add(CNLiveViatePreviewCellType.mineJieShao) | |
| 533 | + self.awardPreViewDataArray.add(CNLiveViatePreviewCellType.mineJieShao) | |
| 534 | + } | |
| 420 | 535 | self.tableView.reloadData() |
| 421 | 536 | } |
| 422 | 537 | }else{ | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewMineJianJieController.swift
| ... | ... | @@ -279,11 +279,11 @@ class CNLiveDigitalResumePreViewMineJianJieController:CNLiveBaseViewController, |
| 279 | 279 | |
| 280 | 280 | @objc func addWorkBtnAction(){ |
| 281 | 281 | //提交 |
| 282 | - if self.textView.text.count > 0{ | |
| 282 | +// if self.textView.text.count > 0{ | |
| 283 | 283 | self.saveJianJie(introduction:self.textView.text) |
| 284 | - }else{ | |
| 285 | - showMessage(message: "请输入自我介绍") | |
| 286 | - } | |
| 284 | +// }else{ | |
| 285 | +// showMessage(message: "请输入自我介绍") | |
| 286 | +// } | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewFourCell.swift
| ... | ... | @@ -15,6 +15,8 @@ typealias vitaePreviewWorkCellChangedBlockActionBlock = (_ cell: CNLiveDigitalRe |
| 15 | 15 | |
| 16 | 16 | class CNLiveDigitalResumePreviewFourCell: UITableViewCell { |
| 17 | 17 | |
| 18 | + var cellType:CNLiveViateWorkAwardType = .work | |
| 19 | + | |
| 18 | 20 | //workModel |
| 19 | 21 | var _workMdl : CNLiveVitaeWorksModel? |
| 20 | 22 | var workMdl : CNLiveVitaeWorksModel? { |
| ... | ... | @@ -587,12 +589,12 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { |
| 587 | 589 | |
| 588 | 590 | } |
| 589 | 591 | @objc func zhengshuBtnAction(){ |
| 590 | - if self.workMdl != nil{ | |
| 592 | + if self.cellType == .work{ | |
| 591 | 593 | //跳转 选择工作记录页面 |
| 592 | 594 | let vc = CNLiveVitaeWorkDetailController() |
| 593 | 595 | vc.workAwardType = .work |
| 594 | 596 | navigationViewController().pushViewController(vc, animated: true) |
| 595 | - }else if self.awardModel != nil{ | |
| 597 | + }else if self.cellType == .award{ | |
| 596 | 598 | //跳转 选择获奖情况页面 |
| 597 | 599 | let vc = CNLiveVitaeWorkDetailController() |
| 598 | 600 | vc.workAwardType = .award | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewSixCell.swift
| ... | ... | @@ -185,44 +185,48 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | func setupNewUI(model:CNLiveVitaeModel){ |
| 188 | - self.zhengshuNoIconImgView.isHidden = true | |
| 189 | - self.zhengshuNoDescTitleLabel.isHidden = true | |
| 190 | - self.nameIconImgView.isHidden = false | |
| 191 | - self.jianjieLabel.isHidden = false | |
| 192 | - self.jianjieLabel.text = model.vitae?.selfIntroduction//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述"// | |
| 193 | - let lines = jianjieLabel.getRealLabelTextLines() | |
| 194 | - let height = jianjieLabel.qmui_lineHeight | |
| 195 | - if lines <= 2{ | |
| 196 | - self.expandBtn.isHidden = true | |
| 197 | - }else{ | |
| 198 | - self.expandBtn.isHidden = false | |
| 199 | - } | |
| 200 | - | |
| 201 | - var jienjieH:CGFloat = 0 | |
| 202 | - if model.vitae!.isExpand{ | |
| 203 | - //展开状态 | |
| 204 | - jienjieH = height*CGFloat(lines) | |
| 205 | - self.jianjieLabel.numberOfLines = 0 | |
| 188 | + if model.vitae?.selfIntroduction.count == 0{ | |
| 189 | + self.zhengshuNoIconImgView.isHidden = false | |
| 190 | + self.zhengshuNoDescTitleLabel.isHidden = false | |
| 206 | 191 | }else{ |
| 207 | - //收起状态 | |
| 192 | + self.zhengshuNoIconImgView.isHidden = true | |
| 193 | + self.zhengshuNoDescTitleLabel.isHidden = true | |
| 194 | + self.nameIconImgView.isHidden = false | |
| 195 | + self.jianjieLabel.isHidden = false | |
| 196 | + self.jianjieLabel.text = model.vitae?.selfIntroduction//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述"// | |
| 197 | + let lines = jianjieLabel.getRealLabelTextLines() | |
| 198 | + let height = jianjieLabel.qmui_lineHeight | |
| 208 | 199 | if lines <= 2{ |
| 209 | - //小于2行,按实际行数 | |
| 210 | - jienjieH = CGFloat(lines)*height+2 | |
| 200 | + self.expandBtn.isHidden = true | |
| 211 | 201 | }else{ |
| 212 | - //大于2行, 显示2行 | |
| 213 | - jienjieH = 2*height+2 | |
| 202 | + self.expandBtn.isHidden = false | |
| 214 | 203 | } |
| 215 | - self.jianjieLabel.numberOfLines = 2 | |
| 216 | - } | |
| 217 | - self.expandBtn.isSelected = model.vitae!.isExpand | |
| 218 | - self.jianjieLabel.snp.remakeConstraints { make in | |
| 219 | - make.top.equalTo(self.myIdentityTitleLabel.snp.bottom).offset(10) | |
| 220 | - make.left.equalTo(self.nameIconImgView.snp.right).offset(10) | |
| 221 | - make.right.equalToSuperview().offset(-20) | |
| 222 | - make.height.equalTo(jienjieH) | |
| 204 | + | |
| 205 | + var jienjieH:CGFloat = 0 | |
| 206 | + if model.vitae!.isExpand{ | |
| 207 | + //展开状态 | |
| 208 | + jienjieH = height*CGFloat(lines) | |
| 209 | + self.jianjieLabel.numberOfLines = 0 | |
| 210 | + }else{ | |
| 211 | + //收起状态 | |
| 212 | + if lines <= 2{ | |
| 213 | + //小于2行,按实际行数 | |
| 214 | + jienjieH = CGFloat(lines)*height+2 | |
| 215 | + }else{ | |
| 216 | + //大于2行, 显示2行 | |
| 217 | + jienjieH = 2*height+2 | |
| 218 | + } | |
| 219 | + self.jianjieLabel.numberOfLines = 2 | |
| 220 | + } | |
| 221 | + self.expandBtn.isSelected = model.vitae!.isExpand | |
| 222 | + self.jianjieLabel.snp.remakeConstraints { make in | |
| 223 | + make.top.equalTo(self.myIdentityTitleLabel.snp.bottom).offset(10) | |
| 224 | + make.left.equalTo(self.nameIconImgView.snp.right).offset(10) | |
| 225 | + make.right.equalToSuperview().offset(-20) | |
| 226 | + make.height.equalTo(jienjieH) | |
| 227 | + } | |
| 228 | + self.expandBtn.top = self.jianjieLabel.top+jienjieH | |
| 223 | 229 | } |
| 224 | - self.expandBtn.top = self.jianjieLabel.top+jienjieH | |
| 225 | - | |
| 226 | 230 | } |
| 227 | 231 | |
| 228 | 232 | ... | ... |