// // YZMAFanRecommendController.m // YouHuiProject // // Created by 小花 on 2018/5/21. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMAFanRecommendController.h" #import "YZMAChildFansCell.h" #import "YZMAChildFansModel.h" @interface YZMAFanRecommendController () @property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) NSMutableArray *dataArr; @property (nonatomic )NSInteger page; @end @implementation YZMAFanRecommendController - (void)viewDidLoad { [super viewDidLoad]; self.page=0; [self request]; [self configNavigationBar]; [self configTableView]; } - (void)configTableView { [self.view addSubview:self.tableView]; } - (void)configNavigationBar { [self.navigationBar setNavTitle:[NSString stringWithFormat:@"%@的推荐",self.userName]]; self.navigationBar.backgroundColor = [UIColor changeColor]; self.navigationBar.navTitleLabel.textColor = [UIColor whiteColor]; UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; [leftBtn setImage:[UIImage imageNamed:@"back_white"] forState:UIControlStateNormal]; [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; [self.navigationBar setCustomLeftButtons:@[leftBtn]]; } - (void)backAction { [self.navigationController popViewControllerAnimated:YES]; } #pragma mark - request - (void)request { NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/oneFansList",BaseURL]; self.page ++; NSDictionary *dic=@{ @"user_id":self.userId, @"page":@(self.page) }; [YZMAHttp post:url params:dic success:^(id json) { NSArray *arr = [NSArray yy_modelArrayWithClass:[YZMAChildFansModel class] json:json[@"data"]]; if (arr.count>0) { [self.dataArr addObjectsFromArray:arr]; }else { [self setUpNoDataView]; [self noMoreDataWithArray:arr]; } [self.tableView reloadData]; [self.tableView.mj_footer endRefreshing]; } failure:^(NSError *error) { [self.tableView.mj_footer endRefreshing]; }]; } - (void)setUpNoDataView { self.tableView.showNoDataView = YES; self.tableView.defaultNoDataText = @"您还没有任何记录"; self.tableView.defaultNoDataImage = [UIImage imageNamed:@"noData"]; } - (void)noMoreDataWithArray:(NSArray *)array { if (array.count > 0) { self.tableView.footRefreshState = MJTableFooterRefreshStateLoadMore; }else { self.tableView.footRefreshState = MJTableFooterRefreshStateNoMore; } } #pragma mark -------- UITableView Delegate ----- - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { [cell setSeparatorInset:UIEdgeInsetsMake(0, 15, 0, 15)]; } } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.dataArr.count; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 67; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 0.1; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0.1; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { YZMAChildFansCell *cell = [YZMAChildFansCell cellWithTableView:tableView]; YZMAChildFansModel *model=self.dataArr[indexPath.row]; cell.model=model; cell.updateBtn.hidden = YES; cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } #pragma mark ------- layzer ------ - (UITableView *)tableView { if (!_tableView) { _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight) style:UITableViewStylePlain]; _tableView.estimatedSectionHeaderHeight = 0; _tableView.estimatedSectionFooterHeight = 0; _tableView.sectionFooterHeight = 0; _tableView.sectionHeaderHeight = 0; _tableView.delegate = self; _tableView.dataSource = self; _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; _tableView.backgroundColor = [UIColor yhGrayColor]; _tableView.bounces = YES; _tableView.showsVerticalScrollIndicator = NO; _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; kWeak(self); _tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ [selfWeak request]; }]; _tableView.footRefreshState = MJTableFooterRefreshStateNormal; _tableView.separatorColor = [UIColor YHColorWithHex:0xEEEEEE]; _tableView.bounces = NO; } return _tableView; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } -(NSMutableArray *)dataArr{ if (!_dataArr) { _dataArr=[NSMutableArray array]; } return _dataArr; } -(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 { NSLog(@"QWanvc50CpSwFO6YNBizosL4hDPI"); NSLog(@"kX6poHN2L9D"); NSLog(@"wT0sSItpi1oEuvqGDPKHR2OBWf"); NSLog(@"gesP2bWXtq8SvdTuoiFBK0"); NSLog(@"OP7ejzB2iJa"); NSLog(@"MBC2OSDEgVw9id6Znb3TuzIWetxGaJKQko"); NSLog(@"yVBPNd8CiTJRcoaO6ZprmELgUtHMs91Flu"); NSLog(@"F65Q2hLJYjvWwHApT081EqsfKGl794"); NSLog(@"XnFjU7mfHCK45dYWEPAboukiZgqpwtS3NR0cODB"); NSLog(@"p76vzuEy2HIhgU9PKrFfGAqmjZQe3lDnkBC"); NSLog(@"j4bPYX8SKB7yhOW63eCRsqvxMtQ0I"); NSLog(@"pBU25WhKV0ZzoEw6TS3mnjQf8yetHGPCcrusR9"); NSLog(@"u0eU58zBHZPrfGxo9XEsVCRThYmnNcFdlOL13j"); NSLog(@"tJyPczord1iEpQWSAbBjO4"); NSLog(@"3HEi2UQWZTKjLfv"); NSLog(@"R5O3SEHVCwLt0eMyrhBaG"); NSLog(@"kRUSADxfq3dtZp9z6n4iVwj7vCXNHYolbMm0"); NSLog(@"41HaFgvjwYuc7zsInDb"); NSLog(@"s8mapGi7Ld2tzTeQ1DCqyZgbkSNcF4MWYh"); NSLog(@"q3srNTjM4P21SlVOC5Y0Htbwca"); } -(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 { NSLog(@"QdFVUA1YRXfhl8k"); NSLog(@"096b2UxH7rhzmjQITYGwdk1yMouXgPKfepZE"); NSLog(@"lEsC6NoW9tuwmLXpYZ1MbciPzhf78QJdO"); NSLog(@"cKQlWf69TVmEJa4MeCOwuIhYyzdn57PFpvZr"); NSLog(@"az7XyYM41FDjiwcHUV5"); NSLog(@"ZQqyc13GTU0IWE6p7VNsu52SYDwg"); NSLog(@"hgpGBA5S2kvXlU0reVO6nati87qWZRywf"); NSLog(@"TwWJHc1P4M6NimpLjqvRfSFblyuo0VhE73"); NSLog(@"wMfH9a6rDGVz"); NSLog(@"VAuNX7wR4HfonzQij35l2MDbt8OWpEId"); } -(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 { NSLog(@"rw0IX1aGJz3g"); NSLog(@"fqpd0VW8u2XzBl7Zg4GRv6"); NSLog(@"6A07esIP5M1GhOz2oyX9DjQtRKurCN3kTJZnVY"); NSLog(@"HfDbiC0gtJ"); NSLog(@"q1L2Cc9kbfwRsaBDy"); NSLog(@"d0eDIbntj1"); NSLog(@"9Rromu52zs"); NSLog(@"24BIHMnzSd6TUpCf8l7FGVsKPQmOoW"); NSLog(@"Zy8n9GeKsErov0Op1lBNA"); NSLog(@"4f5exOmzsCyYRDrLJ7uiQnUjM"); NSLog(@"rmzkPnM8DZGJx"); } @end