Commit c3a66192c4e5738a3949921b8cbf28e6046e83d9
1 parent
3099124a
获奖情况列表页面 , 新增获奖情况页面 , 数字简历页面获奖数据同步
Showing
12 changed files
with
764 additions
and
115 deletions
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeAddWorkController.swift
| @@ -3,13 +3,23 @@ | @@ -3,13 +3,23 @@ | ||
| 3 | // metaCode | 3 | // metaCode |
| 4 | // | 4 | // |
| 5 | // Created by zx on 2024/7/29. | 5 | // Created by zx on 2024/7/29. |
| 6 | -// 数字简历-添加工作记录页面 | 6 | +// 数字简历-添加工作记录页面/添加获奖情况页面 |
| 7 | 7 | ||
| 8 | import Foundation | 8 | import Foundation |
| 9 | import SnapKit | 9 | import SnapKit |
| 10 | 10 | ||
| 11 | +///数字简历工作/获奖类型 | ||
| 12 | +enum CNLiveViateWorkAwardType { | ||
| 13 | + ///工作记录 | ||
| 14 | + case work | ||
| 15 | + ///获奖情况 | ||
| 16 | + case award | ||
| 17 | +} | ||
| 18 | + | ||
| 11 | class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ | 19 | class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ |
| 12 | 20 | ||
| 21 | + var workAwardType:CNLiveViateWorkAwardType = .work | ||
| 22 | + | ||
| 13 | var hangHeight:CGFloat = (KSreenWidth-90)/3.0+10 | 23 | var hangHeight:CGFloat = (KSreenWidth-90)/3.0+10 |
| 14 | var secCell:CNLiveVitaeAddWorkSecCell? | 24 | var secCell:CNLiveVitaeAddWorkSecCell? |
| 15 | var seleArr:Array<String>? | 25 | var seleArr:Array<String>? |
| @@ -26,7 +36,16 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -26,7 +36,16 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 26 | _workModel = newValue! | 36 | _workModel = newValue! |
| 27 | } | 37 | } |
| 28 | } | 38 | } |
| 29 | - | 39 | + //简历awardModel |
| 40 | + var _awardModel : CNLiveVitaeAwardsModel? | ||
| 41 | + var awardModel : CNLiveVitaeAwardsModel? { | ||
| 42 | + get{ | ||
| 43 | + _awardModel | ||
| 44 | + } | ||
| 45 | + set{ | ||
| 46 | + _awardModel = newValue! | ||
| 47 | + } | ||
| 48 | + } | ||
| 30 | 49 | ||
| 31 | let kCNLiveVitaeAddWorkFirCellIdentifier = "kCNLiveVitaeAddWorkFirCellIdentifier" | 50 | let kCNLiveVitaeAddWorkFirCellIdentifier = "kCNLiveVitaeAddWorkFirCellIdentifier" |
| 32 | let kCNLiveVitaeAddWorkSecCellIdentifier = "kCNLiveVitaeAddWorkSecCellIdentifier" | 51 | let kCNLiveVitaeAddWorkSecCellIdentifier = "kCNLiveVitaeAddWorkSecCellIdentifier" |
| @@ -71,11 +90,15 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -71,11 +90,15 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 71 | 90 | ||
| 72 | override func viewDidLoad() { | 91 | override func viewDidLoad() { |
| 73 | super.viewDidLoad() | 92 | super.viewDidLoad() |
| 74 | - titleName = "新增工作记录" | 93 | + if self.workAwardType == .work{ |
| 94 | + titleName = "新增工作记录" | ||
| 95 | + }else{ | ||
| 96 | + titleName = "新增获奖情况" | ||
| 97 | + } | ||
| 75 | navigationBarHidden = false | 98 | navigationBarHidden = false |
| 76 | self.initUI() | 99 | self.initUI() |
| 77 | 100 | ||
| 78 | - if self.workModel != nil{ | 101 | + if self.workModel != nil || self.awardModel != nil{ |
| 79 | self.tableView.reloadData() | 102 | self.tableView.reloadData() |
| 80 | } | 103 | } |
| 81 | } | 104 | } |
| @@ -117,7 +140,11 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -117,7 +140,11 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 117 | } | 140 | } |
| 118 | 141 | ||
| 119 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | 142 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| 120 | - return 3 | 143 | + if self.workAwardType == .work{ |
| 144 | + return 3 | ||
| 145 | + }else{ | ||
| 146 | + return 2 | ||
| 147 | + } | ||
| 121 | } | 148 | } |
| 122 | 149 | ||
| 123 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | 150 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| @@ -128,9 +155,18 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -128,9 +155,18 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 128 | let cell = CNLiveVitaeAddWorkFirCell() | 155 | let cell = CNLiveVitaeAddWorkFirCell() |
| 129 | return cell | 156 | return cell |
| 130 | } | 157 | } |
| 131 | - if self.workModel != nil{ | ||
| 132 | - cell.workModel = self.workModel! | 158 | + if self.workAwardType == .work{ |
| 159 | + if self.workModel != nil{ | ||
| 160 | + cell.workModel = self.workModel! | ||
| 161 | + } | ||
| 162 | + cell.workAwardType = .work | ||
| 163 | + }else{ | ||
| 164 | + if self.awardModel != nil{ | ||
| 165 | + cell.awardModel = self.awardModel! | ||
| 166 | + } | ||
| 167 | + cell.workAwardType = .award | ||
| 133 | } | 168 | } |
| 169 | + | ||
| 134 | return cell | 170 | return cell |
| 135 | }else if indexPath.row == 1{ | 171 | }else if indexPath.row == 1{ |
| 136 | //SecCell | 172 | //SecCell |
| @@ -139,15 +175,23 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -139,15 +175,23 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 139 | let cell = CNLiveVitaeAddWorkSecCell() | 175 | let cell = CNLiveVitaeAddWorkSecCell() |
| 140 | return cell | 176 | return cell |
| 141 | } | 177 | } |
| 142 | - if self.workModel != nil && self.isFirstEdit == true{ | ||
| 143 | - cell.workModel = self.workModel! | ||
| 144 | - self.isFirstEdit = false | 178 | + if self.workAwardType == .work{ |
| 179 | + | ||
| 180 | + if self.workModel != nil && self.isFirstEdit == true{ | ||
| 181 | + cell.workModel = self.workModel! | ||
| 182 | + self.isFirstEdit = false | ||
| 183 | + } | ||
| 184 | + }else{ | ||
| 185 | + if self.awardModel != nil && self.isFirstEdit == true{ | ||
| 186 | + cell.awardModel = self.awardModel! | ||
| 187 | + self.isFirstEdit = false | ||
| 188 | + } | ||
| 145 | } | 189 | } |
| 146 | cell.uploadImageSuceessBlock = { imageUrl in | 190 | cell.uploadImageSuceessBlock = { imageUrl in |
| 147 | 191 | ||
| 148 | } | 192 | } |
| 149 | cell.selectUploadImageView?.changeUploadDataCallBack = { imageUrls , videoUrl in | 193 | cell.selectUploadImageView?.changeUploadDataCallBack = { imageUrls , videoUrl in |
| 150 | - self.seleVideoUrl = videoUrl | 194 | + self.seleVideoUrl = videoUrl |
| 151 | self.seleArr = imageUrls | 195 | self.seleArr = imageUrls |
| 152 | } | 196 | } |
| 153 | 197 | ||
| @@ -160,6 +204,7 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -160,6 +204,7 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 160 | self.seleArr = arr | 204 | self.seleArr = arr |
| 161 | self.tableView.reloadData() | 205 | self.tableView.reloadData() |
| 162 | } | 206 | } |
| 207 | + | ||
| 163 | return cell | 208 | return cell |
| 164 | }else if indexPath.row == 2{ | 209 | }else if indexPath.row == 2{ |
| 165 | //ThreeCell | 210 | //ThreeCell |
| @@ -183,7 +228,11 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -183,7 +228,11 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 183 | 228 | ||
| 184 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | 229 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 185 | if indexPath.row == 0{ | 230 | if indexPath.row == 0{ |
| 186 | - return 276+15 | 231 | + if self.workAwardType == .work{ |
| 232 | + return 276+15 | ||
| 233 | + }else{ | ||
| 234 | + return 184+15 | ||
| 235 | + } | ||
| 187 | }else if indexPath.row == 1{ | 236 | }else if indexPath.row == 1{ |
| 188 | if self.secCell == nil{ | 237 | if self.secCell == nil{ |
| 189 | return self.hangHeight+268+15 | 238 | return self.hangHeight+268+15 |
| @@ -199,74 +248,138 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | @@ -199,74 +248,138 @@ class CNLiveVitaeAddWorkController:CNLiveBaseViewController,UITableViewDataSourc | ||
| 199 | 248 | ||
| 200 | //确认提交证书 | 249 | //确认提交证书 |
| 201 | @objc func addWorkBtnAction() { | 250 | @objc func addWorkBtnAction() { |
| 202 | - let firCell = self.tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? CNLiveVitaeAddWorkFirCell | ||
| 203 | - let secCell = self.tableView.cellForRow(at: IndexPath(row: 1, section: 0)) as? CNLiveVitaeAddWorkSecCell | ||
| 204 | - let threeCell = self.tableView.cellForRow(at: IndexPath(row: 2, section: 0)) as? CNLiveVitaeAddWorkThreeCell | ||
| 205 | - //判断非空 | ||
| 206 | - if firCell?.weizhiRightTitleLabel.text?.count == 0 || firCell?.weizhiRightTitleLabel.text == "请选择"{ | ||
| 207 | - showMessage(message: "请选择职业") | ||
| 208 | - return | ||
| 209 | - } | ||
| 210 | - if firCell?.phoneTextFiled.text?.count == 0 || firCell?.phoneTextFiled.text == "请填写"{ | ||
| 211 | - showMessage(message: "请填写岗位名称") | ||
| 212 | - return | ||
| 213 | - } | ||
| 214 | - if firCell?.canjiaRightTitleLabel.text?.count == 0 || firCell?.canjiaRightTitleLabel.text == "请选择"{ | ||
| 215 | - showMessage(message: "请选择开始时间") | ||
| 216 | - return | ||
| 217 | - } | ||
| 218 | - if firCell?.endTimeRightTitleLabel.text?.count == 0 || firCell?.endTimeRightTitleLabel.text == "请选择"{ | ||
| 219 | - showMessage(message: "请选择结束时间") | ||
| 220 | - return | ||
| 221 | - } | ||
| 222 | - if secCell?.huoJiangtextView.text?.count == 0 || secCell?.huoJiangtextView.text == "获奖描述"{ | ||
| 223 | - showMessage(message: "请填写经历描述") | ||
| 224 | - return | ||
| 225 | - } | ||
| 226 | 251 | ||
| 227 | - var newString = "" | ||
| 228 | - if self.seleArr?.count ?? 0 > 0{ | ||
| 229 | - if self.seleVideoUrl.count > 0{ | ||
| 230 | - self.seleArr!.append(self.seleVideoUrl) | 252 | + if self.workAwardType == .work{ |
| 253 | + let firCell = self.tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? CNLiveVitaeAddWorkFirCell | ||
| 254 | + let secCell = self.tableView.cellForRow(at: IndexPath(row: 1, section: 0)) as? CNLiveVitaeAddWorkSecCell | ||
| 255 | + let threeCell = self.tableView.cellForRow(at: IndexPath(row: 2, section: 0)) as? CNLiveVitaeAddWorkThreeCell | ||
| 256 | + | ||
| 257 | + //判断非空 | ||
| 258 | + if firCell?.weizhiRightTitleLabel.text?.count == 0 || firCell?.weizhiRightTitleLabel.text == "请选择"{ | ||
| 259 | + showMessage(message: "请选择职业") | ||
| 260 | + return | ||
| 231 | } | 261 | } |
| 232 | - newString = self.seleArr!.joined(separator: ",") | ||
| 233 | - }else{ | ||
| 234 | - if self.seleArr == nil || self.seleArr?.count ?? 0 == 0{ | ||
| 235 | - if self.seleVideoUrl.count == 0{ | ||
| 236 | - // | ||
| 237 | - showMessage(message: "请上传凭证") | ||
| 238 | - return | 262 | + if firCell?.phoneTextFiled.text?.count == 0 || firCell?.phoneTextFiled.text == "请填写"{ |
| 263 | + showMessage(message: "请填写岗位名称") | ||
| 264 | + return | ||
| 265 | + } | ||
| 266 | + if firCell?.canjiaRightTitleLabel.text?.count == 0 || firCell?.canjiaRightTitleLabel.text == "请选择"{ | ||
| 267 | + showMessage(message: "请选择开始时间") | ||
| 268 | + return | ||
| 269 | + } | ||
| 270 | + if firCell?.endTimeRightTitleLabel.text?.count == 0 || firCell?.endTimeRightTitleLabel.text == "请选择"{ | ||
| 271 | + showMessage(message: "请选择结束时间") | ||
| 272 | + return | ||
| 273 | + } | ||
| 274 | + if secCell?.huoJiangtextView.text?.count == 0 || secCell?.huoJiangtextView.text == "获奖描述"{ | ||
| 275 | + showMessage(message: "请填写经历描述") | ||
| 276 | + return | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + var newString = "" | ||
| 280 | + if self.seleArr?.count ?? 0 > 0{ | ||
| 281 | + if self.seleVideoUrl.count > 0{ | ||
| 282 | + self.seleArr!.append(self.seleVideoUrl) | ||
| 283 | + } | ||
| 284 | + newString = self.seleArr!.joined(separator: ",") | ||
| 285 | + }else{ | ||
| 286 | + if self.seleArr == nil || self.seleArr?.count ?? 0 == 0{ | ||
| 287 | + if self.seleVideoUrl.count == 0{ | ||
| 288 | + // | ||
| 289 | + showMessage(message: "请上传凭证") | ||
| 290 | + return | ||
| 291 | + }else{ | ||
| 292 | + if self.seleVideoUrl.count > 0{ | ||
| 293 | + newString = self.seleVideoUrl | ||
| 294 | + } | ||
| 295 | + } | ||
| 239 | }else{ | 296 | }else{ |
| 240 | - if self.seleVideoUrl.count > 0{ | ||
| 241 | - newString = self.seleVideoUrl | 297 | + |
| 298 | + } | ||
| 299 | + } | ||
| 300 | + let danWei = threeCell?.phoneTextFiled.text ?? "" | ||
| 301 | + let workDiDian = threeCell?.weizhiRightTitleLabel.text ?? "" | ||
| 302 | + if let userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | ||
| 303 | + let jianli_vitaeId = userDic["jianli_vitaeId"] as? String | ||
| 304 | + let vsid = userDic["vsid"] as? String | ||
| 305 | + let startTime = self.convertDateStringToMillisecondsString(dateString: firCell?.canjiaRightTitleLabel.text ?? "") | ||
| 306 | + let endTime = self.convertDateStringToMillisecondsString(dateString: firCell?.endTimeRightTitleLabel.text ?? "") | ||
| 307 | + //提交工作记录 | ||
| 308 | + var id = "" | ||
| 309 | + if self.workModel != nil{ | ||
| 310 | + id = self.workModel!.id | ||
| 311 | + } | ||
| 312 | + 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 | ||
| 313 | + if status == .success{ | ||
| 314 | + self.navigationController?.viewControllers.forEach({ item in | ||
| 315 | + if (item.isKind(of: CNLiveDigitalResumeController.self)) { | ||
| 316 | + self.navigationController?.popToViewController(item, animated: true) | ||
| 317 | + } | ||
| 318 | + }) | ||
| 242 | } | 319 | } |
| 243 | } | 320 | } |
| 244 | - }else{ | ||
| 245 | - | ||
| 246 | } | 321 | } |
| 247 | - } | ||
| 248 | - let danWei = threeCell?.phoneTextFiled.text ?? "" | ||
| 249 | - let workDiDian = threeCell?.weizhiRightTitleLabel.text ?? "" | ||
| 250 | - if let userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | ||
| 251 | - let jianli_vitaeId = userDic["jianli_vitaeId"] as? String | ||
| 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 ?? "") | ||
| 255 | - //提交工作记录 | ||
| 256 | - var id = "" | ||
| 257 | - if self.workModel != nil{ | ||
| 258 | - id = self.workModel!.id | 322 | + }else{ |
| 323 | + //获奖 | ||
| 324 | + let firCell = self.tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? CNLiveVitaeAddWorkFirCell | ||
| 325 | + let secCell = self.tableView.cellForRow(at: IndexPath(row: 1, section: 0)) as? CNLiveVitaeAddWorkSecCell | ||
| 326 | + //判断非空 | ||
| 327 | + if firCell?.phoneTextFiled.text?.count == 0 || firCell?.phoneTextFiled.text == "请填写"{ | ||
| 328 | + showMessage(message: "请填写获奖名称") | ||
| 329 | + return | ||
| 259 | } | 330 | } |
| 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 | ||
| 261 | - if status == .success{ | ||
| 262 | - self.navigationController?.viewControllers.forEach({ item in | ||
| 263 | - if (item.isKind(of: CNLiveDigitalResumeController.self)) { | ||
| 264 | - self.navigationController?.popToViewController(item, animated: true) | ||
| 265 | - } | ||
| 266 | - }) | ||
| 267 | - } | 331 | + if firCell?.canjiaRightTitleLabel.text?.count == 0 || firCell?.canjiaRightTitleLabel.text == "请选择"{ |
| 332 | + showMessage(message: "请选择开始时间") | ||
| 333 | + return | ||
| 334 | + } | ||
| 335 | + if secCell?.huoJiangtextView.text?.count == 0 || secCell?.huoJiangtextView.text == "描述"{ | ||
| 336 | + showMessage(message: "请填写描述") | ||
| 337 | + return | ||
| 268 | } | 338 | } |
| 269 | 339 | ||
| 340 | + var newString = "" | ||
| 341 | + if self.seleArr?.count ?? 0 > 0{ | ||
| 342 | + if self.seleVideoUrl.count > 0{ | ||
| 343 | + self.seleArr!.append(self.seleVideoUrl) | ||
| 344 | + } | ||
| 345 | + newString = self.seleArr!.joined(separator: ",") | ||
| 346 | + }else{ | ||
| 347 | + if self.seleArr == nil || self.seleArr?.count ?? 0 == 0{ | ||
| 348 | + if self.seleVideoUrl.count == 0{ | ||
| 349 | + // | ||
| 350 | + showMessage(message: "请上传凭证") | ||
| 351 | + return | ||
| 352 | + }else{ | ||
| 353 | + if self.seleVideoUrl.count > 0{ | ||
| 354 | + newString = self.seleVideoUrl | ||
| 355 | + } | ||
| 356 | + } | ||
| 357 | + }else{ | ||
| 358 | + | ||
| 359 | + } | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + if let userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | ||
| 363 | + let jianli_vitaeId = userDic["jianli_vitaeId"] as? String | ||
| 364 | + let vsid = userDic["vsid"] as? String | ||
| 365 | + let startTime = self.convertDateStringToMillisecondsString(dateString: firCell?.canjiaRightTitleLabel.text ?? "") | ||
| 366 | + //提交工作记录 | ||
| 367 | + var id = "" | ||
| 368 | + if self.awardModel != nil{ | ||
| 369 | + id = self.awardModel!.id | ||
| 370 | + } | ||
| 371 | + CNLiveVitaeViewModel.saveAward(company: firCell?.banfaTextFiled.text ?? "", description: secCell?.huoJiangtextView.text ?? "", time: startTime ?? "", title: firCell?.phoneTextFiled.text ?? "", imgs: newString, vsid: vsid ?? "", vitaeId: jianli_vitaeId ?? "", id: id) { result, status in | ||
| 372 | + if status == .success{ | ||
| 373 | + self.navigationController?.viewControllers.forEach({ item in | ||
| 374 | + if (item.isKind(of: CNLiveDigitalResumeController.self)) { | ||
| 375 | + self.navigationController?.popToViewController(item, animated: true) | ||
| 376 | + } | ||
| 377 | + }) | ||
| 378 | + } | ||
| 379 | + | ||
| 380 | + } | ||
| 381 | + | ||
| 382 | + } | ||
| 270 | } | 383 | } |
| 271 | 384 | ||
| 272 | } | 385 | } |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeWorkDetailController.swift
| @@ -11,6 +11,8 @@ import JFHeroBrowser | @@ -11,6 +11,8 @@ import JFHeroBrowser | ||
| 11 | class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ | 11 | class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ |
| 12 | var jianjieLblHeight:CGFloat = 40 | 12 | var jianjieLblHeight:CGFloat = 40 |
| 13 | var cellHeights:Array<CGFloat> = Array() | 13 | var cellHeights:Array<CGFloat> = Array() |
| 14 | + | ||
| 15 | + var workAwardType:CNLiveViateWorkAwardType = .work | ||
| 14 | 16 | ||
| 15 | lazy var bgImgView :UIImageView = { | 17 | lazy var bgImgView :UIImageView = { |
| 16 | let iconImgView = UIImageView() | 18 | let iconImgView = UIImageView() |
| @@ -61,8 +63,8 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -61,8 +63,8 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 61 | nextBtn.addTarget(self, action: #selector(addWorkBtnAction), for: .touchUpInside) | 63 | nextBtn.addTarget(self, action: #selector(addWorkBtnAction), for: .touchUpInside) |
| 62 | return nextBtn | 64 | return nextBtn |
| 63 | }() | 65 | }() |
| 64 | - lazy var workListArr :Array<CNLiveVitaeWorksModel> = { | ||
| 65 | - let dataArray = Array<CNLiveVitaeWorksModel>() | 66 | + lazy var workListArr :Array<Any> = { |
| 67 | + let dataArray = Array<Any>() | ||
| 66 | return dataArray | 68 | return dataArray |
| 67 | }() | 69 | }() |
| 68 | 70 | ||
| @@ -72,9 +74,19 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -72,9 +74,19 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 72 | } | 74 | } |
| 73 | override func viewDidLoad() { | 75 | override func viewDidLoad() { |
| 74 | super.viewDidLoad() | 76 | super.viewDidLoad() |
| 75 | - titleName = "工作记录" | ||
| 76 | navigationBarHidden = false | 77 | navigationBarHidden = false |
| 77 | self.initUI() | 78 | self.initUI() |
| 79 | + if self.workAwardType == .work{ | ||
| 80 | + titleName = "工作记录" | ||
| 81 | + self.bgImgView.image = UIImage(named: "mine_jianli_workBg") | ||
| 82 | + self.yuanmaLabel.text = "工作记录" | ||
| 83 | + self.addWorkBtn.setTitle("添加工作记录", for: .normal) | ||
| 84 | + }else{ | ||
| 85 | + titleName = "获奖情况" | ||
| 86 | + self.bgImgView.image = UIImage(named: "mine_jianli_awardBg") | ||
| 87 | + self.yuanmaLabel.text = "获奖情况" | ||
| 88 | + self.addWorkBtn.setTitle("添加获奖记录", for: .normal) | ||
| 89 | + } | ||
| 78 | } | 90 | } |
| 79 | 91 | ||
| 80 | deinit {} | 92 | deinit {} |
| @@ -131,17 +143,28 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -131,17 +143,28 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 131 | let cell = CNLiveVitaeWorkCell() | 143 | let cell = CNLiveVitaeWorkCell() |
| 132 | return cell | 144 | return cell |
| 133 | } | 145 | } |
| 134 | - let model = workListArr[indexPath.row] | ||
| 135 | - cell.workModel = model | 146 | + if self.workAwardType == .work{ |
| 147 | + let model = workListArr[indexPath.row] as! CNLiveVitaeWorksModel | ||
| 148 | + cell.workModel = model | ||
| 149 | + }else{ | ||
| 150 | + let model = workListArr[indexPath.row] as! CNLiveVitaeAwardsModel | ||
| 151 | + cell.awardModel = model | ||
| 152 | + } | ||
| 136 | cell.vitaeWorkCellChangedBlock = { workCell,jianjieHeight in | 153 | cell.vitaeWorkCellChangedBlock = { workCell,jianjieHeight in |
| 137 | let res = self.workListArr | 154 | let res = self.workListArr |
| 138 | - var tempArr = Array<CNLiveVitaeWorksModel>() | 155 | + var tempArr = Array<Any>() |
| 139 | let idxPath = tableView.indexPath(for: workCell) | 156 | let idxPath = tableView.indexPath(for: workCell) |
| 140 | for (idx,mdl) in res.enumerated() { | 157 | for (idx,mdl) in res.enumerated() { |
| 141 | if idx == idxPath?.row{ | 158 | if idx == idxPath?.row{ |
| 142 | - let layout = CNLiveViateWorkModelLayout(model: mdl,descH: Float(jianjieHeight)) | ||
| 143 | - let newWorkModel = layout.getCellHModel() | ||
| 144 | - tempArr.append(newWorkModel) | 159 | + if self.workAwardType == .work{ |
| 160 | + let layout = CNLiveViateWorkModelLayout(model: mdl as! CNLiveVitaeWorksModel,descH: Float(jianjieHeight)) | ||
| 161 | + let newWorkModel = layout.getCellHModel() | ||
| 162 | + tempArr.append(newWorkModel) | ||
| 163 | + }else{ | ||
| 164 | + let layout = CNLiveViateAwardModelLayout(model: mdl as! CNLiveVitaeAwardsModel,descH: Float(jianjieHeight)) | ||
| 165 | + let newWorkModel = layout.getCellHModel() | ||
| 166 | + tempArr.append(newWorkModel) | ||
| 167 | + } | ||
| 145 | }else{ | 168 | }else{ |
| 146 | tempArr.append(mdl) | 169 | tempArr.append(mdl) |
| 147 | } | 170 | } |
| @@ -171,32 +194,59 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -171,32 +194,59 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 171 | } | 194 | } |
| 172 | 195 | ||
| 173 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | 196 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| 174 | - let model = self.workListArr[indexPath.row] | ||
| 175 | - return CGFloat(model.cellH) | 197 | + if self.workAwardType == .work{ |
| 198 | + let model = self.workListArr[indexPath.row] as! CNLiveVitaeWorksModel | ||
| 199 | + return CGFloat(model.cellH) | ||
| 200 | + }else{ | ||
| 201 | + let model = self.workListArr[indexPath.row] as! CNLiveVitaeAwardsModel | ||
| 202 | + return CGFloat(model.cellH) | ||
| 203 | + } | ||
| 176 | } | 204 | } |
| 177 | 205 | ||
| 178 | @objc func addWorkBtnAction(){ | 206 | @objc func addWorkBtnAction(){ |
| 179 | - self.navigationController?.pushViewController(CNLiveVitaeAddWorkController(), animated: true) | 207 | + let vc = CNLiveVitaeAddWorkController() |
| 208 | + vc.workAwardType = self.workAwardType | ||
| 209 | + self.navigationController?.pushViewController(vc, animated: true) | ||
| 180 | } | 210 | } |
| 181 | 211 | ||
| 182 | func getWorkList(){ | 212 | func getWorkList(){ |
| 183 | let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" | 213 | let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "" |
| 184 | - CNLiveVitaeViewModel.getWorkList(vsid: vsid){ result, respStatus in | ||
| 185 | - if respStatus == .success{ | ||
| 186 | - if let res = result as? [CNLiveVitaeWorksModel]{ | ||
| 187 | - self.workListArr = Array() | ||
| 188 | - for mdl in res { | ||
| 189 | - let layout = CNLiveViateWorkModelLayout(model: mdl,descH: 40.0) | ||
| 190 | - let newWorkModel = layout.getCellHModel() | ||
| 191 | - self.workListArr.append(newWorkModel) | 214 | + if self.workAwardType == .work{ |
| 215 | + CNLiveVitaeViewModel.getWorkList(vsid: vsid){ result, respStatus in | ||
| 216 | + if respStatus == .success{ | ||
| 217 | + if let res = result as? [CNLiveVitaeWorksModel]{ | ||
| 218 | + self.workListArr = Array() | ||
| 219 | + for mdl in res { | ||
| 220 | + let layout = CNLiveViateWorkModelLayout(model: mdl,descH: 40.0) | ||
| 221 | + let newWorkModel = layout.getCellHModel() | ||
| 222 | + self.workListArr.append(newWorkModel) | ||
| 223 | + } | ||
| 224 | + self.tableView.reloadData() | ||
| 225 | + self.yuanmaDescLabel.text = "共 \(res.count) 条" | ||
| 226 | + } | ||
| 227 | + }else{ | ||
| 228 | + showMessage(message: "数据异常") | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + } | ||
| 232 | + }else{ | ||
| 233 | + CNLiveVitaeViewModel.getAwardList(vsid: vsid){ result, respStatus in | ||
| 234 | + if respStatus == .success{ | ||
| 235 | + if let res = result as? [CNLiveVitaeAwardsModel]{ | ||
| 236 | + self.workListArr = Array() | ||
| 237 | + for mdl in res { | ||
| 238 | + let layout = CNLiveViateAwardModelLayout(model: mdl,descH: 40.0) | ||
| 239 | + let newWorkModel = layout.getCellHModel() | ||
| 240 | + self.workListArr.append(newWorkModel) | ||
| 241 | + } | ||
| 242 | + self.tableView.reloadData() | ||
| 243 | + self.yuanmaDescLabel.text = "共 \(res.count) 条" | ||
| 192 | } | 244 | } |
| 193 | - self.tableView.reloadData() | ||
| 194 | - self.yuanmaDescLabel.text = "共 \(res.count) 条" | 245 | + }else{ |
| 246 | + showMessage(message: "数据异常") | ||
| 195 | } | 247 | } |
| 196 | - }else{ | ||
| 197 | - showMessage(message: "数据异常") | 248 | + |
| 198 | } | 249 | } |
| 199 | - | ||
| 200 | } | 250 | } |
| 201 | } | 251 | } |
| 202 | } | 252 | } |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/DigitalResume/CNLiveDigitalResumeCell.swift
| @@ -553,7 +553,19 @@ class CNLiveDigitalResumeCell: UITableViewCell { | @@ -553,7 +553,19 @@ class CNLiveDigitalResumeCell: UITableViewCell { | ||
| 553 | } | 553 | } |
| 554 | } | 554 | } |
| 555 | @objc func huojiangDetailTitleLabelAciton(){ | 555 | @objc func huojiangDetailTitleLabelAciton(){ |
| 556 | - | 556 | + //获奖情况 |
| 557 | + let works = self.vitaeModel?.awards | ||
| 558 | + if works?.count ?? 0 > 0{ | ||
| 559 | + //有获奖->获奖情况页面 | ||
| 560 | + let vc = CNLiveVitaeWorkDetailController() | ||
| 561 | + vc.workAwardType = .award | ||
| 562 | + navigationViewController().pushViewController(vc, animated: true) | ||
| 563 | + }else{ | ||
| 564 | + //无获奖->新增获奖情况页面 | ||
| 565 | + let vc = CNLiveVitaeAddWorkController() | ||
| 566 | + vc.workAwardType = .award | ||
| 567 | + navigationViewController().pushViewController(vc, animated: true) | ||
| 568 | + } | ||
| 557 | } | 569 | } |
| 558 | @objc func chakanTitleLabelAciton(){ | 570 | @objc func chakanTitleLabelAciton(){ |
| 559 | 571 |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkFirCell.swift
| @@ -11,6 +11,24 @@ import SnapKit | @@ -11,6 +11,24 @@ import SnapKit | ||
| 11 | 11 | ||
| 12 | class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | 12 | class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ |
| 13 | var zhiyeStr:String = "" | 13 | var zhiyeStr:String = "" |
| 14 | + | ||
| 15 | +// var workAwardType:CNLiveViateWorkAwardType = .work | ||
| 16 | + var _workAwardType:CNLiveViateWorkAwardType = .work | ||
| 17 | + var workAwardType : CNLiveViateWorkAwardType { | ||
| 18 | + get{ | ||
| 19 | + _workAwardType | ||
| 20 | + } | ||
| 21 | + set{ | ||
| 22 | + _workAwardType = newValue | ||
| 23 | + if _workAwardType == .work{ | ||
| 24 | + self.initUI() | ||
| 25 | + }else{ | ||
| 26 | + self.awardUI() | ||
| 27 | + } | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + | ||
| 14 | //简历workModel | 32 | //简历workModel |
| 15 | var _workModel : CNLiveVitaeWorksModel? | 33 | var _workModel : CNLiveVitaeWorksModel? |
| 16 | var workModel : CNLiveVitaeWorksModel? { | 34 | var workModel : CNLiveVitaeWorksModel? { |
| @@ -22,6 +40,17 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -22,6 +40,17 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 22 | setupNewUI(model: _workModel!) | 40 | setupNewUI(model: _workModel!) |
| 23 | } | 41 | } |
| 24 | } | 42 | } |
| 43 | + //简历awardModel | ||
| 44 | + var _awardModel : CNLiveVitaeAwardsModel? | ||
| 45 | + var awardModel : CNLiveVitaeAwardsModel? { | ||
| 46 | + get{ | ||
| 47 | + _awardModel | ||
| 48 | + } | ||
| 49 | + set{ | ||
| 50 | + _awardModel = newValue! | ||
| 51 | + setupNewAwardUI(model: _awardModel!) | ||
| 52 | + } | ||
| 53 | + } | ||
| 25 | 54 | ||
| 26 | lazy var topWhiteView :UIView = { | 55 | lazy var topWhiteView :UIView = { |
| 27 | let bottomNavView = UIView() | 56 | let bottomNavView = UIView() |
| @@ -64,6 +93,7 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -64,6 +93,7 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 64 | bottomNavView.backgroundColor = HexColor("#EAEAEA") | 93 | bottomNavView.backgroundColor = HexColor("#EAEAEA") |
| 65 | return bottomNavView | 94 | return bottomNavView |
| 66 | }() | 95 | }() |
| 96 | + //"岗位名称"或"获奖名称" | ||
| 67 | lazy var lianxiTitleLabel: UILabel = { | 97 | lazy var lianxiTitleLabel: UILabel = { |
| 68 | let titleLabel = UILabel.init() | 98 | let titleLabel = UILabel.init() |
| 69 | titleLabel.textColor = HexColor("#333333") | 99 | titleLabel.textColor = HexColor("#333333") |
| @@ -166,13 +196,43 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -166,13 +196,43 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 166 | closeBtn.addTarget(self, action: #selector(zhiJinBtnAction), for: .touchUpInside) | 196 | closeBtn.addTarget(self, action: #selector(zhiJinBtnAction), for: .touchUpInside) |
| 167 | return closeBtn | 197 | return closeBtn |
| 168 | }() | 198 | }() |
| 199 | + | ||
| 200 | + //获奖-颁发单位 | ||
| 201 | + lazy var banfaTitleLabel: UILabel = { | ||
| 202 | + let titleLabel = UILabel.init() | ||
| 203 | + titleLabel.textColor = HexColor("#333333") | ||
| 204 | + titleLabel.text = "颁发单位" | ||
| 205 | + titleLabel.textAlignment = .left | ||
| 206 | + titleLabel.font = BoldFont_15 | ||
| 207 | + titleLabel.adjustsFontSizeToFitWidth=true | ||
| 208 | + return titleLabel | ||
| 209 | + }() | ||
| 210 | + lazy var xuantianTitleLabel: UILabel = { | ||
| 211 | + let titleLabel = UILabel.init() | ||
| 212 | + titleLabel.textColor = HexColor("#B4B4B4") | ||
| 213 | + titleLabel.text = "(选填)" | ||
| 214 | + titleLabel.textAlignment = .left | ||
| 215 | + titleLabel.font = Font_13 | ||
| 216 | + titleLabel.adjustsFontSizeToFitWidth=true | ||
| 217 | + return titleLabel | ||
| 218 | + }() | ||
| 219 | + lazy var banfaTextFiled :UITextField = { | ||
| 220 | + let textFiled = UITextField() | ||
| 221 | + textFiled.textAlignment = .right | ||
| 222 | + textFiled.font = Font_15 | ||
| 223 | + textFiled.attributedPlaceholder = NSAttributedString(string: "请输入", attributes: [.foregroundColor: HexColor("#B4B4B4")!]) | ||
| 224 | + textFiled.textColor = HexColor("#333333") | ||
| 225 | + textFiled.delegate = self | ||
| 226 | + textFiled.returnKeyType = .done | ||
| 227 | + textFiled.clearButtonMode = .whileEditing | ||
| 228 | + return textFiled | ||
| 229 | + }() | ||
| 169 | 230 | ||
| 170 | override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | 231 | override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { |
| 171 | super.init(style: style, reuseIdentifier: reuseIdentifier) | 232 | super.init(style: style, reuseIdentifier: reuseIdentifier) |
| 172 | self.selectionStyle = .none | 233 | self.selectionStyle = .none |
| 173 | self.backgroundColor = .clear | 234 | self.backgroundColor = .clear |
| 174 | self.contentView.backgroundColor = .clear | 235 | self.contentView.backgroundColor = .clear |
| 175 | - self.initUI() | ||
| 176 | } | 236 | } |
| 177 | 237 | ||
| 178 | required init?(coder: NSCoder) { | 238 | required init?(coder: NSCoder) { |
| @@ -301,6 +361,92 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -301,6 +361,92 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 301 | 361 | ||
| 302 | } | 362 | } |
| 303 | 363 | ||
| 364 | + func awardUI(){ | ||
| 365 | + | ||
| 366 | + self.contentView.addSubview(self.topWhiteView) | ||
| 367 | + self.topWhiteView.snp.makeConstraints { make in | ||
| 368 | + make.top.equalTo(15) | ||
| 369 | + make.left.equalTo(15) | ||
| 370 | + make.right.equalToSuperview().offset(-15) | ||
| 371 | + make.height.equalTo(184) | ||
| 372 | + } | ||
| 373 | + self.topWhiteView.addSubview(self.lianxiTitleLabel) | ||
| 374 | + self.lianxiTitleLabel.text = "获奖名称" | ||
| 375 | + self.lianxiTitleLabel.snp.makeConstraints { make in | ||
| 376 | + make.top.equalTo(20) | ||
| 377 | + make.left.equalTo(15) | ||
| 378 | + make.width.equalTo(62) | ||
| 379 | + make.height.equalTo(21) | ||
| 380 | + } | ||
| 381 | + self.topWhiteView.addSubview(self.phoneTextFiled) | ||
| 382 | + self.phoneTextFiled.snp.makeConstraints { make in | ||
| 383 | + make.centerY.equalTo(self.lianxiTitleLabel.snp.centerY) | ||
| 384 | + make.left.equalTo(self.lianxiTitleLabel.snp.right).offset(10) | ||
| 385 | + make.right.equalToSuperview().offset(-15) | ||
| 386 | + make.height.equalTo(21) | ||
| 387 | + } | ||
| 388 | + self.topWhiteView.addSubview(self.topLine2View) | ||
| 389 | + self.topLine2View.snp.makeConstraints { make in | ||
| 390 | + make.top.equalTo(self.lianxiTitleLabel.snp.bottom).offset(adapt_length(length: 20)) | ||
| 391 | + make.left.equalTo(15) | ||
| 392 | + make.height.equalTo(0.5) | ||
| 393 | + make.right.equalToSuperview().offset(-15) | ||
| 394 | + } | ||
| 395 | + self.topWhiteView.addSubview(self.canjiaTitleLabel) | ||
| 396 | + self.canjiaTitleLabel.snp.makeConstraints { make in | ||
| 397 | + make.top.equalTo(self.topLine2View.snp.bottom).offset(adapt_length(length: 20)) | ||
| 398 | + make.left.equalTo(15) | ||
| 399 | + } | ||
| 400 | + self.topWhiteView.addSubview(self.canjiaRightTitleLabel) | ||
| 401 | + self.canjiaRightTitleLabel.snp.makeConstraints { make in | ||
| 402 | + make.centerY.equalTo(self.canjiaTitleLabel.snp.centerY) | ||
| 403 | + make.right.equalToSuperview().offset(-28) | ||
| 404 | + make.left.equalTo(self.canjiaTitleLabel.snp.right).offset(5) | ||
| 405 | + make.height.equalTo(21) | ||
| 406 | + } | ||
| 407 | + self.topWhiteView.addSubview(self.canjiaRightImgView) | ||
| 408 | + self.canjiaRightImgView.snp.makeConstraints { make in | ||
| 409 | + make.width.height.equalTo(13) | ||
| 410 | + make.centerY.equalTo(self.canjiaRightTitleLabel.snp.centerY) | ||
| 411 | + make.left.equalTo(self.canjiaRightTitleLabel.snp.right) | ||
| 412 | + } | ||
| 413 | + self.topWhiteView.addSubview(self.canjiaTapView) | ||
| 414 | + self.canjiaTapView.snp.makeConstraints { make in | ||
| 415 | + make.left.right.equalToSuperview() | ||
| 416 | + make.top.equalTo(self.topLine2View.snp.bottom) | ||
| 417 | + make.bottom.equalTo(self.canjiaTitleLabel.snp.bottom).offset(adapt_length(length: 20)) | ||
| 418 | + } | ||
| 419 | + self.topWhiteView.addSubview(self.topLine3View) | ||
| 420 | + self.topLine3View.snp.makeConstraints { make in | ||
| 421 | + make.top.equalTo(self.canjiaTitleLabel.snp.bottom).offset(adapt_length(length: 20)) | ||
| 422 | + make.left.equalTo(15) | ||
| 423 | + make.height.equalTo(0.5) | ||
| 424 | + make.right.equalToSuperview().offset(-15) | ||
| 425 | + } | ||
| 426 | + | ||
| 427 | + self.topWhiteView.addSubview(self.banfaTitleLabel) | ||
| 428 | + self.banfaTitleLabel.snp.makeConstraints { make in | ||
| 429 | + make.top.equalTo(self.topLine3View.snp.bottom).offset(adapt_length(length: 20)) | ||
| 430 | + make.left.equalTo(15) | ||
| 431 | + make.width.equalTo(62) | ||
| 432 | + make.height.equalTo(21) | ||
| 433 | + } | ||
| 434 | + self.topWhiteView.addSubview(self.xuantianTitleLabel) | ||
| 435 | + self.xuantianTitleLabel.snp.makeConstraints { make in | ||
| 436 | + make.centerY.equalTo(self.banfaTitleLabel.snp.centerY) | ||
| 437 | + make.width.equalTo(50) | ||
| 438 | + make.left.equalTo(self.banfaTitleLabel.snp.right).offset(5) | ||
| 439 | + make.height.equalTo(21) | ||
| 440 | + } | ||
| 441 | + self.topWhiteView.addSubview(self.banfaTextFiled) | ||
| 442 | + self.banfaTextFiled.snp.makeConstraints { make in | ||
| 443 | + make.centerY.equalTo(self.xuantianTitleLabel.snp.centerY) | ||
| 444 | + make.left.equalTo(self.xuantianTitleLabel.snp.right).offset(10) | ||
| 445 | + make.right.equalToSuperview().offset(-15) | ||
| 446 | + make.height.equalTo(21) | ||
| 447 | + } | ||
| 448 | + } | ||
| 449 | + | ||
| 304 | // MARK: - UITextFieldDelegate | 450 | // MARK: - UITextFieldDelegate |
| 305 | func textFieldDidEndEditing(_ textField: UITextField) { | 451 | func textFieldDidEndEditing(_ textField: UITextField) { |
| 306 | currentViewController()?.view.endEditing(true) | 452 | currentViewController()?.view.endEditing(true) |
| @@ -357,6 +503,23 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | @@ -357,6 +503,23 @@ class CNLiveVitaeAddWorkFirCell:UITableViewCell, UITextFieldDelegate{ | ||
| 357 | } | 503 | } |
| 358 | } | 504 | } |
| 359 | 505 | ||
| 506 | + //获奖 | ||
| 507 | + func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ | ||
| 508 | + | ||
| 509 | + self.weizhiRightTitleLabel.text = model.title | ||
| 510 | + self.banfaTextFiled.text = model.company | ||
| 511 | + | ||
| 512 | + let startStr = self.convertMillisecondsStringToDateString(millisecondsString: model.time) | ||
| 513 | + if startStr?.count ?? 0 > 0{ | ||
| 514 | + self.canjiaRightTitleLabel.text = startStr | ||
| 515 | + self.canjiaRightTitleLabel.textColor = HexColor("#333333") | ||
| 516 | + }else{ | ||
| 517 | + self.canjiaRightTitleLabel.text = "请选择" | ||
| 518 | + self.canjiaRightTitleLabel.textColor = HexColor("#B4B4B4") | ||
| 519 | + } | ||
| 520 | + } | ||
| 521 | + | ||
| 522 | + //工作记录 | ||
| 360 | func setupNewUI(model:CNLiveVitaeWorksModel){ | 523 | func setupNewUI(model:CNLiveVitaeWorksModel){ |
| 361 | self.weizhiRightTitleLabel.text = model.profession | 524 | self.weizhiRightTitleLabel.text = model.profession |
| 362 | self.phoneTextFiled.text = model.position | 525 | self.phoneTextFiled.text = model.position |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeAddWorkSecCell.swift
| @@ -13,6 +13,7 @@ typealias UpdateAddWorkSecCellHeightBlock = (_ currentCell: CNLiveVitaeAddWorkSe | @@ -13,6 +13,7 @@ typealias UpdateAddWorkSecCellHeightBlock = (_ currentCell: CNLiveVitaeAddWorkSe | ||
| 13 | 13 | ||
| 14 | class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | 14 | class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ |
| 15 | var updateAddWorkSecCellHeightBlock:UpdateAddWorkSecCellHeightBlock? | 15 | var updateAddWorkSecCellHeightBlock:UpdateAddWorkSecCellHeightBlock? |
| 16 | + var workAwardType:CNLiveViateWorkAwardType = .work | ||
| 16 | 17 | ||
| 17 | //简历workModel | 18 | //简历workModel |
| 18 | var _workModel : CNLiveVitaeWorksModel? | 19 | var _workModel : CNLiveVitaeWorksModel? |
| @@ -25,6 +26,17 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | @@ -25,6 +26,17 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | ||
| 25 | setupNewUI(model: _workModel!) | 26 | setupNewUI(model: _workModel!) |
| 26 | } | 27 | } |
| 27 | } | 28 | } |
| 29 | + //简历awardModel | ||
| 30 | + var _awardModel : CNLiveVitaeAwardsModel? | ||
| 31 | + var awardModel : CNLiveVitaeAwardsModel? { | ||
| 32 | + get{ | ||
| 33 | + _awardModel | ||
| 34 | + } | ||
| 35 | + set{ | ||
| 36 | + _awardModel = newValue! | ||
| 37 | + setupNewAwardUI(model: _awardModel!) | ||
| 38 | + } | ||
| 39 | + } | ||
| 28 | 40 | ||
| 29 | lazy var topWhiteView :UIView = { | 41 | lazy var topWhiteView :UIView = { |
| 30 | let bottomNavView = UIView() | 42 | let bottomNavView = UIView() |
| @@ -53,7 +65,7 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | @@ -53,7 +65,7 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | ||
| 53 | let p_textView = UITextView.init() | 65 | let p_textView = UITextView.init() |
| 54 | p_textView.backgroundColor = .clear | 66 | p_textView.backgroundColor = .clear |
| 55 | p_textView.font = Font_15 | 67 | p_textView.font = Font_15 |
| 56 | - p_textView.text = "获奖描述" | 68 | + p_textView.text = "描述" |
| 57 | p_textView.textColor = HexColor("#B3B3B3") | 69 | p_textView.textColor = HexColor("#B3B3B3") |
| 58 | p_textView.delegate = self | 70 | p_textView.delegate = self |
| 59 | return p_textView | 71 | return p_textView |
| @@ -200,6 +212,23 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | @@ -200,6 +212,23 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | ||
| 200 | 212 | ||
| 201 | } | 213 | } |
| 202 | 214 | ||
| 215 | + //获奖 | ||
| 216 | + func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ | ||
| 217 | + self.huoJiangtextView.text = model.description | ||
| 218 | + self.huoJiangNumberLabel.text = "\(model.description.count)/1000" | ||
| 219 | + let imgArr = model.imgs.components(separatedBy: ",") | ||
| 220 | + var tempImgArr = Array<String>() | ||
| 221 | + var tempVideoUrl = "" | ||
| 222 | + for (_,imgUrl) in imgArr.enumerated() { | ||
| 223 | + if imgUrl.contains("vitae_video_"){ | ||
| 224 | + tempVideoUrl = imgUrl | ||
| 225 | + }else{ | ||
| 226 | + tempImgArr.append(imgUrl) | ||
| 227 | + } | ||
| 228 | + } | ||
| 229 | + self.selectUploadImageView?.networkImageArr = tempImgArr | ||
| 230 | + self.selectUploadImageView?.networkVideoUrl = tempVideoUrl | ||
| 231 | + } | ||
| 203 | func setupNewUI(model:CNLiveVitaeWorksModel){ | 232 | func setupNewUI(model:CNLiveVitaeWorksModel){ |
| 204 | self.huoJiangtextView.text = model.jobDuties | 233 | self.huoJiangtextView.text = model.jobDuties |
| 205 | self.huoJiangNumberLabel.text = "\(model.jobDuties.count)/1000" | 234 | self.huoJiangNumberLabel.text = "\(model.jobDuties.count)/1000" |
| @@ -220,13 +249,13 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | @@ -220,13 +249,13 @@ class CNLiveVitaeAddWorkSecCell:UITableViewCell, UITextViewDelegate{ | ||
| 220 | 249 | ||
| 221 | func textViewDidEndEditing(_ textView: UITextView) { | 250 | func textViewDidEndEditing(_ textView: UITextView) { |
| 222 | if textView.text.lengthOfBytes(using: .utf8) < 1 { | 251 | if textView.text.lengthOfBytes(using: .utf8) < 1 { |
| 223 | - textView.text = textView_placeholder | 252 | + textView.text = "描述" |
| 224 | textView.textColor = HexColor("#B3B3B3") | 253 | textView.textColor = HexColor("#B3B3B3") |
| 225 | // setupWithSendBtnStatue(statue: false) | 254 | // setupWithSendBtnStatue(statue: false) |
| 226 | } | 255 | } |
| 227 | } | 256 | } |
| 228 | func textViewDidBeginEditing(_ textView: UITextView) { | 257 | func textViewDidBeginEditing(_ textView: UITextView) { |
| 229 | - if textView.text == "获奖描述" { | 258 | + if textView.text == "描述" { |
| 230 | textView.text = "" | 259 | textView.text = "" |
| 231 | textView.textColor = .black | 260 | textView.textColor = .black |
| 232 | // setupWithSendBtnStatue(statue: true) | 261 | // setupWithSendBtnStatue(statue: true) |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeWorkCell.swift
| @@ -40,6 +40,18 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -40,6 +40,18 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 40 | setupNewUI(model: _workModel!) | 40 | setupNewUI(model: _workModel!) |
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| 43 | + //简历awardModel | ||
| 44 | + var _awardModel : CNLiveVitaeAwardsModel? | ||
| 45 | + var awardModel : CNLiveVitaeAwardsModel? { | ||
| 46 | + get{ | ||
| 47 | + _awardModel | ||
| 48 | + } | ||
| 49 | + set{ | ||
| 50 | + _awardModel = newValue! | ||
| 51 | + setupNewAwardUI(model: _awardModel!) | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | + | ||
| 43 | 55 | ||
| 44 | lazy var whiteBgView :UIView = { | 56 | lazy var whiteBgView :UIView = { |
| 45 | let whiteBgView = UIView() | 57 | let whiteBgView = UIView() |
| @@ -52,7 +64,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -52,7 +64,7 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 52 | let titleLabel = UILabel() | 64 | let titleLabel = UILabel() |
| 53 | titleLabel.textColor = HexColor("#333333") | 65 | titleLabel.textColor = HexColor("#333333") |
| 54 | titleLabel.textAlignment = .left | 66 | titleLabel.textAlignment = .left |
| 55 | - titleLabel.text = "职业" | 67 | + titleLabel.text = "" |
| 56 | titleLabel.font = BoldFont_16 | 68 | titleLabel.font = BoldFont_16 |
| 57 | return titleLabel | 69 | return titleLabel |
| 58 | }() | 70 | }() |
| @@ -259,6 +271,91 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -259,6 +271,91 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 259 | fatalError("init(coder:) has not been implemented") | 271 | fatalError("init(coder:) has not been implemented") |
| 260 | } | 272 | } |
| 261 | 273 | ||
| 274 | + //获奖 | ||
| 275 | + func setupNewAwardUI(model:CNLiveVitaeAwardsModel){ | ||
| 276 | + self.whiteBgView.subviews.forEach { view in | ||
| 277 | + if view.tag >= 1000{ | ||
| 278 | + view.removeFromSuperview() | ||
| 279 | + } | ||
| 280 | + } | ||
| 281 | + self.workTitleLabel.text = model.title | ||
| 282 | + | ||
| 283 | + let startDateString = convertTimestampStringToDateString(timestampString: model.time) | ||
| 284 | + self.workNameTitleLabel.text = startDateString ?? "" | ||
| 285 | + | ||
| 286 | + self.workPositionTitleLabel.text = model.company | ||
| 287 | + | ||
| 288 | + self.jianjieLabel.text = model.description//"描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" | ||
| 289 | + let lines = jianjieLabel.getRealLabelTextLines() | ||
| 290 | + let height = jianjieLabel.qmui_lineHeight | ||
| 291 | + if lines <= 2{ | ||
| 292 | + self.expandBtn.isHidden = true | ||
| 293 | + }else{ | ||
| 294 | + self.expandBtn.isHidden = false | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + if self.expandBtn.isSelected{ | ||
| 298 | + //展开状态 | ||
| 299 | + self.jianjieLabel.height = height*CGFloat(lines) | ||
| 300 | + | ||
| 301 | + }else{ | ||
| 302 | + //收起状态 | ||
| 303 | + if lines <= 2{ | ||
| 304 | + //小于2行,按实际行数 | ||
| 305 | + self.jianjieLabel.height = CGFloat(lines)*height | ||
| 306 | + }else{ | ||
| 307 | + //大于2行, 显示2行 | ||
| 308 | + self.jianjieLabel.height = 2*height | ||
| 309 | + } | ||
| 310 | + } | ||
| 311 | + | ||
| 312 | + let imgArr = model.imgs.components(separatedBy: ",") | ||
| 313 | + if imgArr.count > 0{ | ||
| 314 | + for i in 0..<imgArr.count { | ||
| 315 | + let imgWH:Float = Float((KSreenWidth-60-15)/3.0) | ||
| 316 | + let imgGap:Float = 7.5 | ||
| 317 | + let imgLeftGap:Float = 15 | ||
| 318 | + let lie = i%3 | ||
| 319 | + let hang = i/3 | ||
| 320 | + let imgView = UIImageView(frame: CGRect(x: CGFloat(imgLeftGap+(imgGap+imgWH)*Float(lie)), y: CGFloat((imgWH+10)*Float(hang))+self.jianjieLabel.bottom+10, width: CGFloat(imgWH), height: CGFloat(imgWH))) | ||
| 321 | + imgView.isUserInteractionEnabled = true | ||
| 322 | + imgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(imgViewTapAciton))) | ||
| 323 | + imgView.tag = 1000+i | ||
| 324 | + imgView.contentMode = .center | ||
| 325 | + let imgUrl = imgArr[i] | ||
| 326 | + imgView.clipsToBounds = true | ||
| 327 | + imgView.layer.cornerRadius = 5 | ||
| 328 | + self.whiteBgView.addSubview(imgView) | ||
| 329 | + | ||
| 330 | + if imgUrl.contains("vitae_video_"){ | ||
| 331 | + //是视频 | ||
| 332 | + let thumbailImgUrl = "http://wjjtest.ys2.cnliveimg.com/802/mateCode/img/vitae_photo_0/2024/08/02/3977195366.jpg" | ||
| 333 | + let vm = HeroBrowserVideoViewModule(thumbailImgUrl: thumbailImgUrl, videoUrl: imgUrl, provider: HeroNetworkImageProvider.shared, autoPlay: true) | ||
| 334 | + self.images.append(vm) | ||
| 335 | + imgView.kf.setImage(with: URL(string: thumbailImgUrl),placeholder: UIImage(color: UIColor.lightGray, size: imgView.size)) | ||
| 336 | + | ||
| 337 | + let playBtn = UIButton(type: .custom) | ||
| 338 | + playBtn.frame = imgView.bounds | ||
| 339 | + playBtn.setImage(UIImage(named: "short_video_play"), for: .normal) | ||
| 340 | + playBtn.addTarget(self, action: #selector(playBtnAction(btn:)), for: .touchUpInside) | ||
| 341 | + playBtn.clipsToBounds = true | ||
| 342 | + playBtn.layer.cornerRadius = 5 | ||
| 343 | + playBtn.tag = 1000+i | ||
| 344 | + imgView.addSubview(playBtn) | ||
| 345 | + }else if imgUrl.contains("vitae_photo_"){ | ||
| 346 | + //是图片 | ||
| 347 | + self.images.append(HeroBrowserNetworkImageViewModule(thumbailImgUrl: nil, originImgUrl: imgUrl)) | ||
| 348 | + imgView.kf.setImage(with: URL(string: imgUrl)) | ||
| 349 | + }else{ | ||
| 350 | + //默认图片 | ||
| 351 | + self.images.append(HeroBrowserNetworkImageViewModule(thumbailImgUrl: nil, originImgUrl: imgUrl)) | ||
| 352 | + imgView.kf.setImage(with: URL(string: imgUrl)) | ||
| 353 | + } | ||
| 354 | + } | ||
| 355 | + } | ||
| 356 | + self.workDingWeiTitleLabel.isHidden = true | ||
| 357 | + } | ||
| 358 | + //工作 | ||
| 262 | func setupNewUI(model:CNLiveVitaeWorksModel){ | 359 | func setupNewUI(model:CNLiveVitaeWorksModel){ |
| 263 | self.whiteBgView.subviews.forEach { view in | 360 | self.whiteBgView.subviews.forEach { view in |
| 264 | if view.tag >= 1000{ | 361 | if view.tag >= 1000{ |
| @@ -392,12 +489,28 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -392,12 +489,28 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 392 | } | 489 | } |
| 393 | @objc func editBtnAction(){ | 490 | @objc func editBtnAction(){ |
| 394 | let vc = CNLiveVitaeAddWorkController() | 491 | let vc = CNLiveVitaeAddWorkController() |
| 395 | - vc.workModel = self.workModel | 492 | + if self.workModel != nil{ |
| 493 | + vc.workModel = self.workModel | ||
| 494 | + } | ||
| 495 | + if self.awardModel != nil{ | ||
| 496 | + vc.awardModel = self.awardModel | ||
| 497 | + } | ||
| 396 | navigationViewController().pushViewController(vc, animated: true) | 498 | navigationViewController().pushViewController(vc, animated: true) |
| 397 | } | 499 | } |
| 398 | @objc func deleteBtnAction(){ | 500 | @objc func deleteBtnAction(){ |
| 399 | - | ||
| 400 | - CNLiveVitaeViewModel.deleteVitae(id: self.workModel?.id ?? "", vsid: self.workModel?.vsid ?? "", type: "4") { result, status in | 501 | + var type = "4" |
| 502 | + var id = "" | ||
| 503 | + var vsid = "" | ||
| 504 | + if self.workModel != nil{ | ||
| 505 | + type = "4" | ||
| 506 | + id = self.workModel?.id ?? "" | ||
| 507 | + vsid = self.workModel?.vsid ?? "" | ||
| 508 | + }else{ | ||
| 509 | + type = "5" | ||
| 510 | + id = self.awardModel?.id ?? "" | ||
| 511 | + vsid = self.workModel?.vsid ?? "" | ||
| 512 | + } | ||
| 513 | + CNLiveVitaeViewModel.deleteVitae(id: id, vsid: vsid, type: type) { result, status in | ||
| 401 | if status == .success{ | 514 | if status == .success{ |
| 402 | showMessage(message: "删除成功") | 515 | showMessage(message: "删除成功") |
| 403 | self.vitaeWorkListBlock?() | 516 | self.vitaeWorkListBlock?() |
metaCode/Classes/Main/HomePage/ViewModel/Vitae/CNLiveVitaeViewModel.swift
| @@ -376,6 +376,105 @@ class CNLiveVitaeViewModel:NSObject{ | @@ -376,6 +376,105 @@ class CNLiveVitaeViewModel:NSObject{ | ||
| 376 | 376 | ||
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | + /* | ||
| 380 | + 保存简历-获奖情况(新增获奖情况) | ||
| 381 | + 参数 vsid 实名对象id | ||
| 382 | + */ | ||
| 383 | + static func saveAward(company:String,description:String,time:String,title:String,imgs:String,vsid:String,vitaeId:String,id:String,resultBlock: @escaping downSlideResultBlock) { | ||
| 384 | + let values = NSMutableDictionary() | ||
| 385 | + values.addEntries(from: ["company":company]) | ||
| 386 | + values.addEntries(from: ["description":description]) | ||
| 387 | + values.addEntries(from: ["time":time]) | ||
| 388 | + values.addEntries(from: ["title":title]) | ||
| 389 | + values.addEntries(from: ["imgs":imgs]) | ||
| 390 | + values.addEntries(from: ["vsid":vsid]) | ||
| 391 | + values.addEntries(from: ["vitaeId":vitaeId]) | ||
| 392 | + if id.count > 0{ | ||
| 393 | + values.addEntries(from: ["id":id]) | ||
| 394 | + } | ||
| 395 | + do { | ||
| 396 | + let request = URLRequest.init(url: URL.init(string: APPBaseMCUrl+"/userApi/saveVitaeAwards")!) as! NSMutableURLRequest | ||
| 397 | + request.httpMethod = "POST" | ||
| 398 | + request.timeoutInterval = 10 | ||
| 399 | + request.setValue("application/json", forHTTPHeaderField: "Content-Type") | ||
| 400 | + let data = try JSONSerialization.data(withJSONObject: values, options: .prettyPrinted) | ||
| 401 | + request.httpBody = data | ||
| 402 | + showLoading(message: "") | ||
| 403 | + let custom_param = NSMutableDictionary() | ||
| 404 | + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId") | ||
| 405 | + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey") | ||
| 406 | + | ||
| 407 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | ||
| 408 | + CNLiveNetworking.setAllowRequestDefaultArgument(false) | ||
| 409 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 410 | + CNLiveNetworking.setBuildCustomUrlRequest(request as URLRequest) { task, result, error in | ||
| 411 | + hiddenLoading() | ||
| 412 | + if (error == nil) { | ||
| 413 | + let resp = result as! NSDictionary | ||
| 414 | + let errorCode = "\(resp["errorCode"] ?? "0")" | ||
| 415 | + if (errorCode == "0") { | ||
| 416 | + resultBlock(true,.success) | ||
| 417 | + } else { | ||
| 418 | + showMessage(message: resp["errorMessage"] as! String) | ||
| 419 | + resultBlock(NSNull(),.failed) | ||
| 420 | + } | ||
| 421 | + } else { | ||
| 422 | + if CNLiveNetworking.isNetworking() { | ||
| 423 | + showMessage(message: "上传失败") | ||
| 424 | + resultBlock(NSNull(),.failed) | ||
| 425 | + } else { | ||
| 426 | + showMessage(message: "似乎与网络断开链接") | ||
| 427 | + resultBlock(NSNull(),.noNetwork) | ||
| 428 | + } | ||
| 429 | + } | ||
| 430 | + } | ||
| 431 | + } catch { | ||
| 432 | + showMessage(message: "上传失败") | ||
| 433 | + resultBlock(NSNull(),.failed) | ||
| 434 | + } | ||
| 435 | + | ||
| 436 | + } | ||
| 437 | + /* | ||
| 438 | + 获取获奖情况列表 | ||
| 439 | + 参数 vsid 实名对象id | ||
| 440 | + 参数 type 1简历信息 2官方认证 3证书 4工作经历 5获奖情况 | ||
| 441 | + */ | ||
| 442 | + static func getAwardList(vsid:String,resultBlock: @escaping downSlideResultBlock) { | ||
| 443 | + let param = NSMutableDictionary() | ||
| 444 | + param.setValue(vsid, forKey: "vsid") | ||
| 445 | + param.setValue("5", forKey: "type") | ||
| 446 | + CNLiveNetworking.setAllowRequestDefaultArgument(true) | ||
| 447 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 448 | + CNLiveNetworking.setupDSRequest(true) | ||
| 449 | + let custom_param = NSMutableDictionary() | ||
| 450 | + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId") | ||
| 451 | + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey") | ||
| 452 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | ||
| 453 | + | ||
| 454 | + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/userApi/getVitae", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in | ||
| 455 | + hiddenLoading() | ||
| 456 | + if (error == nil) { | ||
| 457 | + let resp = result as! NSDictionary | ||
| 458 | + if resp["errorCode"] as! Int == 0{ | ||
| 459 | + let dataArr = resp["data"] as! Array<[String : Any]> | ||
| 460 | + var worksArr = Array<CNLiveVitaeAwardsModel>() | ||
| 461 | + for (_,dic) in dataArr.enumerated() { | ||
| 462 | + let model = newDictionaryToModel(dic, CNLiveVitaeAwardsModel.self) as! CNLiveVitaeAwardsModel | ||
| 463 | + worksArr.append(model) | ||
| 464 | + } | ||
| 465 | + resultBlock(worksArr,.success) | ||
| 466 | + }else{ | ||
| 467 | + resultBlock(NSNull(),.failed) | ||
| 468 | + } | ||
| 469 | + }else{ | ||
| 470 | + resultBlock(NSNull(),.failed) | ||
| 471 | + } | ||
| 472 | + } | ||
| 473 | + | ||
| 474 | + | ||
| 475 | + } | ||
| 476 | + | ||
| 477 | + | ||
| 379 | } | 478 | } |
| 380 | 479 | ||
| 381 | 480 |
metaCode/Classes/Main/Model/Vitae/CNLiveViateWorkModelLayout.swift
| @@ -57,3 +57,48 @@ class CNLiveViateWorkModelLayout:NSObject{ | @@ -57,3 +57,48 @@ class CNLiveViateWorkModelLayout:NSObject{ | ||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | } | 59 | } |
| 60 | + | ||
| 61 | + | ||
| 62 | +//获奖 | ||
| 63 | +class CNLiveViateAwardModelLayout:NSObject{ | ||
| 64 | + | ||
| 65 | + ///cell高度 | ||
| 66 | + var cellH:CGFloat = 0.0 | ||
| 67 | +// var descH:Float = 40.0 | ||
| 68 | + | ||
| 69 | + var _awardModel : CNLiveVitaeAwardsModel? | ||
| 70 | + var awardModel : CNLiveVitaeAwardsModel? { | ||
| 71 | + get{ | ||
| 72 | + _awardModel | ||
| 73 | + } | ||
| 74 | + set{ | ||
| 75 | + _awardModel = newValue | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + init(model:CNLiveVitaeAwardsModel,descH:Float){ | ||
| 80 | + super.init() | ||
| 81 | + self.awardModel = model | ||
| 82 | + let imgArr = model.imgs.components(separatedBy: ",") | ||
| 83 | + var hang:Float = 1 | ||
| 84 | + if imgArr.count > 0{ | ||
| 85 | + if imgArr.count <= 3{ | ||
| 86 | + hang = 1 | ||
| 87 | + }else if imgArr.count <= 6{ | ||
| 88 | + hang = 2 | ||
| 89 | + }else if imgArr.count <= 9{ | ||
| 90 | + hang = 3 | ||
| 91 | + }else{ | ||
| 92 | + hang = 4 | ||
| 93 | + } | ||
| 94 | + }else{ | ||
| 95 | + hang = 0 | ||
| 96 | + } | ||
| 97 | + let imgWH:Float = Float((KSreenWidth-60-15)/3.0+10) | ||
| 98 | + _awardModel?.cellH = Float(123)+descH+Float(hang*imgWH)+55 | ||
| 99 | + } | ||
| 100 | + func getCellHModel()->CNLiveVitaeAwardsModel{ | ||
| 101 | + return _awardModel! | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | +} |
metaCode/Classes/Main/Model/Vitae/CNLiveVitaeModel.swift
| @@ -137,22 +137,25 @@ class CNLiveVitaeCertificatesModel:BaseModel{ | @@ -137,22 +137,25 @@ class CNLiveVitaeCertificatesModel:BaseModel{ | ||
| 137 | 137 | ||
| 138 | //简历奖模块 | 138 | //简历奖模块 |
| 139 | class CNLiveVitaeAwardsModel:BaseModel{ | 139 | class CNLiveVitaeAwardsModel:BaseModel{ |
| 140 | - /// | ||
| 141 | - var id: Int = 0 | ||
| 142 | - /// | 140 | + ///获奖id |
| 141 | + var id:String = "" | ||
| 142 | + ///实名sid | ||
| 143 | var vsid:String = "" | 143 | var vsid:String = "" |
| 144 | - /// | 144 | + ///简历id |
| 145 | var vitaeId:String = "" | 145 | var vitaeId:String = "" |
| 146 | - /// | 146 | + ///获奖名称 |
| 147 | var title:String = "" | 147 | var title:String = "" |
| 148 | - /// | 148 | + ///获奖时间-时间戳 |
| 149 | var time:String = "" | 149 | var time:String = "" |
| 150 | - /// | ||
| 151 | - var company:Int = 0 | ||
| 152 | - /// | 150 | + ///获奖单位 |
| 151 | + var company:String = "" | ||
| 152 | + ///获奖经历描述 | ||
| 153 | var description:String = "" | 153 | var description:String = "" |
| 154 | - /// | 154 | + ///图片和视频 str,分隔 |
| 155 | var imgs:String = "" | 155 | var imgs:String = "" |
| 156 | + | ||
| 157 | + ///cell高度 | ||
| 158 | + var cellH: Float = 0 | ||
| 156 | } | 159 | } |
| 157 | /** | 160 | /** |
| 158 | "data": { | 161 | "data": { |
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_awardBg.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "filename" : "mine_jianli_awardBg@2x.png", | ||
| 9 | + "idiom" : "universal", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "filename" : "mine_jianli_awardBg@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_awardBg.imageset/mine_jianli_awardBg@2x.png
0 → 100644
320 KB
metaCode/Supporting Files/Assets.xcassets/MinePage/jianli/mine_jianli_awardBg.imageset/mine_jianli_awardBg@3x.png
0 → 100644
847 KB