// // YOUPAILZLiveOnlineMemberListVC.m // VQU // // Created by CY on 2021/7/22. // Copyright © 2021 leo. All rights reserved. // #import "YOUPAILZLiveOnlineMemberListVC.h" #import "UIScrollView+LZRefresh.h" #import "YOUPAILZLiveOnlineMemberCell.h" #import "YOUPAILZLiveMemberModel.h" @interface YOUPAILZLiveOnlineMemberListVC () @property (nonatomic, weak) UITableView *youpaiptableView; @property (nonatomic, strong) NSString *youpaipendtime; @property (nonatomic, strong) NSMutableArray *youpaipdataSource; @end @implementation YOUPAILZLiveOnlineMemberListVC - (void)viewDidLoad { [super viewDidLoad]; [self youpaifinitUI]; /// 关注状态改变,接收通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youpaifchangeFollowStateNotification:) name:@"ChangeFollowState" object:nil]; [self youpaifrequestMemberListWithStatus:kRefreshNormal]; } - (void)youpaifchangeFollowStateNotification:(NSNotification *)notification{ NSDictionary *dict = [notification userInfo]; NSString *idStr = dict[@"follow_uid"]; NSInteger isfollow = [dict[@"is_follow"] intValue]; NSArray *arr = self.youpaipdataSource; NSMutableArray *arrM = [NSMutableArray new]; if (arr.count>0) { for (int i = 0; i*list = [YOUPAILZLiveMemberModel mj_objectArrayWithKeyValuesArray:[data objectForKey:@"list"]]; [weakSelf.youpaipdataSource addObjectsFromArray:list]; [weakSelf.youpaiptableView reloadData]; [weakSelf.youpaiptableView lz_hideEmptyView]; if (weakSelf.youpaipdataSource.count == 0) { [weakSelf.youpaiptableView lz_showEmptyViewWithImage:nil content:@"当前还没有观众呢~"]; } if ([weakSelf.youpaipendtime isEqual:endTime]) { [weakSelf youpaifrefreshFooterWithHidden:YES]; }else{ weakSelf.youpaipendtime = endTime; [weakSelf youpaifrefreshFooterWithHidden:NO]; } } } failure:^(NSError *error) { [weakSelf.youpaiptableView endRefreshing:kRefreshAll]; }]; } - (NSMutableArray *)youpaipdataSource{ if (!_youpaipdataSource) { _youpaipdataSource = [NSMutableArray array]; } return _youpaipdataSource; } #pragma mark - JXCategoryListContentViewDelegate - (UIView *)listView{ return self.view; } @end