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

// 查看大图

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