Commit 0aa6837723df359fbe29269c1432c914a27d3028
1 parent
50490bba
工作和获奖,自我介绍 展开收起变换高度
Showing
8 changed files
with
113 additions
and
46 deletions
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeWorkDetailController.swift
| @@ -150,18 +150,18 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -150,18 +150,18 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 150 | let model = workListArr[indexPath.row] as! CNLiveVitaeAwardsModel | 150 | let model = workListArr[indexPath.row] as! CNLiveVitaeAwardsModel |
| 151 | cell.awardModel = model | 151 | cell.awardModel = model |
| 152 | } | 152 | } |
| 153 | - cell.vitaeWorkCellChangedBlock = { workCell,jianjieHeight in | 153 | + cell.vitaeWorkCellChangedBlock = { workCell,jianjieHeight,isExpand in |
| 154 | let res = self.workListArr | 154 | let res = self.workListArr |
| 155 | var tempArr = Array<Any>() | 155 | var tempArr = Array<Any>() |
| 156 | let idxPath = tableView.indexPath(for: workCell) | 156 | let idxPath = tableView.indexPath(for: workCell) |
| 157 | for (idx,mdl) in res.enumerated() { | 157 | for (idx,mdl) in res.enumerated() { |
| 158 | if idx == idxPath?.row{ | 158 | if idx == idxPath?.row{ |
| 159 | if self.workAwardType == .work{ | 159 | if self.workAwardType == .work{ |
| 160 | - let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight),isPreview: false) | 160 | + let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight),isPreview: false, isExpand: isExpand) |
| 161 | let newWorkModel = layout.getCellHModel() | 161 | let newWorkModel = layout.getCellHModel() |
| 162 | tempArr.append(newWorkModel) | 162 | tempArr.append(newWorkModel) |
| 163 | }else{ | 163 | }else{ |
| 164 | - let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight), isPreview: false) | 164 | + let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight), isPreview: false, isExpand: isExpand) |
| 165 | let newWorkModel = layout.getCellHModel() | 165 | let newWorkModel = layout.getCellHModel() |
| 166 | tempArr.append(newWorkModel) | 166 | tempArr.append(newWorkModel) |
| 167 | } | 167 | } |
| @@ -217,7 +217,7 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -217,7 +217,7 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 217 | if let res = result as? [CNLiveVitaeWorksModel]{ | 217 | if let res = result as? [CNLiveVitaeWorksModel]{ |
| 218 | self.workListArr = Array() | 218 | self.workListArr = Array() |
| 219 | for mdl in res { | 219 | for mdl in res { |
| 220 | - let layout = CNLiveViateWorkModelLayout(model: mdl,descH: 40.0,isPreview: false) | 220 | + let layout = CNLiveViateWorkModelLayout(model: mdl,descH: 40.0,isPreview: false, isExpand: false) |
| 221 | let newWorkModel = layout.getCellHModel() | 221 | let newWorkModel = layout.getCellHModel() |
| 222 | self.workListArr.append(newWorkModel) | 222 | self.workListArr.append(newWorkModel) |
| 223 | } | 223 | } |
| @@ -235,7 +235,7 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -235,7 +235,7 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 235 | if let res = result as? [CNLiveVitaeAwardsModel]{ | 235 | if let res = result as? [CNLiveVitaeAwardsModel]{ |
| 236 | self.workListArr = Array() | 236 | self.workListArr = Array() |
| 237 | for mdl in res { | 237 | for mdl in res { |
| 238 | - let layout = CNLiveViateAwardModelLayout(model: mdl,descH: 40.0, isPreview: false) | 238 | + let layout = CNLiveViateAwardModelLayout(model: mdl,descH: 40.0, isPreview: false, isExpand: false) |
| 239 | let newWorkModel = layout.getCellHModel() | 239 | let newWorkModel = layout.getCellHModel() |
| 240 | self.workListArr.append(newWorkModel) | 240 | self.workListArr.append(newWorkModel) |
| 241 | } | 241 | } |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewController.swift
| @@ -222,13 +222,13 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | @@ -222,13 +222,13 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | ||
| 222 | } | 222 | } |
| 223 | if let workMdl = self.workDataArray[indexPath.row] as? CNLiveVitaeWorksModel{ | 223 | if let workMdl = self.workDataArray[indexPath.row] as? CNLiveVitaeWorksModel{ |
| 224 | cell.workMdl = workMdl | 224 | cell.workMdl = workMdl |
| 225 | - cell.vitaePreviewWorkCellChangedBlock = { workCell,jianjieHeight in | 225 | + cell.vitaePreviewWorkCellChangedBlock = { workCell,jianjieHeight,isExpand in |
| 226 | let res = self.workDataArray | 226 | let res = self.workDataArray |
| 227 | var tempArr = Array<Any>() | 227 | var tempArr = Array<Any>() |
| 228 | let idxPath = tableView.indexPath(for: workCell) | 228 | let idxPath = tableView.indexPath(for: workCell) |
| 229 | for (idx,mdl) in res.enumerated() { | 229 | for (idx,mdl) in res.enumerated() { |
| 230 | if idx == idxPath?.row{ | 230 | if idx == idxPath?.row{ |
| 231 | - let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight),isPreview: true) | 231 | + let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight),isPreview: true, isExpand: isExpand) |
| 232 | let newWorkModel = layout.getCellHModel() | 232 | let newWorkModel = layout.getCellHModel() |
| 233 | tempArr.append(newWorkModel) | 233 | tempArr.append(newWorkModel) |
| 234 | }else{ | 234 | }else{ |
| @@ -260,13 +260,13 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | @@ -260,13 +260,13 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | ||
| 260 | } | 260 | } |
| 261 | if let awardMdl = self.awardDataArray[indexPath.row] as? CNLiveVitaeAwardsModel{ | 261 | if let awardMdl = self.awardDataArray[indexPath.row] as? CNLiveVitaeAwardsModel{ |
| 262 | cell.awardModel = awardMdl | 262 | cell.awardModel = awardMdl |
| 263 | - cell.vitaePreviewWorkCellChangedBlock = { workCell,jianjieHeight in | 263 | + cell.vitaePreviewWorkCellChangedBlock = { workCell,jianjieHeight ,isExpand in |
| 264 | let res = self.awardDataArray | 264 | let res = self.awardDataArray |
| 265 | var tempArr = Array<Any>() | 265 | var tempArr = Array<Any>() |
| 266 | let idxPath = tableView.indexPath(for: workCell) | 266 | let idxPath = tableView.indexPath(for: workCell) |
| 267 | for (idx,mdl) in res.enumerated() { | 267 | for (idx,mdl) in res.enumerated() { |
| 268 | if idx == idxPath?.row{ | 268 | if idx == idxPath?.row{ |
| 269 | - let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight),isPreview: true) | 269 | + let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight),isPreview: true, isExpand: isExpand) |
| 270 | let newWorkModel = layout.getCellHModel() | 270 | let newWorkModel = layout.getCellHModel() |
| 271 | tempArr.append(newWorkModel) | 271 | tempArr.append(newWorkModel) |
| 272 | }else{ | 272 | }else{ |
| @@ -297,10 +297,10 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | @@ -297,10 +297,10 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | ||
| 297 | return cell | 297 | return cell |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | - cell.vitaePreviewSixCellChangedBlock = { sixCell,jianjieHeight in | 300 | + cell.vitaePreviewSixCellChangedBlock = { sixCell,jianjieHeight,isExpand in |
| 301 | + self.vitaeModel?.vitae?.isExpand = isExpand | ||
| 301 | self.sixCellHeight = jianjieHeight+69 | 302 | self.sixCellHeight = jianjieHeight+69 |
| 302 | self.tableView.reloadData() | 303 | self.tableView.reloadData() |
| 303 | - | ||
| 304 | } | 304 | } |
| 305 | if self.vitaeModel?.vitae?.selfIntroduction.count ?? 0 > 0{ | 305 | if self.vitaeModel?.vitae?.selfIntroduction.count ?? 0 > 0{ |
| 306 | cell.vitaeMdl = self.vitaeModel | 306 | cell.vitaeMdl = self.vitaeModel |
| @@ -383,6 +383,8 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | @@ -383,6 +383,8 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | ||
| 383 | }else{ | 383 | }else{ |
| 384 | //有简历-刷新页面 | 384 | //有简历-刷新页面 |
| 385 | self.vitaeModel = nil | 385 | self.vitaeModel = nil |
| 386 | + model.vitae?.selfIntroduction = "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈" | ||
| 387 | + self.sixCellHeight = DefaultPreViewCellHeight+15 | ||
| 386 | self.vitaeModel = model | 388 | self.vitaeModel = model |
| 387 | self.saveViateModel() | 389 | self.saveViateModel() |
| 388 | self.totalDataArray.removeAllObjects() | 390 | self.totalDataArray.removeAllObjects() |
| @@ -394,14 +396,14 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | @@ -394,14 +396,14 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD | ||
| 394 | for (_,mdl) in self.vitaeModel!.works.enumerated() { | 396 | for (_,mdl) in self.vitaeModel!.works.enumerated() { |
| 395 | self.totalDataArray.add(CNLiveViatePreviewCellType.work) | 397 | self.totalDataArray.add(CNLiveViatePreviewCellType.work) |
| 396 | 398 | ||
| 397 | - let layout = CNLiveViateWorkModelLayout(model: mdl ,descH: Float(40.0),isPreview: true) | 399 | + let layout = CNLiveViateWorkModelLayout(model: mdl ,descH: Float(40.0),isPreview: true, isExpand: false) |
| 398 | let newWorkModel = layout.getCellHModel() | 400 | let newWorkModel = layout.getCellHModel() |
| 399 | self.workDataArray.add(newWorkModel) | 401 | self.workDataArray.add(newWorkModel) |
| 400 | self.awardDataArray.add(CNLiveViatePreviewCellType.work) | 402 | self.awardDataArray.add(CNLiveViatePreviewCellType.work) |
| 401 | } | 403 | } |
| 402 | for (_,mdl) in self.vitaeModel!.awards.enumerated() { | 404 | for (_,mdl) in self.vitaeModel!.awards.enumerated() { |
| 403 | self.totalDataArray.add(CNLiveViatePreviewCellType.award) | 405 | self.totalDataArray.add(CNLiveViatePreviewCellType.award) |
| 404 | - let layout = CNLiveViateAwardModelLayout(model: mdl ,descH: Float(40.0),isPreview: true) | 406 | + let layout = CNLiveViateAwardModelLayout(model: mdl ,descH: Float(40.0),isPreview: true, isExpand: false) |
| 405 | let newWorkModel = layout.getCellHModel() | 407 | let newWorkModel = layout.getCellHModel() |
| 406 | self.awardDataArray.add(newWorkModel) | 408 | self.awardDataArray.add(newWorkModel) |
| 407 | self.workDataArray.add(CNLiveViatePreviewCellType.award) | 409 | self.workDataArray.add(CNLiveViatePreviewCellType.award) |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeWorkCell.swift
| @@ -13,7 +13,7 @@ import Kingfisher | @@ -13,7 +13,7 @@ import Kingfisher | ||
| 13 | import JFHeroBrowser | 13 | import JFHeroBrowser |
| 14 | 14 | ||
| 15 | //cell高度变化 | 15 | //cell高度变化 |
| 16 | -typealias vitaeWorkCellChangedBlockActionBlock = (_ cell: CNLiveVitaeWorkCell ,_ cellHeight:CGFloat) -> Void | 16 | +typealias vitaeWorkCellChangedBlockActionBlock = (_ cell: CNLiveVitaeWorkCell ,_ cellHeight:CGFloat,_ isExpand:Bool) -> Void |
| 17 | typealias VitaeWorkPreviewVideoPhotoBlock = (_ images: [HeroBrowserViewModuleBaseProtocol] ,_ index:Int) -> Void | 17 | typealias VitaeWorkPreviewVideoPhotoBlock = (_ images: [HeroBrowserViewModuleBaseProtocol] ,_ index:Int) -> Void |
| 18 | //刷新tableView | 18 | //刷新tableView |
| 19 | typealias VitaeWorkListBlock = () -> Void | 19 | typealias VitaeWorkListBlock = () -> Void |
| @@ -482,7 +482,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -482,7 +482,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 482 | //文本展开状态,点击收起 | 482 | //文本展开状态,点击收起 |
| 483 | self.jianjieLabel.height = 2*height | 483 | self.jianjieLabel.height = 2*height |
| 484 | } | 484 | } |
| 485 | - self.vitaeWorkCellChangedBlock!(self, self.jianjieLabel.height) | 485 | + self.vitaeWorkCellChangedBlock!(self, self.jianjieLabel.height, button.isSelected) |
| 486 | 486 | ||
| 487 | self.expandBtn.top = self.jianjieLabel.bottom | 487 | self.expandBtn.top = self.jianjieLabel.bottom |
| 488 | 488 |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreViewSecCell.swift
| @@ -47,7 +47,7 @@ class CNLiveDigitalResumePreViewSecCell: UITableViewCell, UICollectionViewDelega | @@ -47,7 +47,7 @@ class CNLiveDigitalResumePreViewSecCell: UITableViewCell, UICollectionViewDelega | ||
| 47 | 47 | ||
| 48 | lazy var zhengshuBtn: UIButton = { | 48 | lazy var zhengshuBtn: UIButton = { |
| 49 | let closeBtn = UIButton(type: .custom) | 49 | let closeBtn = UIButton(type: .custom) |
| 50 | - closeBtn.setTitle("关联验证", for: .normal) | 50 | + closeBtn.setTitle("关联认证", for: .normal) |
| 51 | closeBtn.setTitleColor(HexColor("#1961FE"), for: .normal) | 51 | closeBtn.setTitleColor(HexColor("#1961FE"), for: .normal) |
| 52 | closeBtn.titleLabel?.font = BoldFont_14 | 52 | closeBtn.titleLabel?.font = BoldFont_14 |
| 53 | closeBtn.layer.borderColor = HexColor("#1961FE")?.cgColor | 53 | closeBtn.layer.borderColor = HexColor("#1961FE")?.cgColor |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewFourCell.swift
| @@ -11,7 +11,7 @@ import SnapKit | @@ -11,7 +11,7 @@ import SnapKit | ||
| 11 | import JFHeroBrowser | 11 | import JFHeroBrowser |
| 12 | 12 | ||
| 13 | //cell高度变化 | 13 | //cell高度变化 |
| 14 | -typealias vitaePreviewWorkCellChangedBlockActionBlock = (_ cell: CNLiveDigitalResumePreviewFourCell ,_ cellHeight:CGFloat) -> Void | 14 | +typealias vitaePreviewWorkCellChangedBlockActionBlock = (_ cell: CNLiveDigitalResumePreviewFourCell ,_ cellHeight:CGFloat ,_ isExpand:Bool) -> Void |
| 15 | 15 | ||
| 16 | class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | 16 | class CNLiveDigitalResumePreviewFourCell: UITableViewCell { |
| 17 | 17 | ||
| @@ -253,8 +253,15 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | @@ -253,8 +253,15 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | ||
| 253 | make.top.equalTo(self.workTimeTitleLabel.snp.bottom).offset(10) | 253 | make.top.equalTo(self.workTimeTitleLabel.snp.bottom).offset(10) |
| 254 | make.left.equalTo(self.workTimeTitleLabel.snp.left) | 254 | make.left.equalTo(self.workTimeTitleLabel.snp.left) |
| 255 | make.right.equalToSuperview().offset(-20) | 255 | make.right.equalToSuperview().offset(-20) |
| 256 | + make.height.equalTo(40) | ||
| 256 | } | 257 | } |
| 257 | self.whiteView.addSubview(self.expandBtn) | 258 | self.whiteView.addSubview(self.expandBtn) |
| 259 | + self.expandBtn.snp.makeConstraints { make in | ||
| 260 | + make.top.equalTo(self.jianjieLabel.snp.bottom) | ||
| 261 | + make.right.equalTo(self.jianjieLabel.snp.right) | ||
| 262 | + make.width.equalTo(60) | ||
| 263 | + make.height.equalTo(30) | ||
| 264 | + } | ||
| 258 | 265 | ||
| 259 | let lines = jianjieLabel.getRealLabelTextLines() | 266 | let lines = jianjieLabel.getRealLabelTextLines() |
| 260 | if lines <= 2{ | 267 | if lines <= 2{ |
| @@ -337,20 +344,30 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | @@ -337,20 +344,30 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | ||
| 337 | self.expandBtn.isHidden = false | 344 | self.expandBtn.isHidden = false |
| 338 | } | 345 | } |
| 339 | 346 | ||
| 340 | - if self.expandBtn.isSelected{ | 347 | + var jienjieH:CGFloat = 0 |
| 348 | + if model.isExpand{ | ||
| 341 | //展开状态 | 349 | //展开状态 |
| 342 | - self.jianjieLabel.height = height*CGFloat(lines) | ||
| 343 | - | 350 | + jienjieH = height*CGFloat(lines) |
| 351 | + self.jianjieLabel.numberOfLines = 0 | ||
| 344 | }else{ | 352 | }else{ |
| 345 | //收起状态 | 353 | //收起状态 |
| 346 | if lines <= 2{ | 354 | if lines <= 2{ |
| 347 | //小于2行,按实际行数 | 355 | //小于2行,按实际行数 |
| 348 | - self.jianjieLabel.height = CGFloat(lines)*height | 356 | + jienjieH = CGFloat(lines)*height |
| 349 | }else{ | 357 | }else{ |
| 350 | //大于2行, 显示2行 | 358 | //大于2行, 显示2行 |
| 351 | - self.jianjieLabel.height = 2*height | 359 | + jienjieH = 2*height |
| 352 | } | 360 | } |
| 361 | + self.jianjieLabel.numberOfLines = 2 | ||
| 353 | } | 362 | } |
| 363 | + self.expandBtn.isSelected = model.isExpand | ||
| 364 | + self.jianjieLabel.snp.remakeConstraints { make in | ||
| 365 | + make.top.equalTo(self.workTimeTitleLabel.snp.bottom).offset(10) | ||
| 366 | + make.left.equalTo(self.workTimeTitleLabel.snp.left) | ||
| 367 | + make.right.equalToSuperview().offset(-20) | ||
| 368 | + make.height.equalTo(jienjieH) | ||
| 369 | + } | ||
| 370 | + self.expandBtn.top = self.jianjieLabel.top+jienjieH | ||
| 354 | 371 | ||
| 355 | let imgArr = model.imgs.components(separatedBy: ",") | 372 | let imgArr = model.imgs.components(separatedBy: ",") |
| 356 | if imgArr.count > 0{ | 373 | if imgArr.count > 0{ |
| @@ -360,7 +377,7 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | @@ -360,7 +377,7 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | ||
| 360 | let lie = i%3 | 377 | let lie = i%3 |
| 361 | let hang = i/3 | 378 | let hang = i/3 |
| 362 | let imgWH:Float = Float((Float(KSreenWidth)-30-40-imgLeftGap)/3.0) | 379 | let imgWH:Float = Float((Float(KSreenWidth)-30-40-imgLeftGap)/3.0) |
| 363 | - let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgWH)*Float(lie)), y: CGFloat((imgWH+10)*Float(hang))+self.jianjieLabel.bottom+10, width: CGFloat(imgWH), height: CGFloat(imgWH))) | 380 | + let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgWH)*Float(lie)), y: CGFloat((imgWH+10)*Float(hang))+self.jianjieLabel.top+jienjieH+10, width: CGFloat(imgWH), height: CGFloat(imgWH))) |
| 364 | imgView.isUserInteractionEnabled = true | 381 | imgView.isUserInteractionEnabled = true |
| 365 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) | 382 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) |
| 366 | imgView.tag = 1000+i | 383 | imgView.tag = 1000+i |
| @@ -441,20 +458,30 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | @@ -441,20 +458,30 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | ||
| 441 | self.expandBtn.isHidden = false | 458 | self.expandBtn.isHidden = false |
| 442 | } | 459 | } |
| 443 | 460 | ||
| 444 | - if self.expandBtn.isSelected{ | 461 | + var jienjieH:CGFloat = 0 |
| 462 | + if model.isExpand{ | ||
| 445 | //展开状态 | 463 | //展开状态 |
| 446 | - self.jianjieLabel.height = height*CGFloat(lines) | ||
| 447 | - | 464 | + jienjieH = height*CGFloat(lines) |
| 465 | + self.jianjieLabel.numberOfLines = 0 | ||
| 448 | }else{ | 466 | }else{ |
| 449 | //收起状态 | 467 | //收起状态 |
| 450 | if lines <= 2{ | 468 | if lines <= 2{ |
| 451 | //小于2行,按实际行数 | 469 | //小于2行,按实际行数 |
| 452 | - self.jianjieLabel.height = CGFloat(lines)*height | 470 | + jienjieH = CGFloat(lines)*height |
| 453 | }else{ | 471 | }else{ |
| 454 | //大于2行, 显示2行 | 472 | //大于2行, 显示2行 |
| 455 | - self.jianjieLabel.height = 2*height | 473 | + jienjieH = 2*height |
| 456 | } | 474 | } |
| 475 | + self.jianjieLabel.numberOfLines = 2 | ||
| 457 | } | 476 | } |
| 477 | + self.expandBtn.isSelected = model.isExpand | ||
| 478 | + self.jianjieLabel.snp.remakeConstraints { make in | ||
| 479 | + make.top.equalTo(self.workTimeTitleLabel.snp.bottom).offset(10) | ||
| 480 | + make.left.equalTo(self.workTimeTitleLabel.snp.left) | ||
| 481 | + make.right.equalToSuperview().offset(-20) | ||
| 482 | + make.height.equalTo(jienjieH) | ||
| 483 | + } | ||
| 484 | + self.expandBtn.top = self.jianjieLabel.top+jienjieH | ||
| 458 | 485 | ||
| 459 | let imgArr = model.imgs.components(separatedBy: ",") | 486 | let imgArr = model.imgs.components(separatedBy: ",") |
| 460 | if imgArr.count > 0{ | 487 | if imgArr.count > 0{ |
| @@ -464,7 +491,7 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | @@ -464,7 +491,7 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | ||
| 464 | let lie = i%3 | 491 | let lie = i%3 |
| 465 | let hang = i/3 | 492 | let hang = i/3 |
| 466 | let imgWH:Float = Float((Float(KSreenWidth)-30-40-imgLeftGap)/3.0) | 493 | let imgWH:Float = Float((Float(KSreenWidth)-30-40-imgLeftGap)/3.0) |
| 467 | - let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgWH)*Float(lie)), y: CGFloat((imgWH+10)*Float(hang))+self.jianjieLabel.bottom+10, width: CGFloat(imgWH), height: CGFloat(imgWH))) | 494 | + let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgWH)*Float(lie)), y: CGFloat((imgWH+10)*Float(hang))+self.jianjieLabel.top+jienjieH+10, width: CGFloat(imgWH), height: CGFloat(imgWH))) |
| 468 | imgView.isUserInteractionEnabled = true | 495 | imgView.isUserInteractionEnabled = true |
| 469 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) | 496 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) |
| 470 | imgView.tag = 1000+i | 497 | imgView.tag = 1000+i |
| @@ -533,16 +560,24 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | @@ -533,16 +560,24 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { | ||
| 533 | let lines = jianjieLabel.getRealLabelTextLines() | 560 | let lines = jianjieLabel.getRealLabelTextLines() |
| 534 | let height = jianjieLabel.qmui_lineHeight | 561 | let height = jianjieLabel.qmui_lineHeight |
| 535 | 562 | ||
| 563 | + var jienjieH:CGFloat = 0 | ||
| 536 | if button.isSelected{ | 564 | if button.isSelected{ |
| 537 | //文本收起状态,点击展开 | 565 | //文本收起状态,点击展开 |
| 538 | - self.jianjieLabel.height = CGFloat(lines)*height | 566 | + jienjieH = CGFloat(lines)*height |
| 539 | }else{ | 567 | }else{ |
| 540 | //文本展开状态,点击收起 | 568 | //文本展开状态,点击收起 |
| 541 | - self.jianjieLabel.height = 2*height | 569 | + jienjieH = 2*height |
| 570 | + } | ||
| 571 | + self.jianjieLabel.snp.remakeConstraints { make in | ||
| 572 | + make.top.equalTo(self.workTimeTitleLabel.snp.bottom).offset(10) | ||
| 573 | + make.left.equalTo(self.workTimeTitleLabel.snp.left) | ||
| 574 | + make.right.equalToSuperview().offset(-20) | ||
| 575 | + make.height.equalTo(jienjieH) | ||
| 542 | } | 576 | } |
| 543 | - self.vitaePreviewWorkCellChangedBlock!(self, self.jianjieLabel.height) | ||
| 544 | 577 | ||
| 545 | - self.expandBtn.top = self.jianjieLabel.bottom | 578 | + self.vitaePreviewWorkCellChangedBlock!(self, jienjieH, button.isSelected) |
| 579 | + | ||
| 580 | + self.expandBtn.top = self.jianjieLabel.top + jienjieH | ||
| 546 | 581 | ||
| 547 | } | 582 | } |
| 548 | @objc func zhengshuBtnAction(){ | 583 | @objc func zhengshuBtnAction(){ |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewSixCell.swift
| @@ -10,7 +10,7 @@ import Kingfisher | @@ -10,7 +10,7 @@ import Kingfisher | ||
| 10 | import SnapKit | 10 | import SnapKit |
| 11 | 11 | ||
| 12 | //cell高度变化 | 12 | //cell高度变化 |
| 13 | -typealias vitaePreviewSixCellChangedBlockActionBlock = (_ cell: CNLiveDigitalResumePreviewSixCell ,_ cellHeight:CGFloat) -> Void | 13 | +typealias vitaePreviewSixCellChangedBlockActionBlock = (_ cell: CNLiveDigitalResumePreviewSixCell ,_ cellHeight:CGFloat, _ isExpand:Bool) -> Void |
| 14 | 14 | ||
| 15 | class CNLiveDigitalResumePreviewSixCell: UITableViewCell { | 15 | class CNLiveDigitalResumePreviewSixCell: UITableViewCell { |
| 16 | var vitaePreviewSixCellChangedBlock:vitaePreviewSixCellChangedBlockActionBlock? | 16 | var vitaePreviewSixCellChangedBlock:vitaePreviewSixCellChangedBlockActionBlock? |
| @@ -142,6 +142,13 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { | @@ -142,6 +142,13 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { | ||
| 142 | make.right.equalToSuperview().offset(-20) | 142 | make.right.equalToSuperview().offset(-20) |
| 143 | } | 143 | } |
| 144 | self.whiteView.addSubview(self.expandBtn) | 144 | self.whiteView.addSubview(self.expandBtn) |
| 145 | + self.expandBtn.snp.makeConstraints { make in | ||
| 146 | + make.top.equalTo(self.jianjieLabel.snp.bottom) | ||
| 147 | + make.right.equalTo(self.jianjieLabel.snp.right) | ||
| 148 | + make.width.equalTo(60) | ||
| 149 | + make.height.equalTo(30) | ||
| 150 | + } | ||
| 151 | + | ||
| 145 | 152 | ||
| 146 | let lines = jianjieLabel.getRealLabelTextLines() | 153 | let lines = jianjieLabel.getRealLabelTextLines() |
| 147 | if lines <= 2{ | 154 | if lines <= 2{ |
| @@ -191,20 +198,31 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { | @@ -191,20 +198,31 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { | ||
| 191 | self.expandBtn.isHidden = false | 198 | self.expandBtn.isHidden = false |
| 192 | } | 199 | } |
| 193 | 200 | ||
| 194 | - if self.expandBtn.isSelected{ | 201 | + var jienjieH:CGFloat = 0 |
| 202 | + if model.vitae!.isExpand{ | ||
| 195 | //展开状态 | 203 | //展开状态 |
| 196 | - self.jianjieLabel.height = height*CGFloat(lines) | ||
| 197 | - | 204 | + jienjieH = height*CGFloat(lines) |
| 205 | + self.jianjieLabel.numberOfLines = 0 | ||
| 198 | }else{ | 206 | }else{ |
| 199 | //收起状态 | 207 | //收起状态 |
| 200 | if lines <= 2{ | 208 | if lines <= 2{ |
| 201 | //小于2行,按实际行数 | 209 | //小于2行,按实际行数 |
| 202 | - self.jianjieLabel.height = CGFloat(lines)*height | 210 | + jienjieH = CGFloat(lines)*height+2 |
| 203 | }else{ | 211 | }else{ |
| 204 | //大于2行, 显示2行 | 212 | //大于2行, 显示2行 |
| 205 | - self.jianjieLabel.height = 2*height | 213 | + jienjieH = 2*height+2 |
| 206 | } | 214 | } |
| 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) | ||
| 207 | } | 223 | } |
| 224 | + self.expandBtn.top = self.jianjieLabel.top+jienjieH | ||
| 225 | + | ||
| 208 | } | 226 | } |
| 209 | 227 | ||
| 210 | 228 | ||
| @@ -213,17 +231,24 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { | @@ -213,17 +231,24 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { | ||
| 213 | button.isSelected = !button.isSelected | 231 | button.isSelected = !button.isSelected |
| 214 | let lines = jianjieLabel.getRealLabelTextLines() | 232 | let lines = jianjieLabel.getRealLabelTextLines() |
| 215 | let height = jianjieLabel.qmui_lineHeight | 233 | let height = jianjieLabel.qmui_lineHeight |
| 216 | - | 234 | + |
| 235 | + var jienjieH:CGFloat = 0 | ||
| 217 | if button.isSelected{ | 236 | if button.isSelected{ |
| 218 | //文本收起状态,点击展开 | 237 | //文本收起状态,点击展开 |
| 219 | - self.jianjieLabel.height = CGFloat(lines)*height | 238 | + jienjieH = CGFloat(lines)*height |
| 220 | }else{ | 239 | }else{ |
| 221 | //文本展开状态,点击收起 | 240 | //文本展开状态,点击收起 |
| 222 | - self.jianjieLabel.height = 2*height | 241 | + jienjieH = 2*height+2 |
| 242 | + } | ||
| 243 | + self.jianjieLabel.snp.remakeConstraints { make in | ||
| 244 | + make.top.equalTo(self.myIdentityTitleLabel.snp.bottom).offset(10) | ||
| 245 | + make.left.equalTo(self.nameIconImgView.snp.right).offset(10) | ||
| 246 | + make.right.equalToSuperview().offset(-20) | ||
| 247 | + make.height.equalTo(jienjieH) | ||
| 223 | } | 248 | } |
| 224 | - self.vitaePreviewSixCellChangedBlock!(self, self.jianjieLabel.bottom) | 249 | + self.vitaePreviewSixCellChangedBlock!(self, self.jianjieLabel.top + jienjieH, button.isSelected) |
| 225 | 250 | ||
| 226 | - self.expandBtn.top = self.jianjieLabel.bottom | 251 | + self.expandBtn.top = self.jianjieLabel.top + jienjieH |
| 227 | 252 | ||
| 228 | } | 253 | } |
| 229 | @objc func zhengshuBtnAction(){ | 254 | @objc func zhengshuBtnAction(){ |
metaCode/Classes/Main/Model/Vitae/CNLiveViateWorkModelLayout.swift
| @@ -24,8 +24,9 @@ class CNLiveViateWorkModelLayout:NSObject{ | @@ -24,8 +24,9 @@ class CNLiveViateWorkModelLayout:NSObject{ | ||
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | - init(model:CNLiveVitaeWorksModel,descH:Float,isPreview:Bool){ | 27 | + init(model:CNLiveVitaeWorksModel,descH:Float,isPreview:Bool,isExpand:Bool){ |
| 28 | super.init() | 28 | super.init() |
| 29 | + model.isExpand = isExpand | ||
| 29 | self.workModel = model | 30 | self.workModel = model |
| 30 | let imgArr = model.imgs.components(separatedBy: ",") | 31 | let imgArr = model.imgs.components(separatedBy: ",") |
| 31 | var hang:Float = 1 | 32 | var hang:Float = 1 |
| @@ -81,8 +82,9 @@ class CNLiveViateAwardModelLayout:NSObject{ | @@ -81,8 +82,9 @@ class CNLiveViateAwardModelLayout:NSObject{ | ||
| 81 | } | 82 | } |
| 82 | } | 83 | } |
| 83 | 84 | ||
| 84 | - init(model:CNLiveVitaeAwardsModel,descH:Float,isPreview:Bool){ | 85 | + init(model:CNLiveVitaeAwardsModel,descH:Float,isPreview:Bool,isExpand:Bool){ |
| 85 | super.init() | 86 | super.init() |
| 87 | + model.isExpand = isExpand | ||
| 86 | self.awardModel = model | 88 | self.awardModel = model |
| 87 | let imgArr = model.imgs.components(separatedBy: ",") | 89 | let imgArr = model.imgs.components(separatedBy: ",") |
| 88 | var hang:Float = 1 | 90 | var hang:Float = 1 |
metaCode/Classes/Main/Model/Vitae/CNLiveVitaeModel.swift
| @@ -47,6 +47,7 @@ class CNLiveVitaeVitaeModel:BaseModel{ | @@ -47,6 +47,7 @@ class CNLiveVitaeVitaeModel:BaseModel{ | ||
| 47 | var showAwards:Bool = false | 47 | var showAwards:Bool = false |
| 48 | /// | 48 | /// |
| 49 | var updateTime:String = "" | 49 | var updateTime:String = "" |
| 50 | + var isExpand:Bool = false//自我介绍是否展开 | ||
| 50 | } | 51 | } |
| 51 | //简历身份模块 | 52 | //简历身份模块 |
| 52 | class CNLiveVitaeIdentitiesModel:BaseModel{ | 53 | class CNLiveVitaeIdentitiesModel:BaseModel{ |
| @@ -106,6 +107,7 @@ class CNLiveVitaeWorksModel:BaseModel{ | @@ -106,6 +107,7 @@ class CNLiveVitaeWorksModel:BaseModel{ | ||
| 106 | 107 | ||
| 107 | ///cell高度 | 108 | ///cell高度 |
| 108 | var cellH: Float = 0 | 109 | var cellH: Float = 0 |
| 110 | + var isExpand:Bool = false//是否展开 | ||
| 109 | 111 | ||
| 110 | } | 112 | } |
| 111 | 113 | ||
| @@ -156,6 +158,7 @@ class CNLiveVitaeAwardsModel:BaseModel{ | @@ -156,6 +158,7 @@ class CNLiveVitaeAwardsModel:BaseModel{ | ||
| 156 | 158 | ||
| 157 | ///cell高度 | 159 | ///cell高度 |
| 158 | var cellH: Float = 0 | 160 | var cellH: Float = 0 |
| 161 | + var isExpand:Bool = false//是否展开 | ||
| 159 | } | 162 | } |
| 160 | /** | 163 | /** |
| 161 | "data": { | 164 | "data": { |