Commit 039ae1df authored by Steven杜宇's avatar Steven杜宇

// 家庭成员接口联调

parent ce414e1a
......@@ -19,7 +19,6 @@
041B52D62B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */; };
041B52DB2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */; };
041B52DD2B60A889007EBCEB /* YHTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52DC2B60A889007EBCEB /* YHTest.swift */; };
042FBBB92B627C0F00F9DE23 /* YHCertificateInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */; };
042FBBBB2B62806D00F9DE23 /* YHCertificateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBA2B62806D00F9DE23 /* YHCertificateViewController.swift */; };
042FBBBD2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBC2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift */; };
042FBBBF2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */; };
......@@ -64,6 +63,7 @@
04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; };
04A7BC8F2B6B2BC2000E8D47 /* YHFamilyRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A7BC8E2B6B2BC2000E8D47 /* YHFamilyRequest.swift */; };
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AF58C32B4FC51C0066011A /* YHLocalizable.swift */; };
04D765732B6A173C0055ECBB /* YHSpouseInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D765722B6A173C0055ECBB /* YHSpouseInfoVC.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
......@@ -225,7 +225,6 @@
041B52D52B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInitialInfoVC.swift; sourceTree = "<group>"; };
041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyInitialInfo.swift; sourceTree = "<group>"; };
041B52DC2B60A889007EBCEB /* YHTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHTest.swift; sourceTree = "<group>"; };
042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfo.swift; sourceTree = "<group>"; };
042FBBBA2B62806D00F9DE23 /* YHCertificateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateViewController.swift; sourceTree = "<group>"; };
042FBBBC2B63519C00F9DE23 /* YHFormItemSelectSheetCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemSelectSheetCell.swift; sourceTree = "<group>"; };
042FBBBE2B639F0300F9DE23 /* YHSpouseBasicInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseBasicInfoVC.swift; sourceTree = "<group>"; };
......@@ -270,6 +269,7 @@
04808C042B4686510056D53C /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; };
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; };
04A7BC8E2B6B2BC2000E8D47 /* YHFamilyRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyRequest.swift; sourceTree = "<group>"; };
04AF58C32B4FC51C0066011A /* YHLocalizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLocalizable.swift; sourceTree = "<group>"; };
04D765722B6A173C0055ECBB /* YHSpouseInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSpouseInfoVC.swift; sourceTree = "<group>"; };
58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; };
......@@ -480,7 +480,7 @@
isa = PBXGroup;
children = (
041B52DA2B5FDF8E007EBCEB /* YHFamilyInitialInfo.swift */,
042FBBB82B627C0E00F9DE23 /* YHCertificateInfo.swift */,
04A7BC8E2B6B2BC2000E8D47 /* YHFamilyRequest.swift */,
041B52DC2B60A889007EBCEB /* YHTest.swift */,
);
path = M;
......@@ -1369,7 +1369,6 @@
A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */,
A5ACE9502B4564F7002C94D2 /* YhCacheTool.swift in Sources */,
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */,
042FBBB92B627C0F00F9DE23 /* YHCertificateInfo.swift in Sources */,
A5FD63EA2B67D95100D1D9DA /* YHFamilyMemberViewController.swift in Sources */,
A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */,
042FBBD62B67BDD500F9DE23 /* YHBrotherInfoVC.swift in Sources */,
......@@ -1389,6 +1388,7 @@
A5ACE93E2B4564F7002C94D2 /* UIImage+Extension.swift in Sources */,
0468D4472B624AF000CFB916 /* YHBottomNextView.swift in Sources */,
A5ACE94C2B4564F7002C94D2 /* YHHUDErrorView.swift in Sources */,
04A7BC8F2B6B2BC2000E8D47 /* YHFamilyRequest.swift in Sources */,
041B52D62B5F899E007EBCEB /* YHSpouseInitialInfoVC.swift in Sources */,
A5D6AB1B2B46A1CC001C10A5 /* YHHomeModel.swift in Sources */,
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */,
......
......@@ -86,11 +86,11 @@ class YHChildInitialInfoVC: YHBaseViewController {
let item00 = YHFormDetailItem(type: .ownCustody)
let item01 = YHFormDetailItem(type: .birthday)
let item02 = YHFormDetailItem(type: .isAccompanyToHK)
item02.isAccompany = (child.follow == 1)
item02.value = String(child.follow == 1)
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02]
items.append(arr0)
if item02.isAccompany { // 随行才加后面的信息
if child.isFollow() { // 随行才加后面的信息
// 国籍
let title1 = YHFormTitleItem(type: .country)
let item10 = YHFormDetailItem(type: .nationOrArea)
......@@ -99,7 +99,7 @@ class YHChildInitialInfoVC: YHBaseViewController {
// 居住信息
let title2 = YHFormTitleItem(type: .liveInfo)
let item20 = YHFormDetailItem(type: .isLiveTother)
item20.isLiveTogether = (child.finishFollow == 1)
item20.value = String(child.isLiveTother())
let item21 = YHFormDetailItem(type: .nationOrArea)
let item22 = YHFormDetailItem(type: .liveCity)
let item23 = YHFormDetailItem(type: .detailAddress)
......@@ -108,7 +108,7 @@ class YHChildInitialInfoVC: YHBaseViewController {
// 港澳通信证
let title3 = YHFormTitleItem(type: .hkAndMacaoPassport)
let item30 = YHFormDetailItem(type: .isHandleHKPassPort)
item30.isHandleHkPassport = (child.isHandled == 1)
item30.value = String(child.isNeedHandleHKPassPort())
let arr3:[YHFormItemProtocol] = [title3, item30]
items.append(contentsOf:[arr1, arr2, arr3])
......@@ -195,26 +195,14 @@ extension YHChildInitialInfoVC : UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.title = detailItem.getTitle()
let answers = [YHFormChoiceItem(title: "是".local, isSelect: true),YHFormChoiceItem(title: "否".local, isSelect: false)]
cell.answerArr = answers
if detailItem.type == .isAccompanyToHK {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isAccompany),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isAccompany)]
cell.answerArr = answers
} else if detailItem.type == .isHandleHKPassPort {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isHandleHkPassport),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isHandleHkPassport)]
cell.answerArr = answers
} else if detailItem.type == .isLiveTother {
let answers =
[YHFormChoiceItem(title: "是".local, isSelect: detailItem.isLiveTogether),
YHFormChoiceItem(title: "否".local, isSelect: !detailItem.isLiveTogether)]
cell.answerArr = answers
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
cell.answerBlock = {
......
......@@ -16,6 +16,7 @@ enum YHFormTitleItemEditType:Int {
class YHFamilyMemberFormVC: YHBaseViewController {
let familyRequest:YHFamilyRequest = YHFamilyRequest()
var familyMemberInfo: YHFamilyMemberGroupInfo?
var isChildsEditMode: YHFormTitleItemEditType = .none
var isBrothersEditMode: YHFormTitleItemEditType = .none
......@@ -104,6 +105,10 @@ class YHFamilyMemberFormVC: YHBaseViewController {
func loadData() {
self.familyRequest.getFamilyInfo(params: ["orderId": 133971]) { success, error in
}
let dic = [
"father": [
"id": 0,
......@@ -130,7 +135,12 @@ class YHFamilyMemberFormVC: YHBaseViewController {
"sex": 0,
"married": 0,
"nows": 0,
"address": [],
"address": [
"area": ["广东省", "深圳市"],
"country": "中国-China",
"details": "大新地铁站",
"foreign": ""
],
"child_stepchild": [],
"child_in_hk": [],
"country_identity": [],
......@@ -169,7 +179,12 @@ class YHFamilyMemberFormVC: YHBaseViewController {
"sex": 0,
"married": 0,
"nows": 0,
"address": [],
"address": [
"area": ["广东省", "深圳市"],
"country": "中国-China",
"details": "大新地铁站",
"foreign": ""
],
"child_stepchild": [],
"child_in_hk": [],
"country_identity": [],
......@@ -223,7 +238,7 @@ class YHFamilyMemberFormVC: YHBaseViewController {
"nows": 0,
"address": [
"area": ["广东省", "深圳市"],
"country": "中国-China",
"country": "",
"details": "大新地铁站",
"foreign": ""
],
......
......@@ -24,6 +24,9 @@ class YHSpouseInfoVC: YHBaseViewController {
stepView.currentIndex = currentIndex
for (i, vc) in self.children.enumerated() {
vc.view.isHidden = (currentIndex != i)
if currentIndex == i {
}
}
}
}
......@@ -58,6 +61,7 @@ class YHSpouseInfoVC: YHBaseViewController {
self.addChild(uploadVC)
self.addChild(passportInfoVC)
self.addChild(basicInfoVC)
self.view.addSubview(basicInfoVC.view)
self.view.addSubview(passportInfoVC.view)
self.view.addSubview(uploadVC.view)
......
//
// YHCertificateInfo.swift
// galaxy
//
// Created by edy on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateInfo: NSObject {
}
......@@ -302,24 +302,7 @@ class YHFormDetailItem : YHFormItemProtocol {
var isNeed: Bool = true
var value: String?
// 是否随行
var isAccompany:Bool = false
// 是否办理港澳通信证
var isHandleHkPassport:Bool = false
// 国籍
var country:String? = ""
/** 居住信息 **/
// 是否与主申请人同住
var isLiveTogether:Bool = false
// 现居住国家
var liveContry:String? = ""
// 现居住城市
var liveCity:String? = ""
// 现居住详细地址
var liveAddress:String? = ""
var placeHolder: String?
init(type: YHFormDetailItemType, isNeed:Bool = true) {
self.type = type
......@@ -490,6 +473,35 @@ enum YHFamilyMemberType: Int {
}
class YHFamilyMember: SmartCodable, YHFormItemProtocol {
// 是否随行
func isFollow() -> Bool {
return follow == 1
}
func setFollow(_ follow:Bool) {
self.follow = (follow ? 1 : 0)
}
// 是否要办理港澳通行证
func isNeedHandleHKPassPort() -> Bool {
return self.isHandled == 1
}
func setNeedHandleHKPassPort(_ need:Bool) {
self.isHandled = (need ? 1 : 0)
}
// 是否与主申请人同住
func isLiveTother() -> Bool {
return self.finishFollow == 1
}
func setLiveTother(_ together:Bool) {
self.finishFollow = (together ? 1 : 0)
}
var id: Int = 0
var deceased: Int = 0
var custody: Int = 0
......@@ -533,9 +545,7 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
var married: String?
var nows: Int = 0
// mark any
// var address: YHAddress?
var address: SmartAny?
var address: YHAddress?
// mark any
// var childStepchild: YHChildStepchildClass?
......
//
// YHFamilyRequest.swift
// galaxy
//
// Created by edy on 2024/2/1.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
class YHFamilyRequest {
var familyInfo:YHFamilyMemberGroupInfo?
//请求所有家庭成员信息
func getFamilyInfo(params:[String:Any], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Order.familyInfoApi
let _ = YHNetRequest.getRequest(url: strUrl, params:params) {[weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
guard let model = NetBaseModel.deserialize(dict: json) else {
let error : YHErrorModel = YHErrorModel(errorCode:YHErrorCode.dictParseError.rawValue,errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,error)
return
}
printLog("model 是 ==> \(model)")
let dic = model.data?.peel
guard let resultModel = YHFamilyMemberGroupInfo.deserialize(dict: dic as? [AnyHashable : Any]) else {
callBackBlock(false,nil)
return
}
familyInfo = resultModel
callBackBlock(true,nil)
} failBlock: { err in
callBackBlock(false,err)
}
}
}
......@@ -14,6 +14,7 @@ class YHFormItemInputTextCell: UITableViewCell {
// 是否必填 如必填title会展示红色*
var isMust = false
var textChange:((String?)->Void)?
var title:String? {
didSet {
......@@ -31,7 +32,6 @@ class YHFormItemInputTextCell: UITableViewCell {
}
titleLabel.attributedText = questionAttrStr
}
}
}
......@@ -51,8 +51,7 @@ class YHFormItemInputTextCell: UITableViewCell {
textField.font = UIFont.PingFangScR(ofSize: 14)
textField.tintColor = UIColor(hex: 0xC0C0C0)
textField.textColor = UIColor(hex: 0x222222)
// textField.delegate = self
// textField.addTarget(self, action: #selector(smsCodeInputChanged), for: .editingChanged)
textField.addTarget(self, action: #selector(textFieldChanged(textField:)), for: .editingChanged)
return textField
}()
......@@ -85,5 +84,11 @@ class YHFormItemInputTextCell: UITableViewCell {
make.left.equalTo(titleLabel.snp.right).offset(10)
}
}
@objc func textFieldChanged(textField:UITextField) {
if let textChange = textChange {
textChange(textField.text)
}
}
}
......@@ -20,5 +20,7 @@ class YHAllApiName {
struct Order {
//合同列表
static let contractListApi = "frontend/order/list"
//
static let familyInfoApi = "frontend/order/information/family"
}
}
......@@ -109,7 +109,7 @@ class YHNetRequest: NSObject {
return self
}
///请求参数
func params(_params: [String:Any]?) -> Self {
func params(_ params: [String:Any]?) -> Self {
self.params = params
return self
}
......@@ -234,11 +234,11 @@ extension YHNetRequest {
class func getRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.get).success(successBlock).failed(failBlock).startRequest()
return YHNetRequest().url(url).requestType(.get).params(params).success(successBlock).failed(failBlock).startRequest()
}
class func postRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.post).success(successBlock).failed(failBlock).startRequest()
return YHNetRequest().url(url).requestType(.post).params(params).success(successBlock).failed(failBlock).startRequest()
}
}
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