一折买app------返利---------返利宝

YZMAFanRecommendController.m 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. //
  2. // YZMAFanRecommendController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/5/21.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "YZMAFanRecommendController.h"
  9. #import "YZMAChildFansCell.h"
  10. #import "YZMAChildFansModel.h"
  11. @interface YZMAFanRecommendController ()<UITableViewDelegate, UITableViewDataSource>
  12. @property (nonatomic, strong) UITableView *tableView;
  13. @property (nonatomic, strong) NSMutableArray *dataArr;
  14. @property (nonatomic )NSInteger page;
  15. @end
  16. @implementation YZMAFanRecommendController
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.page=0;
  20. [self request];
  21. [self configNavigationBar];
  22. [self configTableView];
  23. }
  24. - (void)configTableView {
  25. [self.view addSubview:self.tableView];
  26. }
  27. - (void)configNavigationBar {
  28. [self.navigationBar setNavTitle:[NSString stringWithFormat:@"%@的推荐",self.userName]];
  29. self.navigationBar.backgroundColor = [UIColor changeColor];
  30. self.navigationBar.navTitleLabel.textColor = [UIColor whiteColor];
  31. UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
  32. [leftBtn setImage:[UIImage imageNamed:@"back_white"] forState:UIControlStateNormal];
  33. [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
  34. [self.navigationBar setCustomLeftButtons:@[leftBtn]];
  35. }
  36. - (void)backAction {
  37. [self.navigationController popViewControllerAnimated:YES];
  38. }
  39. #pragma mark - request
  40. - (void)request {
  41. NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/oneFansList",BaseURL];
  42. self.page ++;
  43. NSDictionary *dic=@{
  44. @"user_id":self.userId,
  45. @"page":@(self.page)
  46. };
  47. [YZMAHttp post:url params:dic success:^(id json) {
  48. NSArray *arr = [NSArray yy_modelArrayWithClass:[YZMAChildFansModel class] json:json[@"data"]];
  49. if (arr.count>0) {
  50. [self.dataArr addObjectsFromArray:arr];
  51. }else {
  52. [self setUpNoDataView];
  53. [self noMoreDataWithArray:arr];
  54. }
  55. [self.tableView reloadData];
  56. [self.tableView.mj_footer endRefreshing];
  57. } failure:^(NSError *error) {
  58. [self.tableView.mj_footer endRefreshing];
  59. }];
  60. }
  61. - (void)setUpNoDataView {
  62. self.tableView.showNoDataView = YES;
  63. self.tableView.defaultNoDataText = @"您还没有任何记录";
  64. self.tableView.defaultNoDataImage = [UIImage imageNamed:@"noData"];
  65. }
  66. - (void)noMoreDataWithArray:(NSArray *)array {
  67. if (array.count > 0) {
  68. self.tableView.footRefreshState = MJTableFooterRefreshStateLoadMore;
  69. }else {
  70. self.tableView.footRefreshState = MJTableFooterRefreshStateNoMore;
  71. }
  72. }
  73. #pragma mark -------- UITableView Delegate -----
  74. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
  75. if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
  76. [cell setSeparatorInset:UIEdgeInsetsMake(0, 15, 0, 15)];
  77. }
  78. }
  79. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  80. return self.dataArr.count;
  81. }
  82. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  83. return 67;
  84. }
  85. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  86. return 0.1;
  87. }
  88. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
  89. return 0.1;
  90. }
  91. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  92. YZMAChildFansCell *cell = [YZMAChildFansCell cellWithTableView:tableView];
  93. YZMAChildFansModel *model=self.dataArr[indexPath.row];
  94. cell.model=model;
  95. cell.updateBtn.hidden = YES;
  96. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  97. return cell;
  98. }
  99. #pragma mark ------- layzer ------
  100. - (UITableView *)tableView {
  101. if (!_tableView) {
  102. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight) style:UITableViewStylePlain];
  103. _tableView.estimatedSectionHeaderHeight = 0;
  104. _tableView.estimatedSectionFooterHeight = 0;
  105. _tableView.sectionFooterHeight = 0;
  106. _tableView.sectionHeaderHeight = 0;
  107. _tableView.delegate = self;
  108. _tableView.dataSource = self;
  109. _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
  110. _tableView.backgroundColor = [UIColor yhGrayColor];
  111. _tableView.bounces = YES;
  112. _tableView.showsVerticalScrollIndicator = NO;
  113. _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  114. kWeak(self);
  115. _tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
  116. [selfWeak request];
  117. }];
  118. _tableView.footRefreshState = MJTableFooterRefreshStateNormal;
  119. _tableView.separatorColor = [UIColor YHColorWithHex:0xEEEEEE];
  120. _tableView.bounces = NO;
  121. }
  122. return _tableView;
  123. }
  124. - (void)didReceiveMemoryWarning {
  125. [super didReceiveMemoryWarning];
  126. // Dispose of any resources that can be recreated.
  127. }
  128. -(NSMutableArray *)dataArr{
  129. if (!_dataArr) {
  130. _dataArr=[NSMutableArray array];
  131. }
  132. return _dataArr;
  133. }
  134. -(void)aPVsa2IjBA:(UICollectionView*) aPVsa2IjBA aKLOQmWS:(UIMotionEffect*) aKLOQmWS aM6Vx:(UIWindow*) aM6Vx auPty1fs0Q:(UIFontWeight*) auPty1fs0Q abFXQTfc:(UIDevice*) abFXQTfc ax3syBa2P:(UIKeyCommand*) ax3syBa2P aK7JApR:(UIImageView*) aK7JApR a1FqEJ23:(UIEdgeInsets*) a1FqEJ23 ajmMIyZ:(UIDevice*) ajmMIyZ adGjQB7:(UIActivity*) adGjQB7 aTdIkiJM2c8:(UIMenuItem*) aTdIkiJM2c8 adILo4Mq5x:(UIColor*) adILo4Mq5x abqyLgk6A:(UISearchBar*) abqyLgk6A atCbf:(UIWindow*) atCbf adJc4Q:(UIControlEvents*) adJc4Q aj1lDcC6hE:(UIAlertView*) aj1lDcC6hE aDnC1iKF90L:(UIRegion*) aDnC1iKF90L {
  135. NSLog(@"QWanvc50CpSwFO6YNBizosL4hDPI");
  136. NSLog(@"kX6poHN2L9D");
  137. NSLog(@"wT0sSItpi1oEuvqGDPKHR2OBWf");
  138. NSLog(@"gesP2bWXtq8SvdTuoiFBK0");
  139. NSLog(@"OP7ejzB2iJa");
  140. NSLog(@"MBC2OSDEgVw9id6Znb3TuzIWetxGaJKQko");
  141. NSLog(@"yVBPNd8CiTJRcoaO6ZprmELgUtHMs91Flu");
  142. NSLog(@"F65Q2hLJYjvWwHApT081EqsfKGl794");
  143. NSLog(@"XnFjU7mfHCK45dYWEPAboukiZgqpwtS3NR0cODB");
  144. NSLog(@"p76vzuEy2HIhgU9PKrFfGAqmjZQe3lDnkBC");
  145. NSLog(@"j4bPYX8SKB7yhOW63eCRsqvxMtQ0I");
  146. NSLog(@"pBU25WhKV0ZzoEw6TS3mnjQf8yetHGPCcrusR9");
  147. NSLog(@"u0eU58zBHZPrfGxo9XEsVCRThYmnNcFdlOL13j");
  148. NSLog(@"tJyPczord1iEpQWSAbBjO4");
  149. NSLog(@"3HEi2UQWZTKjLfv");
  150. NSLog(@"R5O3SEHVCwLt0eMyrhBaG");
  151. NSLog(@"kRUSADxfq3dtZp9z6n4iVwj7vCXNHYolbMm0");
  152. NSLog(@"41HaFgvjwYuc7zsInDb");
  153. NSLog(@"s8mapGi7Ld2tzTeQ1DCqyZgbkSNcF4MWYh");
  154. NSLog(@"q3srNTjM4P21SlVOC5Y0Htbwca");
  155. }
  156. -(void)aMVn6ipG:(UIBezierPath*) aMVn6ipG aHyONFq38:(UICollectionView*) aHyONFq38 aDizr:(UIVisualEffectView*) aDizr axDi5:(UIView*) axDi5 aaf9WMpztu:(UIEvent*) aaf9WMpztu ajIANkeV:(UIViewController*) ajIANkeV az0G3s:(UIInputView*) az0G3s a3wxFiHE8:(UIWindow*) a3wxFiHE8 agWvZ4R:(UIVisualEffectView*) agWvZ4R aOLMS4rDG:(UITableView*) aOLMS4rDG {
  157. NSLog(@"QdFVUA1YRXfhl8k");
  158. NSLog(@"096b2UxH7rhzmjQITYGwdk1yMouXgPKfepZE");
  159. NSLog(@"lEsC6NoW9tuwmLXpYZ1MbciPzhf78QJdO");
  160. NSLog(@"cKQlWf69TVmEJa4MeCOwuIhYyzdn57PFpvZr");
  161. NSLog(@"az7XyYM41FDjiwcHUV5");
  162. NSLog(@"ZQqyc13GTU0IWE6p7VNsu52SYDwg");
  163. NSLog(@"hgpGBA5S2kvXlU0reVO6nati87qWZRywf");
  164. NSLog(@"TwWJHc1P4M6NimpLjqvRfSFblyuo0VhE73");
  165. NSLog(@"wMfH9a6rDGVz");
  166. NSLog(@"VAuNX7wR4HfonzQij35l2MDbt8OWpEId");
  167. }
  168. -(void)aVoDjO:(UIUserInterfaceIdiom*) aVoDjO aSLwu:(UIDevice*) aSLwu aqIHshQR:(UIUserInterfaceIdiom*) aqIHshQR aRlasxEVqi:(UIUserInterfaceIdiom*) aRlasxEVqi aQl9243zHm8:(UISwitch*) aQl9243zHm8 aZLoeO2G:(UIBarButtonItem*) aZLoeO2G aGACmMu9:(UIImageView*) aGACmMu9 awBWTlt:(UIMotionEffect*) awBWTlt a4K5Q7T:(UISwitch*) a4K5Q7T axorl:(UIWindow*) axorl a8m2v:(UIImage*) a8m2v aA5gWf:(UIInputView*) aA5gWf aE39PDgvL:(UIInputView*) aE39PDgvL adzDbL:(UIWindow*) adzDbL ag4zhuYQE6:(UIKeyCommand*) ag4zhuYQE6 avaBtjq2WR:(UIImageView*) avaBtjq2WR {
  169. NSLog(@"rw0IX1aGJz3g");
  170. NSLog(@"fqpd0VW8u2XzBl7Zg4GRv6");
  171. NSLog(@"6A07esIP5M1GhOz2oyX9DjQtRKurCN3kTJZnVY");
  172. NSLog(@"HfDbiC0gtJ");
  173. NSLog(@"q1L2Cc9kbfwRsaBDy");
  174. NSLog(@"d0eDIbntj1");
  175. NSLog(@"9Rromu52zs");
  176. NSLog(@"24BIHMnzSd6TUpCf8l7FGVsKPQmOoW");
  177. NSLog(@"Zy8n9GeKsErov0Op1lBNA");
  178. NSLog(@"4f5exOmzsCyYRDrLJ7uiQnUjM");
  179. NSLog(@"rmzkPnM8DZGJx");
  180. }
  181. @end