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 | 105 | make.right.equalToSuperview().offset(-15) |
| 106 | 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 | 112 | _selectUploadImageView?.endUploadImageCallBack = { |
| 112 | 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 | 125 | expandBtn.addTarget(self, action: #selector(expandBtnAction), for: .touchUpInside) |
| 126 | 126 | return expandBtn |
| 127 | 127 | }() |
| 128 | - | |
| 128 | + lazy var imagesTotalView :UIView = { | |
| 129 | + let whiteBgView = UIView() | |
| 130 | + whiteBgView.tag = 1100 | |
| 131 | + return whiteBgView | |
| 132 | + }() | |
| 129 | 133 | lazy var dingweiImgView :UIImageView = { |
| 130 | 134 | let iconImgView = UIImageView() |
| 131 | 135 | iconImgView.image = UIImage(named: "mine_jinali_workdingwei") |
| ... | ... | @@ -224,6 +228,14 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 224 | 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 | 239 | self.whiteBgView.addSubview(self.dingweiImgView) |
| 228 | 240 | self.dingweiImgView.snp.makeConstraints { make in |
| 229 | 241 | make.left.equalTo(15) |
| ... | ... | @@ -241,7 +253,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 241 | 253 | make.height.equalTo(0.5) |
| 242 | 254 | make.left.equalTo(15) |
| 243 | 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 | 258 | self.whiteBgView.addSubview(self.realImgView) |
| 247 | 259 | self.realImgView.snp.makeConstraints { make in |
| ... | ... | @@ -273,7 +285,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 273 | 285 | |
| 274 | 286 | //获奖 |
| 275 | 287 | func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ |
| 276 | - self.whiteBgView.subviews.forEach { view in | |
| 288 | + self.imagesTotalView.subviews.forEach { view in | |
| 277 | 289 | if view.tag >= 1000{ |
| 278 | 290 | view.removeFromSuperview() |
| 279 | 291 | } |
| ... | ... | @@ -283,7 +295,12 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 283 | 295 | let startDateString = convertTimestampStringToDateString(timestampString: model.time) |
| 284 | 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 | 305 | self.jianjieLabel.text = model.description//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" |
| 289 | 306 | let lines = jianjieLabel.getRealLabelTextLines() |
| ... | ... | @@ -317,7 +334,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 317 | 334 | let imgLeftGap:Float = 15 |
| 318 | 335 | let lie = i%3 |
| 319 | 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 | 338 | imgView.isUserInteractionEnabled = true |
| 322 | 339 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) |
| 323 | 340 | imgView.tag = 1000+i |
| ... | ... | @@ -325,7 +342,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 325 | 342 | let imgUrl = imgArr[i] |
| 326 | 343 | imgView.clipsToBounds = true |
| 327 | 344 | imgView.layer.cornerRadius = 5 |
| 328 | - self.whiteBgView.addSubview(imgView) | |
| 345 | + self.imagesTotalView.addSubview(imgView) | |
| 329 | 346 | |
| 330 | 347 | if imgUrl.contains("vitae_video_"){ |
| 331 | 348 | //是视频 |
| ... | ... | @@ -354,10 +371,17 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 354 | 371 | } |
| 355 | 372 | } |
| 356 | 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 | 383 | func setupNewUI(model:CNLiveVitaeWorksModel){ |
| 360 | - self.whiteBgView.subviews.forEach { view in | |
| 384 | + self.imagesTotalView.subviews.forEach { view in | |
| 361 | 385 | if view.tag >= 1000{ |
| 362 | 386 | view.removeFromSuperview() |
| 363 | 387 | } |
| ... | ... | @@ -371,8 +395,14 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 371 | 395 | }else{ |
| 372 | 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 | 406 | self.jianjieLabel.text = model.jobDuties//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" |
| 377 | 407 | let lines = jianjieLabel.getRealLabelTextLines() |
| 378 | 408 | let height = jianjieLabel.qmui_lineHeight |
| ... | ... | @@ -405,7 +435,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 405 | 435 | let imgLeftGap:Float = 15 |
| 406 | 436 | let lie = i%3 |
| 407 | 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 | 439 | imgView.isUserInteractionEnabled = true |
| 410 | 440 | imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) |
| 411 | 441 | imgView.tag = 1000+i |
| ... | ... | @@ -413,7 +443,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 413 | 443 | let imgUrl = imgArr[i] |
| 414 | 444 | imgView.clipsToBounds = true |
| 415 | 445 | imgView.layer.cornerRadius = 5 |
| 416 | - self.whiteBgView.addSubview(imgView) | |
| 446 | + self.imagesTotalView.addSubview(imgView) | |
| 417 | 447 | |
| 418 | 448 | if imgUrl.contains("vitae_video_"){ |
| 419 | 449 | //是视频 |
| ... | ... | @@ -445,9 +475,23 @@ class CNLiveVitaeWorkCell: UITableViewCell{ |
| 445 | 475 | let cityStr = model.city |
| 446 | 476 | if cityStr.count == 0 || cityStr == "请选择"{ |
| 447 | 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 | 485 | }else{ |
| 449 | 486 | self.workDingWeiTitleLabel.isHidden = false |
| 450 | 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 | 28 | super.init() |
| 29 | 29 | model.isExpand = isExpand |
| 30 | 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 | 39 | let imgArr = model.imgs.components(separatedBy: ",") |
| 32 | 40 | var hang:Float = 1 |
| 33 | 41 | if imgArr.count > 0{ |
| ... | ... | @@ -52,7 +60,7 @@ class CNLiveViateWorkModelLayout:NSObject{ |
| 52 | 60 | cityH = 35 |
| 53 | 61 | } |
| 54 | 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 | 64 | }else{//预览工作记录 |
| 57 | 65 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) |
| 58 | 66 | _workModel?.cellH = Float(162)+descH+Float(hang*imgWH)+cityH+55 |
| ... | ... | @@ -86,6 +94,13 @@ class CNLiveViateAwardModelLayout:NSObject{ |
| 86 | 94 | super.init() |
| 87 | 95 | model.isExpand = isExpand |
| 88 | 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 | 104 | let imgArr = model.imgs.components(separatedBy: ",") |
| 90 | 105 | var hang:Float = 1 |
| 91 | 106 | if imgArr.count > 0{ |
| ... | ... | @@ -103,7 +118,7 @@ class CNLiveViateAwardModelLayout:NSObject{ |
| 103 | 118 | } |
| 104 | 119 | var imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) |
| 105 | 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 | 122 | }else{//预览获奖 |
| 108 | 123 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) |
| 109 | 124 | _awardModel?.cellH = Float(162)+descH+Float(hang*imgWH)+55 | ... | ... |