Commit 9394b82117b9930c34da52d294ee9802908cffee

Authored by “张旭”
1 parent 866f4458

关联认证-关联证书

metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewController.swift
@@ -62,11 +62,7 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD @@ -62,11 +62,7 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD
62 return dataArray 62 return dataArray
63 }() 63 }()
64 64
65 -  
66 - lazy var secTotalDataArray: NSMutableArray = {  
67 - var dataArray = NSMutableArray()  
68 - return dataArray  
69 - }() 65 + //简历-官方认证数据
70 lazy var succDataArray: NSMutableArray = { 66 lazy var succDataArray: NSMutableArray = {
71 var dataArray = NSMutableArray() 67 var dataArray = NSMutableArray()
72 return dataArray 68 return dataArray
@@ -388,17 +384,10 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD @@ -388,17 +384,10 @@ class CNLiveDigitalResumePreViewController:CNLiveBaseViewController,UITableViewD
388 var arr = Array<CNLiveVitaeIdentitiesModel>() 384 var arr = Array<CNLiveVitaeIdentitiesModel>()
389 var sussArr = Array<CNLiveVitaeIdentitiesModel>() 385 var sussArr = Array<CNLiveVitaeIdentitiesModel>()
390 model.identities.forEach { listMdl in 386 model.identities.forEach { listMdl in
391 - if listMdl.userStatus == 1{  
392 - arr.insert(listMdl, at: 0)  
393 - sussArr.append(listMdl)  
394 - }else{  
395 - arr.append(listMdl)  
396 - } 387 + arr.append(listMdl)
397 } 388 }
398 - self.secTotalDataArray.removeAllObjects()  
399 - self.secTotalDataArray.addObjects(from: arr)  
400 self.succDataArray.removeAllObjects() 389 self.succDataArray.removeAllObjects()
401 - self.succDataArray.addObjects(from: sussArr) 390 + self.succDataArray.addObjects(from: arr)
402 391
403 //关联的证书 392 //关联的证书
404 self.threeCerDataArray = model.certificates 393 self.threeCerDataArray = model.certificates
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/数字简历相关页面/CNLiveDigitalResumePreViewSelectRenzhengCerController.swift
@@ -243,11 +243,47 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro @@ -243,11 +243,47 @@ class CNLiveDigitalResumePreViewSelectRenzhengCerController:CNLiveBaseViewContro
243 // MARK: - ButtonAction 243 // MARK: - ButtonAction
244 @objc func settingBtnAction(){ 244 @objc func settingBtnAction(){
245 //取消 245 //取消
246 - 246 + self.navigationController?.popViewController(animated: true)
247 } 247 }
248 @objc func previewBtnAction(){ 248 @objc func previewBtnAction(){
249 - //确认  
250 - 249 + //提交
  250 + if self.renzhengCerType == .renzheng{
  251 + var idsArrStr = ""
  252 + for (idx,obj) in self.totalDataArray.enumerated() {
  253 + let model = obj as! MineAuthListModel
  254 + let cell = self.tableView.cellForRow(at: IndexPath(row: idx, section: 0)) as! CNLiveDigitalResumeGuanfangRenzhengCell
  255 + if cell.selectBtn.isSelected{
  256 + idsArrStr = idsArrStr + "\(model.identityId),"
  257 + }
  258 + }
  259 + if idsArrStr.count > 0{
  260 + idsArrStr = idsArrStr.subString(start: 0, length: idsArrStr.count-1)
  261 + }
  262 + let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "0"
  263 + CNLiveVitaeViewModel.linkVitae(ids: idsArrStr, vsid: vsid, type: "2") { result, status in
  264 + if status == .success{
  265 + self.navigationController?.popViewController(animated: true)
  266 + }
  267 + }
  268 + }else{
  269 + var idsArrStr = ""
  270 + for (idx,obj) in self.totalDataArray.enumerated() {
  271 + let model = obj as! CNLiveVitaeCertificateModel
  272 + let cell = self.tableView.cellForRow(at: IndexPath(row: idx, section: 0)) as! CNLiveDigitalResumeSelectCerCell
  273 + if cell.selectBtn.isSelected{
  274 + idsArrStr = idsArrStr + "\(model.id),"
  275 + }
  276 + }
  277 + if idsArrStr.count > 0{
  278 + idsArrStr = idsArrStr.subString(start: 0, length: idsArrStr.count-1)
  279 + }
  280 + let vsid = UserInfoManager.shared.userInfo.currentUser?.vsid ?? "0"
  281 + CNLiveVitaeViewModel.linkVitae(ids: idsArrStr, vsid: vsid, type: "3") { result, status in
  282 + if status == .success{
  283 + self.navigationController?.popViewController(animated: true)
  284 + }
  285 + }
  286 + }
251 } 287 }
252 @objc func addBtnAction(){ 288 @objc func addBtnAction(){
253 289
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/我的简历cell/CNLiveDigitalResumePreViewSecCollectionCell.swift
@@ -22,7 +22,7 @@ class CNLiveDigitalResumePreViewSecCollectionCell: UICollectionViewCell { @@ -22,7 +22,7 @@ class CNLiveDigitalResumePreViewSecCollectionCell: UICollectionViewCell {
22 } 22 }
23 23
24 lazy var iconImgView :UIImageView = { 24 lazy var iconImgView :UIImageView = {
25 - let iconImgView = UIImageView(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) 25 + let iconImgView = UIImageView(frame: CGRect(x: 0, y: 0, width: 55, height: 55))
26 iconImgView.clipsToBounds = true 26 iconImgView.clipsToBounds = true
27 iconImgView.layer.cornerRadius = 30 27 iconImgView.layer.cornerRadius = 30
28 iconImgView.contentMode = .scaleAspectFill 28 iconImgView.contentMode = .scaleAspectFill
@@ -31,7 +31,7 @@ class CNLiveDigitalResumePreViewSecCollectionCell: UICollectionViewCell { @@ -31,7 +31,7 @@ class CNLiveDigitalResumePreViewSecCollectionCell: UICollectionViewCell {
31 }() 31 }()
32 32
33 lazy var titleLabel: UILabel = { 33 lazy var titleLabel: UILabel = {
34 - let titleLabel = UILabel.init(frame: CGRectMake(0, self.iconImgView.bottom+8, 60, 17)) 34 + let titleLabel = UILabel.init(frame: CGRectMake(0, self.iconImgView.bottom+3.5, 60, 17))
35 titleLabel.textColor = HexColor("#333333") 35 titleLabel.textColor = HexColor("#333333")
36 titleLabel.textAlignment = .center 36 titleLabel.textAlignment = .center
37 titleLabel.adjustsFontSizeToFitWidth = true 37 titleLabel.adjustsFontSizeToFitWidth = true
@@ -41,7 +41,7 @@ class CNLiveDigitalResumePreViewSecCollectionCell: UICollectionViewCell { @@ -41,7 +41,7 @@ class CNLiveDigitalResumePreViewSecCollectionCell: UICollectionViewCell {
41 lazy var hangyeImgView :UIImageView = { 41 lazy var hangyeImgView :UIImageView = {
42 let iconImgView = UIImageView() 42 let iconImgView = UIImageView()
43 iconImgView.image = UIImage(named: "mine_jianli_zhenshi") 43 iconImgView.image = UIImage(named: "mine_jianli_zhenshi")
44 - iconImgView.frame = CGRect(x: 0, y: self.titleLabel.bottom+2, width: 60, height: 11) 44 + iconImgView.frame = CGRect(x: 0, y: self.titleLabel.bottom+3.5, width: 60, height: 13)
45 return iconImgView 45 return iconImgView
46 }() 46 }()
47 47
@@ -59,16 +59,16 @@ class CNLiveDigitalResumePreViewSecCollectionCell: UICollectionViewCell { @@ -59,16 +59,16 @@ class CNLiveDigitalResumePreViewSecCollectionCell: UICollectionViewCell {
59 func setupNewUI(model:CNLiveVitaeIdentitiesModel){ 59 func setupNewUI(model:CNLiveVitaeIdentitiesModel){
60 if model.identityId != 0{ 60 if model.identityId != 0{
61 61
62 - if model.userStatus == 1{ 62 +// if model.userStatus == 1{
63 //审核成功 63 //审核成功
64 self.titleLabel.text = model.name 64 self.titleLabel.text = model.name
65 self.iconImgView.kf.setImage(with: URL(string: model.icon )) 65 self.iconImgView.kf.setImage(with: URL(string: model.icon ))
66 self.titleLabel.isHidden = false 66 self.titleLabel.isHidden = false
67 self.iconImgView.isHidden = false 67 self.iconImgView.isHidden = false
68 - }else{  
69 - self.titleLabel.isHidden = true  
70 - self.iconImgView.isHidden = true  
71 - } 68 +// }else{
  69 +// self.titleLabel.isHidden = true
  70 +// self.iconImgView.isHidden = true
  71 +// }
72 }else{ 72 }else{
73 self.titleLabel.isHidden = true 73 self.titleLabel.isHidden = true
74 self.iconImgView.isHidden = true 74 self.iconImgView.isHidden = true
metaCode/Classes/Main/HomePage/ViewModel/Vitae/CNLiveVitaeViewModel.swift
@@ -474,7 +474,48 @@ class CNLiveVitaeViewModel:NSObject{ @@ -474,7 +474,48 @@ class CNLiveVitaeViewModel:NSObject{
474 474
475 } 475 }
476 476
477 - 477 + /*
  478 + 关联简历(官方认证/证书)
  479 + 参数 vsid 实名对象id
  480 + 参数 type 2官方认证 3证书
  481 + 参数 ids 官方认证/证书id 用,分隔 "12,21,23"
  482 + */
  483 + static func linkVitae(ids:String,vsid:String,type:String,resultBlock: @escaping downSlideResultBlock) {
  484 + let param = NSMutableDictionary()
  485 + param.setValue(vsid, forKey: "vsid")
  486 + param.setValue(type, forKey: "type")
  487 + param.setValue(ids, forKey: "ids")
  488 + CNLiveNetworking.setAllowRequestDefaultArgument(true)
  489 + CNLiveNetworking.setupShowDataResult(false)
  490 + CNLiveNetworking.setupDSRequest(true)
  491 + let custom_param = NSMutableDictionary()
  492 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId")
  493 + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey")
  494 + CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
  495 +
  496 + CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseMCUrl+"/userApi/linkVitaeMsg", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  497 + hiddenLoading()
  498 + if (error == nil) {
  499 + let resp = result as! NSDictionary
  500 + let errorCode = "\(resp["errorCode"] ?? "0")"
  501 + if (errorCode == "0") {
  502 + resultBlock(true,.success)
  503 + } else {
  504 + showMessage(message: resp["errorMessage"] as! String)
  505 + resultBlock(NSNull(),.failed)
  506 + }
  507 + } else {
  508 + if CNLiveNetworking.isNetworking() {
  509 + showMessage(message: "失败")
  510 + resultBlock(NSNull(),.failed)
  511 + } else {
  512 + showMessage(message: "似乎与网络断开链接")
  513 + resultBlock(NSNull(),.noNetwork)
  514 + }
  515 + }
  516 + }
  517 +
  518 + }
478 } 519 }
479 520
480 521