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

// 选中block

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