imageCollectionViewCell.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // imageCollectionViewCell.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2024/5/13.
  6. //
  7. #import "imageCollectionViewCell.h"
  8. @interface imageCollectionViewCell()
  9. @property (strong, nonatomic) UIImageView *imageView;
  10. @property (nonatomic, strong) UIButton *selectButton;
  11. @end
  12. @implementation imageCollectionViewCell
  13. - (instancetype)initWithFrame:(CGRect)frame {
  14. if (self = [super initWithFrame:frame]) {
  15. [self setupSubViews];
  16. }
  17. return self;
  18. }
  19. - (void)setupSubViews{
  20. _imageView = [UIImageView new];
  21. [self addSubview:_imageView];
  22. [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
  23. make.left.mas_equalTo(0);
  24. make.right.mas_equalTo(0);
  25. make.top.mas_equalTo(0);
  26. make.bottom.mas_equalTo(0);
  27. }];
  28. }
  29. - (void)setCurFileModel:(couldPhoneFileModel *)curFileModel
  30. {
  31. _curFileModel = curFileModel;
  32. //[[downloadThumbnailManager shareInstance] handlToDownloadThumbnailInDownTableViewWith:@[_curFileModel]];
  33. _imageView.image = [UIImage imageNamed:@"uploadFile_image"];
  34. if([curFileModel.fileType isEqualToString:@"video"])
  35. {
  36. _imageView.image = [UIImage imageNamed:@"uploadFile_Video"];
  37. }
  38. //checkButton.selected = curFileModel.isSelectType;
  39. NSString *fileName = [_curFileModel getFileNameFun];
  40. NSString*pathStr = [cachesFileManager getFilePathWithName:fileName type:DownLoadThumbnail];
  41. UIImage *curImage = [UIImage imageWithContentsOfFile:pathStr];
  42. if(curImage){
  43. _imageView.image = curImage;
  44. }
  45. }
  46. @end