Commit 0e710682 authored by Steven杜宇's avatar Steven杜宇

// 家庭信息

parent 52159038
......@@ -58,6 +58,10 @@
04256DF42C73626900A37BA4 /* YHServiceSelectAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DF32C73626900A37BA4 /* YHServiceSelectAlertView.swift */; };
04256DF62C736A0800A37BA4 /* YHServiceItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DF52C736A0800A37BA4 /* YHServiceItemCell.swift */; };
04256DF82C73726C00A37BA4 /* YHCerAppointViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DF72C73726C00A37BA4 /* YHCerAppointViewModel.swift */; };
04256DFA2C742A1500A37BA4 /* YHFamilyGroupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DF92C742A1500A37BA4 /* YHFamilyGroupModel.swift */; };
04256DFC2C742C7D00A37BA4 /* YHFamilyInfoConfirmViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DFB2C742C7D00A37BA4 /* YHFamilyInfoConfirmViewModel.swift */; };
04256DFE2C743CB700A37BA4 /* YHCertificateInfoPhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DFD2C743CB700A37BA4 /* YHCertificateInfoPhotoCell.swift */; };
04256E002C7440A500A37BA4 /* YHFamilyWarmTipsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04256DFF2C7440A500A37BA4 /* YHFamilyWarmTipsCell.swift */; };
0425E63D2BA9345200A5E763 /* YHSchemeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */; };
0425E6402BA9357D00A5E763 /* YHScemeItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */; };
0425E6422BA95B1B00A5E763 /* YHSchemeTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */; };
......@@ -752,6 +756,10 @@
04256DF32C73626900A37BA4 /* YHServiceSelectAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceSelectAlertView.swift; sourceTree = "<group>"; };
04256DF52C736A0800A37BA4 /* YHServiceItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceItemCell.swift; sourceTree = "<group>"; };
04256DF72C73726C00A37BA4 /* YHCerAppointViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCerAppointViewModel.swift; sourceTree = "<group>"; };
04256DF92C742A1500A37BA4 /* YHFamilyGroupModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyGroupModel.swift; sourceTree = "<group>"; };
04256DFB2C742C7D00A37BA4 /* YHFamilyInfoConfirmViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyInfoConfirmViewModel.swift; sourceTree = "<group>"; };
04256DFD2C743CB700A37BA4 /* YHCertificateInfoPhotoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfoPhotoCell.swift; sourceTree = "<group>"; };
04256DFF2C7440A500A37BA4 /* YHFamilyWarmTipsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFamilyWarmTipsCell.swift; sourceTree = "<group>"; };
0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableViewCell.swift; sourceTree = "<group>"; };
0425E63F2BA9357D00A5E763 /* YHScemeItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScemeItemModel.swift; sourceTree = "<group>"; };
0425E6412BA95B1B00A5E763 /* YHSchemeTableFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableFooterView.swift; sourceTree = "<group>"; };
......@@ -2413,6 +2421,7 @@
046A952C2C6EFAF30059326A /* M */ = {
isa = PBXGroup;
children = (
04256DF92C742A1500A37BA4 /* YHFamilyGroupModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -2425,6 +2434,8 @@
049D62C42C6F272800E811A1 /* YHRiskWarningCell.swift */,
049D62C62C6F2F4F00E811A1 /* YHApproverInfoVerifyCell.swift */,
04506F542C6F57E600738EA1 /* YHFamilyMemberInfoCell.swift */,
04256DFD2C743CB700A37BA4 /* YHCertificateInfoPhotoCell.swift */,
04256DFF2C7440A500A37BA4 /* YHFamilyWarmTipsCell.swift */,
04256DD12C704A3000A37BA4 /* YHIFamilyInfoListCell.swift */,
04256DCF2C7041C700A37BA4 /* YHInfoItemView.swift */,
);
......@@ -2434,6 +2445,7 @@
046A952E2C6EFB090059326A /* VM */ = {
isa = PBXGroup;
children = (
04256DFB2C742C7D00A37BA4 /* YHFamilyInfoConfirmViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
......@@ -4073,6 +4085,7 @@
A567E5AA2BD7643D00D5D5A0 /* YHGestureTableView.swift in Sources */,
04CE1ADF2C2AD91F001CB80A /* YHActivityListCell.swift in Sources */,
04F5F8642C19460D004A463C /* YHHKLifeViewController.swift in Sources */,
04256DFC2C742C7D00A37BA4 /* YHFamilyInfoConfirmViewModel.swift in Sources */,
A59B43CF2C4B5AD100B28379 /* YHShareViewOnTablebarView.swift in Sources */,
A5ACE94A2B4564F7002C94D2 /* YHHUDProgressView.swift in Sources */,
04A271232BABFF3200652B1B /* YHCertificateUploadTypeCell.swift in Sources */,
......@@ -4262,6 +4275,7 @@
A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */,
045EEECF2B9F171A0022A143 /* YHScoreOptionsView.swift in Sources */,
04CE1AD22C2AD91F001CB80A /* YHActivityModel.swift in Sources */,
04256E002C7440A500A37BA4 /* YHFamilyWarmTipsCell.swift in Sources */,
0445E6AF2BE9CFF6003C52F9 /* YHAppVersionForceUpdateView.swift in Sources */,
04213B272C48C95E00797900 /* YHHomeIdentityCell.swift in Sources */,
0430E6542C73400A000511E2 /* YHAdopterUploadTableViewCell.swift in Sources */,
......@@ -4320,6 +4334,7 @@
04AD31792C23FFC700DF5655 /* YHInterestModel.swift in Sources */,
04256DD22C704A3000A37BA4 /* YHIFamilyInfoListCell.swift in Sources */,
A596CADF2C6B9B3D00F85797 /* YHHomeAlertViewManager.swift in Sources */,
04256DFE2C743CB700A37BA4 /* YHCertificateInfoPhotoCell.swift in Sources */,
04EA23082BB50753009DA928 /* YHDocumentMessageTableViewCell.swift in Sources */,
045EEE8E2B9F171A0022A143 /* YHPreviewInfoWorkSummaryView.swift in Sources */,
045EEECE2B9F171A0022A143 /* YHScoreDetailViewController.swift in Sources */,
......@@ -4413,6 +4428,7 @@
045EEEFE2B9F171A0022A143 /* YHFormItemInputTextCell.swift in Sources */,
0419A0A42C49184300A5FCFA /* YHInvitationNumberItemView.swift in Sources */,
045EEEDD2B9F171A0022A143 /* YHCollegeNameCell.swift in Sources */,
04256DFA2C742A1500A37BA4 /* YHFamilyGroupModel.swift in Sources */,
045EEF162B9F171A0022A143 /* YHMainApplicantInformationViewController.swift in Sources */,
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */,
045EEEAA2B9F171A0022A143 /* YHWorkExampleViewController.swift in Sources */,
......
......@@ -10,8 +10,11 @@ import UIKit
class YHFamilyInfoConfirmViewController: YHBaseViewController {
var items: [String] = ["1", "1"]
var orderId: Int = 151086
var sectionItems:[String] = ["", "", "", ""]
var familyArr: [YHApplicantInfoModel] = []
let viewModel = YHFamilyInfoConfirmViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 16.0
......@@ -25,25 +28,62 @@ class YHFamilyInfoConfirmViewController: YHBaseViewController {
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHRiskWarningCell.self, forCellReuseIdentifier: YHRiskWarningCell.cellReuseIdentifier)
tableView.register(YHApproverInfoVerifyCell.self, forCellReuseIdentifier: YHApproverInfoVerifyCell.cellReuseIdentifier)
tableView.register(YHCertificateInfoPhotoCell.self, forCellReuseIdentifier: YHCertificateInfoPhotoCell.cellReuseIdentifier)
tableView.register(YHFamilyWarmTipsCell.self, forCellReuseIdentifier: YHFamilyWarmTipsCell.cellReuseIdentifier)
return tableView
}()
lazy var bottomBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .brandMainColor
btn.setTitle("确认修改,下一步", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
btn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside)
btn.layer.cornerRadius = kCornerRadius3
return btn
}()
lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(bottomBtn)
bottomBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(8)
make.height.equalTo(48)
}
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
self.gk_navTitle = "家庭信息确认"
self.view.backgroundColor = .white
self.view.addSubview(self.tableView)
self.view.addSubview(bottomView)
self.tableView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar+16)
make.bottom.equalTo(bottomView.snp.top)
}
self.bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(98)
}
getFamilyInfo()
}
@objc func didBottomBtnClicked() {
}
}
extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return items.count
return sectionItems.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......@@ -51,19 +91,25 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// let cell = tableView.dequeueReusableCell(withIdentifier: YHRiskWarningCell.cellReuseIdentifier, for: indexPath)
if 0 <= indexPath.section && indexPath.section < items.count {
if 0 <= indexPath.section && indexPath.section < sectionItems.count {
if indexPath.section == 0 {
let warningCell = tableView.dequeueReusableCell(withIdentifier: YHRiskWarningCell.cellReuseIdentifier, for: indexPath)
return warningCell
}
if indexPath.section == 1 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHApproverInfoVerifyCell.cellReuseIdentifier, for: indexPath) as! YHApproverInfoVerifyCell
approveCell.updateFamilyArr(self.familyArr)
return approveCell
}
if indexPath.section == 2 {
let certificateInfoCell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoPhotoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoPhotoCell
return certificateInfoCell
}
}
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHApproverInfoVerifyCell.cellReuseIdentifier, for: indexPath)
return approveCell
let warmTipsCell = tableView.dequeueReusableCell(withIdentifier: YHFamilyWarmTipsCell.cellReuseIdentifier, for: indexPath) as! YHFamilyWarmTipsCell
return warmTipsCell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
......@@ -72,7 +118,7 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
if 0 <= indexPath.section && indexPath.section < sectionItems.count {
}
}
......@@ -97,3 +143,26 @@ extension YHFamilyInfoConfirmViewController: UITableViewDelegate, UITableViewDat
return view
}
}
extension YHFamilyInfoConfirmViewController {
func getFamilyInfo() {
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getFamilyInfo(param: ["orderId" : orderId]) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
self.familyArr.removeAll()
if self.viewModel.familyInfo.main.info.id > 0 {
self.familyArr.append(self.viewModel.familyInfo.main)
}
if self.viewModel.familyInfo.spouse.info.id > 0 {
self.familyArr.append(self.viewModel.familyInfo.spouse)
}
for child in self.viewModel.familyInfo.children {
self.familyArr.append(child)
}
self.tableView.reloadData()
}
}
}
......@@ -18,6 +18,7 @@ enum YHFamilyMemberRelationType: Int {
class YHFamilyInfoUpdateViewController: YHBaseViewController {
var orderId: Int = 0
var relation:YHFamilyMemberRelationType = .mainApplicant
var isInfoEditing: Bool = false
......
//
// YHFamilyInfoModel.swift
// galaxy
//
// Created by edy on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHFamilyGroupModel: SmartCodable {
var orderid: Int = 0
var main: YHApplicantInfoModel = YHApplicantInfoModel()
var spouse: YHApplicantInfoModel = YHApplicantInfoModel()
var children: [YHApplicantInfoModel] = []
enum CodingKeys: String, CodingKey {
case orderid = "order_id"
case main = "main"
case spouse = "spouse"
case children = "children"
}
required init() {
}
init(orderid: Int, main: YHApplicantInfoModel, spouse: YHApplicantInfoModel, children: [YHApplicantInfoModel]) {
self.orderid = orderid
self.main = main
self.spouse = spouse
self.children = children
}
}
// MARK: - Main
class YHApplicantInfoModel: SmartCodable {
var info: YHFamilyMemberInfoModel = YHFamilyMemberInfoModel()
var confirmStatus: Int = 0
enum CodingKeys: String, CodingKey {
case info = "info"
case confirmStatus = "confirm_status"
}
required init() {
}
init(info: YHFamilyMemberInfoModel, confirmStatus: Int) {
self.info = info
self.confirmStatus = confirmStatus
}
}
// MARK: - Info
class YHFamilyMemberInfoModel: SmartCodable {
var id: Int = -1
var name: String = ""
var nameHistory: String = ""
var familyName: String = ""
var familyNameHistory: String = ""
var givenName: String = ""
var givenNameHistory: String = ""
var married: String = ""
var marriedHistory: String = ""
var birthPlaceAboard: Int = -1
var birthPlaceAboardHistory: Int = -1
var birthPlace: YHApplicantBirthPlaceModel = YHApplicantBirthPlaceModel()
var birthPlaceHistory: YHApplicantBirthPlaceModel = YHApplicantBirthPlaceModel()
var nationalityType: Int = -1
var nationalityTypeHistory: Int = -1
var nationality: String = ""
var nationalityHistory: String = ""
var hkIdentityid: String = ""
var hkIdentityidHistory: String = ""
var identity: YHApplicantIdentityModel = YHApplicantIdentityModel()
var occupationName: String = ""
var occupationNameHistory: String = ""
// 自定义属性
var relation:Int = YHFamilyMemberRelationType.none.rawValue
func getRelation() -> String {
if relation == YHFamilyMemberRelationType.mainApplicant.rawValue {
return "主申人"
} else if relation == YHFamilyMemberRelationType.spouse.rawValue {
return "配偶"
} else if relation == YHFamilyMemberRelationType.child.rawValue {
return "子女"
}
return ""
}
required init() {
}
enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
case nameHistory = "name_history"
case familyName = "family_name"
case familyNameHistory = "family_name_history"
case givenName = "given_name"
case givenNameHistory = "given_name_history"
case married = "married"
case marriedHistory = "married_history"
case birthPlaceAboard = "birth_place_aboard"
case birthPlaceAboardHistory = "birth_place_aboard_history"
case birthPlace = "birth_place"
case birthPlaceHistory = "birth_place_history"
case nationalityType = "nationality_type"
case nationalityTypeHistory = "nationality_type_history"
case nationality = "nationality"
case nationalityHistory = "nationality_history"
case hkIdentityid = "hk_identity_id"
case hkIdentityidHistory = "hk_identity_id_history"
case identity = "identity"
case occupationName = "occupation_name"
case occupationNameHistory = "occupation_name_history"
}
init(id: Int, name: String, nameHistory: String, familyName: String, familyNameHistory: String, givenName: String, givenNameHistory: String, married: String, marriedHistory: String, birthPlaceAboard: Int, birthPlaceAboardHistory: Int, birthPlace: YHApplicantBirthPlaceModel, birthPlaceHistory: YHApplicantBirthPlaceModel, nationalityType: Int, nationalityTypeHistory: Int, nationality: String, nationalityHistory: String, hkIdentityid: String, hkIdentityidHistory: String, identity: YHApplicantIdentityModel, occupationName: String, occupationNameHistory: String) {
self.id = id
self.name = name
self.nameHistory = nameHistory
self.familyName = familyName
self.familyNameHistory = familyNameHistory
self.givenName = givenName
self.givenNameHistory = givenNameHistory
self.married = married
self.marriedHistory = marriedHistory
self.birthPlaceAboard = birthPlaceAboard
self.birthPlaceAboardHistory = birthPlaceAboardHistory
self.birthPlace = birthPlace
self.birthPlaceHistory = birthPlaceHistory
self.nationalityType = nationalityType
self.nationalityTypeHistory = nationalityTypeHistory
self.nationality = nationality
self.nationalityHistory = nationalityHistory
self.hkIdentityid = hkIdentityid
self.hkIdentityidHistory = hkIdentityidHistory
self.identity = identity
self.occupationName = occupationName
self.occupationNameHistory = occupationNameHistory
}
}
// MARK: - BirthPlace
class YHApplicantBirthPlaceModel: SmartCodable {
var area: [String] = []
var country: String = ""
var details: String = ""
var foreign: String = ""
required init() {
}
enum CodingKeys: String, CodingKey {
case area = "area"
case country = "country"
case details = "details"
case foreign = "foreign"
}
init(area: [String], country: String, details: String, foreign: String) {
self.area = area
self.country = country
self.details = details
self.foreign = foreign
}
}
// MARK: - Identity
class YHApplicantIdentityModel: SmartCodable {
var type: Int = -1
var name: String = ""
var number: String = ""
required init() {
}
enum CodingKeys: String, CodingKey {
case type = "type"
case name = "name"
case number = "number"
}
init(type: Int, name: String, number: String) {
self.type = type
self.name = name
self.number = number
}
}
......@@ -13,9 +13,17 @@ class YHApproverInfoVerifyCell: UITableViewCell {
static let cellReuseIdentifier = "YHApproverInfoVerifyCell"
var items:[String] = ["", "", "", "", ""]
var familyArr:[YHApplicantInfoModel] = []
let memberRowHeight = 69.0
func updateFamilyArr(_ familyArr: [YHApplicantInfoModel]) {
self.familyArr = familyArr
tableView.snp.updateConstraints { make in
make.height.equalTo(memberRowHeight * Double(familyArr.count) + 4.0)
}
self.tableView.reloadData()
}
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
......@@ -88,7 +96,7 @@ class YHApproverInfoVerifyCell: UITableViewCell {
tableView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.height.equalTo(memberRowHeight * Double(items.count) + 4.0)
make.height.equalTo(0)
make.left.right.bottom.equalToSuperview()
}
tableView.reloadData()
......@@ -98,15 +106,16 @@ class YHApproverInfoVerifyCell: UITableViewCell {
extension YHApproverInfoVerifyCell: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
return familyArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFamilyMemberInfoCell.cellReuseIdentifier, for: indexPath)
let cell = tableView.dequeueReusableCell(withIdentifier: YHFamilyMemberInfoCell.cellReuseIdentifier, for: indexPath) as! YHFamilyMemberInfoCell
if 0 <= indexPath.section && indexPath.section < items.count {
if 0 <= indexPath.row && indexPath.row < familyArr.count {
let model = familyArr[indexPath.row]
cell.updateModel(model)
}
return cell
}
......@@ -117,8 +126,10 @@ extension YHApproverInfoVerifyCell: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.row && indexPath.row < items.count {
let vc = YHFamilyInfoUpdateViewController()
if 0 <= indexPath.row && indexPath.row < familyArr.count {
let model = familyArr[indexPath.row]
let vc = YHFamilyInfoConfirmViewController()
vc.orderId = model.info.id
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
......
//
// YHCertificateInfoPhotoCell.swift
// galaxy
//
// Created by edy on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateInfoPhotoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateInfoPhotoCell"
lazy var infoImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "family_certificate_info"))
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
contentView.addSubview(infoImgView)
infoImgView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(0)
make.bottom.equalTo(0)
make.height.equalTo(infoImgView.snp.width).multipliedBy(2716.0/343.0)
}
}
}
......@@ -9,9 +9,19 @@
import UIKit
class YHFamilyMemberInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHFamilyMemberInfoCell"
func updateModel(_ model: YHApplicantInfoModel) {
self.relationLabel.text = model.info.getRelation()
self.nameLabel.text = model.info.name
self.pinyinLabel.text = "\(model.info.familyName) \(model.info.givenName)"
self.statusLabel.text = model.confirmStatus == 1 ? "已确认" : "待核对"
let tintColor: UIColor = model.confirmStatus == 1 ? .brandMainColor : .init(hex: 0x3CC694)
let originArrowImg = UIImage(named: "family_info_status_arrow")
self.arrowImgView.image = originArrowImg?.withTintColor(tintColor, renderingMode: UIImage.RenderingMode.alwaysTemplate)
}
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
......
//
// YHFamilyWarmTipsCell.swift
// galaxy
//
// Created by edy on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFamilyWarmTipsCell: UITableViewCell {
static let cellReuseIdentifier = "YHFamilyWarmTipsCell"
lazy var infoImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "family_warm_tips"))
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
contentView.addSubview(infoImgView)
infoImgView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(0)
make.bottom.equalTo(0)
make.height.equalTo(infoImgView.snp.width).multipliedBy(250.0/343.0)
}
}
}
//
// YHFamilyInfoConfirmModel.swift
// galaxy
//
// Created by edy on 2024/8/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFamilyInfoConfirmViewModel: NSObject {
var familyInfo: YHFamilyGroupModel = YHFamilyGroupModel()
func getFamilyInfo(param:[String : Any], callback:((_ success: Bool,_ error:YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.FamilyInfoConfirm.familyInfo
let _ = YHNetRequest.getRequest(url: strUrl,params: param) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
let dic = json.data
guard let resultModel = YHFamilyGroupModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback?(false, err)
return
}
self.familyInfo = resultModel
// 处理亲属关系
self.familyInfo.main.info.relation = YHFamilyMemberRelationType.mainApplicant.rawValue
self.familyInfo.spouse.info.relation = YHFamilyMemberRelationType.spouse.rawValue
for child in self.familyInfo.children {
child.info.relation = YHFamilyMemberRelationType.child.rawValue
}
callback?(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback?(false, err)
}
} failBlock: { err in
callback?(false, err)
}
}
}
......@@ -342,7 +342,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
if true {
// test dy
let vc = YHCertificateAppointViewController()
let vc = YHFamilyInfoConfirmViewController()
self.navigationController?.pushViewController(vc)
return
}
......
......@@ -404,9 +404,16 @@ class YHAllApiName {
}
struct MakeCertificate {
// 获取香港服务列表
static let servicelist = "super-app/order/customer/journey/journey-service"
}
struct FamilyInfoConfirm {
// 获取获批者家庭信息
static let familyInfo = "super-app/order/family/information/obtain"
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033195466@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033195466@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033195465@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033195465@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "箭头中@2x.png",
"filename" : "箭头中@3x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "箭头中@3x.png",
"filename" : "箭头中@2x 1.png",
"idiom" : "universal",
"scale" : "3x"
}
......
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