Commit 813978bc authored by Steven杜宇's avatar Steven杜宇

// 选中block

parent 54201774
...@@ -51,7 +51,7 @@ class YHHKMemberModel: SmartCodable, NSCopying { ...@@ -51,7 +51,7 @@ class YHHKMemberModel: SmartCodable, NSCopying {
} }
init(id: Int, name: String, type: String, fileNum: String, birthday: String, isCheck: Int, url: String, approvalDate: String) { init(id: Int, name: String, type: String, fileNum: String, birthday: String, isCheck: Int, url: String, approvalDate: String, isSelected: Bool) {
self.id = id self.id = id
self.name = name self.name = name
self.type = type self.type = type
...@@ -60,11 +60,12 @@ class YHHKMemberModel: SmartCodable, NSCopying { ...@@ -60,11 +60,12 @@ class YHHKMemberModel: SmartCodable, NSCopying {
self.isCheck = isCheck self.isCheck = isCheck
self.url = url self.url = url
self.approvalDate = approvalDate self.approvalDate = approvalDate
self.isSelected = isSelected
} }
func copy(with zone: NSZone? = nil) -> Any { func copy(with zone: NSZone? = nil) -> Any {
return YHHKMemberModel(id: self.id, name: self.name, type: self.type, fileNum: self.fileNum, birthday: self.birthday, isCheck: self.isCheck, url: self.url, approvalDate: self.approvalDate) return YHHKMemberModel(id: self.id, name: self.name, type: self.type, fileNum: self.fileNum, birthday: self.birthday, isCheck: self.isCheck, url: self.url, approvalDate: self.approvalDate, isSelected: isSelected)
} }
func isAtLeast11Years() -> Bool { func isAtLeast11Years() -> Bool {
......
...@@ -20,6 +20,9 @@ class YHSelectApplicantGroupCell: UITableViewCell { ...@@ -20,6 +20,9 @@ class YHSelectApplicantGroupCell: UITableViewCell {
} }
} }
// param 选中的用户 是否选中 选中的用户是第几批
var selectBlock: ((_ member: YHHKMemberModel, _ isSelect: Bool, _ groupIndex: Int)->())?
var isShowSelectUserView: Bool = true { var isShowSelectUserView: Bool = true {
didSet { didSet {
...@@ -284,10 +287,10 @@ extension YHSelectApplicantGroupCell: UICollectionViewDelegate, UICollectionView ...@@ -284,10 +287,10 @@ extension YHSelectApplicantGroupCell: UICollectionViewDelegate, UICollectionView
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if let arr = dataModel?.model?.arr { if let dataModel = self.dataModel, let model = dataModel.model {
if 0 <= indexPath.item && indexPath.item < arr.count { if 0 <= indexPath.item && indexPath.item < model.arr.count {
let text = arr[indexPath.item] let member = model.arr[indexPath.item]
printLog(text) selectBlock?(member, !member.isSelected, dataModel.itemIndex)
} }
} }
} }
......
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