Commit 91eb9405 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'develop' into duyu

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents dcac2ce7 19196252
This diff is collapsed.
...@@ -13,7 +13,6 @@ import GKNavigationBarSwift ...@@ -13,7 +13,6 @@ import GKNavigationBarSwift
class YHDavidTestViewController: YHBaseViewController { class YHDavidTestViewController: YHBaseViewController {
var vcCanScroll : Bool = true var vcCanScroll : Bool = true
weak var myParentVc : ContentBaseViewController?
lazy var descripeLable:UILabel = { lazy var descripeLable:UILabel = {
let label = UILabel() let label = UILabel()
......
...@@ -25,7 +25,7 @@ class YHHomeViewController: YHBaseViewController { ...@@ -25,7 +25,7 @@ class YHHomeViewController: YHBaseViewController {
} }
} }
let cellView: ContentBaseViewController = ContentBaseViewController() let cellView: YHMainContentBaseViewController = YHMainContentBaseViewController()
//model 及网络请求 //model 及网络请求
lazy var homeReqVM : YHHomePageViewModel = { lazy var homeReqVM : YHHomePageViewModel = {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import UIKit import UIKit
import JXSegmentedView import JXSegmentedView
class ContentBaseViewController: UIViewController { class YHMainContentBaseViewController: UIViewController {
var canScroll : Bool = false { var canScroll : Bool = false {
didSet { didSet {
...@@ -52,7 +52,6 @@ class ContentBaseViewController: UIViewController { ...@@ -52,7 +52,6 @@ class ContentBaseViewController: UIViewController {
for _ in arrItemTitles { for _ in arrItemTitles {
let vc = YHDavidTestViewController() let vc = YHDavidTestViewController()
vc.myParentVc = self
arrItemVCs.append(vc) arrItemVCs.append(vc)
} }
...@@ -99,7 +98,7 @@ class ContentBaseViewController: UIViewController { ...@@ -99,7 +98,7 @@ class ContentBaseViewController: UIViewController {
} }
} }
extension ContentBaseViewController: JXSegmentedViewDelegate { extension YHMainContentBaseViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) { func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil) NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
} }
...@@ -116,7 +115,7 @@ extension ContentBaseViewController: JXSegmentedViewDelegate { ...@@ -116,7 +115,7 @@ extension ContentBaseViewController: JXSegmentedViewDelegate {
} }
} }
extension ContentBaseViewController: JXSegmentedListContainerViewDataSource { extension YHMainContentBaseViewController: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int { func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource { if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count return titleDataSource.dataSource.count
......
...@@ -111,7 +111,7 @@ extension YHInformationPerfectListVC { ...@@ -111,7 +111,7 @@ extension YHInformationPerfectListVC {
@objc func goInfoListVC() { @objc func goInfoListVC() {
//个人信息表 //个人信息表
navigationController?.pushViewController(YHMyInformationListViewController()) navigationController?.pushViewController(YHPersonInformMainViewController())
} }
@objc func clickSubmitBtn() { @objc func clickSubmitBtn() {
...@@ -279,6 +279,7 @@ extension YHInformationPerfectListVC { ...@@ -279,6 +279,7 @@ extension YHInformationPerfectListVC {
make.top.equalTo(headerTitleDesLable.snp.bottom).offset(10) make.top.equalTo(headerTitleDesLable.snp.bottom).offset(10)
make.left.equalTo(24) make.left.equalTo(24)
make.right.equalTo(-24) make.right.equalTo(-24)
make.bottom.equalToSuperview()
} }
myHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 96) myHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 96)
......
//
// YHMyInformationListViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/27.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
*个人信息表
*/
class YHMyInformationListViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
...@@ -52,12 +52,6 @@ class YHServiceCenterMainViewController: YHBaseViewController { ...@@ -52,12 +52,6 @@ class YHServiceCenterMainViewController: YHBaseViewController {
setupUI() setupUI()
loadData() loadData()
} }
} }
extension YHServiceCenterMainViewController { extension YHServiceCenterMainViewController {
...@@ -108,7 +102,8 @@ extension YHServiceCenterMainViewController { ...@@ -108,7 +102,8 @@ extension YHServiceCenterMainViewController {
// MARK: - UITableViewDelegate 和 UITableViewDataSource // MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDataSource { extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
return self.serviceCenterMainReqVM.arrContactList.count // return self.serviceCenterMainReqVM.arrContactList.count
return 1 //for test hjl
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......
//
// 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 YHPersonInfoControllerHoldViewController: UIViewController {
var canScroll : Bool = false {
didSet {
for vc in arrItemVCs {
vc.vcCanScroll = canScroll
}
}
}
let arrItemTitles = ["主申请人信息","家庭成员信息","基本资料","学历/专业资格","工作经验","其他信息"]
var arrItemVCs : [YHDavidTestViewController] = []
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 40))
lazy var segmentedDataSource: JXSegmentedBaseDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles
dataSource.titleNormalFont = UIFont.PingFangScM(ofSize: 16)
dataSource.titleNormalColor = .commonColor25
dataSource.titleSelectedFont = UIFont.PingFangScM(ofSize: 18)
dataSource.titleSelectedColor = .commonColor100
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 24
return dataSource
}()
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
return JXSegmentedListContainerView(dataSource: self, type: .collectionView)
}()
override func viewDidLoad() {
super.viewDidLoad()
for _ in arrItemTitles {
let vc = YHDavidTestViewController()
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.indicatorColor = .blue
segmentedView.indicators = [indicator]
segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1)
}
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: 50)
listContainerView.frame = CGRect(x: 0, y: 50, width: view.bounds.size.width, height: view.bounds.size.height - 50)
}
}
extension YHPersonInfoControllerHoldViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), 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: "scrollViewWillBeginDragging"), object: nil)
}
}
extension YHPersonInfoControllerHoldViewController: 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]
}
}
//
// YHPersonInformationViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/1/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import GKNavigationBarSwift
//import JXSegmentedView
class YHPersonInformMainViewController: YHBaseViewController {
let sectionHeaderHeight : CGFloat = 40
let cellHeight : CGFloat = 80
var arrItemVc : [UIViewController] = []
var canScroll : Bool = true
var myCellHeight : CGFloat {
get {
return view.bounds.size.height - homeNavBarView.height - k_TabBar_Height
}
}
let cellView: YHMainContentBaseViewController = YHMainContentBaseViewController()
// //model 及网络请求
// lazy var homeReqVM : YHHomePageViewModel = {
// return YHHomePageViewModel()
// }()
//头部背景图片
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "home_head_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
//自定义导航栏
lazy var homeNavBarView: UIView = {
let view1 = UIView()
view1.backgroundColor = .clear
view1.isUserInteractionEnabled = true
let icon = UIImageView(image: UIImage(named: "home_nav_icon"))
icon.contentMode = .scaleAspectFill
view1.addSubview(icon)
icon.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.height.equalTo(26)
make.width.equalTo(120)
}
let btnMsg = UIButton(type: .custom)
btnMsg.setImage(UIImage(named: "home_nav_msg"), for: .normal)
view1.addSubview(btnMsg)
btnMsg.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-16)
make.height.width.equalTo(34)
}
btnMsg.addTarget(self, action: #selector(tapSearch), for: .touchUpInside)
let btnSearch = UIButton(type: .custom)
btnSearch.setImage(UIImage(named: "home_nav_search"), for: .normal)
btnSearch.addTarget(self, action: #selector(tapSearch), for: .touchUpInside)
view1.addSubview(btnSearch)
btnSearch.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(btnMsg.snp.left).offset(-12)
make.height.width.equalTo(34)
}
return view1
}()
var homeTableView: YHGestureTableView = {
let tableView = YHGestureTableView(frame: .zero, style: .plain)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
// tableView.register(YHDavidCell0.self,forCellReuseIdentifier: YHDavidCell0.cellReuseIdentifier)
return tableView
}()
// MARK: - 生命周期方法
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(leaveTopOp), name:Notification.Name(rawValue: "leaveTop"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(beginDragging), name:Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(endDragging), name:Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
//1.UI
initView()
//2.网络请求
requestData()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
}
// MARK: - 私有方法
extension YHPersonInformMainViewController {
@objc func leaveTopOp() {
canScroll = true
}
@objc func beginDragging() {
homeTableView.isScrollEnabled = false
canScroll = false
}
@objc func endDragging() {
homeTableView.isScrollEnabled = true
canScroll = true
}
private func requestData() {
// self.homeReqVM.getHomeConfig { flag, error in
// if flag == true {
// //1. 调用model 刷新界面
// YHHUD.flash(message: "数据已更新")
// } else {
// //2. 给出 错误提示
// if let error = error {
// YHHUD.flash(.error(message: error.errorMsg))
// }
// }
// }
}
private func initView()->Void {
gk_navigationBar.isHidden = true
view.addSubview(headBkgImagV)
headBkgImagV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(307)
}
view.addSubview(homeNavBarView)
homeNavBarView.layer.zPosition = 1
homeNavBarView.snp.makeConstraints { make in
make.top.equalTo(k_Height_safeAreaInsetsTop())
make.left.right.equalToSuperview()
make.height.equalTo(48)
}
homeTableView.delegate = self
homeTableView.dataSource = self
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.equalTo(homeNavBarView.snp.bottom).offset(0)
make.left.right.bottom.equalToSuperview()
}
self.homeTableView.es.addPullToRefresh {
self.loadFirstItem()
}
self.homeTableView.es.startPullToRefresh()
self.homeTableView.es.addInfiniteScrolling {
self.loadFakeData()
}
}
private func loadFirstItem() {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self.homeTableView.es.stopPullToRefresh(ignoreDate: true,ignoreFooter: false)
self.homeTableView.reloadData()
}
}
private func loadFakeData() {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self.homeTableView.es.stopLoadingMore()
self.homeTableView.reloadData()
}
}
@objc func tapSearch() {
printLog("*")
navigationController?.pushViewController(YHDavidTestViewController())
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHPersonInformMainViewController : 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
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return CGRectGetHeight(self.view.bounds)
}
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)
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.row)")
}
}
extension YHPersonInformMainViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let bottomCellOffset: CGFloat = homeTableView.rect(forSection: 1).origin.y - 64 + 80 - 12 //48
if (scrollView.contentOffset.y >= bottomCellOffset) {
scrollView.contentOffset = CGPointMake(0, bottomCellOffset)
if canScroll == true {
canScroll = false
//传递参数到 子VC
cellView.canScroll = true
}
}else{
if canScroll == false {
scrollView.contentOffset = CGPoint(x: 0, y: bottomCellOffset)
}
}
self.homeTableView.showsVerticalScrollIndicator = false
}
}
...@@ -11,21 +11,41 @@ import UIKit ...@@ -11,21 +11,41 @@ import UIKit
class YHMainApplicantInformationViewController: YHBaseViewController { class YHMainApplicantInformationViewController: YHBaseViewController {
var stepView: YHStepView! var stepView: YHStepView!
var bottomView: YHBottomNextView!
var tableView: UITableView! var tableView: UITableView!
var viewModel: YHMainApplicantInformationViewModel!
var dataSource: [YHSectionItemModel]?
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
viewModel = YHMainApplicantInformationViewModel()
gk_navTitle = "主申请人信息填写" gk_navTitle = "主申请人信息填写"
setView() setView()
getData()
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
}
func getData() {
if stepView.currentIndex == 0 {
dataSource = viewModel.getBaseDataSource()
} else if stepView.currentIndex == 1 {
dataSource = viewModel.getIDCardDataSource()
} else if stepView.currentIndex == 2 {
dataSource = viewModel.getDocumentInformation()
} else if stepView.currentIndex == 3 {
dataSource = viewModel.getDetailDataSource()
}
tableView.reloadData()
} }
func setView() { func setView() {
stepView = { stepView = {
let step = YHStepView() let step = YHStepView()
step.dataSource = ["初始信息", "证件上传", "基本信息", "证件信息"] step.dataSource = ["初始信息", "证件上传", "基本信息", "证件信息"]
step.block = { [weak self] (index) in
guard let self = self else { return }
self.getData()
}
return step return step
}() }()
view.addSubview(stepView) view.addSubview(stepView)
...@@ -44,34 +64,47 @@ class YHMainApplicantInformationViewController: YHBaseViewController { ...@@ -44,34 +64,47 @@ class YHMainApplicantInformationViewController: YHBaseViewController {
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(cellWithClass: YHMainInformationTableViewCell.self)
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
return tableView return tableView
}() }()
view.addSubview(tableView) view.addSubview(tableView)
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 104) make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 104)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view) make.left.right.bottom.equalTo(view)
} }
bottomView = {
let bottom = YHBottomNextView()
bottom.block = { [weak self] in
guard let self = self else { return }
self.stepView.currentIndex = self.stepView.currentIndex + 1
self.getData()
}
return bottom
}()
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalTo(view)
make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64)
}
} }
} }
extension YHMainApplicantInformationViewController: UITableViewDelegate, UITableViewDataSource { extension YHMainApplicantInformationViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 0 return dataSource?.count ?? 0
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// let cell = tableView.dequeueReusableCell(withClass: <#T##T.Type#>) let cell = tableView.dequeueReusableCell(withClass: YHMainInformationTableViewCell.self)
let cell = UITableViewCell() cell.dataSource = dataSource?[indexPath.row]
return cell return cell
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let count = dataSource?[indexPath.row].models?.count ?? 0
return CGFloat(count * 52 + 52 + 14)
}
} }
//
// YHItemModel.swift
// galaxy
//
// Created by EDY on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
struct YHItemModel {
var isNeed: Bool?
var title: String?
var isUserKeyBoard: Bool?
var prompts: String?
var message: String?
var leftButtonString: String?
var rightButtonString: String?
init(isNeed: Bool? = nil, title: String? = nil, isUserKeyBoard: Bool? = nil, prompts: String? = nil, message: String? = nil, leftButtonString: String? = nil, rightButtonString: String? = nil) {
self.isNeed = isNeed
self.title = title
self.isUserKeyBoard = isUserKeyBoard
self.prompts = prompts
self.message = message
self.leftButtonString = leftButtonString
self.rightButtonString = rightButtonString
}
}
struct YHSectionItemModel {
var title: String?
var models: [YHItemModel]?
init(title: String? = nil, models: [YHItemModel]? = nil) {
self.title = title
self.models = models
}
}
//
// YHBottomNextView.swift
// galaxy
//
// Created by EDY on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHBottomNextView: UIView {
typealias Block = () -> ()
var block: Block?
var saveButton: UIButton!
var nextButton: UIButton!
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
saveButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0xf8f9fb)
button.titleLabel?.font = kBoldFont(size: 15)
button.contentHorizontalAlignment = .center
button.setTitle("保存", for: .normal)
button.setTitleColor( UIColor(hex:0x222222), for: .normal)
button.layer.cornerRadius = 8
button.addTarget(self, action: #selector(save), for: .touchUpInside)
return button
}()
addSubview(saveButton)
saveButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(10)
make.height.equalTo(44)
make.width.equalTo(86)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x4d9ff8)
button.titleLabel?.font = kBoldFont(size: 15)
button.contentHorizontalAlignment = .center
button.setTitle("下一步", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 8
button.addTarget(self, action: #selector(goNext), for: .touchUpInside)
return button
}()
addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(10)
make.height.equalTo(44)
make.width.equalTo(247)
}
}
@objc func save() {
}
@objc func goNext() {
if let block = block {
block()
}
}
}
//
// YHItemView.swift
// galaxy
//
// Created by EDY on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHItemView: UIView {
var titleLabel: UILabel!
var messageTextField: UITextField!
var nextStepImageView: UIImageView!
var centerButton: UIButton!
var leftButton: UIButton!
var rightButton: UIButton!
var dataSource: YHItemModel? {
didSet {
updateAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
titleLabel = {
let label = UILabel()
label.numberOfLines = 0
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview()
make.width.equalTo(112)
}
messageTextField = {
let textField = UITextField()
return textField
}()
addSubview(messageTextField)
messageTextField.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.left.equalTo(112)
}
nextStepImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "form_right_arrow")
return imageView
}()
addSubview(nextStepImageView)
nextStepImageView.snp.makeConstraints { make in
make.right.equalToSuperview()
make.centerY.equalToSuperview()
make.height.width.equalTo(20)
}
centerButton = {
let button = UIButton(type: .custom)
return button
}()
addSubview(centerButton)
centerButton.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.left.equalTo(112)
}
rightButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0x4487f9).withAlphaComponent(0.08)
button.setTitleColor(UIColor(hex: 0x4487f9), for: .selected)
button.setTitleColor(UIColor(hex: 0x222222), for: .normal)
button.layer.cornerRadius = 16
button.layer.borderWidth = 1
button.layer.borderColor = UIColor(hex: 0x4487f9).cgColor
button.isSelected = true
return button
}()
addSubview(rightButton)
rightButton.snp.makeConstraints { make in
make.right.equalToSuperview()
make.centerY.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(74)
}
leftButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex: 0xf8f9fb)
button.setTitleColor(UIColor(hex: 0x4487f9), for: .selected)
button.setTitleColor(UIColor(hex: 0x222222), for: .normal)
button.layer.cornerRadius = 16
return button
}()
addSubview(leftButton)
leftButton.snp.makeConstraints { make in
make.right.equalTo(rightButton.snp.left).offset(-12)
make.centerY.equalToSuperview()
make.height.equalTo(32)
make.width.equalTo(74)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
if dataSource.isNeed ?? false {
let str = "*" + (dataSource.title ?? "")
let attributes: [NSAttributedString.Key: Any] = [
.font: kFont(size: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex:0xFF3A3A), range: starRange)
titleLabel.attributedText = questionAttrStr
} else {
let str = dataSource.title ?? ""
let attributes: [NSAttributedString.Key: Any] = [
.font: kFont(size: 14),
.foregroundColor: UIColor(hex:0x222222)
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
titleLabel.attributedText = questionAttrStr
}
if dataSource.isUserKeyBoard ?? false {
nextStepImageView.isHidden = true
centerButton.isHidden = true
} else {
nextStepImageView.isHidden = false
centerButton.isHidden = false
}
messageTextField.placeholder = dataSource.prompts
messageTextField.text = dataSource.message
if (dataSource.leftButtonString != nil) {
leftButton.isHidden = false
leftButton.setTitle(dataSource.leftButtonString, for: .normal)
nextStepImageView.isHidden = true
} else {
leftButton.isHidden = true
}
if (dataSource.rightButtonString != nil) {
rightButton.isHidden = false
rightButton.setTitle(dataSource.rightButtonString, for: .normal)
nextStepImageView.isHidden = true
} else {
rightButton.isHidden = true
}
}
}
//
// YHMainInformationCountryTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/1/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMainInformationTableViewCell: UITableViewCell {
var centerView: UIView!
var titleLabel: UILabel!
var mainItemView: UIView!
var dataSource: YHSectionItemModel?{
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = UIColor(hex: 0xe9e9e9)
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = kFont(size: 17)
label.textColor = UIColor(hex:0x222222)
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(20)
make.right.equalTo(-18)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 12
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(52)
}
}
func updateAllViews() {
titleLabel.text = dataSource?.title
mainItemView.removeSubviews()
for i in 0 ..< (dataSource?.models?.count ?? 0) {
let line = UIView()
line.backgroundColor = UIColor(hex: 0xf0f0f0)
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52 * i)
make.height.equalTo(1)
make.right.equalTo(-18)
}
let itemView = YHItemView()
itemView.dataSource = dataSource?.models?[i]
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52 * i + 1)
make.height.equalTo(51)
make.right.equalTo(-18)
}
}
}
}
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
import UIKit import UIKit
class YHStepView: UIScrollView { class YHStepView: UIScrollView {
typealias Block = (Int) -> ()
var block: Block?
var dataSource: [String]? { var dataSource: [String]? {
didSet { didSet {
setUpView(dataSource ?? []) setUpView(dataSource ?? [])
} }
} }
var currentIndex: Int = 3 { var currentIndex: Int = 0 {
didSet { didSet {
updateView(dataSource ?? []) updateView(dataSource ?? [])
} }
...@@ -135,6 +137,9 @@ class YHStepView: UIScrollView { ...@@ -135,6 +137,9 @@ class YHStepView: UIScrollView {
let tag = button.tag let tag = button.tag
if tag - 1000 < currentIndex { if tag - 1000 < currentIndex {
currentIndex = tag - 1000 currentIndex = tag - 1000
if let block = block {
block(currentIndex)
}
} }
} }
} }
//
// YHMainApplicantInformationViewModel.swift
// galaxy
//
// Created by EDY on 2024/1/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMainApplicantInformationViewModel: YHBaseViewModel {
override init() {
super.init()
}
func getBaseDataSource() -> [YHSectionItemModel] {
let item = YHItemModel(isNeed: true, title: "国家/地区", isUserKeyBoard: false, prompts: "请选择")
let section = YHSectionItemModel(title: "国籍", models: [item])
let item1 = YHItemModel(isNeed: true, title: "省市地区", isUserKeyBoard: false, prompts: "请选择")
let item2 = YHItemModel(isNeed: true, title: "详细地址", isUserKeyBoard: true, prompts: "请填写小区、楼栋、单元室等")
let section1 = YHSectionItemModel(title: "现居住地址", models: [item, item1, item2])
let item3 = YHItemModel(isNeed: true, title: "是否办理", isUserKeyBoard: false, prompts: "", message: nil, leftButtonString: "是", rightButtonString: "否")
let section2 = YHSectionItemModel(title: "港澳通行证", models: [item3])
return [section, section1, section2]
}
func getDocumentInformation() -> [YHSectionItemModel] {
let item = YHItemModel(isNeed: true, title: "身份证号码", isUserKeyBoard: true, prompts: "请输入", message: nil)
let item1 = YHItemModel(isNeed: true, title: "签发地", isUserKeyBoard: false, prompts: "请输入", message: nil)
let item2 = YHItemModel(isNeed: true, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: nil)
let item3 = YHItemModel(isNeed: true, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: nil)
let section = YHSectionItemModel(title: "中国身份证", models: [item, item1, item2, item3])
let section1 = YHSectionItemModel(title: "港澳通行证", models: [item, item1, item2, item3])
let item4 = YHItemModel(isNeed: false, title: "证件类别", isUserKeyBoard: false, prompts: "请选择", message: nil)
let item5 = YHItemModel(isNeed: false, title: "证件号码", isUserKeyBoard: true, prompts: "请输入", message: nil)
let item6 = YHItemModel(isNeed: false, title: "签发地", isUserKeyBoard: true, prompts: "请输入", message: nil)
let item7 = YHItemModel(isNeed: false, title: "签发日期", isUserKeyBoard: false, prompts: "请选择", message: nil)
let item8 = YHItemModel(isNeed: false, title: "届满日期", isUserKeyBoard: false, prompts: "请选择", message: nil)
let section2 = YHSectionItemModel(title: "护照及其他旅行证件(选填)", models: [item4, item5, item6, item7, item8])
return [section, section1, section2]
}
func getDetailDataSource() -> [YHSectionItemModel] {
let item = YHItemModel(isNeed: true, title: "主申请人姓名", isUserKeyBoard: true, prompts: "请输入", message: nil)
let item1 = YHItemModel(isNeed: false, title: "曾用名", isUserKeyBoard: true, prompts: "请与户口本一致,若无则不填", message: nil)
let item2 = YHItemModel(isNeed: false, title: "婚前姓氏", isUserKeyBoard: true, prompts: "如有则填写,仅支持输入字母", message: nil)
let item3 = YHItemModel(isNeed: true, title: "出生日期", isUserKeyBoard: false, prompts: "请选择", message: nil)
let item4 = YHItemModel(isNeed: true, title: "出生国家/地区", isUserKeyBoard: false, prompts: nil, message: nil, leftButtonString: "国内", rightButtonString: "国外")
let item5 = YHItemModel(isNeed: true, title: "出生城市", isUserKeyBoard: false, prompts: "请选择", message: nil)
let item6 = YHItemModel(isNeed: true, title: "性别", isUserKeyBoard: false, prompts: "请选择", message: nil)
let item7 = YHItemModel(isNeed: true, title: "婚姻状况", isUserKeyBoard: false, prompts: "请选择", message: nil)
let section = YHSectionItemModel(title: "主申请人信息", models: [item, item1, item2, item3, item4, item5, item6, item7])
let item8 = YHItemModel(isNeed: true, title: "手机号码", isUserKeyBoard: true, prompts: "请输入", message: nil)
let item9 = YHItemModel(isNeed: true, title: "电子邮箱", isUserKeyBoard: true, prompts: "请输入", message: nil)
let section1 = YHSectionItemModel(title: "联系方式", models: [item8, item9])
let item10 = YHItemModel(isNeed: true, title: "是否办理过", isUserKeyBoard: false, prompts: nil, message: nil, leftButtonString: "是", rightButtonString: "否")
let section2 = YHSectionItemModel(title: "香港身份证", models: [item10])
return [section, section1, section2]
}
func getIDCardDataSource() -> [YHSectionItemModel] {
let item = YHItemModel(isNeed: true, title: "身份证", isUserKeyBoard: false, prompts: "请输入", message: nil)
let section = YHSectionItemModel(title: "中国身份证(选填)", models: [item])
let item1 = YHItemModel(isNeed: true, title: "港澳通行证(选填)", isUserKeyBoard: false, prompts: "请输入", message: nil)
let section1 = YHSectionItemModel(title: "中国身份证(选填)", models: [item])
return [section, section1]
}
}
...@@ -144,13 +144,13 @@ extension YHScoreItemCell { ...@@ -144,13 +144,13 @@ extension YHScoreItemCell {
for (index,item) in arrData.enumerated() { for (index,item) in arrData.enumerated() {
if index == 0 { if index == 0 {
scoreOptionsView1.nameLable.text = item.scoreName scoreOptionsView1.dataModel = item
} else if index == 1 { } else if index == 1 {
scoreOptionsView2.nameLable.text = item.scoreName scoreOptionsView2.dataModel = item
} else if index == 2 { } else if index == 2 {
scoreOptionsView3.nameLable.text = item.scoreName scoreOptionsView3.dataModel = item
} else if index == 3 { } else if index == 3 {
scoreOptionsView4.nameLable.text = item.scoreName scoreOptionsView4.dataModel = item
} }
} }
} }
......
...@@ -129,18 +129,16 @@ extension YHScoreItemCellForAge { ...@@ -129,18 +129,16 @@ extension YHScoreItemCellForAge {
guard let arrData = optionData?.options else { guard let arrData = optionData?.options else {
return return
} }
titleView.updateWith(optionData?.name, optionData?.score) titleView.updateWith(optionData?.name, optionData?.score)
for (index,item) in arrData.enumerated() { for (index,item) in arrData.enumerated() {
if index == 0 { if index == 0 {
scoreOptionsView1.nameLable.text = item.scoreName scoreOptionsView1.dataModel = item
} else if index == 1 { } else if index == 1 {
scoreOptionsView2.nameLable.text = item.scoreName scoreOptionsView2.dataModel = item
} else if index == 2 { } else if index == 2 {
scoreOptionsView3.nameLable.text = item.scoreName scoreOptionsView3.dataModel = item
} else if index == 3 { } else if index == 3 {
scoreOptionsView4.nameLable.text = item.scoreName scoreOptionsView4.dataModel = item
} }
} }
} }
......
...@@ -19,13 +19,24 @@ class YHScoreOptionsView: UIView { ...@@ -19,13 +19,24 @@ class YHScoreOptionsView: UIView {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
lazy var nameLable : UILabel = { // lazy var nameLable : UILabel = {
let lable0 = UILabel() // let lable0 = UILabel()
// lable0.textColor = UIColor(hex: 0x4E4E4E)
// lable0.font = UIFont.PingFangScR(ofSize: 14)
// lable0.numberOfLines = 0
// lable0.lineBreakMode = .byWordWrapping
// return lable0
// }()
private lazy var nameTextView : UITextView = {
let lable0 = UITextView()
lable0.textColor = UIColor(hex: 0x4E4E4E) lable0.textColor = UIColor(hex: 0x4E4E4E)
lable0.font = UIFont.PingFangScR(ofSize: 14) lable0.font = UIFont.PingFangScR(ofSize: 14)
lable0.numberOfLines = 0 lable0.isScrollEnabled = false
lable0.lineBreakMode = .byWordWrapping lable0.isEditable = false
lable0.isSelectable = false
return lable0 return lable0
}() }()
...@@ -34,6 +45,25 @@ class YHScoreOptionsView: UIView { ...@@ -34,6 +45,25 @@ class YHScoreOptionsView: UIView {
view.backgroundColor = UIColor(hex:0xF0F0F0) view.backgroundColor = UIColor(hex:0xF0F0F0)
return view return view
}() }()
private lazy var customLabel : UILabel = {
let customLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 40, height: 20))
customLabel.text = "-"
customLabel.font = .PingFangScR(ofSize: 12)
customLabel.backgroundColor = UIColor(hex:0xF8F9FB)
customLabel.textColor = UIColor(hex: 0x888F98)
customLabel.layer.cornerRadius = 4
customLabel.clipsToBounds = true
customLabel.textAlignment = .center
return customLabel
}()
var dataModel : YHScoreOptiosModel? {
didSet {
updateUI()
}
}
} }
private extension YHScoreOptionsView { private extension YHScoreOptionsView {
...@@ -44,11 +74,44 @@ private extension YHScoreOptionsView { ...@@ -44,11 +74,44 @@ private extension YHScoreOptionsView {
make.height.equalTo(0.5) make.height.equalTo(0.5)
} }
addSubview(nameLable) // addSubview(nameLable)
nameLable.snp.makeConstraints { make in // nameLable.snp.makeConstraints { make in
// make.top.equalTo(16)
// make.left.right.equalToSuperview()
// make.bottom.equalTo(bottomLine.snp.top).offset(-16)
// }
addSubview(nameTextView)
nameTextView.snp.makeConstraints { make in
make.top.equalTo(16) make.top.equalTo(16)
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.bottom.equalTo(bottomLine.snp.top).offset(-16) make.bottom.equalTo(bottomLine.snp.top).offset(-16)
} }
} }
func updateUI() {
guard let model = dataModel else {
nameTextView.text = "-"
return
}
customLabel.text = model.scoreValue
if model.isSelected == true {
nameTextView.attributed.text = """
\(model.scoreName, .foreground(UIColor(hex: 0x3C86F8)), .font(UIFont.PingFangScR(ofSize: 14))) \(.view(customLabel, .original(.center)))
"""
customLabel.backgroundColor = UIColor(hex:0x3C86F8,alpha:0.12)
customLabel.textColor = UIColor(hex: 0x3C86F8)
} else {
nameTextView.attributed.text = """
\(model.scoreName, .foreground(UIColor(hex: 0x4E4E4E)), .font(UIFont.PingFangScR(ofSize: 14))) \(.view(customLabel, .original(.center)))
"""
customLabel.backgroundColor = UIColor(hex:0xF8F9FB)
customLabel.textColor = UIColor(hex: 0x888F98)
}
}
} }
...@@ -18,8 +18,6 @@ class YHScorePersonInfoCell: UITableViewCell { ...@@ -18,8 +18,6 @@ class YHScorePersonInfoCell: UITableViewCell {
// } // }
// } // }
//头像 //头像
private lazy var headImagV : UIImageView = { private lazy var headImagV : UIImageView = {
let imageV = UIImageView(image: UIImage(named: "score_header_default")) let imageV = UIImageView(image: UIImage(named: "score_header_default"))
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<key>scoreName</key> <key>scoreName</key>
<string>118-39</string> <string>118-39</string>
<key>isSelected</key> <key>isSelected</key>
<false/> <true/>
</dict> </dict>
<dict> <dict>
<key>scoreValue</key> <key>scoreValue</key>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<key>scoreName</key> <key>scoreName</key>
<string>450+</string> <string>450+</string>
<key>isSelected</key> <key>isSelected</key>
<false/> <true/>
</dict> </dict>
</array> </array>
<key>name</key> <key>name</key>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<key>scoreName</key> <key>scoreName</key>
<string>1)获得最低学位证以后,拥有不超过2年工作经验</string> <string>1)获得最低学位证以后,拥有不超过2年工作经验</string>
<key>isSelected</key> <key>isSelected</key>
<false/> <true/>
</dict> </dict>
<dict> <dict>
<key>scoreValue</key> <key>scoreValue</key>
......
...@@ -13,7 +13,9 @@ class YHBaseUrlManager { ...@@ -13,7 +13,9 @@ class YHBaseUrlManager {
//开发环境 //开发环境
// static let baseUrlTest : String = "https://test-private-sphere.galaxy-immi.com/" // static let baseUrlTest : String = "https://test-private-sphere.galaxy-immi.com/"
static let baseUrlTest : String = "https://test.api.gateway.galaxy-immi.com/" // static let baseUrlTest : String = "https://test.api.gateway.galaxy-immi.com/"
static let baseUrlTest : String = "https://test-api-gateway.galaxy-immi.com/"
......
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