Commit 0827354f authored by pete谢兆麟's avatar pete谢兆麟
parents f26ea22b d687893b
This diff is collapsed.
//
// YHCustomerInformationQuestionnaireVC.swift
// galaxy
//
// Created by alexzzw on 2025/3/25.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import AttributedString
import UIKit
class YHCustomerInformationQuestionnaireVC: YHBaseViewController {
enum CustomerType: Int {
case old
case new
func topImage() -> String {
switch self {
case .old:
return "plan_question_top_old"
case .new:
return "plan_question_top_new"
}
}
}
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 = 16
view.contentInsetAdjustmentBehavior = .never
view.backgroundColor = .clear
view.separatorStyle = .none
view.dataSource = self
view.delegate = self
view.showsVerticalScrollIndicator = false
view.register(YHSurveyTableViewCell.self, forCellReuseIdentifier: YHSurveyTableViewCell.cellReuseIdentifier)
return view
}()
private var imageHeight: CGFloat {
return KScreenWidth
}
private lazy var topImageView: UIImageView = {
let view = UIImageView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: imageHeight))
view.image = UIImage(named: "plan_question_top_old")
return view
}()
private lazy var submitButton: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
let buttonName = "提交"
button.setTitle(buttonName, for: .normal)
button.setTitle(buttonName, for: .highlighted)
button.setTitleColor(UIColor(hex: 0xFFFFFF), for: .normal)
button.setTitleColor(UIColor(hex: 0xFFFFFF), for: .highlighted)
button.addTarget(self, action: #selector(submitButtonClick), for: .touchUpInside)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.backgroundColor = UIColor(hexString: "#121A26")
return button
}()
private lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
/*
private lazy var privacyButton: UIButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "plan_privacy_unchecked"), for: .normal)
button.setImage(UIImage(named: "plan_privacy_checked"), for: .selected)
button.addTarget(self, action: #selector(privacyButtonClicked), for: .touchUpInside)
return button
}()
private lazy var privacyLabel: UILabel = {
let label = UILabel()
let normal: ASAttributedString = .init("同意用户隐私信息收集协议《 ", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor.mainTextColor.withAlphaComponent(0.5))).add(attributes: .action { [weak self] in
self?.privacyButtonClicked()
})
let attributed: ASAttributedString = .init("隐私协议", .font(UIFont.PFSC_M(ofSize: 13)), .foreground(UIColor.mainTextColor), .action { [weak self] in
self?.gotoPrivacyPage()
})
let end: ASAttributedString = .init(" 》", .font(UIFont.PFSC_R(ofSize: 13)), .foreground(UIColor.mainTextColor.withAlphaComponent(0.5)))
let content = normal + attributed + end
label.attributed.text = content
return label
}()
*/
private var sections: [YHSurveyQuestionType] {
return YHSurveyQuestionType.allCases
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
private func setupUI() {
gk_navBarAlpha = 0
gk_navBackgroundColor = .clear
// gk_navLeftBarButtonItem?.tintColor = .white
gk_backImage = UIImage(named: "back_icon_white")
updateRightBarButtonItem(true)
view.backgroundColor = UIColor.contentBkgColor
view.addSubview(bottomView)
bottomView.addSubview(submitButton)
// bottomView.addSubview(privacyButton)
// bottomView.addSubview(privacyLabel)
view.addSubview(tableView)
view.addSubview(topImageView)
view.bringSubviewToFront(tableView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-64)
}
/*
privacyButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.width.height.equalTo(13)
make.centerY.equalTo(privacyLabel)
}
privacyLabel.snp.makeConstraints { make in
make.left.equalTo(privacyButton.snp.right).offset(6)
make.top.equalToSuperview().offset(12)
make.right.lessThanOrEqualToSuperview().offset(-16)
}
*/
submitButton.snp.makeConstraints { make in
make.top.equalToSuperview().offset(8)
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(48)
}
tableView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalToSuperview()
make.bottom.equalTo(bottomView.snp.top).offset(-24)
}
tableView.contentInset = UIEdgeInsets(top: imageHeight - 110, left: 0, bottom: 0, right: 0)
tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.01))
}
@objc private func share() {
//
}
@objc private func submitButtonClick() {
}
/*
@objc private func privacyButtonClicked() {
privacyButton.isSelected.toggle()
}
private func gotoPrivacyPage() {
let vc = YHWebViewViewController()
vc.url = YHBaseUrlManager.shared.curPrivacyAgreementUrl()
vc.navTitle = "银河港生活隐私协议"
navigationController?.pushViewController(vc)
}
*/
private func updateRightBarButtonItem(_ isWhite: Bool) {
let rightButtonItem = UIBarButtonItem(image: UIImage(named: isWhite ? "video_share" : "share_item")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(share))
gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16
}
}
extension YHCustomerInformationQuestionnaireVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return sections.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard sections.count > section else {
return 0
}
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard sections.count > indexPath.section else {
return UITableViewCell()
}
let model = sections[indexPath.section]
if let cell = tableView.dequeueReusableCell(withIdentifier: YHSurveyTableViewCell.cellReuseIdentifier) as? YHSurveyTableViewCell {
cell.configure(with: model.rawValue, options: model.selections())
return cell
}
return UITableViewCell()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
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
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == sections.count - 1 {
return 0.01
}
return 16
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let offsetY = scrollView.contentOffset.y + scrollView.contentInset.top
topImageView.frame.origin.y = -offsetY
if offsetY > 0 {
var alpha = offsetY / k_Height_NavigationtBarAndStatuBar
if alpha > 1.0 {
alpha = 1.0
}
gk_navBarAlpha = alpha
gk_navBackgroundColor = .white
gk_navTitle = "香港身份方案评估"
gk_backImage = UIImage(named: "nav_black_24")
gk_navRightBarButtonItem?.image = UIImage(named: "share_item")
updateRightBarButtonItem(false)
} else {
gk_navBarAlpha = 0.0
gk_navBackgroundColor = .clear
gk_navTitle = nil
updateRightBarButtonItem(true)
gk_backImage = UIImage(named: "back_icon_white")
}
}
}
...@@ -11,7 +11,7 @@ import JXSegmentedView ...@@ -11,7 +11,7 @@ import JXSegmentedView
class YHPlanViewController: YHBaseViewController { class YHPlanViewController: YHBaseViewController {
var infoArr: [String] = ["", "", "", ""] var infoArr: [String] = ["", "", "", "", "", ""]
var cases: [String] = ["水电费噶事多发结石冷风机拉萨反垃圾算法逻辑的山卡拉飞机啊索拉卡飞机啊拉卡萨", var cases: [String] = ["水电费噶事多发结石冷风机拉萨反垃圾算法逻辑的山卡拉飞机啊索拉卡飞机啊拉卡萨",
"阿斯顿发发", "阿斯顿发生大法师懂法守法说法大萨达法司法发沙发是打发三大发实达防擦是打发", "阿斯顿发发", "阿斯顿发生大法师懂法守法说法大萨达法司法发沙发是打发三大发实达防擦是打发",
"啊所发生的发生的放假啦苏卡达飞机拉萨开发机阿萨拉法基阿萨拉开发", "啊所发生的发生的放假啦苏卡达飞机拉萨开发机阿萨拉法基阿萨拉开发",
...@@ -38,7 +38,6 @@ class YHPlanViewController: YHBaseViewController { ...@@ -38,7 +38,6 @@ class YHPlanViewController: YHBaseViewController {
tableView.register(YHPlanScoreCell.self, forCellReuseIdentifier: YHPlanScoreCell.cellReuseIdentifier) tableView.register(YHPlanScoreCell.self, forCellReuseIdentifier: YHPlanScoreCell.cellReuseIdentifier)
tableView.register(YHPlanCustomerCaseListCell.self, forCellReuseIdentifier: YHPlanCustomerCaseListCell.cellReuseIdentifier) tableView.register(YHPlanCustomerCaseListCell.self, forCellReuseIdentifier: YHPlanCustomerCaseListCell.cellReuseIdentifier)
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
view.backgroundColor = .clear
tableView.tableHeaderView = headerView tableView.tableHeaderView = headerView
return tableView return tableView
}() }()
...@@ -122,7 +121,8 @@ class YHPlanViewController: YHBaseViewController { ...@@ -122,7 +121,8 @@ class YHPlanViewController: YHBaseViewController {
lazy var segmented1View: JXSegmentedView = { lazy var segmented1View: JXSegmentedView = {
let view = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: KScreenWidth, height: 30)) let view = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: KScreenWidth, height: 30))
view.backgroundColor = .clear view.backgroundColor = .clear
view.delegate = self
// 配置指示器 // 配置指示器
let indicator = JXSegmentedIndicatorLineView() let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16 indicator.indicatorWidth = 16
...@@ -151,6 +151,7 @@ class YHPlanViewController: YHBaseViewController { ...@@ -151,6 +151,7 @@ class YHPlanViewController: YHBaseViewController {
lazy var segmented2View: JXSegmentedView = { lazy var segmented2View: JXSegmentedView = {
let view = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: KScreenWidth, height: 48)) let view = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: KScreenWidth, height: 48))
view.backgroundColor = .clear view.backgroundColor = .clear
view.delegate = self
// 配置指示器 // 配置指示器
let indicator = JXSegmentedIndicatorLineView() let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16 indicator.indicatorWidth = 16
...@@ -158,6 +159,7 @@ class YHPlanViewController: YHBaseViewController { ...@@ -158,6 +159,7 @@ class YHPlanViewController: YHBaseViewController {
indicator.indicatorCornerRadius = 0.0 indicator.indicatorCornerRadius = 0.0
indicator.indicatorColor = .mainTextColor indicator.indicatorColor = .mainTextColor
view.indicators = [indicator] view.indicators = [indicator]
view.dataSource = segmented2DataSource
return view return view
}() }()
...@@ -178,8 +180,7 @@ class YHPlanViewController: YHBaseViewController { ...@@ -178,8 +180,7 @@ class YHPlanViewController: YHBaseViewController {
lazy var fixedSegmentView: UIView = { lazy var fixedSegmentView: UIView = {
let v = UIView() let v = UIView()
v.backgroundColor = .white v.backgroundColor = .white
v.alpha = 0.0
segmented2View.dataSource = segmented2DataSource
v.addSubview(segmented2View) v.addSubview(segmented2View)
segmented2View.snp.makeConstraints { make in segmented2View.snp.makeConstraints { make in
...@@ -193,6 +194,33 @@ class YHPlanViewController: YHBaseViewController { ...@@ -193,6 +194,33 @@ class YHPlanViewController: YHBaseViewController {
return v return v
}() }()
lazy var bottomView: UIView = {
let v = UIView()
v.backgroundColor = .white
let listView = YHPlanItemsView(frame: .zero)
v.addSubview(listView)
let button = YHLookPlanButton(frame: .zero)
v.addSubview(button)
listView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.height.equalTo(17)
make.top.equalTo(12)
}
button.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(60)
make.top.equalTo(listView.snp.bottom).offset(8)
}
return v
}()
@objc func didRevalueBtnClicked() { @objc func didRevalueBtnClicked() {
} }
...@@ -200,10 +228,15 @@ class YHPlanViewController: YHBaseViewController { ...@@ -200,10 +228,15 @@ class YHPlanViewController: YHBaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navigationBar.backgroundColor = .white
gk_navigationBar.alpha = 0.0
gk_navTitleColor = .mainTextColor
gk_navTitle = "续签至永居方案分析"
self.view.backgroundColor = .init(hex: 0xF8F9FB) self.view.backgroundColor = .init(hex: 0xF8F9FB)
self.view.addSubview(bgImgView) self.view.addSubview(bgImgView)
self.view.addSubview(tableView) self.view.addSubview(tableView)
self.view.addSubview(fixedSegmentView) self.view.addSubview(fixedSegmentView)
self.view.addSubview(bottomView)
bgImgView.snp.makeConstraints { make in bgImgView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview() make.left.right.top.equalToSuperview()
...@@ -211,8 +244,9 @@ class YHPlanViewController: YHBaseViewController { ...@@ -211,8 +244,9 @@ class YHPlanViewController: YHBaseViewController {
} }
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar) make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
} }
fixedSegmentView.snp.makeConstraints { make in fixedSegmentView.snp.makeConstraints { make in
...@@ -220,6 +254,11 @@ class YHPlanViewController: YHBaseViewController { ...@@ -220,6 +254,11 @@ class YHPlanViewController: YHBaseViewController {
make.top.equalTo(k_Height_NavigationtBarAndStatuBar) make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(44) make.height.equalTo(44)
} }
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(102 + k_Height_safeAreaInsetsBottom())
}
} }
} }
...@@ -241,13 +280,13 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -241,13 +280,13 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
return UITableViewCell() return UITableViewCell()
} }
return cell1 return cell1
} else if indexPath.section == 1 || indexPath.section == 2 { } else if indexPath.section < 5 {
guard let cell2 = tableView.dequeueReusableCell(withIdentifier: YHPlanAnalyzeInfoCell.cellReuseIdentifier, for: indexPath) as? YHPlanAnalyzeInfoCell else { guard let cell2 = tableView.dequeueReusableCell(withIdentifier: YHPlanAnalyzeInfoCell.cellReuseIdentifier, for: indexPath) as? YHPlanAnalyzeInfoCell else {
return UITableViewCell() return UITableViewCell()
} }
cell2.products = ["", ""] cell2.products = ["", ""]
return cell2 return cell2
} else if indexPath.section == 3 { } else if indexPath.section == 5 {
guard let cell3 = tableView.dequeueReusableCell(withIdentifier: YHPlanCustomerCaseListCell.cellReuseIdentifier, for: indexPath) as? YHPlanCustomerCaseListCell else { guard let cell3 = tableView.dequeueReusableCell(withIdentifier: YHPlanCustomerCaseListCell.cellReuseIdentifier, for: indexPath) as? YHPlanCustomerCaseListCell else {
return UITableViewCell() return UITableViewCell()
...@@ -262,7 +301,7 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -262,7 +301,7 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 3 { if indexPath.section == 5 {
return getCaseListHeight() return getCaseListHeight()
} }
return UITableView.automaticDimension return UITableView.automaticDimension
...@@ -318,7 +357,35 @@ extension YHPlanViewController: UIScrollViewDelegate { ...@@ -318,7 +357,35 @@ extension YHPlanViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) { func scrollViewDidScroll(_ scrollView: UIScrollView) {
bgImgView.isHidden = scrollView.contentOffset.y >= topScrollHeight bgImgView.y = scrollView.contentOffset.y > 0.0 ? -scrollView.contentOffset.y : 0.0
segmented2View.isHidden = scrollView.contentOffset.y < topScrollHeight
var percent = scrollView.contentOffset.y/20.0
if percent > 1.0 {
percent = 1.0
} else if percent < 0.0 {
percent = 0.0
}
fixedSegmentView.alpha = scrollView.contentOffset.y >= topScrollHeight ? 1.0 : 0.0
tableView.y = scrollView.contentOffset.y > topScrollHeight ? k_Height_NavigationtBarAndStatuBar+44.0 : k_Height_NavigationtBarAndStatuBar
gk_navigationBar.alpha = percent
}
}
extension YHPlanViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
let index = segmentedView.selectedIndex
self.tableView.scrollToRow(at: IndexPath(row: 0, section: index), at: .top, animated: true)
if segmentedView == segmented1View {
self.segmented2View.defaultSelectedIndex = index
self.segmented2View.reloadDataWithoutListContainer()
}
if segmentedView == segmented2View {
self.segmented1View.defaultSelectedIndex = index
self.segmented1View.reloadDataWithoutListContainer()
}
} }
} }
//
// YHSurveyMatchResultViewController.swift
// galaxy
//
// Created by alexzzw on 2025/3/27.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import Lottie
import UIKit
class YHSurveyMatchResultViewController: YHBaseViewController {
enum MatchResult {
case failure
case success
func iconTitle() -> String {
switch self {
case .failure:
return "plan_survey_match_failure"
case .success:
return "plan_survey_match_success"
}
}
func title() -> String {
switch self {
case .failure:
return "匹配失败"
case .success:
return "匹配完成"
}
}
func content() -> String {
switch self {
case .failure:
return "出了点问题,重试一下吧"
case .success:
return "请您查阅【香港身份续签至永居方案】,\n如需进一步咨询,请联系专属顾问和生活管家"
}
}
func buttonTitle() -> String {
switch self {
case .failure:
return "重新匹配"
case .success:
return "香港身份续签至永居方案"
}
}
}
private lazy var topImageView: UIImageView = {
let view = UIImageView()
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
label.font = .PFSC_B(ofSize: 26)
label.textAlignment = .center
return label
}()
private lazy var infoContentLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hex: 0x6A7586)
label.font = .PFSC_R(ofSize: 15)
label.textAlignment = .center
label.numberOfLines = 0
return label
}()
private lazy var matchButton: UIButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(matchButtonClicked), for: .touchUpInside)
button.backgroundColor = .mainTextColor
button.setTitleColor(.white, for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.layer.cornerRadius = 3
button.clipsToBounds = true
return button
}()
private let pageType: MatchResult
init(_ pageType: MatchResult) {
self.pageType = pageType
super.init(nibName: nil, bundle: nil)
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
private func setupUI() {
gk_navTitle = "香港身份方案评估"
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
view.backgroundColor = UIColor.white
view.addSubview(topImageView)
view.addSubview(infoTitleLabel)
view.addSubview(infoContentLabel)
view.addSubview(matchButton)
topImageView.snp.makeConstraints { make in
make.width.equalTo(200)
make.height.equalTo(200)
make.top.equalToSuperview().offset(90 + k_Height_NavigationtBarAndStatuBar)
make.centerX.equalToSuperview()
}
infoTitleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(topImageView.snp.bottom).offset(8)
}
infoContentLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.left.greaterThanOrEqualToSuperview().offset(16)
make.right.lessThanOrEqualToSuperview().offset(-16)
}
matchButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(38)
make.right.equalToSuperview().offset(-38)
make.bottom.equalTo(view.layoutMarginsGuide.snp.bottom).offset(-68)
make.height.equalTo(48)
}
topImageView.image = UIImage(named: pageType.iconTitle())
infoTitleLabel.text = pageType.title()
infoContentLabel.text = pageType.content()
matchButton.setTitle(pageType.buttonTitle(), for: .normal)
if pageType == .success {
playMatchSuccessAnimation()
}
}
@objc private func matchButtonClicked() {
//
}
/// 播放匹配成功
private func playMatchSuccessAnimation() {
let aniView = LottieAnimationView(name: "survey_match_success")
aniView.isUserInteractionEnabled = false
aniView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenWidth)
aniView.contentMode = .scaleAspectFit
aniView.loopMode = .playOnce
view.addSubview(aniView)
aniView.play(completion: { _ in
aniView.removeFromSuperview()
})
}
}
//
// YHSurveyMatchingViewController.swift
// galaxy
//
// Created by alexzzw on 2025/3/27.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import Lottie
import UIKit
class YHSurveyMatchingViewController: YHBaseViewController {
private lazy var lottieView: LottieAnimationView = {
let aniView = LottieAnimationView(name: "survey_file_scan")
aniView.isUserInteractionEnabled = false
aniView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenWidth)
aniView.contentMode = .scaleAspectFit
aniView.loopMode = .loop
return aniView
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.text = "智能匹配中"
label.textColor = .mainTextColor
label.font = .PFSC_B(ofSize: 26)
label.textAlignment = .center
return label
}()
private lazy var infoContentLabel: UILabel = {
let label = UILabel()
label.text = "正在为您制定香港身份续签至永居方案"
label.textColor = UIColor(hex: 0x6A7586)
label.font = .PFSC_R(ofSize: 15)
label.textAlignment = .center
label.numberOfLines = 0
return label
}()
private lazy var progressView: UIProgressView = {
let view = UIProgressView()
view.progressTintColor = .mainTextColor
view.trackTintColor = UIColor(hexString: "#F5F6F8")
view.progress = 0.6
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
startAnimation()
}
private func setupUI() {
gk_navTitle = "香港身份方案评估"
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
view.backgroundColor = UIColor.white
view.addSubview(lottieView)
view.addSubview(infoTitleLabel)
view.addSubview(infoContentLabel)
view.addSubview(progressView)
lottieView.snp.makeConstraints { make in
make.width.equalTo(248)
make.height.equalTo(248)
make.top.equalToSuperview().offset(32 + k_Height_NavigationtBarAndStatuBar)
make.centerX.equalToSuperview()
}
infoTitleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(lottieView.snp.bottom).offset(18)
}
infoContentLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.left.greaterThanOrEqualToSuperview().offset(16)
make.right.lessThanOrEqualToSuperview().offset(-16)
}
progressView.snp.makeConstraints { make in
make.width.equalTo(220)
make.height.equalTo(4)
make.centerX.equalToSuperview()
make.bottom.equalTo(view.layoutMarginsGuide.snp.bottom).offset(-90)
}
}
private func startAnimation() {
lottieView.play(completion: { _ in
//
})
}
private func stopAnimation() {
lottieView.stop()
}
}
//
// YHSurveySubmitDoneViewController.swift
// galaxy
//
// Created by alexzzw on 2025/3/26.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSurveySubmitDoneViewController: YHBaseViewController {
private lazy var topImageView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "plan_question_submitted")
return view
}()
private lazy var infoTitleLabel: UILabel = {
let label = UILabel()
label.text = "问卷提交成功"
label.textColor = .mainTextColor
label.font = .PFSC_B(ofSize: 17)
label.textAlignment = .center
return label
}()
private lazy var infoContentLabel: UILabel = {
let label = UILabel()
label.text = "专属顾问将在24小时内与您联系,\n为您提供详细方案"
label.textColor = UIColor(hex: 0x6A7586)
label.font = .PFSC_R(ofSize: 14)
label.textAlignment = .center
label.numberOfLines = 0
return label
}()
private lazy var backHomeButton: UIButton = {
let button = UIButton(type: .custom)
button.setTitle("返回首页", for: .normal)
button.addTarget(self, action: #selector(backHomeClicked), for: .touchUpInside)
button.backgroundColor = .mainTextColor
button.setTitleColor(.white, for: .normal)
button.titleLabel?.font = .PFSC_R(ofSize: 14)
button.layer.cornerRadius = 3
button.clipsToBounds = true
return button
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
private func setupUI() {
gk_navTitle = "香港身份方案评估"
gk_navBarAlpha = 1.0
gk_navBackgroundColor = .white
view.backgroundColor = UIColor.white
view.addSubview(topImageView)
view.addSubview(infoTitleLabel)
view.addSubview(infoContentLabel)
view.addSubview(backHomeButton)
topImageView.snp.makeConstraints { make in
make.width.equalTo(127)
make.height.equalTo(92)
make.top.equalToSuperview().offset(129 + k_Height_NavigationtBarAndStatuBar)
make.centerX.equalToSuperview()
}
infoTitleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(topImageView.snp.bottom).offset(8)
}
infoContentLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(infoTitleLabel.snp.bottom).offset(8)
make.left.greaterThanOrEqualToSuperview().offset(16)
make.right.lessThanOrEqualToSuperview().offset(-16)
}
backHomeButton.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(infoContentLabel.snp.bottom).offset(24)
make.width.equalTo(100)
make.height.equalTo(40)
}
}
@objc private func backHomeClicked() {
UIViewController.current?.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .home)
}
}
//
// YHSurveyQuestionType.swift
// galaxy
//
// Created by alexzzw on 2025/3/26.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
enum YHSurveyQuestionType: String, CaseIterable {
case hasHKId = "是否香港身份"
case hasPR = "是否有永居服务"
case isEmployed = "是否受雇香港"
case hasHKCompany = "是否有香港公司"
case isHKCompanyOpen = "香港公司是否运营"
case isMainlandCompanyToHK = "是否有内地公司业务转到香港"
case isHKOffice = "是否香港办公室"
case hkResidence = "在港居住情况"
case hasChildrenEduPlan = "是否子女在港读书计划"
case hasHKInsurance = "是否香港保险"
case hasPRLicense = "是否香港驾照"
case isHKHolder = "是否香港个户"
case hkStayRate = "在港逗留频率"
func selections() -> [String] {
switch self {
case .hasHKId:
return ["是", "否"]
case .hasPR:
return ["是", "否"]
case .isEmployed:
return ["是", "否"]
case .hasHKCompany:
return ["是", "否"]
case .isHKCompanyOpen:
return ["是", "否"]
case .isMainlandCompanyToHK:
return ["是", "否"]
case .isHKOffice:
return ["是", "否"]
case .hkResidence:
return ["枚举值已购房", "已租房", "考虑购房", "考虑租房", "暂不考虑"]
case .hasChildrenEduPlan:
return ["是", "否"]
case .hasHKInsurance:
return ["是", "否"]
case .hasPRLicense:
return ["是", "否"]
case .isHKHolder:
return ["是", "否"]
case .hkStayRate:
return ["枚举值长期在港", "每周赴港至少一次", "每月去一次", "每季度去一次", "半年去一次", "超过半年去一次"]
}
}
}
//
// YHLookPlanButton.swift
// galaxy
//
// Created by Dufet on 2025/3/27.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHLookPlanButton: UIButton {
lazy var title1Label: UILabel = {
let lable = UILabel()
lable.textColor = .white
lable.textAlignment = .center
lable.font = UIFont.PFSC_M(ofSize: 16)
lable.text = "查看定制方案"
return lable
}()
lazy var title2Label: UILabel = {
let lable = UILabel()
lable.textColor = UIColor.init(hex: 0xFFFFFF, alpha: 0.6)
lable.textAlignment = .center
lable.font = UIFont.PFSC_R(ofSize: 11)
lable.text = "银河创世纪专业团队为您服务"
return lable
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
backgroundColor = .mainTextColor
self.layer.cornerRadius = 3.0
self.addSubview(title1Label)
self.addSubview(title2Label)
title1Label.snp.makeConstraints { make in
make.top.equalTo(12)
make.height.equalTo(22)
make.centerX.equalToSuperview()
}
title2Label.snp.makeConstraints { make in
make.top.equalTo(title1Label.snp.bottom).offset(0)
make.height.equalTo(14)
make.centerX.equalToSuperview()
}
}
}
//
// YHPlanItemView.swift
// galaxy
//
// Created by Dufet on 2025/3/27.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPlanItemView: UIView {
lazy var iconImgV: UIImageView = {
let v = UIImageView()
v.image = UIImage(named: "plan_item_icon")
return v
}()
lazy var titleLabel: UILabel = {
let lable = UILabel()
lable.textColor = .mainTextColor
lable.textAlignment = .center
lable.font = UIFont.PFSC_R(ofSize: 13)
lable.text = "您的续签评估等级为"
return lable
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
backgroundColor = .clear
self.addSubview(iconImgV)
self.addSubview(titleLabel)
iconImgV.snp.makeConstraints { make in
make.width.height.equalTo(12)
make.left.equalToSuperview()
make.right.equalTo(titleLabel.snp.left).offset(-4)
make.centerY.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.right.equalToSuperview()
make.centerY.equalToSuperview()
make.height.equalTo(17)
}
}
}
class YHPlanItemsView: UIView {
lazy var item1View: YHPlanItemView = {
let v = YHPlanItemView()
v.titleLabel.text = "私人定制"
return v
}()
lazy var item2View: YHPlanItemView = {
let v = YHPlanItemView()
v.titleLabel.text = "官方计划"
return v
}()
lazy var item3View: YHPlanItemView = {
let v = YHPlanItemView()
v.titleLabel.text = "模块化配置"
return v
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
backgroundColor = .clear
self.addSubview(item1View)
self.addSubview(item2View)
self.addSubview(item3View)
item1View.snp.makeConstraints { make in
make.right.equalTo(item2View.snp.left).offset(-24)
make.height.equalTo(17)
make.centerY.equalToSuperview()
}
item3View.snp.makeConstraints { make in
make.left.equalTo(item2View.snp.right).offset(24)
make.height.equalTo(17)
make.centerY.equalToSuperview()
}
item2View.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.height.equalTo(17)
}
}
}
//
// YHSurveyTableViewCell.swift
// galaxy
//
// Created by alexzzw on 2025/3/26.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSurveyTableViewCell: YHResignDocumentCell {
static let cellReuseIdentifier = "YHSurveyTableViewCell"
// MARK: - Question Type
enum QuestionType {
case singleChoice // 单选 (圆形按钮)
case multipleChoice // 多选 (方框按钮)
}
// MARK: - UI Elements
private lazy var questionLabel: UILabel = {
let label = UILabel()
label.font = .PFSC_M(ofSize: 15)
label.numberOfLines = 0
label.textColor = .mainTextColor
return label
}()
private lazy var optionsStackView: UIStackView = {
let stack = UIStackView()
stack.axis = .vertical
stack.spacing = 16
stack.distribution = .fillProportionally
return stack
}()
// MARK: - Properties
var optionSelected: ((Int) -> Void)?
private var questionType: QuestionType = .singleChoice
// MARK: - Lifecycle
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")
}
// MARK: - Setup
private func setupUI() {
updateCellCorner(.single)
subContainerView.addSubview(questionLabel)
subContainerView.addSubview(optionsStackView)
questionLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(24)
make.left.equalToSuperview().offset(18)
make.right.equalToSuperview().offset(-18)
}
optionsStackView.snp.makeConstraints { make in
make.top.equalTo(questionLabel.snp.bottom).offset(16)
make.left.equalToSuperview().offset(28)
make.right.equalToSuperview().offset(-18)
make.bottom.equalToSuperview().offset(-24).priority(.high)
}
}
// MARK: - Configuration
func configure(with question: String, options: [String], selectedIndex: Int? = nil, type: QuestionType = .singleChoice) {
questionLabel.text = question
questionType = type
// Clear previous options
optionsStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
// Add new options
for (index, option) in options.enumerated() {
let optionView = createOptionView(text: option, isSelected: index == selectedIndex, index: index)
optionsStackView.addArrangedSubview(optionView)
}
}
private func createOptionView(text: String, isSelected: Bool, index: Int) -> UIView {
let container = UIControl()
container.tag = index
container.addTarget(self, action: #selector(optionButtonTapped(_:)), for: .touchUpInside)
let label = UILabel()
label.text = text
label.textColor = .mainTextColor
label.font = .PFSC_R(ofSize: 14)
let icon = UIImageView()
icon.image = isSelected ? UIImage(named: "plan_question_checked") : UIImage(named: "plan_question_unchecked")
// icon.image = isSelected ? UIImage(systemName: questionType == .singleChoice ? "largecircle.fill.circle" : "checkmark.square.fill") :
// UIImage(systemName: questionType == .singleChoice ? "circle" : "square")
// icon.tintColor = isSelected ? .systemBlue : .lightGray
container.addSubview(icon)
container.addSubview(label)
icon.snp.makeConstraints { make in
make.left.centerY.equalToSuperview()
make.width.height.equalTo(14)
}
label.snp.makeConstraints { make in
make.left.equalTo(icon.snp.right).offset(8)
make.right.top.bottom.equalToSuperview()
}
return container
}
// MARK: - Actions
@objc private func optionButtonTapped(_ sender: UIControl) {
optionSelected?(sender.tag)
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "nav_black_24@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "nav_black_24@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "4.6_单选框@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "4.6_单选框@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plan_privacy_checked@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plan_privacy_checked@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plan_privacy_unchecked@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plan_privacy_unchecked@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plan_question_checked@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plan_question_checked@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plan_question_submitted@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plan_question_submitted@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plan_question_top_new@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plan_question_top_new@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plan_question_top_old@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plan_question_top_old@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plan_question_unchecked@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plan_question_unchecked@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "plan_survey_match_failure@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "plan_survey_match_failure@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "匹配完成@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "匹配完成@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
This diff is collapsed.
This diff is collapsed.
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