HomeFlashDealSubCollectCell.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // HomeFlashDealSubCollectCell.m
  3. // westkissMob
  4. //
  5. // Created by iOS on 2022/9/6.
  6. //
  7. #import "HomeFlashDealSubCollectCell.h"
  8. @implementation HomeFlashDealSubCollectCell
  9. - (void)setModel:(ASProductBaseModel *)model {
  10. _model = model;
  11. self.contView.model = model;
  12. }
  13. - (void)layoutSubviews {
  14. [self loadSubV];
  15. }
  16. - (void)loadSubV {
  17. self.backgroundColor = UIColor.whiteColor;
  18. [self addSubview:self.contView];
  19. [self.contView mas_makeConstraints:^(MASConstraintMaker *make) {
  20. make.top.left.right.equalTo(self);
  21. make.width.equalTo(self.contView.mas_height).offset(-productHWithOutImg);
  22. make.bottom.equalTo(@0);
  23. }];
  24. [self addSubview:self.numImgV];
  25. [self.numImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.top.left.equalTo(self.contentView);
  27. make.width.height.equalTo(@60);
  28. }];
  29. }
  30. - (ASProductItemView *)contView {
  31. if (!_contView) {
  32. ASProductItemView *v = [[ASProductItemView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth-20, KScreenWidth-20+productHWithOutImg)];
  33. _contView = v;
  34. }
  35. return _contView;
  36. }
  37. - (UIImageView *)numImgV {
  38. if (!_numImgV) {
  39. UIImageView *v = [[UIImageView alloc] init];
  40. v.contentMode = UIViewContentModeScaleAspectFit;
  41. v.hidden = true;
  42. _numImgV = v;
  43. }
  44. return _numImgV;
  45. }
  46. @end