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

主申请人相关bug处理

parent da0981c1
......@@ -93,7 +93,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
guard let self = self else { return }
if self.viewModel.isCanNext(self.stepView.currentIndex) {
self.viewModel.mainModel.step = self.stepView.currentIndex
self.viewModel.updateMainInformation(.submit, self.orderId) {[weak self] success, error in
self.viewModel.updateMainInformation(.submit, self.orderId, self.stepView.currentIndex) {[weak self] success, error in
guard let self = self else { return }
if let error = error {
YHHUD.flash(message: error.errorMsg )
......@@ -117,7 +117,7 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
}
bottom.saveBlock = { [weak self] in
guard let self = self else { return }
self.viewModel.updateMainInformation(.save, self.orderId) {[weak self] success, error in
self.viewModel.updateMainInformation(.save, self.orderId, self.stepView.currentIndex) {[weak self] success, error in
guard let _ = self else { return }
if let error = error {
YHHUD.flash(message: error.errorMsg )
......
......@@ -62,5 +62,5 @@ class YHCertificatesModel: YHBaseModel {
var issue_date_end_at: String = ""
var img_front: String = ""
var img_back: String = ""
var passport_type: String = ""
var pass_port_type: String = ""
}
......@@ -67,7 +67,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let item13 = YHItemModel(id: .id15, isNeed: true, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.hk_macao_pass.issue_date_end_at, type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择届满日期")
let section1 = YHSectionItemModel(title: "港澳通行证", models: [item10, item11, item12, item13])
let item4 = YHItemModel(id: .id16, isNeed: !flag, title: "证件类别", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.passport_type, type: .id, isShowPrompts: isShowPrompt, alertMessage:"请选择件类别")
let item4 = YHItemModel(id: .id16, isNeed: !flag, title: "证件类别", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.pass_port_type, type: .id, isShowPrompts: isShowPrompt, alertMessage:"请选择件类别")
let item5 = YHItemModel(id: .id17, isNeed: !flag, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.passport.number, isShowPrompts: isShowPrompt, alertMessage:"请输入证件号码")
let item6 = YHItemModel(id: .id18, isNeed: !flag, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: mainModel.certificates.passport.issue_at, isShowPrompts: isShowPrompt, alertMessage:"请输入签发地")
let item7 = YHItemModel(id: .id19, isNeed: !flag, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: mainModel.certificates.passport.issue_date_start_at, type: .time, isShowPrompts: isShowPrompt, alertMessage:"请选择签发日期")
......@@ -79,7 +79,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
section2String = "护照及其他旅行证件"
}
let section2 = YHSectionItemModel(title: section2String, models: [item4, item5, item6, item7, item8])
if mainModel.has_hk_id == 1 {
if mainModel.is_handled == 1 {
return [section, section1, section2]
} else {
return [section, section2]
......@@ -128,7 +128,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let section = YHSectionItemModel(title: "中国身份证(选填)", models: [item])
let item1 = YHItemModel(id: .id6, isNeed: true, title: "港澳通行证(选填)", isUserKeyBoard: false, prompts: "请输入", message: nil, isShowPrompts: isShowPrompt)
let section1 = YHSectionItemModel(title: "中国身份证(选填)", models: [item1])
if mainModel.has_hk_id == 1 {
if mainModel.is_handled == 1 {
return [section, section1]
} else {
return [section]
......@@ -170,7 +170,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
case .id15:
mainModel.certificates.hk_macao_pass.issue_date_end_at = item.message ?? ""
case .id16:
mainModel.certificates.passport.passport_type = item.value?.first ?? ""
mainModel.certificates.passport.pass_port_type = item.value?.first ?? ""
case .id17:
mainModel.certificates.passport.number = item.message ?? ""
case .id18:
......@@ -309,7 +309,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
}
}
func updateMainInformation(_ saveType: YHSaveType,_ orderID: Int, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
func updateMainInformation(_ saveType: YHSaveType, _ orderID: Int, _ step: Int, callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
var type = ""
if saveType == .save {
type = "save"
......@@ -344,7 +344,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
"issue_date_end_at": mainModel.certificates.passport.issue_date_end_at,
"issue_date_start_at": mainModel.certificates.passport.issue_date_start_at,
"number": mainModel.certificates.passport.number,
"passport_type": mainModel.certificates.passport.passport_type] as [String : Any]
"passport_type": mainModel.certificates.passport.pass_port_type] as [String : Any]
let params: [String : Any] = ["address": address,
"address_aboard": mainModel.address_aboard,
"age":mainModel.age,
......@@ -362,7 +362,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
"nationality": mainModel.nationality,
"order_id": orderID,
"sex": mainModel.sex,
"step": mainModel.step,
"step": step,
"surname": mainModel.surname,
"used_name": mainModel.used_name,
"username": mainModel.username,
......@@ -505,7 +505,7 @@ class YHMainApplicantInformationViewModel: YHBaseViewModel {
let hk_macao_pass_issue_at = mainModel.certificates.hk_macao_pass.issue_at
let hk_macao_pass_issue_date_start_at = mainModel.certificates.hk_macao_pass.issue_date_start_at
let hk_macao_pass_issue_date_end_at = mainModel.certificates.hk_macao_pass.issue_date_end_at
let passport_type = mainModel.certificates.passport.passport_type
let passport_type = mainModel.certificates.passport.pass_port_type
let passport_number = mainModel.certificates.passport.number
let passport_issue_at = mainModel.certificates.passport.issue_at
let passport_issue_date_start_at = mainModel.certificates.passport.issue_date_start_at
......
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