// // YOUPAILZLiveConsumeMemberListVC.m // TIANYAN // // Created by CY on 2021/5/13. // Copyright © 2021 leo. All rights reserved. // #import "YOUPAILZLiveAnchorHotListVC.h" #import "UIScrollView+LZRefresh.h" #import "YOUPAILZLiveAnchorHotCell.h" #import "YOUPAILZLiveMemberModel.h" #import "YOUPAILZLiveAnchorHotMemberView.h" #import "YOUPAILZLiveCurrent_anchorModel.h" @interface YOUPAILZLiveAnchorHotListVC () @property (nonatomic, weak) UITableView *youpaiptableView; @property (nonatomic, assign) NSInteger youpaippage; @property (nonatomic, strong) NSMutableArray *youpaipdataSource; @property (nonatomic, weak) YOUPAILZLiveAnchorHotMemberView *youpaipfooterView; @end @implementation YOUPAILZLiveAnchorHotListVC - (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]; YOUPAILZLiveCurrent_anchorModel *youpaipmemberModel = [YOUPAILZLiveCurrent_anchorModel mj_objectWithKeyValues:[data objectForKey:@"current_anchor"]]; [weakSelf.youpaipfooterView youpaifreloadWithModel:youpaipmemberModel]; weakSelf.youpaipfooterView.youpaiprankL.textColor = [UIColor whiteColor]; weakSelf.youpaipfooterView.youpaipnicknameL.textColor = [UIColor whiteColor]; // NSMutableAttributedString *attrStr = weakSelf.youpaipfooterView.youpaipcontributionL.attributedText.mutableCopy; // [attrStr addAttribute:NSForegroundColorAttributeName value:HexColorFromRGB(0x75170A) range:NSMakeRange(0, weakSelf.youpaipfooterView.youpaipcontributionL.attributedText.string.length)]; // weakSelf.youpaipfooterView.youpaipcontributionL.attributedText = attrStr.copy; weakSelf.youpaipfooterView.youpaiplastDifferenceL.textColor = [UIColor whiteColor]; [weakSelf.youpaiptableView lz_hideEmptyView]; if (weakSelf.youpaipdataSource.count == 0) { [weakSelf.youpaiptableView lz_showEmptyViewWithImage:nil content:@"暂未有女神上榜哦~"]; } NSInteger youpaiptotalPage = [[data objectForKey:@"total_page"] integerValue]; [weakSelf youpaifrefreshFooterWithHidden:self.youpaippage >= youpaiptotalPage]; } } 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