|
@@ -18,6 +18,9 @@ class PublishEditAddPicCell: UITableViewCell {
|
|
typealias DelPicTransBlock = (_ idxRow:Int?) -> Void
|
|
typealias DelPicTransBlock = (_ idxRow:Int?) -> Void
|
|
var delPicTransBlock : DelPicTransBlock?
|
|
var delPicTransBlock : DelPicTransBlock?
|
|
|
|
|
|
|
|
+ var mediaType : PublishMediaType?
|
|
|
|
+
|
|
|
|
+
|
|
var imgCount: Int = 0
|
|
var imgCount: Int = 0
|
|
var pubImageArr: Array<UIImage>? {
|
|
var pubImageArr: Array<UIImage>? {
|
|
didSet {
|
|
didSet {
|
|
@@ -111,16 +114,12 @@ extension PublishEditAddPicCell: UICollectionViewDelegateFlowLayout,UICollection
|
|
} else {
|
|
} else {
|
|
// 展示图片
|
|
// 展示图片
|
|
let pCell = PublishEditAddImgCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
|
|
let pCell = PublishEditAddImgCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
|
|
|
|
+ pCell.mediaType = mediaType
|
|
if indexPath.row < imgCount {
|
|
if indexPath.row < imgCount {
|
|
pCell.showImage = self.pubImageArr![indexPath.row]
|
|
pCell.showImage = self.pubImageArr![indexPath.row]
|
|
}
|
|
}
|
|
pCell.delPicBlock = {
|
|
pCell.delPicBlock = {
|
|
[weak self] (idxRow) in
|
|
[weak self] (idxRow) in
|
|
-// if self?.imgCount == 1 {
|
|
|
|
-// SwiftProgressHUD.shared().showText("请保留至少1张图片")
|
|
|
|
-// return
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
if let delPicTransBlock = self?.delPicTransBlock {
|
|
if let delPicTransBlock = self?.delPicTransBlock {
|
|
delPicTransBlock(idxRow)
|
|
delPicTransBlock(idxRow)
|
|
}
|
|
}
|