Commit 06e0f159 authored by Steven杜宇's avatar Steven杜宇

// 覆盖高才文件夹

parent f193870a
...@@ -116,6 +116,17 @@ ...@@ -116,6 +116,17 @@
04564D7E2CF8D03D004456E4 /* YHFloatingWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D7D2CF8D03D004456E4 /* YHFloatingWindow.swift */; }; 04564D7E2CF8D03D004456E4 /* YHFloatingWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D7D2CF8D03D004456E4 /* YHFloatingWindow.swift */; };
04564D802CF8E16C004456E4 /* YHPlayerTransitionAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D7F2CF8E16C004456E4 /* YHPlayerTransitionAnimator.swift */; }; 04564D802CF8E16C004456E4 /* YHPlayerTransitionAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04564D7F2CF8E16C004456E4 /* YHPlayerTransitionAnimator.swift */; };
045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */; }; 045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */; };
045C09C02D12C2A800BD2DC0 /* YHGCApplicationTypeResponseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09AC2D12C2A800BD2DC0 /* YHGCApplicationTypeResponseModel.swift */; };
045C09C12D12C2A800BD2DC0 /* YHGCApplicationTypeResultController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09A72D12C2A800BD2DC0 /* YHGCApplicationTypeResultController.swift */; };
045C09C22D12C2A800BD2DC0 /* YHGCApplicationTypeSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09AE2D12C2A800BD2DC0 /* YHGCApplicationTypeSelectCell.swift */; };
045C09C32D12C2A800BD2DC0 /* YHGCApplicationTypeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09B02D12C2A800BD2DC0 /* YHGCApplicationTypeViewModel.swift */; };
045C09C42D12C2A800BD2DC0 /* YHGCApplicationTypeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09A62D12C2A800BD2DC0 /* YHGCApplicationTypeController.swift */; };
045C09C52D12C2A800BD2DC0 /* YHGCApplicationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09AB2D12C2A800BD2DC0 /* YHGCApplicationType.swift */; };
045C09C62D12C2A800BD2DC0 /* YHGCVisaProgramPopVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09A82D12C2A800BD2DC0 /* YHGCVisaProgramPopVC.swift */; };
045C09C72D12C2A800BD2DC0 /* YHGCBasicInfoFillViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09B32D12C2A800BD2DC0 /* YHGCBasicInfoFillViewController.swift */; };
045C09C82D12C2A800BD2DC0 /* YHGCApplicationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09AA2D12C2A800BD2DC0 /* YHGCApplicationModel.swift */; };
045C09C92D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */; };
045C09CA2D12C2A800BD2DC0 /* YHGCSchemeTableHeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045C09A32D12C2A800BD2DC0 /* YHGCSchemeTableHeadView.swift */; };
045F28402CF5ED3400520F19 /* YHAITabBarItemContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F283F2CF5ED3400520F19 /* YHAITabBarItemContentView.swift */; }; 045F28402CF5ED3400520F19 /* YHAITabBarItemContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045F283F2CF5ED3400520F19 /* YHAITabBarItemContentView.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; }; 0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */; }; 0468D4262B495A5400CFB916 /* YHPickPhoneAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */; };
...@@ -1238,6 +1249,17 @@ ...@@ -1238,6 +1249,17 @@
04564D7D2CF8D03D004456E4 /* YHFloatingWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFloatingWindow.swift; sourceTree = "<group>"; }; 04564D7D2CF8D03D004456E4 /* YHFloatingWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFloatingWindow.swift; sourceTree = "<group>"; };
04564D7F2CF8E16C004456E4 /* YHPlayerTransitionAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlayerTransitionAnimator.swift; sourceTree = "<group>"; }; 04564D7F2CF8E16C004456E4 /* YHPlayerTransitionAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlayerTransitionAnimator.swift; sourceTree = "<group>"; };
045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginOneLeadView.swift; sourceTree = "<group>"; }; 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginOneLeadView.swift; sourceTree = "<group>"; };
045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMineSchemeViewController.swift; sourceTree = "<group>"; };
045C09A32D12C2A800BD2DC0 /* YHGCSchemeTableHeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSchemeTableHeadView.swift; sourceTree = "<group>"; };
045C09A62D12C2A800BD2DC0 /* YHGCApplicationTypeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeController.swift; sourceTree = "<group>"; };
045C09A72D12C2A800BD2DC0 /* YHGCApplicationTypeResultController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeResultController.swift; sourceTree = "<group>"; };
045C09A82D12C2A800BD2DC0 /* YHGCVisaProgramPopVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCVisaProgramPopVC.swift; sourceTree = "<group>"; };
045C09AA2D12C2A800BD2DC0 /* YHGCApplicationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationModel.swift; sourceTree = "<group>"; };
045C09AB2D12C2A800BD2DC0 /* YHGCApplicationType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationType.swift; sourceTree = "<group>"; };
045C09AC2D12C2A800BD2DC0 /* YHGCApplicationTypeResponseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeResponseModel.swift; sourceTree = "<group>"; };
045C09AE2D12C2A800BD2DC0 /* YHGCApplicationTypeSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeSelectCell.swift; sourceTree = "<group>"; };
045C09B02D12C2A800BD2DC0 /* YHGCApplicationTypeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCApplicationTypeViewModel.swift; sourceTree = "<group>"; };
045C09B32D12C2A800BD2DC0 /* YHGCBasicInfoFillViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCBasicInfoFillViewController.swift; sourceTree = "<group>"; };
045F283F2CF5ED3400520F19 /* YHAITabBarItemContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAITabBarItemContentView.swift; sourceTree = "<group>"; }; 045F283F2CF5ED3400520F19 /* YHAITabBarItemContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAITabBarItemContentView.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; }; 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPickPhoneAddressViewController.swift; sourceTree = "<group>"; }; 0468D4252B495A5400CFB916 /* YHPickPhoneAddressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPickPhoneAddressViewController.swift; sourceTree = "<group>"; };
...@@ -2676,6 +2698,176 @@ ...@@ -2676,6 +2698,176 @@
path = VM; path = VM;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
045C09A22D12C2A800BD2DC0 /* C */ = {
isa = PBXGroup;
children = (
045C09A12D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
045C09A42D12C2A800BD2DC0 /* V */ = {
isa = PBXGroup;
children = (
045C09A32D12C2A800BD2DC0 /* YHGCSchemeTableHeadView.swift */,
);
path = V;
sourceTree = "<group>";
};
045C09A52D12C2A800BD2DC0 /* MyScheme(我的方案) */ = {
isa = PBXGroup;
children = (
045C09A22D12C2A800BD2DC0 /* C */,
045C09A42D12C2A800BD2DC0 /* V */,
);
path = "MyScheme(我的方案)";
sourceTree = "<group>";
};
045C09A92D12C2A800BD2DC0 /* C */ = {
isa = PBXGroup;
children = (
045C09A62D12C2A800BD2DC0 /* YHGCApplicationTypeController.swift */,
045C09A72D12C2A800BD2DC0 /* YHGCApplicationTypeResultController.swift */,
045C09A82D12C2A800BD2DC0 /* YHGCVisaProgramPopVC.swift */,
);
path = C;
sourceTree = "<group>";
};
045C09AD2D12C2A800BD2DC0 /* M */ = {
isa = PBXGroup;
children = (
045C09AA2D12C2A800BD2DC0 /* YHGCApplicationModel.swift */,
045C09AB2D12C2A800BD2DC0 /* YHGCApplicationType.swift */,
045C09AC2D12C2A800BD2DC0 /* YHGCApplicationTypeResponseModel.swift */,
);
path = M;
sourceTree = "<group>";
};
045C09AF2D12C2A800BD2DC0 /* V */ = {
isa = PBXGroup;
children = (
045C09AE2D12C2A800BD2DC0 /* YHGCApplicationTypeSelectCell.swift */,
);
path = V;
sourceTree = "<group>";
};
045C09B12D12C2A800BD2DC0 /* VM */ = {
isa = PBXGroup;
children = (
045C09B02D12C2A800BD2DC0 /* YHGCApplicationTypeViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
045C09B22D12C2A800BD2DC0 /* ApplicationType(申请类别) */ = {
isa = PBXGroup;
children = (
045C09A92D12C2A800BD2DC0 /* C */,
045C09AD2D12C2A800BD2DC0 /* M */,
045C09AF2D12C2A800BD2DC0 /* V */,
045C09B12D12C2A800BD2DC0 /* VM */,
);
path = "ApplicationType(申请类别)";
sourceTree = "<group>";
};
045C09B42D12C2A800BD2DC0 /* C */ = {
isa = PBXGroup;
children = (
045C09B32D12C2A800BD2DC0 /* YHGCBasicInfoFillViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
045C09B52D12C2A800BD2DC0 /* BaseInformation(基本资料) */ = {
isa = PBXGroup;
children = (
045C09B42D12C2A800BD2DC0 /* C */,
);
path = "BaseInformation(基本资料)";
sourceTree = "<group>";
};
045C09B62D12C2A800BD2DC0 /* C */ = {
isa = PBXGroup;
children = (
);
path = C;
sourceTree = "<group>";
};
045C09B72D12C2A800BD2DC0 /* V */ = {
isa = PBXGroup;
children = (
);
path = V;
sourceTree = "<group>";
};
045C09B82D12C2A800BD2DC0 /* Education&Qualification(学历专业资格填写) */ = {
isa = PBXGroup;
children = (
045C09B62D12C2A800BD2DC0 /* C */,
045C09B72D12C2A800BD2DC0 /* V */,
);
path = "Education&Qualification(学历专业资格填写)";
sourceTree = "<group>";
};
045C09B92D12C2A800BD2DC0 /* Certificates(证书上传和证书信息) */ = {
isa = PBXGroup;
children = (
);
path = "Certificates(证书上传和证书信息)";
sourceTree = "<group>";
};
045C09BA2D12C2A800BD2DC0 /* Child(子女) */ = {
isa = PBXGroup;
children = (
);
path = "Child(子女)";
sourceTree = "<group>";
};
045C09BB2D12C2A800BD2DC0 /* Spouse(配偶) */ = {
isa = PBXGroup;
children = (
);
path = "Spouse(配偶)";
sourceTree = "<group>";
};
045C09BC2D12C2A800BD2DC0 /* C */ = {
isa = PBXGroup;
children = (
045C09B92D12C2A800BD2DC0 /* Certificates(证书上传和证书信息) */,
045C09BA2D12C2A800BD2DC0 /* Child(子女) */,
045C09BB2D12C2A800BD2DC0 /* Spouse(配偶) */,
);
path = C;
sourceTree = "<group>";
};
045C09BD2D12C2A800BD2DC0 /* FamilyMember(家庭成员信息表) */ = {
isa = PBXGroup;
children = (
045C09BC2D12C2A800BD2DC0 /* C */,
);
path = "FamilyMember(家庭成员信息表)";
sourceTree = "<group>";
};
045C09BE2D12C2A800BD2DC0 /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup;
children = (
045C09B22D12C2A800BD2DC0 /* ApplicationType(申请类别) */,
045C09B52D12C2A800BD2DC0 /* BaseInformation(基本资料) */,
045C09B82D12C2A800BD2DC0 /* Education&Qualification(学历专业资格填写) */,
045C09BD2D12C2A800BD2DC0 /* FamilyMember(家庭成员信息表) */,
);
path = "ServiceProcess(我的信息流程)";
sourceTree = "<group>";
};
045C09BF2D12C2A800BD2DC0 /* TTPS(高才) */ = {
isa = PBXGroup;
children = (
045C09A52D12C2A800BD2DC0 /* MyScheme(我的方案) */,
045C09BE2D12C2A800BD2DC0 /* ServiceProcess(我的信息流程) */,
);
path = "TTPS(高才)";
sourceTree = "<group>";
};
0468D4292B55017400CFB916 /* Analytics */ = { 0468D4292B55017400CFB916 /* Analytics */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -2864,6 +3056,7 @@ ...@@ -2864,6 +3056,7 @@
04806D732D129CE50021A44F /* IntelligentService(服务中心) */ = { 04806D732D129CE50021A44F /* IntelligentService(服务中心) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
045C09BF2D12C2A800BD2DC0 /* TTPS(高才) */,
04807F062D12B2750021A44F /* QMAS(优才) */, 04807F062D12B2750021A44F /* QMAS(优才) */,
048069FC2D129CE50021A44F /* OrderList(服务订单) */, 048069FC2D129CE50021A44F /* OrderList(服务订单) */,
); );
...@@ -6919,6 +7112,17 @@ ...@@ -6919,6 +7112,17 @@
A567E5922BD7643D00D5D5A0 /* YHHomeWebViewModel.swift in Sources */, A567E5922BD7643D00D5D5A0 /* YHHomeWebViewModel.swift in Sources */,
A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */, A5ACE93F2B4564F7002C94D2 /* UIViewController+Extension.swift in Sources */,
04564D612CF59835004456E4 /* YHMessageInputViewController.swift in Sources */, 04564D612CF59835004456E4 /* YHMessageInputViewController.swift in Sources */,
045C09C02D12C2A800BD2DC0 /* YHGCApplicationTypeResponseModel.swift in Sources */,
045C09C12D12C2A800BD2DC0 /* YHGCApplicationTypeResultController.swift in Sources */,
045C09C22D12C2A800BD2DC0 /* YHGCApplicationTypeSelectCell.swift in Sources */,
045C09C32D12C2A800BD2DC0 /* YHGCApplicationTypeViewModel.swift in Sources */,
045C09C42D12C2A800BD2DC0 /* YHGCApplicationTypeController.swift in Sources */,
045C09C52D12C2A800BD2DC0 /* YHGCApplicationType.swift in Sources */,
045C09C62D12C2A800BD2DC0 /* YHGCVisaProgramPopVC.swift in Sources */,
045C09C72D12C2A800BD2DC0 /* YHGCBasicInfoFillViewController.swift in Sources */,
045C09C82D12C2A800BD2DC0 /* YHGCApplicationModel.swift in Sources */,
045C09C92D12C2A800BD2DC0 /* YHGCMineSchemeViewController.swift in Sources */,
045C09CA2D12C2A800BD2DC0 /* YHGCSchemeTableHeadView.swift in Sources */,
A567E5B22BD7643D00D5D5A0 /* YHHomeBannerCollectionViewCell.swift in Sources */, A567E5B22BD7643D00D5D5A0 /* YHHomeBannerCollectionViewCell.swift in Sources */,
A59B43C92C491FB100B28379 /* YHH5WebViewVC.swift in Sources */, A59B43C92C491FB100B28379 /* YHH5WebViewVC.swift in Sources */,
0488518F2BF5FD1500C4E32D /* YHOSSManager.swift in Sources */, 0488518F2BF5FD1500C4E32D /* YHOSSManager.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: YHGCSchemeTableHeadView = {
let headView = YHGCSchemeTableHeadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 422))
headView.update(type: .typeA, name: "--")
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) { [weak self] success, error in
guard let self = self else {
return
}
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.update(type: .typeA, name: model.username.defaultStringIfEmpty())
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
}
} else {
printLog("error : orderID 为空")
}
}
}
//
// YHGCSchemeTableHeadView.swift
// galaxy
//
// Created by alexzzw on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import AttributedString
import UIKit
class YHGCSchemeTableHeadView: UIView {
private lazy var centerImageView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "gc_scheme_head_bg")
return view
}()
private lazy var centerView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
private lazy var leftImageView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "scheme_head_left")
return view
}()
private lazy var rightImageView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "scheme_head_right")
return view
}()
private lazy var nameLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 24)
label.textColor = UIColor(hex: 0xFFFFFF)
label.textAlignment = .center
label.lineBreakMode = .byTruncatingMiddle
label.text = "尊敬的--"
return label
}()
private lazy var messageLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor(hex: 0xFFFFFF)
label.textAlignment = .center
label.numberOfLines = 0
label.text = "您好,如电话沟通,这是我们为您定制的申请方案,方案详情如下:"
return label
}()
private lazy var logoImageView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "scheme_head_logo")
return view
}()
private lazy var titleView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xD48638)
return view
}()
private lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "申请方案"
return label
}()
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 6, corner: .allCorners)
view.backgroundColor = UIColor(hex: 0xCF9764, alpha: 0.12)
return view
}()
private lazy var applicationTypeLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "申请类型:"
return label
}()
private lazy var applicationTypeResultLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 24)
label.textColor = UIColor(hex: 0xD48638)
label.text = "--"
return label
}()
private lazy var dotView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hexString: "#F2DABF")
view.layer.cornerRadius = 1.0
view.clipsToBounds = true
return view
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "--"
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
return label
}()
private lazy var dashLineView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "scheme_line_image")
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(hex: 0x070E33)
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func update(type: YHGCApplicationType, name: String) {
applicationTypeResultLabel.text = type.titleString
infoDetailLabel.attributed.text = type.attributedTips()
nameLabel.text = name
}
private func setUpView() {
addSubview(centerImageView)
addSubview(centerView)
addSubview(leftImageView)
addSubview(rightImageView)
addSubview(nameLabel)
addSubview(messageLabel)
addSubview(logoImageView)
addSubview(titleView)
addSubview(titleLabel)
addSubview(subContainerView)
subContainerView.addSubview(applicationTypeLabel)
subContainerView.addSubview(applicationTypeResultLabel)
addSubview(dotView)
addSubview(infoDetailLabel)
addSubview(dashLineView)
centerImageView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(416)
}
centerView.snp.makeConstraints { make in
make.left.equalTo(8)
make.right.equalTo(-8)
make.top.equalTo(416)
make.bottom.equalToSuperview()
}
leftImageView.snp.makeConstraints { make in
make.left.equalTo(35)
make.height.equalTo(80)
make.width.equalTo(65)
make.top.equalTo(27)
}
rightImageView.snp.makeConstraints { make in
make.right.equalTo(-35)
make.height.equalTo(80)
make.width.equalTo(65)
make.top.equalTo(27)
}
nameLabel.snp.makeConstraints { make in
make.right.equalTo(-75)
make.height.equalTo(33.5)
make.left.equalTo(75)
make.top.equalTo(26)
}
messageLabel.snp.makeConstraints { make in
make.right.equalTo(-75)
make.height.equalTo(43)
make.left.equalTo(75)
make.top.equalTo(65.5)
}
logoImageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.height.equalTo(22)
make.width.equalTo(58.5)
make.top.equalTo(147)
}
titleView.snp.makeConstraints { make in
make.left.equalTo(28)
make.top.equalTo(238.5)
make.height.equalTo(16.5)
make.width.equalTo(3.5)
}
titleLabel.snp.makeConstraints { make in
make.centerY.equalTo(titleView.snp.centerY)
make.left.equalTo(titleView.snp.right).offset(4)
make.height.equalTo(24)
make.width.equalTo(150)
}
subContainerView.snp.makeConstraints { make in
make.left.equalTo(titleView.snp.left)
make.top.equalTo(titleLabel.snp.bottom).offset(18)
make.right.equalToSuperview().offset(-28)
make.height.equalTo(64)
}
applicationTypeLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.centerY.equalToSuperview()
}
applicationTypeResultLabel.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview()
make.left.greaterThanOrEqualTo(applicationTypeLabel.snp.right).offset(10)
}
infoDetailLabel.snp.makeConstraints { make in
make.left.equalTo(subContainerView.snp.left).offset(11)
make.top.equalTo(subContainerView.snp.bottom).offset(13)
make.right.lessThanOrEqualToSuperview().offset(-28)
}
dotView.snp.makeConstraints { make in
make.right.equalTo(infoDetailLabel.snp.left).offset(-4)
make.top.equalTo(infoDetailLabel.snp.top).offset(8)
make.width.height.equalTo(3)
}
dashLineView.snp.makeConstraints { make in
make.left.equalTo(subContainerView.snp.left)
make.right.equalTo(subContainerView.snp.right)
make.top.equalTo(infoDetailLabel.snp.bottom).offset(28)
make.height.equalTo(1)
}
}
}
private extension YHGCApplicationType {
func attributedTips() -> ASAttributedString {
switch self {
case .typeA:
let attr1: ASAttributedString = .init(string: "根据评估,您近12个月的税前收入超过", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let attr2: ASAttributedString = .init(string: "250万港元", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor(hexString: "#D48638") ?? .brown))
let attr3: ASAttributedString = .init(string: ",符合", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let attr4: ASAttributedString = .init(string: "高才A类", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor(hexString: "#D48638") ?? .brown))
let attr5: ASAttributedString = .init(string: "申请资格。", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
return attr1 + attr2 + attr3 + attr4 + attr5
case .typeB:
let attr1: ASAttributedString = .init(string: "根据评估,您已取得", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let attr2: ASAttributedString = .init(string: "合资格高校学士学位", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor(hexString: "#D48638") ?? .brown))
let attr3: ASAttributedString = .init(string: ",符合", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let attr4: ASAttributedString = .init(string: "高才B类", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor(hexString: "#D48638") ?? .brown))
let attr5: ASAttributedString = .init(string: "申请资格。", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
return attr1 + attr2 + attr3 + attr4 + attr5
case .typeC:
let attr1: ASAttributedString = .init(string: "根据评估,您已取得", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let attr2: ASAttributedString = .init(string: "合资格高校学士学位", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor(hexString: "#D48638") ?? .brown))
let attr3: ASAttributedString = .init(string: ",符合", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let attr4: ASAttributedString = .init(string: "高才C类", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor(hexString: "#D48638") ?? .brown))
let attr5: ASAttributedString = .init(string: "申请资格。", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
return attr1 + attr2 + attr3 + attr4 + attr5
}
}
}
//
// YHGCApplicationTypeController.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeController: YHBaseViewController {
private lazy var datas: [[YHGCApplicationModel]] = {
let typeA = YHGCApplicationModel(type: .typeA, isSelected: false)
let typeB = YHGCApplicationModel(type: .typeB, isSelected: false)
let typeC = YHGCApplicationModel(type: .typeC, isSelected: false)
return [[typeA], [typeB], [typeC]]
}()
private lazy var headerView: UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 104))
let label = UILabel()
label.text = "您好,请选择申请类别"
label.textColor = .mainTextColor
label.font = .PFSC_M(ofSize: 21)
view.addSubview(label)
label.snp.makeConstraints { make in
make.top.equalToSuperview().offset(32)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-10)
}
return view
}()
private lazy var tableView: UITableView = {
let view = UITableView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight), style: .grouped)
view.estimatedSectionHeaderHeight = 0.01
view.estimatedSectionFooterHeight = 20
view.sectionHeaderHeight = 0.01
view.sectionFooterHeight = 20
view.contentInsetAdjustmentBehavior = .never
view.backgroundColor = .clear
view.separatorStyle = .none
view.rowHeight = UITableView.automaticDimension
view.estimatedRowHeight = 148.0
view.dataSource = self
view.delegate = self
view.showsVerticalScrollIndicator = false
view.register(YHGCApplicationTypeSelectCell.self, forCellReuseIdentifier: YHGCApplicationTypeSelectCell.cellReuseIdentifier)
return view
}()
private lazy var bgIcon: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "gc_application_type_bg")
return view
}()
private lazy var submitButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.setTitle("提交", for: .normal)
button.setTitle("提交", for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .highlighted)
button.addTarget(self, action: #selector(clickSubmitButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
private lazy var viewModel = YHGCApplicationTypeViewModel()
private var didAppear: Bool = false
private let orderId: Int
init(orderId: Int) {
self.orderId = orderId
super.init(nibName: nil, bundle: nil)
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if !didAppear {
didAppear.toggle()
requestData(isNeedLoading: true)
} else {
requestData(isNeedLoading: false)
}
}
}
extension YHGCApplicationTypeController {
@objc private func clickSubmitButton() {
guard let model = datas.flatMap({ $0 }).first(where: { model in
model.isSelected == true
}) else {
YHHUD.flash(message: "请选择申请类别")
return
}
YHCommonAlertView.show("", "确定是否提交申请类别?提交后将不能修改", "取消", "确认", fullGuestureEnable: false) {
//
} callBack: { [weak self] in
guard let self = self else {
return
}
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.submitApplyType(orderId, model.type.rawValue) { [weak self] success, error in
guard let self = self else {
return
}
YHHUD.hide()
if success {
YHHUD.flash(message: "提交成功")
//self.requestData(isNeedLoading: false)
self.gotoResultPage(model)
} else {
var errorMsg = "提交失败"
if let error = error, error.errorMsg.count > 0 {
errorMsg = error.errorMsg
}
YHHUD.flash(message: errorMsg)
}
}
}
}
private func gotoResultPage(_ model: YHGCApplicationModel) {
if let navigationController = self.navigationController {
let ctl = YHGCApplicationTypeResultController(type: model.type)
var viewControllers = navigationController.viewControllers
viewControllers.removeLast()
viewControllers.append(ctl)
navigationController.setViewControllers(viewControllers, animated: true)
}
}
private func setupUI() {
gk_navTitle = "申请类别"
gk_navBarAlpha = 0
gk_navigationBar.backgroundColor = .clear
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(bgIcon)
view.addSubview(tableView)
view.addSubview(bottomView)
bottomView.addSubview(submitButton)
let ratio = 318.0 / 375.0
bgIcon.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(bgIcon.snp.width).multipliedBy(ratio)
}
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-66)
}
submitButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(kMargin)
make.right.equalToSuperview().offset(-kMargin)
make.top.equalToSuperview().offset(8)
make.height.equalTo(48)
}
tableView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
}
tableView.tableHeaderView = headerView
}
private func requestData(isNeedLoading: Bool = false) {
if isNeedLoading {
YHHUD.show(.progress(message: "加载中..."))
}
viewModel.getApplyType(orderId: orderId) { [weak self] model, error in
guard let self = self else {
return
}
if isNeedLoading {
YHHUD.hide()
}
guard let model = model else {
printLog("YHGCApplicationTypeController: 请求失败")
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg)
}
return
}
self.datas.flatMap { $0 }.forEach {
if $0.type.rawValue == model.apply_type {
$0.isSelected = true
} else {
$0.isSelected = false
}
}
self.tableView.reloadData()
}
}
private func showPopVC(type: YHGCApplicationType) {
let vc = YHGCVisaProgramPopVC(type: type)
let pc = YHBottomPresentationController(presentedViewController: vc, presenting: self)
pc.customRadius = 8.0
vc.transitioningDelegate = pc
vc.sureButtonEvent = { [weak vc] in
vc?.dismiss(animated: true)
}
present(vc, animated: true, completion: nil)
}
}
extension YHGCApplicationTypeController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return datas.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard datas.count > section else {
return 0
}
return datas[section].count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.section else {
return UITableViewCell()
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return UITableViewCell()
}
let model = sectionArr[indexPath.row]
if let cell = tableView.dequeueReusableCell(withIdentifier: YHGCApplicationTypeSelectCell.cellReuseIdentifier) as? YHGCApplicationTypeSelectCell {
cell.setupCellInfo(type: model.type, isCurrentSelected: model.isSelected)
cell.actionBtnEvent = { [weak self] in
self?.showPopVC(type: model.type)
}
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 148.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard datas.count > indexPath.section else {
return
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return
}
tableView.deselectRow(at: indexPath, animated: true)
let model = sectionArr[indexPath.row]
model.isSelected.toggle()
datas.flatMap { $0 }.forEach {
if $0.type != model.type, $0.isSelected {
$0.isSelected = false
}
}
tableView.reloadData()
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 0.01
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 20
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
}
//
// YHGCApplicationTypeResultController.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeResultController: YHBaseViewController {
private lazy var bgIcon: UIImageView = {
let view = UIImageView()
return view
}()
private lazy var backButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.setTitle("返回", for: .normal)
button.setTitle("返回", for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .highlighted)
button.addTarget(self, action: #selector(clickBackButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var headerLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.font = .PFSC_M(ofSize: 21)
label.text = "您已选定高才申请类型"
return label
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#6D788A")
label.font = .PFSC_R(ofSize: 13)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 3
return label
}()
private lazy var barView: UIView = {
let view = UIView()
return view
}()
private lazy var actionBtn: UIButton = {
let button = UIButton(type: .custom)
button.setTitle("申请标准", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.setImage(UIImage(named: "right_arrow_black_20"), for: .normal)
button.addTarget(self, action: #selector(actionBtnClicked), for: .touchUpInside)
return button
}()
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 6, corner: .allCorners)
view.backgroundColor = .white
return view
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
var backButtonEvent: (() -> Void)?
private let type: YHGCApplicationType
init(type: YHGCApplicationType) {
self.type = type
super.init(nibName: nil, bundle: nil)
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
}
extension YHGCApplicationTypeResultController {
@objc private func actionBtnClicked() {
showPopVC(type: type)
}
@objc private func clickBackButton() {
backButtonEvent?()
navigationController?.popViewController(animated: true)
}
private func setupUI() {
gk_navTitle = "申请类别"
gk_navBarAlpha = 0
gk_navigationBar.backgroundColor = .clear
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(bgIcon)
view.addSubview(headerLabel)
view.addSubview(bottomView)
bottomView.addSubview(backButton)
view.addSubview(subContainerView)
subContainerView.addSubview(barView)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(actionBtn)
let ratio = 318.0 / 375.0
bgIcon.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(bgIcon.snp.width).multipliedBy(ratio)
}
headerLabel.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 42)
make.left.equalToSuperview().offset(20)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
subContainerView.snp.makeConstraints { make in
make.top.equalTo(headerLabel.snp.bottom).offset(50)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.height.equalTo(148)
}
barView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(3)
make.height.equalTo(108)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(barView.snp.right).offset(20)
make.top.equalTo(barView.snp.top)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
infoDetailLabel.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
actionBtn.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.greaterThanOrEqualTo(infoDetailLabel.snp.bottom).offset(0).priority(.high)
make.bottom.equalTo(barView.snp.bottom)
}
actionBtn.iconInRight(with: 0)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-66)
}
backButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(kMargin)
make.right.equalToSuperview().offset(-kMargin)
make.top.equalToSuperview().offset(8)
make.height.equalTo(48)
}
bgIcon.image = UIImage(named: type.bgIconTitle())
infoTitleLabel.text = type.titleString
infoDetailLabel.text = type.detailString
barView.backgroundColor = type.barColor()
}
private func showPopVC(type: YHGCApplicationType) {
let vc = YHGCVisaProgramPopVC(type: type)
let pc = YHBottomPresentationController(presentedViewController: vc, presenting: self)
pc.customRadius = 8.0
vc.transitioningDelegate = pc
vc.sureButtonEvent = { [weak vc] in
vc?.dismiss(animated: true)
}
present(vc, animated: true, completion: nil)
}
}
private extension YHGCApplicationType {
func bgIconTitle() -> String {
switch self {
case .typeA:
return "gc_application_type_bg_a"
case .typeB:
return "gc_application_type_bg_b"
case .typeC:
return "gc_application_type_bg_c"
}
}
func barColor() -> UIColor? {
switch self {
case .typeA:
return UIColor(hexString: "#EEDBBD")
case .typeB:
return UIColor(hexString: "#BFCDEF")
case .typeC:
return UIColor(hexString: "#BBE1F2")
}
}
}
//
// YHGCVisaProgramPopVC.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHGCVisaProgramPopVC: YHBaseViewController {
private lazy var topProgramIcon: UIImageView = {
let view = UIImageView()
return view
}()
private lazy var sureButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.setTitle("我已知悉,确认", for: .normal)
button.setTitle("我已知悉,确认", for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .highlighted)
button.addTarget(self, action: #selector(clickSureButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.font = .PFSC_R(ofSize: 14)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 0
return label
}()
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 6, corner: .allCorners)
view.backgroundColor = .contentBkgColor
return view
}()
private lazy var infoMarkLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#6D788A")
label.font = .PFSC_R(ofSize: 14)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 0
return label
}()
var sureButtonEvent: (() -> Void)?
private let type: YHGCApplicationType
init(type: YHGCApplicationType) {
self.type = type
super.init(nibName: nil, bundle: nil)
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
}
extension YHGCVisaProgramPopVC {
@objc private func clickSureButton() {
sureButtonEvent?()
}
private func setupUI() {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = UIColor.white
view.addSubview(topProgramIcon)
view.addSubview(sureButton)
view.addSubview(infoDetailLabel)
view.addSubview(subContainerView)
subContainerView.addSubview(infoMarkLabel)
let ratio = 143.0 / 375.0
topProgramIcon.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(topProgramIcon.snp.width).multipliedBy(ratio)
}
let widthRatio = KScreenWidth / 375.0
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(124.0 * widthRatio)
make.left.equalToSuperview().offset(20 * widthRatio)
make.right.equalToSuperview().offset(-20 * widthRatio)
}
subContainerView.snp.makeConstraints { make in
make.top.equalTo(infoDetailLabel.snp.bottom).offset(20.0 * widthRatio)
make.left.equalToSuperview().offset(20 * widthRatio)
make.right.equalToSuperview().offset(-20 * widthRatio)
}
infoMarkLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16.0 * widthRatio)
make.left.equalToSuperview().offset(16 * widthRatio)
make.right.equalToSuperview().offset(-16 * widthRatio)
make.bottom.equalToSuperview().offset(-16.0 * widthRatio)
}
sureButton.snp.makeConstraints { make in
make.top.greaterThanOrEqualTo(subContainerView.snp.bottom).offset(10)
make.left.equalToSuperview().offset(kMargin * widthRatio)
make.right.equalToSuperview().offset(-kMargin * widthRatio)
make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-10 * widthRatio)
make.height.equalTo(48)
}
topProgramIcon.image = UIImage(named: type.programIconTitle())
infoDetailLabel.text = type.detailText()
infoMarkLabel.attributed.text = type.attributedTips()
preferredContentSize = CGSize(width: KScreenWidth, height: 452 * widthRatio)
}
}
private extension YHGCApplicationType {
func programIconTitle() -> String {
switch self {
case .typeA:
return "gc_visa_program_a"
case .typeB:
return "gc_visa_program_b"
case .typeC:
return "gc_visa_program_c"
}
}
func detailText() -> String {
switch self {
case .typeA:
return "在紧接申请前一年,全年收入达港币250万元或以上(或等值外币) 的人士"
case .typeB:
return "4个指定榜单中的世界百强大学的学士学位毕业生(以入境处内置榜单为准),且过去5年累积有不低于3年的工作经验"
case .typeC:
return "过去5年在4个指定榜单中的世界百强大学取得学士学位(以入境处内置榜单为准),但累积工作经验不足3年"
}
}
func attributedTips() -> ASAttributedString {
switch self {
case .typeA:
let attr1: ASAttributedString = .init(string: "注:必须是", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
let attr2: ASAttributedString = .init(string: "课税收入", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor))
let attr3: ASAttributedString = .init(string: ",享受税收优惠、免税的收入,不计算在内", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
return attr1 + attr2 + attr3
case .typeB:
let attr1: ASAttributedString = .init(string: "注:必须是", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
let attr2: ASAttributedString = .init(string: "紧接申请", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor))
let attr3: ASAttributedString = .init(string: "的前五年,累积工作经验不低于三年", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
return attr1 + attr2 + attr3
case .typeC:
let attr1: ASAttributedString = .init(string: "注:", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
let attr2: ASAttributedString = .init(string: "不适用于", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor))
let attr3: ASAttributedString = .init(string: "在港修读全日制经本地评审课程而获得学士学位的非本地生", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
return attr1 + attr2 + attr3
}
}
}
//
// YHGCApplicationModel.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
class YHGCApplicationModel {
var type: YHGCApplicationType = .typeA
var isSelected: Bool = false
init(type: YHGCApplicationType, isSelected: Bool) {
self.type = type
self.isSelected = isSelected
}
}
//
// YHGCApplicationType.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
enum YHGCApplicationType: Int {
case typeA = 1
case typeB = 2
case typeC = 3
var titleString: String {
switch self {
case .typeA:
return "高才A类申请"
case .typeB:
return "高才B类申请"
case .typeC:
return "高才C类申请"
}
}
var detailString: String {
switch self {
case .typeA:
return "近一年度纳税收入250万港元及以上人士"
case .typeB:
return "百强大学毕业,且近5年累积工作经验时长不低于3年人士"
case .typeC:
return "百强大学毕业不足5年,且工作经验时长不足3年人士"
}
}
}
//
// YHGCApplicationTypeResponseModel.swift
// galaxy
//
// Created by alexzzw on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHGCApplicationTypeResponseModel: SmartCodable {
var apply_type: Int = -1
required init() {
}
}
//
// YHGCApplicationTypeSelectCell.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeSelectCell: UITableViewCell {
static let cellReuseIdentifier = "YHGCApplicationTypeSelectCell"
private let selectedBorderColor: UIColor = .brandMainColor
var actionBtnEvent: (() -> Void)?
var isCurrentSelected: Bool = false {
didSet {
guard isCurrentSelected != oldValue else {
return
}
selectIconView.image = isCurrentSelected ? UIImage(named: "gc_application_type_selected"): UIImage(named: "gc_application_type_unselected")
subContainerView.lineWidth = isCurrentSelected ? 1 : nil
subContainerView.lineColor = isCurrentSelected ? selectedBorderColor.cgColor : nil
}
}
private lazy var subContainerView: YHBaseCornerRadiusBorderView = {
let view = YHBaseCornerRadiusBorderView(cornerRadius: 6, corner: .allCorners, lineWidth: nil, lineColor: nil)
view.backgroundColor = .white
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#6D788A")
label.font = .PFSC_R(ofSize: 13)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 3
return label
}()
private lazy var iconView: UIImageView = {
let imageView = UIImageView()
return imageView
}()
private lazy var selectIconView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "gc_application_type_unselected")
return imageView
}()
private lazy var actionBtn: UIButton = {
let button = UIButton(type: .custom)
button.setTitle("申请标准", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.setImage(UIImage(named: "right_arrow_black_20"), for: .normal)
button.addTarget(self, action: #selector(actionBtnClicked), for: .touchUpInside)
return button
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupCellInfo(type: YHGCApplicationType, isCurrentSelected: Bool) {
infoTitleLabel.text = type.titleString
infoDetailLabel.text = type.detailString
iconView.image = UIImage(named: type.iconString())
self.isCurrentSelected = isCurrentSelected
}
}
extension YHGCApplicationTypeSelectCell {
@objc private func actionBtnClicked() {
actionBtnEvent?()
}
private func setupUI() {
selectionStyle = .none
backgroundColor = .clear
contentView.addSubview(subContainerView)
subContainerView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
}
subContainerView.addSubview(iconView)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(selectIconView)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(actionBtn)
iconView.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
selectIconView.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
actionBtn.setContentCompressionResistancePriority(.required, for: .vertical)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
iconView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(20)
make.width.equalTo(88)
make.height.equalTo(108).priority(.high)
make.bottom.lessThanOrEqualToSuperview().offset(-20)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(iconView.snp.right).offset(20)
make.top.equalTo(iconView.snp.top)
}
selectIconView.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-20)
make.top.equalTo(iconView.snp.top)
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
actionBtn.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.greaterThanOrEqualTo(infoDetailLabel.snp.bottom).offset(0).priority(.high)
make.bottom.equalTo(iconView.snp.bottom)
}
actionBtn.iconInRight(with: 0)
}
}
private extension YHGCApplicationType {
func iconString() -> String {
switch self {
case .typeA:
return "gc_application_type_a"
case .typeB:
return "gc_application_type_b"
case .typeC:
return "gc_application_type_c"
}
}
}
//
// YHGCApplicationTypeViewModel.swift
// galaxy
//
// Created by alexzzw on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeViewModel: YHBaseViewModel {
func getApplyType(orderId: Int, callback: @escaping (_ model: YHGCApplicationTypeResponseModel?, _ error: YHErrorModel?) -> ()) {
let params = ["order_id": orderId]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.GCApplyType.getApplyType
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { json, code in
//1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHGCApplicationTypeResponseModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callback(nil, err)
return
}
callback(resultModel, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callback(nil, err)
}
} failBlock: { err in
callback(nil, err)
}
}
func submitApplyType(_ orderId: Int, _ applyType: Int, callBackBlock: @escaping (_ success: Bool, _ error:YHErrorModel?) -> () ) {
let params: [String : Any] = ["order_id": orderId, "apply_type": applyType]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.GCApplyType.submitApplyType
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { json, code in
//1. json字符串 转 对象
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false, err)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
}
//
// 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