Commit af6644fd authored by pete谢兆麟's avatar pete谢兆麟

1.工作经验简历UI修改 2. 工作经验上传逻辑修改 3.工作经验已有列表接口调试 4.工作经验选择上传过的文件逻辑接入 5.已有上传工作经验UI绘制

parent 38c48762
......@@ -30,6 +30,7 @@
0435FA7F2BA178C100024EAE /* YHCommonAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */; };
0435FA812BA186D600024EAE /* YHMyFileMethodTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */; };
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435FA822BA2DEB100024EAE /* YHCardButton.swift */; };
043B0A352C1190C6008A9BBA /* YHSelectFileSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043B0A342C1190C6008A9BBA /* YHSelectFileSheetView.swift */; };
043D2C8A2C0EEF3F00172438 /* YHOrderSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043D2C892C0EEF3F00172438 /* YHOrderSearchViewController.swift */; };
043D2C8C2C0F037B00172438 /* YHServiceOrderSearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 043D2C8B2C0F037B00172438 /* YHServiceOrderSearchViewModel.swift */; };
044378A42BFC848C001F95AE /* loginBkg.mov in Resources */ = {isa = PBXBuildFile; fileRef = 044378A32BFC848C001F95AE /* loginBkg.mov */; };
......@@ -505,6 +506,7 @@
0435FA7E2BA178C100024EAE /* YHCommonAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCommonAlertView.swift; sourceTree = "<group>"; };
0435FA802BA186D600024EAE /* YHMyFileMethodTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileMethodTableViewCell.swift; sourceTree = "<group>"; };
0435FA822BA2DEB100024EAE /* YHCardButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCardButton.swift; sourceTree = "<group>"; };
043B0A342C1190C6008A9BBA /* YHSelectFileSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectFileSheetView.swift; sourceTree = "<group>"; };
043D2C892C0EEF3F00172438 /* YHOrderSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOrderSearchViewController.swift; sourceTree = "<group>"; };
043D2C8B2C0F037B00172438 /* YHServiceOrderSearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderSearchViewModel.swift; sourceTree = "<group>"; };
044378A32BFC848C001F95AE /* loginBkg.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = loginBkg.mov; sourceTree = "<group>"; };
......@@ -1236,6 +1238,7 @@
047619E82BA9867100F45358 /* YHCountryHotView.swift */,
045EEDE72B9F171A0022A143 /* YHResultBottomView.swift */,
045EEDE82B9F171A0022A143 /* YHWorkFileItemView.swift */,
043B0A342C1190C6008A9BBA /* YHSelectFileSheetView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -3090,6 +3093,7 @@
0435FA832BA2DEB100024EAE /* YHCardButton.swift in Sources */,
045EEECA2B9F171A0022A143 /* YHMyDocumentsListViewController.swift in Sources */,
045EEF052B9F171A0022A143 /* YHFormItemExpireDateCell.swift in Sources */,
043B0A352C1190C6008A9BBA /* YHSelectFileSheetView.swift in Sources */,
A5ACE92D2B4564F7002C94D2 /* YHLoginPrivacyView.swift in Sources */,
045EEEB72B9F171A0022A143 /* YHWorkItemAddView.swift in Sources */,
A5ACE9372B4564F7002C94D2 /* YHBaseUrlManager.swift in Sources */,
......
......@@ -12,7 +12,7 @@ import AttributedString
class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateNameCell"
static let cellReuseIdentifier = "YHCertificateInfoCell"
var status : YHCertificateUploadStatus = .preUpload
var templateBlock:(()->())?
......
......@@ -23,8 +23,6 @@ enum YHDateType: Int {
}
class YHDatePickView: UIView {
var backDate: ((String) -> Void)?
var centerView: UIView!
var titleLabel: UILabel!
......
......@@ -64,4 +64,5 @@ class YHWorkExperienceFileModel: YHBaseModel {
var fileName: String = ""
var fileUrl: String = ""
var uploadedAt: String = ""
var isSelect: Bool = false
}
......@@ -16,9 +16,11 @@ enum YHWorkFileClickType {
class YHWorkFileItemView: UIView {
typealias ItemBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> ()
var block: ItemBlock?
var titleLabel: UIButton!
var deleteButton: UIButton!
var whiteView: UIButton!
var iconImgV: UIImageView!
var nameLabel: UILabel!
var timeLabel: UILabel!
var editBtn: UIButton!
var dataSource: YHWorkExperienceFileModel? {
didSet {
updateAllViews()
......@@ -35,43 +37,97 @@ class YHWorkFileItemView: UIView {
}
func setUpView() {
titleLabel = {
let label = UIButton(type: .custom)
label.setTitleColor(UIColor.mainTextColor, for: .normal)
label.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
label.addTarget(self, action: #selector(itemClick), for: .touchUpInside)
label.contentHorizontalAlignment = .left
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.equalTo(16)
make.width.equalTo(200)
whiteView = UIButton()
whiteView.addTarget(self, action: #selector(itemClick), for: .touchUpInside)
addSubview(whiteView)
iconImgV = UIImageView(image:UIImage(named:"my_cer_type_jpg"))
whiteView.addSubview(iconImgV)
nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.numberOfLines = 0
nameLabel.font = UIFont.PFSC_M(ofSize:14)
whiteView.addSubview(nameLabel)
timeLabel = UILabel()
timeLabel.textColor = UIColor.labelTextColor2
timeLabel.textAlignment = .left
timeLabel.font = UIFont.PFSC_R(ofSize:11)
whiteView.addSubview(timeLabel)
editBtn = UIButton()
editBtn.setImage(UIImage(named:"my_cer_btn_edit"), for:.normal)
editBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 30, left: 30, bottom: 30, right: 30)
editBtn.addTarget(self, action: #selector(deleteClick), for: .touchUpInside)
whiteView.addSubview(editBtn)
whiteView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.centerY.equalToSuperview()
make.height.equalTo(55)
}
iconImgV.snp.makeConstraints { make in
make.width.height.equalTo(31)
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(6)
}
nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(18)
make.top.equalToSuperview().offset(7)
make.right.equalTo(editBtn.snp.left)
}
timeLabel.snp.makeConstraints { make in
make.left.right.equalTo(nameLabel)
make.top.equalTo(nameLabel.snp.bottom).offset(2)
make.bottom.equalToSuperview().offset(-7)
make.height.equalTo(20)
}
deleteButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
button.contentHorizontalAlignment = .right
button.setTitle("删除", for: .normal)
button.setTitleColor(.red, for: .normal)
button.addTarget(self, action: #selector(deleteClick), for: .touchUpInside)
return button
}()
addSubview(deleteButton)
deleteButton.snp.makeConstraints { make in
editBtn.snp.makeConstraints { make in
make.width.height.equalTo(16)
make.centerY.equalToSuperview()
make.right.equalToSuperview()
make.height.equalTo(20)
make.width.equalTo(28)
make.centerY.equalTo(titleLabel.snp.centerY)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
titleLabel.setTitle(dataSource.fileName, for: .normal)
nameLabel.text = dataSource.fileName
timeLabel.text = "上传于\(dataSource.uploadedAt)"
let suffix = dataSource.fileUrl.pathExtension.lowercased()
var iconImgName = ""
if suffix == "jpeg" {
iconImgName = "my_cer_type_jpg"
} else if suffix == "jpg" {
iconImgName = "my_cer_type_jpg"
} else if suffix == "png" {
iconImgName = "my_cer_type_png"
} else if suffix == "pdf" {
iconImgName = "my_cer_type_pdf"
} else if suffix == "doc" || suffix == "docx" {
iconImgName = "my_cer_type_word"
} else if suffix == "ppt" || suffix == "pptx" {
iconImgName = "my_cer_type_ppt"
} else if suffix == "bmp" {
iconImgName = "my_cer_type_bmp"
} else if suffix == "tiff" {
iconImgName = "my_cer_type_tiff"
}
iconImgV.image = UIImage(named: iconImgName)
}
@objc func itemClick() {
......
......@@ -14,10 +14,13 @@ class YHWorkFileSyncTableViewCell: UITableViewCell {
typealias AddIntroductionBlock = () -> ()
var experienceListBlock: ExperienceListBlock?
var addIntroductionBlock: AddIntroductionBlock?
var selectIntroductionBlock: AddIntroductionBlock?
var centerView: UIView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var mainItemView: UIView!
var bottomView: YHWorkItemAddView!
var selectbottomView: YHWorkItemAddView!
var dataSource: [YHWorkExperienceFileModel]?{
didSet {
updateAllViews()
......@@ -62,15 +65,9 @@ class YHWorkFileSyncTableViewCell: UITableViewCell {
titleLabel = {
let label = UILabel()
let str = "*" + "上传文件"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 17),
.foregroundColor: UIColor.mainTextColor
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.failColor, range: starRange)
label.attributedText = questionAttrStr
label.font = UIFont.PFSC_R(ofSize: 17)
label.text = "工作相关文件"
label.textColor = UIColor.mainTextColor
return label
}()
centerView.addSubview(titleLabel)
......@@ -81,22 +78,46 @@ class YHWorkFileSyncTableViewCell: UITableViewCell {
make.right.equalTo(-18)
}
subTitleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.text = "快捷导入简历等文件,提升文书定制的丰富度和完善度"
label.textColor = UIColor.labelTextColor2
return label
}()
centerView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(42)
make.height.equalTo(20)
make.right.equalTo(-18)
}
let line = UIView()
line.backgroundColor = UIColor.separatorColor
centerView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(78)
make.height.equalTo(0.5)
make.right.equalTo(-18)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-65)
make.top.equalTo(52)
make.bottom.equalTo(-79)
make.top.equalTo(79)
}
bottomView = {
let view = YHWorkItemAddView()
view.addBtn.setTitle("上传".local, for: .normal)
view.addBtn.setTitle("新增上传".local, for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.addIntroductionBlock {
......@@ -107,24 +128,34 @@ class YHWorkFileSyncTableViewCell: UITableViewCell {
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.right.bottom.equalTo(-18)
make.bottom.equalTo(-18)
make.left.equalTo(18)
make.height.equalTo(45)
make.right.equalTo(centerView.snp.centerX).offset(-5)
}
selectbottomView = {
let view = YHWorkItemAddView()
view.addBtn.setTitle("选择已有".local, for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.selectIntroductionBlock {
block()
}
}
return view
}()
centerView.addSubview(selectbottomView)
selectbottomView.snp.makeConstraints { make in
make.right.bottom.equalTo(-18)
make.left.equalTo(centerView.snp.centerX).offset(5)
make.height.equalTo(45)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
for i in 0 ..< (dataSource?.count ?? 0) {
let line = UIView()
line.backgroundColor = UIColor.separatorColor
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52 * i)
make.height.equalTo(1)
make.right.equalTo(-18)
}
let itemView = YHWorkFileItemView()
itemView.dataSource = dataSource?[i]
itemView.block = {[weak self] model, type in
......@@ -135,10 +166,9 @@ class YHWorkFileSyncTableViewCell: UITableViewCell {
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52 * i + 1)
make.height.equalTo(51)
make.right.equalTo(-18)
make.left.right.equalToSuperview()
make.top.equalTo(69 * i)
make.height.equalTo(69)
}
}
}
......
......@@ -13,6 +13,7 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
var mainModel: YHWorkExperienceDetailModel = YHWorkExperienceDetailModel()
var exampleModels: [YHWorkExampleModel]?
var projectModels: [YHWorkExperienceProjectModel]?
var fileList: [YHWorkExperienceFileModel] = []
override init() {
super.init()
}
......@@ -409,6 +410,30 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
}
}
func requestFileList(_ orderId: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.fileList
let params: [String : Any] = ["order_id": orderId]
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = [YHWorkExperienceFileModel].deserialize(from: dic as? [Any]) else {
callBackBlock(false, nil)
return
}
let last = result.compactMap { $0 }
self.fileList = last
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false,error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func isCanNext(_ step: Int) -> Bool {
if step == 0 {
let companyName = mainModel.company_name //公司名称
......@@ -455,35 +480,9 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
guard message.count > 0 else { return false }
return true
} else if step == 3 {
//todo
let message = mainModel.is_project_introduction
let file = mainModel.file
let uploadFile = mainModel.not_need_upload_file
if message == 1 {
return true
} else {
if uploadFile == 1 {
return true
} else {
if file.count != 0 {
return true
} else {
return false
}
}
}
return true
} else {
let file = mainModel.file
let uploadFile = mainModel.not_need_upload_file
if uploadFile == 1 {
return true
} else {
if file.count != 0 {
return true
} else {
return false
}
}
return true
}
}
}
......@@ -159,6 +159,8 @@ class YHAllApiName {
static let projectDel = "infoflow/work/delWorkProject"
//识别附件
static let ocrFileContent = "infoflow/work/getOcrFileContent"
//已上传文件列表
static let fileList = "infoflow/work/file-list"
}
//登录
......
......@@ -77,7 +77,10 @@
<string>weixinURLParamsAPI</string>
</array>
<key>NSAppTransportSecurity</key>
<dict/>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
</dict>
<key>UIAppFonts</key>
<array>
<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