Commit 6fc3e7048d60331425837ef9eba127d5281846ea
1 parent
7e4fc3fe
* [x] 工作记录列表页-开始时间 结束时间 没有了(看改没改新增工作和获奖接口 或者是否隐藏 ,看提交时判断必传的信息没有提示请填写)
* [x] 工作记录列表页-没有定位时 , cellH不对(得判断是否有更多) * [x] 新增获奖情况-添加描述 ,但是列表页不显示 * [x] 新增获奖情况-编辑一次描述后 , 就不显示了
Showing
8 changed files
with
269 additions
and
177 deletions
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeAddWorkController.swift
| @@ -42,7 +42,8 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -42,7 +42,8 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 42 | var seleArr:Array<String>? | 42 | var seleArr:Array<String>? |
| 43 | var seleVideoUrl:String = "" | 43 | var seleVideoUrl:String = "" |
| 44 | 44 | ||
| 45 | - var isFirstEdit = true | 45 | + var isFirstEdit = true//是否 第一次进入编辑 |
| 46 | +// var isAddWorkAward = true//是否 新增 | ||
| 46 | //简历workModel | 47 | //简历workModel |
| 47 | var _workModel : CNLiveVitaeWorksModel? | 48 | var _workModel : CNLiveVitaeWorksModel? |
| 48 | var workModel : CNLiveVitaeWorksModel? { | 49 | var workModel : CNLiveVitaeWorksModel? { |
| @@ -193,6 +194,12 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -193,6 +194,12 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 193 | } | 194 | } |
| 194 | if self.workModel != nil{ | 195 | if self.workModel != nil{ |
| 195 | cell.workModel = self.workModel! | 196 | cell.workModel = self.workModel! |
| 197 | + }else{ | ||
| 198 | + if cell.isUpdated == false{//没更新过 初始化 | ||
| 199 | + cell.workModel = CNLiveVitaeWorksModel() | ||
| 200 | + }else{ | ||
| 201 | + | ||
| 202 | + } | ||
| 196 | } | 203 | } |
| 197 | }else{ | 204 | }else{ |
| 198 | cell.workAwardType = .award | 205 | cell.workAwardType = .award |
| @@ -212,6 +219,12 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -212,6 +219,12 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 212 | } | 219 | } |
| 213 | if self.awardModel != nil{ | 220 | if self.awardModel != nil{ |
| 214 | cell.awardModel = self.awardModel! | 221 | cell.awardModel = self.awardModel! |
| 222 | + }else{ | ||
| 223 | + if cell.isUpdated == false{//没更新过 初始化 | ||
| 224 | + cell.awardModel = CNLiveVitaeAwardsModel() | ||
| 225 | + }else{ | ||
| 226 | + | ||
| 227 | + } | ||
| 215 | } | 228 | } |
| 216 | } | 229 | } |
| 217 | 230 | ||
| @@ -224,15 +237,36 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -224,15 +237,36 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 224 | return cell | 237 | return cell |
| 225 | } | 238 | } |
| 226 | if self.workAwardType == .work{ | 239 | if self.workAwardType == .work{ |
| 227 | - | 240 | + cell.workAwardType = .work |
| 228 | if self.workModel != nil && self.isFirstEdit == true{ | 241 | if self.workModel != nil && self.isFirstEdit == true{ |
| 229 | cell.workModel = self.workModel! | 242 | cell.workModel = self.workModel! |
| 230 | self.isFirstEdit = false | 243 | self.isFirstEdit = false |
| 244 | + }else{ | ||
| 245 | + if self.workModel != nil{ | ||
| 246 | + | ||
| 247 | + }else{ | ||
| 248 | + if cell.isUpdated == false{//没更新过 | ||
| 249 | + cell.clearWorkLocalData() | ||
| 250 | + }else{ | ||
| 251 | + | ||
| 252 | + } | ||
| 253 | + } | ||
| 231 | } | 254 | } |
| 232 | }else{ | 255 | }else{ |
| 256 | + cell.workAwardType = .award | ||
| 233 | if self.awardModel != nil && self.isFirstEdit == true{ | 257 | if self.awardModel != nil && self.isFirstEdit == true{ |
| 234 | cell.awardModel = self.awardModel! | 258 | cell.awardModel = self.awardModel! |
| 235 | self.isFirstEdit = false | 259 | self.isFirstEdit = false |
| 260 | + }else{ | ||
| 261 | + if self.awardModel != nil{ | ||
| 262 | + | ||
| 263 | + }else{ | ||
| 264 | + if cell.isUpdated == false{//没更新过 | ||
| 265 | + cell.clearAwardLocalData() | ||
| 266 | + }else{ | ||
| 267 | + | ||
| 268 | + } | ||
| 269 | + } | ||
| 236 | } | 270 | } |
| 237 | } | 271 | } |
| 238 | cell.uploadImageSuceessBlock = { imageUrl in | 272 | cell.uploadImageSuceessBlock = { imageUrl in |
| @@ -337,33 +371,35 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -337,33 +371,35 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 337 | @objc func addWorkBtnAction() { | 371 | @objc func addWorkBtnAction() { |
| 338 | 372 | ||
| 339 | if self.workAwardType == .work{ | 373 | if self.workAwardType == .work{ |
| 340 | - let firCell = self.tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? CNLiveVitaeAddWorkFirCell | ||
| 341 | - let secCell = self.tableView.cellForRow(at: IndexPath(row: 1, section: 0)) as? CNLiveVitaeAddWorkSecCell | ||
| 342 | - let threeCell = self.tableView.cellForRow(at: IndexPath(row: 2, section: 0)) as? CNLiveVitaeAddWorkThreeCell | 374 | + |
| 375 | + let firProfession = UserDefaults.standard.string(forKey: CNLiveVitaeAddWorkFirCellprofession) | ||
| 376 | + let firPosition = UserDefaults.standard.string(forKey: CNLiveVitaeAddWorkFirCellposition) | ||
| 377 | + let firStart = UserDefaults.standard.string(forKey: CNLiveVitaeAddWorkFirCellstartWorkingDate) | ||
| 378 | + let firEnd = UserDefaults.standard.string(forKey: CNLiveVitaeAddWorkFirCellendWorkingDate) | ||
| 379 | + | ||
| 380 | + let secJobDuties = UserDefaults.standard.string(forKey: CNLiveVitaeAddWorkSecCelljobDuties) | ||
| 343 | 381 | ||
| 382 | + let threeCompany = UserDefaults.standard.string(forKey: CNLiveVitaeAddWorktThreeCellCompany) | ||
| 383 | + let threeCity = UserDefaults.standard.string(forKey: CNLiveVitaeAddWorktThreeCellCity) | ||
| 384 | + | ||
| 344 | //判断非空 | 385 | //判断非空 |
| 345 | - if firCell != nil{ | ||
| 346 | - if firCell?.weizhiRightTitleLabel.text?.count == 0 || firCell?.weizhiRightTitleLabel.text == "请选择"{ | ||
| 347 | - showMessage(message: "请选择职业") | ||
| 348 | - return | ||
| 349 | - } | ||
| 350 | - if firCell?.phoneTextFiled.text?.count == 0 || firCell?.phoneTextFiled.text == "请填写"{ | ||
| 351 | - showMessage(message: "请填写岗位名称") | ||
| 352 | - return | ||
| 353 | - } | ||
| 354 | - if firCell?.canjiaRightTitleLabel.text?.count == 0 || firCell?.canjiaRightTitleLabel.text == "请选择"{ | ||
| 355 | - showMessage(message: "请选择开始时间") | ||
| 356 | - return | ||
| 357 | - } | ||
| 358 | - if firCell?.endTimeRightTitleLabel.text?.count == 0 || firCell?.endTimeRightTitleLabel.text == "请选择"{ | ||
| 359 | - showMessage(message: "请选择结束时间") | ||
| 360 | - return | ||
| 361 | - } | ||
| 362 | - }else{ | ||
| 363 | - //fircell nil | ||
| 364 | - | 386 | + if firProfession?.count == 0 || firProfession == "请选择"{ |
| 387 | + showMessage(message: "请选择职业") | ||
| 388 | + return | ||
| 389 | + } | ||
| 390 | + if firPosition?.count == 0 || firPosition == "请填写"{ | ||
| 391 | + showMessage(message: "请填写岗位名称") | ||
| 392 | + return | ||
| 365 | } | 393 | } |
| 366 | - if secCell?.huoJiangtextView.text?.count == 0 || secCell?.huoJiangtextView.text == "描述"{ | 394 | + if firStart?.count == 0 || firStart == "请选择"{ |
| 395 | + showMessage(message: "请选择开始时间") | ||
| 396 | + return | ||
| 397 | + } | ||
| 398 | + if firEnd?.count == 0 || firEnd == "请选择"{ | ||
| 399 | + showMessage(message: "请选择结束时间") | ||
| 400 | + return | ||
| 401 | + } | ||
| 402 | + if secJobDuties?.count == 0 || secJobDuties == "描述"{ | ||
| 367 | showMessage(message: "请填写经历描述") | 403 | showMessage(message: "请填写经历描述") |
| 368 | return | 404 | return |
| 369 | } | 405 | } |
| @@ -389,74 +425,9 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -389,74 +425,9 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 389 | 425 | ||
| 390 | } | 426 | } |
| 391 | } | 427 | } |
| 392 | - var company = "" | ||
| 393 | - if threeCell != nil{ | ||
| 394 | - if threeCell?.phoneTextFiled.text?.count ?? 0 <= 0{ | ||
| 395 | - | ||
| 396 | - }else if threeCell?.phoneTextFiled.text == "请填写"{ | ||
| 397 | - | ||
| 398 | - }else{ | ||
| 399 | - company = threeCell?.phoneTextFiled.text ?? "" | ||
| 400 | - } | ||
| 401 | - }else{ | ||
| 402 | - company = self.threeCompanyStr | ||
| 403 | - } | ||
| 404 | - | ||
| 405 | - var workDiDian = "" | ||
| 406 | - if threeCell != nil{ | ||
| 407 | - if threeCell?.weizhiRightTitleLabel.text?.count ?? 0 <= 0{ | ||
| 408 | - | ||
| 409 | - }else if threeCell?.weizhiRightTitleLabel.text == "请选择"{ | ||
| 410 | - | ||
| 411 | - }else{ | ||
| 412 | - workDiDian = threeCell?.weizhiRightTitleLabel.text ?? "" | ||
| 413 | - } | ||
| 414 | - }else{ | ||
| 415 | - workDiDian = self.threeWorkDiDianStr | ||
| 416 | - } | ||
| 417 | - | ||
| 418 | - var gangWei = "" | ||
| 419 | - if firCell != nil{ | ||
| 420 | - if firCell?.phoneTextFiled.text?.count ?? 0 <= 0{ | ||
| 421 | - | ||
| 422 | - }else if firCell?.phoneTextFiled.text == "请填写"{ | ||
| 423 | - | ||
| 424 | - }else{ | ||
| 425 | - gangWei = firCell?.phoneTextFiled.text ?? "" | ||
| 426 | - } | ||
| 427 | - }else{ | ||
| 428 | - gangWei = self.firGangweiStr | ||
| 429 | - } | ||
| 430 | - if gangWei == "" || gangWei.count == 0{ | ||
| 431 | - showMessage(message: "请填写岗位") | ||
| 432 | - return | ||
| 433 | - } | ||
| 434 | - | ||
| 435 | - var zhiye = "" | ||
| 436 | - if firCell != nil{ | ||
| 437 | - if firCell?.weizhiRightTitleLabel.text?.count ?? 0 <= 0{ | ||
| 438 | - | ||
| 439 | - }else if firCell?.weizhiRightTitleLabel.text == "请选择"{ | ||
| 440 | - | ||
| 441 | - }else{ | ||
| 442 | - zhiye = firCell?.weizhiRightTitleLabel.text ?? "" | ||
| 443 | - } | ||
| 444 | - }else{ | ||
| 445 | - zhiye = self.firZhiyeStr | ||
| 446 | - } | ||
| 447 | - if zhiye == "" || zhiye.count == 0{ | ||
| 448 | - showMessage(message: "请选择职业") | ||
| 449 | - return | ||
| 450 | - } | 428 | + var company = threeCompany ?? "" |
| 429 | + var workDiDian = threeCity ?? "" | ||
| 451 | 430 | ||
| 452 | - var desc = "" | ||
| 453 | - if secCell?.huoJiangtextView.text?.count ?? 0 <= 0{ | ||
| 454 | - | ||
| 455 | - }else if secCell?.huoJiangtextView.text == "描述"{ | ||
| 456 | - | ||
| 457 | - }else{ | ||
| 458 | - desc = secCell?.huoJiangtextView.text ?? "" | ||
| 459 | - } | ||
| 460 | if let userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | 431 | if let userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ |
| 461 | let jianli_vitaeId = userDic["jianli_vitaeId"] as? String | 432 | let jianli_vitaeId = userDic["jianli_vitaeId"] as? String |
| 462 | let vsid = userDic["vsid"] as? String | 433 | let vsid = userDic["vsid"] as? String |
| @@ -468,7 +439,7 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -468,7 +439,7 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 468 | id = self.workModel!.id | 439 | id = self.workModel!.id |
| 469 | } | 440 | } |
| 470 | 441 | ||
| 471 | - CNLiveVitaeViewModel.saveWork(city: workDiDian, companyName: company, imgs: newString, jobDuties: desc, startWorkingDate:startTime ?? "" , endWorkingDate: endTime ?? "" , position: gangWei, profession: zhiye, vsid: vsid ?? "", vitaeId: jianli_vitaeId ?? "", id: id) { result, status in | 442 | + CNLiveVitaeViewModel.saveWork(city: workDiDian, companyName: company, imgs: newString, jobDuties: secJobDuties ?? "", startWorkingDate:firStart ?? "", endWorkingDate: firEnd ?? "", position: firPosition ?? "", profession: firProfession ?? "", vsid: vsid ?? "", vitaeId: jianli_vitaeId ?? "", id: id) { result, status in |
| 472 | if status == .success{ | 443 | if status == .success{ |
| 473 | self.navigationController?.popViewController(animated: true) | 444 | self.navigationController?.popViewController(animated: true) |
| 474 | // self.navigationController?.viewControllers.forEach({ item in | 445 | // self.navigationController?.viewControllers.forEach({ item in |
| @@ -481,27 +452,24 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -481,27 +452,24 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 481 | } | 452 | } |
| 482 | }else{ | 453 | }else{ |
| 483 | //获奖 | 454 | //获奖 |
| 484 | - if let firCell = self.tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? CNLiveVitaeAddWorkFirCell{ | ||
| 485 | - //判断非空 | ||
| 486 | - if firCell.phoneTextFiled.text?.count == 0 || firCell.phoneTextFiled.text == "请填写"{ | ||
| 487 | - showMessage(message: "请填写获奖名称") | ||
| 488 | - return | ||
| 489 | - } | ||
| 490 | - if firCell.canjiaRightTitleLabel.text?.count == 0 || firCell.canjiaRightTitleLabel.text == "请选择"{ | ||
| 491 | - showMessage(message: "请选择开始时间") | ||
| 492 | - return | ||
| 493 | - } | 455 | + let firTitle = UserDefaults.standard.string(forKey: CNLiveVitaeAddAwardFirCellTitle) |
| 456 | + let firTime = UserDefaults.standard.string(forKey: CNLiveVitaeAddAwardFirCellTime) | ||
| 457 | + let firCompany = UserDefaults.standard.string(forKey: CNLiveVitaeAddAwardFirCellCompany) | ||
| 494 | 458 | ||
| 495 | - }else{//firCell nil | ||
| 496 | - | 459 | + let secDescription = UserDefaults.standard.string(forKey: CNLiveVitaeAddAwardSecCellDescription) |
| 460 | + | ||
| 461 | + //判断非空 | ||
| 462 | + if firTitle?.count == 0 || firTitle == "请填写"{ | ||
| 463 | + showMessage(message: "请填写获奖名称") | ||
| 464 | + return | ||
| 497 | } | 465 | } |
| 498 | - if let secCell = self.tableView.cellForRow(at: IndexPath(row: 1, section: 0)) as? CNLiveVitaeAddWorkSecCell{ | ||
| 499 | - if secCell.huoJiangtextView.text?.count == 0 || secCell.huoJiangtextView.text == "描述"{ | ||
| 500 | - showMessage(message: "请填写描述") | ||
| 501 | - return | ||
| 502 | - } | ||
| 503 | - }else{//secCell nil | ||
| 504 | - | 466 | + if firTime?.count == 0 || firTime == "请选择"{ |
| 467 | + showMessage(message: "请选择开始时间") | ||
| 468 | + return | ||
| 469 | + } | ||
| 470 | + if secDescription?.count == 0 || secDescription == "描述"{ | ||
| 471 | + showMessage(message: "请填写描述") | ||
| 472 | + return | ||
| 505 | } | 473 | } |
| 506 | 474 | ||
| 507 | var newString = "" | 475 | var newString = "" |
| @@ -530,62 +498,13 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -530,62 +498,13 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 530 | let jianli_vitaeId = userDic["jianli_vitaeId"] as? String | 498 | let jianli_vitaeId = userDic["jianli_vitaeId"] as? String |
| 531 | let vsid = userDic["vsid"] as? String | 499 | let vsid = userDic["vsid"] as? String |
| 532 | 500 | ||
| 533 | - | ||
| 534 | - var awardName = "" | ||
| 535 | - if firCell != nil{ | ||
| 536 | - if firCell?.phoneTextFiled.text?.count ?? 0 <= 0{ | ||
| 537 | - | ||
| 538 | - }else if firCell?.phoneTextFiled.text == "请填写"{ | ||
| 539 | - | ||
| 540 | - }else{ | ||
| 541 | - awardName = firCell?.phoneTextFiled.text ?? "" | ||
| 542 | - if awardName.count == 0{ | ||
| 543 | - awardName = self.firAwardName | ||
| 544 | - } | ||
| 545 | - } | ||
| 546 | - }else{ | ||
| 547 | - awardName = self.firAwardName | ||
| 548 | - } | ||
| 549 | - | ||
| 550 | - var startTime = "" | ||
| 551 | - if firCell != nil{ | ||
| 552 | - startTime = self.convertDateStringToMillisecondsString(dateString: firCell?.canjiaRightTitleLabel.text ?? "") ?? "" | ||
| 553 | - if startTime.count == 0{ | ||
| 554 | - startTime = self.firAwardStart | ||
| 555 | - } | ||
| 556 | - }else{ | ||
| 557 | - startTime = self.firAwardStart | ||
| 558 | - } | ||
| 559 | //提交工作记录 | 501 | //提交工作记录 |
| 560 | var id = "" | 502 | var id = "" |
| 561 | if self.awardModel != nil{ | 503 | if self.awardModel != nil{ |
| 562 | id = self.awardModel!.id | 504 | id = self.awardModel!.id |
| 563 | } | 505 | } |
| 564 | - var danWei = "" | ||
| 565 | - if firCell != nil{ | ||
| 566 | - if firCell?.banfaTextFiled.text?.count ?? 0 <= 0{ | ||
| 567 | - | ||
| 568 | - }else if firCell?.banfaTextFiled.text == "请输入"{ | ||
| 569 | - | ||
| 570 | - }else{ | ||
| 571 | - danWei = firCell?.banfaTextFiled.text ?? "" | ||
| 572 | - if danWei.count == 0{ | ||
| 573 | - danWei = self.firAwardCompany | ||
| 574 | - } | ||
| 575 | - } | ||
| 576 | - }else{ | ||
| 577 | - danWei = self.firAwardCompany | ||
| 578 | - } | ||
| 579 | 506 | ||
| 580 | - var desc = "" | ||
| 581 | - if secCell?.huoJiangtextView.text?.count ?? 0 <= 0{ | ||
| 582 | - | ||
| 583 | - }else if secCell?.huoJiangtextView.text == "描述"{ | ||
| 584 | - | ||
| 585 | - }else{ | ||
| 586 | - desc = secCell?.huoJiangtextView.text ?? "" | ||
| 587 | - } | ||
| 588 | - CNLiveVitaeViewModel.saveAward(company: danWei, description: desc, time: startTime, title: awardName, imgs: newString, vsid: vsid ?? "", vitaeId: jianli_vitaeId ?? "", id: id) { result, status in | 507 | + CNLiveVitaeViewModel.saveAward(company: firCompany ?? "", description: secDescription ?? "", time: firTime ?? "", title: firTitle ?? "", imgs: newString, vsid: vsid ?? "", vitaeId: jianli_vitaeId ?? "", id: id) { result, status in |
| 589 | if status == .success{ | 508 | if status == .success{ |
| 590 | self.navigationController?.popViewController(animated: true) | 509 | self.navigationController?.popViewController(animated: true) |
| 591 | // self.navigationController?.viewControllers.forEach({ item in | 510 | // self.navigationController?.viewControllers.forEach({ item in |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeWorkDetailController.swift
| @@ -157,11 +157,13 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -157,11 +157,13 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 157 | for (idx,mdl) in res.enumerated() { | 157 | for (idx,mdl) in res.enumerated() { |
| 158 | if idx == idxPath?.row{ | 158 | if idx == idxPath?.row{ |
| 159 | if self.workAwardType == .work{ | 159 | if self.workAwardType == .work{ |
| 160 | - let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight),isPreview: false, isExpand: isExpand, isShowExpand: true) | 160 | + let model = mdl as! CNLiveVitaeWorksModel |
| 161 | + let layout = CNLiveViateWorkModelLayout(model: model,descH: Float(jianjieHeight),isPreview: false, isExpand: isExpand, isShowExpand: true) | ||
| 161 | let newWorkModel = layout.getCellHModel() | 162 | let newWorkModel = layout.getCellHModel() |
| 162 | tempArr.append(newWorkModel) | 163 | tempArr.append(newWorkModel) |
| 163 | }else{ | 164 | }else{ |
| 164 | - let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight), isPreview: false, isExpand: isExpand, isShowExpand: true) | 165 | + let model = mdl as! CNLiveVitaeAwardsModel |
| 166 | + let layout = CNLiveViateAwardModelLayout(model: model,descH: Float(jianjieHeight), isPreview: false, isExpand: isExpand, isShowExpand: true) | ||
| 165 | let newWorkModel = layout.getCellHModel() | 167 | let newWorkModel = layout.getCellHModel() |
| 166 | tempArr.append(newWorkModel) | 168 | tempArr.append(newWorkModel) |
| 167 | } | 169 | } |
| @@ -206,6 +208,7 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -206,6 +208,7 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 206 | @objc func addWorkBtnAction(){ | 208 | @objc func addWorkBtnAction(){ |
| 207 | let vc = CNLiveVitaeAddWorkController() | 209 | let vc = CNLiveVitaeAddWorkController() |
| 208 | vc.workAwardType = self.workAwardType | 210 | vc.workAwardType = self.workAwardType |
| 211 | +// vc.isAddWorkAward = true | ||
| 209 | self.navigationController?.pushViewController(vc, animated: true) | 212 | self.navigationController?.pushViewController(vc, animated: true) |
| 210 | } | 213 | } |
| 211 | 214 |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkFirCell.swift
| @@ -13,11 +13,21 @@ typealias UpdateAddWorkFirCellBlock = (_ currentCell: CNLiveVitaeAddWorkFirCell? | @@ -13,11 +13,21 @@ typealias UpdateAddWorkFirCellBlock = (_ currentCell: CNLiveVitaeAddWorkFirCell? | ||
| 13 | 13 | ||
| 14 | typealias UpdateAddAwardFirCellBlock = (_ currentCell: CNLiveVitaeAddWorkFirCell? ,_ awardName:String ,_ start:String,_ company:String) -> Void | 14 | typealias UpdateAddAwardFirCellBlock = (_ currentCell: CNLiveVitaeAddWorkFirCell? ,_ awardName:String ,_ start:String,_ company:String) -> Void |
| 15 | 15 | ||
| 16 | +let CNLiveVitaeAddWorkFirCellprofession = "CNLiveVitaeAddWorkFirCellprofession" | ||
| 17 | +let CNLiveVitaeAddWorkFirCellposition = "CNLiveVitaeAddWorkFirCellposition" | ||
| 18 | +let CNLiveVitaeAddWorkFirCellstartWorkingDate = "CNLiveVitaeAddWorkFirCellstartWorkingDate" | ||
| 19 | +let CNLiveVitaeAddWorkFirCellendWorkingDate = "CNLiveVitaeAddWorkFirCellendWorkingDate" | ||
| 20 | + | ||
| 21 | +let CNLiveVitaeAddAwardFirCellTitle = "CNLiveVitaeAddAwardFirCellTitle" | ||
| 22 | +let CNLiveVitaeAddAwardFirCellCompany = "CNLiveVitaeAddAwardFirCellCompany" | ||
| 23 | +let CNLiveVitaeAddAwardFirCellTime = "CNLiveVitaeAddAwardFirCellTime" | ||
| 24 | + | ||
| 16 | class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | 25 | class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ |
| 17 | var zhiyeStr:String = "" | 26 | var zhiyeStr:String = "" |
| 18 | var updateAddWorkFirCellBlock:UpdateAddWorkFirCellBlock? | 27 | var updateAddWorkFirCellBlock:UpdateAddWorkFirCellBlock? |
| 19 | var updateAddAwardFirCellBlock:UpdateAddAwardFirCellBlock? | 28 | var updateAddAwardFirCellBlock:UpdateAddAwardFirCellBlock? |
| 20 | var startStr:String = "" | 29 | var startStr:String = "" |
| 30 | + var isUpdated = false//是否 已经更新内容 | ||
| 21 | 31 | ||
| 22 | var _workAwardType:CNLiveViateWorkAwardType = .work | 32 | var _workAwardType:CNLiveViateWorkAwardType = .work |
| 23 | var workAwardType : CNLiveViateWorkAwardType { | 33 | var workAwardType : CNLiveViateWorkAwardType { |
| @@ -462,6 +472,28 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -462,6 +472,28 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 462 | if self.updateAddAwardFirCellBlock != nil{ | 472 | if self.updateAddAwardFirCellBlock != nil{ |
| 463 | self.updateAddAwardFirCellBlock?(self, self.phoneTextFiled.text ?? "", self.startStr, self.banfaTextFiled.text ?? "") | 473 | self.updateAddAwardFirCellBlock?(self, self.phoneTextFiled.text ?? "", self.startStr, self.banfaTextFiled.text ?? "") |
| 464 | } | 474 | } |
| 475 | + if self.workAwardType == .work{ | ||
| 476 | + if self.phoneTextFiled.text != "请选择"{ | ||
| 477 | + self.isUpdated = true | ||
| 478 | + UserDefaults.standard.setValue(self.phoneTextFiled.text ?? "", forKey: CNLiveVitaeAddWorkFirCellposition) | ||
| 479 | + UserDefaults.standard.synchronize() | ||
| 480 | + }else{ | ||
| 481 | + } | ||
| 482 | + }else{ | ||
| 483 | + if (textField == self.phoneTextFiled) && self.phoneTextFiled.text != "请填写"{ | ||
| 484 | + self.isUpdated = true | ||
| 485 | + UserDefaults.standard.setValue(self.phoneTextFiled.text ?? "", forKey: CNLiveVitaeAddAwardFirCellTitle) | ||
| 486 | + UserDefaults.standard.synchronize() | ||
| 487 | + }else{ | ||
| 488 | + } | ||
| 489 | + if (textField == self.banfaTextFiled) && self.banfaTextFiled.text != "请输入"{ | ||
| 490 | + self.isUpdated = true | ||
| 491 | + UserDefaults.standard.setValue(self.banfaTextFiled.text ?? "", forKey: CNLiveVitaeAddAwardFirCellCompany) | ||
| 492 | + UserDefaults.standard.synchronize() | ||
| 493 | + }else{ | ||
| 494 | + } | ||
| 495 | + } | ||
| 496 | + | ||
| 465 | } | 497 | } |
| 466 | 498 | ||
| 467 | @objc func zhiYeTapAction(){ | 499 | @objc func zhiYeTapAction(){ |
| @@ -473,6 +505,9 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -473,6 +505,9 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 473 | if self.updateAddWorkFirCellBlock != nil{ | 505 | if self.updateAddWorkFirCellBlock != nil{ |
| 474 | self.updateAddWorkFirCellBlock?(self, zhiyeStr, "", "", "") | 506 | self.updateAddWorkFirCellBlock?(self, zhiyeStr, "", "", "") |
| 475 | } | 507 | } |
| 508 | + self.isUpdated = true | ||
| 509 | + UserDefaults.standard.setValue(zhiyeStr, forKey: CNLiveVitaeAddWorkFirCellprofession) | ||
| 510 | + UserDefaults.standard.synchronize() | ||
| 476 | } | 511 | } |
| 477 | navigationViewController().pushViewController(vc, animated: true) | 512 | navigationViewController().pushViewController(vc, animated: true) |
| 478 | } | 513 | } |
| @@ -489,8 +524,20 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -489,8 +524,20 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 489 | self?.updateAddWorkFirCellBlock?(self ?? CNLiveVitaeAddWorkFirCell(), "", "", textStr, "") | 524 | self?.updateAddWorkFirCellBlock?(self ?? CNLiveVitaeAddWorkFirCell(), "", "", textStr, "") |
| 490 | } | 525 | } |
| 491 | if self?.updateAddAwardFirCellBlock != nil{ | 526 | if self?.updateAddAwardFirCellBlock != nil{ |
| 492 | - self?.updateAddAwardFirCellBlock?(self, self?.phoneTextFiled.text ?? "", self?.startStr ?? "", self?.banfaTextFiled.text ?? "") | 527 | + self?.updateAddAwardFirCellBlock?(self, self?.phoneTextFiled.text ?? "", textStr, self?.banfaTextFiled.text ?? "") |
| 528 | + } | ||
| 529 | + if self?.workAwardType == .work{ | ||
| 530 | + self?.isUpdated = true | ||
| 531 | + let start = self?.convertDateStringToMillisecondsString(dateString: textStr) | ||
| 532 | + UserDefaults.standard.setValue(start, forKey: CNLiveVitaeAddWorkFirCellstartWorkingDate) | ||
| 533 | + UserDefaults.standard.synchronize() | ||
| 534 | + }else{ | ||
| 535 | + self?.isUpdated = true | ||
| 536 | + let start = self?.convertDateStringToMillisecondsString(dateString: textStr) | ||
| 537 | + UserDefaults.standard.setValue(start, forKey: CNLiveVitaeAddAwardFirCellTime) | ||
| 538 | + UserDefaults.standard.synchronize() | ||
| 493 | } | 539 | } |
| 540 | + | ||
| 494 | }else{ | 541 | }else{ |
| 495 | self?.canjiaRightTitleLabel.text = "请选择" | 542 | self?.canjiaRightTitleLabel.text = "请选择" |
| 496 | self?.canjiaRightTitleLabel.textColor = HexColor("#B4B4B4") | 543 | self?.canjiaRightTitleLabel.textColor = HexColor("#B4B4B4") |
| @@ -508,6 +555,10 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -508,6 +555,10 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 508 | if self?.updateAddWorkFirCellBlock != nil{ | 555 | if self?.updateAddWorkFirCellBlock != nil{ |
| 509 | self?.updateAddWorkFirCellBlock?(self ?? CNLiveVitaeAddWorkFirCell(), "", "", "", textStr) | 556 | self?.updateAddWorkFirCellBlock?(self ?? CNLiveVitaeAddWorkFirCell(), "", "", "", textStr) |
| 510 | } | 557 | } |
| 558 | + self?.isUpdated = true | ||
| 559 | + let end = self?.convertDateStringToMillisecondsString(dateString: textStr) | ||
| 560 | + UserDefaults.standard.setValue(end, forKey: CNLiveVitaeAddWorkFirCellendWorkingDate) | ||
| 561 | + UserDefaults.standard.synchronize() | ||
| 511 | }else{ | 562 | }else{ |
| 512 | self?.endTimeRightTitleLabel.text = "请选择" | 563 | self?.endTimeRightTitleLabel.text = "请选择" |
| 513 | self?.endTimeRightTitleLabel.textColor = HexColor("#B4B4B4") | 564 | self?.endTimeRightTitleLabel.textColor = HexColor("#B4B4B4") |
| @@ -521,6 +572,9 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -521,6 +572,9 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 521 | let textStr = text | 572 | let textStr = text |
| 522 | self.endTimeRightTitleLabel.text = textStr | 573 | self.endTimeRightTitleLabel.text = textStr |
| 523 | self.endTimeRightTitleLabel.textColor = HexColor("#333333") | 574 | self.endTimeRightTitleLabel.textColor = HexColor("#333333") |
| 575 | + self.isUpdated = true | ||
| 576 | + UserDefaults.standard.setValue(textStr, forKey: CNLiveVitaeAddWorkFirCellendWorkingDate) | ||
| 577 | + UserDefaults.standard.synchronize() | ||
| 524 | }else{ | 578 | }else{ |
| 525 | self.endTimeRightTitleLabel.text = "请选择" | 579 | self.endTimeRightTitleLabel.text = "请选择" |
| 526 | self.endTimeRightTitleLabel.textColor = HexColor("#B4B4B4") | 580 | self.endTimeRightTitleLabel.textColor = HexColor("#B4B4B4") |
| @@ -531,9 +585,14 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -531,9 +585,14 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 531 | func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ | 585 | func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ |
| 532 | 586 | ||
| 533 | self.phoneTextFiled.text = model.title | 587 | self.phoneTextFiled.text = model.title |
| 588 | + UserDefaults.standard.setValue(model.title, forKey: CNLiveVitaeAddAwardFirCellTitle) | ||
| 534 | self.banfaTextFiled.text = model.company | 589 | self.banfaTextFiled.text = model.company |
| 535 | - | 590 | + UserDefaults.standard.setValue(model.company, forKey:CNLiveVitaeAddAwardFirCellCompany) |
| 591 | + | ||
| 536 | let start = self.convertMillisecondsStringToDateString(millisecondsString: model.time) | 592 | let start = self.convertMillisecondsStringToDateString(millisecondsString: model.time) |
| 593 | + UserDefaults.standard.setValue(model.time, forKey:CNLiveVitaeAddAwardFirCellTime) | ||
| 594 | + UserDefaults.standard.synchronize() | ||
| 595 | + | ||
| 537 | self.startStr = start ?? "" | 596 | self.startStr = start ?? "" |
| 538 | if start?.count ?? 0 > 0{ | 597 | if start?.count ?? 0 > 0{ |
| 539 | self.canjiaRightTitleLabel.text = start | 598 | self.canjiaRightTitleLabel.text = start |
| @@ -551,8 +610,12 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -551,8 +610,12 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 551 | //工作记录 | 610 | //工作记录 |
| 552 | func setupNewUI(model:CNLiveVitaeWorksModel){ | 611 | func setupNewUI(model:CNLiveVitaeWorksModel){ |
| 553 | self.weizhiRightTitleLabel.text = model.profession | 612 | self.weizhiRightTitleLabel.text = model.profession |
| 613 | + UserDefaults.standard.setValue(model.profession, forKey: CNLiveVitaeAddWorkFirCellprofession) | ||
| 614 | + | ||
| 554 | self.phoneTextFiled.text = model.position | 615 | self.phoneTextFiled.text = model.position |
| 555 | 616 | ||
| 617 | + UserDefaults.standard.setValue(model.position, forKey: CNLiveVitaeAddWorkFirCellposition) | ||
| 618 | + | ||
| 556 | let startStr = self.convertMillisecondsStringToDateString(millisecondsString: model.startWorkingDate) | 619 | let startStr = self.convertMillisecondsStringToDateString(millisecondsString: model.startWorkingDate) |
| 557 | if startStr?.count ?? 0 > 0{ | 620 | if startStr?.count ?? 0 > 0{ |
| 558 | self.canjiaRightTitleLabel.text = startStr | 621 | self.canjiaRightTitleLabel.text = startStr |
| @@ -561,6 +624,7 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -561,6 +624,7 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 561 | self.canjiaRightTitleLabel.text = "请选择" | 624 | self.canjiaRightTitleLabel.text = "请选择" |
| 562 | self.canjiaRightTitleLabel.textColor = HexColor("#B4B4B4") | 625 | self.canjiaRightTitleLabel.textColor = HexColor("#B4B4B4") |
| 563 | } | 626 | } |
| 627 | + UserDefaults.standard.setValue(model.startWorkingDate, forKey: CNLiveVitaeAddWorkFirCellstartWorkingDate) | ||
| 564 | 628 | ||
| 565 | let endStr = self.convertMillisecondsStringToDateString(millisecondsString: model.endWorkingDate) | 629 | let endStr = self.convertMillisecondsStringToDateString(millisecondsString: model.endWorkingDate) |
| 566 | if endStr?.count ?? 0 > 0{ | 630 | if endStr?.count ?? 0 > 0{ |
| @@ -570,6 +634,8 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -570,6 +634,8 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 570 | self.endTimeRightTitleLabel.text = "请选择" | 634 | self.endTimeRightTitleLabel.text = "请选择" |
| 571 | self.endTimeRightTitleLabel.textColor = HexColor("#B4B4B4") | 635 | self.endTimeRightTitleLabel.textColor = HexColor("#B4B4B4") |
| 572 | } | 636 | } |
| 637 | + UserDefaults.standard.setValue(model.endWorkingDate, forKey: CNLiveVitaeAddWorkFirCellendWorkingDate) | ||
| 638 | + UserDefaults.standard.synchronize() | ||
| 573 | 639 | ||
| 574 | if self.updateAddWorkFirCellBlock != nil{ | 640 | if self.updateAddWorkFirCellBlock != nil{ |
| 575 | self.updateAddWorkFirCellBlock?(self, model.profession, model.position, startStr ?? "", endStr ?? "") | 641 | self.updateAddWorkFirCellBlock?(self, model.profession, model.position, startStr ?? "", endStr ?? "") |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkSecCell.swift
| @@ -11,10 +11,13 @@ import SnapKit | @@ -11,10 +11,13 @@ import SnapKit | ||
| 11 | 11 | ||
| 12 | typealias UpdateAddWorkSecCellHeightBlock = (_ currentCell: CNLiveVitaeAddWorkSecCell ,_ uploadHeight:CGFloat) -> Void | 12 | typealias UpdateAddWorkSecCellHeightBlock = (_ currentCell: CNLiveVitaeAddWorkSecCell ,_ uploadHeight:CGFloat) -> Void |
| 13 | 13 | ||
| 14 | +let CNLiveVitaeAddWorkSecCelljobDuties = "CNLiveVitaeAddWorkSecCelljobDuties" | ||
| 15 | +let CNLiveVitaeAddAwardSecCellDescription = "CNLiveVitaeAddAwardSecCellDescription" | ||
| 16 | + | ||
| 14 | class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | 17 | class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ |
| 15 | var updateAddWorkSecCellHeightBlock:UpdateAddWorkSecCellHeightBlock? | 18 | var updateAddWorkSecCellHeightBlock:UpdateAddWorkSecCellHeightBlock? |
| 16 | var workAwardType:CNLiveViateWorkAwardType = .work | 19 | var workAwardType:CNLiveViateWorkAwardType = .work |
| 17 | - | 20 | + var isUpdated = false//是否 已经更新内容 |
| 18 | //简历workModel | 21 | //简历workModel |
| 19 | var _workModel : CNLiveVitaeWorksModel? | 22 | var _workModel : CNLiveVitaeWorksModel? |
| 20 | var workModel : CNLiveVitaeWorksModel? { | 23 | var workModel : CNLiveVitaeWorksModel? { |
| @@ -213,9 +216,16 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | @@ -213,9 +216,16 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | ||
| 213 | 216 | ||
| 214 | } | 217 | } |
| 215 | 218 | ||
| 219 | + func clearAwardLocalData(){ | ||
| 220 | + UserDefaults.standard.setValue("", forKey: CNLiveVitaeAddAwardSecCellDescription) | ||
| 221 | + UserDefaults.standard.synchronize() | ||
| 222 | + } | ||
| 216 | //获奖 | 223 | //获奖 |
| 217 | func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ | 224 | func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ |
| 218 | self.huoJiangtextView.text = model.description | 225 | self.huoJiangtextView.text = model.description |
| 226 | + UserDefaults.standard.setValue(model.description, forKey: CNLiveVitaeAddAwardSecCellDescription) | ||
| 227 | + UserDefaults.standard.synchronize() | ||
| 228 | + | ||
| 219 | self.huoJiangNumberLabel.text = "\(model.description.count)/1000" | 229 | self.huoJiangNumberLabel.text = "\(model.description.count)/1000" |
| 220 | let imgArr = model.imgs.components(separatedBy: ",") | 230 | let imgArr = model.imgs.components(separatedBy: ",") |
| 221 | var tempImgArr = Array<String>() | 231 | var tempImgArr = Array<String>() |
| @@ -230,8 +240,15 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | @@ -230,8 +240,15 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | ||
| 230 | self.selectUploadImageView?.networkImageArr = tempImgArr | 240 | self.selectUploadImageView?.networkImageArr = tempImgArr |
| 231 | self.selectUploadImageView?.networkVideoUrl = tempVideoUrl | 241 | self.selectUploadImageView?.networkVideoUrl = tempVideoUrl |
| 232 | } | 242 | } |
| 243 | + | ||
| 244 | + func clearWorkLocalData(){ | ||
| 245 | + UserDefaults.standard.setValue("", forKey: CNLiveVitaeAddWorkSecCelljobDuties) | ||
| 246 | + UserDefaults.standard.synchronize() | ||
| 247 | + } | ||
| 233 | func setupNewUI(model:CNLiveVitaeWorksModel){ | 248 | func setupNewUI(model:CNLiveVitaeWorksModel){ |
| 234 | self.huoJiangtextView.text = model.jobDuties | 249 | self.huoJiangtextView.text = model.jobDuties |
| 250 | + UserDefaults.standard.setValue(model.jobDuties, forKey: CNLiveVitaeAddWorkSecCelljobDuties) | ||
| 251 | + UserDefaults.standard.synchronize() | ||
| 235 | self.huoJiangNumberLabel.text = "\(model.jobDuties.count)/1000" | 252 | self.huoJiangNumberLabel.text = "\(model.jobDuties.count)/1000" |
| 236 | 253 | ||
| 237 | let imgArr = model.imgs.components(separatedBy: ",") | 254 | let imgArr = model.imgs.components(separatedBy: ",") |
| @@ -253,6 +270,21 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | @@ -253,6 +270,21 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | ||
| 253 | textView.text = "描述" | 270 | textView.text = "描述" |
| 254 | textView.textColor = HexColor("#B3B3B3") | 271 | textView.textColor = HexColor("#B3B3B3") |
| 255 | // setupWithSendBtnStatue(statue: false) | 272 | // setupWithSendBtnStatue(statue: false) |
| 273 | + }else{ | ||
| 274 | + if self.workAwardType == .work{ | ||
| 275 | + if textView.text != "描述"{ | ||
| 276 | + self.isUpdated = true | ||
| 277 | + UserDefaults.standard.setValue(textView.text, forKey: CNLiveVitaeAddWorkSecCelljobDuties) | ||
| 278 | + UserDefaults.standard.synchronize() | ||
| 279 | + }else{ | ||
| 280 | + } | ||
| 281 | + }else{ | ||
| 282 | + if textView.text != "描述"{ | ||
| 283 | + self.isUpdated = true | ||
| 284 | + UserDefaults.standard.setValue(textView.text, forKey: CNLiveVitaeAddAwardSecCellDescription) | ||
| 285 | + UserDefaults.standard.synchronize() | ||
| 286 | + }else{} | ||
| 287 | + } | ||
| 256 | } | 288 | } |
| 257 | } | 289 | } |
| 258 | func textViewDidBeginEditing(_ textView: UITextView) { | 290 | func textViewDidBeginEditing(_ textView: UITextView) { |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkThreeCell.swift
| @@ -11,9 +11,12 @@ import SnapKit | @@ -11,9 +11,12 @@ import SnapKit | ||
| 11 | 11 | ||
| 12 | typealias UpdateAddWorkThreeCellBlock = (_ currentCell: CNLiveVitaeAddWorkThreeCell? ,_ company:String ,_ workDiDian:String) -> Void | 12 | typealias UpdateAddWorkThreeCellBlock = (_ currentCell: CNLiveVitaeAddWorkThreeCell? ,_ company:String ,_ workDiDian:String) -> Void |
| 13 | 13 | ||
| 14 | +let CNLiveVitaeAddWorktThreeCellCompany = "CNLiveVitaeAddWorktThreeCellCompany" | ||
| 15 | +let CNLiveVitaeAddWorktThreeCellCity = "CNLiveVitaeAddWorktThreeCellCity" | ||
| 16 | + | ||
| 14 | class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{ | 17 | class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{ |
| 15 | var updateAddWorkThreeCellBlock:UpdateAddWorkThreeCellBlock? | 18 | var updateAddWorkThreeCellBlock:UpdateAddWorkThreeCellBlock? |
| 16 | - | 19 | + var isUpdated = false//是否 已经更新内容 |
| 17 | //简历workModel | 20 | //简历workModel |
| 18 | var _workModel : CNLiveVitaeWorksModel? | 21 | var _workModel : CNLiveVitaeWorksModel? |
| 19 | var workModel : CNLiveVitaeWorksModel? { | 22 | var workModel : CNLiveVitaeWorksModel? { |
| @@ -203,6 +206,13 @@ class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{ | @@ -203,6 +206,13 @@ class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{ | ||
| 203 | if self.updateAddWorkThreeCellBlock != nil{ | 206 | if self.updateAddWorkThreeCellBlock != nil{ |
| 204 | self.updateAddWorkThreeCellBlock?(self, textField.text ?? "", "") | 207 | self.updateAddWorkThreeCellBlock?(self, textField.text ?? "", "") |
| 205 | } | 208 | } |
| 209 | + if textField.text != "请填写"{ | ||
| 210 | + self.isUpdated = true | ||
| 211 | + UserDefaults.standard.setValue(textField.text ?? "", forKey: CNLiveVitaeAddWorktThreeCellCompany) | ||
| 212 | + UserDefaults.standard.synchronize() | ||
| 213 | + }else{ | ||
| 214 | + | ||
| 215 | + } | ||
| 206 | } | 216 | } |
| 207 | 217 | ||
| 208 | @objc func workCityTapAction(){ | 218 | @objc func workCityTapAction(){ |
| @@ -216,6 +226,9 @@ class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{ | @@ -216,6 +226,9 @@ class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{ | ||
| 216 | if self?.updateAddWorkThreeCellBlock != nil{ | 226 | if self?.updateAddWorkThreeCellBlock != nil{ |
| 217 | self?.updateAddWorkThreeCellBlock?(self, "", self?.weizhiRightTitleLabel.text ?? "") | 227 | self?.updateAddWorkThreeCellBlock?(self, "", self?.weizhiRightTitleLabel.text ?? "") |
| 218 | } | 228 | } |
| 229 | + self?.isUpdated = true | ||
| 230 | + UserDefaults.standard.setValue(self?.weizhiRightTitleLabel.text ?? "", forKey: CNLiveVitaeAddWorktThreeCellCity) | ||
| 231 | + UserDefaults.standard.synchronize() | ||
| 219 | } | 232 | } |
| 220 | let currVC = currentViewController() | 233 | let currVC = currentViewController() |
| 221 | currVC?.addChild(vc) | 234 | currVC?.addChild(vc) |
| @@ -229,10 +242,17 @@ class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{ | @@ -229,10 +242,17 @@ class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{ | ||
| 229 | 242 | ||
| 230 | func setupNewUI(model:CNLiveVitaeWorksModel){ | 243 | func setupNewUI(model:CNLiveVitaeWorksModel){ |
| 231 | self.phoneTextFiled.text = model.companyName.count>0 ? model.companyName : "请填写" | 244 | self.phoneTextFiled.text = model.companyName.count>0 ? model.companyName : "请填写" |
| 245 | + UserDefaults.standard.setValue(model.companyName, forKey: CNLiveVitaeAddWorktThreeCellCompany) | ||
| 246 | + UserDefaults.standard.synchronize() | ||
| 247 | + | ||
| 232 | var cityStr = model.city | 248 | var cityStr = model.city |
| 249 | + UserDefaults.standard.setValue(model.city, forKey: CNLiveVitaeAddWorktThreeCellCity) | ||
| 250 | + UserDefaults.standard.synchronize() | ||
| 251 | + | ||
| 233 | if cityStr.count == 0{ | 252 | if cityStr.count == 0{ |
| 234 | cityStr = "请选择" | 253 | cityStr = "请选择" |
| 235 | } | 254 | } |
| 255 | + | ||
| 236 | self.weizhiRightTitleLabel.text = cityStr | 256 | self.weizhiRightTitleLabel.text = cityStr |
| 237 | 257 | ||
| 238 | if self.updateAddWorkThreeCellBlock != nil{ | 258 | if self.updateAddWorkThreeCellBlock != nil{ |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeWorkCell.swift
| @@ -384,6 +384,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -384,6 +384,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 384 | self.editImageUrls.removeAll() | 384 | self.editImageUrls.removeAll() |
| 385 | self.editVideoUrl = "" | 385 | self.editVideoUrl = "" |
| 386 | let imgArr = model.imgs.components(separatedBy: ",") | 386 | let imgArr = model.imgs.components(separatedBy: ",") |
| 387 | + self.images.removeAll() | ||
| 387 | if imgArr.count > 0{ | 388 | if imgArr.count > 0{ |
| 388 | for i in 0..<imgArr.count { | 389 | for i in 0..<imgArr.count { |
| 389 | let imgWH:Float = Float((KSreenWidth-60-15)/3.0) | 390 | let imgWH:Float = Float((KSreenWidth-60-15)/3.0) |
| @@ -457,8 +458,12 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -457,8 +458,12 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 457 | 458 | ||
| 458 | let startDateString = convertTimestampStringToDateString(timestampString: model.startWorkingDate) | 459 | let startDateString = convertTimestampStringToDateString(timestampString: model.startWorkingDate) |
| 459 | let endDateString = convertTimestampStringToDateString(timestampString: model.endWorkingDate) | 460 | let endDateString = convertTimestampStringToDateString(timestampString: model.endWorkingDate) |
| 460 | - if endDateString == nil || endDateString?.count == 0{ | 461 | + if startDateString == nil || startDateString?.count == 0{ |
| 462 | + self.workNameTitleLabel.text = model.position | ||
| 463 | + }else{ | ||
| 461 | self.workNameTitleLabel.text = model.position+" | "+(startDateString ?? "") | 464 | self.workNameTitleLabel.text = model.position+" | "+(startDateString ?? "") |
| 465 | + } | ||
| 466 | + if endDateString == nil || endDateString?.count == 0{ | ||
| 462 | }else{ | 467 | }else{ |
| 463 | self.workNameTitleLabel.text = model.position+" | "+(startDateString ?? "")+" - "+endDateString! | 468 | self.workNameTitleLabel.text = model.position+" | "+(startDateString ?? "")+" - "+endDateString! |
| 464 | } | 469 | } |
| @@ -522,6 +527,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -522,6 +527,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 522 | 527 | ||
| 523 | self.editImageUrls.removeAll() | 528 | self.editImageUrls.removeAll() |
| 524 | self.editVideoUrl = "" | 529 | self.editVideoUrl = "" |
| 530 | + self.images.removeAll() | ||
| 525 | let imgArr = model.imgs.components(separatedBy: ",") | 531 | let imgArr = model.imgs.components(separatedBy: ",") |
| 526 | if imgArr.count > 0{ | 532 | if imgArr.count > 0{ |
| 527 | for i in 0..<imgArr.count { | 533 | for i in 0..<imgArr.count { |
| @@ -661,6 +667,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -661,6 +667,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 661 | vc.awardModel = self.awardModel | 667 | vc.awardModel = self.awardModel |
| 662 | vc.workAwardType = .award | 668 | vc.workAwardType = .award |
| 663 | } | 669 | } |
| 670 | +// vc.isAddWorkAward = false | ||
| 664 | vc.seleArr = self.editImageUrls | 671 | vc.seleArr = self.editImageUrls |
| 665 | vc.seleVideoUrl = self.editVideoUrl | 672 | vc.seleVideoUrl = self.editVideoUrl |
| 666 | navigationViewController().pushViewController(vc, animated: true) | 673 | navigationViewController().pushViewController(vc, animated: true) |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreViewFirCell.swift
| @@ -180,7 +180,7 @@ class CNLiveDigitalResumePreViewFirCell: UITableViewCell { | @@ -180,7 +180,7 @@ class CNLiveDigitalResumePreViewFirCell: UITableViewCell { | ||
| 180 | self.phoneTitleLabel.sizeToFit() | 180 | self.phoneTitleLabel.sizeToFit() |
| 181 | self.phoneTitleLabel.snp.makeConstraints { make in | 181 | self.phoneTitleLabel.snp.makeConstraints { make in |
| 182 | make.left.equalTo(adapt_length(length: 15)) | 182 | make.left.equalTo(adapt_length(length: 15)) |
| 183 | - make.top.equalTo(self.authNameTitleLabel.snp.bottom).offset(8) | 183 | + make.top.equalTo(60)//self.authNameTitleLabel.snp.bottom).offset(8) |
| 184 | make.width.equalTo(self.phoneTitleLabel.size.width) | 184 | make.width.equalTo(self.phoneTitleLabel.size.width) |
| 185 | make.height.equalTo(self.phoneTitleLabel.size.height) | 185 | make.height.equalTo(self.phoneTitleLabel.size.height) |
| 186 | } | 186 | } |
metaCode/Classes/Main/Model/Vitae/CNLiveViateWorkModelLayout.swift
| @@ -26,14 +26,39 @@ class CNLiveViateWorkModelLayout:NSObject{ | @@ -26,14 +26,39 @@ class CNLiveViateWorkModelLayout:NSObject{ | ||
| 26 | 26 | ||
| 27 | init(model:CNLiveVitaeWorksModel,descH:Float,isPreview:Bool,isExpand:Bool,isShowExpand:Bool){ | 27 | init(model:CNLiveVitaeWorksModel,descH:Float,isPreview:Bool,isExpand:Bool,isShowExpand:Bool){ |
| 28 | super.init() | 28 | super.init() |
| 29 | + var gangwei:Float = 10 | ||
| 30 | + if model.position.count == 0{ | ||
| 31 | + gangwei = 0 | ||
| 32 | + }else{ | ||
| 33 | + } | ||
| 34 | + | ||
| 29 | model.isExpand = isExpand | 35 | model.isExpand = isExpand |
| 30 | model.isShowExpand = isShowExpand | 36 | model.isShowExpand = isShowExpand |
| 31 | var expand:Float = 20 | 37 | var expand:Float = 20 |
| 32 | - if isShowExpand{ | 38 | + |
| 39 | + let titleLabel = UILabel.init(frame: CGRectMake(0, 0, KSreenWidth-60, 40)) | ||
| 40 | + titleLabel.textColor = HexColor("#999999") | ||
| 41 | + titleLabel.textAlignment = .left | ||
| 42 | + titleLabel.font = Font_14 | ||
| 43 | + titleLabel.backgroundColor = .clear | ||
| 44 | + titleLabel.text = "描述" | ||
| 45 | + titleLabel.numberOfLines = 0 | ||
| 46 | + titleLabel.text = model.jobDuties | ||
| 47 | + let lines = titleLabel.getRealLabelTextLines() | ||
| 48 | + let height = titleLabel.qmui_lineHeight | ||
| 49 | + var tempisShowExpand = false | ||
| 50 | + if lines <= 2{ | ||
| 51 | + tempisShowExpand = false | ||
| 52 | + }else{ | ||
| 53 | + tempisShowExpand = true | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + if tempisShowExpand{ | ||
| 33 | expand = 20 | 57 | expand = 20 |
| 34 | }else{ | 58 | }else{ |
| 35 | expand = 0 | 59 | expand = 0 |
| 36 | } | 60 | } |
| 61 | + | ||
| 37 | self.workModel = model | 62 | self.workModel = model |
| 38 | var companyH:Float = 25 | 63 | var companyH:Float = 25 |
| 39 | let companyStr = model.companyName | 64 | let companyStr = model.companyName |
| @@ -58,16 +83,16 @@ class CNLiveViateWorkModelLayout:NSObject{ | @@ -58,16 +83,16 @@ class CNLiveViateWorkModelLayout:NSObject{ | ||
| 58 | }else{ | 83 | }else{ |
| 59 | hang = 0 | 84 | hang = 0 |
| 60 | } | 85 | } |
| 61 | - var imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) | 86 | + var imgWH:Float = Float((KSreenWidth-60-15-10)/3.0+10) |
| 62 | var cityH:Float = 35 | 87 | var cityH:Float = 35 |
| 63 | let cityStr = model.city | 88 | let cityStr = model.city |
| 64 | if cityStr.count == 0 || cityStr == "请选择"{ | 89 | if cityStr.count == 0 || cityStr == "请选择"{ |
| 65 | cityH = 0 | 90 | cityH = 0 |
| 66 | }else{ | 91 | }else{ |
| 67 | - cityH = 35 | 92 | + |
| 68 | } | 93 | } |
| 69 | if isPreview == false{//工作记录详情页 | 94 | if isPreview == false{//工作记录详情页 |
| 70 | - _workModel?.cellH = Float(123-25)+companyH+descH+expand+Float(hang*imgWH)+cityH+55+15 | 95 | + _workModel?.cellH = Float(123-25)+gangwei+companyH+descH+expand+Float(hang*imgWH)-10+cityH+55+15 |
| 71 | }else{//预览工作记录 | 96 | }else{//预览工作记录 |
| 72 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) | 97 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) |
| 73 | _workModel?.cellH = Float(162-58-25)+companyH+descH+expand+Float(hang*imgWH)+cityH//+55 | 98 | _workModel?.cellH = Float(162-58-25)+companyH+descH+expand+Float(hang*imgWH)+cityH//+55 |
| @@ -99,14 +124,34 @@ class CNLiveViateAwardModelLayout:NSObject{ | @@ -99,14 +124,34 @@ class CNLiveViateAwardModelLayout:NSObject{ | ||
| 99 | 124 | ||
| 100 | init(model:CNLiveVitaeAwardsModel,descH:Float,isPreview:Bool,isExpand:Bool,isShowExpand:Bool){ | 125 | init(model:CNLiveVitaeAwardsModel,descH:Float,isPreview:Bool,isExpand:Bool,isShowExpand:Bool){ |
| 101 | super.init() | 126 | super.init() |
| 127 | + | ||
| 102 | model.isExpand = isExpand | 128 | model.isExpand = isExpand |
| 103 | model.isShowExpand = isShowExpand | 129 | model.isShowExpand = isShowExpand |
| 104 | var expand:Float = 20 | 130 | var expand:Float = 20 |
| 105 | - if isShowExpand{ | 131 | + |
| 132 | + let titleLabel = UILabel.init(frame: CGRectMake(0, 0, KSreenWidth-60, 40)) | ||
| 133 | + titleLabel.textColor = HexColor("#999999") | ||
| 134 | + titleLabel.textAlignment = .left | ||
| 135 | + titleLabel.font = Font_14 | ||
| 136 | + titleLabel.backgroundColor = .clear | ||
| 137 | + titleLabel.text = "描述" | ||
| 138 | + titleLabel.numberOfLines = 0 | ||
| 139 | + titleLabel.text = model.description | ||
| 140 | + let lines = titleLabel.getRealLabelTextLines() | ||
| 141 | + let height = titleLabel.qmui_lineHeight | ||
| 142 | + var tempisShowExpand = false | ||
| 143 | + if lines <= 2{ | ||
| 144 | + tempisShowExpand = false | ||
| 145 | + }else{ | ||
| 146 | + tempisShowExpand = true | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + if tempisShowExpand{ | ||
| 106 | expand = 20 | 150 | expand = 20 |
| 107 | }else{ | 151 | }else{ |
| 108 | expand = 0 | 152 | expand = 0 |
| 109 | } | 153 | } |
| 154 | + | ||
| 110 | self.awardModel = model | 155 | self.awardModel = model |
| 111 | var companyH:Float = 25 | 156 | var companyH:Float = 25 |
| 112 | let companyStr = model.company | 157 | let companyStr = model.company |
| @@ -132,7 +177,7 @@ class CNLiveViateAwardModelLayout:NSObject{ | @@ -132,7 +177,7 @@ class CNLiveViateAwardModelLayout:NSObject{ | ||
| 132 | } | 177 | } |
| 133 | var imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) | 178 | var imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) |
| 134 | if isPreview == false{//获奖详情页 | 179 | if isPreview == false{//获奖详情页 |
| 135 | - _awardModel?.cellH = Float(123-25)+companyH+descH+expand+Float(hang*imgWH)+55+15 | 180 | + _awardModel?.cellH = Float(123-25)+companyH+descH+expand+Float(hang*imgWH)-10+55+15 |
| 136 | }else{//预览获奖 | 181 | }else{//预览获奖 |
| 137 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) | 182 | imgWH = Float((Float(KSreenWidth)-30-40-50)/3.0+10) |
| 138 | _awardModel?.cellH = Float(162-58-25-25)+companyH+descH+expand+Float(hang*imgWH)//+55 | 183 | _awardModel?.cellH = Float(162-58-25-25)+companyH+descH+expand+Float(hang*imgWH)//+55 |