Commit a64af63e authored by Alex朱枝文's avatar Alex朱枝文

高才我的方案以及基本资料

parent d6bd663a
...@@ -603,6 +603,8 @@ ...@@ -603,6 +603,8 @@
04B401912CE20360005C61A9 /* YHGCApplicationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B401902CE20360005C61A9 /* YHGCApplicationModel.swift */; }; 04B401912CE20360005C61A9 /* YHGCApplicationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B401902CE20360005C61A9 /* YHGCApplicationModel.swift */; };
04B401932CE22EF0005C61A9 /* YHGCVisaProgramPopVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B401922CE22EF0005C61A9 /* YHGCVisaProgramPopVC.swift */; }; 04B401932CE22EF0005C61A9 /* YHGCVisaProgramPopVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B401922CE22EF0005C61A9 /* YHGCVisaProgramPopVC.swift */; };
04B401952CE257DC005C61A9 /* YHGCApplicationTypeResultController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B401942CE257DC005C61A9 /* YHGCApplicationTypeResultController.swift */; }; 04B401952CE257DC005C61A9 /* YHGCApplicationTypeResultController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B401942CE257DC005C61A9 /* YHGCApplicationTypeResultController.swift */; };
04B4019B2CE306DC005C61A9 /* YHGCBasicInfoFillViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4019A2CE306DC005C61A9 /* YHGCBasicInfoFillViewController.swift */; };
04B4019F2CE32175005C61A9 /* YHGCMineSchemeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4019E2CE32175005C61A9 /* YHGCMineSchemeViewController.swift */; };
04B4B8D52C89CE5E00ED82BC /* YHButlerServiceMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */; }; 04B4B8D52C89CE5E00ED82BC /* YHButlerServiceMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */; };
04B4B8D72C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */; }; 04B4B8D72C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */; };
04B4B8DC2C90696E00ED82BC /* YHResignDocumentManagementVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */; }; 04B4B8DC2C90696E00ED82BC /* YHResignDocumentManagementVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */; };
...@@ -1589,6 +1591,8 @@ ...@@ -1589,6 +1591,8 @@
04B401902CE20360005C61A9 /* YHGCApplicationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationModel.swift; sourceTree = "<group>"; }; 04B401902CE20360005C61A9 /* YHGCApplicationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationModel.swift; sourceTree = "<group>"; };
04B401922CE22EF0005C61A9 /* YHGCVisaProgramPopVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCVisaProgramPopVC.swift; sourceTree = "<group>"; }; 04B401922CE22EF0005C61A9 /* YHGCVisaProgramPopVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCVisaProgramPopVC.swift; sourceTree = "<group>"; };
04B401942CE257DC005C61A9 /* YHGCApplicationTypeResultController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeResultController.swift; sourceTree = "<group>"; }; 04B401942CE257DC005C61A9 /* YHGCApplicationTypeResultController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeResultController.swift; sourceTree = "<group>"; };
04B4019A2CE306DC005C61A9 /* YHGCBasicInfoFillViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCBasicInfoFillViewController.swift; sourceTree = "<group>"; };
04B4019E2CE32175005C61A9 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; };
04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessage.swift; sourceTree = "<group>"; }; 04B4B8D42C89CE5E00ED82BC /* YHButlerServiceMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessage.swift; sourceTree = "<group>"; };
04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessageHandler.swift; sourceTree = "<group>"; }; 04B4B8D62C8AE77C00ED82BC /* YHButlerServiceMessageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceMessageHandler.swift; sourceTree = "<group>"; };
04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentManagementVC.swift; sourceTree = "<group>"; }; 04B4B8DB2C90696E00ED82BC /* YHResignDocumentManagementVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignDocumentManagementVC.swift; sourceTree = "<group>"; };
...@@ -3562,6 +3566,7 @@ ...@@ -3562,6 +3566,7 @@
047F3DAF2CDF36CE001B2A6D /* TTPS(高才) */ = { 047F3DAF2CDF36CE001B2A6D /* TTPS(高才) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04B4019C2CE3212B005C61A9 /* MyScheme(我的方案) */,
047F3DCB2CDF3F3C001B2A6D /* MyCertificates(我的证书) */, 047F3DCB2CDF3F3C001B2A6D /* MyCertificates(我的证书) */,
047F3DB02CDF36DE001B2A6D /* ServiceProcess(我的信息流程) */, 047F3DB02CDF36DE001B2A6D /* ServiceProcess(我的信息流程) */,
); );
...@@ -3571,6 +3576,7 @@ ...@@ -3571,6 +3576,7 @@
047F3DB02CDF36DE001B2A6D /* ServiceProcess(我的信息流程) */ = { 047F3DB02CDF36DE001B2A6D /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04B401962CE30695005C61A9 /* BaseInformation(基本资料) */,
04B401862CE1D006005C61A9 /* ApplicationType(申请类别) */, 04B401862CE1D006005C61A9 /* ApplicationType(申请类别) */,
047F3DB72CDF3B30001B2A6D /* FamilyMember(家庭成员信息表) */, 047F3DB72CDF3B30001B2A6D /* FamilyMember(家庭成员信息表) */,
047F3DB12CDF36F8001B2A6D /* Education&Qualification(学历专业资格填写) */, 047F3DB12CDF36F8001B2A6D /* Education&Qualification(学历专业资格填写) */,
...@@ -4012,6 +4018,54 @@ ...@@ -4012,6 +4018,54 @@
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
04B401962CE30695005C61A9 /* BaseInformation(基本资料) */ = {
isa = PBXGroup;
children = (
04B401992CE306B1005C61A9 /* M */,
04B401982CE306AC005C61A9 /* V */,
04B401972CE306A6005C61A9 /* C */,
);
path = "BaseInformation(基本资料)";
sourceTree = "<group>";
};
04B401972CE306A6005C61A9 /* C */ = {
isa = PBXGroup;
children = (
04B4019A2CE306DC005C61A9 /* YHGCBasicInfoFillViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
04B401982CE306AC005C61A9 /* V */ = {
isa = PBXGroup;
children = (
);
path = V;
sourceTree = "<group>";
};
04B401992CE306B1005C61A9 /* M */ = {
isa = PBXGroup;
children = (
);
path = M;
sourceTree = "<group>";
};
04B4019C2CE3212B005C61A9 /* MyScheme(我的方案) */ = {
isa = PBXGroup;
children = (
04B4019D2CE32135005C61A9 /* C */,
);
path = "MyScheme(我的方案)";
sourceTree = "<group>";
};
04B4019D2CE32135005C61A9 /* C */ = {
isa = PBXGroup;
children = (
04B4019E2CE32175005C61A9 /* YHGCMineSchemeViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
04B4B8D32C89CCE400ED82BC /* M */ = { 04B4B8D32C89CCE400ED82BC /* M */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -6154,6 +6208,7 @@ ...@@ -6154,6 +6208,7 @@
04912F742CB7743900CC3105 /* YHResignAppointSelectTimeItemView.swift in Sources */, 04912F742CB7743900CC3105 /* YHResignAppointSelectTimeItemView.swift in Sources */,
047F3DCA2CDF3E5C001B2A6D /* YHGCChildBasicInfoVC.swift in Sources */, 047F3DCA2CDF3E5C001B2A6D /* YHGCChildBasicInfoVC.swift in Sources */,
047AA3F82C5CC7B0009C4554 /* YHShareStepView.swift in Sources */, 047AA3F82C5CC7B0009C4554 /* YHShareStepView.swift in Sources */,
04B4019B2CE306DC005C61A9 /* YHGCBasicInfoFillViewController.swift in Sources */,
04AD31792C23FFC700DF5655 /* YHInterestModel.swift in Sources */, 04AD31792C23FFC700DF5655 /* YHInterestModel.swift in Sources */,
04256DD22C704A3000A37BA4 /* YHIFamilyInfoListCell.swift in Sources */, 04256DD22C704A3000A37BA4 /* YHIFamilyInfoListCell.swift in Sources */,
A596CADF2C6B9B3D00F85797 /* YHHomeAlertViewManager.swift in Sources */, A596CADF2C6B9B3D00F85797 /* YHHomeAlertViewManager.swift in Sources */,
...@@ -6462,6 +6517,7 @@ ...@@ -6462,6 +6517,7 @@
044EE22D2C9184CD00A2FE3A /* YHServiceMoreAlertView.swift in Sources */, 044EE22D2C9184CD00A2FE3A /* YHServiceMoreAlertView.swift in Sources */,
044EE2562C9D0E4500A2FE3A /* YHResignGuidelinesModel.swift in Sources */, 044EE2562C9D0E4500A2FE3A /* YHResignGuidelinesModel.swift in Sources */,
A5D335F92BCE51E700236F21 /* YHServiceCenterProgressModel.swift in Sources */, A5D335F92BCE51E700236F21 /* YHServiceCenterProgressModel.swift in Sources */,
04B4019F2CE32175005C61A9 /* YHGCMineSchemeViewController.swift in Sources */,
045EEECC2B9F171A0022A143 /* YHScoreResultModel.swift in Sources */, 045EEECC2B9F171A0022A143 /* YHScoreResultModel.swift in Sources */,
A5DF9C672C78B7E600CE48E6 /* YHUploadCertificateListModel.swift in Sources */, A5DF9C672C78B7E600CE48E6 /* YHUploadCertificateListModel.swift in Sources */,
045EEEDC2B9F171A0022A143 /* YHQualificationDetailVC.swift in Sources */, 045EEEDC2B9F171A0022A143 /* YHQualificationDetailVC.swift in Sources */,
......
//
// YHGCMineSchemeViewController.swift
// galaxy
//
// Created by alexzzw on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCMineSchemeViewController: YHBaseViewController {
var tableView: UITableView!
var dataSource: [YHScemeItemModel]? = []
lazy var reqSchemeVM: YHMySchemeViewModel = {
let vm = YHMySchemeViewModel()
return vm
}()
lazy var headView: YHSchemeTableHeadView = {
let headView = YHSchemeTableHeadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 566))
return headView
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "我的方案"
gk_navTitleColor = .white
gk_navBarAlpha = 1
gk_navBackgroundImage = UIImage(named: "my_scheme_nav")
gk_backImage = UIImage(named: "nav_icon_back_white")
setView()
loadData()
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
}
extension YHGCMineSchemeViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataSource?.count ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHSchemeTableViewCell.self)
cell.dataSource = dataSource?[indexPath.row]
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 199
} else if indexPath.row == 1 {
return 251
} else if indexPath.row == 2 {
return 190
}
return 0
}
}
extension YHGCMineSchemeViewController {
func getData() {
let model1 = YHScemeItemModel(title: "行业定位", mainMessage: "根据您目前给来的材料,初步建议您申请的行业:--", lightMessage: "--", subMessage: "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。")
let model2 = YHScemeItemModel(title: "资料清单", buttonTitle: "资料清单", mainMessage: "这是您的资料清单,请您前往查看。请您在1-2周内上传基础类证件哦,需要重新办理的可以晚些提供。需要注意的点如下:", lightMessage: "1-2周内", subMessage: "(1)港澳通如未办理,请尽快办理好反馈过来;\n(2)如为国内学校,需要尽快办理学位认证报告;\n(3)如为海外学校,需提供成绩单副本")
let model3 = YHScemeItemModel(title: "文书清单", buttonTitle: "文书写作", mainMessage: "这是您的文书清单,包括推荐信、赴港计划书,我写好后会发在微信里,与您一起沟通进行哈。3周-4周左右完成,需要咱们共同配合完成的噢", lightMessage: "3周-4周")
dataSource = [model1, model2, model3]
tableView.reloadData()
}
func updateDataSource() {
}
func setView() {
view.backgroundColor = .contentBkgColor
tableView = {
let tableView = UITableView(frame: .zero, style: .plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.tableFooterView = YHSchemeTableFooterView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 112))
tableView.tableHeaderView = headView
tableView.register(cellWithClass: YHSchemeTableViewCell.self)
tableView.bounces = false
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.bottom.equalToSuperview()
}
}
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
let param = ["order_id": orderID]
reqSchemeVM.getMySchemeData(params: param) { success, error in
if success == true {
guard let model = self.reqSchemeVM.schemeModel else { return }
let industry = model.industry.defaultStringIfEmpty()
let model1 = YHScemeItemModel(title: "行业定位", mainMessage: "根据您目前给来的材料,初步建议您申请的行业:" + industry, lightMessage: industry, subMessage: "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。")
let model2 = YHScemeItemModel(title: "资料清单", buttonTitle: "资料清单", mainMessage: "这是您的资料清单,请您前往查看。请您在1-2周内上传基础类证件哦,需要重新办理的可以晚些提供。需要注意的点如下:", lightMessage: "1-2周内", subMessage: "(1)港澳通如未办理,请尽快办理好反馈过来;\n(2)如为国内学校,需要尽快办理学位认证报告;\n(3)如为海外学校,需提供成绩单副本")
let model3 = YHScemeItemModel(title: "文书清单", buttonTitle: "文书写作", mainMessage: "这是您的文书清单,包括推荐信、赴港计划书,我写好后会发在微信里,与您一起沟通进行哈。3周-4周左右完成,需要咱们共同配合完成的噢", lightMessage: "3周-4周")
self.dataSource = [model1, model2, model3]
self.tableView.reloadData()
let ageTxt = "年龄" + model.age_score.string + "分"
let eduTxtA = "学历" + model.education_score_a.string + "分,名校加分XX分"
let workExp = "工作经验加分" + model.work_experience_score.string + "分"
let famous_enterprise = "名企加分" + model.famous_enterprise.string + "分"
let talent_list = "人才清单加分" + model.talent_list.string + "分"
let language = "语言加分" + model.language_score.string + "分"
let family = "家庭背景加分" + model.background_score.string + "分"
let arrText: [String] = [ageTxt, eduTxtA, workExp, famous_enterprise, talent_list, language, family]
let arrH: [String] = [model.age_score.string, model.education_score_a.string, model.work_experience_score.string, model.famous_enterprise.string, model.talent_list.string, model.language_score.string, model.background_score.string]
self.headView.dataSource = YHScemeHeadModel(totalScore: model.sum_score.string, scoreArray: arrText, scoreLightArray: arrH, addScore: "", name: model.username.defaultStringIfEmpty(), addtionStr: model.education_score_b.string)
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
}
} else {
printLog("error : orderID 为空")
}
}
}
//
// YHGCBasicInfoFillViewController.swift
// galaxy
//
// Created by alexzzw on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCBasicInfoFillViewController: YHBaseViewController {
var orderId: Int?
private let basicInfoVM: YHBasicInfoFillViewModel = YHBasicInfoFillViewModel()
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.register(YHBasicInfoFillCell.self, forCellReuseIdentifier: YHBasicInfoFillCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
// 1.0
initView()
// 2.0
loadData()
}
}
// MARK: - private methods
extension YHGCBasicInfoFillViewController {
private func initView() {
gk_backStyle = .black
gk_navTitle = "基本资料信息填写"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1
let bottomView = YHBasicInfoFillBottomView()
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(YHBasicInfoFillBottomView.viewH)
}
bottomView.block = { tag in
if tag == 0 {
// 点击了保存按钮
printLog("点击了保存按钮")
self.saveData()
} else {
// 点击了提交按钮
printLog("点击了提交按钮")
self.submitData()
}
}
homeTableView.delegate = self
homeTableView.dataSource = self
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
}
}
private func loadData() {
guard let orderId = orderId else { return }
let param = ["order_id": orderId]
basicInfoVM.getBasicInfo(params: param) { success, error in
if success == true {
self.homeTableView.reloadData()
} else {
YHHUD.flash(message: error?.errorMsg ?? "发生错误,请重试")
self.navigationController?.popViewController(animated: true)
}
self.homeTableView.reloadData()
}
}
private func saveData() {
// 保存
submitAndSaveDataOp(isSaveFlag: true)
}
private func submitData() {
// 提交
// 1.校验
if dataIsOK() == true {
// 提交数据
submitAndSaveDataOp(isSaveFlag: false)
} else {
homeTableView.reloadData()
YHHUD.flash(message: "您还有信息未填写")
}
}
// 检查数据是否合法
private func dataIsOK() -> Bool {
var returnValue: Bool = true
let arr = basicInfoVM.arrBasicInfoSessionDataForEdit
for item in arr {
for (_, item0) in item.arrQuestionItem.enumerated() {
if (item0.answer == "Y" && item0.info.count < 1) || item0.answer == "" {
item0.needCheckFlag = true
returnValue = returnValue && false
}
}
}
return returnValue
}
private func submitAndSaveDataOp(isSaveFlag: Bool) {
// 保存
let arr = basicInfoVM.arrBasicInfoSessionDataForEdit
var param: [String: Any] = ["order_id": orderId as Any, "save_type": isSaveFlag ? "save" : "submit"]
for item in arr {
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: "has_conviction")
} else if index0 == 1 {
let value = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "has_departure")
} 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")
} else {
printLog("其他数据没有处理")
}
}
applicant.updateValue(basicInfoVM.dataModelForBasicInfo?.applicant?.id ?? 0, forKey: "id")
param.updateValue(applicant, forKey: "applicant")
} 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: "child_departure")
} else if index0 == 1 {
let value = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "child_deny")
} else {
printLog("其他数据没有处理")
}
}
applicant.updateValue(basicInfoVM.dataModelForBasicInfo?.spouse?.id ?? 0, forKey: "id")
applicant.updateValue(basicInfoVM.dataModelForBasicInfo?.spouse?.subset_name ?? 0, forKey: "subset_name")
param.updateValue(applicant, forKey: "spouse")
} else if item.sessionTitle.hasPrefix("子女") {
var arr: [[String: Any]] = []
if let tArr = param["child"] as? [[String: Any]] {
arr = tArr
}
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: "child_departure")
} else if index0 == 1 {
let value = ["has": item0.answer, "info": item0.answer == "Y" ? item0.info : ""]
applicant.updateValue(value, forKey: "child_deny")
} else {
printLog("其他数据没有处理")
}
}
applicant.updateValue(item.model?.id ?? 0, forKey: "id")
applicant.updateValue(item.model?.subset_name ?? "", forKey: "subset_name")
arr.append(applicant)
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 {
}
}
printLog(param)
basicInfoVM.saveBasicInfo(params: param) { [weak self] success, error in
if success == true {
let title = isSaveFlag ? "保存成功" : "提交成功"
YHHUD.flash(message: title)
if isSaveFlag == false {
self?.navigationController?.popViewController(animated: true)
}
} else {
let title = isSaveFlag ? "保存失败" : "提交失败"
let msg = error?.errorMsg ?? title
YHHUD.flash(message: msg)
}
}
}
}
// MARK: - delegates
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCBasicInfoFillViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return basicInfoVM.arrBasicInfoSessionDataForEdit.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 15
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.bounds.width, height: 15))
view.backgroundColor = .clear
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHBasicInfoFillCell.self)
cell.dataModel = basicInfoVM.arrBasicInfoSessionDataForEdit[indexPath.section]
cell.indexPath = indexPath
cell.block = { indexPath in
if let indexPath = indexPath {
tableView.reloadRows(at: [indexPath], with: .none)
}
}
return cell
}
}
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