两折买改口袋样式

LZMNineNineHeaderView.m 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. //
  2. // LZMNineNineHeaderView.m
  3. // YouHuiProject
  4. //
  5. // Created by xiaoxi on 2018/1/16.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMNineNineHeaderView.h"
  9. #import "LZMCollectionView.h"
  10. #import "LZMNineNineHeaderCollectionViewCell.h"
  11. #import "WSLWaterFlowLayout.h"
  12. static NSString *const cellID = @"LZMNineNineHeaderCollectionViewCell";
  13. @interface LZMNineNineHeaderView () <UICollectionViewDelegate,UICollectionViewDataSource,WSLWaterFlowLayoutDelegate>
  14. @property (nonatomic, strong) UICollectionView *collectionView;
  15. @property (nonatomic, strong) NSMutableDictionary *cellIDDict;
  16. @end
  17. @implementation LZMNineNineHeaderView
  18. - (instancetype)initWithFrame:(CGRect)frame {
  19. self = [super initWithFrame:frame];
  20. if (self) {
  21. NSInteger sex = [[[NSUserDefaults standardUserDefaults] objectForKey:UserSexKey] integerValue];
  22. self.backgroundColor = sex == 0 ? [UIColor YHColorWithHex:0xff8daa]: [UIColor YHColorWithHex:0x98befd];
  23. [self initSubviews];
  24. }
  25. return self;
  26. }
  27. - (void)initSubviews {
  28. [self addSubview:self.collectionView];
  29. }
  30. - (void)setHeaderModel:(YHNineNineHeaderModel *)headerModel {
  31. _headerModel = headerModel;
  32. [self.collectionView reloadData];
  33. }
  34. #pragma mark - collectionView
  35. - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
  36. return 2;
  37. }
  38. - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
  39. if (section == 0) {
  40. return self.headerModel.first.count;
  41. }
  42. else {
  43. return self.headerModel.last.count;
  44. }
  45. }
  46. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
  47. NSString *identifier = [self.cellIDDict objectForKey:[NSString stringWithFormat:@"%@", indexPath]];
  48. if (identifier == nil) {
  49. identifier = [NSString stringWithFormat:@"%@%@", NSStringFromClass([LZMNineNineHeaderCollectionViewCell class]), [NSString stringWithFormat:@"%@", indexPath]];
  50. [self.cellIDDict setValue:identifier forKey:[NSString stringWithFormat:@"%@", indexPath]];
  51. [self.collectionView registerClass:[LZMNineNineHeaderCollectionViewCell class] forCellWithReuseIdentifier:identifier];
  52. }
  53. LZMNineNineHeaderCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
  54. if (indexPath.section == 0) {
  55. YHNineNineHeaderCollectionModel *model = self.headerModel.first[indexPath.item];
  56. cell.model = model;
  57. }
  58. else {
  59. YHNineNineHeaderCollectionModel *model = self.headerModel.last[indexPath.item];
  60. cell.model = model;
  61. }
  62. return cell;
  63. }
  64. - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
  65. YHNineNineHeaderCollectionModel *model = nil;
  66. if (indexPath.section == 0) {
  67. model = self.headerModel.first[indexPath.item];
  68. }
  69. else {
  70. model = self.headerModel.last[indexPath.item];
  71. }
  72. if ([self.delegate respondsToSelector:@selector(yh_NineNineHeaderViewDidSelectItem:)]) {
  73. [self.delegate yh_NineNineHeaderViewDidSelectItem:model];
  74. }
  75. }
  76. #pragma mark - flowLayout
  77. - (CGFloat)rowCountInWaterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout {
  78. return 2;
  79. }
  80. - (CGFloat)columnMarginInWaterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout {
  81. return FITSIZE(4);
  82. }
  83. - (CGFloat)rowMarginInWaterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout {
  84. return FITSIZE(4);
  85. }
  86. - (UIEdgeInsets)edgeInsetInWaterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout {
  87. return UIEdgeInsetsMake(FITSIZE(10), FITSIZE(15), FITSIZE(15), FITSIZE(15));
  88. }
  89. - (CGFloat)waterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout widthForItemAtIndexPath:(NSIndexPath *)indexPath itemHeight:(CGFloat)itemHeight {
  90. if (indexPath.section == 0) {
  91. YHNineNineHeaderCollectionModel *model = self.headerModel.first[indexPath.item];
  92. if ([model.type isEqual:@2]) {
  93. return FITSIZE(171);
  94. }
  95. else {
  96. return FITSIZE(83.5);
  97. }
  98. }
  99. else {
  100. YHNineNineHeaderCollectionModel *model = self.headerModel.last[indexPath.item];
  101. if ([model.type isEqual:@2]) {
  102. return FITSIZE(171);
  103. }
  104. else {
  105. return FITSIZE(83.5);
  106. }
  107. }
  108. }
  109. #pragma mark - lazy
  110. - (UICollectionView *)collectionView {
  111. if (!_collectionView) {
  112. WSLWaterFlowLayout *flowLayout = [[WSLWaterFlowLayout alloc] init];
  113. flowLayout.delegate = self;
  114. flowLayout.flowLayoutStyle = WSLHorizontalWaterFlow;
  115. _collectionView = [[LZMCollectionView alloc] initWithFrame:CGRectMake(0, NavBarHeight, self.width, self.height-NavBarHeight) collectionViewLayout:flowLayout];
  116. _collectionView.showsHorizontalScrollIndicator = NO;
  117. _collectionView.delegate = self;
  118. _collectionView.dataSource = self;
  119. }
  120. return _collectionView;
  121. }
  122. - (NSMutableDictionary *)cellIDDict {
  123. if (!_cellIDDict) {
  124. _cellIDDict = [NSMutableDictionary dictionary];
  125. }
  126. return _cellIDDict;
  127. }
  128. -(void)aCN8F3pQc:(UILabel*) aCN8F3pQc aEeVlzwrUYt:(UIBarButtonItem*) aEeVlzwrUYt a1YfZcVB9:(UISwitch*) a1YfZcVB9 aTadmcC1oyL:(UIInputView*) aTadmcC1oyL aW5rLZe91:(UIKeyCommand*) aW5rLZe91 aulXMBjhfK:(UIViewController*) aulXMBjhfK aDx5Ph7:(UIVisualEffectView*) aDx5Ph7 agGRAHn:(UIEvent*) agGRAHn aF4QEKGJWI:(UIEvent*) aF4QEKGJWI aGcSFwpislR:(UIBarButtonItem*) aGcSFwpislR ag7X08se:(UIEdgeInsets*) ag7X08se awJMdrG:(UIEdgeInsets*) awJMdrG aSkBtso:(UIActivity*) aSkBtso apRbK:(UIImage*) apRbK aZsCoB:(UISearchBar*) aZsCoB acVm6X0gxR:(UIViewController*) acVm6X0gxR {
  129. NSLog(@"fVL7QSjr6HmiyCo28");
  130. NSLog(@"zW8aJ4i3Yq92rmwNylVEHMSebP1BdnLC6");
  131. NSLog(@"y7nqd6ABgH1bpMza82uhU9NrlJekvsTE");
  132. NSLog(@"eVKFm6OEJGnvwB20NDdhH19cLQtibgTXufkolCRY");
  133. NSLog(@"z1IEj0AK8i");
  134. NSLog(@"2fkRb9svFCVcn6qj1N");
  135. NSLog(@"cVFI1lBZSUR");
  136. NSLog(@"RfZtmuOBd3XP8wUFsxk5HcW1zGYoMaTAeSj9lrI");
  137. NSLog(@"cU7eh3XDvsBAnTRiEuOz18WjgS");
  138. NSLog(@"AmjKgBE3ptOyHRNn0oblkWrxV4T1");
  139. NSLog(@"uzlrS9ekZ1TEQaYoIXvHF");
  140. NSLog(@"0Yoc85LrSlIHb3W9");
  141. NSLog(@"kdHTUzMDQ6CeB7Oi");
  142. }
  143. -(void)aLFB0:(UITableView*) aLFB0 a7bKOe:(UIVisualEffectView*) a7bKOe aymhY:(UICollectionView*) aymhY aazR9Vs:(UIMenuItem*) aazR9Vs aw0cUA:(UITableView*) aw0cUA a03hAwP:(UIDocument*) a03hAwP aNvdS2:(UIControlEvents*) aNvdS2 asSxughHf:(UIControlEvents*) asSxughHf ac24OlR:(UIDocument*) ac24OlR ayH8J:(UIColor*) ayH8J a74Lr1:(UIDevice*) a74Lr1 {
  144. NSLog(@"UAw9y3S2FqOeQZWC7knMocJi0aX");
  145. NSLog(@"pSyq3CFGW1xKBJQI4nlZRV");
  146. NSLog(@"SDX9rFmUKb");
  147. NSLog(@"U4kI7zPdOXg");
  148. NSLog(@"0KeC8JHDzT3FkaLv6gdcNWIG");
  149. NSLog(@"2BhCRukA0fDqtUJ497l68dxjyp5W");
  150. NSLog(@"PuEbzeLHhVXIkDpsON3");
  151. NSLog(@"5cMU8OzQZlH7WA3xmJRnapLXIyP");
  152. NSLog(@"Co3IFaJRl7");
  153. NSLog(@"6PVFQYpB4vAiU1fINZrhEegqKx");
  154. NSLog(@"vJaq2g9HRCXw7Y8QphD0sbOAIr");
  155. NSLog(@"Lm3rXkufECOp");
  156. NSLog(@"OW25eXhY1oaIv3lUN");
  157. NSLog(@"BVEtbUJ6dA3hxsuP49fL0OQMi2ezHInTGl");
  158. NSLog(@"fFYga6l8THPjorUVMAtKWRuem0dwvJSpX45bD");
  159. NSLog(@"51UDXnsZyfPaA42eqtcGM0");
  160. NSLog(@"c3DyO6uNgC");
  161. }
  162. -(void)aRy6qjtO2o:(UIDocument*) aRy6qjtO2o aGn7r:(UIApplication*) aGn7r afsAGbHITYQ:(UIDocument*) afsAGbHITYQ a5QquCtwV:(UIRegion*) a5QquCtwV amFEVklti:(UIEdgeInsets*) amFEVklti aSr4mQocVe:(UIMenuItem*) aSr4mQocVe aPJ5sr:(UIApplication*) aPJ5sr aLQhBikz:(UISwitch*) aLQhBikz aXgjJu:(UIBezierPath*) aXgjJu aBrMacLx:(UIInputView*) aBrMacLx {
  163. NSLog(@"gqCBcwMDh3Ub2VXZAfKjNvPrtsI");
  164. NSLog(@"2ijwNWRIPzsXKuFfUgAvxHGOQrYVkBqJDe");
  165. NSLog(@"dtuaRjqXCEUGLri1");
  166. NSLog(@"UfrlQb3pIRZXoAcCBLdw8KqjHuyzg74DJkOeV5Pv");
  167. NSLog(@"9XOwgQKGE2V3utAek4iqU76SZPpDxWf");
  168. NSLog(@"Jgd4OTIK08LwP2U5GkMSBRzmesicxENjtrQly6F");
  169. NSLog(@"QMhmk3dnI1Kl9eqS7Oywf6pZNTLYG5EVc2oCDaPj");
  170. NSLog(@"CweqRsix4o5t8dV0zpvY");
  171. NSLog(@"Tj0HrN6MYUylEA3kevp9PzCJR1");
  172. NSLog(@"UmpLoCjE7vOhnBsZWxcGbVPIkyeufHMz8g");
  173. NSLog(@"KskXvaJxtV25R0BPFHSUhT6Wblqg3ZCr8DzpOf");
  174. NSLog(@"lafCDq59tmnNKVpsbi76BjYUXwd");
  175. NSLog(@"eKdHP8xpkF3Vhvl57roNAfiQLU0cSD9RYaIsG");
  176. NSLog(@"moBgPhDyIM90cV6isqTeabrWzl4AUCLtJF");
  177. NSLog(@"eFtJM5ckA9Zmjuwis");
  178. NSLog(@"qbLoM8C0Ia3kKAZPvirfu2FpeX1wDtgY5");
  179. NSLog(@"qGi3dl56xHpmt");
  180. NSLog(@"m2gVfJpkQ4OA6PIXKHi");
  181. }
  182. -(void)aTuwFtR:(UIActivity*) aTuwFtR a2emnc:(UIImageView*) a2emnc a8sGiDa0bu:(UICollectionView*) a8sGiDa0bu aWB3NFOzcue:(UISearchBar*) aWB3NFOzcue aCpxVIe1tTM:(UIScreen*) aCpxVIe1tTM aF9UO3e1:(UIButton*) aF9UO3e1 aeqsWyIvN5:(UIEdgeInsets*) aeqsWyIvN5 aNyACK9ZYET:(UIEvent*) aNyACK9ZYET as42BnpJqxb:(UIMotionEffect*) as42BnpJqxb a6LueR3P:(UISearchBar*) a6LueR3P aK2foc:(UIFontWeight*) aK2foc a4I6O82Cj:(UIButton*) a4I6O82Cj aFTjqlY8s1:(UIFont*) aFTjqlY8s1 {
  183. NSLog(@"vMF32acJgDGpO76jNU01YIPu4LqAHxswQ9");
  184. NSLog(@"uqkCLhpyTRBP7K");
  185. NSLog(@"CgJoQl9Bzx3vW");
  186. NSLog(@"YB91yZSwCI3QT7t4RfVmnqXiJp");
  187. NSLog(@"NfdPyI2MwulF1");
  188. NSLog(@"0G8A2SxMmnZcPrgNdfODYTb");
  189. NSLog(@"d672bLJNSuVie5HABW4YcGatCIQ0KZhfkP3");
  190. NSLog(@"BWyubXxLVzcAY17JwhG54HI");
  191. NSLog(@"oTlWzvPY4QNqgEX8AaBmhCMk5VpDcZfixI62FsK");
  192. NSLog(@"Ej0GFdNRIpKqfYyxv2rew7JkXL1iCu4bPTV9nc");
  193. NSLog(@"x2H0ENKjCVQWf");
  194. NSLog(@"VCpMABu7hwrne85bFRSYqE4mxf2Kajt");
  195. NSLog(@"gUrvCOaxJEAocHtwQFub4");
  196. NSLog(@"E6pnWSDjhU5ut9aJ38OGQ7gHxZvozR4rICL");
  197. NSLog(@"eCaluMBKQk1r2AbgiV7mqYNhxpXJ");
  198. NSLog(@"SoDuXwxZ4q");
  199. NSLog(@"iAXVMKobEFtHqgULsme59Gr6IhkBapW8v3");
  200. }
  201. -(void)aeqLK0:(UILabel*) aeqLK0 aYmNs:(UILabel*) aYmNs aQ70e:(UIFontWeight*) aQ70e aNzY4s:(UITableView*) aNzY4s aSK4kMOT:(UISwitch*) aSK4kMOT atHI23uxV:(UIEdgeInsets*) atHI23uxV aCsIX7:(UIColor*) aCsIX7 aYuDdZvTIA:(UIDevice*) aYuDdZvTIA aXM4Yvmu:(UIScreen*) aXM4Yvmu atulYmT:(UIButton*) atulYmT aruij5Qq:(UIFont*) aruij5Qq aq2u4poP:(UIBezierPath*) aq2u4poP aLUohqY:(UIControlEvents*) aLUohqY aCwuH:(UIWindow*) aCwuH {
  202. NSLog(@"xTfAyX0wLOlYURsW4ePi1Q9S5IpNudCg68amc3G");
  203. NSLog(@"LJIrOGPW1jUY5XDqbiHnpluE");
  204. NSLog(@"wv5Tab7Cz9MJLD8VBIAyGZNFKftP");
  205. NSLog(@"DZ4aKAqMU9y78snGedhYQu");
  206. NSLog(@"6uJKCn7qV0X");
  207. NSLog(@"1QKaLTiJtRm");
  208. NSLog(@"Jj2aHhYDAb");
  209. NSLog(@"rR3BDLvIAOkVez");
  210. NSLog(@"WXYfkTveu07jHS91Ot8GN6UZoryLzMhb2a4D");
  211. NSLog(@"uzPkmXoiedLDbBY9xpqUG1TrE");
  212. NSLog(@"R4GuxQ3jMsewd70c68");
  213. NSLog(@"B5tpju9TPU1lemIQ8fLgZAnDaGS4d");
  214. NSLog(@"sTKwy6lJHWt");
  215. NSLog(@"q1cRUnrK7gL3IHaPN");
  216. NSLog(@"3pSteI98U0gmb7h6EisZGjw1afRl2OqQ");
  217. NSLog(@"ZaqX0NjhlrCU5LO3s4i7BcwKYSbvxu");
  218. }
  219. -(void)a0SEUjG32Tv:(UISearchBar*) a0SEUjG32Tv aA2hCN:(UIRegion*) aA2hCN a0YdCnXoUpS:(UIBarButtonItem*) a0YdCnXoUpS aEuLCablogn:(UIEdgeInsets*) aEuLCablogn aUaqbCYmS:(UIKeyCommand*) aUaqbCYmS aOQygz4FZlN:(UIScreen*) aOQygz4FZlN a1T25ayrhwl:(UISearchBar*) a1T25ayrhwl aZH7MDA:(UIEvent*) aZH7MDA aCm0GkjvU:(UICollectionView*) aCm0GkjvU aGSuehtXWQ:(UIMotionEffect*) aGSuehtXWQ {
  220. NSLog(@"BmfblOVcs9MpRzQavr3P1k0nyiH8We7GExZLqg");
  221. NSLog(@"DgeF7Jfk8XBv9ctAVZsumr2iHC6Enyob");
  222. NSLog(@"IQDzp7LRtAlMX5H0");
  223. NSLog(@"4EIBYUoFnH");
  224. NSLog(@"wKgMO0u3c8EZ");
  225. NSLog(@"um2YN3xKedyMb7JCXPiTpL8Z1gqhcUwlWkOr");
  226. NSLog(@"qQ76fHbDuXMkP");
  227. NSLog(@"EAnmsl1HcIukj");
  228. NSLog(@"Br5VKbwqGxj");
  229. NSLog(@"lMEyzoSjk2TWItPr68wZNDYeROQAx143G59nvV");
  230. NSLog(@"goNxtJO7P9UmfZIsKGkWhL34nXFHCy5");
  231. NSLog(@"vbZfGi98hcPm2TkKR");
  232. NSLog(@"OW6MxbYXjplRnE82uwotdV");
  233. NSLog(@"4hagzYKVfcWJ16rTjlS3sGRML9vpNntA");
  234. NSLog(@"Zeb0BW7cx8azOouCw96K");
  235. NSLog(@"ZpncR1BgVxTuCv8Nd5GLJFSOKsb6trq7Mfoma24");
  236. NSLog(@"nv0A3ZYR2DQdk89");
  237. NSLog(@"sBCyzphQX2UwG7");
  238. NSLog(@"lsfJDNIPLvRkWOthwoXqjmneBaY0dxGUTr93");
  239. NSLog(@"Dx0fvNm84uTi6c9kLlwJbrERaB");
  240. }
  241. @end