Commit 4d6d956b authored by pete谢兆麟's avatar pete谢兆麟

工作经验接口字段调整

parent 6bdecb3c
...@@ -50,7 +50,7 @@ class YHConfigManager: NSObject { ...@@ -50,7 +50,7 @@ class YHConfigManager: NSObject {
//测试环境-OSS //测试环境-OSS
static let baseOSSUrlTest : String = "https://test-comserver.galaxy-immi.com" static let baseOSSUrlTest : String = "https://test-comserver.galaxy-immi.com"
//正式环境-OSS //正式环境-OSS
static let baseOSSUrlRelease : String = "http://comserver.galaxy-immi.com" static let baseOSSUrlRelease : String = "https://comserver.galaxy-immi.com"
//OSS //OSS
var ossUrl : String { var ossUrl : String {
......
...@@ -233,14 +233,10 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -233,14 +233,10 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
return 1 return 1
} }
if stepView.currentIndex == 3 { if stepView.currentIndex == 3 {
if self.viewModel.mainModel.is_project_introduction == 1 { return 1
return 1
} else {
return 2
}
} }
if stepView.currentIndex == 4 { if stepView.currentIndex == 4 {
return 2 return 1
} }
return baseDataSource?.count ?? 0 return baseDataSource?.count ?? 0
} }
...@@ -364,68 +360,9 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -364,68 +360,9 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
return cell return cell
} else {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkMessageSelectTableViewCell.self)
cell.dataSource = viewModel.mainModel.not_need_upload_file
cell.isNeedFileBlock = { [weak self] value in
guard let self = self else { return }
self.viewModel.updateNotNeedUploadFile(value: value)
self.tableView.reloadData()
}
cell.isHidden = !self.isShowMessageSelect
return cell
} else {
let cell = tableView.dequeueReusableCell(withClass: YHWorkFileSyncTableViewCell.self)
cell.dataSource = fileDataSource
cell.isHidden = viewModel.mainModel.not_need_upload_file == 1 && isShowMessageSelect
cell.addIntroductionBlock = { [weak self] in
guard let self = self else { return }
YHImagePickerView.show() {[weak self] image in
guard let self = self else { return }
YHHUD.show(.progress(message: ""))
self.viewModel.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
let timestamp = Date().timeIntervalSince1970
let model = YHWorkExperienceFileModel()
model.fileUrl = success ?? ""
model.fileName = "\(UInt64(timestamp))" + ".jpg"
self.fileDataSource?.append(model)
self.viewModel.mainModel.file = self.fileDataSource ?? []
self.tableView.reloadData()
YHHUD.hide()
}
}
}
cell.experienceListBlock = {[weak self] model, type in
guard let self = self else { return }
if type == .delete {
self.showDeleteAlert(model)
} else {
let vc = YHImageViewController()
vc.imgString = model.fileUrl
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
return cell
}
}
} else if stepView.currentIndex == 4 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkMessageSelectTableViewCell.self)
cell.dataSource = viewModel.mainModel.not_need_upload_file
cell.isNeedFileBlock = { [weak self] value in
guard let self = self else { return }
self.viewModel.updateNotNeedUploadFile(value: value)
self.tableView.reloadData()
}
cell.isHidden = !self.isShowMessageSelect
return cell
} else { } else {
let cell = tableView.dequeueReusableCell(withClass: YHWorkFileSyncTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHWorkFileSyncTableViewCell.self)
cell.dataSource = fileDataSource cell.dataSource = fileDataSource
cell.isHidden = viewModel.mainModel.not_need_upload_file == 1 && isShowMessageSelect
cell.addIntroductionBlock = { [weak self] in cell.addIntroductionBlock = { [weak self] in
guard let self = self else { return } guard let self = self else { return }
YHImagePickerView.show() {[weak self] image in YHImagePickerView.show() {[weak self] image in
...@@ -457,6 +394,39 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -457,6 +394,39 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
} }
return cell return cell
} }
} else if stepView.currentIndex == 4 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkFileSyncTableViewCell.self)
cell.dataSource = fileDataSource
cell.addIntroductionBlock = { [weak self] in
guard let self = self else { return }
YHImagePickerView.show() {[weak self] image in
guard let self = self else { return }
YHHUD.show(.progress(message: ""))
self.viewModel.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
guard let url = success else { return }
let timestamp = Date().timeIntervalSince1970
let model = YHWorkExperienceFileModel()
model.fileUrl = success ?? ""
model.fileName = "\(UInt64(timestamp))" + ".jpg"
self.fileDataSource?.append(model)
self.viewModel.mainModel.file = self.fileDataSource ?? []
self.tableView.reloadData()
YHHUD.hide()
}
}
}
cell.experienceListBlock = {[weak self] model, type in
guard let self = self else { return }
if type == .delete {
self.showDeleteAlert(model)
} else {
let vc = YHImageViewController()
vc.imgString = model.fileUrl
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
return cell
} else { } else {
let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceTableViewCell.self)
cell.country = self.viewModel.mainModel.location.country cell.country = self.viewModel.mainModel.location.country
...@@ -485,29 +455,13 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -485,29 +455,13 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
if self.viewModel.mainModel.is_project_introduction == 1 { if self.viewModel.mainModel.is_project_introduction == 1 {
let number = introductionDataSource?.count ?? 0 let number = introductionDataSource?.count ?? 0
return CGFloat(76 * number + 150) return CGFloat(76 * number + 150)
} else {
if indexPath.row == 0 {
if self.isShowMessageSelect {
return 166
} else {
return 0
}
} else {
let count = fileDataSource?.count ?? 0
return CGFloat(52 * count + 145)
}
}
} else if stepView.currentIndex == 4 {
if indexPath.row == 0 {
if self.isShowMessageSelect {
return 166
} else {
return 0
}
} else { } else {
let count = fileDataSource?.count ?? 0 let count = fileDataSource?.count ?? 0
return CGFloat(52 * count + 145) return CGFloat(52 * count + 145)
} }
} else if stepView.currentIndex == 4 {
let count = fileDataSource?.count ?? 0
return CGFloat(52 * count + 145)
} else { } else {
let array = baseDataSource?[indexPath.row].models ?? [] let array = baseDataSource?[indexPath.row].models ?? []
var h = 0 var h = 0
......
...@@ -63,4 +63,5 @@ class YHWorkExperienceDetailModel: YHBaseModel { ...@@ -63,4 +63,5 @@ class YHWorkExperienceDetailModel: YHBaseModel {
class YHWorkExperienceFileModel: YHBaseModel { class YHWorkExperienceFileModel: YHBaseModel {
var fileName: String = "" var fileName: String = ""
var fileUrl: String = "" var fileUrl: String = ""
var uploadedAt: String = ""
} }
...@@ -269,7 +269,8 @@ class YHWorkExperienceViewModel: YHBaseViewModel { ...@@ -269,7 +269,8 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
var file: [[String : Any]] = [] var file: [[String : Any]] = []
for item in mainModel.file { for item in mainModel.file {
let fileDic = ["fileName": item.fileName, let fileDic = ["fileName": item.fileName,
"fileUrl": item.fileUrl] "fileUrl": item.fileUrl,
"uploadedAt": item.uploadedAt]
file.append(fileDic) file.append(fileDic)
} }
let params: [String : Any] = ["administrative_level": mainModel.administrative_level, let params: [String : Any] = ["administrative_level": mainModel.administrative_level,
......
...@@ -77,10 +77,7 @@ ...@@ -77,10 +77,7 @@
<string>weixinURLParamsAPI</string> <string>weixinURLParamsAPI</string>
</array> </array>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict/>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key> <key>UIAppFonts</key>
<array> <array>
<string>DIN Alternate Bold</string> <string>DIN Alternate Bold</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment