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

Merge commit 'fb8c951c' into xiezhaolin

parents b96c7173 fb8c951c
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
04010B952B6A1DE90093F3BB /* YHSaveAndSubmitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */; }; 04010B952B6A1DE90093F3BB /* YHSaveAndSubmitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */; };
0413A6D82B8C76290006D154 /* YHCertificateUploadVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0413A6D72B8C76290006D154 /* YHCertificateUploadVC.swift */; };
041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; }; 041B52872B5657B3007EBCEB /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52862B5657B3007EBCEB /* IMAppKey.swift */; };
041B528D2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */; }; 041B528D2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */; };
041B528F2B5E620E007EBCEB /* YHFormItemInputTextCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528E2B5E620E007EBCEB /* YHFormItemInputTextCell.swift */; }; 041B528F2B5E620E007EBCEB /* YHFormItemInputTextCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528E2B5E620E007EBCEB /* YHFormItemInputTextCell.swift */; };
...@@ -302,6 +303,7 @@ ...@@ -302,6 +303,7 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSaveAndSubmitView.swift; sourceTree = "<group>"; }; 04010B942B6A1DE90093F3BB /* YHSaveAndSubmitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSaveAndSubmitView.swift; sourceTree = "<group>"; };
0413A6D72B8C76290006D154 /* YHCertificateUploadVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadVC.swift; sourceTree = "<group>"; };
041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; }; 041B52862B5657B3007EBCEB /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; };
041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDoubleChoiceCell.swift; sourceTree = "<group>"; }; 041B528C2B5E58FA007EBCEB /* YHFormItemDoubleChoiceCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemDoubleChoiceCell.swift; sourceTree = "<group>"; };
041B528E2B5E620E007EBCEB /* YHFormItemInputTextCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemInputTextCell.swift; sourceTree = "<group>"; }; 041B528E2B5E620E007EBCEB /* YHFormItemInputTextCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemInputTextCell.swift; sourceTree = "<group>"; };
...@@ -838,6 +840,7 @@ ...@@ -838,6 +840,7 @@
children = ( children = (
04E86E0E2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift */, 04E86E0E2B70DE9400A35F4B /* YHSpouseInfoContainerVC.swift */,
041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */, 041B52D52B5F899E007EBCEB /* YHSpousePrimaryInfoVC.swift */,
0413A6D72B8C76290006D154 /* YHCertificateUploadVC.swift */,
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */, 042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */,
); );
path = "Spouse(配偶)"; path = "Spouse(配偶)";
...@@ -1789,6 +1792,7 @@ ...@@ -1789,6 +1792,7 @@
04E86E362B832F5D00A35F4B /* YHWorkExperienceTableViewCell.swift in Sources */, 04E86E362B832F5D00A35F4B /* YHWorkExperienceTableViewCell.swift in Sources */,
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */, A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */,
A5ACE9452B4564F7002C94D2 /* YHHUDContainerView.swift in Sources */, A5ACE9452B4564F7002C94D2 /* YHHUDContainerView.swift in Sources */,
0413A6D82B8C76290006D154 /* YHCertificateUploadVC.swift in Sources */,
A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */, A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */,
04E86E662B86EB6F00A35F4B /* YHLoginManager.swift in Sources */, 04E86E662B86EB6F00A35F4B /* YHLoginManager.swift in Sources */,
042F888B2B8477C6008B60BD /* YHEducationInfo.swift in Sources */, 042F888B2B8477C6008B60BD /* YHEducationInfo.swift in Sources */,
......
...@@ -138,7 +138,7 @@ class YHHomeViewController: YHBaseViewController { ...@@ -138,7 +138,7 @@ class YHHomeViewController: YHBaseViewController {
initView() initView()
//2.网络请求 //2.网络请求
requestData() // requestData()
......
...@@ -32,6 +32,8 @@ class YHBasicInfoFillViewController: YHBaseViewController { ...@@ -32,6 +32,8 @@ class YHBasicInfoFillViewController: YHBaseViewController {
//1.0 //1.0
initView() initView()
orderId = 6019 //for test hjl
//2.0 //2.0
loadData() loadData()
} }
...@@ -105,19 +107,23 @@ extension YHBasicInfoFillViewController { ...@@ -105,19 +107,23 @@ extension YHBasicInfoFillViewController {
var applicant : [String : Any] = [:] var applicant : [String : Any] = [:]
for (index0,item0) in item.arrQuestionItem.enumerated() { for (index0,item0) in item.arrQuestionItem.enumerated() {
if index0 == 0 { if index0 == 0 {
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""] let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "has_breaking_law")
} else if index0 == 1 {
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "has_conviction") applicant.updateValue(value, forKey: "has_conviction")
} else if index0 == 2 { }
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""] else if index0 == 1 {
applicant.updateValue(value, forKey: "has_deny") let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
} else if index0 == 3 {
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "has_departure") applicant.updateValue(value, forKey: "has_departure")
} else if index0 == 4 { }
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""] else if index0 == 2 {
let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "has_deny")
}
else if index0 == 3 {
let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "has_breaking_law")
}
else if index0 == 4 {
let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "has_other_id") applicant.updateValue(value, forKey: "has_other_id")
} else { } else {
printLog("其他数据没有处理") printLog("其他数据没有处理")
...@@ -130,10 +136,10 @@ extension YHBasicInfoFillViewController { ...@@ -130,10 +136,10 @@ extension YHBasicInfoFillViewController {
var applicant : [String : Any] = [:] var applicant : [String : Any] = [:]
for (index0,item0) in item.arrQuestionItem.enumerated() { for (index0,item0) in item.arrQuestionItem.enumerated() {
if index0 == 0 { if index0 == 0 {
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""] let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "child_deny") applicant.updateValue(value, forKey: "child_deny")
} else if index0 == 1 { } else if index0 == 1 {
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""] let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "child_departure") applicant.updateValue(value, forKey: "child_departure")
} else { } else {
printLog("其他数据没有处理") printLog("其他数据没有处理")
...@@ -152,10 +158,10 @@ extension YHBasicInfoFillViewController { ...@@ -152,10 +158,10 @@ extension YHBasicInfoFillViewController {
var applicant : [String : Any] = [:] var applicant : [String : Any] = [:]
for (index0,item0) in item.arrQuestionItem.enumerated() { for (index0,item0) in item.arrQuestionItem.enumerated() {
if index0 == 0 { if index0 == 0 {
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""] let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "child_deny") applicant.updateValue(value, forKey: "child_deny")
} else if index0 == 1 { } else if index0 == 1 {
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""] let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "child_departure") applicant.updateValue(value, forKey: "child_departure")
} else { } else {
printLog("其他数据没有处理") printLog("其他数据没有处理")
...@@ -172,7 +178,7 @@ extension YHBasicInfoFillViewController { ...@@ -172,7 +178,7 @@ extension YHBasicInfoFillViewController {
var applicant : [String : Any] = [:] var applicant : [String : Any] = [:]
for (index0,item0) in item.arrQuestionItem.enumerated() { for (index0,item0) in item.arrQuestionItem.enumerated() {
if index0 == 0 { if index0 == 0 {
let value = ["answer":item0.answer,"info":item0.answer == "Y" ? item0.info : ""] let value = ["has":item0.answer,"info":item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "background_member") applicant.updateValue(value, forKey: "background_member")
} else { } else {
printLog("其他数据没有处理") printLog("其他数据没有处理")
......
...@@ -84,13 +84,13 @@ extension YHBasicInfoFillViewModel { ...@@ -84,13 +84,13 @@ extension YHBasicInfoFillViewModel {
//主申请人 //主申请人
let model1 = YHBasicInfoCellModel(question: "1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?", answer: dataModelForBasicInfo.applicant?.has_conviction?.has ?? "", info: dataModelForBasicInfo.applicant?.has_conviction?.info ?? "") let model1 = YHBasicInfoCellModel(question: "1、是否曾在香港或其他地方因任何罪行或违法行为被定罪?", answer: dataModelForBasicInfo.applicant?.has_conviction?.has ?? "", info: dataModelForBasicInfo.applicant?.has_conviction?.info ?? "")
let model2 = YHBasicInfoCellModel(question: "2、是否曾在香港或其他地方被拒入境/递解/遣送或要求离境?", answer: dataModelForBasicInfo.applicant?.has_departure?.has ?? "", info: dataModelForBasicInfo.applicant?.has_departure?.has ?? "") let model2 = YHBasicInfoCellModel(question: "2、是否曾在香港或其他地方被拒入境/递解/遣送或要求离境?", answer: dataModelForBasicInfo.applicant?.has_departure?.has ?? "", info: dataModelForBasicInfo.applicant?.has_departure?.info ?? "")
let model3 = YHBasicInfoCellModel(question: "3、是否曾被拒绝签发香港或其他地方的签证/进入许可?", answer: dataModelForBasicInfo.applicant?.has_deny?.has ?? "", info: dataModelForBasicInfo.applicant?.has_deny?.has ?? "") let model3 = YHBasicInfoCellModel(question: "3、是否曾被拒绝签发香港或其他地方的签证/进入许可?", answer: dataModelForBasicInfo.applicant?.has_deny?.has ?? "", info: dataModelForBasicInfo.applicant?.has_deny?.info ?? "")
let model4 = YHBasicInfoCellModel(question: "4、是否曾触犯香港或任何地方的入境法例?", answer: dataModelForBasicInfo.applicant?.has_breaking_law?.has ?? "", info: dataModelForBasicInfo.applicant?.has_breaking_law?.has ?? "") let model4 = YHBasicInfoCellModel(question: "4、是否曾触犯香港或任何地方的入境法例?", answer: dataModelForBasicInfo.applicant?.has_breaking_law?.has ?? "", info: dataModelForBasicInfo.applicant?.has_breaking_law?.info ?? "")
let model5 = YHBasicInfoCellModel(question: "5、是否曾经使用另一个姓名或身份申请香港入境签证/进入许可或进入香港?", answer: dataModelForBasicInfo.applicant?.has_other_id?.has ?? "", info: dataModelForBasicInfo.applicant?.has_other_id?.has ?? "") let model5 = YHBasicInfoCellModel(question: "5、是否曾经使用另一个姓名或身份申请香港入境签证/进入许可或进入香港?", answer: dataModelForBasicInfo.applicant?.has_other_id?.has ?? "", info: dataModelForBasicInfo.applicant?.has_other_id?.info ?? "")
let arr = [model1,model2,model3,model4,model5] let arr = [model1,model2,model3,model4,model5]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "主申请人", arrQuestionItem: arr) let sessionModel = YHBasicInfoSessionModel(sessionTitle: "主申请人", arrQuestionItem: arr)
...@@ -99,8 +99,8 @@ extension YHBasicInfoFillViewModel { ...@@ -99,8 +99,8 @@ extension YHBasicInfoFillViewModel {
do { do {
//配偶 //配偶
let model1 = YHBasicInfoCellModel(question: "1、是否曾被拒绝入境/递解/遣送或要求离开香港?", answer: dataModelForBasicInfo.spouse?.child_departure?.has ?? "", info: dataModelForBasicInfo.spouse?.child_departure?.has ?? "") let model1 = YHBasicInfoCellModel(question: "1、是否曾被拒绝入境/递解/遣送或要求离开香港?", answer: dataModelForBasicInfo.spouse?.child_departure?.has ?? "", info: dataModelForBasicInfo.spouse?.child_departure?.info ?? "")
let model2 = YHBasicInfoCellModel(question: "2、是否曾被拒绝签发签证/进入许可以入境香港?", answer: dataModelForBasicInfo.spouse?.child_deny?.has ?? "", info: dataModelForBasicInfo.spouse?.child_deny?.has ?? "") let model2 = YHBasicInfoCellModel(question: "2、是否曾被拒绝签发签证/进入许可以入境香港?", answer: dataModelForBasicInfo.spouse?.child_deny?.has ?? "", info: dataModelForBasicInfo.spouse?.child_deny?.info ?? "")
let arr = [model1,model2] let arr = [model1,model2]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "配偶", arrQuestionItem: arr) let sessionModel = YHBasicInfoSessionModel(sessionTitle: "配偶", arrQuestionItem: arr)
...@@ -147,7 +147,11 @@ extension YHBasicInfoFillViewModel { ...@@ -147,7 +147,11 @@ extension YHBasicInfoFillViewModel {
// callBackBlock(true,nil)//先返回数据 让界面展示相关的UI // callBackBlock(true,nil)//先返回数据 让界面展示相关的UI
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Basics.basicInfoApi // let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Basics.basicInfoApi
//http://192.168.25.21:10087 梁杰ip
let strUrl = "http://192.168.25.21:10087/" + "infoflow/basics/get_basics"
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
...@@ -174,8 +178,10 @@ extension YHBasicInfoFillViewModel { ...@@ -174,8 +178,10 @@ extension YHBasicInfoFillViewModel {
//保存基本资料信息 //保存基本资料信息
func saveBasicInfo( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) { func saveBasicInfo( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Basics.updateBasicInfoApi // let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Basics.updateBasicInfoApi
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
let strUrl = "http://192.168.25.21:10087/" + "infoflow/basics/update_basics"
let _ = YHNetRequest.postRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard self != nil else { return } guard self != nil else { return }
guard let model = NetBaseModel.deserialize(dict: json) else { guard let model = NetBaseModel.deserialize(dict: json) else {
...@@ -184,15 +190,14 @@ extension YHBasicInfoFillViewModel { ...@@ -184,15 +190,14 @@ extension YHBasicInfoFillViewModel {
return return
} }
printLog("model 是 ==> \(model)") printLog("model 是 ==> \(model)")
// let dic = model.data?.peel if model.code == 200 {
// guard let resultModel = YHBasicInfoFillModel.deserialize(dict: dic as? [AnyHashable : Any]) else { callBackBlock(true,nil)
// callBackBlock(false,nil) } else {
// return
// } let error : YHErrorModel = YHErrorModel(errorCode:Int32(model.code),errorMsg: model.msg)
// callBackBlock(false,error)
// self.dataModelForBasicInfo = resultModel
//根据返回值 组装 真实的数据 }
callBackBlock(true,nil)
} failBlock: { err in } failBlock: { err in
callBackBlock(false,err) callBackBlock(false,err)
} }
......
//
// YHCertificateUploadVC.swift
// galaxy
//
// Created by edy on 2024/2/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateUploadVC: YHBaseViewController, YHFamilyMemberProtol {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .systemPink
// Do any additional setup after loading the view.
}
func nextStep()->Bool {
return true
}
}
...@@ -22,11 +22,12 @@ enum HKFormItemCellType: Int { ...@@ -22,11 +22,12 @@ enum HKFormItemCellType: Int {
} }
class YHSpouseBasicInfoVC: YHBaseViewController { class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
var spouse:YHFamilyMember? var spouse:YHFamilyMember?
weak var delegate:YHSpouseInfoVCProtocol? weak var delegate:YHSpouseInfoVCProtocol?
// 是否显示未填写错误提示
var isNeedShowError = false
var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]() var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -87,6 +88,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -87,6 +88,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
let item00 = YHFormDetailItem(type: .spouseName) let item00 = YHFormDetailItem(type: .spouseName)
item00.placeHolder = "请输入".local item00.placeHolder = "请输入".local
item00.value = spouse.subsetName item00.value = spouse.subsetName
item00.tips = "请输入配偶姓名".local
let item01 = YHFormDetailItem(type: .everName, isNeed: false) let item01 = YHFormDetailItem(type: .everName, isNeed: false)
item01.placeHolder = "选填".local item01.placeHolder = "选填".local
...@@ -99,7 +101,8 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -99,7 +101,8 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
let item03 = YHFormDetailItem(type: .birthday) let item03 = YHFormDetailItem(type: .birthday)
item03.placeHolder = "请选择".local item03.placeHolder = "请选择".local
item03.value = spouse.birthday item03.value = spouse.birthday
item03.tips = "请选择出生日期".local
let item04 = YHFormDetailItem(type: .birthNation) let item04 = YHFormDetailItem(type: .birthNation)
item04.value = String(spouse.isBirthOverSeas()) item04.value = String(spouse.isBirthOverSeas())
...@@ -107,9 +110,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -107,9 +110,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
if spouse.isBirthOverSeas() { if spouse.isBirthOverSeas() {
item05.value = spouse.birthPlace?.foreign item05.value = spouse.birthPlace?.foreign
item05.placeHolder = "请输入".local item05.placeHolder = "请输入".local
item05.tips = "请输入出生城市".local
} else { } else {
item05.value = spouse.birthPlace?.area?.joined(separator: ",") item05.value = spouse.birthPlace?.area?.joined(separator: ",")
item05.placeHolder = "请选择".local item05.placeHolder = "请选择".local
item05.tips = "请选择出生城市".local
} }
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05] let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05]
...@@ -117,13 +124,16 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -117,13 +124,16 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
let title1 = YHFormTitleItem(type: .occupationInfo) let title1 = YHFormTitleItem(type: .occupationInfo)
let item10 = YHFormDetailItem(type: .occupation) let item10 = YHFormDetailItem(type: .occupation)
item10.value = spouse.occupation item10.value = spouse.occupation
item10.placeHolder = "请输入".local item10.placeHolder = "请选择".local
item10.tips = "请选择职业".local
var arr1:[YHFormItemProtocol] = [title1, item10] var arr1:[YHFormItemProtocol] = [title1, item10]
if spouse.isNowHaveJob() { if spouse.isNowHaveJob() {
let item11 = YHFormDetailItem(type: .occupationName) let item11 = YHFormDetailItem(type: .occupationName)
item11.value = spouse.occupationName item11.value = spouse.occupationName
item11.placeHolder = "请输入".local item11.placeHolder = "请输入".local
item11.tips = "请输入职业名称".local
arr1.append(item11) arr1.append(item11)
} }
...@@ -132,6 +142,8 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -132,6 +142,8 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
let item20 = YHFormDetailItem(type: .ownDegree) let item20 = YHFormDetailItem(type: .ownDegree)
item20.placeHolder = "请选择".local item20.placeHolder = "请选择".local
item20.value = spouse.haveDegreeName() item20.value = spouse.haveDegreeName()
item20.tips = "请选择".local
var arr2:[YHFormItemProtocol] = [title2, item20] var arr2:[YHFormItemProtocol] = [title2, item20]
if spouse.isHaveDegree() { // 选择了有学位 if spouse.isHaveDegree() { // 选择了有学位
...@@ -164,11 +176,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -164,11 +176,13 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
let item31 = YHFormDetailItem(type: .stayHKDate) let item31 = YHFormDetailItem(type: .stayHKDate)
item31.placeHolder = "请选择".local item31.placeHolder = "请选择".local
item31.value = spouse.childInHk?.info item31.value = spouse.childInHk?.info
item31.tips = "请选择".local
let item32 = YHFormDetailItem(type: .roleInHK) let item32 = YHFormDetailItem(type: .roleInHK)
item32.placeHolder = "请选择".local item32.placeHolder = "请选择".local
item32.value = spouse.hkIdentity item32.value = spouse.hkIdentity
item32.tips = "请选择".local
arr3.append(contentsOf: [item31, item32]) arr3.append(contentsOf: [item31, item32])
} }
...@@ -181,12 +195,69 @@ class YHSpouseBasicInfoVC: YHBaseViewController { ...@@ -181,12 +195,69 @@ class YHSpouseBasicInfoVC: YHBaseViewController {
if spouse.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号 if spouse.isHaveHKIdentityCard() { // 办理过香港身份证才显示证号
let item41 = YHFormDetailItem(type: .hkIdentityCardNumber) let item41 = YHFormDetailItem(type: .hkIdentityCardNumber)
item41.value = spouse.hkIdentityCard item41.value = spouse.hkIdentityCard
item41.tips = "请输入正确的香港身份证号码".local
arr4.append(item41) arr4.append(item41)
} }
items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4]) items.append(contentsOf: [arr0, arr1, arr2, arr3, arr4])
tableView.reloadData() tableView.reloadData()
} }
// 检查填写信息完整性
func checkIntegrity() -> Bool {
guard let spouse = spouse else { return false}
if isEmptyString(spouse.subsetName) {
return false
}
if isEmptyString(spouse.birthday) {
return false
}
if spouse.isBirthOverSeas() {
if isEmptyString(spouse.birthPlace?.foreign) {
return false
}
} else {
if isEmptyArray(spouse.birthPlace?.area) {
return false
}
}
if isEmptyString(spouse.occupation) {
return false
}
if spouse.isNowHaveJob(), isEmptyString(spouse.occupationName) {
return false
}
if spouse.isHaveDegree() { // 选择了有学位
if let degreeArr = spouse.hasDegreeJson, !degreeArr.isEmpty {
for degreeInfo in degreeArr {
if isEmptyString(degreeInfo.degree) || isEmptyString(degreeInfo.address) {
return false
}
}
}
}
return true
}
func nextStep()->Bool {
guard let spouse = spouse else { return false }
let isChecked = checkIntegrity()
isNeedShowError = !isChecked
self.tableView .reloadData()
if !isChecked {
YHHUD.flash(message: "资料还未填完")
return false
}
return true
}
func getCellType(_ item: Any) ->HKFormItemCellType { func getCellType(_ item: Any) ->HKFormItemCellType {
if item is YHFormTitleItem { if item is YHFormTitleItem {
return .title return .title
...@@ -293,7 +364,19 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -293,7 +364,19 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.text = detailItem.value cell.text = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1 cell.isShowBottomLine = indexPath.row != arr.count-1
if detailItem.type == .hkIdentityCardNumber { // 输入香港身份证号码
let isEmptyValue = isEmptyString(detailItem.value)
var isUnvalidFormat = true
if let value = detailItem.value, value.isHKIdentityCardNumber() {
isUnvalidFormat = false
}
let isNeedShowTips = isEmptyValue || isUnvalidFormat
cell.setTips(detailItem.tips, isShow: isNeedShowError && isNeedShowTips)
} else {
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
}
cell.textChange = { cell.textChange = {
[weak self] (text, isEditEnd) in [weak self] (text, isEditEnd) in
guard let self = self else { return } guard let self = self else { return }
...@@ -313,6 +396,12 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -313,6 +396,12 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
if isEditEnd { if isEditEnd {
self.loadBasicInfo() self.loadBasicInfo()
if detailItem.type == .hkIdentityCardNumber {
if let text = text, !text.isHKIdentityCardNumber() {
YHHUD.flash(message: "请输入正确的香港身份证号格式")
return
}
}
if let delegate = delegate { if let delegate = delegate {
delegate.saveInfo?() delegate.saveInfo?()
} }
...@@ -328,6 +417,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -328,6 +417,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1 cell.isShowBottomLine = indexPath.row != arr.count-1
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
return cell return cell
} }
...@@ -550,6 +640,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -550,6 +640,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
self.spouse?.occupation = selectType.title self.spouse?.occupation = selectType.title
self.loadBasicInfo() self.loadBasicInfo()
} }
} else if detailItem.type == .ownDegree { } else if detailItem.type == .ownDegree {
let hasDegree = self.spouse?.haveDegreeName() ?? "无学位" let hasDegree = self.spouse?.haveDegreeName() ?? "无学位"
YHFormPickerView.show(type: .ownDegree, selectTitle:hasDegree ) { YHFormPickerView.show(type: .ownDegree, selectTitle:hasDegree ) {
......
...@@ -12,30 +12,47 @@ import UIKit ...@@ -12,30 +12,47 @@ import UIKit
@objc optional func updateStepView() @objc optional func updateStepView()
@objc optional func saveInfo() @objc optional func saveInfo()
}
@objc protocol YHFamilyMemberProtol {
@objc func nextStep()->Bool
}
class YHFaimilyStepItem {
typealias YHFamilyStepVC = UIViewController & YHFamilyMemberProtol
var title:String = ""
var vc:YHFamilyStepVC
var step:Int = -1
init(title:String, vc: YHFamilyStepVC, step: Int) {
self.title = title
self.vc = vc
self.step = step
}
} }
class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
let familyRequest:YHFamilyRequestViewModel = YHFamilyRequestViewModel() let familyRequest:YHFamilyRequestViewModel = YHFamilyRequestViewModel()
var stepVCs:[YHFaimilyStepItem] = []
var orderId:Int = 0 var orderId:Int = 0
var spouse:YHFamilyMember? { var spouse:YHFamilyMember? {
didSet { didSet {
if let spouse = spouse { if let spouse = spouse {
initalInfoVC.spouse = spouse primaryInfoVC.spouse = spouse
certificateVC.familyMember = spouse certificateVC.familyMember = spouse
basicInfoVC.spouse = spouse basicInfoVC.spouse = spouse
} }
} }
} }
var currentIndex = 0 { var currentStep = 0 {
didSet { didSet {
stepView.currentIndex = currentIndex
for (i, vc) in self.children.enumerated() { stepView.currentIndex = currentStep
vc.view.isHidden = (currentIndex != i) for vcItem in stepVCs {
vcItem.vc.view.isHidden = (vcItem.step != currentStep)
} }
} }
} }
...@@ -49,8 +66,8 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -49,8 +66,8 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
return YHSaveAndSubmitView.createView() return YHSaveAndSubmitView.createView()
}() }()
let initalInfoVC = YHSpousePrimaryInfoVC() let primaryInfoVC = YHSpousePrimaryInfoVC()
let uploadVC = UIViewController() let uploadVC = YHCertificateUploadVC()
let certificateVC = YHCertificateInfoController() let certificateVC = YHCertificateInfoController()
let basicInfoVC = YHSpouseBasicInfoVC() let basicInfoVC = YHSpouseBasicInfoVC()
...@@ -63,7 +80,7 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -63,7 +80,7 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
guard let spouse = spouse else { return } guard let spouse = spouse else { return }
initalInfoVC.delegate = self primaryInfoVC.delegate = self
certificateVC.delegate = self certificateVC.delegate = self
basicInfoVC.delegate = self basicInfoVC.delegate = self
...@@ -72,13 +89,14 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -72,13 +89,14 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
updateStepView() updateStepView()
let tap = UITapGestureRecognizer(target: self, action: #selector(tap))
tap.cancelsTouchesInView = false
self.view.addGestureRecognizer(tap)
bottomView.submitBlock = { bottomView.submitBlock = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
let index = (currentIndex+1)%self.children.count submit()
currentIndex = index
self.didClickSubmitBtn()
} }
bottomView.saveBlock = { bottomView.saveBlock = {
...@@ -100,10 +118,6 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -100,10 +118,6 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
} }
} }
func didClickSubmitBtn() {
}
func updateStepView() { func updateStepView() {
guard let spouse = spouse else { return } guard let spouse = spouse else { return }
...@@ -117,38 +131,35 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -117,38 +131,35 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
if spouse.isFollow() { if spouse.isFollow() {
self.addChild(initalInfoVC) stepVCs = [ YHFaimilyStepItem(title:"初始信息".local, vc:primaryInfoVC, step:0),
self.addChild(uploadVC) YHFaimilyStepItem(title:"证件上传".local, vc:uploadVC, step:1),
self.addChild(certificateVC) YHFaimilyStepItem(title:"证件信息".local, vc:certificateVC, step:2),
self.addChild(basicInfoVC) YHFaimilyStepItem(title:"基本信息".local, vc:basicInfoVC, step:3)]
self.view.addSubview(basicInfoVC.view)
self.view.addSubview(certificateVC.view)
self.view.addSubview(uploadVC.view)
self.view.addSubview(initalInfoVC.view)
stepView.dataSource = ["初始信息".local, "证件上传".local, "证件信息".local, "基本信息".local]
} else { } else {
self.addChild(initalInfoVC)
self.addChild(basicInfoVC)
self.view.addSubview(basicInfoVC.view)
self.view.addSubview(initalInfoVC.view)
stepView.dataSource = ["初始信息".local, "基本信息".local]
stepVCs = [ YHFaimilyStepItem(title:"初始信息".local, vc:primaryInfoVC, step:0),
YHFaimilyStepItem(title:"基本信息".local, vc:basicInfoVC, step:3)]
} }
var titles:[String] = []
for vcItem in stepVCs {
self.addChild(vcItem.vc)
self.view.addSubview(vcItem.vc.view)
titles.append(vcItem.title)
}
stepView.dataSource = titles
print("step:\(spouse.step)") print("step:\(spouse.step)")
currentIndex = spouse.step currentStep = spouse.step
currentIndex = 0
stepView.block = { stepView.block = {
[weak self] index in [weak self] index in
guard let self = self else { return } guard let self = self else { return }
if let targetStep = getStepForArrayIndex(index) {
currentStep = targetStep
}
print("index:\(index)") print("index:\(index)")
currentIndex = index
} }
self.view.bringSubviewToFront(stepView) self.view.bringSubviewToFront(stepView)
...@@ -176,4 +187,56 @@ extension YHSpouseInfoContainerVC { ...@@ -176,4 +187,56 @@ extension YHSpouseInfoContainerVC {
} }
} }
} }
func submit() {
if let targetVC = getCurrentStepViewController() {
if targetVC.nextStep() {
// 当前步骤已是最后一步
if let vc = stepVCs.last, vc.step == currentStep {
YHHUD.flash(message: "已经是最后一步!")
return
}
if let cur = getArrayIndexOfCurrentStep(), let item = stepVCs[safe:cur+1] {
currentStep = item.step
}
print("currentIndex:\(currentStep)")
}
}
}
// 【WARNING!】步骤step和在数组中的下标有时候并不是一一对应
func getArrayIndexOfCurrentStep() ->Int? {
for (i, item) in stepVCs.enumerated() {
if item.step == currentStep {
return i
}
}
return nil
}
// 【WARNING!】步骤step和在数组中的下标有时候并不是一一对应
func getStepForArrayIndex(_ index:Int) -> Int? {
if let targetVCItem = stepVCs[safe: index] {
return targetVCItem.step
}
return nil
}
func getCurrentStepViewController() -> (UIViewController & YHFamilyMemberProtol)? {
for vcItem in stepVCs {
if vcItem.step == currentStep {
return vcItem.vc
}
}
return nil
}
}
extension YHSpouseInfoContainerVC: UIGestureRecognizerDelegate {
@objc func tap() {
print("点击了parentViewController: YHSpouseInfoContainerVC")
}
} }
...@@ -9,11 +9,12 @@ ...@@ -9,11 +9,12 @@
import UIKit import UIKit
import SmartCodable import SmartCodable
class YHSpousePrimaryInfoVC: YHBaseViewController { class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
var spouse:YHFamilyMember? var spouse:YHFamilyMember?
weak var delegate:YHSpouseInfoVCProtocol? weak var delegate:YHSpouseInfoVCProtocol?
// 是否显示未填写错误提示
var isNeedShowError = false
lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]() lazy var items:[[YHFormItemProtocol]] = [[YHFormItemProtocol]]()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -39,8 +40,6 @@ class YHSpousePrimaryInfoVC: YHBaseViewController { ...@@ -39,8 +40,6 @@ class YHSpousePrimaryInfoVC: YHBaseViewController {
return tableView return tableView
}() }()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navTitle = "配偶信息填写".local gk_navTitle = "配偶信息填写".local
...@@ -82,6 +81,7 @@ class YHSpousePrimaryInfoVC: YHBaseViewController { ...@@ -82,6 +81,7 @@ class YHSpousePrimaryInfoVC: YHBaseViewController {
let item21 = YHFormDetailItem(type: .nationOrArea) let item21 = YHFormDetailItem(type: .nationOrArea)
item21.value = spouse.address?.country item21.value = spouse.address?.country
item21.placeHolder = "请选择".local item21.placeHolder = "请选择".local
item21.tips = "请选择国家/地区".local
arr2.append(item21) arr2.append(item21)
// 国家/地区已填写 才显示现居住城市和详细地址两行 // 国家/地区已填写 才显示现居住城市和详细地址两行
...@@ -98,7 +98,6 @@ class YHSpousePrimaryInfoVC: YHBaseViewController { ...@@ -98,7 +98,6 @@ class YHSpousePrimaryInfoVC: YHBaseViewController {
} }
item22.placeHolder = "请选择城市".local item22.placeHolder = "请选择城市".local
item22.tips = "请请选择城市".local item22.tips = "请请选择城市".local
item22.tips = "请选择城市".local
arr2.append(item22) arr2.append(item22)
} }
...@@ -114,7 +113,6 @@ class YHSpousePrimaryInfoVC: YHBaseViewController { ...@@ -114,7 +113,6 @@ class YHSpousePrimaryInfoVC: YHBaseViewController {
item24.value = String(spouse.isOverSeasOver1Year()) item24.value = String(spouse.isOverSeasOver1Year())
arr2.append(item24) arr2.append(item24)
} }
} }
} }
} }
...@@ -180,9 +178,8 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -180,9 +178,8 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.setTips(detailItem.tips, isShow: detailItem.isShowTips) cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
cell.isShowBottomLine = indexPath.row != arr.count-1 cell.isShowBottomLine = indexPath.row != arr.count-1
var select = false var select = false
if let value = detailItem.value { if let value = detailItem.value {
...@@ -234,7 +231,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -234,7 +231,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.setTips(detailItem.tips, isShow: detailItem.isShowTips) cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.detail = detailItem.value cell.detail = detailItem.value
cell.isShowBottomLine = indexPath.row != arr.count-1 cell.isShowBottomLine = indexPath.row != arr.count-1
...@@ -246,7 +243,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -246,7 +243,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.setTips(detailItem.tips, isShow: detailItem.isShowTips) cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
cell.text = detailItem.value cell.text = detailItem.value
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.setTips(detailItem.tips, isShow:detailItem.isShowTips) cell.setTips(detailItem.tips, isShow:detailItem.isShowTips)
...@@ -395,7 +392,29 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -395,7 +392,29 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
if isEmptyString(spouse.nationality) { if isEmptyString(spouse.nationality) {
return false return false
} }
return false if isEmptyString(spouse.address?.country) {
return false
}
if isEmptyString(spouse.address?.details) {
return false
}
if spouse.isBirthOverSeas(), isEmptyArray(spouse.address?.area) {
return false
}
return true
}
func nextStep() -> Bool {
let isChecked = checkIntegrity()
isNeedShowError = !isChecked
self.tableView .reloadData()
if !isChecked {
YHHUD.flash(message: "资料还未填完")
return false
}
return true
} }
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHCertificateInfoController: YHBaseViewController { class YHCertificateInfoController: YHBaseViewController, YHFamilyMemberProtol {
var familyMember:YHFamilyMember? var familyMember:YHFamilyMember?
weak var delegate:YHSpouseInfoVCProtocol? weak var delegate:YHSpouseInfoVCProtocol?
...@@ -374,5 +374,9 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour ...@@ -374,5 +374,9 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
delegate.saveInfo?() delegate.saveInfo?()
} }
} }
func nextStep()->Bool {
return true
}
} }
...@@ -74,7 +74,7 @@ class YHFormItemInputTextCell: UITableViewCell { ...@@ -74,7 +74,7 @@ class YHFormItemInputTextCell: UITableViewCell {
textField.backgroundColor = .clear textField.backgroundColor = .clear
textField.placeholder = "请输入" textField.placeholder = "请输入"
textField.font = UIFont.PFSC_M(ofSize: 14) textField.font = UIFont.PFSC_M(ofSize: 14)
textField.tintColor = UIColor.placeHolderColor textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor textField.textColor = UIColor.mainTextColor
textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged) textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
textField.addTarget(self, action: #selector(textFieldEditEnd(textField:)), for: .editingDidEnd) textField.addTarget(self, action: #selector(textFieldEditEnd(textField:)), for: .editingDidEnd)
......
...@@ -323,7 +323,6 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource { ...@@ -323,7 +323,6 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
} }
} }
// 选中背景色 // 选中背景色
if #available(iOS 14.0, *), pickerView.subviews.count > 1 { if #available(iOS 14.0, *), pickerView.subviews.count > 1 {
pickerView.subviews[1].backgroundColor = UIColor(hex: 0x4487F9, alpha: 0.06) pickerView.subviews[1].backgroundColor = UIColor(hex: 0x4487F9, alpha: 0.06)
......
...@@ -283,11 +283,10 @@ extension YHOtherInfoFillViewModel { ...@@ -283,11 +283,10 @@ extension YHOtherInfoFillViewModel {
} }
} }
//保存其他资料信息 //保存其他资料信息
func saveOtherInfo( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) { func saveOtherInfo( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Order.updateOtherInfoApi let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Order.updateOtherInfoApi
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard self != nil else { return } guard self != nil else { return }
guard let model = NetBaseModel.deserialize(dict: json) else { guard let model = NetBaseModel.deserialize(dict: json) else {
......
...@@ -76,16 +76,24 @@ extension YHServiceCenterMainViewModel { ...@@ -76,16 +76,24 @@ extension YHServiceCenterMainViewModel {
return return
} }
printLog("model 是 ==> \(model)") printLog("model 是 ==> \(model)")
let dic = model.data?.peel
guard let resultModel = YHContactItemHoldModel.deserialize(dict: dic as? [AnyHashable : Any]) else { if model.code == 200 {
let dic = model.data?.peel
guard let resultModel = YHContactItemHoldModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
arrContactList = []
callBackBlock(false,nil)
return
}
arrContactList = resultModel.orders
callBackBlock(true,nil)
} else {
arrContactList = [] arrContactList = []
callBackBlock(false,nil) let error : YHErrorModel = YHErrorModel(errorCode:Int32(model.code),errorMsg: model.msg.count > 0 ? model.msg : "数据错误")
return callBackBlock(false,error)
} }
arrContactList = resultModel.orders
callBackBlock(true,nil)
} failBlock: { err in } failBlock: { err in
self.arrContactList = []
callBackBlock(false,err) callBackBlock(false,err)
} }
} }
...@@ -103,43 +111,49 @@ extension YHServiceCenterMainViewModel { ...@@ -103,43 +111,49 @@ extension YHServiceCenterMainViewModel {
return return
} }
printLog("model 是 ==> \(model)") printLog("model 是 ==> \(model)")
let dic = model.data?.peel
guard let resultModel = YHContactMainItemStatusModel2.deserialize(dict: dic as? [AnyHashable : Any]) else { if model.code == 200 {
self.arrContactStausItmes = [] let dic = model.data?.peel
callBackBlock(false,nil) guard let resultModel = YHContactMainItemStatusModel2.deserialize(dict: dic as? [AnyHashable : Any]) else {
return self.arrContactStausItmes = []
} callBackBlock(false,nil)
return
}
if resultModel.fill_info_step > 6 { if resultModel.fill_info_step > 6 {
let model = YHContactMainItemStatusModel() let model = YHContactMainItemStatusModel()
model.type = 1 model.type = 1
model.isFinished = true model.isFinished = true
arrContactStausItmes.append(model) arrContactStausItmes.append(model)
let model2 = YHContactMainItemStatusModel() let model2 = YHContactMainItemStatusModel()
model2.type = 2 model2.type = 2
model2.isFinished = false model2.isFinished = false
arrContactStausItmes.append(model2) arrContactStausItmes.append(model2)
let model3 = YHContactMainItemStatusModel() let model3 = YHContactMainItemStatusModel()
model3.type = 3 model3.type = 3
model3.isFinished = false model3.isFinished = false
arrContactStausItmes.append(model3) arrContactStausItmes.append(model3)
} else {
let model = YHContactMainItemStatusModel()
model.type = 1
model.isFinished = false
arrContactStausItmes.append(model)
let model2 = YHContactMainItemStatusModel()
model2.type = 2
model2.isFinished = false
arrContactStausItmes.append(model2)
}
callBackBlock(true,nil)
} else { } else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(model.code),errorMsg: model.msg.count > 0 ? model.msg : "数据错误")
let model = YHContactMainItemStatusModel() callBackBlock(false,error)
model.type = 1
model.isFinished = false
arrContactStausItmes.append(model)
let model2 = YHContactMainItemStatusModel()
model2.type = 2
model2.isFinished = false
arrContactStausItmes.append(model2)
} }
callBackBlock(true,nil)
} failBlock: { err in } failBlock: { err in
self.arrContactStausItmes = [] self.arrContactStausItmes = []
callBackBlock(false,err) callBackBlock(false,err)
......
...@@ -68,6 +68,7 @@ extension YHLoginViewModel { ...@@ -68,6 +68,7 @@ extension YHLoginViewModel {
return return
} }
if model.code == 200 { if model.code == 200 {
if resultModel.token?.count != 0 { if resultModel.token?.count != 0 {
//token 正常 //token 正常
...@@ -89,7 +90,6 @@ extension YHLoginViewModel { ...@@ -89,7 +90,6 @@ extension YHLoginViewModel {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(model.code), errorMsg: model.msg) let error : YHErrorModel = YHErrorModel(errorCode:Int32(model.code), errorMsg: model.msg)
callBackBlock(false,error) callBackBlock(false,error)
} }
} failBlock: { err in } failBlock: { err in
callBackBlock(false,err) callBackBlock(false,err)
} }
......
...@@ -7,6 +7,15 @@ ...@@ -7,6 +7,15 @@
// //
import Foundation import Foundation
// 字符串是否为空(空的标准是nil或[])
func isEmptyArray(_ array: [Any]?) -> Bool {
if let array = array, array.count > 0 {
return false
}
return true
}
extension Array { extension Array {
/// 数组转json字符串 /// 数组转json字符串
func yh_toJSONString() -> String? { func yh_toJSONString() -> String? {
......
...@@ -78,6 +78,14 @@ extension String { ...@@ -78,6 +78,14 @@ extension String {
return false return false
} }
// MARK: - 是否符合香港身份证号码
func isHKIdentityCardNumber() -> Bool {
let regex = #"^([A-Z]\d{6,10}(\(\w{1}\))?)|([A-Z]\d{6,10}(\\w{1}\))?)$/"#
let predicate = NSPredicate(format: "SELF MATCHES %@", regex)
let isValid = predicate.evaluate(with:self)
print(isValid ? "正确的香港身份证号码格式":"错误的香港身份证号码格式")
return isValid
}
func phoneNumberForUI() -> String { func phoneNumberForUI() -> String {
let phone = self.replacingOccurrences(of: " ", with: "") let phone = self.replacingOccurrences(of: " ", with: "")
......
...@@ -19,11 +19,20 @@ class YHAllApiName { ...@@ -19,11 +19,20 @@ class YHAllApiName {
//order 模块 //order 模块
struct Order { struct Order {
//合同列表 //合同列表
static let contractListApi = "frontend/order/list" // static let contractListApi = "frontend/order/list"
static let contractListApi = "infoflow/order/list"
//合同填写进度 //合同填写进度
static let contractStatusApi = "frontend/order/progress" // static let contractStatusApi = "frontend/order/progress"
static let contractStatusApi = "infoflow/order/progress"
//信息表的填写进度 //信息表的填写进度
static let informationStepApi = "frontend/order/information/step" // static let informationStepApi = "frontend/order/information/step"
static let informationStepApi = "infoflow/order/information/step"
//我的评分结果 //我的评分结果
static let scoreDetailApi = "frontend/order-assessment/score_detail" static let scoreDetailApi = "frontend/order-assessment/score_detail"
...@@ -68,7 +77,8 @@ class YHAllApiName { ...@@ -68,7 +77,8 @@ class YHAllApiName {
//Users //Users
struct Users { struct Users {
//提交 温馨提示信息 //提交 温馨提示信息
static let submitSweetNotifyApi = "frontend/users/sweet-notify/submit" // static let submitSweetNotifyApi = "frontend/users/sweet-notify/submit"
static let submitSweetNotifyApi = "infoflow/users/sweet-notify/submit"
} }
......
...@@ -14,13 +14,13 @@ class YHBaseUrlManager { ...@@ -14,13 +14,13 @@ class YHBaseUrlManager {
//开发环境 //开发环境
// static let baseUrlTest : String = "https://test-private-sphere.galaxy-immi.com/" // static let baseUrlTest : String = "https://test-private-sphere.galaxy-immi.com/"
// static let baseUrlTest : String = "https://test.api.gateway.galaxy-immi.com/" // static let baseUrlTest : String = "https://test.api.gateway.galaxy-immi.com/"
static let baseUrlTest : String = "https://test-api-gateway.galaxy-immi.com/" // static let baseUrlTest : String = "https://test-api-gateway.galaxy-immi.com/"
static let baseUrlTest : String = "http://test.api.diymanager.galaxy-immi.com/"
//正式环境 //正式环境
static let baseUrlRelease : String = "https://api.health.sleep321.com/" static let baseUrlRelease : String = ""
//h5开发环境 //h5开发环境
static let h5UrlDev : String = "" static let h5UrlDev : String = ""
...@@ -42,7 +42,6 @@ class YHBaseUrlManager { ...@@ -42,7 +42,6 @@ class YHBaseUrlManager {
#endif #endif
} }
// MARK: - 当前使用的url // MARK: - 当前使用的url
func h5URL() -> String { func h5URL() -> String {
#if DEBUG #if DEBUG
......
...@@ -93,13 +93,24 @@ class YHNetRequest: NSObject { ...@@ -93,13 +93,24 @@ class YHNetRequest: NSObject {
print("sign = \(sign)") print("sign = \(sign)")
requestHeader.add(name:"sign",value:sign) requestHeader.add(name:"sign",value:sign)
// requestHeader.add(name: "token", value: YHLoginManager.shared.userModel?.token ?? "-") //for test hjl
requestHeader.add(name: "token", value: "eyJpdiI6InhISTlXZjA2cXE5Z2pqMDZDa2NrTkE9PSIsInZhbHVlIjoiR3NkRVR0dVdjWE5GN2N3UmNiU0xobVYzZTR6SXlGXC9XVEhWV0xcL1F1YXVBOU9jRDlFZ2pOanBcL1RBMUVkUDlRQ2xhREx0c3dKeHNJQjMwaVVuYkloZHBiUXQzZkJlS2dTWDJrTE90K2FpM0FDWm10a3FFUGZpdW90TDNscStud0tSenRRV2kyV3JVbEZ6eXppUHZ5ajFQMXpBejh0YUZ4Z0VPZkwwdEtwXC9mNjh4bWQySGpSS2pzVkJ1Y3ZrbGFKdGVsMkhkRXJrTlRHbzkxcVdkcE1yWXRja2xDRHVmRUhhdU9ybkJmXC9VRVJnY2RXeVpXMzZVc2h2e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0FvQ2ZFaTViTmdybm1xQ1BscVMzM2tjeUFCQVlvZFdPMTJTb2ttZDl2Q3BuTXVvTnJkUDRpa0g5cE4rWlRcL1l2MWdNdmY0MFVsMFArWWYzWVNmMW5oUnkwWk1mTVc3WUluU3dyQUM4TTZBbHJac0lOMDNiYVhVWks2TCs3QnN0VDlOXC9xaEwyUEtmblVmOXpcL3hoekQ1K3JKWVozVWxrdElKbTdWTHpaMnk2bXFQQ0VJalR1TVpIc1d4bmJjVVIwdTR1VXY1M1wvMEJMODVTWkNreVpCVmh3MWRDeERROGh5YnVsMkVKV2poMFwvYnZHakMycHJmQjUycDQ3b3laUUlTSjdmaDdFMnFtTHhIN1RvUnhhcUhCWXkybkhoMlFwZUVtM0VPUVZrcXp3S0lLMFwvOUtvZnhibE1ZUnp0bGVkcGdqTlp0dGV0cGhCa3hjUmxZXC96SWRFXC83OWxEUnRma1MyYnZqWGhMN0lSM0x2Z0NCTWxIR0pUYjByWDN4Y3JCT3JLTzFzUWkzS3NYTDVDZVJ3MmhEbXlXSENqYWc9PSIsIm1hYyI6Ijc1YmU5YTE4ZGEwNzExZGJlZWQ0MzZhNGVkNWE1NGMzYmE1YWFjNjBhYTgxYjFlYjUyN2M1Yzc4ZjkwNTcyNmMifQ==")
requestHeader.add(name: "token", value: YHLoginManager.shared.userModel?.token ?? "-") //for test hjl
// testToken(&requestHeader)
headers = requestHeader headers = requestHeader
} }
private func testToken(_ requestHeader:inout HTTPHeaders) {
//杜宇的账号
requestHeader.add(name: "token", value: "eyJpdiI6Ik5aeEVDclZTK0FISEFBZUgxN2VkdGc9PSIsInZhbHVlIjoiRFRJOHlObzVrZlp4T2tVYW1MSE1ZK0Z3dXlyK3p4QlczNmxsTXdkdW5GQVY4Q2VqZlNNUDdrdVpsb0JcLytpYmJheUp2MWZTUE5pOWgrVWRLdEtIUkx4R1wvS3F6SmRSQ0dWeFVXanFINGkyRWNMTXB4TVlcLzhjXC9NSzVoMFwvZ1ZOaVIwb0VqWlo1V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L1BkaUswZkJZSlVid0UydUxkWEhKcWtkWmV2dml0Rkh4cnQxNENwVDdVb0x0eUFBXC9VMmlPTDI0OVJ4VHpHMEN6RENWa3hORG9RTXhTcDM1M0xHdE5pcWx1dU55YzBHKzZxOWdEYVcreSt3dmdGaG9kaDQrMXhsTTd0ZFl1OTMySlNxNTRxXC9uVzBvR3RrK3AxZGxaZmJma0ZQMkxlRUlwXC83OHE4T2hTMkF0U2wrdXlzalJXaEhXSnNDMEZqWmt6RGNKbFhUblpcL3lyRGxnQW9nanNja1FsYlwvZUpDUmJtWVhsZzIzY3lUSDhudWRvRmp5TkpJbEN5WEZTTFA4OGpoUVVkdHRqcHFsWVZkXC85d1hIUEpGMkZRbHAyeFphWTJud2FZejRCdkFUK0lSTDlicnZiUDFcL3lhMEFPQVFYQTMxdXJla0tpbDdibmkycGxOU05wY1ZjeTZzdTN0NjdLNk9IUHhOYTZnaUR3VW1iVXJEbmJvMmN3WTZYUFllbHd2Y0J2cnVsUzVvVitHMFFxSGFzc2x3K2ErVUpaaFZkbHVqRG5Ua3NzTTNSZTNRdGtwNnFiS2wyRkVTUEJVVjluZ1ZGN3RHT0VWQjR4MVpXNnBFWnU2bHU1Z2dqOUNuMlNwMUljXC9ZZk5EWjhiXC9sdUVnVUhYelJSQVwvK1FXcytPb3ZYMXZrVVBScmN5YU0rNWR3a0pqcm1BPT0iLCJtYWMiOiJhOGM2NjQwNDVjYjNmMjhiZjI5MWU5YTdiODE0MGVkOGQ2YzIzNWVkYjUzYjkwNjU3OTFiN2U5YTliZWQ1NGQ1In0")
}
///  链式语法 ///  链式语法
func url(_ url:String?) -> Self{ func url(_ url:String?) -> Self{
self.url = url ?? "" self.url = url ?? ""
......
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