Commit 195d513c authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  bug修复
  产品走查问题 删除按钮弹窗添加
parents c0fece8a 63c26152
...@@ -2667,7 +2667,7 @@ ...@@ -2667,7 +2667,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 5; CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
...@@ -2709,7 +2709,7 @@ ...@@ -2709,7 +2709,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 5; CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
......
...@@ -39,6 +39,21 @@ class YHCommonAlertView: UIView { ...@@ -39,6 +39,21 @@ class YHCommonAlertView: UIView {
self.messageLabel.text = message self.messageLabel.text = message
self.disAgressButton.setTitle(leftButtonString, for: .normal) self.disAgressButton.setTitle(leftButtonString, for: .normal)
self.agreeButton.setTitle(rightButtonString, for: .normal) self.agreeButton.setTitle(rightButtonString, for: .normal)
if title?.count == 0 || title == nil {
centerView.snp.remakeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(299)
make.height.equalTo(164)
}
messageLabel.snp.remakeConstraints { make in
make.left.equalTo(22)
make.right.equalTo(-22)
make.height.equalTo(42)
make.top.equalTo(40)
}
}
} }
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
......
...@@ -22,9 +22,9 @@ class YHMainInformationModel: YHBaseModel { ...@@ -22,9 +22,9 @@ class YHMainInformationModel: YHBaseModel {
var married: Int = 0 var married: Int = 0
var mobile: String = "" var mobile: String = ""
var email: String = "" var email: String = ""
var address_aboard: Int = 0 var address_aboard: Int = 0
var has_hk_id: Int = 0 var has_hk_id: Int = 0
var hk_id_number: String = "" var hk_id_number: String = ""
var step: Int = 0 var step: Int = 0
var surname: String = "" var surname: String = ""
var is_live_oversea_year: Int = 0 var is_live_oversea_year: Int = 0
......
...@@ -30,7 +30,11 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -30,7 +30,11 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
var string = "" var string = ""
let array = mainModel.address.area let array = mainModel.address.area
for item in array { for item in array {
string = string + item if string.count != 0 {
string = string + "/" + item
} else {
string = string + item
}
} }
let item1 = YHItemModel(id: .id3, isNeed: true, title: "省市地区", isUserKeyBoard: false, prompts: "请选择", message: string, type: .address, isShowPrompts: isShowPrompt, alertMessage:"请选择省市地区") let item1 = YHItemModel(id: .id3, isNeed: true, title: "省市地区", isUserKeyBoard: false, prompts: "请选择", message: string, type: .address, isShowPrompts: isShowPrompt, alertMessage:"请选择省市地区")
let item2 = YHItemModel(id: .id4, isNeed: true, title: "详细地址", isUserKeyBoard: true, prompts: "请填写小区、楼栋、单元室等", message: mainModel.address.details, isShowPrompts: isShowPrompt, alertMessage:"请填写小区、楼栋、单元室等") let item2 = YHItemModel(id: .id4, isNeed: true, title: "详细地址", isUserKeyBoard: true, prompts: "请填写小区、楼栋、单元室等", message: mainModel.address.details, isShowPrompts: isShowPrompt, alertMessage:"请填写小区、楼栋、单元室等")
...@@ -95,7 +99,11 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -95,7 +99,11 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
var string = "" var string = ""
let array = mainModel.birth_place.area let array = mainModel.birth_place.area
for item in array { for item in array {
string = string + item if string.count != 0 {
string = string + "/" + item
} else {
string = string + item
}
} }
let item5 = YHItemModel(id: .id26, isNeed: true, title: "出生城市", isUserKeyBoard: false, prompts: "请选择", message: string, type: .address, isShowPrompts: isShowPrompt, alertMessage:"请选择出生城市;") let item5 = YHItemModel(id: .id26, isNeed: true, title: "出生城市", isUserKeyBoard: false, prompts: "请选择", message: string, type: .address, isShowPrompts: isShowPrompt, alertMessage:"请选择出生城市;")
...@@ -502,13 +510,12 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel { ...@@ -502,13 +510,12 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let sex = mainModel.sex let sex = mainModel.sex
_ = mainModel.married _ = mainModel.married
let mobile = mainModel.mobile let mobile = mainModel.mobile
let email = mainModel.email
let has_hk_id = mainModel.has_hk_id let has_hk_id = mainModel.has_hk_id
let hk_id_numbe = mainModel.hk_id_number let hk_id_numbe = mainModel.hk_id_number
guard username.count > 0 else { return false } guard username.count > 0 else { return false }
guard birthday.count > 0 else { return false } guard birthday.count > 0 else { return false }
guard sex > 0 else { return false } guard sex > 0 else { return false }
guard email.count > 0 else { return false } guard mobile.count > 0 else { return false }
if birth_place_aboard == 1 { if birth_place_aboard == 1 {
guard birth_place_foreign.count > 0 else { return false } guard birth_place_foreign.count > 0 else { return false }
} else { } else {
......
...@@ -118,6 +118,15 @@ class YHWorkExperienceListViewController: YHBaseViewController { ...@@ -118,6 +118,15 @@ class YHWorkExperienceListViewController: YHBaseViewController {
} }
}) })
} }
func showDeleteAlert(_ model: YHWorkItemListModel) {
YHCommonAlertView.show("", "您确定要删除这份工作经验吗?", "取消", "确认") {
self.viewModel?.requestDeleteWorkExperience("\(model.id ?? 0)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
self.getData()
})
}
}
} }
extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDataSource { extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDataSource {
...@@ -148,10 +157,7 @@ extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDa ...@@ -148,10 +157,7 @@ extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDa
} }
cell.deleteBlock = {[weak self] model in cell.deleteBlock = {[weak self] model in
guard let self = self else { return } guard let self = self else { return }
self.viewModel?.requestDeleteWorkExperience("\(model.id ?? 0)", callBackBlock: {[weak self] success, error in self.showDeleteAlert(model)
guard let self = self else { return }
self.getData()
})
} }
cell.isMoreBlock = {[weak self] isMore in cell.isMoreBlock = {[weak self] isMore in
guard let self = self else { return } guard let self = self else { return }
......
...@@ -198,6 +198,30 @@ class YHWorkExperienceViewController: YHBaseViewController { ...@@ -198,6 +198,30 @@ class YHWorkExperienceViewController: YHBaseViewController {
} }
} }
func showDeleteAlert(_ model: YHWorkExperienceProjectModel) {
YHCommonAlertView.show("", "确定要删除该项目介绍吗?", "取消", "确认") {[weak self] in
guard let self = self else { return }
self.viewModel?.requestDeleteWorkExperienceProject("\(model.id ?? 0)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
self.getData()
})
}
}
func showDeleteAlert(_ model: YHWorkExperienceFileModel) {
YHCommonAlertView.show("", "确定要删除吗?", "取消", "确认") {[weak self] in
guard let self = self else { return }
for i in 0..<(self.fileDataSource?.count ?? 0) {
let data = self.fileDataSource?[i]
if data?.fileName == model.fileName {
self.fileDataSource?.remove(at: i)
self.tableView.reloadData()
self.viewModel.mainModel.file = self.fileDataSource ?? []
}
}
}
}
deinit { deinit {
NotificationCenter.default.removeObserver(self) NotificationCenter.default.removeObserver(self)
} }
...@@ -323,10 +347,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -323,10 +347,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
} }
cell.deleteBlock = {[weak self] model in cell.deleteBlock = {[weak self] model in
guard let self = self else { return } guard let self = self else { return }
self.viewModel?.requestDeleteWorkExperienceProject("\(model.id ?? 0)", callBackBlock: {[weak self] success, error in self.showDeleteAlert(model)
guard let self = self else { return }
self.getData()
})
} }
cell.isMoreBlock = {[weak self] isMore in cell.isMoreBlock = {[weak self] isMore in
guard let self = self else { return } guard let self = self else { return }
...@@ -380,15 +401,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -380,15 +401,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
cell.experienceListBlock = {[weak self] model, type in cell.experienceListBlock = {[weak self] model, type in
guard let self = self else { return } guard let self = self else { return }
if type == .delete { if type == .delete {
for i in 0..<(self.fileDataSource?.count ?? 0) { self.showDeleteAlert(model)
let data = self.fileDataSource?[i]
if data?.fileName == model.fileName {
self.fileDataSource?.remove(at: i)
self.tableView.reloadData()
self.viewModel.mainModel.file = self.fileDataSource ?? []
return
}
}
} else { } else {
let vc = YHImageViewController() let vc = YHImageViewController()
vc.imgString = model.fileUrl vc.imgString = model.fileUrl
...@@ -435,15 +448,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -435,15 +448,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
cell.experienceListBlock = {[weak self] model, type in cell.experienceListBlock = {[weak self] model, type in
guard let self = self else { return } guard let self = self else { return }
if type == .delete { if type == .delete {
for i in 0..<(self.fileDataSource?.count ?? 0) { self.showDeleteAlert(model)
let data = self.fileDataSource?[i]
if data?.fileName == model.fileName {
self.fileDataSource?.remove(at: i)
self.tableView.reloadData()
self.viewModel.mainModel.file = self.fileDataSource ?? []
return
}
}
} else { } else {
let vc = YHImageViewController() let vc = YHImageViewController()
vc.imgString = model.fileUrl vc.imgString = model.fileUrl
......
...@@ -100,7 +100,7 @@ class YHWorkIntroductionViewController: YHBaseViewController { ...@@ -100,7 +100,7 @@ class YHWorkIntroductionViewController: YHBaseViewController {
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52) make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52)
make.left.equalTo(117) make.left.equalTo(117)
make.height.equalTo(51) make.height.equalTo(51)
make.width.equalTo(80) make.width.equalTo(90)
} }
let startButton = { let startButton = {
...@@ -113,7 +113,7 @@ class YHWorkIntroductionViewController: YHBaseViewController { ...@@ -113,7 +113,7 @@ class YHWorkIntroductionViewController: YHBaseViewController {
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52) make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52)
make.left.equalTo(117) make.left.equalTo(117)
make.height.equalTo(51) make.height.equalTo(51)
make.width.equalTo(80) make.width.equalTo(90)
} }
endTextField = { endTextField = {
...@@ -130,7 +130,7 @@ class YHWorkIntroductionViewController: YHBaseViewController { ...@@ -130,7 +130,7 @@ class YHWorkIntroductionViewController: YHBaseViewController {
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52) make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52)
make.right.equalTo(-18) make.right.equalTo(-18)
make.height.equalTo(51) make.height.equalTo(51)
make.width.equalTo(80) make.width.equalTo(90)
} }
let endButton = { let endButton = {
...@@ -143,7 +143,7 @@ class YHWorkIntroductionViewController: YHBaseViewController { ...@@ -143,7 +143,7 @@ class YHWorkIntroductionViewController: YHBaseViewController {
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52) make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 52)
make.right.equalTo(-18) make.right.equalTo(-18)
make.height.equalTo(51) make.height.equalTo(51)
make.width.equalTo(80) make.width.equalTo(90)
} }
let lineView = UIView() let lineView = UIView()
...@@ -276,17 +276,21 @@ class YHWorkIntroductionViewController: YHBaseViewController { ...@@ -276,17 +276,21 @@ class YHWorkIntroductionViewController: YHBaseViewController {
} }
viewModel?.saveWorkProjectDetail(workModel ?? YHWorkExperienceDetailModel(), projectModel: dataSource, callBackBlock: {[weak self] success, error in viewModel?.saveWorkProjectDetail(workModel ?? YHWorkExperienceDetailModel(), projectModel: dataSource, callBackBlock: {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if let block = self.saveBlock { if success {
block() if let block = self.saveBlock {
block()
}
self.navigationController?.popViewController(animated: true)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
} }
self.navigationController?.popViewController(animated: true)
}) })
} }
@objc func startClick() { @objc func startClick() {
view.endEditing(true) view.endEditing(true)
YHDatePickView.show(type: .yyyymmdd, title: "请选择开始时间") { date in YHDatePickView.show(type: .yyyymmdd, title: "请选择开始时间") { date in
if date > self.dataSource.project_end_time ?? "" { if date > self.dataSource.project_end_time ?? "" && self.dataSource.project_end_time?.count ?? 0 > 0 {
self.startTextField.text = "" self.startTextField.text = ""
self.dataSource.project_start_time = "" self.dataSource.project_start_time = ""
YHHUD.flash(message: "开始时间不能晚于结束时间") YHHUD.flash(message: "开始时间不能晚于结束时间")
......
...@@ -45,7 +45,7 @@ class YHWorkIntroductionItemView: UIView { ...@@ -45,7 +45,7 @@ class YHWorkIntroductionItemView: UIView {
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview() make.left.equalToSuperview()
make.top.equalTo(16) make.top.equalTo(16)
make.width.equalTo(200) make.right.equalTo(-30)
make.height.equalTo(20) make.height.equalTo(20)
} }
......
...@@ -26,7 +26,11 @@ class YHWorkExperienceViewModel: YHBaseViewModel { ...@@ -26,7 +26,11 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
var string = "" var string = ""
let array = mainModel.location.area let array = mainModel.location.area
for item in array { for item in array {
string = string + item if string.count != 0 {
string = string + "/" + item
} else {
string = string + item
}
} }
let item5 = YHWorkExperienceModel(id: .id6, isNeed: true, title: "工作城市", isUserKeyBoard: false, prompts: "请选择", message: string, type: .address, isShowPrompts: isShowPrompt, alertMessage:"请选择工作国家/地区") let item5 = YHWorkExperienceModel(id: .id6, isNeed: true, title: "工作城市", isUserKeyBoard: false, prompts: "请选择", message: string, type: .address, isShowPrompts: isShowPrompt, alertMessage:"请选择工作国家/地区")
let item55 = YHWorkExperienceModel(id: .id7, isNeed: true, title: "工作城市", isUserKeyBoard: true, prompts: "请输入", message: mainModel.location.foreign, isShowPrompts: isShowPrompt, alertMessage:"请输入工作国家/地区") let item55 = YHWorkExperienceModel(id: .id7, isNeed: true, title: "工作城市", isUserKeyBoard: true, prompts: "请输入", message: mainModel.location.foreign, isShowPrompts: isShowPrompt, alertMessage:"请输入工作国家/地区")
...@@ -84,7 +88,7 @@ class YHWorkExperienceViewModel: YHBaseViewModel { ...@@ -84,7 +88,7 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
case .id8: // 职位 case .id8: // 职位
mainModel.position = item.message ?? "" mainModel.position = item.message ?? ""
case .id9: // 入职年月 case .id9: // 入职年月
if item.message ?? "" > mainModel.departure_time { if item.message ?? "" > mainModel.departure_time && mainModel.departure_time.count != 0 {
mainModel.entry_time = "" mainModel.entry_time = ""
if item.message != "" { if item.message != "" {
YHHUD.flash(message: "入职日期不能晚于离职日期") YHHUD.flash(message: "入职日期不能晚于离职日期")
......
...@@ -39,7 +39,7 @@ class YHWorkIntroductionViewModel: YHBaseViewModel { ...@@ -39,7 +39,7 @@ class YHWorkIntroductionViewModel: YHBaseViewModel {
} }
// 0保存 1下一步 // 0保存 1下一步
func saveWorkProjectDetail(_ workModel: YHWorkExperienceDetailModel, projectModel: YHWorkExperienceProjectModel, callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) { func saveWorkProjectDetail(_ workModel: YHWorkExperienceDetailModel, projectModel: YHWorkExperienceProjectModel, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let params: [String : Any] = ["id": projectModel.id ?? 0, let params: [String : Any] = ["id": projectModel.id ?? 0,
"order_id": workModel.order_id, "order_id": workModel.order_id,
"work_id": workModel.id, "work_id": workModel.id,
......
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