Commit f884bc00 authored by Steven杜宇's avatar Steven杜宇

// 查看大图

parent 1670bc4e
...@@ -186,13 +186,6 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD ...@@ -186,13 +186,6 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension 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 { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return UITableView.automaticDimension return UITableView.automaticDimension
......
...@@ -12,6 +12,7 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell { ...@@ -12,6 +12,7 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHPrinciplePhotoCollectCell" static let cellReuseIdentifier = "YHPrinciplePhotoCollectCell"
var clickBlock: (()->())?
lazy var imgView: UIImageView = { lazy var imgView: UIImageView = {
let imgView = UIImageView() let imgView = UIImageView()
imgView.layer.cornerRadius = 3.0 imgView.layer.cornerRadius = 3.0
...@@ -67,6 +68,9 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell { ...@@ -67,6 +68,9 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
self.addSubview(imgView) self.addSubview(imgView)
self.addSubview(titleLabel) self.addSubview(titleLabel)
let tap = UITapGestureRecognizer(target: self, action: #selector(didPhotoClicked))
self.contentView.addGestureRecognizer(tap)
imgView.snp.makeConstraints { make in imgView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview() make.left.right.top.equalToSuperview()
make.height.equalTo(80.0) make.height.equalTo(80.0)
...@@ -78,6 +82,10 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell { ...@@ -78,6 +82,10 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
make.height.equalTo(18.0) make.height.equalTo(18.0)
} }
} }
@objc func didPhotoClicked() {
clickBlock?()
}
} }
......
...@@ -216,21 +216,18 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec ...@@ -216,21 +216,18 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec
if 0 <= indexPath.item, indexPath.item < items.count { if 0 <= indexPath.item, indexPath.item < items.count {
let model = items[indexPath.item] let model = items[indexPath.item]
cell.updateModel(model) cell.updateModel(model)
cell.clickBlock = {
[weak self] in
guard let self = self else { return }
let model = items[indexPath.item]
var imgUrlArr:[String] = []
for item in items {
imgUrlArr.append(item.image)
}
YHPictureReviewManager.shared.showNetWorkPicturs(curIndex: indexPath.item, arrPicturs: imgUrlArr)
}
} }
return cell return cell
} }
private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("index is \(indexPath.row)")
if 0 <= indexPath.item, indexPath.item < items.count {
let model = items[indexPath.item]
var imgUrlArr:[String] = []
for item in items {
imgUrlArr.append(item.image)
}
YHPictureReviewManager.shared.showNetWorkPicturs(curIndex: indexPath.item, arrPicturs: imgUrlArr)
}
}
} }
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