Commit 4281d277 authored by David黄金龙's avatar David黄金龙

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

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  新增受养人UI
  //  赴港办证

# Conflicts:
#	galaxy/galaxy.xcodeproj/project.pbxproj
parents cc6e72f8 51a779ea
This diff is collapsed.
...@@ -173,67 +173,70 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource { ...@@ -173,67 +173,70 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = self.viewModel.arrDataForSeviceCenterProgress[indexPath.section] let model = self.viewModel.arrDataForSeviceCenterProgress[indexPath.section]
let vc = YHAddAdoptersViewController()
navigationController?.pushViewController(vc)
if model.status == 1 || model.status == 4 {
return // if model.status == 1 || model.status == 4 {
} else { // return
//1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书 // } else {
if model.type == 1 { // //1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
let vc = YHMineCertificateEntryViewController() // if model.type == 1 {
vc.orderId = orderID // let vc = YHMineCertificateEntryViewController()
navigationController?.pushViewController(vc) // vc.orderId = orderID
// navigationController?.pushViewController(vc)
} else if model.type == 2 { //
let vc = YHInformationPerfectListVC() // } else if model.type == 2 {
vc.orderId = orderID // let vc = YHInformationPerfectListVC()
navigationController?.pushViewController(vc) // vc.orderId = orderID
// navigationController?.pushViewController(vc)
} else if model.type == 3 { // 评分 //
// } else if model.type == 3 { // 评分
handleRedPointFor(key: kMyScoreRedPointInfoKey, model: model) //
let vc = YHScoreDetailViewController() // handleRedPointFor(key: kMyScoreRedPointInfoKey, model: model)
vc.orderId = orderID // let vc = YHScoreDetailViewController()
// vc.model = serviceCenterMainReqVM.allInfoScoreModel // vc.orderId = orderID
navigationController?.pushViewController(vc) //// vc.model = serviceCenterMainReqVM.allInfoScoreModel
// navigationController?.pushViewController(vc)
} else if model.type == 4 { // 方案 //
handleRedPointFor(key: kMyPlanRedPointInfoKey, model: model) // } else if model.type == 4 { // 方案
let vc = YHMineSchemeViewController() // handleRedPointFor(key: kMyPlanRedPointInfoKey, model: model)
navigationController?.pushViewController(vc) // let vc = YHMineSchemeViewController()
// navigationController?.pushViewController(vc)
} else if model.type == 5 { //
let vc = YHMySignatureListViewController() // } else if model.type == 5 {
vc.orderId = orderID // let vc = YHMySignatureListViewController()
navigationController?.pushViewController(vc) // vc.orderId = orderID
// navigationController?.pushViewController(vc)
} else if model.type == 6 { //
let vc = YHMyDocumentsListViewController() // } else if model.type == 6 {
vc.orderId = orderID // let vc = YHMyDocumentsListViewController()
vc.mobile = mobile // vc.orderId = orderID
navigationController?.pushViewController(vc) // vc.mobile = mobile
// navigationController?.pushViewController(vc)
} else if model.type == 11 || model.type == 12 || model.type == 14 { //
// } else if model.type == 11 || model.type == 12 || model.type == 14 {
// 11 原则批等待结果 //
// 12 原则批待补件 // // 11 原则批等待结果
// 14 原则批未获批准 // // 12 原则批待补件
// // 14 原则批未获批准
let vc = YHPrincipleWaitResultViewController() //
vc.status = model.type // let vc = YHPrincipleWaitResultViewController()
vc.orderId = orderID // vc.status = model.type
navigationController?.pushViewController(vc) // vc.orderId = orderID
// navigationController?.pushViewController(vc)
} else if model.type == 13 { //原则批已获批~ //
let vc = YHPrincipleApprovedResultVC() // } else if model.type == 13 { //原则批已获批~
vc.orderId = orderID // let vc = YHPrincipleApprovedResultVC()
navigationController?.pushViewController(vc) // vc.orderId = orderID
// navigationController?.pushViewController(vc)
} else if model.type == 15 { //
//正式批已获批~ // } else if model.type == 15 {
let vc = YHOfficialApprovalResultVC() // //正式批已获批~
self.navigationController?.pushViewController(vc) // let vc = YHOfficialApprovalResultVC()
} // self.navigationController?.pushViewController(vc)
} // }
// }
} }
func handleRedPointFor(key: String, model: YHServiceCenterProgressModel) { func handleRedPointFor(key: String, model: YHServiceCenterProgressModel) {
......
//
// YHAddAdoptersViewController.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAddAdoptersViewController: YHBaseViewController {
var tableView: UITableView!
var nextButton: UIButton!
var clickIndex = -1
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "新增受养人"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1.0
setView()
getData()
}
func getData() {
tableView.reloadData()
let view = YHNoAdopterAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
func setView() {
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
tableView.contentInsetAdjustmentBehavior = .never
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHAdopterMainTableViewCell.self)
tableView.register(cellWithClass: YHAdopterStepTableViewCell.self)
tableView.register(cellWithClass: YHAdopterAddNewTableViewCell.self)
tableView.register(cellWithClass: YHAdopterIncomeTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 8)
make.bottom.left.right.equalTo(view)
}
// let bottonView = UIView()
// bottonView.backgroundColor = .white
// view.addSubview(bottonView)
// bottonView.snp.makeConstraints { make in
// make.height.equalTo(98)
// make.bottom.left.right.equalTo(view)
// }
//
// nextButton = {
// let button = UIButton(type: .custom)
// button.backgroundColor = UIColor.brandMainColor
// button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
// button.contentHorizontalAlignment = .center
// button.setTitle("下一步,预约赴港办证", for: .normal)
// button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
// button.layer.cornerRadius = kCornerRadius3
// button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
// return button
// }()
// view.addSubview(nextButton)
// nextButton.snp.makeConstraints { make in
// make.left.equalTo(16)
// make.right.equalTo(-16)
// make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom())
// make.height.equalTo(48)
// }
}
@objc func nextStep() {
}
@objc func submit() {
}
}
extension YHAddAdoptersViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if clickIndex == -1 || clickIndex == 1 {
return 4
} else {
return 1
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterMainTableViewCell.self)
cell.clickBlock = { [weak self] index in
guard let self = self else { return }
self.clickIndex = index
self.tableView.reloadData()
if self.clickIndex == 0 {
let view = YHNoAdopterAlertView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view)
}
}
cell.clickIndex = clickIndex
return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterStepTableViewCell.self)
return cell
} else if indexPath.row == 2 {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterAddNewTableViewCell.self)
return cell
} else {
let cell = tableView.dequeueReusableCell(withClass: YHAdopterIncomeTableViewCell.self)
return cell
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 225
}
if indexPath.row == 1 {
return 136
}
if indexPath.row == 2 {
// count * 52
return 156
}
if indexPath.row == 3 {
return 199
}
return 40
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
//
// YHAdopterAddNewTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterAddNewTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ model: YHWorkItemListModel) -> ()
typealias IsMoreBlock = (_ isMore: Bool) -> ()
typealias NewWorkBlock = () -> ()
var clickBlock: ExperienceListBlock?
var deleteBlock: ExperienceListBlock?
var isMoreBlock: IsMoreBlock?
var newWorkBlock: NewWorkBlock?
var centerView: UIView!
var titleLabel: UILabel!
var cannalButton: UIButton!
var moreButton: UIButton!
var mainItemView: UIView!
var lineView: UIView!
var bottomView: YHWorkItemAddView!
var showPrompt: Bool = false
var dataSource: [YHWorkItemListModel]?{
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(14)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.text = "新增受养人"
label.textColor = UIColor.mainTextColor
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(23)
make.height.equalTo(24)
make.right.equalTo(-20)
}
cannalButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
button.contentHorizontalAlignment = .center
button.setTitle("取消操作", for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.addTarget(self, action: #selector(cannal), for: .touchUpInside)
button.isHidden = true
return button
}()
centerView.addSubview(cannalButton)
cannalButton.snp.makeConstraints { make in
make.right.equalTo(-18)
make.top.equalTo(24)
make.height.equalTo(20)
make.width.equalTo(60)
}
moreButton = {
let button = UIButton(type: .custom)
button.setBackgroundImage(UIImage(named: "work_more"), for: .normal)
button.addTarget(self, action: #selector(more), for: .touchUpInside)
return button
}()
centerView.addSubview(moreButton)
moreButton.snp.makeConstraints { make in
make.right.equalTo(-18)
make.top.equalTo(24)
make.height.equalTo(24)
make.width.equalTo(24)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(63)
make.height.equalTo(0.5)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-63)
make.top.equalTo(77)
}
bottomView = {
let view = YHWorkItemAddView()
view.addBtn.setTitle("新增受养人".local, for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.newWorkBlock {
block()
}
}
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.right.bottom.equalTo(-18)
make.left.equalTo(18)
make.height.equalTo(45)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
guard let dataSource = dataSource else {
return
}
var total = 0
for i in 0 ..< dataSource.count {
let line = UIView()
line.backgroundColor = UIColor.separatorColor
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(total)
make.height.equalTo(1)
make.right.equalTo(-18)
}
total = total + 1
let itemView = YHWorkItemView()
itemView.clickBlock = {[weak self] model in
guard let self = self else { return }
if let block = self.clickBlock {
block(model)
}
}
itemView.deleteBlock = {[weak self] model in
guard let self = self else { return }
if let block = self.deleteBlock {
block(model)
}
}
let model = dataSource[i]
itemView.tag = 4000 + i
itemView.dataSource = dataSource[i]
itemView.showPrompt = showPrompt
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(total)
make.height.equalTo(75)
make.right.equalTo(-18)
}
total = total + 75
}
}
@objc func cannal() {
moreButton.isHidden = false
cannalButton.isHidden = true
for i in 0..<(dataSource?.count ?? 0) {
let view = mainItemView.viewWithTag(4000 + i) as! YHWorkItemView
view.isShowDelete(i, isShow: false)
}
if let block = isMoreBlock {
block(false)
}
}
@objc func more() {
moreButton.isHidden = true
cannalButton.isHidden = false
for i in 0..<(dataSource?.count ?? 0) {
let view = mainItemView.viewWithTag(4000 + i) as! YHWorkItemView
view.isShowDelete(i, isShow: true)
}
if let block = isMoreBlock {
block(true)
}
}
}
//
// YHAdopterIncomeTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHAdopterIncomeTableViewCell: UITableViewCell {
typealias ClicktBlock = (_ model: Int) -> ()
var clickBlock: ClicktBlock?
var centerView: UIView!
var titleLabel: UILabel!
var alertLabel: UILabel!
var selectLabel: UILabel!
var lineView: UIView!
var moreButton: UIButton!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "主申请人资料"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
make.right.equalTo(-18)
}
alertLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.mainTextColor50
label.numberOfLines = 0
let a: ASAttributedString = .init("温馨提示:", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor50))
let b: ASAttributedString = .init("存款证明有效期为3个月", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.brandMainColor))
let c: ASAttributedString = .init(",并且存款金额为每个成员(包括额外新增受养人)", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor50))
let d: ASAttributedString = .init("最低为12万", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.brandMainColor))
label.attributed.text = a + b + c + d
return label
}()
centerView.addSubview(alertLabel)
alertLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(79)
make.right.equalTo(-18)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(63)
make.height.equalTo(0.5)
}
selectLabel = {
let label = UILabel()
label.text = "上传存款证明"
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
return label
}()
centerView.addSubview(selectLabel)
selectLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.bottom.equalTo(-20)
make.height.equalTo(20)
make.width.equalTo(110)
}
moreButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 13)
button.contentHorizontalAlignment = .center
button.setTitle("待上传", for: .normal)
button.setImage(UIImage(named: "service_adopter_income_start"), for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.addTarget(self, action: #selector(more), for: .touchUpInside)
return button
}()
centerView.addSubview(moreButton)
moreButton.snp.makeConstraints { make in
make.bottom.equalTo(-16)
make.right.equalTo(-20)
make.height.equalTo(20)
make.width.equalTo(69)
}
moreButton.iconInRight(with: 1)
}
@objc func more() {
if let block = clickBlock {
block(0)
}
}
}
//
// YHAdopterMainTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHAdopterMainTableViewCell: UITableViewCell {
typealias ClicktBlock = (_ model: Int) -> ()
var clickBlock: ClicktBlock?
var centerView: UIView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var alertLabel: UILabel!
var selectLabel: UILabel!
var lineView: UIView!
var cannalButton: UIButton!
var moreButton: UIButton!
var clickIndex: Int? {
didSet {
if clickIndex == 0 {
moreButton.isSelected = false
cannalButton.isSelected = true
moreButton.layer.borderWidth = 0
cannalButton.layer.borderWidth = 1
}
if clickIndex == 1 {
moreButton.isSelected = true
cannalButton.isSelected = false
moreButton.layer.borderWidth = 1
cannalButton.layer.borderWidth = 0
}
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 17)
label.textColor = UIColor.mainTextColor
let str = "*" + "受养人信息核实"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize: 17),
.foregroundColor: UIColor.mainTextColor
]
let questionAttrStr = NSMutableAttributedString(string: str, attributes: attributes)
let starRange = NSRange(location: 0, length: 1)
questionAttrStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.failColor, range: starRange)
label.attributedText = questionAttrStr
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
make.right.equalTo(-18)
}
subTitleLabel = {
let label = UILabel()
label.text = "(受养人:与主申共同获得香港身份的配偶或子女)"
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.mainTextColor50
return label
}()
centerView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(42)
make.height.equalTo(17)
make.right.equalTo(-18)
}
alertLabel = {
let label = UILabel()
label.text = "(受养人:与主申共同获得香港身份的配偶或子女)"
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.mainTextColor50
label.numberOfLines = 0
let a: ASAttributedString = .init("备注:如最初递交申请文书时,已全部递交受养人信息与资料,此时", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor50))
let b: ASAttributedString = .init("无需再新增受养人信息,则选项选择“否”", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.brandMainColor))
label.attributed.text = a + b
return label
}()
centerView.addSubview(alertLabel)
alertLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(97)
make.right.equalTo(-18)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(71)
make.height.equalTo(0.5)
}
selectLabel = {
let label = UILabel()
label.text = "是否新增受养人"
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
return label
}()
centerView.addSubview(selectLabel)
selectLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.bottom.equalTo(-22)
make.height.equalTo(20)
make.width.equalTo(110)
}
cannalButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 13)
button.contentHorizontalAlignment = .center
button.setTitle("否", for: .normal)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.addTarget(self, action: #selector(cannal), for: .touchUpInside)
button.setBackgroundColor(color: UIColor.contentBkgColor, forState: .normal)
button.setBackgroundColor(color: UIColor(hex: 0xf0f4fb), forState: .selected)
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.layer.borderWidth = 0
button.layer.cornerRadius = 16
return button
}()
centerView.addSubview(cannalButton)
cannalButton.snp.makeConstraints { make in
make.bottom.equalTo(-16)
make.right.equalTo(-18)
make.height.equalTo(32)
make.width.equalTo(69)
}
moreButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 13)
button.contentHorizontalAlignment = .center
button.setTitle("是", for: .normal)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.setTitleColor(UIColor.brandMainColor, for: .selected)
button.setBackgroundColor(color: UIColor.contentBkgColor, forState: .normal)
button.setBackgroundColor(color: UIColor(hex: 0xf0f4fb), forState: .selected)
button.layer.cornerRadius = 16
button.layer.borderColor = UIColor.brandMainColor.cgColor
button.layer.borderWidth = 0
button.addTarget(self, action: #selector(more), for: .touchUpInside)
return button
}()
centerView.addSubview(moreButton)
moreButton.snp.makeConstraints { make in
make.bottom.equalTo(-16)
make.right.equalTo(-95)
make.height.equalTo(32)
make.width.equalTo(69)
}
}
@objc func cannal() {
moreButton.isSelected = false
cannalButton.isSelected = true
moreButton.layer.borderWidth = 0
cannalButton.layer.borderWidth = 1
if let block = clickBlock {
block(0)
}
}
@objc func more() {
moreButton.isSelected = true
cannalButton.isSelected = false
moreButton.layer.borderWidth = 1
cannalButton.layer.borderWidth = 0
if let block = clickBlock {
block(1)
}
}
}
//
// YHAdopterStepTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHAdopterStepTableViewCell: UITableViewCell {
typealias ClicktBlock = (_ model: Int) -> ()
var clickBlock: ClicktBlock?
var centerView: UIView!
var titleLabel: UILabel!
var stepView: YHStepView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-7)
}
stepView = {
let step = YHStepView()
step.viewWidth = KScreenWidth - 32
step.dataSource = ["收集资料", "递交申请", "跟踪申请结果"]
step.block = { [weak self] (index) in
guard let self = self else { return }
}
return step
}()
centerView.addSubview(stepView)
stepView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(104)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.mainTextColor50
label.text = "受养人申请身份流程"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(16)
make.right.equalTo(-18)
}
}
}
//
// YHNoAdopterAlertView.swift
// galaxy
//
// Created by EDY on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHNoAdopterAlertView: UIView {
var centerView: UIView!
var topImageView: UIImageView!
var bgImageView: UIImageView!
var titleLabel: UILabel!
var nextButton: UIButton!
var alertLabel: UILabel!
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor(white: 0.5, alpha: 0.1)
setView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setView() {
backgroundColor = UIColor(hex: 0x000000, alpha: 0.5)
centerView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.height.equalTo(299)
make.width.equalTo(307)
}
topImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "service_adopter_no_alert")
return imageView
}()
centerView.addSubview(topImageView)
topImageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.height.width.equalTo(53)
make.top.equalTo(30)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "风险预警"
label.textAlignment = .center
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(24)
make.top.equalTo(99)
}
alertLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.mainTextColor50
label.numberOfLines = 0
let a: ASAttributedString = .init("如若在主申请者激活电子签证后才新增受养人,", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor50))
let b: ASAttributedString = .init("港府将会要求您提供香港的住址证明,可能会导致您产生租房的新增费用", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.brandMainColor))
let c: ASAttributedString = .init(",请您务必知悉!", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.mainTextColor50))
label.attributed.text = a + b + c
return label
}()
centerView.addSubview(alertLabel)
alertLabel.snp.makeConstraints { make in
make.left.equalTo(21)
make.top.equalTo(131)
make.right.equalTo(-21)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("我已知悉,确认", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
return button
}()
centerView.addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.bottom.equalTo(-21)
make.height.equalTo(45)
}
}
@objc func dismiss() {
removeFromSuperview()
}
@objc func nextStep() {
removeFromSuperview()
}
}
//
// YHCertificateAppointViewController.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateAppointViewController: YHBaseViewController {
var items = ["", ""]
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 16.0
tableView.estimatedSectionFooterHeight = 0.01
tableView.contentInsetAdjustmentBehavior = .never
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor(hex: 0xF8F9FB)
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateAppointOptionCell.self, forCellReuseIdentifier: YHCertificateAppointOptionCell.cellReuseIdentifier)
tableView.register(YHSelectApplicantGroupCell.self, forCellReuseIdentifier: YHSelectApplicantGroupCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
createUI()
}
func createUI() {
super.viewDidLoad()
self.gk_navTitle = "赴港办证预约"
self.view.backgroundColor = .white
self.view.addSubview(self.tableView)
self.tableView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
}
}
}
extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateAppointOptionCell.cellReuseIdentifier, for: indexPath) as! YHCertificateAppointOptionCell
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHSelectApplicantGroupCell.cellReuseIdentifier, for: indexPath) as! YHSelectApplicantGroupCell
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 0.01
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 0.01
}
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
}
}
//
// YHCertificateAppointOptionCell.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHCertificateAppointOptionCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateAppointOptionCell"
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.failColor))
let b: ASAttributedString = .init("赴港办证", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
label.attributed.text = a+b
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("备注:如您已获得香港居民身份证,此时无需再赴港办理身份证,", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.init(hex: 0x94A3B8)))
let b: ASAttributedString = .init("则选择“否”", .font(UIFont.PFSC_R(ofSize: 13)),.foreground(UIColor.brandMainColor))
label.attributed.text = a+b
return label
}()
lazy var optionsView: YHInfoItemOptionView = {
let view = YHInfoItemOptionView(frame: .zero)
view.title = "是否赴港办证"
view.setOptions(["是", "否"])
view.selectIndex = 0
view.selectBlock = {
index in
}
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() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(lineView)
whiteContentView.addSubview(detailLabel)
whiteContentView.addSubview(optionsView)
whiteContentView.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(0)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(18)
make.right.equalTo(-18)
}
lineView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
}
detailLabel.snp.makeConstraints { make in
make.top.equalTo(lineView.snp.bottom).offset(16)
make.left.equalTo(18)
make.right.equalTo(-18)
}
optionsView.snp.makeConstraints { make in
make.top.equalTo(detailLabel.snp.bottom).offset(10)
make.left.equalTo(18)
make.right.equalTo(0)
make.bottom.equalTo(-8)
}
}
}
//
// YHCertificateAppointOptionView.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateAppointOptionView: UIView {
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_M(ofSize: 14)
label.text = "张全蛋"
label.textColor = UIColor.mainTextColor
return label
}()
}
//
// YHInfoItemOptionView.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHInfoItemOption {
var value: String = ""
var isSelect: Bool = false
}
class YHInfoItemOptionView: UIView {
let btnHeight = 32.0
let titleMaxWidth = 113.0
let baseBtnTag = 9527
var options: [String] = []
var selectBlock:((Int)->())?
var title: String = "" {
didSet {
self.titleLabel.text = title
let height = self.getHeight(text: title, font: titleLabel.font , width: titleMaxWidth)
var isOneLine = false
if height <= 20 {
// 文字只显示一行
isOneLine = true
} else {
// 文字超过一行
isOneLine = false
}
titleLabel.snp.remakeConstraints { make in
if isOneLine {
make.height.equalTo(20)
}
make.edges.equalToSuperview()
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
func setOptions(_ options:[String]) {
self.options = options
for (index, text) in options.enumerated() {
if let btn = self.viewWithTag(baseBtnTag + index) as? UIButton {
btn.setTitle(text, for: .normal)
}
}
}
var selectIndex: Int = -1 {
didSet {
for (index, _) in options.enumerated() {
if let btn = self.viewWithTag(baseBtnTag + index) as? UIButton {
setOptionBtnSelected(btn: btn, isSelect: index == selectIndex)
}
}
}
}
var titleGap = 16.0 {
didSet {
titleView.snp.updateConstraints { make in
make.top.equalTo(titleGap)
make.bottom.equalTo(-titleGap)
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var titleView: UIView = {
let view = UIView()
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
func createOptionButton() -> UIButton {
let btn = UIButton()
btn.backgroundColor = UIColor.init(hex: 0xF8F9FB)
btn.titleLabel?.font = .PFSC_R(ofSize: 13)
btn.setTitle("", for: .normal)
btn.layer.cornerRadius = self.btnHeight/2.0
btn.clipsToBounds = true
return btn
}
func setOptionBtnSelected(btn: UIButton, isSelect: Bool) {
btn.layer.borderWidth = isSelect ? 1.0 : 0.0
btn.layer.borderColor = isSelect ? UIColor.brandMainColor.cgColor : nil
btn.setTitleColor(isSelect ? UIColor.brandMainColor : UIColor.init(hex: 0x222222), for: .normal)
}
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(titleView)
titleView.addSubview(titleLabel)
let firstBtn = self.createOptionButton()
firstBtn.tag = baseBtnTag + 0
setOptionBtnSelected(btn: firstBtn, isSelect:false)
firstBtn.addTarget(self, action: #selector(didOptionBtnClicked(_:)), for: .touchUpInside)
self.addSubview(firstBtn)
let secondBtn = self.createOptionButton()
secondBtn.tag = baseBtnTag + 1
setOptionBtnSelected(btn: secondBtn, isSelect:false)
secondBtn.addTarget(self, action: #selector(didOptionBtnClicked(_:)), for: .touchUpInside)
self.addSubview(secondBtn)
self.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.equalTo(0)
make.height.equalTo(0.5)
}
titleView.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(titleGap)
make.bottom.equalTo(-titleGap)
make.width.equalTo(titleMaxWidth)
}
titleLabel.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
secondBtn.snp.makeConstraints { make in
make.right.equalTo(-18)
make.size.equalTo(CGSize(width: 69, height: 32))
make.centerY.equalTo(titleView)
}
firstBtn.snp.makeConstraints { make in
make.right.equalTo(secondBtn.snp.left).offset(-8)
make.size.equalTo(CGSize(width: 69, height: 32))
make.centerY.equalTo(titleView)
}
}
@objc func didOptionBtnClicked(_ sender: UIButton) {
if let btn1 = self.viewWithTag(baseBtnTag + 0) as? UIButton {
setOptionBtnSelected(btn: btn1, isSelect: sender.tag == baseBtnTag + 0)
}
if let btn2 = self.viewWithTag(baseBtnTag + 1) as? UIButton {
setOptionBtnSelected(btn: btn2, isSelect: sender.tag == baseBtnTag + 1)
}
}
func getHeight(text:String, font:UIFont, width:CGFloat)->CGFloat {
let size = CGSize.init(width:width , height: CGFloat(MAXFLOAT))
let dic = [NSAttributedString.Key.font: font]
let strSize = text.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
return CGSizeMake(strSize.width, ceil(strSize.height)).height
}
}
//
// YHInfoItemSelectSheetView.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHInfoItemSelectSheetView: UIView {
var titleMaxWidth = 112.0
var title: String = "" {
didSet {
titleLabel.text = title
}
}
var detail: String = "" {
didSet {
detailLabel.text = detail
}
}
var isShowDetailOneline:Bool = false {
didSet {
detailLabel.textAlignment = isShowDetailOneline ? .right : .left
detailLabel.numberOfLines = isShowDetailOneline ? 1 : 0
detailLabel.snp.remakeConstraints { make in
make.top.equalTo(16)
make.right.equalTo(arrowImgView.snp.left)
make.bottom.equalTo(-16)
if isShowDetailOneline {
make.height.equalTo(20)
} else {
make.left.equalTo(titleLabel.snp.right)
}
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_M(ofSize: 14)
return label
}()
lazy var arrowImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "family_info_arrow"))
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(titleLabel)
self.addSubview(detailLabel)
self.addSubview(arrowImgView)
self.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.equalTo(0)
make.height.equalTo(0.5)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(16)
make.width.equalTo(titleMaxWidth)
}
detailLabel.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(titleLabel.snp.right)
make.right.equalTo(arrowImgView.snp.left)
make.bottom.equalTo(-16)
}
arrowImgView.snp.makeConstraints { make in
make.width.height.equalTo(22)
make.top.equalTo(15)
make.right.equalTo(0)
}
}
}
//
// YHSelectApplicantCell.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHSelectApplicantCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHSelectApplicantCell"
lazy var selectImgView:UIImageView = {
let view = UIImageView(image: UIImage(named: ""))
return view
}()
lazy var nameLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .mainTextColor
return label
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(selectImgView)
self.addSubview(nameLabel)
selectImgView.snp.makeConstraints { make in
make.left.equalTo(0)
make.width.height.equalTo(14)
make.centerY.equalToSuperview()
}
nameLabel.snp.makeConstraints { make in
make.left.equalTo(selectImgView.snp.right).offset(6)
make.centerY.equalToSuperview()
make.right.equalToSuperview()
}
}
func updateApplicantInfo(_ applicant: YHSelectApplicantInfo) {
nameLabel.text = applicant.name
let imgName = applicant.isSelect ? "login_privacy_agree" : "login_privacy_disagree_glay"
selectImgView.image = UIImage(named: imgName)
}
}
//
// YHSelectApplicantGroupCell.swift
// galaxy
//
// Created by edy on 2024/8/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHSelectApplicantInfo {
var name: String = ""
var isSelect: Bool = false
init(name: String, isSelect: Bool) {
self.name = name
self.isSelect = isSelect
}
}
class YHSelectApplicantGroupCell: UITableViewCell {
static let cellReuseIdentifier = "YHSelectApplicantGroupCell"
lazy var selecters:[YHSelectApplicantInfo] = {
return [YHSelectApplicantInfo(name: "李小龙", isSelect: true),
YHSelectApplicantInfo(name: "成龙", isSelect: false),
YHSelectApplicantInfo(name: "甄子丹", isSelect: true),
YHSelectApplicantInfo(name: "吉田双阴", isSelect: false),]
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
let a: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.failColor))
let b: ASAttributedString = .init("请您确认第一批赴港信息", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
label.attributed.text = a+b
return label
}()
lazy var detailLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = .mainTextColor
label.text = "选择第一批赴港激活签证的申请人"
return label
}()
lazy var selectGroupView: UIView = {
let view = UIView()
view.backgroundColor = .init(hex: 0xF8F9FB)
view.layer.cornerRadius = kCornerRadius3
return view
}()
lazy var collectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .vertical
layout.minimumInteritemSpacing = 0
layout.minimumLineSpacing = 16
let collectView = UICollectionView(frame:.zero, collectionViewLayout: layout)
collectView.delegate = self
collectView.dataSource = self
collectView.backgroundColor = .clear
// 注册自定义单元格
collectView.register(YHSelectApplicantCell.self, forCellWithReuseIdentifier: YHSelectApplicantCell.cellReuseIdentifier)
return collectView
}()
lazy var optionsView: YHInfoItemOptionView = {
let view = YHInfoItemOptionView(frame: .zero)
view.titleGap = 22.0
view.title = "赴港办证时间"
view.setOptions(["具体日期", "具体时段"])
view.selectIndex = 0
view.selectBlock = {
index in
}
return view
}()
lazy var timeSelectView: YHInfoItemSelectSheetView = {
let view = YHInfoItemSelectSheetView(frame: .zero)
view.isShowDetailOneline = true
view.title = "具体日期"
view.detail = "2024-03-14 ~ 2024-03-14 "
return view
}()
lazy var locationSelectView: YHInfoItemSelectSheetView = {
let view = YHInfoItemSelectSheetView(frame: .zero)
view.title = "港府办证地点"
view.detail = "九龙办事处(长沙湾) "
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() {
self.selectionStyle = .none
self.backgroundColor = .clear
self.contentView.backgroundColor = .clear
contentView.addSubview(whiteContentView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(lineView)
whiteContentView.addSubview(detailLabel)
whiteContentView.addSubview(selectGroupView)
selectGroupView.addSubview(collectionView)
whiteContentView.addSubview(optionsView)
whiteContentView.addSubview(timeSelectView)
whiteContentView.addSubview(locationSelectView)
whiteContentView.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(0)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(18)
make.left.equalTo(18)
make.right.equalTo(-18)
}
lineView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(12)
make.left.right.equalToSuperview()
make.height.equalTo(0.5)
}
detailLabel.snp.makeConstraints { make in
make.top.equalTo(lineView.snp.bottom).offset(16)
make.left.equalTo(18)
make.right.equalTo(-18)
}
selectGroupView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(detailLabel.snp.bottom).offset(12)
}
collectionView.snp.makeConstraints { make in
make.left.equalTo(14)
make.right.equalTo(-14)
make.height.equalTo(40+16)
make.top.equalTo(14)
make.bottom.equalTo(-14)
}
optionsView.snp.makeConstraints { make in
make.top.equalTo(selectGroupView.snp.bottom).offset(16)
make.left.equalTo(18)
make.right.equalTo(0)
}
timeSelectView.snp.makeConstraints { make in
make.top.equalTo(optionsView.snp.bottom).offset(0)
make.left.equalTo(18)
make.right.equalTo(-18)
}
locationSelectView.snp.makeConstraints { make in
make.top.equalTo(timeSelectView.snp.bottom).offset(0)
make.left.equalTo(18)
make.right.equalTo(-18)
make.bottom.equalToSuperview()
}
}
}
extension YHSelectApplicantGroupCell: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
// 返回单元格数量
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return selecters.count
}
// 返回每个单元格的大小
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: floorl(collectionView.width/3.0), height: 20)
}
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSelectApplicantCell.cellReuseIdentifier, for: indexPath) as! YHSelectApplicantCell
if 0 <= indexPath.item && indexPath.item < selecters.count {
let applicant = selecters[indexPath.item]
cell.updateApplicantInfo(applicant)
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < selecters.count {
let text = selecters[indexPath.item]
}
}
}
...@@ -11,6 +11,7 @@ import UIKit ...@@ -11,6 +11,7 @@ import UIKit
class YHStepView: UIScrollView { class YHStepView: UIScrollView {
static let height = 104.0 static let height = 104.0
var viewWidth = KScreenWidth
typealias Block = (Int) -> () typealias Block = (Int) -> ()
var block: Block? var block: Block?
var dataSource: [String]? { var dataSource: [String]? {
...@@ -30,15 +31,15 @@ class YHStepView: UIScrollView { ...@@ -30,15 +31,15 @@ class YHStepView: UIScrollView {
let lineCount = dataSource.count - 1 let lineCount = dataSource.count - 1
if dataSource.count <= 2 { if dataSource.count <= 2 {
let contentWidth = 89 * 2 + Int(stepSpace) * 2 * lineCount + 14 * dataSource.count let contentWidth = 89 * 2 + Int(stepSpace) * 2 * lineCount + 14 * dataSource.count
let width = (KScreenWidth - CGFloat(contentWidth)) / lineCount.cgFloat let width = (viewWidth - CGFloat(contentWidth)) / lineCount.cgFloat
return width return width
} else if dataSource.count <= 4 { } else if dataSource.count <= 4 {
let contentWidth = 43 * 2 + Int(stepSpace) * 2 * lineCount + 14 * dataSource.count let contentWidth = 43 * 2 + Int(stepSpace) * 2 * lineCount + 14 * dataSource.count
let width = (KScreenWidth - CGFloat(contentWidth)) / lineCount.cgFloat let width = (viewWidth - CGFloat(contentWidth)) / lineCount.cgFloat
return width return width
} else { } else {
let contentWidth = 43 * 2 + Int(stepSpace) * 2 * 3 + 14 * 4 let contentWidth = 43 * 2 + Int(stepSpace) * 2 * 3 + 14 * 4
let width = (KScreenWidth - CGFloat(contentWidth)) / lineCount.cgFloat let width = (viewWidth - CGFloat(contentWidth)) / lineCount.cgFloat
return width return width
} }
} }
......
...@@ -341,7 +341,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -341,7 +341,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
} }
if true { if true {
let vc = YHFamilyInfoConfirmViewController() let vc = YHCertificateAppointViewController()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
return return
} }
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_adopter_income_fail@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_adopter_income_fail@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_adopter_income_start@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_adopter_income_start@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_adopter_income_success@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_adopter_income_success@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_adopter_no_alert@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_adopter_no_alert@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment