Commit 50490bbaa7b9fee7c7bd4b868c5490da23800c55
1 parent
8cf2050f
数字简历预览页
Showing
18 changed files
with
1043 additions
and
139 deletions
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeWorkDetailController.swift
| ... | ... | @@ -157,11 +157,11 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo |
| 157 | 157 | for (idx,mdl) in res.enumerated() { |
| 158 | 158 | if idx == idxPath?.row{ |
| 159 | 159 | if self.workAwardType == .work{ |
| 160 | - let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight)) | |
| 160 | + let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight),isPreview: false) | |
| 161 | 161 | let newWorkModel = layout.getCellHModel() |
| 162 | 162 | tempArr.append(newWorkModel) |
| 163 | 163 | }else{ |
| 164 | - let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight)) | |
| 164 | + let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight), isPreview: false) | |
| 165 | 165 | let newWorkModel = layout.getCellHModel() |
| 166 | 166 | tempArr.append(newWorkModel) |
| 167 | 167 | } |
| ... | ... | @@ -217,7 +217,7 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo |
| 217 | 217 | if let res = result as? [CNLiveVitaeWorksModel]{ |
| 218 | 218 | self.workListArr = Array() |
| 219 | 219 | for mdl in res { |
| 220 | - let layout = CNLiveViateWorkModelLayout(model: mdl,descH: 40.0) | |
| 220 | + let layout = CNLiveViateWorkModelLayout(model: mdl,descH: 40.0,isPreview: false) | |
| 221 | 221 | let newWorkModel = layout.getCellHModel() |
| 222 | 222 | self.workListArr.append(newWorkModel) |
| 223 | 223 | } |
| ... | ... | @@ -235,7 +235,7 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo |
| 235 | 235 | if let res = result as? [CNLiveVitaeAwardsModel]{ |
| 236 | 236 | self.workListArr = Array() |
| 237 | 237 | for mdl in res { |
| 238 | - let layout = CNLiveViateAwardModelLayout(model: mdl,descH: 40.0) | |
| 238 | + let layout = CNLiveViateAwardModelLayout(model: mdl,descH: 40.0, isPreview: false) | |
| 239 | 239 | let newWorkModel = layout.getCellHModel() |
| 240 | 240 | self.workListArr.append(newWorkModel) |
| 241 | 241 | } | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewController.swift
| ... | ... | @@ -6,11 +6,30 @@ |
| 6 | 6 | // 数字简历预览页面 |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | +import JFHeroBrowser | |
| 9 | 10 | |
| 11 | + | |
| 12 | +///数字简历预览cell类型 | |
| 13 | +enum CNLiveViatePreviewCellType { | |
| 14 | + ///实名 | |
| 15 | + case realName | |
| 16 | + ///官方认证 | |
| 17 | + case guanFang | |
| 18 | + ///其他证书 | |
| 19 | + case cer | |
| 20 | + ///工作记录 | |
| 21 | + case work | |
| 22 | + ///获奖情况 | |
| 23 | + case award | |
| 24 | + ///自我介绍 | |
| 25 | + case mineJieShao | |
| 26 | +} | |
| 10 | 27 | class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ |
| 11 | 28 | |
| 12 | 29 | //简历model |
| 13 | 30 | var vitaeModel:CNLiveVitaeModel? |
| 31 | + var sixCellHeight:CGFloat = DefaultPreViewCellHeight+15 | |
| 32 | + | |
| 14 | 33 | |
| 15 | 34 | lazy var bgImgView :UIImageView = { |
| 16 | 35 | let iconImgView = UIImageView() |
| ... | ... | @@ -27,6 +46,23 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 27 | 46 | return iconImgView |
| 28 | 47 | }() |
| 29 | 48 | |
| 49 | + //所有cell的type | |
| 50 | + lazy var totalDataArray: NSMutableArray = { | |
| 51 | + var dataArray = NSMutableArray() | |
| 52 | + return dataArray | |
| 53 | + }() | |
| 54 | + //work的数据源 | |
| 55 | + lazy var workDataArray: NSMutableArray = { | |
| 56 | + var dataArray = NSMutableArray() | |
| 57 | + return dataArray | |
| 58 | + }() | |
| 59 | + //award的数据源 | |
| 60 | + lazy var awardDataArray: NSMutableArray = { | |
| 61 | + var dataArray = NSMutableArray() | |
| 62 | + return dataArray | |
| 63 | + }() | |
| 64 | + | |
| 65 | + | |
| 30 | 66 | lazy var secTotalDataArray: NSMutableArray = { |
| 31 | 67 | var dataArray = NSMutableArray() |
| 32 | 68 | return dataArray |
| ... | ... | @@ -35,11 +71,15 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 35 | 71 | var dataArray = NSMutableArray() |
| 36 | 72 | return dataArray |
| 37 | 73 | }() |
| 74 | + lazy var threeCerDataArray:[CNLiveVitaeCertificateModel] = { | |
| 75 | + var dataArray = [CNLiveVitaeCertificateModel]() | |
| 76 | + return dataArray | |
| 77 | + }() | |
| 38 | 78 | let kCNLiveDigitalResumePreViewFirCellIdentifier = "kCNLiveDigitalResumePreViewFirCellIdentifier" |
| 39 | 79 | let kCNLiveDigitalResumePreViewSecCellIdentifier = "kCNLiveDigitalResumePreViewSecCellIdentifier" |
| 40 | 80 | let kCNLiveDigitalResumePreviewThreeCellIdentifier = "kCNLiveDigitalResumePreviewThreeCellIdentifier" |
| 41 | 81 | let kCNLiveDigitalResumePreviewFourCellIdentifier = "kCNLiveDigitalResumePreviewFourCellIdentifier" |
| 42 | - let kCNLiveDigitalResumePreviewFiveCellIdentifier = "kCNLiveDigitalResumePreviewFiveCellIdentifier" | |
| 82 | +// let kCNLiveDigitalResumePreviewFiveCellIdentifier = "kCNLiveDigitalResumePreviewFiveCellIdentifier" | |
| 43 | 83 | let kCNLiveDigitalResumePreviewSixCellIdentifier = "kCNLiveDigitalResumePreviewSixCellIdentifier" |
| 44 | 84 | |
| 45 | 85 | lazy var tableView : UITableView = { |
| ... | ... | @@ -52,7 +92,7 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 52 | 92 | tableView.register(CNLiveDigitalResumePreViewSecCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreViewSecCellIdentifier) |
| 53 | 93 | tableView.register(CNLiveDigitalResumePreviewThreeCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewThreeCellIdentifier) |
| 54 | 94 | tableView.register(CNLiveDigitalResumePreviewFourCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewFourCellIdentifier) |
| 55 | - tableView.register(CNLiveDigitalResumePreviewFiveCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewFiveCellIdentifier) | |
| 95 | +// tableView.register(CNLiveDigitalResumePreviewFiveCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewFiveCellIdentifier) | |
| 56 | 96 | tableView.register(CNLiveDigitalResumePreviewSixCell.self, forCellReuseIdentifier: kCNLiveDigitalResumePreviewSixCellIdentifier) |
| 57 | 97 | tableView.backgroundColor = .clear |
| 58 | 98 | return tableView |
| ... | ... | @@ -134,11 +174,12 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 134 | 174 | } |
| 135 | 175 | |
| 136 | 176 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| 137 | - return 6 | |
| 177 | + return self.totalDataArray.count | |
| 138 | 178 | } |
| 139 | 179 | |
| 140 | 180 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| 141 | - if indexPath.row == 0{ | |
| 181 | + let cellType = self.totalDataArray[indexPath.row] as! CNLiveViatePreviewCellType | |
| 182 | + if cellType == .realName{ | |
| 142 | 183 | //我的简历-fir姓名等Cell |
| 143 | 184 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreViewFirCellIdentifier) as? CNLiveDigitalResumePreViewFirCell |
| 144 | 185 | else { |
| ... | ... | @@ -146,7 +187,7 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 146 | 187 | return cell |
| 147 | 188 | } |
| 148 | 189 | cell.updateViateDataBlock = { |
| 149 | - self.vitaeModel = nil | |
| 190 | + | |
| 150 | 191 | self.getVitae() |
| 151 | 192 | self.getCetList() |
| 152 | 193 | } |
| ... | ... | @@ -154,7 +195,7 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 154 | 195 | cell.vitaeModel = self.vitaeModel! |
| 155 | 196 | } |
| 156 | 197 | return cell |
| 157 | - }else if indexPath.row == 1{ | |
| 198 | + }else if cellType == .guanFang{ | |
| 158 | 199 | //官方验证 |
| 159 | 200 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreViewSecCellIdentifier) as? CNLiveDigitalResumePreViewSecCell |
| 160 | 201 | else { |
| ... | ... | @@ -163,37 +204,107 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 163 | 204 | } |
| 164 | 205 | cell.digitalListModels = self.succDataArray as? [MineAuthListModel] |
| 165 | 206 | return cell |
| 166 | - }else if indexPath.row == 2{ | |
| 207 | + }else if cellType == .cer{ | |
| 167 | 208 | //其他证书 |
| 168 | 209 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewThreeCellIdentifier) as? CNLiveDigitalResumePreviewThreeCell |
| 169 | 210 | else { |
| 170 | 211 | let cell = CNLiveDigitalResumePreviewThreeCell() |
| 171 | 212 | return cell |
| 172 | 213 | } |
| 214 | + cell.threeCerDataArray = self.threeCerDataArray | |
| 173 | 215 | return cell |
| 174 | - }else if indexPath.row == 3{ | |
| 216 | + }else if cellType == .work{ | |
| 175 | 217 | //工作记录 |
| 176 | 218 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewFourCellIdentifier) as? CNLiveDigitalResumePreviewFourCell |
| 177 | 219 | else { |
| 178 | 220 | let cell = CNLiveDigitalResumePreviewFourCell() |
| 179 | 221 | return cell |
| 180 | 222 | } |
| 223 | + if let workMdl = self.workDataArray[indexPath.row] as? CNLiveVitaeWorksModel{ | |
| 224 | + cell.workMdl = workMdl | |
| 225 | + cell.vitaePreviewWorkCellChangedBlock = { workCell,jianjieHeight in | |
| 226 | + let res = self.workDataArray | |
| 227 | + var tempArr = Array<Any>() | |
| 228 | + let idxPath = tableView.indexPath(for: workCell) | |
| 229 | + for (idx,mdl) in res.enumerated() { | |
| 230 | + if idx == idxPath?.row{ | |
| 231 | + let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight),isPreview: true) | |
| 232 | + let newWorkModel = layout.getCellHModel() | |
| 233 | + tempArr.append(newWorkModel) | |
| 234 | + }else{ | |
| 235 | + tempArr.append(mdl) | |
| 236 | + } | |
| 237 | + } | |
| 238 | + self.workDataArray = NSMutableArray(array: tempArr) | |
| 239 | + self.tableView.reloadData() | |
| 240 | + } | |
| 241 | + cell.vitaeWorkPreviewVideoPhotoBlock = { images , index in | |
| 242 | + self.hero.browserMultiSoures(viewModules: images, initIndex: index) { | |
| 243 | + [ | |
| 244 | + .enableBlurEffect(false), | |
| 245 | + .heroView(nil), | |
| 246 | + .imageDidChangeHandle({ imageIndex in | |
| 247 | + return nil | |
| 248 | + }) | |
| 249 | + ] | |
| 250 | + } | |
| 251 | + } | |
| 252 | + } | |
| 181 | 253 | return cell |
| 182 | - }else if indexPath.row == 4{ | |
| 254 | + }else if cellType == .award{ | |
| 183 | 255 | //获奖情况 |
| 184 | - guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewFiveCellIdentifier) as? CNLiveDigitalResumePreviewFiveCell | |
| 256 | + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewFourCellIdentifier) as? CNLiveDigitalResumePreviewFourCell | |
| 185 | 257 | else { |
| 186 | - let cell = CNLiveDigitalResumePreviewFiveCell() | |
| 258 | + let cell = CNLiveDigitalResumePreviewFourCell() | |
| 187 | 259 | return cell |
| 188 | 260 | } |
| 261 | + if let awardMdl = self.awardDataArray[indexPath.row] as? CNLiveVitaeAwardsModel{ | |
| 262 | + cell.awardModel = awardMdl | |
| 263 | + cell.vitaePreviewWorkCellChangedBlock = { workCell,jianjieHeight in | |
| 264 | + let res = self.awardDataArray | |
| 265 | + var tempArr = Array<Any>() | |
| 266 | + let idxPath = tableView.indexPath(for: workCell) | |
| 267 | + for (idx,mdl) in res.enumerated() { | |
| 268 | + if idx == idxPath?.row{ | |
| 269 | + let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight),isPreview: true) | |
| 270 | + let newWorkModel = layout.getCellHModel() | |
| 271 | + tempArr.append(newWorkModel) | |
| 272 | + }else{ | |
| 273 | + tempArr.append(mdl) | |
| 274 | + } | |
| 275 | + } | |
| 276 | + self.awardDataArray = NSMutableArray(array: tempArr) | |
| 277 | + self.tableView.reloadData() | |
| 278 | + } | |
| 279 | + cell.vitaeWorkPreviewVideoPhotoBlock = { images , index in | |
| 280 | + self.hero.browserMultiSoures(viewModules: images, initIndex: index) { | |
| 281 | + [ | |
| 282 | + .enableBlurEffect(false), | |
| 283 | + .heroView(nil), | |
| 284 | + .imageDidChangeHandle({ imageIndex in | |
| 285 | + return nil | |
| 286 | + }) | |
| 287 | + ] | |
| 288 | + } | |
| 289 | + } | |
| 290 | + } | |
| 189 | 291 | return cell |
| 190 | - }else if indexPath.row == 5{ | |
| 292 | + }else if cellType == .mineJieShao{ | |
| 191 | 293 | //自我介绍 |
| 192 | 294 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDigitalResumePreviewSixCellIdentifier) as? CNLiveDigitalResumePreviewSixCell |
| 193 | 295 | else { |
| 194 | 296 | let cell = CNLiveDigitalResumePreviewSixCell() |
| 195 | 297 | return cell |
| 196 | 298 | } |
| 299 | + | |
| 300 | + cell.vitaePreviewSixCellChangedBlock = { sixCell,jianjieHeight in | |
| 301 | + self.sixCellHeight = jianjieHeight+69 | |
| 302 | + self.tableView.reloadData() | |
| 303 | + | |
| 304 | + } | |
| 305 | + if self.vitaeModel?.vitae?.selfIntroduction.count ?? 0 > 0{ | |
| 306 | + cell.vitaeMdl = self.vitaeModel | |
| 307 | + } | |
| 197 | 308 | return cell |
| 198 | 309 | }else { |
| 199 | 310 | //未知cell |
| ... | ... | @@ -206,21 +317,35 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 206 | 317 | } |
| 207 | 318 | |
| 208 | 319 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 209 | - if indexPath.row == 0{ | |
| 320 | + let cellType = self.totalDataArray[indexPath.row] as! CNLiveViatePreviewCellType | |
| 321 | + if cellType == .realName{ | |
| 210 | 322 | return 177+51 |
| 211 | - }else if indexPath.row == 1{ | |
| 323 | + }else if cellType == .guanFang{ | |
| 212 | 324 | return self.succDataArray.count == 0 ? DefaultPreViewCellHeight+15 : 218+15 |
| 213 | - }else if indexPath.row == 2{ | |
| 214 | - return DefaultPreViewCellHeight+15//227+15 | |
| 215 | - }else if indexPath.row == 3{ | |
| 216 | - return DefaultPreViewCellHeight+15//396+15 | |
| 217 | - }else if indexPath.row == 4{ | |
| 218 | - return DefaultPreViewCellHeight+15//396+15 | |
| 219 | - }else if indexPath.row == 5{ | |
| 220 | - return DefaultPreViewCellHeight+15//209+15 | |
| 221 | - }else { | |
| 325 | + }else if cellType == .cer{ | |
| 326 | + return self.threeCerDataArray.count == 0 ? DefaultPreViewCellHeight+15 : 227+15 | |
| 327 | + }else if cellType == .work{ | |
| 328 | + if self.vitaeModel?.works.count ?? 0 > 0{ | |
| 329 | + //有多个workcell | |
| 330 | + let model = self.workDataArray[indexPath.row] as! CNLiveVitaeWorksModel | |
| 331 | + return CGFloat(model.cellH) | |
| 332 | + }else{ | |
| 333 | + return DefaultPreViewCellHeight+15//396+15 | |
| 334 | + } | |
| 335 | + }else if cellType == .award{ | |
| 336 | + if self.vitaeModel?.awards.count ?? 0 > 0{ | |
| 337 | + //有多个awardcell | |
| 338 | + let model = self.awardDataArray[indexPath.row] as! CNLiveVitaeAwardsModel | |
| 339 | + return CGFloat(model.cellH) | |
| 340 | + }else{ | |
| 341 | + return DefaultPreViewCellHeight+15//396+15 | |
| 342 | + } | |
| 343 | + }else if cellType == .mineJieShao{ | |
| 344 | + return self.sixCellHeight | |
| 345 | + }else{ | |
| 222 | 346 | return 50 |
| 223 | 347 | } |
| 348 | + | |
| 224 | 349 | } |
| 225 | 350 | |
| 226 | 351 | @objc func settingBtnAction(){ |
| ... | ... | @@ -237,6 +362,7 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 237 | 362 | CNLiveVitaeViewModel.getCerList(vsid: vsid, page: 1, pageSize: 100){ result, respStatue in |
| 238 | 363 | if respStatue == .success{ |
| 239 | 364 | if let res = result as? [CNLiveVitaeCertificateModel]{ |
| 365 | + self.threeCerDataArray = res | |
| 240 | 366 | self.tableView.reloadData() |
| 241 | 367 | } |
| 242 | 368 | }else{ |
| ... | ... | @@ -256,8 +382,33 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD |
| 256 | 382 | self.saveUpdateVitae(isSave: true) |
| 257 | 383 | }else{ |
| 258 | 384 | //有简历-刷新页面 |
| 385 | + self.vitaeModel = nil | |
| 259 | 386 | self.vitaeModel = model |
| 260 | 387 | self.saveViateModel() |
| 388 | + self.totalDataArray.removeAllObjects() | |
| 389 | + self.workDataArray.removeAllObjects() | |
| 390 | + self.awardDataArray.removeAllObjects() | |
| 391 | + self.totalDataArray.addObjects(from: [CNLiveViatePreviewCellType.realName,CNLiveViatePreviewCellType.guanFang,CNLiveViatePreviewCellType.cer]) | |
| 392 | + self.workDataArray.addObjects(from: [CNLiveViatePreviewCellType.realName,CNLiveViatePreviewCellType.guanFang,CNLiveViatePreviewCellType.cer]) | |
| 393 | + self.awardDataArray.addObjects(from: [CNLiveViatePreviewCellType.realName,CNLiveViatePreviewCellType.guanFang,CNLiveViatePreviewCellType.cer]) | |
| 394 | + for (_,mdl) in self.vitaeModel!.works.enumerated() { | |
| 395 | + self.totalDataArray.add(CNLiveViatePreviewCellType.work) | |
| 396 | + | |
| 397 | + let layout = CNLiveViateWorkModelLayout(model: mdl ,descH: Float(40.0),isPreview: true) | |
| 398 | + let newWorkModel = layout.getCellHModel() | |
| 399 | + self.workDataArray.add(newWorkModel) | |
| 400 | + self.awardDataArray.add(CNLiveViatePreviewCellType.work) | |
| 401 | + } | |
| 402 | + for (_,mdl) in self.vitaeModel!.awards.enumerated() { | |
| 403 | + self.totalDataArray.add(CNLiveViatePreviewCellType.award) | |
| 404 | + let layout = CNLiveViateAwardModelLayout(model: mdl ,descH: Float(40.0),isPreview: true) | |
| 405 | + let newWorkModel = layout.getCellHModel() | |
| 406 | + self.awardDataArray.add(newWorkModel) | |
| 407 | + self.workDataArray.add(CNLiveViatePreviewCellType.award) | |
| 408 | + } | |
| 409 | + self.totalDataArray.add(CNLiveViatePreviewCellType.mineJieShao) | |
| 410 | + self.workDataArray.add(CNLiveViatePreviewCellType.mineJieShao) | |
| 411 | + self.awardDataArray.add(CNLiveViatePreviewCellType.mineJieShao) | |
| 261 | 412 | self.tableView.reloadData() |
| 262 | 413 | } |
| 263 | 414 | }else{ | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreViewFirCell.swift
| ... | ... | @@ -134,7 +134,12 @@ class CNLiveDigitalResumePreViewFirCell: UITableViewCell { |
| 134 | 134 | self.selectionStyle = .none |
| 135 | 135 | |
| 136 | 136 | self.contentView.addSubview(self.whiteBgView) |
| 137 | - | |
| 137 | + self.whiteBgView.snp.makeConstraints { make in | |
| 138 | + make.top.equalTo(51) | |
| 139 | + make.bottom.equalToSuperview() | |
| 140 | + make.left.equalTo(15) | |
| 141 | + make.right.equalToSuperview().offset(-15) | |
| 142 | + } | |
| 138 | 143 | self.contentView.addSubview(self.jianliIconBgView) |
| 139 | 144 | self.jianliIconBgView.snp.makeConstraints { make in |
| 140 | 145 | make.top.equalTo(21) | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreViewSecCell.swift
| ... | ... | @@ -88,6 +88,12 @@ class CNLiveDigitalResumePreViewSecCell: UITableViewCell, UICollectionViewDelega |
| 88 | 88 | self.backgroundColor = .clear |
| 89 | 89 | self.selectionStyle = .none |
| 90 | 90 | self.contentView.addSubview(self.whiteView) |
| 91 | + self.whiteView.snp.makeConstraints { make in | |
| 92 | + make.top.equalTo(15) | |
| 93 | + make.bottom.equalToSuperview() | |
| 94 | + make.left.equalTo(15) | |
| 95 | + make.right.equalToSuperview().offset(-15) | |
| 96 | + } | |
| 91 | 97 | self.whiteView.addSubview(self.myIdentityTitleLabel) |
| 92 | 98 | self.myIdentityTitleLabel.snp.makeConstraints { make in |
| 93 | 99 | make.top.equalToSuperview().offset(adapt_length(length: 15)) | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewFiveCell.swift
| 1 | +//// | |
| 2 | +//// CNLiveDigitalResumePreviewFiveCell.swift | |
| 3 | +//// metaCode | |
| 4 | +//// | |
| 5 | +//// Created by zx on 2024/8/7. | |
| 6 | +//// 数字简历-Five 获奖情况cell | |
| 1 | 7 | // |
| 2 | -// CNLiveDigitalResumePreviewFiveCell.swift | |
| 3 | -// metaCode | |
| 8 | +//import Foundation | |
| 9 | +//import Kingfisher | |
| 10 | +//import SnapKit | |
| 4 | 11 | // |
| 5 | -// Created by zx on 2024/8/7. | |
| 6 | -// 数字简历-Five 获奖情况cell | |
| 7 | - | |
| 8 | -import Foundation | |
| 9 | -import Kingfisher | |
| 10 | -import SnapKit | |
| 11 | - | |
| 12 | -class CNLiveDigitalResumePreviewFiveCell: UITableViewCell { | |
| 13 | - | |
| 14 | - lazy var whiteView :UIView = { | |
| 15 | - let whiteView = UIView(frame: CGRect(x: 15, y:15, width: KSreenWidth-30, height: DefaultPreViewCellHeight)) | |
| 16 | - whiteView.backgroundColor = .white | |
| 17 | - whiteView.layer.cornerRadius = 12 | |
| 18 | - whiteView.clipsToBounds = true | |
| 19 | - return whiteView | |
| 20 | - }() | |
| 21 | - lazy var myIdentityTitleLabel: UILabel = { | |
| 22 | - let titleLabel = UILabel() | |
| 23 | - titleLabel.textColor = HexColor("#333333") | |
| 24 | - titleLabel.textAlignment = .center | |
| 25 | - titleLabel.text = "获奖情况" | |
| 26 | - titleLabel.font = BoldFont_16 | |
| 27 | - return titleLabel | |
| 28 | - }() | |
| 29 | - | |
| 30 | - lazy var zhengshuNoDescTitleLabel: UILabel = { | |
| 31 | - let titleLabel = UILabel() | |
| 32 | - titleLabel.textColor = HexColor("#999999") | |
| 33 | - titleLabel.textAlignment = .left | |
| 34 | - titleLabel.text = "还没有添加获奖情况" | |
| 35 | - titleLabel.font = Font_12 | |
| 36 | - return titleLabel | |
| 37 | - }() | |
| 38 | - lazy var zhengshuNoIconImgView :UIImageView = { | |
| 39 | - let iconImgView = UIImageView(frame: CGRect(x: 18, y: 0, width: 60, height: 45)) | |
| 40 | - iconImgView.contentMode = .scaleAspectFit | |
| 41 | - iconImgView.image = UIImage(named: "mine_jianli_noaward") | |
| 42 | - return iconImgView | |
| 43 | - }() | |
| 44 | - | |
| 45 | - lazy var zhengshuBtn: UIButton = { | |
| 46 | - let closeBtn = UIButton(type: .custom) | |
| 47 | - closeBtn.setTitle("关联获奖", for: .normal) | |
| 48 | - closeBtn.setTitleColor(HexColor("#1961FE"), for: .normal) | |
| 49 | - closeBtn.titleLabel?.font = BoldFont_14 | |
| 50 | - closeBtn.layer.borderColor = HexColor("#1961FE")?.cgColor | |
| 51 | - closeBtn.layer.borderWidth = 0.5 | |
| 52 | - closeBtn.layer.cornerRadius = 6 | |
| 53 | - closeBtn.clipsToBounds = true | |
| 54 | - closeBtn.addTarget(self, action: #selector(zhengshuBtnAction), for: .touchUpInside) | |
| 55 | - return closeBtn | |
| 56 | - }() | |
| 57 | - | |
| 58 | - override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 59 | - super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 60 | - self.contentView.backgroundColor = .clear | |
| 61 | - self.backgroundColor = .clear | |
| 62 | - self.selectionStyle = .none | |
| 63 | - | |
| 64 | - self.contentView.addSubview(self.whiteView) | |
| 65 | - self.whiteView.addSubview(self.myIdentityTitleLabel) | |
| 66 | - self.myIdentityTitleLabel.snp.makeConstraints { make in | |
| 67 | - make.top.equalToSuperview().offset(adapt_length(length: 15)) | |
| 68 | - make.left.equalTo(adapt_length(length: 15)) | |
| 69 | - } | |
| 70 | - | |
| 71 | - self.whiteView.addSubview(self.zhengshuBtn) | |
| 72 | - self.zhengshuBtn.snp.makeConstraints { make in | |
| 73 | - make.centerX.equalToSuperview() | |
| 74 | - make.bottom.equalToSuperview().offset(-20) | |
| 75 | - make.width.equalTo(86) | |
| 76 | - make.height.equalTo(34) | |
| 77 | - } | |
| 78 | - | |
| 79 | - self.whiteView.addSubview(self.zhengshuNoDescTitleLabel) | |
| 80 | - self.zhengshuNoDescTitleLabel.snp.makeConstraints { make in | |
| 81 | - make.centerX.equalToSuperview() | |
| 82 | - make.bottom.equalTo(self.zhengshuBtn.snp.top).offset(-10) | |
| 83 | - } | |
| 84 | - self.whiteView.addSubview(self.zhengshuNoIconImgView) | |
| 85 | - self.zhengshuNoIconImgView.snp.makeConstraints { make in | |
| 86 | - make.centerX.equalToSuperview() | |
| 87 | - make.bottom.equalTo(self.zhengshuNoDescTitleLabel.snp.top).offset(-10) | |
| 88 | - make.width.equalTo(60) | |
| 89 | - make.height.equalTo(45) | |
| 90 | - } | |
| 91 | - | |
| 92 | - } | |
| 93 | - required init?(coder: NSCoder) { | |
| 94 | - fatalError("init(coder:) has not been implemented") | |
| 95 | - } | |
| 96 | - | |
| 97 | - @objc func zhengshuBtnAction(){ | |
| 98 | - //跳转 选择获奖情况页面 | |
| 99 | - | |
| 100 | - } | |
| 101 | - | |
| 102 | -} | |
| 12 | +//class CNLiveDigitalResumePreviewFiveCell: UITableViewCell { | |
| 13 | +// | |
| 14 | +// lazy var whiteView :UIView = { | |
| 15 | +// let whiteView = UIView(frame: CGRect(x: 15, y:15, width: KSreenWidth-30, height: DefaultPreViewCellHeight)) | |
| 16 | +// whiteView.backgroundColor = .white | |
| 17 | +// whiteView.layer.cornerRadius = 12 | |
| 18 | +// whiteView.clipsToBounds = true | |
| 19 | +// return whiteView | |
| 20 | +// }() | |
| 21 | +// lazy var myIdentityTitleLabel: UILabel = { | |
| 22 | +// let titleLabel = UILabel() | |
| 23 | +// titleLabel.textColor = HexColor("#333333") | |
| 24 | +// titleLabel.textAlignment = .center | |
| 25 | +// titleLabel.text = "获奖情况" | |
| 26 | +// titleLabel.font = BoldFont_16 | |
| 27 | +// return titleLabel | |
| 28 | +// }() | |
| 29 | +// | |
| 30 | +// lazy var zhengshuNoDescTitleLabel: UILabel = { | |
| 31 | +// let titleLabel = UILabel() | |
| 32 | +// titleLabel.textColor = HexColor("#999999") | |
| 33 | +// titleLabel.textAlignment = .left | |
| 34 | +// titleLabel.text = "还没有添加获奖情况" | |
| 35 | +// titleLabel.font = Font_12 | |
| 36 | +// return titleLabel | |
| 37 | +// }() | |
| 38 | +// lazy var zhengshuNoIconImgView :UIImageView = { | |
| 39 | +// let iconImgView = UIImageView(frame: CGRect(x: 18, y: 0, width: 60, height: 45)) | |
| 40 | +// iconImgView.contentMode = .scaleAspectFit | |
| 41 | +// iconImgView.image = UIImage(named: "mine_jianli_noaward") | |
| 42 | +// return iconImgView | |
| 43 | +// }() | |
| 44 | +// | |
| 45 | +// lazy var zhengshuBtn: UIButton = { | |
| 46 | +// let closeBtn = UIButton(type: .custom) | |
| 47 | +// closeBtn.setTitle("关联获奖", for: .normal) | |
| 48 | +// closeBtn.setTitleColor(HexColor("#1961FE"), for: .normal) | |
| 49 | +// closeBtn.titleLabel?.font = BoldFont_14 | |
| 50 | +// closeBtn.layer.borderColor = HexColor("#1961FE")?.cgColor | |
| 51 | +// closeBtn.layer.borderWidth = 0.5 | |
| 52 | +// closeBtn.layer.cornerRadius = 6 | |
| 53 | +// closeBtn.clipsToBounds = true | |
| 54 | +// closeBtn.addTarget(self, action: #selector(zhengshuBtnAction), for: .touchUpInside) | |
| 55 | +// return closeBtn | |
| 56 | +// }() | |
| 57 | +// | |
| 58 | +// override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
| 59 | +// super.init(style: style, reuseIdentifier: reuseIdentifier) | |
| 60 | +// self.contentView.backgroundColor = .clear | |
| 61 | +// self.backgroundColor = .clear | |
| 62 | +// self.selectionStyle = .none | |
| 63 | +// | |
| 64 | +// self.contentView.addSubview(self.whiteView) | |
| 65 | +// self.whiteView.addSubview(self.myIdentityTitleLabel) | |
| 66 | +// self.myIdentityTitleLabel.snp.makeConstraints { make in | |
| 67 | +// make.top.equalToSuperview().offset(adapt_length(length: 15)) | |
| 68 | +// make.left.equalTo(adapt_length(length: 15)) | |
| 69 | +// } | |
| 70 | +// | |
| 71 | +// self.whiteView.addSubview(self.zhengshuBtn) | |
| 72 | +// self.zhengshuBtn.snp.makeConstraints { make in | |
| 73 | +// make.centerX.equalToSuperview() | |
| 74 | +// make.bottom.equalToSuperview().offset(-20) | |
| 75 | +// make.width.equalTo(86) | |
| 76 | +// make.height.equalTo(34) | |
| 77 | +// } | |
| 78 | +// | |
| 79 | +// self.whiteView.addSubview(self.zhengshuNoDescTitleLabel) | |
| 80 | +// self.zhengshuNoDescTitleLabel.snp.makeConstraints { make in | |
| 81 | +// make.centerX.equalToSuperview() | |
| 82 | +// make.bottom.equalTo(self.zhengshuBtn.snp.top).offset(-10) | |
| 83 | +// } | |
| 84 | +// self.whiteView.addSubview(self.zhengshuNoIconImgView) | |
| 85 | +// self.zhengshuNoIconImgView.snp.makeConstraints { make in | |
| 86 | +// make.centerX.equalToSuperview() | |
| 87 | +// make.bottom.equalTo(self.zhengshuNoDescTitleLabel.snp.top).offset(-10) | |
| 88 | +// make.width.equalTo(60) | |
| 89 | +// make.height.equalTo(45) | |
| 90 | +// } | |
| 91 | +// | |
| 92 | +// } | |
| 93 | +// required init?(coder: NSCoder) { | |
| 94 | +// fatalError("init(coder:) has not been implemented") | |
| 95 | +// } | |
| 96 | +// | |
| 97 | +// @objc func zhengshuBtnAction(){ | |
| 98 | +// //跳转 选择获奖情况页面 | |
| 99 | +// | |
| 100 | +// } | |
| 101 | +// | |
| 102 | +//} | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewFourCell.swift
| ... | ... | @@ -8,9 +8,45 @@ |
| 8 | 8 | import Foundation |
| 9 | 9 | import Kingfisher |
| 10 | 10 | import SnapKit |
| 11 | +import JFHeroBrowser | |
| 12 | + | |
| 13 | +//cell高度变化 | |
| 14 | +typealias vitaePreviewWorkCellChangedBlockActionBlock = (_ cell: CNLiveDigitalResumePreviewFourCell ,_ cellHeight:CGFloat) -> Void | |
| 11 | 15 | |
| 12 | 16 | class CNLiveDigitalResumePreviewFourCell: UITableViewCell { |
| 13 | 17 | |
| 18 | + //workModel | |
| 19 | + var _workMdl : CNLiveVitaeWorksModel? | |
| 20 | + var workMdl : CNLiveVitaeWorksModel? { | |
| 21 | + get{ | |
| 22 | + _workMdl | |
| 23 | + } | |
| 24 | + set{ | |
| 25 | + _workMdl = newValue! | |
| 26 | + setupNewUI(model: _workMdl!) | |
| 27 | + } | |
| 28 | + } | |
| 29 | + | |
| 30 | + //awardModel | |
| 31 | + var _awardModel : CNLiveVitaeAwardsModel? | |
| 32 | + var awardModel : CNLiveVitaeAwardsModel? { | |
| 33 | + get{ | |
| 34 | + _awardModel | |
| 35 | + } | |
| 36 | + set{ | |
| 37 | + _awardModel = newValue! | |
| 38 | + setupAwardNewUI(model: _awardModel!) | |
| 39 | + } | |
| 40 | + } | |
| 41 | + | |
| 42 | + lazy var images: [HeroBrowserViewModuleBaseProtocol] = { | |
| 43 | + var list: [HeroBrowserViewModuleBaseProtocol] = [] | |
| 44 | + return list | |
| 45 | + }() | |
| 46 | + | |
| 47 | + var vitaeWorkPreviewVideoPhotoBlock:VitaeWorkPreviewVideoPhotoBlock? | |
| 48 | + var vitaePreviewWorkCellChangedBlock:vitaePreviewWorkCellChangedBlockActionBlock? | |
| 49 | + | |
| 14 | 50 | lazy var whiteView :UIView = { |
| 15 | 51 | let whiteView = UIView(frame: CGRect(x: 15, y:15, width: KSreenWidth-30, height: DefaultPreViewCellHeight)) |
| 16 | 52 | whiteView.backgroundColor = .white |
| ... | ... | @@ -41,7 +77,105 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { |
| 41 | 77 | iconImgView.image = UIImage(named: "mine_jianli_preview_workNoData") |
| 42 | 78 | return iconImgView |
| 43 | 79 | }() |
| 80 | + //有内容 | |
| 81 | + lazy var nameIconImgView :UIImageView = { | |
| 82 | + let iconImgView = UIImageView(frame: CGRect(x: 15, y: 0, width: 25, height: 25)) | |
| 83 | + iconImgView.contentMode = .scaleAspectFit | |
| 84 | + iconImgView.image = UIImage(named: "mine_jianli_preview_work") | |
| 85 | + return iconImgView | |
| 86 | + }() | |
| 87 | + lazy var workProfessionTitleLabel: UILabel = { | |
| 88 | + let titleLabel = UILabel() | |
| 89 | + titleLabel.textColor = HexColor("#333333") | |
| 90 | + titleLabel.textAlignment = .left | |
| 91 | + titleLabel.text = "行业" | |
| 92 | + titleLabel.font = BoldFont_16 | |
| 93 | + titleLabel.adjustsFontSizeToFitWidth = true | |
| 94 | + return titleLabel | |
| 95 | + }() | |
| 96 | + lazy var realImgView :UIImageView = { | |
| 97 | + let iconImgView = UIImageView() | |
| 98 | + iconImgView.image = UIImage(named: "mine_jianli_zhenshi") | |
| 99 | + return iconImgView | |
| 100 | + }() | |
| 101 | + lazy var workNameTitleLabel: UILabel = { | |
| 102 | + let titleLabel = UILabel() | |
| 103 | + titleLabel.textColor = HexColor("#333333") | |
| 104 | + titleLabel.textAlignment = .left | |
| 105 | + titleLabel.text = "工作岗位" | |
| 106 | + titleLabel.font = Font_14 | |
| 107 | + titleLabel.adjustsFontSizeToFitWidth = true | |
| 108 | + return titleLabel | |
| 109 | + }() | |
| 110 | + lazy var workPositionTitleLabel: UILabel = { | |
| 111 | + let titleLabel = UILabel() | |
| 112 | + titleLabel.textColor = HexColor("#333333") | |
| 113 | + titleLabel.textAlignment = .left | |
| 114 | + titleLabel.text = "公司名称" | |
| 115 | + titleLabel.font = Font_14 | |
| 116 | + titleLabel.adjustsFontSizeToFitWidth = true | |
| 117 | + return titleLabel | |
| 118 | + }() | |
| 119 | + lazy var workTimeTitleLabel: UILabel = { | |
| 120 | + let titleLabel = UILabel() | |
| 121 | + titleLabel.textColor = HexColor("#333333") | |
| 122 | + titleLabel.textAlignment = .left | |
| 123 | + titleLabel.text = "工作时间" | |
| 124 | + titleLabel.font = Font_14 | |
| 125 | + titleLabel.adjustsFontSizeToFitWidth = true | |
| 126 | + return titleLabel | |
| 127 | + }() | |
| 128 | + ///工作内容描述 | |
| 129 | + lazy var jianjieLabel: UILabel = { | |
| 130 | + let titleLabel = UILabel.init(frame: CGRectMake(50, 162, KSreenWidth-60, 40)) | |
| 131 | + titleLabel.textColor = HexColor("#999999") | |
| 132 | + titleLabel.textAlignment = .left | |
| 133 | + titleLabel.font = Font_14 | |
| 134 | + titleLabel.backgroundColor = .clear// UIColor(red:0.98, green:0.98, blue:0.98, alpha:1.00) | |
| 135 | + titleLabel.text = "描述" | |
| 136 | + titleLabel.numberOfLines = 0 | |
| 137 | + var lines = titleLabel.getRealLabelTextLines() | |
| 138 | + let height = titleLabel.qmui_lineHeight | |
| 139 | + if lines > 2 { | |
| 140 | + lines = 2 | |
| 141 | + } | |
| 142 | + titleLabel.height = height*CGFloat(lines) | |
| 143 | + return titleLabel | |
| 144 | + }() | |
| 145 | + //展开,收起 | |
| 146 | + lazy var expandBtn: UIButton = { | |
| 147 | + let expandBtn = UIButton.init(type: .custom) | |
| 148 | + expandBtn.backgroundColor = .clear | |
| 149 | + | |
| 150 | + expandBtn.frame = CGRect(x: self.jianjieLabel.right-60, y: self.jianjieLabel.bottom+10, width: 60, height: 30) | |
| 151 | + expandBtn.setTitle("更多", for: .normal) | |
| 152 | + expandBtn.setTitle("收起", for: .selected) | |
| 44 | 153 | |
| 154 | + expandBtn.setTitleColor(HexColor("#1B64FE"), for: .normal) | |
| 155 | + expandBtn.setImage(UIImage(named: "homepage_unfold"), for: .normal) | |
| 156 | + expandBtn.setImage(UIImage(named: "homepage_fold"), for: .selected) | |
| 157 | + expandBtn.titleLabel?.font = Font_14 | |
| 158 | + expandBtn.setupButtonImageAndTitlePossitionWith(padding: 5, style: .right) | |
| 159 | + expandBtn.addTarget(self, action: #selector(expandBtnAction), for: .touchUpInside) | |
| 160 | + return expandBtn | |
| 161 | + }() | |
| 162 | + | |
| 163 | + lazy var dingweiImgView :UIImageView = { | |
| 164 | + let iconImgView = UIImageView() | |
| 165 | + iconImgView.image = UIImage(named: "mine_jinali_workdingwei") | |
| 166 | + return iconImgView | |
| 167 | + }() | |
| 168 | + lazy var workDingWeiTitleLabel: UILabel = { | |
| 169 | + let titleLabel = UILabel() | |
| 170 | + titleLabel.textColor = HexColor("#999999") | |
| 171 | + titleLabel.textAlignment = .left | |
| 172 | + titleLabel.text = "" | |
| 173 | + titleLabel.font = Font_11 | |
| 174 | + titleLabel.adjustsFontSizeToFitWidth = true | |
| 175 | + return titleLabel | |
| 176 | + }() | |
| 177 | + | |
| 178 | + | |
| 45 | 179 | lazy var zhengshuBtn: UIButton = { |
| 46 | 180 | let closeBtn = UIButton(type: .custom) |
| 47 | 181 | closeBtn.setTitle("关联工作", for: .normal) |
| ... | ... | @@ -62,12 +196,86 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { |
| 62 | 196 | self.selectionStyle = .none |
| 63 | 197 | |
| 64 | 198 | self.contentView.addSubview(self.whiteView) |
| 199 | + self.whiteView.snp.makeConstraints { make in | |
| 200 | + make.top.equalTo(15) | |
| 201 | + make.bottom.equalToSuperview() | |
| 202 | + make.left.equalTo(15) | |
| 203 | + make.right.equalToSuperview().offset(-15) | |
| 204 | + } | |
| 205 | + | |
| 65 | 206 | self.whiteView.addSubview(self.myIdentityTitleLabel) |
| 66 | 207 | self.myIdentityTitleLabel.snp.makeConstraints { make in |
| 67 | 208 | make.top.equalToSuperview().offset(adapt_length(length: 15)) |
| 68 | 209 | make.left.equalTo(adapt_length(length: 15)) |
| 69 | 210 | } |
| 70 | - | |
| 211 | + self.whiteView.addSubview(self.nameIconImgView) | |
| 212 | + self.nameIconImgView.snp.makeConstraints { make in | |
| 213 | + make.top.equalTo(self.myIdentityTitleLabel.snp.bottom).offset(15) | |
| 214 | + make.left.equalTo(15) | |
| 215 | + make.width.height.equalTo(25) | |
| 216 | + } | |
| 217 | + self.whiteView.addSubview(self.workProfessionTitleLabel) | |
| 218 | + self.workProfessionTitleLabel.snp.makeConstraints { make in | |
| 219 | + make.top.equalTo(self.myIdentityTitleLabel.snp.bottom).offset(15) | |
| 220 | + make.left.equalTo(50) | |
| 221 | + } | |
| 222 | + | |
| 223 | + self.whiteView.addSubview(self.realImgView) | |
| 224 | + self.realImgView.snp.makeConstraints { make in | |
| 225 | + make.right.equalToSuperview().offset(-15) | |
| 226 | + make.centerY.equalTo(self.workProfessionTitleLabel.snp.centerY) | |
| 227 | + make.width.equalTo(80) | |
| 228 | + make.height.equalTo(80.0*78/403) | |
| 229 | + make.left.greaterThanOrEqualTo(self.workProfessionTitleLabel.snp.right).offset(5) | |
| 230 | + } | |
| 231 | + self.whiteView.addSubview(self.workNameTitleLabel) | |
| 232 | + self.workNameTitleLabel.snp.makeConstraints { make in | |
| 233 | + make.top.equalTo(self.workProfessionTitleLabel.snp.bottom).offset(6) | |
| 234 | + make.left.equalTo(50) | |
| 235 | + make.right.equalToSuperview().offset(-15) | |
| 236 | + } | |
| 237 | + | |
| 238 | + self.whiteView.addSubview(self.workPositionTitleLabel) | |
| 239 | + self.workPositionTitleLabel.snp.makeConstraints { make in | |
| 240 | + make.top.equalTo(self.workNameTitleLabel.snp.bottom).offset(5) | |
| 241 | + make.left.equalTo(self.workNameTitleLabel.snp.left) | |
| 242 | + make.right.equalToSuperview().offset(-15) | |
| 243 | + } | |
| 244 | + | |
| 245 | + self.whiteView.addSubview(self.workTimeTitleLabel) | |
| 246 | + self.workTimeTitleLabel.snp.makeConstraints { make in | |
| 247 | + make.top.equalTo(self.workPositionTitleLabel.snp.bottom).offset(5) | |
| 248 | + make.left.equalTo(self.workPositionTitleLabel.snp.left) | |
| 249 | + make.right.equalToSuperview().offset(-15) | |
| 250 | + } | |
| 251 | + self.whiteView.addSubview(self.jianjieLabel) | |
| 252 | + self.jianjieLabel.snp.makeConstraints { make in | |
| 253 | + make.top.equalTo(self.workTimeTitleLabel.snp.bottom).offset(10) | |
| 254 | + make.left.equalTo(self.workTimeTitleLabel.snp.left) | |
| 255 | + make.right.equalToSuperview().offset(-20) | |
| 256 | + } | |
| 257 | + self.whiteView.addSubview(self.expandBtn) | |
| 258 | + | |
| 259 | + let lines = jianjieLabel.getRealLabelTextLines() | |
| 260 | + if lines <= 2{ | |
| 261 | + self.expandBtn.isHidden = true | |
| 262 | + }else{ | |
| 263 | + self.expandBtn.isHidden = false | |
| 264 | + } | |
| 265 | + | |
| 266 | + self.whiteView.addSubview(self.dingweiImgView) | |
| 267 | + self.dingweiImgView.snp.makeConstraints { make in | |
| 268 | + make.left.equalTo(self.workNameTitleLabel.snp.left) | |
| 269 | + make.bottom.equalToSuperview().offset(-72) | |
| 270 | + make.width.equalTo(10) | |
| 271 | + make.height.equalTo(10) | |
| 272 | + } | |
| 273 | + self.whiteView.addSubview(self.workDingWeiTitleLabel) | |
| 274 | + self.workDingWeiTitleLabel.snp.makeConstraints { make in | |
| 275 | + make.left.equalTo(self.dingweiImgView.snp.right).offset(3) | |
| 276 | + make.centerY.equalTo(self.dingweiImgView.snp.centerY) | |
| 277 | + } | |
| 278 | + | |
| 71 | 279 | self.whiteView.addSubview(self.zhengshuBtn) |
| 72 | 280 | self.zhengshuBtn.snp.makeConstraints { make in |
| 73 | 281 | make.centerX.equalToSuperview() |
| ... | ... | @@ -94,9 +302,270 @@ class CNLiveDigitalResumePreviewFourCell: UITableViewCell { |
| 94 | 302 | fatalError("init(coder:) has not been implemented") |
| 95 | 303 | } |
| 96 | 304 | |
| 97 | - @objc func zhengshuBtnAction(){ | |
| 98 | - //跳转 选择工作记录页面 | |
| 305 | + func setupAwardNewUI(model:CNLiveVitaeAwardsModel){ | |
| 306 | + self.myIdentityTitleLabel.text = "获奖情况" | |
| 307 | + self.realImgView.isHidden = true | |
| 308 | + | |
| 309 | + self.zhengshuNoIconImgView.isHidden = true | |
| 310 | + self.zhengshuNoDescTitleLabel.isHidden = true | |
| 311 | + | |
| 312 | + self.whiteView.subviews.forEach { view in | |
| 313 | + if view.tag >= 1000{ | |
| 314 | + view.removeFromSuperview() | |
| 315 | + } | |
| 316 | + } | |
| 317 | + self.workProfessionTitleLabel.text = model.title.count > 0 ? model.title : "获奖名称" | |
| 318 | + self.workNameTitleLabel.isHidden = true | |
| 319 | + self.workPositionTitleLabel.text = model.company | |
| 320 | + | |
| 321 | + let startDateString = convertTimestampStringToDateString(timestampString: model.time) | |
| 322 | + if startDateString == nil || startDateString?.count == 0{ | |
| 323 | + self.workTimeTitleLabel.text = "" | |
| 324 | + self.workTimeTitleLabel.isHidden = true | |
| 325 | + }else{ | |
| 326 | + self.workTimeTitleLabel.text = startDateString! | |
| 327 | + self.workTimeTitleLabel.isHidden = false | |
| 328 | + | |
| 329 | + } | |
| 330 | + | |
| 331 | + self.jianjieLabel.text = model.description//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" | |
| 332 | + let lines = jianjieLabel.getRealLabelTextLines() | |
| 333 | + let height = jianjieLabel.qmui_lineHeight | |
| 334 | + if lines <= 2{ | |
| 335 | + self.expandBtn.isHidden = true | |
| 336 | + }else{ | |
| 337 | + self.expandBtn.isHidden = false | |
| 338 | + } | |
| 339 | + | |
| 340 | + if self.expandBtn.isSelected{ | |
| 341 | + //展开状态 | |
| 342 | + self.jianjieLabel.height = height*CGFloat(lines) | |
| 343 | + | |
| 344 | + }else{ | |
| 345 | + //收起状态 | |
| 346 | + if lines <= 2{ | |
| 347 | + //小于2行,按实际行数 | |
| 348 | + self.jianjieLabel.height = CGFloat(lines)*height | |
| 349 | + }else{ | |
| 350 | + //大于2行, 显示2行 | |
| 351 | + self.jianjieLabel.height = 2*height | |
| 352 | + } | |
| 353 | + } | |
| 354 | + | |
| 355 | + let imgArr = model.imgs.components(separatedBy: ",") | |
| 356 | + if imgArr.count > 0{ | |
| 357 | + for i in 0..<imgArr.count { | |
| 358 | + let imgGap:Float = 10 | |
| 359 | + let imgLeftGap:Float = 50 | |
| 360 | + let lie = i%3 | |
| 361 | + let hang = i/3 | |
| 362 | + 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))) | |
| 364 | + imgView.isUserInteractionEnabled = true | |
| 365 | + imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) | |
| 366 | + imgView.tag = 1000+i | |
| 367 | + imgView.contentMode = .center | |
| 368 | + let imgUrl = imgArr[i] | |
| 369 | + imgView.clipsToBounds = true | |
| 370 | + imgView.layer.cornerRadius = 5 | |
| 371 | + self.whiteView.addSubview(imgView) | |
| 372 | + | |
| 373 | + if imgUrl.contains("vitae_video_"){ | |
| 374 | + //是视频 | |
| 375 | + let thumbailImgUrl = "http://wjjtest.ys2.cnliveimg.com/802/mateCode/img/vitae_photo_0/2024/08/02/3977195366.jpg" | |
| 376 | + let vm = HeroBrowserVideoViewModule(thumbailImgUrl: thumbailImgUrl, videoUrl: imgUrl, provider: HeroNetworkImageProvider.shared, autoPlay: true) | |
| 377 | + self.images.append(vm) | |
| 378 | + imgView.kf.setImage(with: URL(string: thumbailImgUrl),placeholder: UIImage(color: UIColor.lightGray, size: imgView.size)) | |
| 379 | + | |
| 380 | + let playBtn = UIButton(type: .custom) | |
| 381 | + playBtn.frame = imgView.bounds | |
| 382 | + playBtn.setImage(UIImage(named: "short_video_play"), for: .normal) | |
| 383 | + playBtn.addTarget(self, action: #selector(playBtnAction(btn:)), for: .touchUpInside) | |
| 384 | + playBtn.clipsToBounds = true | |
| 385 | + playBtn.layer.cornerRadius = 5 | |
| 386 | + playBtn.tag = 1000+i | |
| 387 | + imgView.addSubview(playBtn) | |
| 388 | + }else if imgUrl.contains("vitae_photo_"){ | |
| 389 | + //是图片 | |
| 390 | + self.images.append(HeroBrowserNetworkImageViewModule(thumbailImgUrl: nil, originImgUrl: imgUrl)) | |
| 391 | + imgView.kf.setImage(with: URL(string: imgUrl)) | |
| 392 | + }else{ | |
| 393 | + //默认图片 | |
| 394 | + self.images.append(HeroBrowserNetworkImageViewModule(thumbailImgUrl: nil, originImgUrl: imgUrl)) | |
| 395 | + imgView.kf.setImage(with: URL(string: imgUrl)) | |
| 396 | + } | |
| 397 | + } | |
| 398 | + } | |
| 399 | + | |
| 400 | + self.workDingWeiTitleLabel.isHidden = true | |
| 401 | + self.dingweiImgView.isHidden = true | |
| 402 | + self.zhengshuBtn.setTitle("关联获奖", for: .normal) | |
| 403 | + self.nameIconImgView.image = UIImage(named: "mine_jianli_preview_award") | |
| 404 | + } | |
| 405 | + func setupNewUI(model:CNLiveVitaeWorksModel){ | |
| 406 | + | |
| 407 | + self.zhengshuNoIconImgView.isHidden = true | |
| 408 | + self.zhengshuNoDescTitleLabel.isHidden = true | |
| 409 | + | |
| 410 | + self.whiteView.subviews.forEach { view in | |
| 411 | + if view.tag >= 1000{ | |
| 412 | + view.removeFromSuperview() | |
| 413 | + } | |
| 414 | + } | |
| 415 | + self.workProfessionTitleLabel.text = model.profession.count > 0 ? model.profession : "行业" | |
| 416 | + self.workNameTitleLabel.text = model.position.count > 0 ? model.position : "职位" | |
| 417 | + self.workPositionTitleLabel.text = model.companyName | |
| 418 | + | |
| 419 | + let startDateString = convertTimestampStringToDateString(timestampString: model.startWorkingDate) | |
| 420 | + let endDateString = convertTimestampStringToDateString(timestampString: model.endWorkingDate) | |
| 421 | + if endDateString == nil || endDateString?.count == 0{ | |
| 422 | + if startDateString == nil || startDateString?.count == 0{ | |
| 423 | + self.workTimeTitleLabel.text = "" | |
| 424 | + }else{ | |
| 425 | + self.workTimeTitleLabel.text = startDateString! | |
| 426 | + } | |
| 427 | + }else{ | |
| 428 | + if startDateString == nil || startDateString?.count == 0{ | |
| 429 | + self.workTimeTitleLabel.text = "" | |
| 430 | + }else{ | |
| 431 | + self.workTimeTitleLabel.text = startDateString!+"~"+endDateString! | |
| 432 | + } | |
| 433 | + } | |
| 434 | + | |
| 435 | + self.jianjieLabel.text = model.jobDuties//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" | |
| 436 | + let lines = jianjieLabel.getRealLabelTextLines() | |
| 437 | + let height = jianjieLabel.qmui_lineHeight | |
| 438 | + if lines <= 2{ | |
| 439 | + self.expandBtn.isHidden = true | |
| 440 | + }else{ | |
| 441 | + self.expandBtn.isHidden = false | |
| 442 | + } | |
| 443 | + | |
| 444 | + if self.expandBtn.isSelected{ | |
| 445 | + //展开状态 | |
| 446 | + self.jianjieLabel.height = height*CGFloat(lines) | |
| 447 | + | |
| 448 | + }else{ | |
| 449 | + //收起状态 | |
| 450 | + if lines <= 2{ | |
| 451 | + //小于2行,按实际行数 | |
| 452 | + self.jianjieLabel.height = CGFloat(lines)*height | |
| 453 | + }else{ | |
| 454 | + //大于2行, 显示2行 | |
| 455 | + self.jianjieLabel.height = 2*height | |
| 456 | + } | |
| 457 | + } | |
| 458 | + | |
| 459 | + let imgArr = model.imgs.components(separatedBy: ",") | |
| 460 | + if imgArr.count > 0{ | |
| 461 | + for i in 0..<imgArr.count { | |
| 462 | + let imgGap:Float = 10 | |
| 463 | + let imgLeftGap:Float = 50 | |
| 464 | + let lie = i%3 | |
| 465 | + let hang = i/3 | |
| 466 | + 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))) | |
| 468 | + imgView.isUserInteractionEnabled = true | |
| 469 | + imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) | |
| 470 | + imgView.tag = 1000+i | |
| 471 | + imgView.contentMode = .center | |
| 472 | + let imgUrl = imgArr[i] | |
| 473 | + imgView.clipsToBounds = true | |
| 474 | + imgView.layer.cornerRadius = 5 | |
| 475 | + self.whiteView.addSubview(imgView) | |
| 476 | + | |
| 477 | + if imgUrl.contains("vitae_video_"){ | |
| 478 | + //是视频 | |
| 479 | + let thumbailImgUrl = "http://wjjtest.ys2.cnliveimg.com/802/mateCode/img/vitae_photo_0/2024/08/02/3977195366.jpg" | |
| 480 | + let vm = HeroBrowserVideoViewModule(thumbailImgUrl: thumbailImgUrl, videoUrl: imgUrl, provider: HeroNetworkImageProvider.shared, autoPlay: true) | |
| 481 | + self.images.append(vm) | |
| 482 | + imgView.kf.setImage(with: URL(string: thumbailImgUrl),placeholder: UIImage(color: UIColor.lightGray, size: imgView.size)) | |
| 483 | + | |
| 484 | + let playBtn = UIButton(type: .custom) | |
| 485 | + playBtn.frame = imgView.bounds | |
| 486 | + playBtn.setImage(UIImage(named: "short_video_play"), for: .normal) | |
| 487 | + playBtn.addTarget(self, action: #selector(playBtnAction(btn:)), for: .touchUpInside) | |
| 488 | + playBtn.clipsToBounds = true | |
| 489 | + playBtn.layer.cornerRadius = 5 | |
| 490 | + playBtn.tag = 1000+i | |
| 491 | + imgView.addSubview(playBtn) | |
| 492 | + }else if imgUrl.contains("vitae_photo_"){ | |
| 493 | + //是图片 | |
| 494 | + self.images.append(HeroBrowserNetworkImageViewModule(thumbailImgUrl: nil, originImgUrl: imgUrl)) | |
| 495 | + imgView.kf.setImage(with: URL(string: imgUrl)) | |
| 496 | + }else{ | |
| 497 | + //默认图片 | |
| 498 | + self.images.append(HeroBrowserNetworkImageViewModule(thumbailImgUrl: nil, originImgUrl: imgUrl)) | |
| 499 | + imgView.kf.setImage(with: URL(string: imgUrl)) | |
| 500 | + } | |
| 501 | + } | |
| 502 | + } | |
| 503 | + | |
| 504 | + let cityStr = model.city | |
| 505 | + if cityStr.count == 0 || cityStr == "请选择"{ | |
| 506 | + self.workDingWeiTitleLabel.isHidden = true | |
| 507 | + self.dingweiImgView.isHidden = true | |
| 508 | + }else{ | |
| 509 | + self.dingweiImgView.isHidden = false | |
| 510 | + self.workDingWeiTitleLabel.isHidden = false | |
| 511 | + self.workDingWeiTitleLabel.text = model.city | |
| 512 | + } | |
| 513 | + } | |
| 514 | + | |
| 515 | + func convertTimestampStringToDateString(timestampString: String) -> String? { | |
| 516 | + // 首先,将毫秒时间戳字符串转换为TimeInterval(秒) | |
| 517 | + guard let timestampMilliseconds = Double(timestampString) else { | |
| 518 | + return nil | |
| 519 | + } | |
| 520 | + let timestampSeconds = timestampMilliseconds / 1000.0 | |
| 521 | + // 然后,将TimeInterval转换为Date对象 | |
| 522 | + let date = Date(timeIntervalSince1970: timestampSeconds) | |
| 523 | + // 接着,设置DateFormatter的格式 | |
| 524 | + let formatter = DateFormatter() | |
| 525 | + formatter.dateFormat = "yyyy.MM.dd" // 设置为你想要的日期格式 | |
| 526 | + // 最后,使用DateFormatter将Date对象格式化为字符串 | |
| 527 | + return formatter.string(from: date) | |
| 528 | + } | |
| 99 | 529 | |
| 530 | + // MARK: - Action | |
| 531 | + @objc func expandBtnAction(button:UIButton){ | |
| 532 | + button.isSelected = !button.isSelected | |
| 533 | + let lines = jianjieLabel.getRealLabelTextLines() | |
| 534 | + let height = jianjieLabel.qmui_lineHeight | |
| 535 | + | |
| 536 | + if button.isSelected{ | |
| 537 | + //文本收起状态,点击展开 | |
| 538 | + self.jianjieLabel.height = CGFloat(lines)*height | |
| 539 | + }else{ | |
| 540 | + //文本展开状态,点击收起 | |
| 541 | + self.jianjieLabel.height = 2*height | |
| 542 | + } | |
| 543 | + self.vitaePreviewWorkCellChangedBlock!(self, self.jianjieLabel.height) | |
| 544 | + | |
| 545 | + self.expandBtn.top = self.jianjieLabel.bottom | |
| 546 | + | |
| 547 | + } | |
| 548 | + @objc func zhengshuBtnAction(){ | |
| 549 | + if self.workMdl != nil{ | |
| 550 | + //跳转 选择工作记录页面 | |
| 551 | + | |
| 552 | + }else if self.awardModel != nil{ | |
| 553 | + //跳转 选择获奖情况页面 | |
| 554 | + | |
| 555 | + }else{ | |
| 556 | + | |
| 557 | + } | |
| 558 | + | |
| 559 | + } | |
| 560 | + @objc func playBtnAction(btn:UIButton){ | |
| 561 | + let index = btn.tag-1000 | |
| 562 | + self.vitaeWorkPreviewVideoPhotoBlock?(self.images, index) | |
| 563 | + } | |
| 564 | + @objc func imgViewTapAciton(ges: UITapGestureRecognizer){ | |
| 565 | + let imgView = ges.view as! UIImageView | |
| 566 | + let index = imgView.tag-1000 | |
| 567 | + | |
| 568 | + self.vitaeWorkPreviewVideoPhotoBlock?(self.images, index) | |
| 100 | 569 | } |
| 101 | 570 | |
| 102 | 571 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewSixCell.swift
| ... | ... | @@ -9,8 +9,24 @@ import Foundation |
| 9 | 9 | import Kingfisher |
| 10 | 10 | import SnapKit |
| 11 | 11 | |
| 12 | +//cell高度变化 | |
| 13 | +typealias vitaePreviewSixCellChangedBlockActionBlock = (_ cell: CNLiveDigitalResumePreviewSixCell ,_ cellHeight:CGFloat) -> Void | |
| 14 | + | |
| 12 | 15 | class CNLiveDigitalResumePreviewSixCell: UITableViewCell { |
| 13 | - | |
| 16 | + var vitaePreviewSixCellChangedBlock:vitaePreviewSixCellChangedBlockActionBlock? | |
| 17 | + | |
| 18 | + //_vitaeMdl | |
| 19 | + var _vitaeMdl : CNLiveVitaeModel? | |
| 20 | + var vitaeMdl : CNLiveVitaeModel? { | |
| 21 | + get{ | |
| 22 | + _vitaeMdl | |
| 23 | + } | |
| 24 | + set{ | |
| 25 | + _vitaeMdl = newValue! | |
| 26 | + setupNewUI(model: _vitaeMdl!) | |
| 27 | + } | |
| 28 | + } | |
| 29 | + | |
| 14 | 30 | lazy var whiteView :UIView = { |
| 15 | 31 | let whiteView = UIView(frame: CGRect(x: 15, y:15, width: KSreenWidth-30, height: DefaultPreViewCellHeight)) |
| 16 | 32 | whiteView.backgroundColor = .white |
| ... | ... | @@ -26,7 +42,46 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { |
| 26 | 42 | titleLabel.font = BoldFont_16 |
| 27 | 43 | return titleLabel |
| 28 | 44 | }() |
| 45 | + lazy var nameIconImgView :UIImageView = { | |
| 46 | + let iconImgView = UIImageView(frame: CGRect(x: 15, y: 0, width: 25, height: 25)) | |
| 47 | + iconImgView.contentMode = .scaleAspectFit | |
| 48 | + iconImgView.image = UIImage(named: "mine_jianli_preview_jianjie") | |
| 49 | + return iconImgView | |
| 50 | + }() | |
| 51 | + ///工作内容描述 | |
| 52 | + lazy var jianjieLabel: UILabel = { | |
| 53 | + let titleLabel = UILabel.init(frame: CGRectMake(50, 162, KSreenWidth-60, 40)) | |
| 54 | + titleLabel.textColor = HexColor("#999999") | |
| 55 | + titleLabel.textAlignment = .left | |
| 56 | + titleLabel.font = Font_14 | |
| 57 | + titleLabel.backgroundColor = .clear// UIColor(red:0.98, green:0.98, blue:0.98, alpha:1.00) | |
| 58 | + titleLabel.text = "" | |
| 59 | + titleLabel.numberOfLines = 0 | |
| 60 | + var lines = titleLabel.getRealLabelTextLines() | |
| 61 | + let height = titleLabel.qmui_lineHeight | |
| 62 | + if lines > 2 { | |
| 63 | + lines = 2 | |
| 64 | + } | |
| 65 | + titleLabel.height = height*CGFloat(lines) | |
| 66 | + return titleLabel | |
| 67 | + }() | |
| 68 | + //展开,收起 | |
| 69 | + lazy var expandBtn: UIButton = { | |
| 70 | + let expandBtn = UIButton.init(type: .custom) | |
| 71 | + expandBtn.backgroundColor = .clear | |
| 72 | + | |
| 73 | + expandBtn.frame = CGRect(x: self.jianjieLabel.right-60, y: self.jianjieLabel.bottom+10, width: 60, height: 30) | |
| 74 | + expandBtn.setTitle("更多", for: .normal) | |
| 75 | + expandBtn.setTitle("收起", for: .selected) | |
| 29 | 76 | |
| 77 | + expandBtn.setTitleColor(HexColor("#1B64FE"), for: .normal) | |
| 78 | + expandBtn.setImage(UIImage(named: "homepage_unfold"), for: .normal) | |
| 79 | + expandBtn.setImage(UIImage(named: "homepage_fold"), for: .selected) | |
| 80 | + expandBtn.titleLabel?.font = Font_14 | |
| 81 | + expandBtn.setupButtonImageAndTitlePossitionWith(padding: 5, style: .right) | |
| 82 | + expandBtn.addTarget(self, action: #selector(expandBtnAction), for: .touchUpInside) | |
| 83 | + return expandBtn | |
| 84 | + }() | |
| 30 | 85 | lazy var zhengshuNoDescTitleLabel: UILabel = { |
| 31 | 86 | let titleLabel = UILabel() |
| 32 | 87 | titleLabel.textColor = HexColor("#999999") |
| ... | ... | @@ -62,12 +117,38 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { |
| 62 | 117 | self.selectionStyle = .none |
| 63 | 118 | |
| 64 | 119 | self.contentView.addSubview(self.whiteView) |
| 120 | + self.whiteView.snp.makeConstraints { make in | |
| 121 | + make.top.equalTo(15) | |
| 122 | + make.bottom.equalToSuperview() | |
| 123 | + make.left.equalTo(15) | |
| 124 | + make.right.equalToSuperview().offset(-15) | |
| 125 | + } | |
| 126 | + | |
| 65 | 127 | self.whiteView.addSubview(self.myIdentityTitleLabel) |
| 66 | 128 | self.myIdentityTitleLabel.snp.makeConstraints { make in |
| 67 | 129 | make.top.equalToSuperview().offset(adapt_length(length: 15)) |
| 68 | 130 | make.left.equalTo(adapt_length(length: 15)) |
| 69 | 131 | } |
| 70 | - | |
| 132 | + self.whiteView.addSubview(self.nameIconImgView) | |
| 133 | + self.nameIconImgView.snp.makeConstraints { make in | |
| 134 | + make.top.equalTo(self.myIdentityTitleLabel.snp.bottom).offset(15) | |
| 135 | + make.left.equalTo(15) | |
| 136 | + make.width.height.equalTo(25) | |
| 137 | + } | |
| 138 | + self.whiteView.addSubview(self.jianjieLabel) | |
| 139 | + self.jianjieLabel.snp.makeConstraints { make in | |
| 140 | + make.top.equalTo(self.nameIconImgView.snp.top) | |
| 141 | + make.left.equalTo(self.nameIconImgView.snp.right).offset(10) | |
| 142 | + make.right.equalToSuperview().offset(-20) | |
| 143 | + } | |
| 144 | + self.whiteView.addSubview(self.expandBtn) | |
| 145 | + | |
| 146 | + let lines = jianjieLabel.getRealLabelTextLines() | |
| 147 | + if lines <= 2{ | |
| 148 | + self.expandBtn.isHidden = true | |
| 149 | + }else{ | |
| 150 | + self.expandBtn.isHidden = false | |
| 151 | + } | |
| 71 | 152 | self.whiteView.addSubview(self.zhengshuBtn) |
| 72 | 153 | self.zhengshuBtn.snp.makeConstraints { make in |
| 73 | 154 | make.centerX.equalToSuperview() |
| ... | ... | @@ -89,11 +170,62 @@ class CNLiveDigitalResumePreviewSixCell: UITableViewCell { |
| 89 | 170 | make.height.equalTo(45) |
| 90 | 171 | } |
| 91 | 172 | |
| 173 | + self.nameIconImgView.isHidden = true | |
| 174 | + self.jianjieLabel.isHidden = true | |
| 92 | 175 | } |
| 93 | 176 | required init?(coder: NSCoder) { |
| 94 | 177 | fatalError("init(coder:) has not been implemented") |
| 95 | 178 | } |
| 96 | 179 | |
| 180 | + func setupNewUI(model:CNLiveVitaeModel){ | |
| 181 | + self.zhengshuNoIconImgView.isHidden = true | |
| 182 | + self.zhengshuNoDescTitleLabel.isHidden = true | |
| 183 | + self.nameIconImgView.isHidden = false | |
| 184 | + self.jianjieLabel.isHidden = false | |
| 185 | + self.jianjieLabel.text = model.vitae?.selfIntroduction//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述"// | |
| 186 | + let lines = jianjieLabel.getRealLabelTextLines() | |
| 187 | + let height = jianjieLabel.qmui_lineHeight | |
| 188 | + if lines <= 2{ | |
| 189 | + self.expandBtn.isHidden = true | |
| 190 | + }else{ | |
| 191 | + self.expandBtn.isHidden = false | |
| 192 | + } | |
| 193 | + | |
| 194 | + if self.expandBtn.isSelected{ | |
| 195 | + //展开状态 | |
| 196 | + self.jianjieLabel.height = height*CGFloat(lines) | |
| 197 | + | |
| 198 | + }else{ | |
| 199 | + //收起状态 | |
| 200 | + if lines <= 2{ | |
| 201 | + //小于2行,按实际行数 | |
| 202 | + self.jianjieLabel.height = CGFloat(lines)*height | |
| 203 | + }else{ | |
| 204 | + //大于2行, 显示2行 | |
| 205 | + self.jianjieLabel.height = 2*height | |
| 206 | + } | |
| 207 | + } | |
| 208 | + } | |
| 209 | + | |
| 210 | + | |
| 211 | + // MARK: - Action | |
| 212 | + @objc func expandBtnAction(button:UIButton){ | |
| 213 | + button.isSelected = !button.isSelected | |
| 214 | + let lines = jianjieLabel.getRealLabelTextLines() | |
| 215 | + let height = jianjieLabel.qmui_lineHeight | |
| 216 | + | |
| 217 | + if button.isSelected{ | |
| 218 | + //文本收起状态,点击展开 | |
| 219 | + self.jianjieLabel.height = CGFloat(lines)*height | |
| 220 | + }else{ | |
| 221 | + //文本展开状态,点击收起 | |
| 222 | + self.jianjieLabel.height = 2*height | |
| 223 | + } | |
| 224 | + self.vitaePreviewSixCellChangedBlock!(self, self.jianjieLabel.bottom) | |
| 225 | + | |
| 226 | + self.expandBtn.top = self.jianjieLabel.bottom | |
| 227 | + | |
| 228 | + } | |
| 97 | 229 | @objc func zhengshuBtnAction(){ |
| 98 | 230 | //跳转 自我简介页面 |
| 99 | 231 | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreviewThreeCell.swift
| ... | ... | @@ -8,9 +8,23 @@ |
| 8 | 8 | import Foundation |
| 9 | 9 | import Kingfisher |
| 10 | 10 | import SnapKit |
| 11 | +import JFHeroBrowser | |
| 12 | + | |
| 13 | +var CerHaveDataPreViewCellHeight:CGFloat = 227 | |
| 11 | 14 | |
| 12 | 15 | class CNLiveDigitalResumePreviewThreeCell: UITableViewCell { |
| 13 | 16 | |
| 17 | + var _threeCerDataArray : [CNLiveVitaeCertificateModel]? | |
| 18 | + var threeCerDataArray : [CNLiveVitaeCertificateModel]? { | |
| 19 | + get{ | |
| 20 | + _threeCerDataArray | |
| 21 | + } | |
| 22 | + set{ | |
| 23 | + _threeCerDataArray = newValue! | |
| 24 | + setupNewUI(modelsArr: _threeCerDataArray!) | |
| 25 | + } | |
| 26 | + } | |
| 27 | + | |
| 14 | 28 | lazy var whiteView :UIView = { |
| 15 | 29 | let whiteView = UIView(frame: CGRect(x: 15, y:15, width: KSreenWidth-30, height: DefaultPreViewCellHeight)) |
| 16 | 30 | whiteView.backgroundColor = .white |
| ... | ... | @@ -62,6 +76,12 @@ class CNLiveDigitalResumePreviewThreeCell: UITableViewCell { |
| 62 | 76 | self.selectionStyle = .none |
| 63 | 77 | |
| 64 | 78 | self.contentView.addSubview(self.whiteView) |
| 79 | + self.whiteView.snp.makeConstraints { make in | |
| 80 | + make.top.equalTo(15) | |
| 81 | + make.bottom.equalToSuperview() | |
| 82 | + make.left.equalTo(15) | |
| 83 | + make.right.equalToSuperview().offset(-15) | |
| 84 | + } | |
| 65 | 85 | self.whiteView.addSubview(self.myIdentityTitleLabel) |
| 66 | 86 | self.myIdentityTitleLabel.snp.makeConstraints { make in |
| 67 | 87 | make.top.equalToSuperview().offset(adapt_length(length: 15)) |
| ... | ... | @@ -94,6 +114,51 @@ class CNLiveDigitalResumePreviewThreeCell: UITableViewCell { |
| 94 | 114 | fatalError("init(coder:) has not been implemented") |
| 95 | 115 | } |
| 96 | 116 | |
| 117 | + func setupNewUI(modelsArr:[CNLiveVitaeCertificateModel]){ | |
| 118 | + self.whiteView.subviews.forEach { view in | |
| 119 | + if view.tag >= 1000{ | |
| 120 | + view.removeFromSuperview() | |
| 121 | + } | |
| 122 | + } | |
| 123 | + if modelsArr.count > 0{ | |
| 124 | + //有 证书 | |
| 125 | + //计算几行 ,1行3个 | |
| 126 | + let totalHang:Int = modelsArr.count / 3 | |
| 127 | + if totalHang == 0{ | |
| 128 | + self.whiteView.height = CerHaveDataPreViewCellHeight | |
| 129 | + }else{ | |
| 130 | + self.whiteView.height = CerHaveDataPreViewCellHeight+CGFloat(totalHang*115) | |
| 131 | + } | |
| 132 | + self.zhengshuNoIconImgView.isHidden = true | |
| 133 | + self.zhengshuNoDescTitleLabel.isHidden = true | |
| 134 | + | |
| 135 | + for i in 0..<modelsArr.count { | |
| 136 | + let imgW:Float = Float((KSreenWidth-80-30)/3.0) | |
| 137 | + let imgH:Float = 101*imgW/85.0 | |
| 138 | + let imgGap:Float = 20 | |
| 139 | + let imgLeftGap:Float = 20 | |
| 140 | + let lie = i%3 | |
| 141 | + let hang = i/3 | |
| 142 | + let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgW)*Float(lie)), y: CGFloat((imgH+10)*Float(hang))+46, width: CGFloat(imgW), height: CGFloat(imgH))) | |
| 143 | + imgView.contentMode = .center | |
| 144 | + imgView.tag = 1000+i | |
| 145 | + let cerModel = modelsArr[i]//CNLiveVitaeCertificateModel | |
| 146 | + let imgUrl = cerModel.img | |
| 147 | + imgView.kf.setImage(with: URL(string: imgUrl)) | |
| 148 | + imgView.clipsToBounds = true | |
| 149 | + imgView.layer.cornerRadius = 5 | |
| 150 | + self.whiteView.addSubview(imgView) | |
| 151 | + | |
| 152 | + } | |
| 153 | + | |
| 154 | + }else{ | |
| 155 | + //没有 证书 | |
| 156 | + self.whiteView.height = DefaultPreViewCellHeight | |
| 157 | + self.zhengshuNoIconImgView.isHidden = false | |
| 158 | + self.zhengshuNoDescTitleLabel.isHidden = false | |
| 159 | + } | |
| 160 | + } | |
| 161 | + | |
| 97 | 162 | @objc func zhengshuBtnAction(){ |
| 98 | 163 | //跳转 选择证书页面 |
| 99 | 164 | ... | ... |
metaCode/Classes/Main/Model/Vitae/CNLiveViateWorkModelLayout.swift
| ... | ... | @@ -24,7 +24,7 @@ class CNLiveViateWorkModelLayout:NSObject{ |
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - init(model:CNLiveVitaeWorksModel,descH:Float){ | |
| 27 | + init(model:CNLiveVitaeWorksModel,descH:Float,isPreview:Bool){ | |
| 28 | 28 | super.init() |
| 29 | 29 | self.workModel = model |
| 30 | 30 | let imgArr = model.imgs.components(separatedBy: ",") |
| ... | ... | @@ -42,7 +42,7 @@ class CNLiveViateWorkModelLayout:NSObject{ |
| 42 | 42 | }else{ |
| 43 | 43 | hang = 0 |
| 44 | 44 | } |
| 45 | - let imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) | |
| 45 | + var imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) | |
| 46 | 46 | var cityH:Float = 35 |
| 47 | 47 | let cityStr = model.city |
| 48 | 48 | if cityStr.count == 0 || cityStr == "请选择"{ |
| ... | ... | @@ -50,7 +50,12 @@ class CNLiveViateWorkModelLayout:NSObject{ |
| 50 | 50 | }else{ |
| 51 | 51 | cityH = 35 |
| 52 | 52 | } |
| 53 | - _workModel?.cellH = Float(123)+descH+Float(hang*imgWH)+cityH+55 | |
| 53 | + if isPreview == false{//工作记录详情页 | |
| 54 | + _workModel?.cellH = Float(123)+descH+Float(hang*imgWH)+cityH+55 | |
| 55 | + }else{//预览工作记录 | |
| 56 | + imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) | |
| 57 | + _workModel?.cellH = Float(162)+descH+Float(hang*imgWH)+cityH+55 | |
| 58 | + } | |
| 54 | 59 | } |
| 55 | 60 | func getCellHModel()->CNLiveVitaeWorksModel{ |
| 56 | 61 | return _workModel! |
| ... | ... | @@ -76,7 +81,7 @@ class CNLiveViateAwardModelLayout:NSObject{ |
| 76 | 81 | } |
| 77 | 82 | } |
| 78 | 83 | |
| 79 | - init(model:CNLiveVitaeAwardsModel,descH:Float){ | |
| 84 | + init(model:CNLiveVitaeAwardsModel,descH:Float,isPreview:Bool){ | |
| 80 | 85 | super.init() |
| 81 | 86 | self.awardModel = model |
| 82 | 87 | let imgArr = model.imgs.components(separatedBy: ",") |
| ... | ... | @@ -94,8 +99,13 @@ class CNLiveViateAwardModelLayout:NSObject{ |
| 94 | 99 | }else{ |
| 95 | 100 | hang = 0 |
| 96 | 101 | } |
| 97 | - let imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) | |
| 98 | - _awardModel?.cellH = Float(123)+descH+Float(hang*imgWH)+55 | |
| 102 | + var imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) | |
| 103 | + if isPreview == false{//获奖详情页 | |
| 104 | + _awardModel?.cellH = Float(123)+descH+Float(hang*imgWH)+55 | |
| 105 | + }else{//预览获奖 | |
| 106 | + imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) | |
| 107 | + _awardModel?.cellH = Float(162)+descH+Float(hang*imgWH)+55 | |
| 108 | + } | |
| 99 | 109 | } |
| 100 | 110 | func getCellHModel()->CNLiveVitaeAwardsModel{ |
| 101 | 111 | return _awardModel! | ... | ... |
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_award.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_jianli_preview_award@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_jianli_preview_award@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_award.imageset/mine_jianli_preview_award@2x.png
0 → 100644
1.86 KB
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_award.imageset/mine_jianli_preview_award@3x.png
0 → 100644
3.39 KB
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_jianjie.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_jianli_preview_jianjie@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_jianli_preview_jianjie@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_jianjie.imageset/mine_jianli_preview_jianjie@2x.png
0 → 100644
1.39 KB
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_jianjie.imageset/mine_jianli_preview_jianjie@3x.png
0 → 100644
2.63 KB
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_work.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "mine_jianli_preview_work@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "mine_jianli_preview_work@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_work.imageset/mine_jianli_preview_work@2x.png
0 → 100644
1.28 KB
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_preview_work.imageset/mine_jianli_preview_work@3x.png
0 → 100644
2.26 KB