Commit 97e726e48eaea056b167eac80f80bf6706607b18

Authored by “张旭”
1 parent c2c70c39

编辑工作记录

metaCode.xcodeproj/project.pbxproj
... ... @@ -145,6 +145,7 @@
145 145 1975636E2C5A2EB2004E0F42 /* CNLiveVitaeWorkDetailController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1975636D2C5A2EB2004E0F42 /* CNLiveVitaeWorkDetailController.swift */; };
146 146 197563712C5A3151004E0F42 /* CNLiveVitaeWorkCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 197563702C5A3151004E0F42 /* CNLiveVitaeWorkCell.swift */; };
147 147 197563752C5B62FE004E0F42 /* CNLiveViateWorkModelLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 197563742C5B62FE004E0F42 /* CNLiveViateWorkModelLayout.swift */; };
  148 + 197563772C5C80D9004E0F42 /* HeroNetworkImageProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 197563762C5C80D9004E0F42 /* HeroNetworkImageProvider.swift */; };
148 149 19864E3F2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19864E3E2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift */; };
149 150 19864E412BF6090400586E72 /* CNLiveDuanJuDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19864E402BF6090400586E72 /* CNLiveDuanJuDetailCell.swift */; };
150 151 19AB90642BB412C700B6A79B /* CNLiveDownslideOperationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AB90632BB412C700B6A79B /* CNLiveDownslideOperationManager.swift */; };
... ... @@ -481,6 +482,7 @@
481 482 1975636D2C5A2EB2004E0F42 /* CNLiveVitaeWorkDetailController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVitaeWorkDetailController.swift; sourceTree = "<group>"; };
482 483 197563702C5A3151004E0F42 /* CNLiveVitaeWorkCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVitaeWorkCell.swift; sourceTree = "<group>"; };
483 484 197563742C5B62FE004E0F42 /* CNLiveViateWorkModelLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveViateWorkModelLayout.swift; sourceTree = "<group>"; };
  485 + 197563762C5C80D9004E0F42 /* HeroNetworkImageProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeroNetworkImageProvider.swift; sourceTree = "<group>"; };
484 486 19864E3E2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideRealHotListCell.swift; sourceTree = "<group>"; };
485 487 19864E402BF6090400586E72 /* CNLiveDuanJuDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDuanJuDetailCell.swift; sourceTree = "<group>"; };
486 488 19AB90632BB412C700B6A79B /* CNLiveDownslideOperationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownslideOperationManager.swift; sourceTree = "<group>"; };
... ... @@ -1419,6 +1421,7 @@
1419 1421 792E57D82A3AA2F2005834DB /* CNLiveCommonBaseModel.swift */,
1420 1422 792E57DA2A3AE9F4005834DB /* CNLiveCommonQiniuTool.swift */,
1421 1423 1938BD462B4FD5A500390A34 /* CNLiveIntegralAlertTool.swift */,
  1424 + 197563762C5C80D9004E0F42 /* HeroNetworkImageProvider.swift */,
1422 1425 );
1423 1426 path = Util;
1424 1427 sourceTree = "<group>";
... ... @@ -2293,6 +2296,7 @@
2293 2296 19C735C52BFF09BA00CACF4E /* CNLiveRealHotListDetailImageCell.swift in Sources */,
2294 2297 192ED4672C4F47E50057244C /* CNLiveSelectHangYeController.swift in Sources */,
2295 2298 790B1FB42A4153E90074CF00 /* CNLiveMineBaseModel.swift in Sources */,
  2299 + 197563772C5C80D9004E0F42 /* HeroNetworkImageProvider.swift in Sources */,
