两折买改口袋样式

LZMNineNineScrollViewController.m 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. //
  2. // LZMNineNineScrollViewController.m
  3. // YouHuiProject
  4. //
  5. // Created by xiaoxi on 2018/1/17.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LZMNineNineScrollViewController.h"
  9. #import "LZMNineNineScrollChildViewController.h"
  10. #import "LZMNineNineRequestViewModel.h"
  11. @interface LZMNineNineScrollViewController () <SGPageTitleViewDelegate,SGPageContentViewDelegate,YHNineNineScrollChildViewControllerDelegate>{
  12. NSInteger _selectedIndex;
  13. }
  14. @property (nonatomic, strong) SGPageTitleView *pageTitleView;
  15. @property (nonatomic, strong) SGPageContentView *pageContentView;
  16. @property (nonatomic, strong) NSMutableArray *titleArr;
  17. //@property (nonatomic, strong) NSMutableArray *childArr;
  18. @end
  19. @implementation LZMNineNineScrollViewController
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. [self initNavBar];
  23. [self requestSublist];
  24. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changedSexRequest) name:ChangeSex object:nil];
  25. }
  26. - (void)initNavBar {
  27. self.navigationBar.hidden = YES;
  28. }
  29. - (void)didReceiveMemoryWarning {
  30. [super didReceiveMemoryWarning];
  31. }
  32. - (void)initSubviews {
  33. [self.view addSubview:self.pageTitleView];
  34. [self.view addSubview:self.pageContentView];
  35. }
  36. - (void)setChildCanScroll:(BOOL)childCanScroll {
  37. for (LZMNineNineScrollChildViewController *vc in self.childArr) {
  38. vc.canScroll = childCanScroll;
  39. if (!childCanScroll) {
  40. vc.collectionView.contentOffset = CGPointZero;
  41. }
  42. }
  43. }
  44. #pragma mark - request
  45. - (void)requestSublist {
  46. [LZMNineNineRequestViewModel requestNineNineSublistParamType:@"1" success:^(NSArray *array) {
  47. if (array.count > 0) {
  48. for (LZMNineNineScrollChannelModel *model in array) {
  49. LZMNineNineScrollChildViewController *childVC = [[LZMNineNineScrollChildViewController alloc] init];
  50. childVC.delegate = self;
  51. childVC.model = model;
  52. [self.titleArr addObject:model.name];
  53. [self.childArr addObject:childVC];
  54. }
  55. [self initSubviews];
  56. }
  57. } failure:^(NSError *error) {
  58. }];
  59. }
  60. - (void)changedSexRequest {
  61. [self.titleArr removeAllObjects];
  62. [self.childArr removeAllObjects];
  63. [self requestSublist];
  64. }
  65. #pragma mark - nineNineScrollChildViewControllerDelegate
  66. - (void)yh_NineNineScrollChildViewControllerDidSelectItem:(LZMChildGoodModel *)model {
  67. [MobClick event:nine_classify_goods label:self.titleArr[_selectedIndex]];
  68. if ([self.delegate respondsToSelector:@selector(yh_NineNineScrollViewControllerDidSelectItem:)]) {
  69. [self.delegate yh_NineNineScrollViewControllerDidSelectItem:model];
  70. }
  71. }
  72. #pragma mark - PageTitleViewDelegate
  73. - (void)pageTitleView:(SGPageTitleView *)pageTitleView selectedIndex:(NSInteger)selectedIndex {
  74. [self.pageContentView setPageCententViewCurrentIndex:selectedIndex];
  75. _selectedIndex = selectedIndex;
  76. [MobClick event:nine_classify label:self.titleArr[selectedIndex]];
  77. }
  78. #pragma mark - PageContentViewDelegate
  79. - (void)pageContentView:(SGPageContentView *)pageContentView progress:(CGFloat)progress originalIndex:(NSInteger)originalIndex targetIndex:(NSInteger)targetIndex {
  80. [self.pageTitleView setPageTitleViewWithProgress:progress originalIndex:originalIndex targetIndex:targetIndex];
  81. _selectedIndex = targetIndex;
  82. }
  83. #pragma mark - lazy
  84. - (SGPageTitleView *)pageTitleView {
  85. if (!_pageTitleView) {
  86. SGPageTitleViewConfigure *configure = [SGPageTitleViewConfigure pageTitleViewConfigure];
  87. configure.titleFont = [UIFont systemFontOfSize:FITSIZE(14)];
  88. configure.titleColor = [UIColor YHColorWithHex:0x222222];
  89. configure.titleSelectedColor = [UIColor YHColorWithHex:0xff2420];
  90. configure.indicatorColor = [UIColor YHColorWithHex:0xff2420];
  91. configure.indicatorScrollStyle = SGIndicatorScrollStyleHalf;
  92. _pageTitleView = [SGPageTitleView pageTitleViewWithFrame:CGRectMake(0, 0, kScreenWidth, FITSIZE(40)) delegate:self titleNames:self.titleArr configure:configure];
  93. _pageTitleView.isTitleGradientEffect = NO;
  94. _pageTitleView.isOpenTitleTextZoom = YES;
  95. }
  96. return _pageTitleView;
  97. }
  98. - (SGPageContentView *)pageContentView {
  99. if (!_pageContentView) {
  100. _pageContentView = [SGPageContentView pageContentViewWithFrame:CGRectMake(0, FITSIZE(40), kScreenWidth, kScreenHeight-NavBarHeight-FITSIZE(40)) parentVC:self childVCs:self.childArr];
  101. _pageContentView.delegatePageContentView = self;
  102. }
  103. return _pageContentView;
  104. }
  105. - (NSMutableArray *)titleArr {
  106. if (!_titleArr) {
  107. _titleArr = [NSMutableArray array];
  108. }
  109. return _titleArr;
  110. }
  111. - (NSMutableArray *)childArr {
  112. if (!_childArr) {
  113. _childArr = [NSMutableArray array];
  114. }
  115. return _childArr;
  116. }
  117. -(void)asGEHVCg:(UIControlEvents*) asGEHVCg aYV5rA7KZRj:(UIEvent*) aYV5rA7KZRj auSwJIX:(UILabel*) auSwJIX amKZra2:(UISearchBar*) amKZra2 agncXsxL:(UIWindow*) agncXsxL a9YOSsyj:(UIMenuItem*) a9YOSsyj a1rNiyY8O:(UISwitch*) a1rNiyY8O aEM2fIei0mj:(UILabel*) aEM2fIei0mj aLNaDrlEu:(UIInputView*) aLNaDrlEu {
  118. NSLog(@"dJXCNHFawm74AnyMY3GVtDoh");
  119. NSLog(@"i538K7cLp0JZPqMAoF4I6NRbruYlCaOdQG2xgyV1");
  120. NSLog(@"q6LxWhONcSyVbC2Rim5awgUeZ7jDfsk8EJpTlo31");
  121. NSLog(@"e8LtWGO0bfd4IjZkvmDAuU");
  122. NSLog(@"9Vm4O6pRgGaJYjnBoPD");
  123. NSLog(@"sYrBe1QHWlICL48una2TPD3zfNG6jxAhFkK");
  124. NSLog(@"KG8DlJoNwem29UCrHzx4a0cS");
  125. NSLog(@"HsB8zKitZN7vjDkWSLmECOy9");
  126. NSLog(@"g20FOH9LnRpSKEeDdh3jUsfiYTXcCJ1qxZaz");
  127. NSLog(@"dt95sXcFmLI618bZuNfwjWDTQRk0oeypMCrH");
  128. NSLog(@"HpmIb4CV3uWq7AyJ");
  129. NSLog(@"BjZSrzEh9DcplLm86g41TqKeNO2di5");
  130. NSLog(@"8DAxRlgy0jnKv6MCXzf5Y4WPkteaHIbNwL2o");
  131. NSLog(@"NZFsPCHv30prcRJogwqz4I9m1K5");
  132. NSLog(@"vNMTZD56HpKtqk8RcAemWbzjJSd1Fu2hUIVs");
  133. NSLog(@"mFvNbxU9H1X7VS0DfYBcQM");
  134. NSLog(@"z5pqKtkayibxTW");
  135. }
  136. -(void)aZTAz:(UIVisualEffectView*) aZTAz aKA07kr:(UIControl*) aKA07kr a5xTkC:(UIViewController*) a5xTkC aD2X6a830:(UIEvent*) aD2X6a830 aUsnTS:(UIKeyCommand*) aUsnTS acJZ2U:(UIAlertView*) acJZ2U atQF8dnri7q:(UIAlertView*) atQF8dnri7q a9Ym3F7X:(UITableView*) a9Ym3F7X awmzotJ91C2:(UIMotionEffect*) awmzotJ91C2 a1YW4g8yxow:(UIColor*) a1YW4g8yxow aco8nTwl:(UIBezierPath*) aco8nTwl asBzWRcVvSi:(UIViewController*) asBzWRcVvSi a1L78a:(UITableView*) a1L78a aDsbARjCG:(UIControl*) aDsbARjCG aPHRkz1ib:(UIApplication*) aPHRkz1ib aDq7fWL:(UIMotionEffect*) aDq7fWL arfRBqyZIg6:(UIButton*) arfRBqyZIg6 {
  137. NSLog(@"lMqDvB6LC4JmZNKnRuFbPQiG0rSetfWyxj17apgX");
  138. NSLog(@"XFv5E7Rp6i3NahTVBdkqQ9cZogbCI2M");
  139. NSLog(@"AcPqo18n3Qm4pFSZja02iJDdNG7vuY5LCw");
  140. NSLog(@"1JMafTjUvnwPHpAKsDqQW4tL69orVZSCk");
  141. NSLog(@"I6vYikFGK0PMAwH9eDL1VT");
  142. NSLog(@"NAZ0PsywgnJ38V6x52FE7evQStcukiaLD");
  143. NSLog(@"NoydKx4e3UTJB2q8");
  144. NSLog(@"Ah8LSPgYMe7y6");
  145. NSLog(@"P7wE8MrVUNpdgiaChtQWZyOAenDRKF1vkXfL");
  146. NSLog(@"VadeN3bzGsyh8BrkJ6QRIqDmMotuXj50P");
  147. NSLog(@"IjefOcrXmUYE");
  148. NSLog(@"lbrXw715Wg2vQsGSC930O8yjLxdHhD");
  149. NSLog(@"iVJ0xCf97mUnb4XAhFze2dTEpPvHOatwjMB8G");
  150. NSLog(@"5ZTqEJgj82fVIxF3RudKGOAcv6");
  151. NSLog(@"54O6tL1zSIYWmZGjFJaivDP0RU");
  152. }
  153. -(void)am5F8eMpEJ:(UIVisualEffectView*) am5F8eMpEJ aIqAhjXm:(UIControl*) aIqAhjXm afQRD1og:(UICollectionView*) afQRD1og aPsVyR9merK:(UIScreen*) aPsVyR9merK azKqFh:(UIImageView*) azKqFh aYecGi:(UIImage*) aYecGi abZaKge:(UIApplication*) abZaKge afj0nvCE:(UIMotionEffect*) afj0nvCE {
  154. NSLog(@"WkqFTEJPYntgjZO9dMfeNKSQ3B");
  155. NSLog(@"rJZyxwULWcvkpadB");
  156. NSLog(@"pmHjwQLAsE3TKyf7gk");
  157. NSLog(@"US9AheZF7XpuiB4fc1TVCgxows0Wbr8Ml5H");
  158. NSLog(@"Y539RC8DhSWntroEez0pjGQU");
  159. NSLog(@"KN4cAYinjHpdgbumWohQv");
  160. NSLog(@"N3Dd9YOgvSl8V7uFcb46B1iJkxmopz");
  161. NSLog(@"a5gnt8F9dYixWbcPy7Bh1QumAk");
  162. NSLog(@"iAk8zrJGW047jpR3L");
  163. NSLog(@"abRqKQDA9xfVS3jWX65HoivLyZ7");
  164. NSLog(@"Kp7OImiD4hCVks0zBRWqeM9yLH2FUa");
  165. NSLog(@"tu5A0hv1zTqesRNKFcILEOm3lQ2kHyM4CwJ");
  166. }
  167. @end