Commit a35312e7 authored by Steven杜宇's avatar Steven杜宇

// UI走查

parent 5756f284
...@@ -49,6 +49,7 @@ class YHQualificationDetailVC: YHBaseViewController { ...@@ -49,6 +49,7 @@ class YHQualificationDetailVC: YHBaseViewController {
var bottomView: YHSaveAndSubmitView = { var bottomView: YHSaveAndSubmitView = {
let view = YHSaveAndSubmitView.createView() let view = YHSaveAndSubmitView.createView()
view.changeRightBtnTitle("下一步".local)
return view return view
}() }()
......
...@@ -71,14 +71,11 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -71,14 +71,11 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let title0 = YHFormTitleItem(type: .childInfo) let title0 = YHFormTitleItem(type: .childInfo)
let item00 = YHFormDetailItem(type: .childName) let item00 = YHFormDetailItem(type: .childName)
item00.value = child.subsetName item00.value = child.subsetName
item00.placeHolder = "请输入子女姓名".local
item00.tips = "请输入子女姓名".local item00.tips = "请输入子女姓名".local
let item01 = YHFormDetailItem(type: .everName, isNeed: false) let item01 = YHFormDetailItem(type: .everName, isNeed: false)
item01.value = child.usedName item01.value = child.usedName
item01.placeHolder = "请输入曾用名".local
let item02 = YHFormDetailItem(type: .befourMarryFirstName, isNeed: false) let item02 = YHFormDetailItem(type: .befourMarryFirstName, isNeed: false)
item02.value = child.surname item02.value = child.surname
item02.placeHolder = "请输入婚前姓氏".local
let item03 = YHFormDetailItem(type: .gender) let item03 = YHFormDetailItem(type: .gender)
item03.value = child.sexName() item03.value = child.sexName()
item03.tips = "请选择性别".local item03.tips = "请选择性别".local
...@@ -92,12 +89,10 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -92,12 +89,10 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if child.isBirthOverSeas() { if child.isBirthOverSeas() {
item07.value = child.birthPlace.foreign item07.value = child.birthPlace.foreign
item07.placeHolder = "请输入".local
item07.tips = "请输入出生城市".local item07.tips = "请输入出生城市".local
} else { } else {
item07.value = child.birthPlace.area.joined(separator: ",") item07.value = child.birthPlace.area.joined(separator: ",")
item07.placeHolder = "请选择出生城市".local
item07.tips = "请选择出生城市".local item07.tips = "请选择出生城市".local
} }
...@@ -108,14 +103,12 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -108,14 +103,12 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let item10 = YHFormDetailItem(type: .occupation) let item10 = YHFormDetailItem(type: .occupation)
item10.value = child.occupation item10.value = child.occupation
item10.tips = "请选择职业".local item10.tips = "请选择职业".local
item10.placeHolder = "请选择职业".local
var arr1:[YHFormItemProtocol] = [title1, item10] var arr1:[YHFormItemProtocol] = [title1, item10]
if child.isNowHaveJob() { if child.isNowHaveJob() {
let item11 = YHFormDetailItem(type: .occupationName) let item11 = YHFormDetailItem(type: .occupationName)
item11.value = child.occupationName item11.value = child.occupationName
item11.tips = "请输入职业名称".local item11.tips = "请输入职业名称".local
item11.placeHolder = "请输入职业名称".local
arr1.append(item11) arr1.append(item11)
} }
items.append(contentsOf: [arr0, arr1]) items.append(contentsOf: [arr0, arr1])
...@@ -141,12 +134,10 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -141,12 +134,10 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if child.isNowInHK() { // 目前在港才显示 逗留期限和在港身份 if child.isNowInHK() { // 目前在港才显示 逗留期限和在港身份
let item31 = YHFormDetailItem(type: .stayHKDate) let item31 = YHFormDetailItem(type: .stayHKDate)
item31.placeHolder = "请选择".local
item31.tips = "请选择获准逗留期限".local item31.tips = "请选择获准逗留期限".local
item31.value = child.childInHk.info item31.value = child.childInHk.info
let item32 = YHFormDetailItem(type: .roleInHK) let item32 = YHFormDetailItem(type: .roleInHK)
item32.placeHolder = "请选择".local
item32.tips = "请选择在港身份".local item32.tips = "请选择在港身份".local
item32.value = child.hkIdentity item32.value = child.hkIdentity
......
...@@ -116,7 +116,7 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -116,7 +116,7 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
bottomView.saveBlock = { bottomView.saveBlock = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
self.saveInfo(isSubmit: false, isShowLoading: true, callBack:nil) self.saveInfo(isSubmit: false, isShowSubmitMsg:false, isShowLoading: true, callBack:nil)
} }
stepView.snp.makeConstraints { make in stepView.snp.makeConstraints { make in
...@@ -188,7 +188,15 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -188,7 +188,15 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
func submit() { func submit() {
if let targetVC = getCurrentStepViewController() { if let targetVC = getCurrentStepViewController() {
if targetVC.nextStep() { if targetVC.nextStep() {
saveInfo(isSubmit: true, isShowLoading: true) {
var isShowSubmitMsg = false
let index = getArrayIndexOfCurrentStep()
if let index = index, index == stepVCs.count-1 {
// 最后一步
isShowSubmitMsg = true
}
saveInfo(isSubmit: true, isShowSubmitMsg:isShowSubmitMsg, isShowLoading: true) {
[weak self] success in [weak self] success in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
...@@ -244,7 +252,8 @@ extension YHChildInfoContainerVC { ...@@ -244,7 +252,8 @@ extension YHChildInfoContainerVC {
// @param isSubmit:是否为提交 false为保存 true为提交 // @param isSubmit:是否为提交 false为保存 true为提交
// @param isShowLoading: 是否展示loading和toast // @param isShowLoading: 是否展示loading和toast
func saveInfo(isSubmit:Bool, isShowLoading:Bool, callBack:((Bool)->Void)?) { //
func saveInfo(isSubmit:Bool, isShowSubmitMsg:Bool, isShowLoading:Bool, callBack:((Bool)->Void)?) {
guard let child = child else { return } guard let child = child else { return }
guard let info = child.toDictionary() else { return } guard let info = child.toDictionary() else { return }
...@@ -260,9 +269,9 @@ extension YHChildInfoContainerVC { ...@@ -260,9 +269,9 @@ extension YHChildInfoContainerVC {
guard let self = self else { return } guard let self = self else { return }
if isShowLoading { if isShowLoading {
if success { if success {
YHHUD.flash(message:isSubmit ? "提交成功" : "保存成功") YHHUD.flash(message:isSubmit && isShowSubmitMsg ? "提交成功" : "保存成功")
} else { } else {
var msg = isSubmit ? "提交失败" : "保存失败" var msg = isSubmit && isShowSubmitMsg ? "提交失败" : "保存失败"
if let errorMsg = error?.errorMsg, errorMsg.count > 0 { if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
msg = errorMsg msg = errorMsg
} }
...@@ -295,6 +304,6 @@ extension YHChildInfoContainerVC { ...@@ -295,6 +304,6 @@ extension YHChildInfoContainerVC {
} }
func saveInfoSilent() { func saveInfoSilent() {
saveInfo(isSubmit:false, isShowLoading:false, callBack:nil) saveInfo(isSubmit:false, isShowSubmitMsg:false, isShowLoading:false, callBack:nil)
} }
} }
...@@ -131,7 +131,7 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -131,7 +131,7 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
bottomView.saveBlock = { bottomView.saveBlock = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
saveInfo(isSubmit: false, isLoading: true, callBack: nil) saveInfo(isSubmit: false, isShowSubmitMsg:false, isLoading: true, callBack: nil)
} }
stepView.snp.makeConstraints { make in stepView.snp.makeConstraints { make in
...@@ -206,7 +206,7 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -206,7 +206,7 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
extension YHSpouseInfoContainerVC { extension YHSpouseInfoContainerVC {
// isSubmit:是否为提交 false为保存 true为提交 // isSubmit:是否为提交 false为保存 true为提交
func saveInfo(isSubmit:Bool, isLoading:Bool, callBack:((Bool)->Void)?) { func saveInfo(isSubmit:Bool, isShowSubmitMsg:Bool, isLoading:Bool, callBack:((Bool)->Void)?) {
guard let spouse = spouse else { return } guard let spouse = spouse else { return }
guard let info = spouse.toDictionary() else { return } guard let info = spouse.toDictionary() else { return }
...@@ -221,9 +221,9 @@ extension YHSpouseInfoContainerVC { ...@@ -221,9 +221,9 @@ extension YHSpouseInfoContainerVC {
success, error in success, error in
if isLoading { if isLoading {
if success { if success {
YHHUD.flash(message:isSubmit ? "提交成功" : "保存成功") YHHUD.flash(message:isSubmit && isShowSubmitMsg ? "提交成功" : "保存成功")
} else { } else {
var msg = isSubmit ? "提交失败" : "保存失败" var msg = isSubmit && isShowSubmitMsg ? "提交失败" : "保存失败"
if let errorMsg = error?.errorMsg, errorMsg.count > 0 { if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
msg = errorMsg msg = errorMsg
} }
...@@ -237,7 +237,7 @@ extension YHSpouseInfoContainerVC { ...@@ -237,7 +237,7 @@ extension YHSpouseInfoContainerVC {
} }
func saveInfoSilent() { func saveInfoSilent() {
saveInfo(isSubmit: false, isLoading: false) { saveInfo(isSubmit: false,isShowSubmitMsg:false, isLoading: false) {
[weak self] success in [weak self] success in
} }
...@@ -247,7 +247,15 @@ extension YHSpouseInfoContainerVC { ...@@ -247,7 +247,15 @@ extension YHSpouseInfoContainerVC {
func submit() { func submit() {
if let targetVC = getCurrentStepViewController() { if let targetVC = getCurrentStepViewController() {
if targetVC.nextStep() { if targetVC.nextStep() {
saveInfo(isSubmit: true, isLoading: true) {
var isShowSubmitMsg = false
let index = getArrayIndexOfCurrentStep()
if let index = index, index == stepVCs.count-1 {
// 最后一步
isShowSubmitMsg = true
}
saveInfo(isSubmit: true, isShowSubmitMsg:isShowSubmitMsg, isLoading: true) {
[weak self] success in [weak self] success in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
......
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