Commit a7b8e5c7 authored by David黄金龙's avatar David黄金龙

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

* 'qmas-1130' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS: (23 commits)
  //  家庭
  // 方案
  //  方案
  //  方案
  // 我的方案
  // 方案
  收入记录接口调试
  工作经验部分接口调试
  //  方案
  //  方案
  //  方案
  // 阿里云key
  收入记录相关逻辑优化
  //  方案
  工作经验UI
  // 方案
  工作经验首页UI
  优才收入记录UI相关
  职位细节
  工作经验
  ...
parents ac4879e8 c2f3b41a
This diff is collapsed.
...@@ -23,7 +23,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate { ...@@ -23,7 +23,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
var window: UIWindow? var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Thread.sleep(forTimeInterval: 0.5) // 应产品同学Nick要求 启动页时间展示长点 Thread.sleep(forTimeInterval: 0.5) // 应产品同学Nick要求 启动页时间展示长点
......
...@@ -34,8 +34,8 @@ class YHAliYunLogManager { ...@@ -34,8 +34,8 @@ class YHAliYunLogManager {
static let SLS_PROJECT_DEV = "dev-yinhe-app" static let SLS_PROJECT_DEV = "dev-yinhe-app"
static let SLS_PROJECT_RELEASE = "release-yinhe-app" static let SLS_PROJECT_RELEASE = "release-yinhe-app"
static let SLS_LOG_STORE = "yinhe_logstore" static let SLS_LOG_STORE = "yinhe_logstore"
static let SLS_KEY = "LTAI5tPV7UEB2Dqyaippchbq" static let SLS_KEY = "LTAI5tRiRFQGiM3DtDVpjHWr"
static let SLS_SECRET = "K6AOXrVnLzb0Zn6HtHm9qFv8DfmEFv" static let SLS_SECRET = "f9Uc3LNhxDWwlBS7rmdg4UPCTUL57M"
static let shared = createManager() static let shared = createManager()
private var config: LogProducerConfig? private var config: LogProducerConfig?
......
...@@ -307,6 +307,8 @@ extension YHHomeHoldViewPageViewController { ...@@ -307,6 +307,8 @@ extension YHHomeHoldViewPageViewController {
NotificationCenter.default.addObserver(self, selector: #selector(didRefreshMessageCount), name: YhConstant.YhNotification.didQiYuUnReadMsgCountChangeNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didRefreshMessageCount), name: YhConstant.YhNotification.didQiYuUnReadMsgCountChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didJumpToIdentityTab), name: YhConstant.YhNotification.didJumpToHomePageIdentityTabNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didJumpToNewsTab), name: YhConstant.YhNotification.didJumpToHomePageNewsTabNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didJumpToNewsTab), name: YhConstant.YhNotification.didJumpToHomePageNewsTabNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didJumpToLifeTab), name: YhConstant.YhNotification.didJumpToHomePageLifeTabNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didJumpToLifeTab), name: YhConstant.YhNotification.didJumpToHomePageLifeTabNotification, object: nil)
...@@ -368,6 +370,10 @@ extension YHHomeHoldViewPageViewController { ...@@ -368,6 +370,10 @@ extension YHHomeHoldViewPageViewController {
jumpToItemIndex(itemIndex: 2) jumpToItemIndex(itemIndex: 2)
} }
@objc func didJumpToIdentityTab() {
jumpToItemIndex(itemIndex: 1)
}
@objc func didLoadYhManager() { @objc func didLoadYhManager() {
if needShowManagerTipsView { if needShowManagerTipsView {
needShowManagerTipsView = false needShowManagerTipsView = false
......
...@@ -74,7 +74,7 @@ class YHServiceOrderListView: YHBaseViewController { ...@@ -74,7 +74,7 @@ class YHServiceOrderListView: YHBaseViewController {
} else if type == 4 { // 方案 } else if type == 4 { // 方案
//我的方案 //我的方案
let vc = YHMineSchemeViewController() let vc = YHMyNewSchemeViewController()
UIViewController.current?.navigationController?.pushViewController(vc) UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 5 { } else if type == 5 {
......
...@@ -19,6 +19,11 @@ class YHDocumentPromptTableViewCell: UITableViewCell { ...@@ -19,6 +19,11 @@ class YHDocumentPromptTableViewCell: UITableViewCell {
updatePrompt() updatePrompt()
} }
} }
var workList: Int = 0 {
didSet {
updateWorkPrompt()
}
}
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
...@@ -120,7 +125,14 @@ class YHDocumentPromptTableViewCell: UITableViewCell { ...@@ -120,7 +125,14 @@ class YHDocumentPromptTableViewCell: UITableViewCell {
subTitleLabel.attributed.text = a + aa subTitleLabel.attributed.text = a + aa
} }
} }
func updateWorkPrompt() {
let a: ASAttributedString = .init("温馨提示:优才获批后,您需要提供获批时在职公司盖章的赴港居留同意书,请您知悉。", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2))
let aa: ASAttributedString = .init("查看示例模板", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor), .underline(.single), .action {
})
subTitleLabel.attributed.text = a + aa
}
} }
//
// YHImproveSchemeViewController.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHImproveSchemeViewController: YHBaseViewController {
var orderId: Int = 0
let viewModel = YHSchemeViewModel()
var items:[YHImproveDetailModel] = []
var isPass: Bool = false
lazy var bgImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "my_scheme_improve_list_bg"))
view.frame = CGRectMake(0, 0, KScreenWidth, 528)
return view
}()
lazy var headerView: UIView = {
let view = UIView()
view.addSubview(greetLabel)
let tipsLabel = UILabel()
tipsLabel.numberOfLines = 0
tipsLabel.font = UIFont.PFSC_R(ofSize: 14)
tipsLabel.textColor = .white
tipsLabel.text = "您好,根据您的信息,这是我们为您定制的提升方案,方案详情如下:"
view.addSubview(tipsLabel)
let leftImgV = UIImageView(image: UIImage(named: "my_scheme_improve_wheatear_left"))
let rightImgV = UIImageView(image: UIImage(named: "my_scheme_improve_wheatear_right"))
view.addSubview(leftImgV)
view.addSubview(rightImgV)
greetLabel.snp.makeConstraints { make in
make.top.equalTo(32)
make.left.equalTo(leftImgV.snp.right).offset(8)
make.right.equalTo(rightImgV.snp.left).offset(-8)
make.height.equalTo(34)
}
leftImgV.snp.makeConstraints { make in
make.width.equalTo(14)
make.height.equalTo(24)
make.left.equalTo(24)
make.centerY.equalTo(greetLabel)
}
rightImgV.snp.makeConstraints { make in
make.width.equalTo(14)
make.height.equalTo(24)
make.centerY.equalTo(greetLabel)
}
tipsLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(greetLabel.snp.bottom).offset(12)
make.bottom.equalTo(-32)
}
return view
}()
lazy var greetLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 24)
label.textColor = .init(hex: 0xFFDEC8)
label.text = "尊敬的先生"
return label
}()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHImproveTargetListCell.self, forCellReuseIdentifier: YHImproveTargetListCell.cellReuseIdentifier)
tableView.register(YHIHKIdentityPlanCell.self, forCellReuseIdentifier: YHIHKIdentityPlanCell.cellReuseIdentifier)
tableView.bounces = false
return tableView
}()
lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(leftBtn)
view.addSubview(rightBtn)
leftBtn.snp.makeConstraints { make in
make.top.equalTo(8)
make.left.equalTo(16)
make.width.equalTo(rightBtn)
make.right.equalTo(rightBtn.snp.left).offset(-10)
make.height.equalTo(46)
}
rightBtn.snp.makeConstraints { make in
make.top.equalTo(8)
make.right.equalTo(-16)
make.height.equalTo(46)
}
return view
}()
lazy var rightBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .brandMainColor
btn.setTitle("重新选择提升目标", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
btn.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
btn.layer.cornerRadius = kCornerRadius3
return btn
}()
lazy var leftBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .white
btn.layer.borderColor = UIColor.brandMainColor.cgColor
btn.layer.borderWidth = 1.0
btn.setTitle("修改信息", for: .normal)
btn.setTitleColor(.brandMainColor, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
btn.addTarget(self, action: #selector(didLeftBtnClicked), for: .touchUpInside)
btn.layer.cornerRadius = kCornerRadius3
return btn
}()
@objc func didLeftBtnClicked() {
self.modifyInfo()
}
@objc func didRightBtnClicked() {
self.navigationController?.popViewController(animated: true)
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .init(hex: 0xF6F7FA)
gk_navTitle = "提升方案"
gk_navTitleColor = .white
gk_backImage = UIImage(named: "back_icon_white")
gk_navigationBar.backgroundColor = .clear
self.view.addSubview(bgImgView)
self.view.addSubview(tableView)
self.view.addSubview(bottomView)
tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(bottomView.snp.top)
}
bottomView.isHidden = isPass
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(isPass ? 0.0 : 64+k_Height_safeAreaInsetsBottom())
}
view.bringSubviewToFront(gk_navigationBar)
tableView.reloadData()
}
override func backItemClick(_ sender: Any) {
self.navigationController?.popToRootViewController(animated: true)
}
func requestData() {
viewModel.getImproveDetail(orderId: orderId) {
[weak self] success, error in
guard let self = self else { return }
items.removeAll()
items.append(contentsOf: viewModel.improveDetailModel.improvePlanItem)
tableView.reloadData()
greetLabel.text = "尊敬的\(viewModel.improveDetailModel.username)\(viewModel.improveDetailModel.sex)"
}
}
func modifyInfo() {
YHHUD.show(.progress(message: "修改中..."))
viewModel.modifyInfo(orderId: orderId) {
[weak self] success, error in
guard let self = self else { return }
YHHUD.hide()
if success {
let vc = YHInformationPerfectListVC()
vc.orderId = orderId
navigationController?.pushViewController(vc)
}
YHHUD.flash(message: error?.errorMsg ?? "修改失败")
}
}
}
extension YHImproveSchemeViewController : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 2
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHIHKIdentityPlanCell.cellReuseIdentifier, for: indexPath) as! YHIHKIdentityPlanCell
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveTargetListCell.cellReuseIdentifier, for: indexPath) as! YHImproveTargetListCell
cell.arr = self.items
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.row == 1 {
UIViewController.current?.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .home)
NotificationCenter.default.post(name: YhConstant.YhNotification.didJumpToHomePageIdentityTabNotification, object: nil)
}
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return self.headerView
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.1
}
}
extension YHImproveSchemeViewController: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let scrollY = scrollView.contentOffset.y
if scrollY >= 0.0 {
bgImgView.frame.origin.y = -scrollY
} else {
bgImgView.frame.origin.y = 0.0
}
if scrollY >= 44.0 {
gk_navigationBar.backgroundColor = .init(hex: 0x082F84)
} else {
gk_navigationBar.backgroundColor = .clear
}
}
}
//
// YHSchemeModel.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHSchemeModel: NSObject {
}
class YHComprehensiveEevaluationModel: SmartCodable {
var standard_name: String = ""
var standard_key: String = ""
var is_pass: Bool = false
var is_select: Bool = false
required init() {
}
}
class YHMySchemeDetailModel: SmartCodable {
var comprehensive_evaluation: [YHComprehensiveEevaluationModel] = []
var comprehensive_evaluation_selected: [String] = []
var industry_positioning: Int = 0
var plan_skip_status: Bool = false
var supplement_skip_status: Bool = false
var username: String = ""
var sex: String = ""
required init() {
}
}
class YHImproveDetailModel: SmartCodable {
var hk_require: String = ""
var improve_content: String = ""
var sort_num: Int = -1
var templates: [YHSchemeTemplatesModel] = []
required init() {
}
}
class YHSchemeTemplatesModel: SmartCodable {
var name: String = ""
var url: String = ""
required init() {
}
}
class YHImproveSchemeDetailModel: SmartCodable {
var improvePlanItem: [YHImproveDetailModel] = []
var username: String = ""
var sex: String = ""
required init() {
}
}
//
// YHComprehensiveEvaluationCell.swift
// galaxy
//
// Created by Dufet on 2024/11/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHComprehensiveEvaluationCell: UITableViewCell {
static let cellReuseIdentifier = "YHComprehensiveEvaluationCell"
var isPass: Bool = false {
didSet {
tipsLabel.attributed.text = isPass ? passText : unPassText
}
}
lazy var markImgV: UIImageView = {
let v = UIImageView(image: UIImage(named: "my_scheme_mark"))
return v
}()
lazy var evaluationLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
label.text = "综合评估"
return label
}()
lazy var yellowContentView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.init(hex: 0xCF9764, alpha: 0.12)
view.layer.cornerRadius = 4.0
view.clipsToBounds = true
return view
}()
lazy var tipsLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.attributed.text = unPassText
return label
}()
lazy var passText: ASAttributedString = {
let aa: ASAttributedString = .init("经初步评估,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("您符合【优秀人才入境计划-综合计分制】甄选条件", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638)))
let cc: ASAttributedString = .init(",您在以下方面具备明显优势,为您感到开心!接下来辛苦您根据指引配合准备申请材料", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
return aa+bb+cc
}()
lazy var unPassText: ASAttributedString = {
let aa: ASAttributedString = .init("经初步评估,", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("您目前已符合【优秀人才入境计划 - 综合计分制】的部分重要甄选条件", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638)))
let cc: ASAttributedString = .init(",在如下方面具备优势,足以证明您的优秀之处!考虑到优才计划的的多维度要求,以及您目前已经具备的良好基础,如果您能进一步去孵化其他条件,后续的申请将会更具竞争力", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
return aa+bb+cc
}()
lazy var bgView: UIView = {
let view = UIView()
view.backgroundColor = .clear
return view
}()
lazy var whiteBottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.addSubview(bgView)
contentView.addSubview(whiteBottomView)
contentView.addSubview(markImgV)
contentView.addSubview(evaluationLabel)
contentView.addSubview(yellowContentView)
yellowContentView.addSubview(tipsLabel)
bgView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.equalToSuperview()
make.height.equalTo(416)
}
whiteBottomView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.equalTo(bgView.snp.bottom).offset(0)
make.bottom.equalToSuperview()
}
markImgV.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.equalTo(4)
make.height.equalTo(16)
make.centerY.equalTo(evaluationLabel)
}
evaluationLabel.snp.makeConstraints { make in
make.top.equalTo(238)
make.height.equalTo(24)
make.left.equalTo(markImgV.snp.right).offset(8)
make.right.equalTo(-32)
}
yellowContentView.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(evaluationLabel.snp.bottom).offset(16)
make.bottom.equalTo(-24)
}
tipsLabel.snp.makeConstraints { make in
make.left.equalTo(12)
make.right.equalTo(-12)
make.top.equalTo(12)
make.bottom.equalTo(-12)
}
}
}
//
// YHDocumentListCell.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHDocumentListCell: UITableViewCell {
static let cellReuseIdentifier = "YHDocumentListCell"
var rightBtnClick:(()->())?
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.clipsToBounds = true
return view
}()
lazy var dotLine: YHDashLineView = {
let view = YHDashLineView(strokeColor: UIColor.init(hex: 0xF7F2ED).cgColor, lineWidth: 0.8, lineDashPattern: [3, 3])
return view
}()
lazy var markImgV: UIImageView = {
let v = UIImageView(image: UIImage(named: "my_scheme_mark"))
return v
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
label.text = "文书清单"
return label
}()
lazy var tips1Label: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let aa: ASAttributedString = .init("您的文书清单,包括推荐信、赴港计划书。文书编写后会发送至APP【我的文书】,与您一起沟通定稿,预计", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("3周-4周", .font(UIFont.PFSC_M(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638)))
let cc: ASAttributedString = .init("左右完成,需要咱们共同配合完成噢", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
label.attributed.text = aa+bb+cc
return label
}()
lazy var rightBtn: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
button.backgroundColor = UIColor(hex: 0xd48638).withAlphaComponent(0.08)
button.contentHorizontalAlignment = .center
button.setTitle("文书写作", for: .normal)
button.setImage(UIImage(named: "scheme_button_icon"), for: .normal)
button.setTitleColor(UIColor(hex:0xd48638), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 20, right: 20)
button.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
return button
}()
@objc func didRightBtnClicked() {
rightBtnClick?()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.clipsToBounds = true
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(dotLine)
whiteContentView.addSubview(markImgV)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(tips1Label)
whiteContentView.addSubview(rightBtn)
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.bottom.equalToSuperview()
}
dotLine.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(0)
make.height.equalTo(1)
}
markImgV.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.equalTo(4)
make.height.equalTo(16)
make.centerY.equalTo(titleLabel)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(26)
make.height.equalTo(24)
make.left.equalTo(markImgV.snp.right).offset(8)
make.right.equalTo(-24)
}
tips1Label.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(titleLabel.snp.bottom).offset(18)
make.bottom.equalTo(-26)
}
rightBtn.snp.makeConstraints { make in
make.width.equalTo(76)
make.height.equalTo(27)
make.right.equalTo(-24)
make.top.equalTo(titleLabel)
}
rightBtn.iconInRight(with: 2)
}
}
//
// YHHKRequiredItemListCell.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHHKRequiredItemListCell: UITableViewCell {
static let cellReuseIdentifier = "YHHKRequiredItemListCell"
var passArr: [YHComprehensiveEevaluationModel] = [] {
didSet {
listView.removeSubviews()
listView.addSubview(topView)
topView.snp.remakeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(42)
}
var lastItemView: YHHKRequiredItemView? = nil
for (index, model) in passArr.enumerated() {
let itemView = YHHKRequiredItemView(frame: .zero)
itemView.text = model.standard_name
itemView.backgroundColor = index%2 == 0 ? .white : .init(hex: 0xFBF7F3)
listView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
if let lastItemView = lastItemView {
make.top.equalTo(lastItemView.snp.bottom)
} else {
make.top.equalTo(topView.snp.bottom)
}
if index == passArr.count-1 {
make.bottom.equalToSuperview()
}
}
lastItemView = itemView
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
lazy var topView: UIView = {
let view = UIView()
view.backgroundColor = .init(hex: 0xFBF7F3)
let requireLabel = UILabel()
requireLabel.text = "港府要求"
requireLabel.font = UIFont.PFSC_M(ofSize: 13)
requireLabel.textColor = UIColor.init(hex: 0xD48638)
view.addSubview(requireLabel)
let fitLabel = UILabel()
fitLabel.text = "是否符合"
fitLabel.font = UIFont.PFSC_M(ofSize: 13)
fitLabel.textColor = UIColor.init(hex: 0x6D788A)
view.addSubview(fitLabel)
let line = UIView()
line.backgroundColor = UIColor.init(hex: 0xF7F2ED)
view.addSubview(line)
requireLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalTo(12)
}
fitLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.right.equalTo(-12)
}
line.snp.makeConstraints { make in
make.right.equalTo(-72)
make.top.bottom.equalToSuperview()
make.width.equalTo(0.5)
}
return view
}()
lazy var whiteBgView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var listView: UIView = {
let view = UIView()
view.layer.cornerRadius = 4.0
view.layer.borderWidth = 0.5
view.layer.borderColor = UIColor.init(hex: 0xF7F2ED).cgColor
view.clipsToBounds = true
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.clipsToBounds = true
self.addSubview(whiteBgView)
self.addSubview(listView)
listView.addSubview(topView)
whiteBgView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.bottom.equalToSuperview()
}
listView.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalToSuperview()
make.bottom.equalTo(-26)
}
topView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(42)
}
}
}
//
// YHHKRequiredItemView.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHHKRequiredItemView: UIView {
var text: String = "" {
didSet {
titleLabel.text = text
}
}
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 13)
label.textColor = .mainTextColor
return label
}()
lazy var requireView: UIView = {
let view = UIView()
let hookImgV = UIImageView(image: UIImage(named: "my_scheme_require_fit"))
view.addSubview(hookImgV)
hookImgV.snp.makeConstraints { make in
make.width.height.equalTo(14)
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
}
return view
}()
lazy var topSeparaterLine: UIView = {
let view = UIView()
view.backgroundColor = UIColor.init(hex: 0xF7F2ED)
return view
}()
lazy var verticalSeparaterLine: UIView = {
let view = UIView()
view.backgroundColor = UIColor.init(hex: 0xF7F2ED)
return view
}()
override init(frame: CGRect) {
super.init(frame: .zero)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupUI() {
self.addSubview(titleLabel)
self.addSubview(requireView)
self.addSubview(topSeparaterLine)
self.addSubview(verticalSeparaterLine)
requireView.snp.makeConstraints { make in
make.width.equalTo(72)
make.right.top.bottom.equalToSuperview()
}
topSeparaterLine.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(0.5)
}
verticalSeparaterLine.snp.makeConstraints { make in
make.left.equalTo(requireView.snp.left)
make.top.bottom.equalToSuperview()
make.width.equalTo(0.5)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(12)
make.top.equalTo(12)
make.bottom.equalTo(-12)
make.right.equalTo(requireView.snp.left).offset(-12)
}
}
}
//
// YHIHKIdentityPlanCell.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHIHKIdentityPlanCell: UITableViewCell {
static let cellReuseIdentifier = "YHIHKIdentityPlanCell"
lazy var titleLabel: UILabel = {
let label = UILabel()
let aa: ASAttributedString = .init("了解更多", .font(UIFont.PFSC_B(ofSize: 18)),.foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("香港身份计划", .font(UIFont.PFSC_B(ofSize: 18)),.foreground(UIColor.brandMainColor))
label.attributed.text = aa+bb
return label
}()
lazy var subtitleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .mainTextColor(alpha: 0.5)
label.text = "助您香港身份申请无忧"
return label
}()
lazy var knowBtn: UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("立即了解", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = .brandMainColor
btn.titleLabel?.font = .PFSC_M(ofSize: 12)
return btn
}()
lazy var bgImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "my_shceme_plan_bg"))
view.clipsToBounds = true
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
contentView.backgroundColor = .clear
self.backgroundColor = .clear
selectionStyle = .none
contentView.addSubview(bgImgView)
bgImgView.snp.makeConstraints { make in
make.left.equalTo(17)
make.right.equalTo(-17)
make.top.equalToSuperview()
make.height.equalTo(bgImgView.snp.width).multipliedBy(93.0/(KScreenWidth-34.0))
make.bottom.equalTo(-33)
}
// titleLabel.snp.makeConstraints { make in
// make.left.equalTo(18)
// make.top.equalTo(22)
// make.height.equalTo(25)
// }
//
// subtitleLabel.snp.makeConstraints { make in
// make.left.equalTo(18)
// make.top.equalTo(titleLabel.snp.bottom).offset(4)
// make.height.equalTo(20)
// }
//
// knowBtn.snp.makeConstraints { make in
// make.right.equalTo(-24)
// make.centerY.equalToSuperview()
// make.width.equalTo(72)
// make.height.equalTo(32)
// }
}
}
//
// YHImproveHKView.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHImproveHKView: UIView {
var item = YHImproveDetailModel() {
didSet {
titleLabel.text = "港府要求:\(item.hk_require)"
tipsLabel.text = item.improve_content
numLabel.text = "\(item.sort_num)"
showTemplateBtn = item.templates.count > 0
}
}
var showTemplateBtn: Bool = true {
didSet {
templateBtn.isHidden = !showTemplateBtn
templateBtn.snp.updateConstraints { make in
make.height.equalTo(showTemplateBtn ? 20 : 0)
make.top.equalTo(tipsLabel.snp.bottom).offset(showTemplateBtn ? 12 : 0)
make.bottom.equalTo(showTemplateBtn ? -14 : 0)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
lazy var grayView: UIView = {
let view = UIView()
view.layer.cornerRadius = 4.0
view.clipsToBounds = true
view.backgroundColor = .init(hex: 0xF8F9FB)
return view
}()
lazy var numImgView: UIImageView = {
let iconV = UIImageView(image: UIImage(named: "my_scheme_num_bg"))
iconV.addSubview(numLabel)
numLabel.snp.makeConstraints { make in
make.top.equalToSuperview()
make.centerX.equalToSuperview()
make.height.equalTo(20)
}
return iconV
}()
lazy var numLabel: UILabel = {
let label = UILabel()
label.text = "19"
label.font = UIFont(name: "DINAlternate-Bold", size: 14)
label.textColor = .white
return label
}()
lazy var markView: UIView = {
let view = UIView()
view.backgroundColor = .brandMainColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
lazy var improveTargetContentView: UIView = {
let view = UIView()
view.layer.cornerRadius = 2.0
view.clipsToBounds = true
view.backgroundColor = .white
return view
}()
lazy var iconImgView: UIImageView = {
let v = UIImageView(image: UIImage(named: "my_scheme_improve_icon"))
return v
}()
lazy var subtitleLabel: UILabel = {
let label = UILabel()
label.text = "提升方向"
label.font = UIFont.PFSC_B(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
lazy var tipsLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 13)
label.textColor = .init(hex: 0x6D788A)
return label
}()
lazy var templateBtn: UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("材料示例", for: .normal)
btn.setTitleColor(.brandMainColor, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 14)
btn.setImage(UIImage(named: "blue_right_arrow"), for: .normal)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 10, left: 20, bottom: 20, right: 10)
btn.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
return btn
}()
override init(frame: CGRect) {
super.init(frame: .zero)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc func didRightBtnClicked() {
let view = YHImproveSchemeTemplateListView.listView()
view.items = item.templates
view.show()
}
func setupUI() {
self.addSubview(grayView)
self.addSubview(markView)
self.addSubview(titleLabel)
self.addSubview(numImgView)
self.addSubview(improveTargetContentView)
improveTargetContentView.addSubview(iconImgView)
improveTargetContentView.addSubview(subtitleLabel)
improveTargetContentView.addSubview(tipsLabel)
improveTargetContentView.addSubview(templateBtn)
grayView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
markView.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(titleLabel).offset(3)
make.width.equalTo(3)
make.height.equalTo(12)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(markView.snp.right).offset(9)
make.top.equalTo(16)
make.right.equalTo(numImgView.snp.left).offset(-5)
}
numImgView.snp.makeConstraints { make in
make.top.equalTo(0)
make.right.equalTo(-8)
make.width.equalTo(19)
make.height.equalTo(22)
}
improveTargetContentView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(16)
make.left.equalTo(8)
make.right.equalTo(-8)
make.bottom.equalTo(-8)
}
iconImgView.snp.makeConstraints { make in
make.width.height.equalTo(18)
make.left.top.equalTo(12)
}
subtitleLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgView.snp.right).offset(6)
make.centerY.equalTo(iconImgView)
make.height.equalTo(20)
}
tipsLabel.snp.makeConstraints { make in
make.left.equalTo(12)
make.right.equalTo(-12)
make.top.equalTo(subtitleLabel.snp.bottom).offset(8)
}
templateBtn.snp.makeConstraints { make in
make.left.equalTo(12)
make.top.equalTo(tipsLabel.snp.bottom).offset(12)
make.width.equalTo(76)
make.height.equalTo(20)
make.bottom.equalTo(-14)
}
templateBtn.iconInRight(with: 0)
}
}
//
// YHImproveRequireItemView.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHImproveItem {
var title: String = ""
var isSelect: Bool = false
init(title: String, isSelect: Bool) {
self.title = title
self.isSelect = isSelect
}
}
class YHImproveRequireItemView: UIView {
var item: YHComprehensiveEevaluationModel = YHComprehensiveEevaluationModel() {
didSet {
let a: ASAttributedString = .init(string:"港府要求:" , .font(UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init(string: item.standard_name , .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
titleLabel.attributed.text = a + b
isSelect = item.is_select
}
}
var isSelect: Bool = false {
didSet {
self.backgroundColor = isSelect ? .init(hex: 0xFBF7F3) : .init(hex: 0xF8F9FB)
self.selectImgV.image = UIImage(named: isSelect ? "my_shceme_improve_select" : "my_shceme_improve_unselect")
self.layer.borderColor = isSelect ? UIColor.init(hex: 0xD48638).cgColor : nil
self.layer.borderWidth = isSelect ? 1.0: 0.0
}
}
lazy var selectImgV = {
let imgV = UIImageView(image: UIImage(named: "my_shceme_improve_unselect"))
return imgV
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 13)
label.textColor = .mainTextColor
return label
}()
override init(frame: CGRect) {
super.init(frame: .zero)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupUI() {
let tap = UITapGestureRecognizer(target: self, action: #selector(tap))
self.addGestureRecognizer(tap)
self.backgroundColor = .init(hex: 0xF8F9FB)
self.layer.cornerRadius = 4.0
self.clipsToBounds = true
self.addSubview(selectImgV)
self.addSubview(titleLabel)
selectImgV.snp.makeConstraints { make in
make.width.height.equalTo(14)
make.left.equalTo(12)
make.centerY.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(12)
make.bottom.equalTo(-12)
make.right.equalTo(-12)
make.left.equalTo(selectImgV.snp.right).offset(12)
}
}
@objc func tap() {
item.is_select = !item.is_select
isSelect = item.is_select
}
}
//
// YHImproveSchemeCell.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHImproveSchemeCell: UITableViewCell {
static let cellReuseIdentifier = "YHImproveSchemeCell"
var rightBtnClick:(()->())?
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.clipsToBounds = true
return view
}()
lazy var dotLine: YHDashLineView = {
let view = YHDashLineView(strokeColor: UIColor.init(hex: 0xF7F2ED).cgColor, lineWidth: 0.8, lineDashPattern: [3, 3])
return view
}()
lazy var markImgV: UIImageView = {
let v = UIImageView(image: UIImage(named: "my_scheme_mark"))
return v
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
label.text = "提升方案"
return label
}()
lazy var tips1Label: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let aa: ASAttributedString = .init("已根据港府甄选条件,为您规划后续提升方案,您可根据实际情况进行提升~", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
label.attributed.text = aa
return label
}()
lazy var rightBtn: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
button.backgroundColor = UIColor(hex: 0xd48638).withAlphaComponent(0.08)
button.contentHorizontalAlignment = .center
button.setTitle("查看详情", for: .normal)
button.setImage(UIImage(named: "scheme_button_icon"), for: .normal)
button.setTitleColor(UIColor(hex:0xd48638), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 20, right: 20)
button.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
return button
}()
@objc func didRightBtnClicked() {
rightBtnClick?()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.clipsToBounds = true
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(dotLine)
whiteContentView.addSubview(markImgV)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(tips1Label)
whiteContentView.addSubview(rightBtn)
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.bottom.equalToSuperview()
}
dotLine.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(0)
make.height.equalTo(1)
}
markImgV.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.equalTo(4)
make.height.equalTo(16)
make.centerY.equalTo(titleLabel)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(26)
make.height.equalTo(24)
make.left.equalTo(markImgV.snp.right).offset(8)
make.right.equalTo(-24)
}
tips1Label.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(titleLabel.snp.bottom).offset(18)
make.bottom.equalTo(-32)
}
rightBtn.snp.makeConstraints { make in
make.width.equalTo(76)
make.height.equalTo(27)
make.right.equalTo(-24)
make.top.equalTo(titleLabel)
}
rightBtn.iconInRight(with: 2)
}
}
//
// YHImproveSchemeTemplateListCell.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHImproveSchemeTemplateListCell: UITableViewCell {
static let cellReuseIdentifier = "YHImproveSchemeTemplateListCell"
var model = YHSchemeTemplatesModel() {
didSet {
titleLabel.text = model.name
}
}
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: UIViewController.current)
return tool
}()
lazy var lineView:UIView = {
let view = UIView()
view.backgroundColor = .init(hex: 0xE9ECF0)
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .mainTextColor
label.numberOfLines = 0
return label
}()
lazy var rightBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .init(hex: 0xF5F6F8)
btn.setTitle("查看示例", for: .normal)
btn.setTitleColor(.mainTextColor, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 11)
btn.addTarget(self, action: #selector(didBtnClicked), for: .touchUpInside)
btn.layer.cornerRadius = kCornerRadius2
return btn
}()
@objc func didBtnClicked() {
if !model.url.isEmpty {
self.previewFileTool.openXLSXRemoteFile(urlString:model.url, fileName:"预览")
}
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.clipsToBounds = true
contentView.addSubview(titleLabel)
contentView.addSubview(rightBtn)
contentView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(0.5)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(16)
make.bottom.equalTo(-16)
make.right.equalTo(rightBtn.snp.left).offset(-40)
}
rightBtn.snp.makeConstraints { make in
make.width.equalTo(60)
make.height.equalTo(25)
make.right.equalTo(-20)
make.centerY.equalToSuperview()
}
}
}
//
// YHImproveSchemeTemplateListView.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHImproveSchemeTemplateListView: UIView {
static func listView() -> YHImproveSchemeTemplateListView {
let v = YHImproveSchemeTemplateListView(frame: UIScreen.main.bounds)
return v
}
var items: [YHSchemeTemplatesModel] = [] {
didSet {
tableView.reloadData()
}
}
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = .alertMaskColor
return view
}()
lazy var whiteView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 4.0
return view
}()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHImproveSchemeTemplateListCell.self, forCellReuseIdentifier: YHImproveSchemeTemplateListCell.cellReuseIdentifier)
tableView.bounces = false
return tableView
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textAlignment = .center
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = .mainTextColor
label.text = "材料示例"
return label
}()
lazy var closeBtn: UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named:"my_cer_sheet_close"), for: .normal)
btn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc func show() {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
@objc func dismiss() {
self.removeFromSuperview()
}
func createUI() {
self.addSubview(blackMaskView)
self.addSubview(whiteView)
whiteView.addSubview(titleLabel)
whiteView.addSubview(tableView)
whiteView.addSubview(closeBtn)
blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
whiteView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(628)
}
titleLabel.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(52)
}
closeBtn.snp.makeConstraints { make in
make.width.height.equalTo(24)
make.centerY.equalTo(titleLabel)
make.right.equalTo(-24)
}
tableView.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.bottom.equalToSuperview()
make.top.equalTo(titleLabel.snp.bottom).offset(0)
}
}
}
extension YHImproveSchemeTemplateListView : UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveSchemeTemplateListCell.cellReuseIdentifier, for: indexPath) as! YHImproveSchemeTemplateListCell
return cell
}
let defaultCell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
return defaultCell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.1
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.1
}
}
//
// YHImproveTargetCell.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHImproveTargetCell: UITableViewCell {
static let cellReuseIdentifier = "YHImproveTargetCell"
var submitClick:(()->())?
var unpassArr: [YHComprehensiveEevaluationModel] = [] {
didSet {
}
}
func updateRequireArrUI() {
listView.removeSubviews()
var lastView: YHImproveRequireItemView? = nil
for (index, item) in unpassArr.enumerated() {
let view = YHImproveRequireItemView(frame: .zero)
view.item = item
listView.addSubview(view)
view.snp.makeConstraints { make in
make.left.right.equalToSuperview()
if let lastView = lastView {
make.top.equalTo(lastView.snp.bottom).offset(16)
} else {
make.top.equalTo(0)
}
if index == unpassArr.count-1 {
make.bottom.equalTo(0)
}
}
lastView = view
}
}
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = 6
view.clipsToBounds = true
return view
}()
lazy var topBgView: UIImageView = {
let imgV = UIImageView(image: UIImage(named: "my_scheme_improve_bg"))
return imgV
}()
lazy var markImgV: UIImageView = {
let v = UIImageView(image: UIImage(named: "my_scheme_mark"))
return v
}()
lazy var improveLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
label.text = "提升目标"
return label
}()
lazy var optionsLabel: UILabel = {
let optionsLabel = UILabel()
optionsLabel.text = "多选"
optionsLabel.textAlignment = .center
optionsLabel.font = .PFSC_M(ofSize: 11)
optionsLabel.textColor = .init(hex: 0x949494)
optionsLabel.layer.cornerRadius = 4.0
optionsLabel.clipsToBounds = true
optionsLabel.backgroundColor = .init(hex: 0x949494, alpha: 0.12)
optionsLabel.frame = CGRectMake(0, 0, 30, 16)
return optionsLabel
}()
private lazy var titleLabel : UITextView = {
let lable0 = UITextView()
lable0.isScrollEnabled = false
lable0.isEditable = false
lable0.isSelectable = false
lable0.backgroundColor = .clear
let title: ASAttributedString = .init(string:"请选择您的提升目标,我们将为您生成专属提升方案~" , .font(UIFont.PFSC_M(ofSize: 15)), .foreground(UIColor.mainTextColor))
var options: ASAttributedString = " \(.view(optionsLabel, .original(.center)))"
lable0.attributed.text = title + options
return lable0
}()
lazy var listView: UIView = {
let view = UIView()
return view
}()
lazy var bottomBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .init(hex: 0xD48638)
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 16)
btn.layer.cornerRadius = 3
btn.setTitle("提交,获取详细方案", for: .normal)
btn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside)
return btn
}()
@objc func didBottomBtnClicked() {
submitClick?()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.clipsToBounds = true
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(topBgView)
whiteContentView.addSubview(markImgV)
whiteContentView.addSubview(improveLabel)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(listView)
whiteContentView.addSubview(bottomBtn)
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.bottom.equalToSuperview()
}
topBgView.snp.makeConstraints { make in
make.left.top.right.equalToSuperview()
make.height.equalTo(105)
}
markImgV.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.equalTo(4)
make.height.equalTo(16)
make.centerY.equalTo(improveLabel)
}
improveLabel.snp.makeConstraints { make in
make.top.equalTo(24)
make.height.equalTo(24)
make.left.equalTo(markImgV.snp.right).offset(8)
make.right.equalTo(-24)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(improveLabel.snp.bottom).offset(16)
}
listView.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(titleLabel.snp.bottom).offset(16)
}
bottomBtn.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(listView.snp.bottom).offset(24)
make.bottom.equalTo(-24)
make.height.equalTo(46)
}
}
}
//
// YHImproveTargetListCell.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHImproveTargetListCell: UITableViewCell {
static let cellReuseIdentifier = "YHImproveTargetListCell"
var arr: [YHImproveDetailModel] = [] {
didSet {
listView.removeSubviews()
var lastView: YHImproveHKView? = nil
for (i, item) in arr.enumerated() {
let itemView = YHImproveHKView(frame: .zero)
itemView.item = item
listView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
if let lastView = lastView {
make.top.equalTo(lastView.snp.bottom).offset(16)
} else {
make.top.equalTo(0)
}
if i == arr.count-1 {
make.bottom.equalTo(0)
}
}
lastView = itemView
}
}
}
lazy var whiteContentView: UIView = {
let v = UIView()
v.backgroundColor = .white
v.layer.cornerRadius = 6.0
v.clipsToBounds = true
return v
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
label.text = "提升方案"
return label
}()
lazy var subtitleLabel: UILabel = {
let label = UILabel()
label.text = "接下来请您依据如下指引进行提升准备"
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = .init(hex: 0x8993A2)
return label
}()
lazy var lineView: UIView = {
let v = UIView()
v.backgroundColor = .init(hex: 0xE9ECF0)
return v
}()
lazy var listView: UIView = {
let v = UIView()
return v
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
contentView.backgroundColor = .clear
self.backgroundColor = .clear
selectionStyle = .none
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(subtitleLabel)
whiteContentView.addSubview(lineView)
whiteContentView.addSubview(listView)
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(0)
make.bottom.equalTo(-16)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(16)
make.height.equalTo(24)
make.width.equalTo(69)
}
subtitleLabel.snp.makeConstraints { make in
make.bottom.equalTo(titleLabel)
make.left.equalTo(titleLabel.snp.right).offset(6)
make.right.equalTo(-16)
make.height.equalTo(20)
}
lineView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.height.equalTo(0.5)
}
listView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-16)
make.top.equalTo(lineView.snp.bottom).offset(20)
}
}
}
//
// YHIndustryLocationCell.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHIndustryLocationCell: UITableViewCell {
static let cellReuseIdentifier = "YHIndustryLocationCell"
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.clipsToBounds = true
return view
}()
lazy var dotLine: YHDashLineView = {
let view = YHDashLineView(strokeColor: UIColor.init(hex: 0xF7F2ED).cgColor, lineWidth: 0.8, lineDashPattern: [3, 3])
return view
}()
lazy var markImgV: UIImageView = {
let v = UIImageView(image: UIImage(named: "my_scheme_mark"))
return v
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
label.text = "行业定位"
return label
}()
lazy var tips1Label: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .mainTextColor
label.numberOfLines = 0
label.text = "根据您目前给来的材料,初步建议您申请的行业:"
return label
}()
lazy var tips2Label: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 16)
label.textColor = .init(hex: 0xD48638)
label.numberOfLines = 0
label.text = "其他(环境科学、HSE)"
return label
}()
lazy var tips3Label: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .init(hex: 0x8993A2)
label.numberOfLines = 0
label.text = "后续会根据您文书准备的补充情况来最终确定,如有修改会再告知您。"
return label
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.clipsToBounds = true
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(dotLine)
whiteContentView.addSubview(markImgV)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(tips1Label)
whiteContentView.addSubview(tips2Label)
whiteContentView.addSubview(tips3Label)
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.bottom.equalToSuperview()
}
dotLine.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(0)
make.height.equalTo(1)
}
markImgV.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.equalTo(4)
make.height.equalTo(16)
make.centerY.equalTo(titleLabel)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(26)
make.height.equalTo(24)
make.left.equalTo(markImgV.snp.right).offset(8)
make.right.equalTo(-24)
}
tips1Label.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(titleLabel.snp.bottom).offset(16)
}
tips2Label.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(tips1Label.snp.bottom).offset(6)
}
tips3Label.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(tips2Label.snp.bottom).offset(6)
make.bottom.equalTo(-26)
}
}
}
//
// YHMaterialListCell.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHMaterialListCell: UITableViewCell {
static let cellReuseIdentifier = "YHMaterialListCell"
var rightBtnClick:(()->())?
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.clipsToBounds = true
return view
}()
lazy var dotLine: YHDashLineView = {
let view = YHDashLineView(strokeColor: UIColor.init(hex: 0xF7F2ED).cgColor, lineWidth: 0.8, lineDashPattern: [3, 3])
return view
}()
lazy var markImgV: UIImageView = {
let v = UIImageView(image: UIImage(named: "my_scheme_mark"))
return v
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 17)
label.textColor = .mainTextColor
label.text = "资料清单"
return label
}()
lazy var tips1Label: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let aa: ASAttributedString = .init("这是您的资料清单,请您前往查看。请您在", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("1-2周内", .font(UIFont.PFSC_M(ofSize: 14)),.foreground(UIColor.init(hex: 0xD48638)))
let cc: ASAttributedString = .init("上传基础类证件哦,需要重新办理的可以晚些提供。需要注意的点如下:", .font(UIFont.PFSC_R(ofSize: 14)),.foreground(UIColor.mainTextColor))
label.attributed.text = aa+bb+cc
return label
}()
lazy var tips2Label: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .init(hex: 0x8993A2)
label.numberOfLines = 0
label.text = "(1)港澳通如未办理,请优先安排办理;\n(2)如为国内学校,需准备由教育部学信网出具的学位认证报告;\n(3)如为海外学校,需准备官方成绩单和第三方机构学位认证文件;\n(4)赴港同意书,在获批后1个月内,由您获批时在职公司盖章出具即可(目前不需要提供)。"
return label
}()
lazy var rightBtn: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
button.backgroundColor = UIColor(hex: 0xd48638).withAlphaComponent(0.08)
button.contentHorizontalAlignment = .center
button.setTitle("资料清单", for: .normal)
button.setImage(UIImage(named: "scheme_button_icon"), for: .normal)
button.setTitleColor(UIColor(hex:0xd48638), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.YH_clickEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 20, right: 20)
button.addTarget(self, action: #selector(didRightBtnClicked), for: .touchUpInside)
return button
}()
@objc func didRightBtnClicked() {
rightBtnClick?()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.clipsToBounds = true
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(dotLine)
whiteContentView.addSubview(markImgV)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(tips1Label)
whiteContentView.addSubview(tips2Label)
whiteContentView.addSubview(rightBtn)
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.bottom.equalToSuperview()
}
dotLine.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(0)
make.height.equalTo(1)
}
markImgV.snp.makeConstraints { make in
make.left.equalTo(24)
make.width.equalTo(4)
make.height.equalTo(16)
make.centerY.equalTo(titleLabel)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(26)
make.height.equalTo(24)
make.left.equalTo(markImgV.snp.right).offset(8)
make.right.equalTo(-24)
}
tips1Label.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(titleLabel.snp.bottom).offset(18)
}
tips2Label.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(tips1Label.snp.bottom).offset(6)
make.bottom.equalTo(-26)
}
rightBtn.snp.makeConstraints { make in
make.width.equalTo(76)
make.height.equalTo(27)
make.right.equalTo(-24)
make.top.equalTo(titleLabel)
}
rightBtn.iconInRight(with: 2)
}
}
//
// YHModifySchemeInfoCell.swift
// galaxy
//
// Created by Dufet on 2024/11/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHModifySchemeInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHModifySchemeInfoCell"
var modifyBlock: (()->())?
lazy var bottomBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .white
btn.setTitleColor(.init(hex: 0xD48638), for: .normal)
btn.layer.borderColor = UIColor.init(hex: 0xD48638).cgColor
btn.layer.borderWidth = 1.0
btn.titleLabel?.font = .PFSC_M(ofSize: 16)
btn.layer.cornerRadius = 3
btn.setTitle("修改信息", for: .normal)
btn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside)
return btn
}()
@objc func didBottomBtnClicked() {
modifyBlock?()
}
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.clipsToBounds = true
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
selectionStyle = .none
contentView.backgroundColor = .clear
backgroundColor = .clear
contentView.clipsToBounds = true
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(bottomBtn)
whiteContentView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.bottom.equalToSuperview()
}
bottomBtn.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(0)
make.bottom.equalTo(-24)
make.height.equalTo(46)
}
}
// override func layoutSubviews() {
// super.layoutSubviews()
// let path = UIBezierPath(roundedRect:whiteContentView.bounds,
// byRoundingCorners:UIRectCorner(rawValue: UIRectCorner.bottomLeft.rawValue | UIRectCorner.bottomRight.rawValue),
// cornerRadii: CGSizeMake(6, 6))
// let layer = CAShapeLayer()
// layer.frame = whiteContentView.bounds
// layer.path = path.cgPath
// self.whiteContentView.layer.mask = layer
// }
}
//
// YHSchemeViewModel.swift
// galaxy
//
// Created by Dufet on 2024/11/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSchemeViewModel {
var schemeModel = YHMySchemeDetailModel()
var improveDetailModel = YHImproveSchemeDetailModel()
//我的方案
func getMySchemeData(orderId: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Assessment.applyPlanNewApi
let params: [String : Any] = ["order_id" : orderId]
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHMySchemeDetailModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,err)
return
}
self.schemeModel = resultModel
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
// 提交方案
func postSelectImproveTargets(orderId: Int, targets:[String], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Assessment.submitTargetsApi
let params: [String : Any] = ["order_id" : orderId,
"standard_key" : targets]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false, err)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func modifyInfo(orderId: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Assessment.modifyInfoApi
let params: [String : Any] = ["order_id" : orderId]
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false, err)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func getImproveDetail(orderId: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Assessment.improveDetailApi
let params: [String : Any] = ["order_id" : orderId]
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHImproveSchemeDetailModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,err)
return
}
self.improveDetailModel = resultModel
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
}
...@@ -28,6 +28,15 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -28,6 +28,15 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
basicInfoVC.child = child basicInfoVC.child = child
} }
} }
var mainApplicantInfo: YHMyMainApplicantInfoModel? {
didSet {
if let mainApplicantInfo = mainApplicantInfo {
primaryInfoVC.mainApplicantInfo = mainApplicantInfo
}
}
}
var stepVCs:[YHFaimilyStepItem] = [] var stepVCs:[YHFaimilyStepItem] = []
var _currentStep = 0 var _currentStep = 0
......
...@@ -11,6 +11,8 @@ import UIKit ...@@ -11,6 +11,8 @@ import UIKit
class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
var child:YHFamilyMember? var child:YHFamilyMember?
var mainApplicantInfo: YHMyMainApplicantInfoModel?
weak var delegate:YHSpouseInfoVCProtocol? weak var delegate:YHSpouseInfoVCProtocol?
var isNeedShowError = false var isNeedShowError = false
// 是否随行能编辑 // 是否随行能编辑
...@@ -113,10 +115,21 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -113,10 +115,21 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 港澳通信证 // 港澳通信证
var isHiddenHK = true var isHiddenHK = true
if child.nationality.contains("中国") { // 中国国籍 if child.nationality.contains("中国") { // 中国国籍
let isLiveInChina = child.address.country.contains("中国".local) if child.isLiveTother() { // 与主申请人同住
if isLiveInChina || (!isLiveInChina && !child.isOverSeasOver1Year()) { if let mainApplicantInfo = mainApplicantInfo {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框 let isLiveInChina = mainApplicantInfo.applicant_address.country.contains("中国".local)
isHiddenHK = false if isLiveInChina || (!isLiveInChina && !mainApplicantInfo.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
}
} else { // 不与主申请人同住
let isLiveInChina = child.address.country.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !child.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
} }
} }
......
...@@ -49,6 +49,15 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol { ...@@ -49,6 +49,15 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
} }
} }
} }
var mainApplicantInfo: YHMyMainApplicantInfoModel? {
didSet {
if let mainApplicantInfo = mainApplicantInfo {
primaryInfoVC.mainApplicantInfo = mainApplicantInfo
}
}
}
var _currentStep = 0 var _currentStep = 0
var currentStep:Int { var currentStep:Int {
......
...@@ -13,6 +13,8 @@ import SwifterSwift ...@@ -13,6 +13,8 @@ import SwifterSwift
class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
var spouse:YHFamilyMember? var spouse:YHFamilyMember?
var mainApplicantInfo: YHMyMainApplicantInfoModel?
weak var delegate:YHSpouseInfoVCProtocol? weak var delegate:YHSpouseInfoVCProtocol?
// 是否显示未填写错误提示 // 是否显示未填写错误提示
var isNeedShowError = false var isNeedShowError = false
...@@ -117,10 +119,21 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol { ...@@ -117,10 +119,21 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
// 港澳通信证 // 港澳通信证
var isHiddenHK = true var isHiddenHK = true
if spouse.nationality.contains("中国") { // 中国国籍 if spouse.nationality.contains("中国") { // 中国国籍
let isLiveInChina = spouse.address.country.contains("中国".local) if spouse.isLiveTother() { // 与主申请人同住
if isLiveInChina || (!isLiveInChina && !spouse.isOverSeasOver1Year()) { if let mainApplicantInfo = mainApplicantInfo {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框 let isLiveInChina = mainApplicantInfo.applicant_address.country.contains("中国".local)
isHiddenHK = false if isLiveInChina || (!isLiveInChina && !mainApplicantInfo.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
}
} else { // 不与主申请人同住
let isLiveInChina = spouse.address.country.contains("中国".local)
if isLiveInChina || (!isLiveInChina && !spouse.isOverSeasOver1Year()) {
// 中国国籍&居住国内、中国国籍&居住国外不满一年 需展示“港澳通行证”询问框
isHiddenHK = false
}
} }
} }
......
...@@ -592,38 +592,40 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource ...@@ -592,38 +592,40 @@ extension YHFamilyMemberInfoListVC : UITableViewDelegate, UITableViewDataSource
// 配偶 // 配偶
if detailItem.relationType == .spouse { if detailItem.relationType == .spouse {
let vc = YHSpouseInfoContainerVC() let vc = YHSpouseInfoContainerVC()
vc.spouse = detailItem vc.spouse = detailItem
vc.orderId = orderId vc.mainApplicantInfo = self.familyMemberInfo?.applicant
self.navigationController?.pushViewController(vc) vc.orderId = orderId
return self.navigationController?.pushViewController(vc)
return
} }
// 父母 // 父母
if detailItem.relationType == .father || detailItem.relationType == .mother { if detailItem.relationType == .father || detailItem.relationType == .mother {
let vc = YHParentInfoVC() let vc = YHParentInfoVC()
vc.parentInfo = detailItem vc.parentInfo = detailItem
vc.orderId = orderId vc.orderId = orderId
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
} }
// 子女 // 子女
if detailItem.relationType == .child { if detailItem.relationType == .child {
let vc = YHChildInfoContainerVC() let vc = YHChildInfoContainerVC()
vc.child = detailItem vc.child = detailItem
vc.orderId = orderId vc.mainApplicantInfo = self.familyMemberInfo?.applicant
self.navigationController?.pushViewController(vc) vc.orderId = orderId
return self.navigationController?.pushViewController(vc)
return
} }
// 兄弟姐妹 // 兄弟姐妹
if detailItem.relationType == .brother { if detailItem.relationType == .brother {
let vc = YHBrotherInfoVC() let vc = YHBrotherInfoVC()
vc.orderId = orderId vc.orderId = orderId
vc.brotherInfo = detailItem vc.brotherInfo = detailItem
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
} }
} }
......
...@@ -539,6 +539,7 @@ class YHFormDetailItem : YHFormItemProtocol { ...@@ -539,6 +539,7 @@ class YHFormDetailItem : YHFormItemProtocol {
/* ***** ***** ***** ***** ***** ***** ***** ***** */ /* ***** ***** ***** ***** ***** ***** ***** ***** */
// MARK: - 家庭成员 YHData // MARK: - 家庭成员 YHData
class YHFamilyMemberGroupInfo: SmartCodable { class YHFamilyMemberGroupInfo: SmartCodable {
...@@ -547,6 +548,7 @@ class YHFamilyMemberGroupInfo: SmartCodable { ...@@ -547,6 +548,7 @@ class YHFamilyMemberGroupInfo: SmartCodable {
var spouse: YHFamilyMember? var spouse: YHFamilyMember?
var child: [YHFamilyMember]? var child: [YHFamilyMember]?
var brother: [YHFamilyMember]? var brother: [YHFamilyMember]?
var applicant: YHMyMainApplicantInfoModel?
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case father = "father" case father = "father"
...@@ -554,6 +556,7 @@ class YHFamilyMemberGroupInfo: SmartCodable { ...@@ -554,6 +556,7 @@ class YHFamilyMemberGroupInfo: SmartCodable {
case spouse = "spouse" case spouse = "spouse"
case brother = "brother" case brother = "brother"
case child = "child" case child = "child"
case applicant = "applicant"
} }
func checkDefaultValue() -> Self { func checkDefaultValue() -> Self {
...@@ -589,7 +592,23 @@ enum YHFamilyMemberType: Int { ...@@ -589,7 +592,23 @@ enum YHFamilyMemberType: Int {
case brother = 5 case brother = 5
} }
class YHMyMainApplicantInfoModel: SmartCodable {
var applicant_address: YHAddress = YHAddress()
var address_aboard: Int = 0
// 是否在海外居住满1年及以上 1:是 2:否
var is_live_oversea_year: Int = 2
// 是否在海外居住满1年及以上
func isOverSeasOver1Year() -> Bool {
return self.is_live_oversea_year == 1
}
required init() {
}
}
class YHFamilyMember: SmartCodable, YHFormItemProtocol { class YHFamilyMember: SmartCodable, YHFormItemProtocol {
......
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