Commit 63fb355c authored by Alex朱枝文's avatar Alex朱枝文

拷贝了一份高才的预览页

parent cab61452
...@@ -31,6 +31,15 @@ ...@@ -31,6 +31,15 @@
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 */; }; 04307B7A2D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B762D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift */; };
04307B7B2D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B782D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift */; }; 04307B7B2D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B782D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift */; };
04307B7F2D1AB31000ED8E8D /* YHGCPreviewMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B7E2D1AB31000ED8E8D /* YHGCPreviewMainViewController.swift */; };
04307B8A2D1AB66100ED8E8D /* YHGCPreviewBasiceInformationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B822D1AB66100ED8E8D /* YHGCPreviewBasiceInformationViewController.swift */; };
04307B8C2D1AB66100ED8E8D /* YHGCPreviewControllerHoldViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B832D1AB66100ED8E8D /* YHGCPreviewControllerHoldViewController.swift */; };
04307B8D2D1AB66100ED8E8D /* YHGCPreviewAcademicAndProfessionalQualificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B802D1AB66100ED8E8D /* YHGCPreviewAcademicAndProfessionalQualificationViewController.swift */; };
04307B8E2D1AB66100ED8E8D /* YHGCPreviewFamilyMemberViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B842D1AB66100ED8E8D /* YHGCPreviewFamilyMemberViewController.swift */; };
04307B8F2D1AB66100ED8E8D /* YHGCPreviewOtherInformationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B882D1AB66100ED8E8D /* YHGCPreviewOtherInformationViewController.swift */; };
04307B902D1AB66100ED8E8D /* YHGCPreviewMainApplicantInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B862D1AB66100ED8E8D /* YHGCPreviewMainApplicantInfoViewController.swift */; };
04307B912D1AB66100ED8E8D /* YHGCPreviewIncomeRecordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B852D1AB66100ED8E8D /* YHGCPreviewIncomeRecordViewController.swift */; };
04307B932D1AB66100ED8E8D /* YHGCPreviewWorkExpViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B892D1AB66100ED8E8D /* YHGCPreviewWorkExpViewController.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 */; };
...@@ -1212,6 +1221,15 @@ ...@@ -1212,6 +1221,15 @@
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>"; }; 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>"; }; 04307B782D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCBasicInfoFillViewModel.swift; sourceTree = "<group>"; };
04307B7E2D1AB31000ED8E8D /* YHGCPreviewMainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewMainViewController.swift; sourceTree = "<group>"; };
04307B802D1AB66100ED8E8D /* YHGCPreviewAcademicAndProfessionalQualificationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewAcademicAndProfessionalQualificationViewController.swift; sourceTree = "<group>"; };
04307B822D1AB66100ED8E8D /* YHGCPreviewBasiceInformationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewBasiceInformationViewController.swift; sourceTree = "<group>"; };
04307B832D1AB66100ED8E8D /* YHGCPreviewControllerHoldViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewControllerHoldViewController.swift; sourceTree = "<group>"; };
04307B842D1AB66100ED8E8D /* YHGCPreviewFamilyMemberViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewFamilyMemberViewController.swift; sourceTree = "<group>"; };
04307B852D1AB66100ED8E8D /* YHGCPreviewIncomeRecordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewIncomeRecordViewController.swift; sourceTree = "<group>"; };
04307B862D1AB66100ED8E8D /* YHGCPreviewMainApplicantInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewMainApplicantInfoViewController.swift; sourceTree = "<group>"; };
04307B882D1AB66100ED8E8D /* YHGCPreviewOtherInformationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewOtherInformationViewController.swift; sourceTree = "<group>"; };
04307B892D1AB66100ED8E8D /* YHGCPreviewWorkExpViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCPreviewWorkExpViewController.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>"; };
...@@ -2524,6 +2542,30 @@ ...@@ -2524,6 +2542,30 @@
path = VM; path = VM;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
04307B7C2D1AB2B000ED8E8D /* PersonInfoList(个人信息预览) */ = {
isa = PBXGroup;
children = (
04307B7D2D1AB2B900ED8E8D /* C */,
);
path = "PersonInfoList(个人信息预览)";
sourceTree = "<group>";
};
04307B7D2D1AB2B900ED8E8D /* C */ = {
isa = PBXGroup;
children = (
04307B802D1AB66100ED8E8D /* YHGCPreviewAcademicAndProfessionalQualificationViewController.swift */,
04307B822D1AB66100ED8E8D /* YHGCPreviewBasiceInformationViewController.swift */,
04307B832D1AB66100ED8E8D /* YHGCPreviewControllerHoldViewController.swift */,
04307B842D1AB66100ED8E8D /* YHGCPreviewFamilyMemberViewController.swift */,
04307B852D1AB66100ED8E8D /* YHGCPreviewIncomeRecordViewController.swift */,
04307B862D1AB66100ED8E8D /* YHGCPreviewMainApplicantInfoViewController.swift */,
04307B882D1AB66100ED8E8D /* YHGCPreviewOtherInformationViewController.swift */,
04307B892D1AB66100ED8E8D /* YHGCPreviewWorkExpViewController.swift */,
04307B7E2D1AB31000ED8E8D /* YHGCPreviewMainViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
045C0A182D12CA5E00BD2DC0 /* C */ = { 045C0A182D12CA5E00BD2DC0 /* C */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -6157,6 +6199,7 @@ ...@@ -6157,6 +6199,7 @@
04AE200D2D12CFAF00891D24 /* ServiceProcess(我的信息流程) */ = { 04AE200D2D12CFAF00891D24 /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04307B7C2D1AB2B000ED8E8D /* PersonInfoList(个人信息预览) */,
047A968E2D16AA410033BB4E /* IncomeRecord(收入记录) */, 047A968E2D16AA410033BB4E /* IncomeRecord(收入记录) */,
0411CEE32D15063F00644D35 /* WorkExperience(工作经验) */, 0411CEE32D15063F00644D35 /* WorkExperience(工作经验) */,
0411CED92D14000D00644D35 /* MainApplicantInformation(主申请人信息) */, 0411CED92D14000D00644D35 /* MainApplicantInformation(主申请人信息) */,
...@@ -7325,6 +7368,14 @@ ...@@ -7325,6 +7368,14 @@
045C122B2D12CA5F00BD2DC0 /* YHEditWorkViewController.swift in Sources */, 045C122B2D12CA5F00BD2DC0 /* YHEditWorkViewController.swift in Sources */,
045C122C2D12CA5F00BD2DC0 /* YHFamilyInfoUpdateViewController.swift in Sources */, 045C122C2D12CA5F00BD2DC0 /* YHFamilyInfoUpdateViewController.swift in Sources */,
045C122D2D12CA5F00BD2DC0 /* YHVisaRenewalTipsCell.swift in Sources */, 045C122D2D12CA5F00BD2DC0 /* YHVisaRenewalTipsCell.swift in Sources */,
04307B8A2D1AB66100ED8E8D /* YHGCPreviewBasiceInformationViewController.swift in Sources */,
04307B8C2D1AB66100ED8E8D /* YHGCPreviewControllerHoldViewController.swift in Sources */,
04307B8D2D1AB66100ED8E8D /* YHGCPreviewAcademicAndProfessionalQualificationViewController.swift in Sources */,
04307B8E2D1AB66100ED8E8D /* YHGCPreviewFamilyMemberViewController.swift in Sources */,
04307B8F2D1AB66100ED8E8D /* YHGCPreviewOtherInformationViewController.swift in Sources */,
04307B902D1AB66100ED8E8D /* YHGCPreviewMainApplicantInfoViewController.swift in Sources */,
04307B912D1AB66100ED8E8D /* YHGCPreviewIncomeRecordViewController.swift in Sources */,
04307B932D1AB66100ED8E8D /* YHGCPreviewWorkExpViewController.swift in Sources */,
045C122E2D12CA5F00BD2DC0 /* YHServiceOrderSearchViewModel.swift in Sources */, 045C122E2D12CA5F00BD2DC0 /* YHServiceOrderSearchViewModel.swift in Sources */,
045C122F2D12CA5F00BD2DC0 /* YHSchemeViewModel.swift in Sources */, 045C122F2D12CA5F00BD2DC0 /* YHSchemeViewModel.swift in Sources */,
045C12302D12CA5F00BD2DC0 /* YHAiRadarAreaView.swift in Sources */, 045C12302D12CA5F00BD2DC0 /* YHAiRadarAreaView.swift in Sources */,
...@@ -7690,6 +7741,7 @@ ...@@ -7690,6 +7741,7 @@
045C138A2D12CA5F00BD2DC0 /* YHMatchCardUsageGuideView.swift in Sources */, 045C138A2D12CA5F00BD2DC0 /* YHMatchCardUsageGuideView.swift in Sources */,
045C138B2D12CA5F00BD2DC0 /* YHResignUploadTravelGuideView.swift in Sources */, 045C138B2D12CA5F00BD2DC0 /* YHResignUploadTravelGuideView.swift in Sources */,
045C138C2D12CA5F00BD2DC0 /* YHResignFamilyMemberInfoCell.swift in Sources */, 045C138C2D12CA5F00BD2DC0 /* YHResignFamilyMemberInfoCell.swift in Sources */,
04307B7F2D1AB31000ED8E8D /* YHGCPreviewMainViewController.swift in Sources */,
045C138D2D12CA5F00BD2DC0 /* YHDocumentUploadView.swift in Sources */, 045C138D2D12CA5F00BD2DC0 /* YHDocumentUploadView.swift in Sources */,
045C138E2D12CA5F00BD2DC0 /* YHOtherSelecteItemView.swift in Sources */, 045C138E2D12CA5F00BD2DC0 /* YHOtherSelecteItemView.swift in Sources */,
045C138F2D12CA5F00BD2DC0 /* YHHKRecordsSummaryVC.swift in Sources */, 045C138F2D12CA5F00BD2DC0 /* YHHKRecordsSummaryVC.swift in Sources */,
......
//
// YHGCPreviewAcademicAndProfessionalQualificationViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/2/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
*学历/专业资格 预览
*/
class YHGCPreviewAcademicAndProfessionalQualificationViewController: YHPreviewBaseViewController {
private let previewVM : YHPreviewViewModel = YHPreviewViewModel()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
}
}
private extension YHGCPreviewAcademicAndProfessionalQualificationViewController {
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
// let tmp = 133967 //全数据 可测试
previewVM.getPreviewForAcademicInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
} else {
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
func setupUI() {
self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
self.homeTableView.reloadData()
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCPreviewAcademicAndProfessionalQualificationViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return previewVM.arrDataForAcademicInfo.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self)
cell.selectionStyle = .none
cell.model = previewVM.arrDataForAcademicInfo[indexPath.row]
return cell
}
}
//
// YHGCPreviewBasiceInformationViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/2/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
*基本资料信息 预览
*/
class YHGCPreviewBasiceInformationViewController: YHPreviewBaseViewController {
private let previewVM : YHPreviewViewModel = YHPreviewViewModel()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
}
}
private extension YHGCPreviewBasiceInformationViewController {
func setupUI() {
self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
self.homeTableView.reloadData()
}
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
previewVM.getPreviewForBasicInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
} else {
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCPreviewBasiceInformationViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return previewVM.arrDataForBasicInfo.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self)
cell.selectionStyle = .none
cell.model = previewVM.arrDataForBasicInfo[indexPath.row]
return cell
}
}
//
// YHPersonInfoControllerHoldViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHGCPreviewControllerHoldViewController: UIViewController {
var canScroll : Bool = false {
didSet {
for vc in arrItemVCs {
vc.vcCanScroll = canScroll
}
}
}
var myDefaultNavItemIndex : Int = 0 {
didSet {
self.segmentedView.selectItemAt(index: self.myDefaultNavItemIndex)
}
}
let arrItemTitles = ["主申请人信息","家庭成员信息","基本资料","学历/专业资格","工作经验","收入记录","其他信息"]
var arrItemVCs : [YHPreviewBaseViewController] = []
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 55))
lazy var segmentedDataSource: JXSegmentedBaseDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 16)
dataSource.titleSelectedColor = UIColor.labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleSelectedColor = UIColor.brandMainColor
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 21.5
return dataSource
}()
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
return JXSegmentedListContainerView(dataSource: self, type: .collectionView)
}()
override func viewDidLoad() {
super.viewDidLoad()
do {
//主申请人
let vc = YHGCPreviewMainApplicantInfoViewController()
arrItemVCs.append(vc)
}
do {
//家庭成员信息
let vc = YHGCPreviewFamilyMemberViewController()
arrItemVCs.append(vc)
}
do {
//基本资料
let vc = YHGCPreviewBasiceInformationViewController()
arrItemVCs.append(vc)
}
do {
//学历/专业资格
let vc = YHGCPreviewAcademicAndProfessionalQualificationViewController()
arrItemVCs.append(vc)
}
do {
//工作经验
let vc = YHGCPreviewWorkExpViewController()
arrItemVCs.append(vc)
}
do {
// 收入记录
let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") as? Int ?? 0
let vc = YHGCPreviewIncomeRecordViewController(orderId: orderID)
arrItemVCs.append(vc)
}
do {
//其他信息
let vc = YHGCPreviewOtherInformationViewController()
arrItemVCs.append(vc)
}
//segmentedViewDataSource一定要通过属性强持有!!!!!!!!!
segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self
view.addSubview(segmentedView)
segmentedView.listContainer = listContainerView
view.addSubview(listContainerView)
//分类Title
segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorHeight = 4
indicator.indicatorCornerRadius = 2
indicator.verticalOffset = 4
indicator.indicatorColor = UIColor.brandMainColor
segmentedView.indicators = [indicator]
segmentedView.defaultSelectedIndex = self.myDefaultNavItemIndex
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
//处于第一个item的时候,才允许屏幕边缘手势返回
// navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
//离开页面的时候,需要恢复屏幕边缘手势,不能影响其他页面
// navigationController?.interactivePopGestureRecognizer?.isEnabled = true
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
segmentedView.frame = CGRect(x: 0, y: 0, width: view.bounds.size.width, height: 55)
listContainerView.frame = CGRect(x: 0, y: 55, width: view.bounds.size.width, height: view.bounds.size.height - 55)
segmentedView.backgroundColor = .white
}
}
extension YHGCPreviewControllerHoldViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging0"), object: nil)
}
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging0"), object: nil)
}
}
extension YHGCPreviewControllerHoldViewController: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count
}
return 0
}
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
return arrItemVCs[index] as JXSegmentedListContainerViewListDelegate
}
}
//
// YHGCPreviewIncomeRecordViewController.swift
// galaxy
//
// Created by alexzzw on 2024/11/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCPreviewIncomeRecordViewController: YHPreviewBaseViewController {
enum TableRow {
case infoHeader(_ title: String)
case infoSectionHeader(_ title: String)
case infoTitleAndDetail(_ title: String, _ detail: String, _ cellType: YHResignRoundCellType, _ topMargin: CGFloat, _ bottomMargin: CGFloat)
case infoIncomeType(_ title: String, _ types: [String])
}
private lazy var noDataView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("暂无收入记录", kEmptyCommonBgName)
view.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 164)
view.backgroundColor = .clear
view.isHidden = true
return view
}()
private lazy var datas: [TableRow] = []
private lazy var viewModel = YHIncomeRecordViewModel()
private var incomeModel = YHIncomeRecordCompleteModel()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
requestData()
}
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")
}
}
extension YHGCPreviewIncomeRecordViewController {
private func setupUI() {
view.addSubview(noDataView)
noDataView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview().offset(-100)
make.width.equalTo(KScreenWidth)
make.height.equalTo(164)
}
homeTableView.snp.remakeConstraints { make in
make.left.right.top.bottom.equalToSuperview()
}
homeTableView.register(YHPreviewInfoHeaderCell.self, forCellReuseIdentifier: YHPreviewInfoHeaderCell.cellReuseIdentifier)
homeTableView.register(YHPreviewInfoNameAndDetailCell.self, forCellReuseIdentifier: YHPreviewInfoNameAndDetailCell.cellReuseIdentifier)
homeTableView.register(YHPreviewInfoSectionHeaderCell.self, forCellReuseIdentifier: YHPreviewInfoSectionHeaderCell.cellReuseIdentifier)
homeTableView.register(YHPreviewInfoIncomeTypeCell.self, forCellReuseIdentifier: YHPreviewInfoIncomeTypeCell.cellReuseIdentifier)
homeTableView.tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 16))
homeTableView.tableFooterView = UIView(frame: CGRect(x: 16, y: 0, width: KScreenWidth, height: 44))
}
private func currencyFormat(_ currencySymbol: String) -> NumberFormatter {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.currencySymbol = currencySymbol
formatter.maximumFractionDigits = 0
return formatter
}
private func setupData() {
datas.removeAll()
datas.append(.infoHeader("收入情况"))
guard incomeModel.income_over_100 == YHIncomeOver100.true.rawValue else {
if incomeModel.income_over_100 == YHIncomeOver100.false.rawValue {
datas.append(.infoTitleAndDetail("前一年全年收入是否达港币100万元或以上:", "否", .bottom, 16, 16))
noDataView.isHidden = true
homeTableView.reloadData()
} else {
noDataView.isHidden = false
datas = []
homeTableView.reloadData()
}
return
}
datas.append(.infoTitleAndDetail("前一年全年收入是否达港币100万元或以上:", "是", .mid, 16, 8))
let currencyFmt = currencyFormat("")
let rate = incomeModel.rate > 0 ? incomeModel.rate : 0.92
var totalMoney: Double = 0
let listCount = incomeModel.list.count
incomeModel.list.enumerated().forEach { index, model in
datas.append(.infoSectionHeader("收入\(index + 1)"))
datas.append(.infoTitleAndDetail("收入来源公司:", model.company_name, .mid, 8, 8))
let selectedTypes = model.income_type.compactMap {
YHIncomeType(rawValue: $0)
}
datas.append(.infoIncomeType("收入类型:", selectedTypes.map {
$0.nameString()
}))
if selectedTypes.contains(.incomeOfMainland) || selectedTypes.contains(.incomeOfHKCompanies) || selectedTypes.contains(.incomeOfMacauCompanies) || selectedTypes.contains(.incomeOfOtherOverseasCompanies) {
datas.append(.infoTitleAndDetail("公司营业额/人民币 (近一年):", currencyFmt.string(from: NSNumber(value: model.corporate_turnover)) ?? "0", .mid, 8, 8))
}
let isLast = (listCount - 1 == index)
datas.append(.infoTitleAndDetail("收入金额(港元):", currencyFmt.string(from: NSNumber(value: model.income_money / rate)) ?? "0", isLast ? .bottom : .mid, 8, 16))
totalMoney += model.income_money
}
if datas.count >= 2 {
if incomeModel.list.count == 0 {
datas.insert(.infoTitleAndDetail("主申请人总收入(港元):", currencyFmt.string(from: NSNumber(value: totalMoney / rate)) ?? "0", .bottom, 8, 16), at: 2)
} else {
datas.insert(.infoTitleAndDetail("主申请人总收入(港元):", currencyFmt.string(from: NSNumber(value: totalMoney / rate)) ?? "0", .mid, 8, 16), at: 2)
}
}
noDataView.isHidden = true
homeTableView.reloadData()
}
private func requestData() {
viewModel.getIncomeList(orderId: orderId) { [weak self] incomeModel, error in
guard let self = self else {
return
}
guard let incomeModel = incomeModel else {
printLog("YHGCPreviewIncomeRecordViewController: 请求失败")
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg)
}
self.noDataView.isHidden = false
self.datas = []
self.homeTableView.reloadData()
return
}
self.incomeModel = incomeModel
self.setupData()
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCPreviewIncomeRecordViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return datas.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.row else {
return UITableViewCell()
}
let tableRow = datas[indexPath.row]
switch tableRow {
case let .infoHeader(title):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHPreviewInfoHeaderCell.cellReuseIdentifier) as? YHPreviewInfoHeaderCell {
cell.setup(title: title)
return cell
}
case let .infoSectionHeader(title):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHPreviewInfoSectionHeaderCell.cellReuseIdentifier) as? YHPreviewInfoSectionHeaderCell {
cell.setup(title: title)
return cell
}
case let .infoTitleAndDetail(title, detail, cellType, top, bottom):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHPreviewInfoNameAndDetailCell.cellReuseIdentifier) as? YHPreviewInfoNameAndDetailCell {
cell.setup(title: title, detail: detail, cellType: cellType, topMargin: top, bottomMargin: bottom)
return cell
}
case let .infoIncomeType(title, docs):
if let cell = tableView.dequeueReusableCell(withIdentifier: YHPreviewInfoIncomeTypeCell.cellReuseIdentifier) as? YHPreviewInfoIncomeTypeCell {
cell.setupCellInfo(title: title, documents: docs)
return cell
}
}
return UITableViewCell()
}
}
//
// YHMainApplicantInfoViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
*主申请人信息 预览
*/
class YHGCPreviewMainApplicantInfoViewController: YHPreviewBaseViewController {
private let previewVM : YHPreviewViewModel = YHPreviewViewModel()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
homeTableView.reloadData()
}
}
private extension YHGCPreviewMainApplicantInfoViewController {
func setupUI() {
self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
self.homeTableView.reloadData()
}
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
previewVM.getPreviewForMainApplicationInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
} else {
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCPreviewMainApplicantInfoViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return previewVM.arrDataForMainApplicationInfo.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self)
cell.selectionStyle = .none
cell.model = previewVM.arrDataForMainApplicationInfo[indexPath.row]
return cell
}
}
//
// YHOtherInfoPreviewViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/2/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
*其他信息 预览
*/
class YHGCPreviewOtherInformationViewController: YHPreviewBaseViewController {
private let previewVM : YHPreviewViewModel = YHPreviewViewModel()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
}
}
private extension YHGCPreviewOtherInformationViewController {
func setupUI() {
self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
self.homeTableView.reloadData()
}
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
previewVM.getPreviewForOtherInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
} else {
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCPreviewOtherInformationViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return previewVM.arrDataForOtherInfo.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self)
cell.selectionStyle = .none
cell.model = previewVM.arrDataForOtherInfo[indexPath.row]
return cell
}
}
//
// YHGCPreviewWorkExpViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/3/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
*工作经验 预览
*/
class YHGCPreviewWorkExpViewController: YHPreviewBaseViewController {
private let previewVM : YHPreviewViewModel = YHPreviewViewModel()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
// loadData()
loadData2()
}
}
private extension YHGCPreviewWorkExpViewController {
func setupUI() {
self.homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
self.homeTableView.reloadData()
}
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
previewVM.getPreviewForWorkExpInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
} else {
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
func loadData2() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
previewVM.getPreviewForWorkExpNewInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
} else {
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCPreviewWorkExpViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// return previewVM.arrDataForWorkExpInfo.count
return previewVM.arrDataForWorkExpInfoNew.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHPreviewInfoCell.self)
cell.selectionStyle = .none
// cell.model = previewVM.arrDataForWorkExpInfo[indexPath.row]
if !previewVM.arrDataForWorkExpInfoNew.isEmpty,indexPath.row < previewVM.arrDataForWorkExpInfoNew.count {
cell.model = previewVM.arrDataForWorkExpInfoNew[indexPath.row]
}
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