Commit 8a70a9e8 authored by Steven杜宇's avatar Steven杜宇

// 预约

parent 55cad985
This diff is collapsed.
...@@ -26,11 +26,13 @@ class YHResignAppointTimeViewController: YHBaseViewController { ...@@ -26,11 +26,13 @@ class YHResignAppointTimeViewController: YHBaseViewController {
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.bounces = false tableView.bounces = false
tableView.register(YHResignAppointTimeCell.self, forCellReuseIdentifier: YHResignAppointTimeCell.cellReuseIdentifier) tableView.register(YHResignAppointTimeSingleCell.self, forCellReuseIdentifier: YHResignAppointTimeSingleCell.cellReuseIdentifier)
tableView.register(YHResignAppointOptionCell.self, forCellReuseIdentifier: YHResignAppointOptionCell.cellReuseIdentifier) tableView.register(YHResignAppointOptionCell.self, forCellReuseIdentifier: YHResignAppointOptionCell.cellReuseIdentifier)
tableView.register(YHResignAppointApplicantInfoCell.self, forCellReuseIdentifier: YHResignAppointApplicantInfoCell.cellReuseIdentifier) tableView.register(YHResignAppointApplicantInfoCell.self, forCellReuseIdentifier: YHResignAppointApplicantInfoCell.cellReuseIdentifier)
tableView.register(YHResignAppointOptionResultCell.self, forCellReuseIdentifier: YHResignAppointOptionResultCell.cellReuseIdentifier) tableView.register(YHResignAppointOptionResultCell.self, forCellReuseIdentifier: YHResignAppointOptionResultCell.cellReuseIdentifier)
tableView.register(YHResignHaveAppointedInfoCell.self, forCellReuseIdentifier: YHResignHaveAppointedInfoCell.cellReuseIdentifier) tableView.register(YHResignHaveAppointedMultipleInfoCell.self, forCellReuseIdentifier: YHResignHaveAppointedMultipleInfoCell.cellReuseIdentifier)
tableView.register(YHResignHaveAppointedSingleInfoCell.self, forCellReuseIdentifier: YHResignHaveAppointedSingleInfoCell.cellReuseIdentifier)
tableView.register(YHResignAppointTimeMultipleCell.self, forCellReuseIdentifier: YHResignAppointTimeMultipleCell.cellReuseIdentifier)
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
return tableView return tableView
...@@ -110,7 +112,7 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat ...@@ -110,7 +112,7 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell2 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointTimeCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointTimeCell let cell2 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointTimeSingleCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointTimeSingleCell
if 0 <= indexPath.row && indexPath.row < familyArr.count { if 0 <= indexPath.row && indexPath.row < familyArr.count {
...@@ -130,7 +132,12 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat ...@@ -130,7 +132,12 @@ extension YHResignAppointTimeViewController: UITableViewDelegate, UITableViewDat
} }
if indexPath.row == 3 { if indexPath.row == 3 {
let cell1 = tableView.dequeueReusableCell(withIdentifier: YHResignHaveAppointedInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignHaveAppointedInfoCell let cell1 = tableView.dequeueReusableCell(withIdentifier: YHResignHaveAppointedSingleInfoCell.cellReuseIdentifier, for: indexPath) as! YHResignHaveAppointedSingleInfoCell
return cell1
}
if indexPath.row == 4 {
let cell1 = tableView.dequeueReusableCell(withIdentifier: YHResignAppointTimeMultipleCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointTimeMultipleCell
return cell1 return cell1
} }
} }
......
//
// YHResignAppointTimeMultipleCell.swift
// galaxy
//
// Created by edy on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHResignAppointTimeMultipleCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignAppointTimeMultipleCell"
var arr:[YHHKMemberModel] = {
let m1 = YHHKMemberModel()
m1.name = "侯林"
let m2 = YHHKMemberModel()
m2.name = "李小龙"
let m3 = YHHKMemberModel()
m3.name = "啊发顺丰进啦司法局阿里司法"
let m4 = YHHKMemberModel()
m4.name = "司法"
return [m1, m2, m3, m4]
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
lazy var titleLabel: UILabel = {
let titleLabel = UILabel(frame: CGRect(x: 18, y: 16, width: KScreenWidth, height: 24.0))
let mustTag: ASAttributedString = .init("* ", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.failColor))
var title: ASAttributedString = .init("请确认第X批递交信息", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
title = mustTag + title
titleLabel.attributed.text = title
return titleLabel
}()
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var subTitleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "选择第X批赴港递交的申请人"
return label
}()
lazy var selectBgView: UIView = {
let groupBgview = UIView()
groupBgview.backgroundColor = .init(hex: 0xF8F9FB)
groupBgview.layer.cornerRadius = kCornerRadius3
groupBgview.addSubview(collectionView)
collectionView.snp.makeConstraints { make in
make.left.equalTo(14)
make.right.equalTo(-14)
make.height.equalTo(0)
make.top.equalTo(14)
make.bottom.equalTo(-14)
}
return groupBgview
}()
lazy var collectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .vertical
layout.minimumInteritemSpacing = 0.0
layout.minimumLineSpacing = 16.0
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 submitTimeItemView: YHResignAppointSelectTimeItemView = {
let view = YHResignAppointSelectTimeItemView(frame: .zero)
view.title = "预约在港递交时间"
view.placeHolder = "请选择"
view.isNeedShowErrorTips = false
view.errorTips = "请选择在港递交时间"
view.detail = ""
view.updateLineMargin(-18.0)
view.clickBlock = {
[weak self] in
guard let self = self else { return }
}
return view
}()
lazy var leaveTimeItemView: YHResignAppointSelectTimeItemView = {
let view = YHResignAppointSelectTimeItemView(frame: .zero)
view.title = "预计离港时间"
view.placeHolder = "请选择"
view.errorTips = "请选择离港时间"
view.isNeedShowErrorTips = false
view.detail = ""
view.clickBlock = {
[weak self] in
guard let self = self else { return }
}
return view
}()
lazy var leaveHKSwithView: YHResignLeaveHKSwitchItemView = {
let view = YHResignLeaveHKSwitchItemView()
view.title = "暂不离港"
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
self.contentView.addSubview(whiteContentView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(lineView)
whiteContentView.addSubview(subTitleLabel)
whiteContentView.addSubview(selectBgView)
whiteContentView.addSubview(submitTimeItemView)
whiteContentView.addSubview(leaveTimeItemView)
whiteContentView.addSubview(leaveHKSwithView)
whiteContentView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.bottom.equalTo(-16)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(16)
make.height.equalTo(24)
}
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)
}
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(lineView.snp.bottom).offset(16)
}
selectBgView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(subTitleLabel.snp.bottom).offset(12)
}
submitTimeItemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(selectBgView.snp.bottom).offset(16)
}
leaveTimeItemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(submitTimeItemView.snp.bottom)
}
leaveHKSwithView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(leaveTimeItemView.snp.bottom)
make.bottom.equalToSuperview()
}
updateUI()
}
func updateUI() {
collectionView.reloadData()
collectionView.snp.updateConstraints { make in
make.height.equalTo(self.getCollectionViewHeight())
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
func getCollectionViewHeight() -> CGFloat {
let rowHeight = 20.0
let gap = 16.0
var rowCount = arr.count/3
if arr.count%3 != 0 {
rowCount += 1
}
var height = 0.0
if rowCount > 0 {
height = rowHeight * Double(rowCount) + gap * Double(rowCount-1)
}
return height
}
}
extension YHResignAppointTimeMultipleCell: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
// 返回单元格数量
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return arr.count
}
// 返回每个单元格的大小
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let listWidth = KScreenWidth-(14.0+18.0+16.0)*2.0
return CGSize(width: floorl(listWidth/3.0), height: 20)
}
// 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHSelectApplicantCell.cellReuseIdentifier, for: indexPath) as! YHSelectApplicantCell
// if let arr = dataModel?.model?.arr {
if 0 <= indexPath.item && indexPath.item < arr.count {
let applicant = arr[indexPath.item]
cell.updateApplicantInfo(applicant)
}
// }
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// if let dataModel = self.dataModel, let model = dataModel.model {
// if 0 <= indexPath.item && indexPath.item < model.arr.count {
// let member = model.arr[indexPath.item]
// let selectArr = model.arr.filter {
// return $0.isSelected == true
// }
// if selectArr.count == 1, member.isSelected == true, member.id == selectArr[0].id {
// // 分组中仅有一个选中用户 且点击的是该用户
// YHHUD.flash(message: "每一批赴港申请人不可为空,请确保每位申请人都在列")
// return
// }
// selectBlock?(member, !member.isSelected, dataModel.itemIndex)
// }
// }
}
}
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
import UIKit import UIKit
import AttributedString import AttributedString
class YHResignAppointTimeCell: UITableViewCell { class YHResignAppointTimeSingleCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignFamilyMemberInfoCell" static let cellReuseIdentifier = "YHResignAppointTimeSingleCell"
lazy var whiteContentView: UIView = { lazy var whiteContentView: UIView = {
let view = UIView() let view = UIView()
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
import UIKit import UIKit
class YHResignAppointedScheduleLineCell: UICollectionViewCell { class YHResignAppointedScheduleLineCollectCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHResignAppointedScheduleLineCell" static let cellReuseIdentifier = "YHResignAppointedScheduleLineCollectCell"
lazy var numLabel: UILabel = { lazy var numLabel: UILabel = {
var label = UILabel() var label = UILabel()
......
...@@ -44,7 +44,7 @@ class YHResignAppointedScheduleLineView: UIView { ...@@ -44,7 +44,7 @@ class YHResignAppointedScheduleLineView: UIView {
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectinoView.backgroundColor = .init(hex: 0xF8F9FB) collectinoView.backgroundColor = .init(hex: 0xF8F9FB)
collectinoView.register(YHResignAppointedScheduleLineCell.self, forCellWithReuseIdentifier:YHResignAppointedScheduleLineCell.cellReuseIdentifier) collectinoView.register(YHResignAppointedScheduleLineCollectCell.self, forCellWithReuseIdentifier:YHResignAppointedScheduleLineCollectCell.cellReuseIdentifier)
collectinoView.delegate = self collectinoView.delegate = self
collectinoView.dataSource = self collectinoView.dataSource = self
collectinoView.bounces = false collectinoView.bounces = false
...@@ -96,7 +96,7 @@ extension YHResignAppointedScheduleLineView: UICollectionViewDelegate, UICollect ...@@ -96,7 +96,7 @@ extension YHResignAppointedScheduleLineView: UICollectionViewDelegate, UICollect
// 返回自定义单元格 // 返回自定义单元格
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignAppointedScheduleLineCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointedScheduleLineCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHResignAppointedScheduleLineCollectCell.cellReuseIdentifier, for: indexPath) as! YHResignAppointedScheduleLineCollectCell
if 0 <= indexPath.item && indexPath.item < steps.count { if 0 <= indexPath.item && indexPath.item < steps.count {
let model = steps[indexPath.item] let model = steps[indexPath.item]
model.index = indexPath.item+1 model.index = indexPath.item+1
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class YHResignAppointedScheduleItemView: UIView { class YHResignAppointedScheduleMultipleItemView: UIView {
lazy var lineView: UIView = { lazy var lineView: UIView = {
let view = UIView() let view = UIView()
......
//
// YHResignAppointedScheduleSingleItemView.swift
// galaxy
//
// Created by edy on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignAppointedScheduleSingleItemView: UIView {
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var applicantNamesLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = .mainTextColor
label.text = "申请人:"
return label
}()
lazy var confirmInHKLabel: UILabel = {
let label = UILabel()
label.text = "已确认在港"
label.font = UIFont.PFSC_M(ofSize: 13)
label.textColor = .init(hex: 0x3CC694)
return label
}()
lazy var confirmInHKBtn: UIButton = {
let btn = UIButton()
btn.layer.cornerRadius = 2.0
btn.backgroundColor = .brandMainColor
btn.setTitleColor(.white, for: .normal)
btn.setTitle("确认在港", for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 11)
return btn
}()
lazy var submitTimeLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = .mainTextColor(alpha: 0.5)
label.text = "预约递交时间: 0000-00-00 00:00"
return label
}()
lazy var confirmHKTimeLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = .mainTextColor(alpha: 0.5)
label.text = "确认在港时间: 0000-00-00 00:00"
return label
}()
lazy var scheduleView: YHResignAppointedScheduleLineView = {
let view = YHResignAppointedScheduleLineView(frame: .zero)
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(lineView)
self.addSubview(applicantNamesLabel)
self.addSubview(confirmInHKBtn)
self.addSubview(confirmInHKLabel)
self.addSubview(confirmHKTimeLabel)
self.addSubview(submitTimeLabel)
self.addSubview(confirmHKTimeLabel)
self.addSubview(scheduleView)
lineView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(0.5)
}
applicantNamesLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(lineView.snp.bottom).offset(18)
}
confirmInHKBtn.snp.makeConstraints { make in
make.right.equalTo(-18)
make.width.equalTo(68)
make.height.equalTo(28)
make.centerY.equalTo(applicantNamesLabel)
}
confirmInHKLabel.snp.makeConstraints { make in
make.right.equalTo(-18)
make.top.equalTo(applicantNamesLabel)
make.height.equalTo(18)
}
submitTimeLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(applicantNamesLabel.snp.bottom).offset(8)
}
confirmHKTimeLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(submitTimeLabel.snp.bottom).offset(8)
}
scheduleView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(confirmHKTimeLabel.snp.bottom).offset(18)
make.height.equalTo(84.0)
make.bottom.equalTo(-18)
}
}
}
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
import UIKit import UIKit
class YHResignHaveAppointedInfoCell: UITableViewCell { class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignHaveAppointedInfoCell" static let cellReuseIdentifier = "YHResignHaveAppointedMultipleInfoCell"
lazy var whiteContentView: UIView = { lazy var whiteContentView: UIView = {
let view = UIView() let view = UIView()
...@@ -94,9 +94,9 @@ class YHResignHaveAppointedInfoCell: UITableViewCell { ...@@ -94,9 +94,9 @@ class YHResignHaveAppointedInfoCell: UITableViewCell {
let arr = ["", ""] let arr = ["", ""]
batchView.removeSubviews() batchView.removeSubviews()
var lastView: YHResignAppointedScheduleItemView? = nil var lastView: YHResignAppointedScheduleMultipleItemView? = nil
for (index, model) in arr.enumerated() { for (index, model) in arr.enumerated() {
let itemView = YHResignAppointedScheduleItemView(frame: .zero) let itemView = YHResignAppointedScheduleMultipleItemView(frame: .zero)
batchView.addSubview(itemView) batchView.addSubview(itemView)
itemView.snp.makeConstraints { make in itemView.snp.makeConstraints { make in
make.left.equalTo(0) make.left.equalTo(0)
......
//
// YHResignHaveAppointedSingleInfoCell.swift
// galaxy
//
// Created by edy on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignHaveAppointedSingleInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignHaveAppointedSingleInfoCell"
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = .mainTextColor
label.text = "赴港递交已预约"
return label
}()
lazy var modifyBtn: UIButton = {
let btn = UIButton()
btn.setTitle("修改", for: .normal)
btn.setTitleColor(.brandMainColor, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 14)
return btn
}()
lazy var batchView: YHResignAppointedScheduleSingleItemView = {
let view = YHResignAppointedScheduleSingleItemView(frame: .zero)
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(modifyBtn)
whiteContentView.addSubview(batchView)
whiteContentView.snp.makeConstraints { make in
make.top.equalTo(0)
make.left.equalTo(0)
make.right.equalTo(0)
make.bottom.equalTo(-16)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(16)
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(24)
}
modifyBtn.snp.makeConstraints { make in
make.width.equalTo(28)
make.height.equalTo(24)
make.right.equalTo(-18)
make.centerY.equalTo(titleLabel)
}
batchView.snp.makeConstraints { make in
make.left.equalTo(0)
make.right.equalTo(0)
make.bottom.equalTo(0)
make.top.equalTo(titleLabel.snp.bottom).offset(12)
}
}
}
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