2296 2300 794294AA2B4D4381008AAFA0 /* CNLiveShortVideoCommentListView.swift in Sources */,
2297 2301 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */,
2298 2302 19AD65AC2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift in Sources */,
... ...
metaCode/Classes/Common/Util/HeroNetworkImageProvider.swift 0 → 100644
  1 +//
  2 +// HeroNetworkImageProvider.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/8/2.
  6 +//
  7 +
  8 +import Foundation
  9 +import JFHeroBrowser
  10 +import Kingfisher
  11 +
  12 +extension HeroNetworkImageProvider: NetworkImageProvider {
  13 + func downloadImage(with imgUrl: String, complete: Complete<UIImage>?) {
  14 + KingfisherManager.shared.retrieveImage(with: URL(string: imgUrl)!, options: nil) { receiveSize, totalSize in
  15 + guard totalSize > 0 else { return }
  16 + let progress:CGFloat = CGFloat(CGFloat(receiveSize) / CGFloat(totalSize))
  17 + complete?(.progress(progress))
  18 + } downloadTaskUpdated: { task in
  19 +
  20 + } completionHandler: { result in
  21 + switch result {
  22 + case .success(let loadingImageResult):
  23 + complete?(.success(loadingImageResult.image))
  24 + break
  25 + case .failure(let error):
  26 + complete?(.failed(error))
  27 + break
  28 + }
  29 + }
  30 + }
  31 +}
  32 +
  33 +class HeroNetworkImageProvider: NSObject {
  34 + @objc static let shared = HeroNetworkImageProvider()
  35 +}
... ...
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeAddWorkController.swift
... ... @@ -15,6 +15,19 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
15 15 var seleArr:Array<String>?
16 16 var seleVideoUrl:String = ""
17 17  
  18 + var isFirstEdit = true
  19 + //简历workModel
  20 + var _workModel : CNLiveVitaeWorksModel?
  21 + var workModel : CNLiveVitaeWorksModel? {
  22 + get{
  23 + _workModel
  24 + }
  25 + set{
  26 + _workModel = newValue!
  27 + }
  28 + }
  29 +
  30 +
18 31 let kCNLiveVitaeAddWorkFirCellIdentifier = "kCNLiveVitaeAddWorkFirCellIdentifier"
19 32 let kCNLiveVitaeAddWorkSecCellIdentifier = "kCNLiveVitaeAddWorkSecCellIdentifier"
20 33 let kCNLiveVitaeAddWorkThreeCellIdentifier = "kCNLiveVitaeAddWorkThreeCellIdentifier"
... ... @@ -61,6 +74,10 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
61 74 titleName = "新增工作记录"
62 75 navigationBarHidden = false
63 76 self.initUI()
  77 +
  78 + if self.workModel != nil{
  79 + self.tableView.reloadData()
  80 + }
64 81 }
65 82  
66 83 deinit {}
... ... @@ -111,6 +128,9 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
111 128 let cell = CNLiveVitaeAddWorkFirCell()
112 129 return cell
113 130 }
  131 + if self.workModel != nil{
  132 + cell.workModel = self.workModel!
  133 + }
114 134 return cell
115 135 }else if indexPath.row == 1{
116 136 //SecCell
... ... @@ -119,6 +139,10 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
119 139 let cell = CNLiveVitaeAddWorkSecCell()
120 140 return cell
121 141 }
  142 + if self.workModel != nil && self.isFirstEdit == true{
  143 + cell.workModel = self.workModel!
  144 + self.isFirstEdit = false
  145 + }
122 146 cell.uploadImageSuceessBlock = { imageUrl in
123 147  
124 148 }
... ... @@ -135,8 +159,6 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
135 159 self.seleVideoUrl = videoUrl ?? ""
136 160 self.seleArr = arr
137 161 self.tableView.reloadData()
138   - print("11111video\(self.seleVideoUrl)")
139   - print("11111photo\(self.seleArr)")
140 162 }
141 163 return cell
142 164 }else if indexPath.row == 2{
... ... @@ -146,6 +168,9 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
146 168 let cell = CNLiveVitaeAddWorkThreeCell()
147 169 return cell
148 170 }
  171 + if self.workModel != nil{
  172 + cell.workModel = self.workModel!
  173 + }
149 174 return cell
150 175 }else{
151 176 return UITableViewCell()
... ... @@ -173,7 +198,7 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
173 198 }
174 199  
175 200 //确认提交证书
176   - @objc func addWorkBtnAction(){
  201 + @objc func addWorkBtnAction() {
177 202 let firCell = self.tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? CNLiveVitaeAddWorkFirCell
178 203 let secCell = self.tableView.cellForRow(at: IndexPath(row: 1, section: 0)) as? CNLiveVitaeAddWorkSecCell
179 204 let threeCell = self.tableView.cellForRow(at: IndexPath(row: 2, section: 0)) as? CNLiveVitaeAddWorkThreeCell
... ... @@ -222,12 +247,17 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
222 247 }
223 248 let danWei = threeCell?.phoneTextFiled.text ?? ""
224 249 let workDiDian = threeCell?.weizhiRightTitleLabel.text ?? ""
225   - let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? ""
226 250 if let userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){
227 251 let jianli_vitaeId = userDic["jianli_vitaeId"] as? String
228 252 let vsid = userDic["vsid"] as? String
  253 + let startTime = self.convertDateStringToMillisecondsString(dateString: firCell?.canjiaRightTitleLabel.text ?? "")
  254 + let endTime = self.convertDateStringToMillisecondsString(dateString: firCell?.endTimeRightTitleLabel.text ?? "")
229 255 //提交工作记录
230   - CNLiveVitaeViewModel.saveWork(city: workDiDian, companyName: danWei, imgs: newString, jobDuties: secCell?.huoJiangtextView.text ?? "", startWorkingDate: firCell?.canjiaRightTitleLabel.text ?? "", endWorkingDate: firCell?.endTimeRightTitleLabel.text ?? "", position: firCell?.phoneTextFiled.text ?? "", profession: firCell?.weizhiRightTitleLabel.text ?? "", vsid: vsid ?? "", vitaeId: jianli_vitaeId ?? "") { result, status in
  256 + var id = ""
  257 + if self.workModel != nil{
  258 + id = self.workModel!.id
  259 + }
  260 + CNLiveVitaeViewModel.saveWork(city: workDiDian, companyName: danWei, imgs: newString, jobDuties: secCell?.huoJiangtextView.text ?? "", startWorkingDate:startTime ?? "" , endWorkingDate: endTime ?? "" , position: firCell?.phoneTextFiled.text ?? "", profession: firCell?.weizhiRightTitleLabel.text ?? "", vsid: vsid ?? "", vitaeId: jianli_vitaeId ?? "", id: id) { result, status in
231 261 if status == .success{
232 262 self.navigationController?.viewControllers.forEach({ item in
233 263 if (item.isKind(of: CNLiveDigitalResumeController.self)) {
... ... @@ -238,17 +268,25 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc
238 268 }
239 269  
240 270 }
241   -// //提交证书
242   -// CNLiveVitaeViewModel.saveCertificate(img: self.seleImageUrl, lv: cell.cerLevelTF.text ?? "", number: cell.cerNumberTF.text ?? "", organization: cell.cerJiGouTF.text ?? "", time: cell.cerTimeTF.text ?? "", title: cell.cerNameTF.text ?? "", uploadTime: "", validity: cell.cerYouXiaoTF.text ?? "", vsid: vsid){result, respStatue in
243   -// if respStatue == .success{
244   -// self.navigationController?.viewControllers.forEach({ item in
245   -// if (item.isKind(of: CNLiveVitaeVocationalCertificateController.self)) {
246   -// self.navigationController?.popToViewController(item, animated: true)
247   -// }
248   -// })
249   -// }
250   -//
251   -// }
252   -
  271 +
  272 + }
  273 +
  274 + func convertDateStringToMillisecondsString(dateString: String, dateFormat: String = "yyyy.MM.dd") -> String? {
  275 + // 创建DateFormatter实例并设置日期格式
  276 + let formatter = DateFormatter()
  277 + formatter.dateFormat = dateFormat
  278 + formatter.timeZone = TimeZone(secondsFromGMT: 0) // 确保使用UTC时区
  279 +
  280 + // 使用DateFormatter解析日期字符串
  281 + if let date = formatter.date(from: dateString) {
  282 + // 获取时间戳(秒)并转换为毫秒
  283 + let milliseconds = Int64(date.timeIntervalSince1970 * 1000)
  284 +
  285 + // 将毫秒值转换为字符串
  286 + return String(milliseconds)
  287 + }
  288 +
  289 + // 如果日期字符串无法被解析,则返回nil
  290 + return nil
253 291 }
254 292 }
... ...
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeWorkDetailController.swift
... ... @@ -7,7 +7,7 @@
7 7  
8 8 import Foundation
9 9 import SnapKit
10   -
  10 +import JFHeroBrowser
11 11 class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{
12 12 var jianjieLblHeight:CGFloat = 40
13 13 var cellHeights:Array<CGFloat> = Array()
... ... @@ -149,7 +149,17 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo
149 149 self.workListArr = Array(tempArr)
150 150 self.tableView.reloadData()
151 151 }
152   -
  152 + cell.vitaeWorkPreviewVideoPhotoBlock = { images , index in
  153 + self.hero.browserMultiSoures(viewModules: images, initIndex: index) {
  154 + [
  155 + .enableBlurEffect(false),
  156 + .heroView(nil),
  157 + .imageDidChangeHandle({ imageIndex in
  158 + return nil
  159 + })
  160 + ]
  161 + }
  162 + }
153 163 return cell
154 164 }
155 165  
... ...
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkFirCell.swift
... ... @@ -11,6 +11,17 @@ import SnapKit
11 11  
12 12 class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{
13 13 var zhiyeStr:String = ""
  14 + //简历workModel
  15 + var _workModel : CNLiveVitaeWorksModel?
  16 + var workModel : CNLiveVitaeWorksModel? {
  17 + get{
  18 + _workModel
  19 + }
  20 + set{
  21 + _workModel = newValue!
  22 + setupNewUI(model: _workModel!)
  23 + }
  24 + }
14 25  
15 26 lazy var topWhiteView :UIView = {
16 27 let bottomNavView = UIView()
... ... @@ -308,7 +319,7 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{
308 319 @objc func startTimeTapAction(){
309 320 currentViewController()?.view.endEditing(true)
310 321 MineInfoAlertView.showSelectView(showType: .selectDay) { [weak self] text in
311   - print("刷新之后的数据是=>\(text)")//"2024-06-18"
  322 + print("刷新之后的数据是=>\(text)")//"2024.06.18"
312 323 if (text as! String).count > 0{
313 324 let textStr = text as! String
314 325 self?.canjiaRightTitleLabel.text = textStr
... ... @@ -336,7 +347,7 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{
336 347  
337 348 @objc func zhiJinBtnAction(){
338 349 if let text = getCurrentDateAsString() {
339   - print(text) // 输出类似 "2024-06-18" 的字符串,具体取决于当前日期
  350 + print(text) // 输出类似 "2024.06.18" 的字符串,具体取决于当前日期
340 351 let textStr = text
341 352 self.endTimeRightTitleLabel.text = textStr
342 353 self.endTimeRightTitleLabel.textColor = HexColor("#333333")
... ... @@ -345,6 +356,71 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{
345 356 self.endTimeRightTitleLabel.textColor = HexColor("#B4B4B4")
346 357 }
347 358 }
  359 +
  360 + func setupNewUI(model:CNLiveVitaeWorksModel){
  361 + self.weizhiRightTitleLabel.text = model.profession
  362 + self.phoneTextFiled.text = model.position
  363 +
  364 + let startStr = self.convertMillisecondsStringToDateString(millisecondsString: model.startWorkingDate)
  365 + if startStr?.count ?? 0 > 0{
  366 + self.canjiaRightTitleLabel.text = startStr
  367 + self.canjiaRightTitleLabel.textColor = HexColor("#333333")
  368 + }else{
  369 + self.canjiaRightTitleLabel.text = "请选择"
  370 + self.canjiaRightTitleLabel.textColor = HexColor("#B4B4B4")
  371 + }
  372 +
  373 + let endStr = self.convertMillisecondsStringToDateString(millisecondsString: model.endWorkingDate)
  374 + if endStr?.count ?? 0 > 0{
  375 + self.endTimeRightTitleLabel.text = endStr
  376 + self.endTimeRightTitleLabel.textColor = HexColor("#333333")
  377 + }else{
  378 + self.endTimeRightTitleLabel.text = "请选择"
  379 + self.endTimeRightTitleLabel.textColor = HexColor("#B4B4B4")
  380 + }
  381 + }
  382 +
  383 + //"2024.07.02"格式转成"1722297600000"毫秒时间戳字符串
  384 + func convertDateStringToMillisecondsString(dateString: String, dateFormat: String = "yyyy.MM.dd") -> String? {
  385 + // 创建DateFormatter实例并设置日期格式
  386 + let formatter = DateFormatter()
  387 + formatter.dateFormat = dateFormat
  388 + formatter.timeZone = TimeZone(secondsFromGMT: 0) // 确保使用UTC时区
  389 +
  390 + // 使用DateFormatter解析日期字符串
  391 + if let date = formatter.date(from: dateString) {
  392 + // 获取时间戳(秒)并转换为毫秒
  393 + let milliseconds = Int64(date.timeIntervalSince1970 * 1000)
  394 +
  395 + // 将毫秒值转换为字符串
  396 + return String(milliseconds)
  397 + }
  398 +
  399 + // 如果日期字符串无法被解析,则返回nil
  400 + return nil
  401 + }
  402 + //"1722297600000"格式转为"yyyy.MM.dd"格式字符串
  403 + func convertMillisecondsStringToDateString(millisecondsString: String, dateFormatOutput: String = "yyyy.MM.dd") -> String? {
  404 + // 将毫秒时间戳字符串转换为Int64
  405 + if let milliseconds = Int64(millisecondsString) {
  406 + // 将毫秒转换为秒
  407 + let seconds = TimeInterval(milliseconds) / 1000
  408 +
  409 + // 使用Date表示这个时间戳
  410 + let date = Date(timeIntervalSince1970: seconds)
  411 +
  412 + // 创建DateFormatter并设置输出格式
  413 + let formatter = DateFormatter()
  414 + formatter.dateFormat = dateFormatOutput
  415 +
  416 + // 使用DateFormatter将Date格式化为字符串
  417 + return formatter.string(from: date)
  418 + }
  419 +
  420 + // 如果毫秒时间戳字符串无法被转换为Int64,则返回nil
  421 + return nil
  422 + }
  423 +
348 424 func getCurrentDateAsString() -> String? {
349 425 // 创建一个Date对象,它默认表示当前日期和时间
350 426 let now = Date()
... ... @@ -353,7 +429,7 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{
353 429 let formatter = DateFormatter()
354 430  
355 431 // 设置DateFormatter的日期格式
356   - formatter.dateFormat = "yyyy-MM-dd"
  432 + formatter.dateFormat = "yyyy.MM.dd"
357 433  
358 434 // 使用DateFormatter将Date对象格式化为字符串
359 435 let dateString = formatter.string(from: now)
... ...
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkSecCell.swift
... ... @@ -13,6 +13,19 @@ typealias UpdateAddWorkSecCellHeightBlock = (_ currentCell: CNLiveVitaeAddWorkSe
13 13  
14 14 class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{
15 15 var updateAddWorkSecCellHeightBlock:UpdateAddWorkSecCellHeightBlock?
  16 +
  17 + //简历workModel
  18 + var _workModel : CNLiveVitaeWorksModel?
  19 + var workModel : CNLiveVitaeWorksModel? {
  20 + get{
  21 + _workModel
  22 + }
  23 + set{
  24 + _workModel = newValue!
  25 + setupNewUI(model: _workModel!)
  26 + }
  27 + }
  28 +
16 29 lazy var topWhiteView :UIView = {
17 30 let bottomNavView = UIView()
18 31 bottomNavView.backgroundColor = .white
... ... @@ -187,6 +200,23 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{
187 200  
188 201 }
189 202  
  203 + func setupNewUI(model:CNLiveVitaeWorksModel){
  204 + self.huoJiangtextView.text = model.jobDuties
  205 + self.huoJiangNumberLabel.text = "\(model.jobDuties.count)/1000"
  206 +
  207 + let imgArr = model.imgs.components(separatedBy: ",")
  208 + var tempImgArr = Array<String>()
  209 + var tempVideoUrl = ""
  210 + for (_,imgUrl) in imgArr.enumerated() {
  211 + if imgUrl.contains("vitae_video_"){
  212 + tempVideoUrl = imgUrl
  213 + }else{
  214 + tempImgArr.append(imgUrl)
  215 + }
  216 + }
  217 + self.selectUploadImageView?.networkImageArr = tempImgArr
  218 + self.selectUploadImageView?.networkVideoUrl = tempVideoUrl
  219 + }
190 220  
191 221 func textViewDidEndEditing(_ textView: UITextView) {
192 222 if textView.text.lengthOfBytes(using: .utf8) < 1 {
... ...
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkThreeCell.swift
... ... @@ -10,6 +10,19 @@ import Kingfisher
10 10 import SnapKit
11 11  
12 12 class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{
  13 +
  14 + //简历workModel
  15 + var _workModel : CNLiveVitaeWorksModel?
  16 + var workModel : CNLiveVitaeWorksModel? {
  17 + get{
  18 + _workModel
  19 + }
  20 + set{
  21 + _workModel = newValue!
  22 + setupNewUI(model: _workModel!)
  23 + }
  24 + }
  25 +
13 26 var selectAreaVC:CNLiveDigitalResumeInfoSelectAddressController?
14 27  
15 28 lazy var topWhiteView :UIView = {
... ... @@ -205,6 +218,13 @@ class CNLiveVitaeAddWorkThreeCell:UITableViewCell, UITextFieldDelegate{
205 218 self.selectAreaVC?.display()
206 219 }
207 220  
208   -
  221 + func setupNewUI(model:CNLiveVitaeWorksModel){
  222 + self.phoneTextFiled.text = model.companyName.count>0 ? model.companyName : "请填写"
  223 + var cityStr = model.city
  224 + if cityStr.count == 0{
  225 + cityStr = "请选择"
  226 + }
  227 + self.weizhiRightTitleLabel.text = cityStr
  228 + }
209 229 }
210 230  
... ...
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeWorkCell.swift
... ... @@ -10,14 +10,21 @@ import QMUIKit
10 10 import SwiftUI
11 11 import SnapKit
12 12 import Kingfisher
13   -import SKPhotoBrowser
14   -
  13 +import JFHeroBrowser
15 14  
16 15 //cell高度变化
17 16 typealias vitaeWorkCellChangedBlockActionBlock = (_ cell: CNLiveVitaeWorkCell ,_ cellHeight:CGFloat) -> Void
  17 +typealias VitaeWorkPreviewVideoPhotoBlock = (_ images: [HeroBrowserViewModuleBaseProtocol] ,_ index:Int) -> Void
18 18  
19 19 class CNLiveVitaeWorkCell: UITableViewCell{
20   - var images = [SKPhoto]()
  20 +
  21 + lazy var images: [HeroBrowserViewModuleBaseProtocol] = {
  22 + var list: [HeroBrowserViewModuleBaseProtocol] = []
  23 + return list
  24 + }()
  25 +
  26 + var vitaeWorkPreviewVideoPhotoBlock:VitaeWorkPreviewVideoPhotoBlock?
  27 +
21 28 var vitaeWorkCellChangedBlock:vitaeWorkCellChangedBlockActionBlock?
22 29  
23 30 //简历workModel
... ... @@ -303,21 +310,46 @@ class CNLiveVitaeWorkCell: UITableViewCell{
303 310 imgView.isUserInteractionEnabled = true
304 311 imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton)))
305 312 imgView.tag = 1000+i
306   - imgView.contentMode = .scaleAspectFit
  313 + imgView.contentMode = .center
307 314 let imgUrl = imgArr[i]
308   - imgView.kf.setImage(with: URL(string: imgUrl))
309 315 imgView.clipsToBounds = true
310 316 imgView.layer.cornerRadius = 5
311 317 self.whiteBgView.addSubview(imgView)
312 318  
313   - let photo = SKPhoto.photoWithImageURL(imgUrl)
314   - photo.shouldCachePhotoURLImage = false
315   - photo.photoURL = imgUrl
316   - self.images.append(photo)
  319 + if imgUrl.contains("vitae_video_"){
  320 + //是视频
  321 + let thumbailImgUrl = "http://wjjtest.ys2.cnliveimg.com/802/mateCode/img/vitae_photo_0/2024/08/02/3977195366.jpg"
  322 + let vm = HeroBrowserVideoViewModule(thumbailImgUrl: thumbailImgUrl, videoUrl: imgUrl, provider: HeroNetworkImageProvider.shared, autoPlay: true)
  323 + self.images.append(vm)
  324 + imgView.kf.setImage(with: URL(string: thumbailImgUrl),placeholder: UIImage(color: UIColor.lightGray, size: imgView.size))
  325 +
  326 + let playBtn = UIButton(type: .custom)
  327 + playBtn.frame = imgView.bounds
  328 + playBtn.setImage(UIImage(named: "short_video_play"), for: .normal)
  329 + playBtn.addTarget(self, action: #selector(playBtnAction(btn:)), for: .touchUpInside)
  330 + playBtn.clipsToBounds = true
  331 + playBtn.layer.cornerRadius = 5
  332 + playBtn.tag = 1000+i
  333 + imgView.addSubview(playBtn)
  334 + }else if imgUrl.contains("vitae_photo_"){
  335 + //是图片
  336 + self.images.append(HeroBrowserNetworkImageViewModule(thumbailImgUrl: nil, originImgUrl: imgUrl))
  337 + imgView.kf.setImage(with: URL(string: imgUrl))
  338 + }else{
  339 + //默认图片
  340 + self.images.append(HeroBrowserNetworkImageViewModule(thumbailImgUrl: nil, originImgUrl: imgUrl))
  341 + imgView.kf.setImage(with: URL(string: imgUrl))
  342 + }
317 343 }
318 344 }
319 345  
320   - self.workDingWeiTitleLabel.text = model.city
  346 + let cityStr = model.city
  347 + if cityStr.count == 0 || cityStr == "请选择"{
  348 + self.workDingWeiTitleLabel.isHidden = true
  349 + }else{
  350 + self.workDingWeiTitleLabel.isHidden = false
  351 + self.workDingWeiTitleLabel.text = model.city
  352 + }
321 353  
322 354 }
323 355 func convertTimestampStringToDateString(timestampString: String) -> String? {
... ... @@ -357,19 +389,22 @@ class CNLiveVitaeWorkCell: UITableViewCell{
357 389  
358 390 }
359 391 @objc func editBtnAction(){
360   -
  392 + let vc = CNLiveVitaeAddWorkController()
  393 + vc.workModel = self.workModel
  394 + navigationViewController().pushViewController(vc, animated: true)
361 395 }
362 396 @objc func deleteBtnAction(){
363 397  
364 398 }
365   -
  399 + @objc func playBtnAction(btn:UIButton){
  400 + let index = btn.tag-1000
  401 + self.vitaeWorkPreviewVideoPhotoBlock?(self.images, index)
  402 + }
366 403 @objc func imgViewTapAciton(ges: UITapGestureRecognizer){
367 404 let imgView = ges.view as! UIImageView
368 405 let index = imgView.tag-1000
369 406  
370   - let browser = SKPhotoBrowser(photos: self.images)
371   - browser.initializePageIndex(index)
372   - currentViewController()?.present(browser, animated: true)
  407 + self.vitaeWorkPreviewVideoPhotoBlock?(self.images, index)
373 408 }
374 409  
375 410 }
... ...
metaCode/Classes/Main/HomePage/View/Shop/GoodsManager/CNLiveAddGoodsSelectUploadImageView.swift
... ... @@ -345,6 +345,9 @@ class CNLiveAddGoodsSelectUploadImageView: UIView,UIImagePickerControllerDelegat
345 345 */
346 346 func deleteUploadImageUrl(){
347 347 for uploadImageModel in self.uploadImageUrls {
  348 + if uploadImageModel.imageUrl == nil || uploadImageModel.imageUrl?.count == 0{
  349 + return
  350 + }
348 351 if !self.networkImageArr.contains(uploadImageModel.imageUrl!){
349 352 UploadManager.shared.requestQiNiuDeleteImageUrl(imageUrl: uploadImageModel.imageUrl!) { result, status in
350 353  
... ...
metaCode/Classes/Main/HomePage/ViewModel/Vitae/CNLiveVitaeViewModel.swift
... ... @@ -236,7 +236,7 @@ class CNLiveVitaeViewModel:NSObject{
236 236 保存简历-工作经历(新增工作记录)
237 237 参数 vsid 实名对象id
238 238 */
239   - static func saveWork(city:String,companyName:String,imgs:String,jobDuties:String,startWorkingDate:String,endWorkingDate:String,position:String,profession:String,vsid:String,vitaeId:String,resultBlock: @escaping downSlideResultBlock) {
  239 + static func saveWork(city:String,companyName:String,imgs:String,jobDuties:String,startWorkingDate:String,endWorkingDate:String,position:String,profession:String,vsid:String,vitaeId:String,id:String,resultBlock: @escaping downSlideResultBlock) {
240 240 let values = NSMutableDictionary()
241 241 values.addEntries(from: ["profession":profession])
242 242 values.addEntries(from: ["position":position])
... ... @@ -248,6 +248,9 @@ class CNLiveVitaeViewModel:NSObject{
248 248 values.addEntries(from: ["city":city])
249 249 values.addEntries(from: ["vsid":vsid])
250 250 values.addEntries(from: ["vitaeId":vitaeId])
  251 + if id.count > 0{
  252 + values.addEntries(from: ["id":id])
  253 + }
251 254 do {
252 255 let request = URLRequest.init(url: URL.init(string: APPBaseMCUrl+"/userApi/saveVitaeWork")!) as! NSMutableURLRequest
253 256 request.httpMethod = "POST"
... ...
metaCode/Classes/Main/Model/Vitae/CNLiveViateWorkModelLayout.swift
... ... @@ -43,7 +43,14 @@ class CNLiveViateWorkModelLayout:NSObject{
43 43 hang = 0
44 44 }
45 45 let imgWH:Float = Float((KSreenWidth-60-15)/3.0+10)
46   - _workModel?.cellH = Float(123)+descH+Float(hang*imgWH)+90
  46 + var cityH:Float = 35
  47 + let cityStr = model.city
  48 + if cityStr.count == 0 || cityStr == "请选择"{
  49 + cityH = 0
  50 + }else{
  51 + cityH = 35
  52 + }
  53 + _workModel?.cellH = Float(123)+descH+Float(hang*imgWH)+cityH+55
47 54 }
48 55 func getCellHModel()->CNLiveVitaeWorksModel{
49 56 return _workModel!
... ...
metaCode/Classes/Main/Model/Vitae/CNLiveVitaeModel.swift
... ... @@ -82,7 +82,7 @@ class CNLiveVitaeIdentitiesModel:BaseModel{
82 82 //简历工作模块
83 83 class CNLiveVitaeWorksModel:BaseModel{
84 84 ///
85   - var id: Int = 0
  85 + var id:String = ""
86 86 ///
87 87 var vitaeId:String = ""
88 88 ///
... ...
metaCode/Classes/Other/AppDelegate.swift
... ... @@ -12,6 +12,8 @@ import CNLiveShareToolKit
12 12 //import RangersAPM
13 13 import CNLiveEnvironment
14 14 import CNLivePayCostModule
  15 +import JFHeroBrowser
  16 +
15 17  
16 18 @main
17 19 class AppDelegate: UIResponder, UIApplicationDelegate {
... ... @@ -20,6 +22,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
20 22  
21 23 func application(_ appUITableViewRowDatalication: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
22 24  
  25 + JFHeroBrowserGlobalConfig.default.networkImageProvider = HeroNetworkImageProvider.shared
  26 +
23 27 // Override point for customization after application launch.
24 28 //tencentAppId wxAppId
25 29 CNLiveShareManager.registeredShareView(whenDidFinishLaunch: universalLinkURL, appId: APPId, tencentAppId: tencentAppId, wxAppId: wxAppId, wxSecret: "", weiBoAppId: "")
... ...