Commit 35640030a8d5754e675ae6626ec7255a590803ab
1 parent
ce82210b
工作记录/获奖情况 , image加到了一个图片总容器里
工作记录列表页-没有位置授权,图片超出了横线 * [x] 工作记录列表页-描述和时间间隔比较大
Showing
3 changed files
with
75 additions
and
15 deletions
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkSecCell.swift
| @@ -105,8 +105,9 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | @@ -105,8 +105,9 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | ||
| 105 | make.right.equalToSuperview().offset(-15) | 105 | make.right.equalToSuperview().offset(-15) |
| 106 | make.height.equalTo(whiteH) | 106 | make.height.equalTo(whiteH) |
| 107 | } | 107 | } |
| 108 | - self.updateAddWorkSecCellHeightBlock!(self, whiteH+20) | ||
| 109 | - | 108 | + if self.updateAddWorkSecCellHeightBlock != nil{ |
| 109 | + self.updateAddWorkSecCellHeightBlock!(self, whiteH+20) | ||
| 110 | + } | ||
| 110 | } | 111 | } |
| 111 | _selectUploadImageView?.endUploadImageCallBack = { | 112 | _selectUploadImageView?.endUploadImageCallBack = { |
| 112 | let imageUrl = self.selectUploadImageView?.getCurrentSelectImageUrls().first | 113 | let imageUrl = self.selectUploadImageView?.getCurrentSelectImageUrls().first |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeWorkCell.swift
| @@ -125,7 +125,11 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -125,7 +125,11 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 125 | expandBtn.addTarget(self, action: #selector(expandBtnAction), for: .touchUpInside) | 125 | expandBtn.addTarget(self, action: #selector(expandBtnAction), for: .touchUpInside) |
| 126 | return expandBtn | 126 | return expandBtn |
| 127 | }() | 127 | }() |
| 128 | - | 128 | + lazy var imagesTotalView :UIView = { |
| 129 | + let whiteBgView = UIView() | ||
| 130 | + whiteBgView.tag = 1100 | ||
| 131 | + return whiteBgView | ||
| 132 | + }() | ||
| 129 | lazy var dingweiImgView :UIImageView = { | 133 | lazy var dingweiImgView :UIImageView = { |
| 130 | let iconImgView = UIImageView() | 134 | let iconImgView = UIImageView() |
| 131 | iconImgView.image = UIImage(named: "mine_jinali_workdingwei") | 135 | iconImgView.image = UIImage(named: "mine_jinali_workdingwei") |
| @@ -224,6 +228,14 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -224,6 +228,14 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 224 | self.expandBtn.isHidden = false | 228 | self.expandBtn.isHidden = false |
| 225 | } | 229 | } |
| 226 | 230 | ||
| 231 | + self.whiteBgView.addSubview(self.imagesTotalView) | ||
| 232 | + self.imagesTotalView.snp.makeConstraints { make in | ||
| 233 | + make.left.equalToSuperview() | ||
| 234 | + make.bottom.equalToSuperview().offset(-54-15) | ||
| 235 | + make.width.equalToSuperview() | ||
| 236 | + make.top.equalTo(self.jianjieLabel.snp.bottom).offset(10) | ||
| 237 | + } | ||
| 238 | + | ||
| 227 | self.whiteBgView.addSubview(self.dingweiImgView) | 239 | self.whiteBgView.addSubview(self.dingweiImgView) |
| 228 | self.dingweiImgView.snp.makeConstraints { make in | 240 | self.dingweiImgView.snp.makeConstraints { make in |
| 229 | make.left.equalTo(15) | 241 | make.left.equalTo(15) |
| @@ -241,7 +253,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -241,7 +253,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 241 | make.height.equalTo(0.5) | 253 | make.height.equalTo(0.5) |
| 242 | make.left.equalTo(15) | 254 | make.left.equalTo(15) |
| 243 | make.right.equalToSuperview().offset(-15) | 255 | make.right.equalToSuperview().offset(-15) |
| 244 | - make.top.equalTo(self.workDingWeiTitleLabel.snp.bottom).offset(15) | 256 | + make.bottom.equalToSuperview().offset(-54) |
| 245 | } | 257 | } |
| 246 | self.whiteBgView.addSubview(self.realImgView) | 258 | self.whiteBgView.addSubview(self.realImgView) |
| 247 | self.realImgView.snp.makeConstraints { make in | 259 | self.realImgView.snp.makeConstraints { make in |
| @@ -273,7 +285,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -273,7 +285,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 273 | 285 | ||
| 274 | //获奖 | 286 | //获奖 |
| 275 | func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ | 287 | func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ |
| 276 | - self.whiteBgView.subviews.forEach { view in | 288 | + self.imagesTotalView.subviews.forEach { view in |
| 277 | if view.tag >= 1000{ | 289 | if view.tag >= 1000{ |
| 278 | view.removeFromSuperview() | 290 | view.removeFromSuperview() |
| 279 | } | 291 | } |
| @@ -283,7 +295,12 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -283,7 +295,12 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 283 | let startDateString = convertTimestampStringToDateString(timestampString: model.time) | 295 | let startDateString = convertTimestampStringToDateString(timestampString: model.time) |
| 284 | self.workNameTitleLabel.text = startDateString ?? "" | 296 | self.workNameTitleLabel.text = startDateString ?? "" |
| 285 | 297 | ||
| 286 | - self.workPositionTitleLabel.text = model.company | 298 | + if model.company.count > 0{ |
| 299 | + self.workPositionTitleLabel.text = model.company | ||
| 300 | + self.workPositionTitleLabel.isHidden = false | ||
| 301 | + }else{ | ||
| 302 | + self.workPositionTitleLabel.isHidden = true | ||
| 303 | + } | ||
| 287 | 304 | ||
| 288 | self.jianjieLabel.text = model.description//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" | 305 | self.jianjieLabel.text = model.description//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" |
| 289 | let lines = jianjieLabel.getRealLabelTextLines() | 306 | let lines = jianjieLabel.getRealLabelTextLines() |
| @@ -317,7 +334,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -317,7 +334,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 317 | let imgLeftGap:Float = 15 | 334 | let imgLeftGap:Float = 15 |
| 318 | let lie = i%3 | 335 | let lie = i%3 |
| 319 | let hang = i/3 | 336 | let hang = i/3 |
| 320 | - 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))) | 337 | + let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgWH)*Float(lie)), y: CGFloat((imgWH+10)*Float(hang)), width: CGFloat(imgWH), height: CGFloat(imgWH)))// 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))) |
| 321 | imgView.isUserInteractionEnabled = true | 338 | imgView.isUserInteractionEnabled = true |
| 322 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) | 339 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) |
| 323 | imgView.tag = 1000+i | 340 | imgView.tag = 1000+i |
| @@ -325,7 +342,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -325,7 +342,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 325 | let imgUrl = imgArr[i] | 342 | let imgUrl = imgArr[i] |
| 326 | imgView.clipsToBounds = true | 343 | imgView.clipsToBounds = true |
| 327 | imgView.layer.cornerRadius = 5 | 344 | imgView.layer.cornerRadius = 5 |
| 328 | - self.whiteBgView.addSubview(imgView) | 345 | + self.imagesTotalView.addSubview(imgView) |
| 329 | 346 | ||
| 330 | if imgUrl.contains("vitae_video_"){ | 347 | if imgUrl.contains("vitae_video_"){ |
| 331 | //是视频 | 348 | //是视频 |
| @@ -354,10 +371,17 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -354,10 +371,17 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 354 | } | 371 | } |
| 355 | } | 372 | } |
| 356 | self.workDingWeiTitleLabel.isHidden = true | 373 | self.workDingWeiTitleLabel.isHidden = true |
| 374 | + self.dingweiImgView.isHidden = true | ||
| 375 | + self.imagesTotalView.snp.remakeConstraints { make in | ||
| 376 | + make.left.equalToSuperview() | ||
| 377 | + make.bottom.equalToSuperview().offset(-54-15) | ||
| 378 | + make.width.equalToSuperview() | ||
| 379 | + make.top.equalTo(self.jianjieLabel.snp.bottom).offset(10) | ||
| 380 | + } | ||
| 357 | } | 381 | } |
| 358 | //工作 | 382 | //工作 |
| 359 | func setupNewUI(model:CNLiveVitaeWorksModel){ | 383 | func setupNewUI(model:CNLiveVitaeWorksModel){ |
| 360 | - self.whiteBgView.subviews.forEach { view in | 384 | + self.imagesTotalView.subviews.forEach { view in |
| 361 | if view.tag >= 1000{ | 385 | if view.tag >= 1000{ |
| 362 | view.removeFromSuperview() | 386 | view.removeFromSuperview() |
| 363 | } | 387 | } |
| @@ -371,8 +395,14 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -371,8 +395,14 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 371 | }else{ | 395 | }else{ |
| 372 | self.workNameTitleLabel.text = model.position+" | "+(startDateString ?? "")+" - "+endDateString! | 396 | self.workNameTitleLabel.text = model.position+" | "+(startDateString ?? "")+" - "+endDateString! |
| 373 | } | 397 | } |
| 374 | - self.workPositionTitleLabel.text = model.companyName | ||
| 375 | - | 398 | + if model.companyName.count > 0{ |
| 399 | + self.workPositionTitleLabel.text = model.companyName | ||
| 400 | + self.workPositionTitleLabel.isHidden = false | ||
| 401 | + self.jianjieLabel.top = 113 | ||
| 402 | + }else{ | ||
| 403 | + self.workPositionTitleLabel.isHidden = true | ||
| 404 | + self.jianjieLabel.top = 113 - 25 | ||
| 405 | + } | ||
| 376 | self.jianjieLabel.text = model.jobDuties//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" | 406 | self.jianjieLabel.text = model.jobDuties//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" |
| 377 | let lines = jianjieLabel.getRealLabelTextLines() | 407 | let lines = jianjieLabel.getRealLabelTextLines() |
| 378 | let height = jianjieLabel.qmui_lineHeight | 408 | let height = jianjieLabel.qmui_lineHeight |
| @@ -405,7 +435,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -405,7 +435,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 405 | let imgLeftGap:Float = 15 | 435 | let imgLeftGap:Float = 15 |
| 406 | let lie = i%3 | 436 | let lie = i%3 |
| 407 | let hang = i/3 | 437 | let hang = i/3 |
| 408 | - 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))) | 438 | + let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgWH)*Float(lie)), y: CGFloat((imgWH+10)*Float(hang)), width: CGFloat(imgWH), height: CGFloat(imgWH)))// 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))) |
| 409 | imgView.isUserInteractionEnabled = true | 439 | imgView.isUserInteractionEnabled = true |
| 410 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) | 440 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) |
| 411 | imgView.tag = 1000+i | 441 | imgView.tag = 1000+i |
| @@ -413,7 +443,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -413,7 +443,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 413 | let imgUrl = imgArr[i] | 443 | let imgUrl = imgArr[i] |
| 414 | imgView.clipsToBounds = true | 444 | imgView.clipsToBounds = true |
| 415 | imgView.layer.cornerRadius = 5 | 445 | imgView.layer.cornerRadius = 5 |
| 416 | - self.whiteBgView.addSubview(imgView) | 446 | + self.imagesTotalView.addSubview(imgView) |
| 417 | 447 | ||
| 418 | if imgUrl.contains("vitae_video_"){ | 448 | if imgUrl.contains("vitae_video_"){ |
| 419 | //是视频 | 449 | //是视频 |
| @@ -445,9 +475,23 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -445,9 +475,23 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 445 | let cityStr = model.city | 475 | let cityStr = model.city |
| 446 | if cityStr.count == 0 || cityStr == "请选择"{ | 476 | if cityStr.count == 0 || cityStr == "请选择"{ |
| 447 | self.workDingWeiTitleLabel.isHidden = true | 477 | self.workDingWeiTitleLabel.isHidden = true |
| 478 | + self.dingweiImgView.isHidden = true | ||
| 479 | + self.imagesTotalView.snp.remakeConstraints { make in | ||
| 480 | + make.left.equalToSuperview() | ||
| 481 | + make.bottom.equalToSuperview().offset(-54-15) | ||
| 482 | + make.width.equalToSuperview() | ||
| 483 | + make.top.equalTo(self.jianjieLabel.snp.bottom).offset(10) | ||
| 484 | + } | ||
| 448 | }else{ | 485 | }else{ |
| 449 | self.workDingWeiTitleLabel.isHidden = false | 486 | self.workDingWeiTitleLabel.isHidden = false |
| 450 | self.workDingWeiTitleLabel.text = model.city | 487 | self.workDingWeiTitleLabel.text = model.city |
| 488 | + self.dingweiImgView.isHidden = false | ||
| 489 | + self.imagesTotalView.snp.remakeConstraints { make in | ||
| 490 | + make.left.equalToSuperview() | ||
| 491 | + make.bottom.equalTo(self.dingweiImgView.snp.top).offset(-5) | ||
| 492 | + make.width.equalToSuperview() | ||
| 493 | + make.top.equalTo(self.jianjieLabel.snp.bottom).offset(10) | ||
| 494 | + } | ||
| 451 | } | 495 | } |
| 452 | 496 | ||
| 453 | } | 497 | } |
metaCode/Classes/Main/Model/Vitae/CNLiveViateWorkModelLayout.swift
| @@ -28,6 +28,14 @@ class CNLiveViateWorkModelLayout:NSObject{ | @@ -28,6 +28,14 @@ class CNLiveViateWorkModelLayout:NSObject{ | ||
| 28 | super.init() | 28 | super.init() |
| 29 | model.isExpand = isExpand | 29 | model.isExpand = isExpand |
| 30 | self.workModel = model | 30 | self.workModel = model |
| 31 | + var companyH:Float = 25 | ||
| 32 | + let companyStr = model.companyName | ||
| 33 | + if companyStr.count == 0 || companyStr == ""{ | ||
| 34 | + companyH = 0 | ||
| 35 | + }else{ | ||
| 36 | + companyH = 25 | ||
| 37 | + } | ||
| 38 | + | ||
| 31 | let imgArr = model.imgs.components(separatedBy: ",") | 39 | let imgArr = model.imgs.components(separatedBy: ",") |
| 32 | var hang:Float = 1 | 40 | var hang:Float = 1 |
| 33 | if imgArr.count > 0{ | 41 | if imgArr.count > 0{ |
| @@ -52,7 +60,7 @@ class CNLiveViateWorkModelLayout:NSObject{ | @@ -52,7 +60,7 @@ class CNLiveViateWorkModelLayout:NSObject{ | ||
| 52 | cityH = 35 | 60 | cityH = 35 |
| 53 | } | 61 | } |
| 54 | if isPreview == false{//工作记录详情页 | 62 | if isPreview == false{//工作记录详情页 |
| 55 | - _workModel?.cellH = Float(123)+descH+Float(hang*imgWH)+cityH+55 | 63 | + _workModel?.cellH = Float(123-25)+companyH+descH+Float(hang*imgWH)+cityH+55 |
| 56 | }else{//预览工作记录 | 64 | }else{//预览工作记录 |
| 57 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) | 65 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) |
| 58 | _workModel?.cellH = Float(162)+descH+Float(hang*imgWH)+cityH+55 | 66 | _workModel?.cellH = Float(162)+descH+Float(hang*imgWH)+cityH+55 |
| @@ -86,6 +94,13 @@ class CNLiveViateAwardModelLayout:NSObject{ | @@ -86,6 +94,13 @@ class CNLiveViateAwardModelLayout:NSObject{ | ||
| 86 | super.init() | 94 | super.init() |
| 87 | model.isExpand = isExpand | 95 | model.isExpand = isExpand |
| 88 | self.awardModel = model | 96 | self.awardModel = model |
| 97 | + var companyH:Float = 25 | ||
| 98 | + let companyStr = model.company | ||
| 99 | + if companyStr.count == 0 || companyStr == ""{ | ||
| 100 | + companyH = 0 | ||
| 101 | + }else{ | ||
| 102 | + companyH = 25 | ||
| 103 | + } | ||
| 89 | let imgArr = model.imgs.components(separatedBy: ",") | 104 | let imgArr = model.imgs.components(separatedBy: ",") |
| 90 | var hang:Float = 1 | 105 | var hang:Float = 1 |
| 91 | if imgArr.count > 0{ | 106 | if imgArr.count > 0{ |
| @@ -103,7 +118,7 @@ class CNLiveViateAwardModelLayout:NSObject{ | @@ -103,7 +118,7 @@ class CNLiveViateAwardModelLayout:NSObject{ | ||
| 103 | } | 118 | } |
| 104 | var imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) | 119 | var imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) |
| 105 | if isPreview == false{//获奖详情页 | 120 | if isPreview == false{//获奖详情页 |
| 106 | - _awardModel?.cellH = Float(123)+descH+Float(hang*imgWH)+55 | 121 | + _awardModel?.cellH = Float(123-25)+companyH+descH+Float(hang*imgWH)+55 |
| 107 | }else{//预览获奖 | 122 | }else{//预览获奖 |
| 108 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) | 123 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) |
| 109 | _awardModel?.cellH = Float(162)+descH+Float(hang*imgWH)+55 | 124 | _awardModel?.cellH = Float(162)+descH+Float(hang*imgWH)+55 |