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

拷贝了一份高才的预览页

parent cab61452
......@@ -31,6 +31,15 @@
04307B6E2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */; };
04307B7A2D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B762D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift */; };
04307B7B2D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B782D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift */; };
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 */; };
045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F762D12CA5E00BD2DC0 /* Localizable.xcstrings */; };
045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */ = {isa = PBXBuildFile; fileRef = 045C0F5E2D12CA5E00BD2DC0 /* img_0.png */; };
......@@ -1212,6 +1221,15 @@
04307B6D2D1A5F4200ED8E8D /* YHIncomeUploadWorkIDCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeUploadWorkIDCell.swift; sourceTree = "<group>"; };
04307B762D1AADBE00ED8E8D /* YHGCBasicInfoFillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCBasicInfoFillModel.swift; sourceTree = "<group>"; };
04307B782D1AADBE00ED8E8D /* YHGCBasicInfoFillViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCBasicInfoFillViewModel.swift; sourceTree = "<group>"; };
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>"; };
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>"; };
......@@ -2524,6 +2542,30 @@
path = VM;
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 */ = {
isa = PBXGroup;
children = (
......@@ -6157,6 +6199,7 @@
04AE200D2D12CFAF00891D24 /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup;
children = (
04307B7C2D1AB2B000ED8E8D /* PersonInfoList(个人信息预览) */,
047A968E2D16AA410033BB4E /* IncomeRecord(收入记录) */,
0411CEE32D15063F00644D35 /* WorkExperience(工作经验) */,
0411CED92D14000D00644D35 /* MainApplicantInformation(主申请人信息) */,
......@@ -7325,6 +7368,14 @@
045C122B2D12CA5F00BD2DC0 /* YHEditWorkViewController.swift in Sources */,
045C122C2D12CA5F00BD2DC0 /* YHFamilyInfoUpdateViewController.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 */,
045C122F2D12CA5F00BD2DC0 /* YHSchemeViewModel.swift in Sources */,
045C12302D12CA5F00BD2DC0 /* YHAiRadarAreaView.swift in Sources */,
......@@ -7690,6 +7741,7 @@
045C138A2D12CA5F00BD2DC0 /* YHMatchCardUsageGuideView.swift in Sources */,
045C138B2D12CA5F00BD2DC0 /* YHResignUploadTravelGuideView.swift in Sources */,
045C138C2D12CA5F00BD2DC0 /* YHResignFamilyMemberInfoCell.swift in Sources */,
04307B7F2D1AB31000ED8E8D /* YHGCPreviewMainViewController.swift in Sources */,
045C138D2D12CA5F00BD2DC0 /* YHDocumentUploadView.swift in Sources */,
045C138E2D12CA5F00BD2DC0 /* YHOtherSelecteItemView.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
}
}
//
// YHGCPreviewFamilyMemberViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
*家庭成员信息 预览
*/
class YHGCPreviewFamilyMemberViewController: YHPreviewBaseViewController {
private let previewVM : YHPreviewViewModel = YHPreviewViewModel()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
homeTableView.reloadData()
}
private var buttonHoldView : UIView = {
let view = UIView()
return view
}()
// private var parentButton : UIButton!
private var spouseButton : UIButton!
private var childrenButton : UIButton!
// private var brotherButton : UIButton!
private var arrButtons : [UIButton] = []
lazy var noNetWorkTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("暂无内容", kEmptyCommonBgName)
view.topMargin = 0
view.backgroundColor = .white
view.isHidden = true
return view
}()
}
private extension YHGCPreviewFamilyMemberViewController {
func setupUI() {
noNetWorkTipsView.isHidden = false
noNetWorkTipsView.backgroundColor = UIColor.contentBkgColor
view.addSubview(self.noNetWorkTipsView)
self.noNetWorkTipsView.topMargin = 20
view.addSubview(buttonHoldView)
buttonHoldView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
make.height.equalTo(56)
}
spouseButton = createButton()
spouseButton.setTitle("配偶", for: .normal)
buttonHoldView.addSubview(spouseButton)
spouseButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
childrenButton = createButton()
childrenButton.setTitle("子女", for: .normal)
buttonHoldView.addSubview(childrenButton)
childrenButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(spouseButton.snp.right).offset(12)
make.height.equalTo(32)
make.width.equalTo(68)
}
// parentButton = createButton()
// parentButton.setTitle("父母", for: .normal)
// buttonHoldView.addSubview(parentButton)
// parentButton.snp.makeConstraints { make in
// make.centerY.equalToSuperview()
// make.left.equalTo(childrenButton.snp.right).offset(12)
// make.height.equalTo(32)
// make.width.equalTo(68)
//
// }
//
//
//
//
//
// brotherButton = createButton()
// brotherButton.setTitle("兄弟姐妹", for: .normal)
// buttonHoldView.addSubview(brotherButton)
// brotherButton.snp.makeConstraints { make in
// make.centerY.equalToSuperview()
// make.left.equalTo(parentButton.snp.right).offset(12)
// make.height.equalTo(32)
// make.width.equalTo(84)
// }
// arrButtons.append(parentButton)
arrButtons.append(spouseButton)
arrButtons.append(childrenButton)
// arrButtons.append(brotherButton)
homeTableView.snp.removeConstraints()
homeTableView.snp.makeConstraints { make in
make.top.equalTo(buttonHoldView.snp.bottom)
make.bottom.equalToSuperview()
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
}
homeTableView.register(YHPreviewInfoCell.self,forCellReuseIdentifier: YHPreviewInfoCell.cellReuseIdentifier)
homeTableView.reloadData()
}
private func layouButtons() {
spouseButton.snp.removeConstraints()
childrenButton.snp.removeConstraints()
// parentButton.snp.removeConstraints()
// brotherButton.snp.removeConstraints()
var lastTagView : UIView? = nil
//配偶
if previewVM.arrDataForSpouse.isEmpty == false {
spouseButton.isHidden = false
spouseButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
lastTagView = spouseButton
} else {
spouseButton.isHidden = true
}
//子女
if previewVM.arrDataForChildren.isEmpty == false {
childrenButton.isHidden = false
if let lastTagView = lastTagView {
childrenButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(lastTagView.snp.right).offset(12)
make.height.equalTo(32)
make.width.equalTo(68)
}
} else {
childrenButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(68)
}
}
lastTagView = childrenButton
} else {
childrenButton.isHidden = true
}
// //父母
// if previewVM.arrDataForParents.isEmpty == false {
// parentButton.isHidden = false
// if let lastTagView = lastTagView {
// parentButton.snp.makeConstraints { make in
// make.centerY.equalToSuperview()
// make.left.equalTo(lastTagView.snp.right).offset(12)
// make.height.equalTo(32)
// make.width.equalTo(68)
// }
// } else {
// parentButton.snp.makeConstraints { make in
// make.centerY.equalToSuperview()
// make.left.equalToSuperview()
// make.height.equalTo(32)
// make.width.equalTo(68)
// }
// }
//
// lastTagView = parentButton
// } else {
// parentButton.isHidden = true
// }
// //兄弟姐妹
// if previewVM.arrDataForBrother.isEmpty == false {
// brotherButton.isHidden = false
// if let lastTagView = lastTagView {
// brotherButton.snp.makeConstraints { make in
// make.centerY.equalToSuperview()
// make.left.equalTo(lastTagView.snp.right).offset(12)
// make.height.equalTo(32)
// make.width.equalTo(68)
// }
// } else {
// brotherButton.snp.makeConstraints { make in
// make.centerY.equalToSuperview()
// make.left.equalToSuperview()
// make.height.equalTo(32)
// make.width.equalTo(68)
// }
// }
//
// lastTagView = brotherButton
// } else {
// brotherButton.isHidden = true
// }
}
func createButton() -> UIButton {
let btn = UIButton(type: .custom)
btn.backgroundColor = UIColor.white
btn.setTitleColor(.mainTextColor, for: .normal)
btn.setTitleColor(.white, for: .selected)
btn.layer.cornerRadius = 16
btn.clipsToBounds = true
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 13)
btn.addTarget(self, action:#selector(clickButton(sender:)) , for: .touchUpInside)
return btn
}
@objc func clickButton(sender : UIButton) {
for button in arrButtons {
button.backgroundColor = UIColor.white
button.setTitleColor(.black, for: .normal)
}
sender.backgroundColor = .brandMainColor
sender.setTitleColor(.white, for: .normal)
if sender == spouseButton {
previewVM.arrDataForMainApplicationInfo = previewVM.arrDataForSpouse
}
// else if sender == parentButton {
// previewVM.arrDataForMainApplicationInfo = previewVM.arrDataForParents
// }
else if sender == childrenButton {
previewVM.arrDataForMainApplicationInfo = previewVM.arrDataForChildren
}
// else if sender == brotherButton {
// previewVM.arrDataForMainApplicationInfo = previewVM.arrDataForBrother
// }
else {
previewVM.arrDataForMainApplicationInfo = []
}
homeTableView.reloadData()
if previewVM.arrDataForMainApplicationInfo.count > 0 {
self.noNetWorkTipsView.isHidden = true
self.homeTableView.isHidden = false
} else {
self.noNetWorkTipsView.isHidden = false
self.homeTableView.isHidden = true
}
}
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
previewVM.getPreviewForFamilyInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
} else {
}
self.layouButtons()
self.highlightButton()
self.homeTableView.reloadData()
return
}
} else {
printLog("error : orderID 为空")
}
self.layouButtons()
self.homeTableView.reloadData()
}
private func highlightButton() {
if !spouseButton.isHidden {
clickButton(sender:spouseButton)
clickButton(sender:spouseButton)
return
}
if !childrenButton.isHidden {
clickButton(sender:childrenButton)
return
}
// if !parentButton.isHidden {
// clickButton(sender:parentButton)
// return
// }
//
// if !brotherButton.isHidden {
// clickButton(sender:brotherButton)
// return
// }
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCPreviewFamilyMemberViewController {
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
}
}
//
// 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
}
}
//
// YHGCPreviewMainViewController.swift
// galaxy
//
// Created by alexzzw on 2024/12/24.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import GKNavigationBarSwift
class YHGCPreviewMainViewController: YHBaseViewController {
private let previewVM : YHPreviewViewModel = YHPreviewViewModel()
var orderId : Int?
var canScroll : Bool = true
var myCellHeight : CGFloat {
get {
return view.bounds.size.height - k_Height_NavigationtBarAndStatuBar
}
}
var myDefaultIndex : Int = 0 {
didSet {
DispatchQueue.global().asyncAfter(wallDeadline: .now() ) {[weak self] in
DispatchQueue.main.async {
self?.cellView.myDefaultNavItemIndex = self?.myDefaultIndex ?? 0
}
}
}
}
lazy var cellView: YHGCPreviewControllerHoldViewController = {
let ttt = YHGCPreviewControllerHoldViewController()
ttt.myDefaultNavItemIndex = self.myDefaultIndex
return ttt
}()
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
return tableView
}()
var myHeadView : UIView = {
let view = UIView(frame: CGRect(x: kMargin, y: 0, width: KScreenWidth - kMargin * 2, height: 131))
view.backgroundColor = .white
return view
}()
//头像
private lazy var headImagV : UIImageView = {
let imageV = UIImageView(image: UIImage(named: "mine_head_default"))
imageV.contentMode = .scaleAspectFill
imageV.layer.cornerRadius = 26.5
imageV.clipsToBounds = true
imageV.layer.borderWidth = 2
imageV.layer.borderColor = UIColor.white.cgColor
return imageV
}()
//姓名
private lazy var nameLable : UILabel = {
let lable0 = UILabel(text: "")
lable0.textColor = UIColor.mainTextColor
lable0.font = UIFont.PFSC_M(ofSize: 19)
return lable0
}()
//电话号码
private lazy var phoneLable : UILabel = {
let lable0 = UILabel(text: "")
lable0.textColor = UIColor.labelTextColor2
lable0.font = UIFont.PFSC_R(ofSize: 14)
return lable0
}()
// MARK: - 生命周期方法
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(leaveTopOp), name:Notification.Name(rawValue: "leaveTop0"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(beginDragging), name:Notification.Name(rawValue: "scrollViewWillBeginDragging0"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(endDragging), name:Notification.Name(rawValue: "scrollViewDidEndDragging0"), object: nil)
//1.UI
initView()
//2.网络请求
loadData()
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
cellView.view.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: myCellHeight)
}
}
// MARK: - 私有方法
extension YHGCPreviewMainViewController {
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
previewVM.getPreviewForMainApplicationInfo(params: ["order_id" : orderID]) { success, error in
if success == true {
var title = ""
if let tmp = self.previewVM.mainApplicationInfoPreviewModel?.username,tmp.isEmpty == false {
title = tmp + "的个人信息表"
} else {
title = "未知 "
}
self.nameLable.text = title
// self.phoneLable.text = self.previewVM.mainApplicationInfoPreviewModel?.mobile ?? "-"
self.phoneLable.text = "优才计划"
// self.handleHeaderIcon()
} else {
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
private func handleHeaderIcon() {
//缺少头像字段
// guard let model = previewVM.mainApplicationInfoPreviewModel,let icon = model. else {
// return
// }
// previewVM.getPublicImageUrl(imgString) {[weak self] success, error in
// guard let self = self else { return }
// guard success != nil else { return }
// self.resultView.kf.setImage(with: URL(string: success))
// }
}
private func initView()->Void {
gk_navigationBar.isHidden = false
gk_backStyle = .black
gk_navTitle = "预览"
gk_navBackgroundColor = .white
gk_navTitleColor = UIColor(hex:0x0F1214)
gk_navBarAlpha = 1
gk_navTitleFont = UIFont.PFSC_B(ofSize: 17)
homeTableView.delegate = self
homeTableView.dataSource = self
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.bottom.equalToSuperview()
}
homeTableView.tableHeaderView = myHeadView
let headSubView = UIView()
headSubView.backgroundColor = .clear
headSubView.layer.cornerRadius = kCornerRadius6
headSubView.clipsToBounds = true
myHeadView.addSubview(headSubView)
headSubView.snp.makeConstraints { make in
make.top.equalTo(17)
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
make.height.equalTo(105)
}
let bkgImageV = UIImageView(image: UIImage(named: "person_info_head_bkg"))
bkgImageV.contentMode = .scaleAspectFill
headSubView.addSubview(bkgImageV)
bkgImageV.snp.makeConstraints { make in
make.edges.equalTo(0)
}
// 头像 名称 电话号码
headSubView.addSubview(headImagV)
headImagV.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(20.5)
make.width.height.equalTo(53)
}
headSubView.addSubview(nameLable)
nameLable.snp.makeConstraints { make in
make.top.equalTo(headImagV.snp.top)
make.left.equalTo(headImagV.snp.right).offset(12)
make.height.equalTo(26.5)
make.right.equalTo(-kMargin)
}
headSubView.addSubview(phoneLable)
phoneLable.snp.makeConstraints { make in
make.top.equalTo(nameLable.snp.bottom)
make.left.equalTo(headImagV.snp.right).offset(12)
make.height.equalTo(20)
make.right.equalTo(-20.5)
}
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHGCPreviewMainViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.001
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.001))
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.001
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.001))
return view
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return myCellHeight
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell()
cellView.view.frame = CGRect(x: 0, y: 0, width: cell.contentView.bounds.size.width, height: myCellHeight)
cell.contentView.addSubview(cellView.view)
cellView.view.snp.makeConstraints { make in
make.edges.equalTo(0)
}
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
}
}
extension YHGCPreviewMainViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let bottomCellOffset: CGFloat = homeTableView.rect(forSection: 0).origin.y
if (scrollView.contentOffset.y >= bottomCellOffset) {
scrollView.contentOffset = CGPointMake(0, bottomCellOffset)
if canScroll == true {
// canScroll = false
// //传递参数到 子VC
// cellView.canScroll = true
}
canScroll = false
//传递参数到 子VC
cellView.canScroll = true
}else{
if canScroll == false {
scrollView.contentOffset = CGPoint(x: 0, y: bottomCellOffset)
}
}
self.homeTableView.showsVerticalScrollIndicator = false
}
}
extension YHGCPreviewMainViewController {
@objc func leaveTopOp() {
canScroll = true
}
@objc func beginDragging() {
homeTableView.isScrollEnabled = false
canScroll = false
}
@objc func endDragging() {
homeTableView.isScrollEnabled = true
canScroll = true
}
}
//
// 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