|
@@ -92,6 +92,55 @@ class ProductDetailEvaluationTableViewCell: UITableViewCell {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private lazy var collectionView: UICollectionView = {
|
|
|
+ let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
|
|
|
+ collectionView.backgroundColor = UIColor.white
|
|
|
+ collectionView.delegate = self;
|
|
|
+ collectionView.dataSource = self;
|
|
|
+ collectionView.showsVerticalScrollIndicator = false
|
|
|
+ collectionView.showsHorizontalScrollIndicator = false
|
|
|
+ collectionView.cornerRadius = 4
|
|
|
+ collectionView.masksToBounds = true
|
|
|
+ return collectionView
|
|
|
+ }()
|
|
|
|
|
|
+ private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
|
|
|
+ let collectionViewLayout = UICollectionViewFlowLayout.init()
|
|
|
+ collectionViewLayout.minimumLineSpacing = 7
|
|
|
+ collectionViewLayout.minimumInteritemSpacing = 0
|
|
|
+ collectionViewLayout.scrollDirection = .horizontal
|
|
|
+ return collectionViewLayout
|
|
|
+ }()
|
|
|
+}
|
|
|
+
|
|
|
+extension ProductDetailEvaluationTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
|
|
|
+ func numberOfSections(in collectionView: UICollectionView) -> Int {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+
|
|
|
+ func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+
|
|
|
+ func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
|
|
+ let cell = ProductDetailEvaluationImageCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
|
|
|
+
|
|
|
+ return cell
|
|
|
+ }
|
|
|
+
|
|
|
+ func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
|
|
+// let productSearchModel = productSearchListModel?.data?[indexPath.row]
|
|
|
+// if let jumpToDetailClosure = self.jumpToDetailClosure {
|
|
|
+// jumpToDetailClosure(productSearchModel?.id ?? 0, productSearchModel?.shopId ?? 0)
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
+ func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
|
|
+ return CGSize(width:(kScreenWidth-30-(14*3))/4, height: (kScreenWidth-30-(14*3))/4)
|
|
|
+ }
|
|
|
+
|
|
|
+ func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
|
|
|
+ return UIEdgeInsets(top: 10, left: 14, bottom: 10, right: 14)
|
|
|
+ }
|
|
|
|
|
|
}
|