Commit 6cabaad6 authored by Alex朱枝文's avatar Alex朱枝文

高才基本资料

parent 2f6ea612
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; }; 04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; };
04307B6C2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */; }; 04307B6C2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */; };
04307B6E2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */; }; 04307B6E2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */; };
04307B7A2D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B762D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift */; };
04307B7B2D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B782D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift */; };
045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F4F2D12CA5E00BD2DC0 /* submit_page_scroll.gif */; }; 045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F4F2D12CA5E00BD2DC0 /* submit_page_scroll.gif */; };
045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F762D12CA5E00BD2DC0 /* Localizable.xcstrings */; }; 045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F762D12CA5E00BD2DC0 /* Localizable.xcstrings */; };
045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F5E2D12CA5E00BD2DC0 /* img_0.png */; }; 045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F5E2D12CA5E00BD2DC0 /* img_0.png */; };
...@@ -1208,6 +1210,8 @@ ...@@ -1208,6 +1210,8 @@
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; }; 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; };
04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeDateTillNowCell.swift; sourceTree = "<group>"; }; 04307B6B2D1A547C00ED8E8D /* YHIncomeDateTillNowCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeDateTillNowCell.swift; sourceTree = "<group>"; };
04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeUploadWorkIDCell.swift; sourceTree = "<group>"; }; 04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeUploadWorkIDCell.swift; sourceTree = "<group>"; };
04307B762D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCBasicInfoFillModel.swift; sourceTree = "<group>"; };
04307B782D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCBasicInfoFillViewModel.swift; sourceTree = "<group>"; };
045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; }; 045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; };
045C0A142D12CA5E00BD2DC0 /* YHBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewController.swift; sourceTree = "<group>"; }; 045C0A142D12CA5E00BD2DC0 /* YHBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewController.swift; sourceTree = "<group>"; };
045C0A152D12CA5E00BD2DC0 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; }; 045C0A152D12CA5E00BD2DC0 /* YHBaseViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseViewModel.swift; sourceTree = "<group>"; };
...@@ -2504,6 +2508,22 @@ ...@@ -2504,6 +2508,22 @@
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
04307B772D1AADBE00ED8E8D /* M */ = {
isa = PBXGroup;
children = (
04307B762D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift */,
);
path = M;
sourceTree = "<group>";
};
04307B792D1AADBE00ED8E8D /* VM */ = {
isa = PBXGroup;
children = (
04307B782D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
045C0A182D12CA5E00BD2DC0 /* C */ = { 045C0A182D12CA5E00BD2DC0 /* C */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -6127,6 +6147,8 @@ ...@@ -6127,6 +6147,8 @@
04AE200C2D12CFAF00891D24 /* BaseInformation(基本资料) */ = { 04AE200C2D12CFAF00891D24 /* BaseInformation(基本资料) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04307B772D1AADBE00ED8E8D /* M */,
04307B792D1AADBE00ED8E8D /* VM */,
04AE200B2D12CFAF00891D24 /* C */, 04AE200B2D12CFAF00891D24 /* C */,
); );
path = "BaseInformation(基本资料)"; path = "BaseInformation(基本资料)";
...@@ -7247,6 +7269,8 @@ ...@@ -7247,6 +7269,8 @@
045C11F72D12CA5F00BD2DC0 /* YHPrinciplePhotoCollectCell.swift in Sources */, 045C11F72D12CA5F00BD2DC0 /* YHPrinciplePhotoCollectCell.swift in Sources */,
045C11F82D12CA5F00BD2DC0 /* YHCompanyViewModel.swift in Sources */, 045C11F82D12CA5F00BD2DC0 /* YHCompanyViewModel.swift in Sources */,
045C11F92D12CA5F00BD2DC0 /* YHTravelDocsPreparationListViewController.swift in Sources */, 045C11F92D12CA5F00BD2DC0 /* YHTravelDocsPreparationListViewController.swift in Sources */,
04307B7A2D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift in Sources */,
04307B7B2D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift in Sources */,
045C11FA2D12CA5F00BD2DC0 /* YHMyTestViewController.swift in Sources */, 045C11FA2D12CA5F00BD2DC0 /* YHMyTestViewController.swift in Sources */,
045C11FB2D12CA5F00BD2DC0 /* YHIncomeDocumentationConfirmationCell.swift in Sources */, 045C11FB2D12CA5F00BD2DC0 /* YHIncomeDocumentationConfirmationCell.swift in Sources */,
045C11FC2D12CA5F00BD2DC0 /* YHHKPlaceInfoCell.swift in Sources */, 045C11FC2D12CA5F00BD2DC0 /* YHHKPlaceInfoCell.swift in Sources */,
......
...@@ -642,12 +642,13 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -642,12 +642,13 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
} else if tapIndex == 3 { } else if tapIndex == 3 {
//高A- 收入记录/工作经验 //高A- 收入记录/工作经验
YHHUD.flash(message: "高A- 收入记录/工作经验") let ctl = YHGCIncomeRecordViewController(orderId: orderId ?? 0)
navigationController?.pushViewController(ctl)
} else if tapIndex == 4 { } else if tapIndex == 4 {
//高A- 基本资料 //高A- 基本资料
YHHUD.flash(message: "高A- 基本资料") let ctl = YHGCBasicInfoFillViewController()
ctl.orderId = orderId ?? 0
navigationController?.pushViewController(ctl)
} }
else { else {
YHHUD.flash(message: "高A- 未知") YHHUD.flash(message: "高A- 未知")
...@@ -693,7 +694,9 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -693,7 +694,9 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
navigationController?.pushViewController(vc) navigationController?.pushViewController(vc)
} else if tapIndex == 5 { } else if tapIndex == 5 {
//高才BC- 基本资料 //高才BC- 基本资料
YHHUD.flash(message: "高才BC- 基本资料") let ctl = YHGCBasicInfoFillViewController()
ctl.orderId = orderId ?? 0
navigationController?.pushViewController(ctl)
} }
else { else {
YHHUD.flash(message: "高才BC- 未知") YHHUD.flash(message: "高才BC- 未知")
......
...@@ -13,6 +13,7 @@ class YHBasicInfoSessionModel { ...@@ -13,6 +13,7 @@ class YHBasicInfoSessionModel {
var arrQuestionItem : [YHBasicInfoCellModel] = [] var arrQuestionItem : [YHBasicInfoCellModel] = []
var model : SpouseModel? var model : SpouseModel?
var gcModel: YHGCApplicantModel?
init(sessionTitle: String, arrQuestionItem: [YHBasicInfoCellModel]) { init(sessionTitle: String, arrQuestionItem: [YHBasicInfoCellModel]) {
self.sessionTitle = sessionTitle self.sessionTitle = sessionTitle
self.arrQuestionItem = arrQuestionItem self.arrQuestionItem = arrQuestionItem
......
...@@ -10,7 +10,7 @@ import UIKit ...@@ -10,7 +10,7 @@ import UIKit
class YHGCBasicInfoFillViewController: YHBaseViewController { class YHGCBasicInfoFillViewController: YHBaseViewController {
var orderId: Int? var orderId: Int?
private let basicInfoVM: YHBasicInfoFillViewModel = YHBasicInfoFillViewModel() private let basicInfoVM: YHGCBasicInfoFillViewModel = YHGCBasicInfoFillViewModel()
var homeTableView: UITableView = { var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped) let tableView = UITableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
...@@ -122,27 +122,28 @@ extension YHGCBasicInfoFillViewController { ...@@ -122,27 +122,28 @@ extension YHGCBasicInfoFillViewController {
// 保存 // 保存
let arr = basicInfoVM.arrBasicInfoSessionDataForEdit let arr = basicInfoVM.arrBasicInfoSessionDataForEdit
var param: [String: Any] = ["order_id": orderId as Any, "save_type": isSaveFlag ? "save" : "submit"] var param: [String: Any] = ["orderId": orderId ?? 0, "save_type": isSaveFlag ? "save" : "submit"]
for item in arr { for item in arr {
if item.sessionTitle == "主申请人" { if item.sessionTitle == "主申请人" {
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 = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""] if item0.answer == "Y" {
applicant.updateValue(value, forKey: "has_conviction") applicant.updateValue(item0.info.count > 0 ? 1 : 2, forKey: "deny")
applicant.updateValue(item0.info, forKey: "denyContent")
} else if item0.answer == "N" {
applicant.updateValue(0, forKey: "deny")
applicant.updateValue("", forKey: "denyContent")
}
} else if index0 == 1 { } else if index0 == 1 {
let value = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""] if item0.answer == "Y" {
applicant.updateValue(value, forKey: "has_departure") applicant.updateValue(item0.info.count > 0 ? 1 : 2, forKey: "crime")
} else if index0 == 2 { applicant.updateValue(item0.info, forKey: "crimeContent")
let value = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""] } else if item0.answer == "N" {
applicant.updateValue(value, forKey: "has_deny") applicant.updateValue(0, forKey: "crime")
} else if index0 == 3 { applicant.updateValue("", forKey: "crimeContent")
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")
} else { } else {
printLog("其他数据没有处理") printLog("其他数据没有处理")
} }
...@@ -153,17 +154,27 @@ extension YHGCBasicInfoFillViewController { ...@@ -153,17 +154,27 @@ extension YHGCBasicInfoFillViewController {
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 = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""] if item0.answer == "Y" {
applicant.updateValue(value, forKey: "child_departure") applicant.updateValue(item0.info.count > 0 ? 1 : 2, forKey: "deny")
applicant.updateValue(item0.info, forKey: "denyContent")
} else if item0.answer == "N" {
applicant.updateValue(0, forKey: "deny")
applicant.updateValue("", forKey: "denyContent")
}
} else if index0 == 1 { } else if index0 == 1 {
let value = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""] if item0.answer == "Y" {
applicant.updateValue(value, forKey: "child_deny") applicant.updateValue(item0.info.count > 0 ? 1 : 2, forKey: "crime")
applicant.updateValue(item0.info, forKey: "crimeContent")
} else if item0.answer == "N" {
applicant.updateValue(0, forKey: "crime")
applicant.updateValue("", forKey: "crimeContent")
}
} else { } else {
printLog("其他数据没有处理") printLog("其他数据没有处理")
} }
} }
applicant.updateValue(basicInfoVM.dataModelForBasicInfo?.spouse?.id ?? 0, forKey: "id") applicant.updateValue(basicInfoVM.dataModelForBasicInfo?.spouse?.id ?? 0, forKey: "id")
applicant.updateValue(basicInfoVM.dataModelForBasicInfo?.spouse?.subset_name ?? 0, forKey: "subset_name") // applicant.updateValue(basicInfoVM.dataModelForBasicInfo?.spouse?.name ?? "", forKey: "name")
param.updateValue(applicant, forKey: "spouse") param.updateValue(applicant, forKey: "spouse")
} else if item.sessionTitle.hasPrefix("子女") { } else if item.sessionTitle.hasPrefix("子女") {
var arr: [[String: Any]] = [] var arr: [[String: Any]] = []
...@@ -174,33 +185,31 @@ extension YHGCBasicInfoFillViewController { ...@@ -174,33 +185,31 @@ extension YHGCBasicInfoFillViewController {
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 = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""] if item0.answer == "Y" {
applicant.updateValue(value, forKey: "child_departure") applicant.updateValue(item0.info.count > 0 ? 1 : 2, forKey: "deny")
applicant.updateValue(item0.info, forKey: "denyContent")
} else if item0.answer == "N" {
applicant.updateValue(0, forKey: "deny")
applicant.updateValue("", forKey: "denyContent")
}
} else if index0 == 1 { } else if index0 == 1 {
let value = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""] if item0.answer == "Y" {
applicant.updateValue(value, forKey: "child_deny") applicant.updateValue(item0.info.count > 0 ? 1 : 2, forKey: "crime")
applicant.updateValue(item0.info, forKey: "crimeContent")
} else if item0.answer == "N" {
applicant.updateValue(0, forKey: "crime")
applicant.updateValue("", forKey: "crimeContent")
}
} else { } else {
printLog("其他数据没有处理") printLog("其他数据没有处理")
} }
} }
applicant.updateValue(item.model?.id ?? 0, forKey: "id") applicant.updateValue(item.gcModel?.id ?? 0, forKey: "id")
applicant.updateValue(item.model?.subset_name ?? "", forKey: "subset_name") // applicant.updateValue(item.gcModel?.name ?? "", forKey: "name")
arr.append(applicant) arr.append(applicant)
param.updateValue(arr, forKey: "child") param.updateValue(arr, forKey: "child")
} else if item.sessionTitle == "家庭背景" {
var applicant: [String: Any] = [:]
for (index0, item0) in item.arrQuestionItem.enumerated() {
if index0 == 0 {
let value = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "background_member")
} else {
printLog("其他数据没有处理")
}
}
param.updateValue(applicant, forKey: "background")
} else {
} }
} }
......
//
// YHGCBasicInfoFillModel.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import SmartCodable
import UIKit
class YHGCBasicInfoFillModel: SmartCodable {
var applicant: YHGCApplicantModel?
var spouse: YHGCApplicantModel?
var child: [YHGCApplicantModel]?
required init() {
}
}
class YHGCApplicantModel: SmartCodable {
// deny 和 crime 如果是2那就是没填, 0 1 或者 2
var deny: Int = 0
var denyContent: String = ""
var crime: Int = 0
var crimeContent: String = ""
var name: String = ""
var id: Int = 0
required init() {
}
}
//
// YHGCBasicInfoFillViewModel.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCBasicInfoFillViewModel: YHBaseViewModel {
// UI层需要的数据源
var arrBasicInfoSessionDataForEdit: [YHBasicInfoSessionModel] = []
// 从网络请求的数据源
var dataModelForBasicInfo: YHGCBasicInfoFillModel? {
didSet {
assembleBasicInfoData()
}
}
}
extension YHGCBasicInfoFillViewModel {
private func createOrgBasiceInfoData() {
var arrData: [YHBasicInfoSessionModel] = []
do {
// 主申请人
let model1 = YHBasicInfoCellModel(question: "1、是否曾被拒绝签发签证或入境香港,或被遣返、遣送和要求离开香港?", answer: "", info: "")
let model2 = YHBasicInfoCellModel(question: "2、是否曾因任何罪行或违法行为在香港或其他地方被定罪?", answer: "", info: "")
let arr = [model1, model2]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "主申请人", arrQuestionItem: arr)
arrData.append(sessionModel)
}
do {
// 配偶
let model1 = YHBasicInfoCellModel(question: "1、是否曾被拒绝签发签证或入境香港,或被遣返、遣送和要求离开香港?", answer: "", info: "")
let model2 = YHBasicInfoCellModel(question: "2、是否曾因任何罪行或违法行为在香港或其他地方被定罪?", answer: "", info: "")
let arr = [model1, model2]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "配偶", arrQuestionItem: arr)
arrData.append(sessionModel)
}
do {
// 子女 - xxx
let model1 = YHBasicInfoCellModel(question: "1、是否曾被拒绝签发签证或入境香港,或被遣返、遣送和要求离开香港?", answer: "", info: "")
let model2 = YHBasicInfoCellModel(question: "2、是否曾因任何罪行或违法行为在香港或其他地方被定罪?", answer: "", info: "")
let arr = [model1, model2]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "子女 - xxx", arrQuestionItem: arr)
arrData.append(sessionModel)
}
arrBasicInfoSessionDataForEdit = arrData
}
// 根据网络数据 组装数据
private func assembleBasicInfoData() {
guard let dataModelForBasicInfo = dataModelForBasicInfo else {
createOrgBasiceInfoData()
return
}
var arrData: [YHBasicInfoSessionModel] = []
do {
// 主申请人
if let model = dataModelForBasicInfo.applicant {
let answer1 = model.deny == 0 ? "N" : "Y"
let model1 = YHBasicInfoCellModel(question: "1、是否曾被拒绝签发签证或入境香港,或被遣返、遣送和要求离开香港?", answer: answer1, info: model.denyContent)
let answer2 = model.crime == 0 ? "N" : "Y"
let model2 = YHBasicInfoCellModel(question: "2、是否曾因任何罪行或违法行为在香港或其他地方被定罪?", answer: answer2, info: model.crimeContent)
let arr = [model1, model2]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "主申请人", arrQuestionItem: arr)
arrData.append(sessionModel)
}
}
do {
// 配偶
if let spouse = dataModelForBasicInfo.spouse {
let answer1 = spouse.deny == 0 ? "N" : "Y"
let model1 = YHBasicInfoCellModel(question: "1、是否曾被拒绝签发签证或入境香港,或被遣返、遣送和要求离开香港?", answer: answer1, info: spouse.denyContent)
let answer2 = spouse.crime == 0 ? "N" : "Y"
let model2 = YHBasicInfoCellModel(question: "2、是否曾因任何罪行或违法行为在香港或其他地方被定罪?", answer: answer2, info: spouse.crimeContent)
let arr = [model1, model2]
let sessionModel = YHBasicInfoSessionModel(sessionTitle: "配偶", arrQuestionItem: arr)
arrData.append(sessionModel)
}
}
do {
// 子女 - xxx
if let arrChild = dataModelForBasicInfo.child {
for item in arrChild {
let answer1 = item.deny == 0 ? "N" : "Y"
let model1 = YHBasicInfoCellModel(question: "1、是否曾被拒绝签发签证或入境香港,或被遣返、遣送和要求离开香港?", answer: answer1, info: item.denyContent)
let answer2 = item.crime == 0 ? "N" : "Y"
let model2 = YHBasicInfoCellModel(question: "2、是否曾因任何罪行或违法行为在香港或其他地方被定罪?", answer: answer2, info: item.crimeContent)
let arr = [model1, model2]
let title = "子女" + "-" + item.name
let sessionModel = YHBasicInfoSessionModel(sessionTitle: title, arrQuestionItem: arr)
sessionModel.gcModel = item
arrData.append(sessionModel)
}
}
}
arrBasicInfoSessionDataForEdit = arrData
}
}
extension YHGCBasicInfoFillViewModel {
// 获取基本资料信息
func getBasicInfo(params: [String: Any], callBackBlock: @escaping (_ success: Bool, _ error: YHErrorModel?) -> Void) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.GCBasics.basicInfoApi
_ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, _ in
// 1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String: Any], let resultModel = YHGCBasicInfoFillModel.deserialize(from: dic) else {
callBackBlock(false, nil)
return
}
self.dataModelForBasicInfo = resultModel
// 根据返回值 组装 真实的数据
callBackBlock(true, nil)
} else {
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
// 保存基本资料信息
func saveBasicInfo(params: [String: Any], callBackBlock: @escaping (_ success: Bool, _ error: YHErrorModel?) -> Void) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.GCBasics.updateBasicInfoApi
_ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, _ in
// 1. json字符串 转 对象
guard self != nil else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true, nil)
} else {
let error: YHErrorModel = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
}
...@@ -217,6 +217,15 @@ class YHAllApiName { ...@@ -217,6 +217,15 @@ class YHAllApiName {
static let updateBasicInfoApi = "infoflow/basics/update_basics" static let updateBasicInfoApi = "infoflow/basics/update_basics"
} }
//Basics
struct GCBasics {
//获取 基本资料信息
static let basicInfoApi = "super-app/basic/gc-information"
//保存基本资料信息
static let updateBasicInfoApi = "super-app/basic/gc-information/update"
}
struct OrderInformation { struct OrderInformation {
//主申请人获取信息 //主申请人获取信息
static let getInformation = "infoflow/order-information/get_information" static let getInformation = "infoflow/order-information/get_information"
......
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