|
@@ -7,6 +7,7 @@
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
+import SwiftyMediator
|
|
|
|
|
|
class CardContentPicVideoTableViewCell: UITableViewCell {
|
|
|
|
|
@@ -49,7 +50,6 @@ class CardContentPicVideoTableViewCell: UITableViewCell {
|
|
|
collectionView.showsVerticalScrollIndicator = false
|
|
|
collectionView.showsHorizontalScrollIndicator = false
|
|
|
collectionView.isScrollEnabled = false
|
|
|
- collectionView.isUserInteractionEnabled = false
|
|
|
return collectionView
|
|
|
}()
|
|
|
|
|
@@ -87,6 +87,12 @@ class CardContentPicVideoTableViewCell: UITableViewCell {
|
|
|
self.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (PostType(rawValue: (communityRecommendDataModel?.type)!)) == .image {
|
|
|
+ collectionView.isUserInteractionEnabled = true
|
|
|
+ }else {
|
|
|
+ collectionView.isUserInteractionEnabled = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -119,6 +125,11 @@ class CardContentPicVideoTableViewCell: UITableViewCell {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ if (PostType(rawValue: (communityFollowDataModel?.relateData?.type)!)) == .image {
|
|
|
+ collectionView.isUserInteractionEnabled = true
|
|
|
+ }else {
|
|
|
+ collectionView.isUserInteractionEnabled = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -211,6 +222,46 @@ extension CardContentPicVideoTableViewCell: UICollectionViewDelegateFlowLayout,U
|
|
|
|
|
|
|
|
|
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
|
|
+ if type == .recommend {
|
|
|
+ if (PostType(rawValue: (communityRecommendDataModel?.type)!)) == .image {
|
|
|
+ var postDesc : String?
|
|
|
+ if self.communityRecommendDataModel?.title == nil || communityRecommendDataModel?.title == "" {
|
|
|
+ postDesc = "\(communityRecommendDataModel?.content?.prefix(20) ?? "")"
|
|
|
+ }else {
|
|
|
+ postDesc = communityRecommendDataModel?.title
|
|
|
+ }
|
|
|
+ VirusViewModel.shared.readVirueRecordAddApi(postId: communityRecommendDataModel?.id, postAuthorUid: "\(communityRecommendDataModel?.uid ?? 0)", postDesc: postDesc, postType: communityRecommendDataModel?.type, postCover: communityRecommendDataModel?.img, actionId: "\(communityRecommendDataModel?.id ?? 0)")
|
|
|
+ if communityRecommendDataModel?.imgs?.isEmpty ?? true {
|
|
|
+ if communityRecommendDataModel?.img != "" || communityRecommendDataModel?.img != nil {
|
|
|
+ Mediator.push(BrowsePictureRouterModuleType.pushBrowsePictureImageStrs(imageStrs: [(communityRecommendDataModel?.img ?? "")], index: indexPath.row), animated: true)
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Mediator.push(BrowsePictureRouterModuleType.pushBrowsePictureImageStrs(imageStrs: communityRecommendDataModel?.imgs ?? [(communityRecommendDataModel?.img ?? "")], index: indexPath.row), animated: true)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ } else if type == .follow {
|
|
|
+ if (PostType(rawValue: (communityFollowDataModel?.relateData?.type)!)) == .image {
|
|
|
+ var postDesc : String?
|
|
|
+ if self.communityFollowDataModel?.relateData?.title == nil || communityFollowDataModel?.relateData?.title == "" {
|
|
|
+ postDesc = "\(communityFollowDataModel?.relateData?.content?.prefix(20) ?? "")"
|
|
|
+ }else {
|
|
|
+ postDesc = communityFollowDataModel?.relateData?.title
|
|
|
+ }
|
|
|
+ VirusViewModel.shared.readVirueRecordAddApi(postId: communityFollowDataModel?.relateData?.id, postAuthorUid: "\(communityFollowDataModel?.relateData?.uid ?? 0)", postDesc: postDesc, postType: communityFollowDataModel?.relateData?.type, postCover: communityFollowDataModel?.relateData?.img, actionId: "\(communityFollowDataModel?.relateData?.id ?? 0)")
|
|
|
+
|
|
|
+ if communityFollowDataModel?.relateData?.imgs?.isEmpty ?? true {
|
|
|
+ if communityFollowDataModel?.relateData?.img != "" || communityFollowDataModel?.relateData?.img != nil {
|
|
|
+ Mediator.push(BrowsePictureRouterModuleType.pushBrowsePictureImageStrs(imageStrs: [(communityFollowDataModel?.relateData?.img ?? "")], index: indexPath.row), animated: true)
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Mediator.push(BrowsePictureRouterModuleType.pushBrowsePictureImageStrs(imageStrs: communityFollowDataModel?.relateData?.imgs ?? [(communityFollowDataModel?.relateData?.img ?? "")], index: indexPath.row), animated: true)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|