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

打通 数据

parent bdec0397
......@@ -134,6 +134,10 @@ class YHCertificateAppointViewController: YHBaseViewController {
} else { // 申请人不是统一赴港激活签证
let item6 = YHAppointItem(type: .confirmGoHKInfo)
item6.itemIndex = 0
let model1 = YHSelectGroupMemberModel()
model1.arr = waitAppointMembers
item6.model = model1
items2.append(item6)
}
......@@ -272,6 +276,7 @@ extension YHCertificateAppointViewController: UITableViewDelegate, UITableViewDa
if item.type == .confirmGoHKInfo {
// 请您确认第X批赴港信息
let cell = tableView.dequeueReusableCell(withIdentifier: YHSelectApplicantGroupCell.cellReuseIdentifier, for: indexPath) as! YHSelectApplicantGroupCell
cell.dataModel = arr[indexPath.row]
cell.isShowSelectUserView = !self.isAllMembersGo
return cell
}
......
......@@ -30,7 +30,8 @@ enum YHAppointItemType: Int {
}
class YHAppointItem: NSObject {
class YHAppointItem {
var itemIndex : Int = 0
var type: YHAppointItemType = .none
var model : YHSelectGroupMemberModel? // type = .confirmGoHKInfo 时候的赋值
init(type: YHAppointItemType) {
......
......@@ -50,10 +50,9 @@ class YHSelectApplicantCell: UICollectionViewCell {
}
}
func updateApplicantInfo(_ applicant: YHSelectApplicantInfo) {
func updateApplicantInfo(_ applicant: YHHKMemberModel) {
nameLabel.text = applicant.name
let imgName = applicant.isSelect ? "login_privacy_agree" : "login_privacy_disagree_glay"
let imgName = applicant.isSelectedFlag ? "login_privacy_agree" : "login_privacy_disagree_glay"
selectImgView.image = UIImage(named: imgName)
}
}
......@@ -22,7 +22,13 @@ class YHSelectApplicantInfo {
class YHSelectApplicantGroupCell: UITableViewCell {
static let cellReuseIdentifier = "YHSelectApplicantGroupCell"
let detailText = "选择第一批赴港激活签证的申请人"
var detailText = "选择第一批赴港激活签证的申请人"
var dataModel : YHAppointItem? {
didSet {
updateUI()
}
}
var isShowSelectUserView: Bool = true {
......@@ -57,12 +63,12 @@ class YHSelectApplicantGroupCell: UITableViewCell {
}
}
lazy var selecters:[YHSelectApplicantInfo] = {
return [YHSelectApplicantInfo(name: "李小龙", isSelect: true),
YHSelectApplicantInfo(name: "成龙", isSelect: true),
YHSelectApplicantInfo(name: "甄子丹", isSelect: true),
YHSelectApplicantInfo(name: "吉田双阴", isSelect: false),]
}()
// lazy var selecters:[YHSelectApplicantInfo] = {
// return [YHSelectApplicantInfo(name: "李小龙", isSelect: true),
// YHSelectApplicantInfo(name: "成龙", isSelect: true),
// YHSelectApplicantInfo(name: "甄子丹", isSelect: true),
// YHSelectApplicantInfo(name: "吉田双阴", isSelect: false),]
// }()
lazy var whiteContentView: UIView = {
let view = UIView()
......@@ -133,7 +139,7 @@ class YHSelectApplicantGroupCell: UITableViewCell {
let view = YHInfoItemSelectSheetView(frame: .zero)
view.isShowDetailOneline = true
view.title = "具体日期"
view.detail = "2024-03-14 ~ 2024-03-14 "
view.detail = "2024-03-14 ~ 2024-03-14"
return view
}()
......@@ -233,8 +239,7 @@ extension YHSelectApplicantGroupCell: UICollectionViewDelegate, UICollectionView
// 返回单元格数量
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return selecters.count
return (dataModel?.model?.arr.count) ?? 0
}
// 返回每个单元格的大小
......@@ -246,16 +251,40 @@ extension YHSelectApplicantGroupCell: UICollectionViewDelegate, UICollectionView
// 返回自定义单元格
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)
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 0 <= indexPath.item && indexPath.item < selecters.count {
let text = selecters[indexPath.item]
if let arr = dataModel?.model?.arr {
if 0 <= indexPath.item && indexPath.item < arr.count {
let text = arr[indexPath.item]
printLog(text)
}
}
}
}
private extension YHSelectApplicantGroupCell {
func updateUI() {
guard let model = dataModel else {
return
}
let a: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.failColor))
let b: ASAttributedString = .init("请您确认第\(model.itemIndex + 1)批赴港信息", .font(UIFont.PFSC_M(ofSize: 17)),.foreground(UIColor.mainTextColor))
titleLabel.attributed.text = a+b
collectionView.reloadData()
}
}
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