Commit 9668452c authored by David黄金龙's avatar David黄金龙

Merge commit '974dae47' into davidhuang

* commit '974dae47':
  // 家庭成员Model字段调整
parents 2ad35594 974dae47
...@@ -144,7 +144,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -144,7 +144,7 @@ class YHChildBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
let item31 = YHFormDetailItem(type: .stayHKDate) let item31 = YHFormDetailItem(type: .stayHKDate)
item31.placeHolder = "请选择".local 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.placeHolder = "请选择".local
...@@ -435,7 +435,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -435,7 +435,7 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
if detailItem.type == .birthday { if detailItem.type == .birthday {
self.child?.birthday = date self.child?.birthday = date
} else if detailItem.type == .stayHKDate { } else if detailItem.type == .stayHKDate {
self.child?.childInHk?.info = date self.child?.childInHk.info = date
} }
self.loadBasicInfo() self.loadBasicInfo()
if let delegate = delegate { if let delegate = delegate {
......
...@@ -175,7 +175,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -175,7 +175,7 @@ class YHSpouseBasicInfoVC: YHBaseViewController, YHFamilyMemberProtol {
if spouse.isNowInHK() { // 目前在港才显示 逗留期限和在港身份 if spouse.isNowInHK() { // 目前在港才显示 逗留期限和在港身份
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 item31.tips = "请选择".local
let item32 = YHFormDetailItem(type: .roleInHK) let item32 = YHFormDetailItem(type: .roleInHK)
...@@ -596,7 +596,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -596,7 +596,7 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
if detailItem.type == .birthday { if detailItem.type == .birthday {
self.spouse?.birthday = date self.spouse?.birthday = date
} else if detailItem.type == .stayHKDate { } else if detailItem.type == .stayHKDate {
self.spouse?.childInHk?.info = date self.spouse?.childInHk.info = date
} }
self.loadBasicInfo() self.loadBasicInfo()
} }
......
...@@ -129,21 +129,21 @@ class YHFamilyMemberInfoVC: YHBaseViewController { ...@@ -129,21 +129,21 @@ class YHFamilyMemberInfoVC: YHBaseViewController {
// 检查填写信息完整性 // 检查填写信息完整性
func checkIntegrity() -> Bool { func checkIntegrity() -> Bool {
if let sponse = familyMemberInfo?.spouse, sponse.notFillNum > 0 { if let sponse = familyMemberInfo?.spouse, sponse.notFillNumber > 0 {
return false return false
} }
if let father = familyMemberInfo?.father, father.notFillNum > 0 { if let father = familyMemberInfo?.father, father.notFillNumber > 0 {
return false return false
} }
if let mother = familyMemberInfo?.mother, mother.notFillNum > 0 { if let mother = familyMemberInfo?.mother, mother.notFillNumber > 0 {
return false return false
} }
if let childs = familyMemberInfo?.child, !childs.isEmpty { if let childs = familyMemberInfo?.child, !childs.isEmpty {
for child in childs { for child in childs {
if child.notFillNum > 0 { if child.notFillNumber > 0 {
return false return false
} }
} }
...@@ -151,7 +151,7 @@ class YHFamilyMemberInfoVC: YHBaseViewController { ...@@ -151,7 +151,7 @@ class YHFamilyMemberInfoVC: YHBaseViewController {
if let brothers = familyMemberInfo?.brother, !brothers.isEmpty { if let brothers = familyMemberInfo?.brother, !brothers.isEmpty {
for brother in brothers { for brother in brothers {
if brother.notFillNum > 0 { if brother.notFillNumber > 0 {
return false return false
} }
} }
...@@ -233,7 +233,7 @@ extension YHFamilyMemberInfoVC { ...@@ -233,7 +233,7 @@ extension YHFamilyMemberInfoVC {
// 请求家庭成员信息 // 请求家庭成员信息
func requestFamilyInfo() { func requestFamilyInfo() {
self.familyRequest.getFamilyInfo(params: ["orderId": self.orderId]) { [weak self] success, error in self.familyRequest.getFamilyInfo(params: ["order_id": self.orderId]) { [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
familyMemberInfo = self.familyRequest.familyInfo familyMemberInfo = self.familyRequest.familyInfo
...@@ -337,10 +337,10 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -337,10 +337,10 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFamilyMember let detailItem = item as! YHFamilyMember
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier, for: indexPath) as! YHFormItemEnterDetailCell
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detailLabel.textColor = (isNeedShowError && detailItem.notFillNum > 0 ? .failColor : .labelTextColor2) cell.detailLabel.textColor = (isNeedShowError && detailItem.notFillNumber > 0 ? .failColor : .labelTextColor2)
if detailItem.notFillNum > 0 { if detailItem.notFillNumber > 0 {
cell.detailLabel.text = String(format: "有%d项未填写".local, detailItem.notFillNum) cell.detailLabel.text = String(format: "有%d项未填写".local, detailItem.notFillNumber)
} else { } else {
cell.detailLabel.text = "已填完".local cell.detailLabel.text = "已填完".local
} }
...@@ -464,12 +464,7 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -464,12 +464,7 @@ extension YHFamilyMemberInfoVC : UITableViewDelegate, UITableViewDataSource {
let arr = items[indexPath.section] let arr = items[indexPath.section]
let item:YHFormItemProtocol = arr[indexPath.row] let item:YHFormItemProtocol = arr[indexPath.row]
if item is YHFormTitleItem { // 是标题 return UITableView.automaticDimension
return 52.0
} else if item is YHFormAddItem { // 新增子女兄妹
return 70.0
}
return 50.0
} }
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
......
...@@ -26,41 +26,7 @@ class YHFamilyRequestViewModel { ...@@ -26,41 +26,7 @@ class YHFamilyRequestViewModel {
printLog("model 是 ==> \(json)") printLog("model 是 ==> \(json)")
let dic = json.data as? [AnyHashable : Any] let dic = json.data as? [AnyHashable : Any]
guard let resultModel = YHFamilyMemberGroupInfo.deserialize(dict: dic) else {
guard var dic = dic else { return }
#if DEBUG
if let child = dic["child"], child is [[String: Any]] {
var child = child as! [[String: Any]]
for (index, dic) in child.enumerated() {
var d = dic
d["certificates"] = [String: Any]()
child[index] = d
}
dic["child"] = child
}
if let brother = dic["brother"], brother is [[String: Any]] {
var brother = brother as! [[String: Any]]
for (index, dic) in brother.enumerated() {
var d = dic
d["certificates"] = [String: Any]()
// ["cnIdentityCard":"",
// "passport":"",
// "hkMacaoPass":""]
brother[index] = d
}
dic["brother"] = brother
}
#endif
guard let resultModel = YHFamilyMemberGroupInfo.deserialize(dict: dic as? [AnyHashable : Any]) else {
callBackBlock(false,nil) callBackBlock(false,nil)
return return
......
...@@ -49,7 +49,8 @@ class YHAllApiName { ...@@ -49,7 +49,8 @@ class YHAllApiName {
struct Family { struct Family {
// 获取家庭成员信息 添加家庭成员也用这个 // 获取家庭成员信息 添加家庭成员也用这个
static let familyInfoApi = "frontend/order/information/family" // static let familyInfoApi = "frontend/order/information/family"
static let familyInfoApi = "infoflow/information/family"
// 删除家庭成员信息 // 删除家庭成员信息
static let familyMemberDeleteApi = "frontend/order/information/family/delete" static let familyMemberDeleteApi = "frontend/order/information/family/delete"
......
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