两折卖----返利app-----返利圈

LZMFindMiddleView.m 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. //
  2. // LZMFindMiddleView.m
  3. // YouHuiProject
  4. //
  5. // Created by xiaoxi on 2018/1/19.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMFindMiddleView.h"
  9. #import "LZMCollectionView.h"
  10. #import "LZMFindMiddleCollectionViewCell.h"
  11. static NSString *const cellID = @"LZMFindMiddleCollectionViewCell";
  12. @interface LZMFindMiddleView () <UICollectionViewDelegate,UICollectionViewDataSource>
  13. @property (nonatomic, strong) UICollectionView *collectionView;
  14. @end
  15. @implementation LZMFindMiddleView
  16. - (instancetype)initWithFrame:(CGRect)frame {
  17. self = [super initWithFrame:frame];
  18. if (self) {
  19. self.backgroundColor = [UIColor whiteColor];
  20. [self initSubviews];
  21. }
  22. return self;
  23. }
  24. - (void)initSubviews {
  25. CALayer *lineLayer = [CALayer layer];
  26. lineLayer.backgroundColor = [UIColor YHColorWithHex:0xdddddd].CGColor;
  27. lineLayer.frame = CGRectMake(0, 0, kScreenWidth, 0.5);
  28. [self.layer addSublayer:lineLayer];
  29. UIImageView *iconImageView = [[UIImageView alloc] init];
  30. iconImageView.backgroundColor = [UIColor clearColor];
  31. iconImageView.image = [UIImage imageNamed:@"goods"];
  32. [self addSubview:iconImageView];
  33. UILabel *nameLabel = [[UILabel alloc] init];
  34. nameLabel.backgroundColor = [UIColor clearColor];
  35. nameLabel.text = @"商品分类";
  36. nameLabel.textColor = [UIColor YHColorWithHex:0x222222];
  37. nameLabel.font = [UIFont systemFontOfSize:FITSIZE(12)];
  38. [self addSubview:nameLabel];
  39. [self addSubview:self.collectionView];
  40. [iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  41. make.left.equalTo(self).offset(FITSIZE(15));
  42. make.centerY.equalTo(nameLabel);
  43. make.size.mas_equalTo(CGSizeMake(FITSIZE(12), FITSIZE(12)));
  44. }];
  45. [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.left.equalTo(iconImageView.mas_right).offset(FITSIZE(8));
  47. make.top.equalTo(self).offset(FITSIZE(16));
  48. }];
  49. [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
  50. make.left.equalTo(self);
  51. make.top.equalTo(self).offset(FITSIZE(28));
  52. make.right.equalTo(self);
  53. make.bottom.equalTo(self);
  54. }];
  55. }
  56. - (void)setDataSource:(NSMutableArray *)dataSource {
  57. _dataSource = dataSource;
  58. [self.collectionView reloadData];
  59. }
  60. #pragma mark - collectionView
  61. - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
  62. return 1;
  63. }
  64. - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
  65. return self.dataSource.count;
  66. }
  67. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
  68. LZMFindMiddleCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath];
  69. LZMFindChannelModel *model = self.dataSource[indexPath.item];
  70. cell.model = model;
  71. return cell;
  72. }
  73. - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
  74. if ([self.delegate respondsToSelector:@selector(yh_FindMiddleViewDidSelectItemAtIndexPath:)]) {
  75. [self.delegate yh_FindMiddleViewDidSelectItemAtIndexPath:indexPath];
  76. }
  77. }
  78. #pragma mark - lazy
  79. - (UICollectionView *)collectionView {
  80. if (!_collectionView) {
  81. UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
  82. flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
  83. flowLayout.itemSize = CGSizeMake(kScreenWidth/4, FITSIZE(66));
  84. flowLayout.minimumLineSpacing = FITSIZE(26);
  85. flowLayout.minimumInteritemSpacing = FITSIZE(0);
  86. flowLayout.sectionInset = UIEdgeInsetsMake(FITSIZE(26), 0, FITSIZE(16), 0);
  87. _collectionView = [[LZMCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:flowLayout];
  88. _collectionView.scrollEnabled = NO;
  89. _collectionView.bounces = NO;
  90. _collectionView.showsVerticalScrollIndicator = NO;
  91. _collectionView.delegate = self;
  92. _collectionView.dataSource = self;
  93. [_collectionView registerClass:[LZMFindMiddleCollectionViewCell class] forCellWithReuseIdentifier:cellID];
  94. }
  95. return _collectionView;
  96. }
  97. -(void)aQyhxM:(UIFont*) aQyhxM apaGAgMU:(UIFont*) apaGAgMU ayDrHom4Gs:(UIMotionEffect*) ayDrHom4Gs ac18G5Z49w:(UISearchBar*) ac18G5Z49w a4fFisYXD3P:(UIScreen*) a4fFisYXD3P akLG8lgd:(UIApplication*) akLG8lgd a9LTmi:(UIView*) a9LTmi ag6FbexIW9V:(UILabel*) ag6FbexIW9V aqsJmr:(UIActivity*) aqsJmr abvdmrc:(UIUserInterfaceIdiom*) abvdmrc aenBFUQujh4:(UIEdgeInsets*) aenBFUQujh4 ax05cUR:(UIAlertView*) ax05cUR a3RGA2siCI:(UISearchBar*) a3RGA2siCI a2U5vaNl:(UIImage*) a2U5vaNl aEiFd1hM3l:(UIControl*) aEiFd1hM3l aGMh4pXDcU0:(UIDocument*) aGMh4pXDcU0 {
  98. NSLog(@"AKJqEHTrCukzh7lfg31PRwoY64SZMNiOvmQ");
  99. NSLog(@"7s9m8UWTghRbc0MvftKzuJranN6BGoxZP1I54");
  100. NSLog(@"MY7gGN9wCUVnZ0jiue5DFmxh4");
  101. NSLog(@"PhujnxlRqtXdTr4E7CyVmiWFHaJNb1sA5MfevY6");
  102. NSLog(@"Xp7DFu3YGdQWMkzorPt5S2OnBh8HCE61TK0qsNlU");
  103. NSLog(@"gpZJuyzH8Yk4PNS9v6R");
  104. NSLog(@"ljh9PfQXVLJCsp1nBZ0DRTqbGeUzY2");
  105. NSLog(@"LlASXO7jTNQn35Dbrqmi0uKozHeyB2cM");
  106. NSLog(@"4JmMDHVjE6fcr2bnXogNFwPKS5UvIL0yqha1B3");
  107. NSLog(@"z9k2qPRpOCaiesn45HUdSgXrb7YMIly0T");
  108. NSLog(@"GA07weFtTLBYMl8");
  109. NSLog(@"8woVch6r1U2f0t7QbDBiaRe43SLXpHgAuv5zNq");
  110. NSLog(@"ePBKUhgr6y3J7uXvcGaSHQkR");
  111. NSLog(@"DFlgGYAn9Vk6bONi");
  112. NSLog(@"UHxDtnj6yh7gfYu");
  113. NSLog(@"Vcm3tX2F5p");
  114. }
  115. -(void)aiNJzjsHU1Z:(UIView*) aiNJzjsHU1Z aY3yCkVAF:(UIImageView*) aY3yCkVAF aoM8FTvU:(UIDocument*) aoM8FTvU an8FfM3pYaW:(UIEdgeInsets*) an8FfM3pYaW aEkvUGDhZV:(UIScreen*) aEkvUGDhZV a9Z4y5:(UIAlertView*) a9Z4y5 aNkhlLgY3J:(UIDevice*) aNkhlLgY3J aQnChZ1KXzt:(UIInputView*) aQnChZ1KXzt aNesnP3kb:(UIEvent*) aNesnP3kb akDd5JOSXT:(UIView*) akDd5JOSXT aVinut0:(UIScreen*) aVinut0 a9NSy:(UIControl*) a9NSy aWCaS:(UIColor*) aWCaS auBmTWbCgxn:(UIBezierPath*) auBmTWbCgxn aG6JM:(UIUserInterfaceIdiom*) aG6JM ab9V7:(UIImage*) ab9V7 aocyslW6q:(UILabel*) aocyslW6q {
  116. NSLog(@"etln63sOCK5wUkMSpLcbPDxTz2");
  117. NSLog(@"txNq6JLiEUk9WQS1GDOHAla");
  118. NSLog(@"SqQWB8l4r9anPFiIw3EHZcRmhK");
  119. NSLog(@"310KUITiBcPqu6QFxJ");
  120. NSLog(@"wANFdMLTIuaegt5QK");
  121. NSLog(@"Tpbr8OG3W7nyw5CzMeSj9YLNZmiIgQfq6EkPv");
  122. NSLog(@"DCSu8HvzcXdUmypnJQk4l7A9Nb0GVRgtIOjh");
  123. NSLog(@"4MQa6cPDkoIpTKNOfzL8sVuW9A5geGYZblrSJ");
  124. NSLog(@"i8KfuAyhCbtH2w3jRgqDIBUJ");
  125. NSLog(@"3sUa9EVDMzY6T7SpgQmi");
  126. }
  127. -(void)a3O0RgGdo4b:(UISearchBar*) a3O0RgGdo4b aCHM9dhD:(UIApplication*) aCHM9dhD aDXKL8A97Zz:(UICollectionView*) aDXKL8A97Zz aQxFZPo:(UISwitch*) aQxFZPo afFUP:(UIFont*) afFUP aYAFo:(UISwitch*) aYAFo aTLv5:(UIEdgeInsets*) aTLv5 ag5dp0uGEB6:(UIVisualEffectView*) ag5dp0uGEB6 aFKuEQZ:(UITableView*) aFKuEQZ aku5V7pWnw:(UIControl*) aku5V7pWnw aMpfPq0ZkXJ:(UIBarButtonItem*) aMpfPq0ZkXJ aWU9yGZh:(UIView*) aWU9yGZh aSpMEe8:(UIMenuItem*) aSpMEe8 a0BvfUx:(UISwitch*) a0BvfUx akJlusTOR:(UIRegion*) akJlusTOR aNMsBG0wYLn:(UILabel*) aNMsBG0wYLn anWpUzlwJ:(UIFontWeight*) anWpUzlwJ aXLWDfk70:(UISwitch*) aXLWDfk70 a5tdcMxn:(UICollectionView*) a5tdcMxn {
  128. NSLog(@"Wa4HSGgeikrXRqL9vZEBFnxKy7D3");
  129. NSLog(@"lNYvzZysbjR8xpuWJBU01kHSILn");
  130. NSLog(@"Met0fFa3bDyUI48u");
  131. NSLog(@"NMSHkYtE0L4UnuelpcgJjArom");
  132. NSLog(@"pqDzZMx0YdXFAe741Uu8g9HioaIsjEhLNBCJ");
  133. NSLog(@"HUCX8B9fWVJs2P3wg5h1yIOlm6");
  134. NSLog(@"v1YR7VdHzUew");
  135. NSLog(@"rkfKUdMWDvVPQg");
  136. NSLog(@"LFDxNrSC05RXA2gmWE9h8sputOcY6jGbnqekd");
  137. NSLog(@"mkcLt8nXzAfNHUxYQPh6BVrDM4Eliuo");
  138. }
  139. @end