Commit 15881b12 authored by pete谢兆麟's avatar pete谢兆麟

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents 6bc33c03 a64af63e
This diff is collapsed.
......@@ -24,9 +24,9 @@ class YHConfigManager: NSObject {
//测试环境-H5
static let baseH5UrlTest : String = "https://test-hkdiy-h5.galaxy-immi.com"
static let baseH5UrlTest : String = "https://test-hklife.galaxy-immi.com"
//正式环境-H5
static let baseH5UrlRelease : String = "https://hkdiy-h5.galaxy-immi.com"
static let baseH5UrlRelease : String = "https://hklife.galaxy-immi.com"
//h5地址
var h5Url : String {
......
......@@ -17,7 +17,7 @@ class YHCollegeNameCell: UITableViewCell {
label.textColor = .mainTextColor
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSC_B(ofSize: 14)
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
......
......@@ -25,7 +25,7 @@ class YHCollegeSearchBar: UIView, UITextFieldDelegate {
private lazy var contentView = {
let view = UIView()
view.backgroundColor = .contentBkgColor
view.layer.cornerRadius = Self.height/2.0
// view.layer.cornerRadius = Self.height/2.0
view.clipsToBounds = true
return view
}()
......@@ -34,7 +34,7 @@ class YHCollegeSearchBar: UIView, UITextFieldDelegate {
let textField = UITextField()
textField.backgroundColor = .clear
textField.attributedPlaceholder = NSAttributedString(string: "请输入学校全称", attributes: [NSAttributedString.Key.foregroundColor : UIColor.placeHolderColor])
textField.font = UIFont.PFSC_M(ofSize: 12)
textField.font = UIFont.PFSC_R(ofSize: 14)
textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor
textField.delegate = self
......@@ -44,10 +44,10 @@ class YHCollegeSearchBar: UIView, UITextFieldDelegate {
lazy var confirmBtn: UIButton = {
let btn = UIButton()
btn.setTitle("确认".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor.brandMainColor
btn.layer.cornerRadius = Self.confirmBtnHeight/2.0
// btn.layer.cornerRadius = Self.confirmBtnHeight/2.0
btn.addTarget(self, action: #selector(confirmBtnClicked), for: .touchUpInside)
return btn
}()
......
//
// YHGCMineSchemeViewController.swift
// galaxy
//
// Created by alexzzw on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCMineSchemeViewController: YHBaseViewController {
var tableView: UITableView!
var dataSource: [YHScemeItemModel]? = []
lazy var reqSchemeVM: YHMySchemeViewModel = {
let vm = YHMySchemeViewModel()
return vm
}()
lazy var headView: YHSchemeTableHeadView = {
let headView = YHSchemeTableHeadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 566))
return headView
}()
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "我的方案"
gk_navTitleColor = .white
gk_navBarAlpha = 1
gk_navBackgroundImage = UIImage(named: "my_scheme_nav")
gk_backImage = UIImage(named: "nav_icon_back_white")
setView()
loadData()
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
}
extension YHGCMineSchemeViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataSource?.count ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHSchemeTableViewCell.self)
cell.dataSource = dataSource?[indexPath.row]
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 199
} else if indexPath.row == 1 {
return 251
} else if indexPath.row == 2 {
return 190
}
return 0
}
}
extension YHGCMineSchemeViewController {
func getData() {
let model1 = YHScemeItemModel(title: "行业定位", mainMessage: "根据您目前给来的材料,初步建议您申请的行业:--", lightMessage: "--", subMessage: "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。")
let model2 = YHScemeItemModel(title: "资料清单", buttonTitle: "资料清单", mainMessage: "这是您的资料清单,请您前往查看。请您在1-2周内上传基础类证件哦,需要重新办理的可以晚些提供。需要注意的点如下:", lightMessage: "1-2周内", subMessage: "(1)港澳通如未办理,请尽快办理好反馈过来;\n(2)如为国内学校,需要尽快办理学位认证报告;\n(3)如为海外学校,需提供成绩单副本")
let model3 = YHScemeItemModel(title: "文书清单", buttonTitle: "文书写作", mainMessage: "这是您的文书清单,包括推荐信、赴港计划书,我写好后会发在微信里,与您一起沟通进行哈。3周-4周左右完成,需要咱们共同配合完成的噢", lightMessage: "3周-4周")
dataSource = [model1, model2, model3]
tableView.reloadData()
}
func updateDataSource() {
}
func setView() {
view.backgroundColor = .contentBkgColor
tableView = {
let tableView = UITableView(frame: .zero, style: .plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.tableFooterView = YHSchemeTableFooterView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 112))
tableView.tableHeaderView = headView
tableView.register(cellWithClass: YHSchemeTableViewCell.self)
tableView.bounces = false
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.bottom.equalToSuperview()
}
}
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
let param = ["order_id": orderID]
reqSchemeVM.getMySchemeData(params: param) { success, error in
if success == true {
guard let model = self.reqSchemeVM.schemeModel else { return }
let industry = model.industry.defaultStringIfEmpty()
let model1 = YHScemeItemModel(title: "行业定位", mainMessage: "根据您目前给来的材料,初步建议您申请的行业:" + industry, lightMessage: industry, subMessage: "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。")
let model2 = YHScemeItemModel(title: "资料清单", buttonTitle: "资料清单", mainMessage: "这是您的资料清单,请您前往查看。请您在1-2周内上传基础类证件哦,需要重新办理的可以晚些提供。需要注意的点如下:", lightMessage: "1-2周内", subMessage: "(1)港澳通如未办理,请尽快办理好反馈过来;\n(2)如为国内学校,需要尽快办理学位认证报告;\n(3)如为海外学校,需提供成绩单副本")
let model3 = YHScemeItemModel(title: "文书清单", buttonTitle: "文书写作", mainMessage: "这是您的文书清单,包括推荐信、赴港计划书,我写好后会发在微信里,与您一起沟通进行哈。3周-4周左右完成,需要咱们共同配合完成的噢", lightMessage: "3周-4周")
self.dataSource = [model1, model2, model3]
self.tableView.reloadData()
let ageTxt = "年龄" + model.age_score.string + "分"
let eduTxtA = "学历" + model.education_score_a.string + "分,名校加分XX分"
let workExp = "工作经验加分" + model.work_experience_score.string + "分"
let famous_enterprise = "名企加分" + model.famous_enterprise.string + "分"
let talent_list = "人才清单加分" + model.talent_list.string + "分"
let language = "语言加分" + model.language_score.string + "分"
let family = "家庭背景加分" + model.background_score.string + "分"
let arrText: [String] = [ageTxt, eduTxtA, workExp, famous_enterprise, talent_list, language, family]
let arrH: [String] = [model.age_score.string, model.education_score_a.string, model.work_experience_score.string, model.famous_enterprise.string, model.talent_list.string, model.language_score.string, model.background_score.string]
self.headView.dataSource = YHScemeHeadModel(totalScore: model.sum_score.string, scoreArray: arrText, scoreLightArray: arrH, addScore: "", name: model.username.defaultStringIfEmpty(), addtionStr: model.education_score_b.string)
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
}
} else {
printLog("error : orderID 为空")
}
}
}
//
// YHGCApplicationTypeController.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeController: YHBaseViewController {
private lazy var datas: [[YHGCApplicationModel]] = {
let typeA = YHGCApplicationModel(type: .typeA, isSelected: false)
let typeB = YHGCApplicationModel(type: .typeB, isSelected: false)
let typeC = YHGCApplicationModel(type: .typeC, isSelected: false)
return [[typeA], [typeB], [typeC]]
}()
private lazy var headerView: UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 104))
let label = UILabel()
label.text = "您好,请选择申请类别"
label.textColor = .mainTextColor
label.font = .PFSC_M(ofSize: 21)
view.addSubview(label)
label.snp.makeConstraints { make in
make.top.equalToSuperview().offset(32)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-10)
}
return view
}()
private lazy var tableView: UITableView = {
let view = UITableView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight), style: .grouped)
view.estimatedSectionHeaderHeight = 0.01
view.estimatedSectionFooterHeight = 20
view.sectionHeaderHeight = 0.01
view.sectionFooterHeight = 20
view.contentInsetAdjustmentBehavior = .never
view.backgroundColor = .clear
view.separatorStyle = .none
view.rowHeight = UITableView.automaticDimension
view.estimatedRowHeight = 148.0
view.dataSource = self
view.delegate = self
view.showsVerticalScrollIndicator = false
view.register(YHGCApplicationTypeSelectCell.self, forCellReuseIdentifier: YHGCApplicationTypeSelectCell.cellReuseIdentifier)
return view
}()
private lazy var bgIcon: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "gc_application_type_bg")
return view
}()
private lazy var submitButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.setTitle("提交", for: .normal)
button.setTitle("提交", for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .highlighted)
button.addTarget(self, action: #selector(clickSubmitButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
}
extension YHGCApplicationTypeController {
@objc private func clickSubmitButton() {
guard let model = datas.flatMap({ $0 }).first(where: { model in
model.isSelected == true
}) else {
YHHUD.flash(message: "请选择申请类别")
return
}
YHCommonAlertView.show("", "确定是否提交申请类别?提交后将不能修改", "取消", "确认", fullGuestureEnable: false) {
//
} callBack: { [weak self] in
let resultVC = YHGCApplicationTypeResultController(type: model.type)
self?.navigationController?.pushViewController(resultVC)
}
}
private func setupUI() {
gk_navTitle = "申请类别"
gk_navBarAlpha = 0
gk_navigationBar.backgroundColor = .clear
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(bgIcon)
view.addSubview(tableView)
view.addSubview(bottomView)
bottomView.addSubview(submitButton)
let ratio = 318.0 / 375.0
bgIcon.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(bgIcon.snp.width).multipliedBy(ratio)
}
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-66)
}
submitButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(kMargin)
make.right.equalToSuperview().offset(-kMargin)
make.top.equalToSuperview().offset(8)
make.height.equalTo(48)
}
tableView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
}
tableView.tableHeaderView = headerView
}
private func showPopVC(type: YHGCApplicationType) {
let vc = YHGCVisaProgramPopVC(type: type)
let pc = YHBottomPresentationController(presentedViewController: vc, presenting: self)
pc.customRadius = 8.0
vc.transitioningDelegate = pc
vc.sureButtonEvent = { [weak vc] in
vc?.dismiss(animated: true)
}
present(vc, animated: true, completion: nil)
}
}
extension YHGCApplicationTypeController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return datas.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard datas.count > section else {
return 0
}
return datas[section].count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard datas.count > indexPath.section else {
return UITableViewCell()
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return UITableViewCell()
}
let model = sectionArr[indexPath.row]
if let cell = tableView.dequeueReusableCell(withIdentifier: YHGCApplicationTypeSelectCell.cellReuseIdentifier) as? YHGCApplicationTypeSelectCell {
cell.setupCellInfo(type: model.type, isCurrentSelected: model.isSelected)
cell.actionBtnEvent = { [weak self] in
self?.showPopVC(type: model.type)
}
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 148.0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard datas.count > indexPath.section else {
return
}
let sectionArr = datas[indexPath.section]
guard sectionArr.count > indexPath.row else {
return
}
tableView.deselectRow(at: indexPath, animated: true)
let model = sectionArr[indexPath.row]
model.isSelected.toggle()
datas.flatMap { $0 }.forEach {
if $0.type != model.type, $0.isSelected {
$0.isSelected = false
}
}
tableView.reloadData()
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 0.01
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 20
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
}
//
// YHGCApplicationTypeResultController.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeResultController: YHBaseViewController {
private lazy var bgIcon: UIImageView = {
let view = UIImageView()
return view
}()
private lazy var backButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.setTitle("返回", for: .normal)
button.setTitle("返回", for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .highlighted)
button.addTarget(self, action: #selector(clickBackButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var headerLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.font = .PFSC_M(ofSize: 21)
label.text = "您已选定高才申请类型"
return label
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#6D788A")
label.font = .PFSC_R(ofSize: 13)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 3
return label
}()
private lazy var barView: UIView = {
let view = UIView()
return view
}()
private lazy var actionBtn: UIButton = {
let button = UIButton(type: .custom)
button.setTitle("申请标准", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.setImage(UIImage(named: "right_arrow_black_20"), for: .normal)
button.addTarget(self, action: #selector(actionBtnClicked), for: .touchUpInside)
return button
}()
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 6, corner: .allCorners)
view.backgroundColor = .white
return view
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
var backButtonEvent: (() -> Void)?
private let type: YHGCApplicationType
init(type: YHGCApplicationType) {
self.type = type
super.init(nibName: nil, bundle: nil)
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
}
extension YHGCApplicationTypeResultController {
@objc private func actionBtnClicked() {
showPopVC(type: type)
}
@objc private func clickBackButton() {
backButtonEvent?()
}
private func setupUI() {
gk_navTitle = "申请类别"
gk_navBarAlpha = 0
gk_navigationBar.backgroundColor = .clear
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(bgIcon)
view.addSubview(headerLabel)
view.addSubview(bottomView)
bottomView.addSubview(backButton)
view.addSubview(subContainerView)
subContainerView.addSubview(barView)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(actionBtn)
let ratio = 318.0 / 375.0
bgIcon.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(bgIcon.snp.width).multipliedBy(ratio)
}
headerLabel.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 42)
make.left.equalToSuperview().offset(20)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
subContainerView.snp.makeConstraints { make in
make.top.equalTo(headerLabel.snp.bottom).offset(50)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.height.equalTo(148)
}
barView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(3)
make.height.equalTo(108)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(barView.snp.right).offset(20)
make.top.equalTo(barView.snp.top)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
infoDetailLabel.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
actionBtn.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.greaterThanOrEqualTo(infoDetailLabel.snp.bottom).offset(0).priority(.high)
make.bottom.equalTo(barView.snp.bottom)
}
actionBtn.iconInRight(with: 0)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-66)
}
backButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(kMargin)
make.right.equalToSuperview().offset(-kMargin)
make.top.equalToSuperview().offset(8)
make.height.equalTo(48)
}
bgIcon.image = UIImage(named: type.bgIconTitle())
infoTitleLabel.text = type.titleString
infoDetailLabel.text = type.detailString
barView.backgroundColor = type.barColor()
}
private func showPopVC(type: YHGCApplicationType) {
let vc = YHGCVisaProgramPopVC(type: type)
let pc = YHBottomPresentationController(presentedViewController: vc, presenting: self)
pc.customRadius = 8.0
vc.transitioningDelegate = pc
vc.sureButtonEvent = { [weak vc] in
vc?.dismiss(animated: true)
}
present(vc, animated: true, completion: nil)
}
}
private extension YHGCApplicationType {
func bgIconTitle() -> String {
switch self {
case .typeA:
return "gc_application_type_bg_a"
case .typeB:
return "gc_application_type_bg_b"
case .typeC:
return "gc_application_type_bg_c"
}
}
func barColor() -> UIColor? {
switch self {
case .typeA:
return UIColor(hexString: "#EEDBBD")
case .typeB:
return UIColor(hexString: "#BFCDEF")
case .typeC:
return UIColor(hexString: "#BBE1F2")
}
}
}
//
// YHGCApplicationTypeSelectCell.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeSelectCell: UITableViewCell {
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
}
}
//
// YHGCVisaProgramPopVC.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHGCVisaProgramPopVC: YHBaseViewController {
private lazy var topProgramIcon: UIImageView = {
let view = UIImageView()
return view
}()
private lazy var sureButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.setTitle("我已知悉,确认", for: .normal)
button.setTitle("我已知悉,确认", for: .highlighted)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .highlighted)
button.addTarget(self, action: #selector(clickSureButton), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = .brandMainColor
return button
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.font = .PFSC_R(ofSize: 14)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 0
return label
}()
private lazy var subContainerView: YHBaseDynamicCornerRadiusView = {
let view = YHBaseDynamicCornerRadiusView(cornerRadius: 6, corner: .allCorners)
view.backgroundColor = .contentBkgColor
return view
}()
private lazy var infoMarkLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#6D788A")
label.font = .PFSC_R(ofSize: 14)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 0
return label
}()
var sureButtonEvent: (() -> Void)?
private let type: YHGCApplicationType
init(type: YHGCApplicationType) {
self.type = type
super.init(nibName: nil, bundle: nil)
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
}
extension YHGCVisaProgramPopVC {
@objc private func clickSureButton() {
sureButtonEvent?()
}
private func setupUI() {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = UIColor.white
view.addSubview(topProgramIcon)
view.addSubview(sureButton)
view.addSubview(infoDetailLabel)
view.addSubview(subContainerView)
subContainerView.addSubview(infoMarkLabel)
let ratio = 143.0 / 375.0
topProgramIcon.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(topProgramIcon.snp.width).multipliedBy(ratio)
}
let widthRatio = KScreenWidth / 375.0
infoDetailLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(124.0 * widthRatio)
make.left.equalToSuperview().offset(20 * widthRatio)
make.right.equalToSuperview().offset(-20 * widthRatio)
}
subContainerView.snp.makeConstraints { make in
make.top.equalTo(infoDetailLabel.snp.bottom).offset(20.0 * widthRatio)
make.left.equalToSuperview().offset(20 * widthRatio)
make.right.equalToSuperview().offset(-20 * widthRatio)
}
infoMarkLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16.0 * widthRatio)
make.left.equalToSuperview().offset(16 * widthRatio)
make.right.equalToSuperview().offset(-16 * widthRatio)
make.bottom.equalToSuperview().offset(-16.0 * widthRatio)
}
sureButton.snp.makeConstraints { make in
make.top.greaterThanOrEqualTo(subContainerView.snp.bottom).offset(10)
make.left.equalToSuperview().offset(kMargin * widthRatio)
make.right.equalToSuperview().offset(-kMargin * widthRatio)
make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-10 * widthRatio)
make.height.equalTo(48)
}
topProgramIcon.image = UIImage(named: type.programIconTitle())
infoDetailLabel.text = type.detailText()
infoMarkLabel.attributed.text = type.attributedTips()
preferredContentSize = CGSize(width: KScreenWidth, height: 452 * widthRatio)
}
}
private extension YHGCApplicationType {
func programIconTitle() -> String {
switch self {
case .typeA:
return "gc_visa_program_a"
case .typeB:
return "gc_visa_program_b"
case .typeC:
return "gc_visa_program_c"
}
}
func detailText() -> String {
switch self {
case .typeA:
return "在紧接申请前一年,全年收入达港币250万元或以上(或等值外币) 的人士"
case .typeB:
return "4个指定榜单中的世界百强大学的学士学位毕业生(以入境处内置榜单为准),且过去5年累积有不低于3年的工作经验"
case .typeC:
return "过去5年在4个指定榜单中的世界百强大学取得学士学位(以入境处内置榜单为准),但累积工作经验不足3年"
}
}
func attributedTips() -> ASAttributedString {
switch self {
case .typeA:
let attr1: ASAttributedString = .init(string: "注:必须是", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
let attr2: ASAttributedString = .init(string: "课税收入", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor))
let attr3: ASAttributedString = .init(string: ",享受税收优惠、免税的收入,不计算在内", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
return attr1 + attr2 + attr3
case .typeB:
let attr1: ASAttributedString = .init(string: "注:必须是", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
let attr2: ASAttributedString = .init(string: "紧接申请", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor))
let attr3: ASAttributedString = .init(string: "的前五年,累积工作经验不低于三年", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
return attr1 + attr2 + attr3
case .typeC:
let attr1: ASAttributedString = .init(string: "注:", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
let attr2: ASAttributedString = .init(string: "不适用于", .font(UIFont.PFSC_B(ofSize: 14)), .foreground(UIColor.brandMainColor))
let attr3: ASAttributedString = .init(string: "在港修读全日制经本地评审课程而获得学士学位的非本地生", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hexString: "#6D788A") ?? UIColor.gray))
return attr1 + attr2 + attr3
}
}
}
//
// YHGCApplicationModel.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
class YHGCApplicationModel {
var type: YHGCApplicationType = .typeA
var isSelected: Bool = false
init(type: YHGCApplicationType, isSelected: Bool) {
self.type = type
self.isSelected = isSelected
}
}
//
// YHGCApplicationType.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
enum YHGCApplicationType: Int {
case typeA
case typeB
case typeC
var titleString: String {
switch self {
case .typeA:
return "高才A类申请"
case .typeB:
return "高才B类申请"
case .typeC:
return "高才C类申请"
}
}
var detailString: String {
switch self {
case .typeA:
return "近一年度纳税收入250万港元及以上人士"
case .typeB:
return "百强大学毕业,且近5年累积工作经验时长不低于3年人士"
case .typeC:
return "百强大学毕业不足5年,且工作经验时长不足3年人士"
}
}
}
//
// YHGCApplicationTypeSelectCell.swift
// galaxy
//
// Created by alexzzw on 2024/11/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCApplicationTypeSelectCell: UITableViewCell {
static let cellReuseIdentifier = "YHGCApplicationTypeSelectCell"
private let selectedBorderColor: UIColor = .brandMainColor
var actionBtnEvent: (() -> Void)?
var isCurrentSelected: Bool = false {
didSet {
guard isCurrentSelected != oldValue else {
return
}
selectIconView.image = isCurrentSelected ? UIImage(named: "gc_application_type_selected"): UIImage(named: "gc_application_type_unselected")
subContainerView.lineWidth = isCurrentSelected ? 1 : nil
subContainerView.lineColor = isCurrentSelected ? selectedBorderColor.cgColor : nil
}
}
private lazy var subContainerView: YHBaseCornerRadiusBorderView = {
let view = YHBaseCornerRadiusBorderView(cornerRadius: 6, corner: .allCorners, lineWidth: nil, lineColor: nil)
view.backgroundColor = .white
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
return label
}()
private lazy var infoDetailLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hexString: "#6D788A")
label.font = .PFSC_R(ofSize: 13)
label.lineBreakMode = .byCharWrapping
label.numberOfLines = 3
return label
}()
private lazy var iconView: UIImageView = {
let imageView = UIImageView()
return imageView
}()
private lazy var selectIconView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "gc_application_type_unselected")
return imageView
}()
private lazy var actionBtn: UIButton = {
let button = UIButton(type: .custom)
button.setTitle("申请标准", for: .normal)
button.setTitleColor(.mainTextColor, for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.setImage(UIImage(named: "right_arrow_black_20"), for: .normal)
button.addTarget(self, action: #selector(actionBtnClicked), for: .touchUpInside)
return button
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupCellInfo(type: YHGCApplicationType, isCurrentSelected: Bool) {
infoTitleLabel.text = type.titleString
infoDetailLabel.text = type.detailString
iconView.image = UIImage(named: type.iconString())
self.isCurrentSelected = isCurrentSelected
}
}
extension YHGCApplicationTypeSelectCell {
@objc private func actionBtnClicked() {
actionBtnEvent?()
}
private func setupUI() {
selectionStyle = .none
backgroundColor = .clear
contentView.addSubview(subContainerView)
subContainerView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
}
subContainerView.addSubview(iconView)
subContainerView.addSubview(infoTitleLabel)
subContainerView.addSubview(selectIconView)
subContainerView.addSubview(infoDetailLabel)
subContainerView.addSubview(actionBtn)
iconView.setContentCompressionResistancePriority(.required, for: .horizontal)
infoTitleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
selectIconView.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
actionBtn.setContentCompressionResistancePriority(.required, for: .vertical)
infoDetailLabel.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
iconView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.left.equalToSuperview().offset(20)
make.width.equalTo(88)
make.height.equalTo(108).priority(.high)
make.bottom.lessThanOrEqualToSuperview().offset(-20)
}
infoTitleLabel.snp.makeConstraints { make in
make.left.equalTo(iconView.snp.right).offset(20)
make.top.equalTo(iconView.snp.top)
}
selectIconView.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-20)
make.top.equalTo(iconView.snp.top)
make.left.greaterThanOrEqualTo(infoTitleLabel.snp.right).offset(20)
}
infoDetailLabel.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-20)
}
actionBtn.snp.makeConstraints { make in
make.left.equalTo(infoTitleLabel.snp.left)
make.top.greaterThanOrEqualTo(infoDetailLabel.snp.bottom).offset(0).priority(.high)
make.bottom.equalTo(iconView.snp.bottom)
}
actionBtn.iconInRight(with: 0)
}
}
private extension YHGCApplicationType {
func iconString() -> String {
switch self {
case .typeA:
return "gc_application_type_a"
case .typeB:
return "gc_application_type_b"
case .typeC:
return "gc_application_type_c"
}
}
}
//
// YHGCCertificateUploadVC.swift
// galaxy
//
// Created by edy on 2024/11/12.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCCertificateUploadVC: YHBaseViewController, YHFamilyMemberProtol {
var tableView: UITableView!
weak var delegate:YHSpouseInfoVCProtocol?
var familyMember:YHFamilyMember? {
didSet {
if let familyMember = familyMember {
viewModel.mainModel = familyMember
}
}
}
lazy var viewModel: YHFamilyMemberViewModel = {
let model = YHFamilyMemberViewModel()
model.saveInfoSilentBlock = {
if let delegate = self.delegate, delegate.responds(to: #selector(YHSpouseInfoVCProtocol.saveInfoSilent)) {
delegate.saveInfoSilent()
}
}
return model
}()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor(hexString:"#F8F8F8")
gk_navigationBar.isHidden = true
createUI()
}
func loadInfo() {
self.tableView.reloadData()
}
func nextStep()->Bool {
return true
}
func createUI() {
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.backgroundColor = UIColor(hexString:"#F8F8F8")
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHIdentityCardCell.self)
return tableView
}()
view.addSubview(tableView)
let topHeight = k_Height_NavigationtBarAndStatuBar+YHStepView.height
let bottomHeight = YHSaveAndSubmitView.height
tableView.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalToSuperview()
make.right.equalToSuperview()
make.height.equalTo(KScreenHeight-topHeight-bottomHeight)
}
}
}
extension YHGCCertificateUploadVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return viewModel.getIDCardDataSource(false).count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHIdentityCardCell.self)
cell.type = YHCardType(rawValue: indexPath.row) ?? .identity
cell.viewModel = viewModel
cell.backSurfaceDeleteButton.isHidden = true
cell.frontDeleteButton.isHidden = true
cell.informationBlock = {[weak self] type, image, isLeft in
guard let self = self else { return }
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_a@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_a@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_b@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_b@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_bg_a@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_bg_a@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_bg_b@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_bg_b@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_bg_c@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_bg_c@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_c@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_c@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_selected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_selected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_application_type_unselected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_application_type_unselected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_visa_program_a@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_visa_program_a@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_visa_program_b@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_visa_program_b@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "gc_visa_program_c@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "gc_visa_program_c@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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