Commit 3099124ada622da5db42cef72cf0c344a6f3000e
1 parent
97e726e4
删除工作记录 , 工作记录播放视频
Showing
3 changed files
with
58 additions
and
2 deletions
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/工作相关页面/CNLiveVitaeWorkDetailController.swift
| @@ -160,6 +160,9 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | @@ -160,6 +160,9 @@ class CNLiveVitaeWorkDetailController:CNLiveBaseViewController,UITableViewDataSo | ||
| 160 | ] | 160 | ] |
| 161 | } | 161 | } |
| 162 | } | 162 | } |
| 163 | + cell.vitaeWorkListBlock = { | ||
| 164 | + self.getWorkList() | ||
| 165 | + } | ||
| 163 | return cell | 166 | return cell |
| 164 | } | 167 | } |
| 165 | 168 |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/Vitae/Work/CNLiveVitaeWorkCell.swift
| @@ -15,6 +15,8 @@ import JFHeroBrowser | @@ -15,6 +15,8 @@ import JFHeroBrowser | ||
| 15 | //cell高度变化 | 15 | //cell高度变化 |
| 16 | typealias vitaeWorkCellChangedBlockActionBlock = (_ cell: CNLiveVitaeWorkCell ,_ cellHeight:CGFloat) -> Void | 16 | typealias vitaeWorkCellChangedBlockActionBlock = (_ cell: CNLiveVitaeWorkCell ,_ cellHeight:CGFloat) -> Void |
| 17 | typealias VitaeWorkPreviewVideoPhotoBlock = (_ images: [HeroBrowserViewModuleBaseProtocol] ,_ index:Int) -> Void | 17 | typealias VitaeWorkPreviewVideoPhotoBlock = (_ images: [HeroBrowserViewModuleBaseProtocol] ,_ index:Int) -> Void |
| 18 | +//刷新tableView | ||
| 19 | +typealias VitaeWorkListBlock = () -> Void | ||
| 18 | 20 | ||
| 19 | class CNLiveVitaeWorkCell: UITableViewCell{ | 21 | class CNLiveVitaeWorkCell: UITableViewCell{ |
| 20 | 22 | ||
| @@ -24,8 +26,8 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -24,8 +26,8 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 24 | }() | 26 | }() |
| 25 | 27 | ||
| 26 | var vitaeWorkPreviewVideoPhotoBlock:VitaeWorkPreviewVideoPhotoBlock? | 28 | var vitaeWorkPreviewVideoPhotoBlock:VitaeWorkPreviewVideoPhotoBlock? |
| 27 | - | ||
| 28 | var vitaeWorkCellChangedBlock:vitaeWorkCellChangedBlockActionBlock? | 29 | var vitaeWorkCellChangedBlock:vitaeWorkCellChangedBlockActionBlock? |
| 30 | + var vitaeWorkListBlock:VitaeWorkListBlock? | ||
| 29 | 31 | ||
| 30 | //简历workModel | 32 | //简历workModel |
| 31 | var _workModel : CNLiveVitaeWorksModel? | 33 | var _workModel : CNLiveVitaeWorksModel? |
| @@ -395,6 +397,14 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | @@ -395,6 +397,14 @@ class CNLiveVitaeWorkCell: UITableViewCell{ | ||
| 395 | } | 397 | } |
| 396 | @objc func deleteBtnAction(){ | 398 | @objc func deleteBtnAction(){ |
| 397 | 399 | ||
| 400 | + CNLiveVitaeViewModel.deleteVitae(id: self.workModel?.id ?? "", vsid: self.workModel?.vsid ?? "", type: "4") { result, status in | ||
| 401 | + if status == .success{ | ||
| 402 | + showMessage(message: "删除成功") | ||
| 403 | + self.vitaeWorkListBlock?() | ||
| 404 | + }else{ | ||
| 405 | + showMessage(message: "删除失败") | ||
| 406 | + } | ||
| 407 | + } | ||
| 398 | } | 408 | } |
| 399 | @objc func playBtnAction(btn:UIButton){ | 409 | @objc func playBtnAction(btn:UIButton){ |
| 400 | let index = btn.tag-1000 | 410 | let index = btn.tag-1000 |
metaCode/Classes/Main/HomePage/ViewModel/Vitae/CNLiveVitaeViewModel.swift
| @@ -95,7 +95,7 @@ class CNLiveVitaeViewModel:NSObject{ | @@ -95,7 +95,7 @@ class CNLiveVitaeViewModel:NSObject{ | ||
| 95 | } | 95 | } |
| 96 | } else { | 96 | } else { |
| 97 | if CNLiveNetworking.isNetworking() { | 97 | if CNLiveNetworking.isNetworking() { |
| 98 | - showMessage(message: "上传失败") | 98 | + showMessage(message: "失败") |
| 99 | resultBlock(NSNull(),.failed) | 99 | resultBlock(NSNull(),.failed) |
| 100 | } else { | 100 | } else { |
| 101 | showMessage(message: "似乎与网络断开链接") | 101 | showMessage(message: "似乎与网络断开链接") |
| @@ -109,6 +109,48 @@ class CNLiveVitaeViewModel:NSObject{ | @@ -109,6 +109,48 @@ class CNLiveVitaeViewModel:NSObject{ | ||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | } | 111 | } |
| 112 | + /* | ||
| 113 | + 删除简历(工作经历/获奖情况) | ||
| 114 | + 参数 vsid 实名对象id | ||
| 115 | + 参数 type 4工作经历 5获奖情况 | ||
| 116 | + 参数 id 工作记录id | ||
| 117 | + */ | ||
| 118 | + static func deleteVitae(id:String,vsid:String,type:String,resultBlock: @escaping downSlideResultBlock) { | ||
| 119 | + let param = NSMutableDictionary() | ||
| 120 | + param.setValue(vsid, forKey: "vsid") | ||
| 121 | + param.setValue(type, forKey: "type") | ||
| 122 | + param.setValue(id, forKey: "id") | ||
| 123 | + CNLiveNetworking.setAllowRequestDefaultArgument(true) | ||
| 124 | + CNLiveNetworking.setupShowDataResult(false) | ||
| 125 | + CNLiveNetworking.setupDSRequest(true) | ||
| 126 | + let custom_param = NSMutableDictionary() | ||
| 127 | + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId") | ||
| 128 | + custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey") | ||
| 129 | + CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | ||
| 130 | + | ||
| 131 | + CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseMCUrl+"/userApi/deleteVitaeMsg", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in | ||
| 132 | + hiddenLoading() | ||
| 133 | + if (error == nil) { | ||
| 134 | + let resp = result as! NSDictionary | ||
| 135 | + let errorCode = "\(resp["errorCode"] ?? "0")" | ||
| 136 | + if (errorCode == "0") { | ||
| 137 | + resultBlock(true,.success) | ||
| 138 | + } else { | ||
| 139 | + showMessage(message: resp["errorMessage"] as! String) | ||
| 140 | + resultBlock(NSNull(),.failed) | ||
| 141 | + } | ||
| 142 | + } else { | ||
| 143 | + if CNLiveNetworking.isNetworking() { | ||
| 144 | + showMessage(message: "失败") | ||
| 145 | + resultBlock(NSNull(),.failed) | ||
| 146 | + } else { | ||
| 147 | + showMessage(message: "似乎与网络断开链接") | ||
| 148 | + resultBlock(NSNull(),.noNetwork) | ||
| 149 | + } | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + } | ||
| 112 | 154 | ||
| 113 | /// 获取省市区县列表 | 155 | /// 获取省市区县列表 |
| 114 | /// @param id | 156 | /// @param id |
| @@ -262,6 +304,7 @@ class CNLiveVitaeViewModel:NSObject{ | @@ -262,6 +304,7 @@ class CNLiveVitaeViewModel:NSObject{ | ||
| 262 | let custom_param = NSMutableDictionary() | 304 | let custom_param = NSMutableDictionary() |
| 263 | custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId") | 305 | custom_param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId") |
| 264 | custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey") | 306 | custom_param.setValue(CNLiveMCEnvironmentManager.shared.appKey, forKey: "appKey") |
| 307 | + | ||
| 265 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 308 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 266 | CNLiveNetworking.setAllowRequestDefaultArgument(false) | 309 | CNLiveNetworking.setAllowRequestDefaultArgument(false) |
| 267 | CNLiveNetworking.setupShowDataResult(false) | 310 | CNLiveNetworking.setupShowDataResult(false) |