二卡八不显示离线,背包礼物一键全送增加提示
This commit is contained in:
@@ -38,6 +38,10 @@
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
QXLOG(@"========首页子控制器即将展示========");
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.page = 1;
|
||||
[self.view addSubview:self.collectionView];
|
||||
@@ -48,24 +52,28 @@
|
||||
[super viewDidAppear:animated];
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
-(void)setRoomType:(QXMyRoomType *)roomType{
|
||||
_roomType = roomType;
|
||||
[self getRoomList];
|
||||
}
|
||||
- (void)getRoomList {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
// __weak typeof(self)weakSelf = self;
|
||||
@weakify(self)
|
||||
[QXHomePageNetwork homeRoomListWithPage:self.page is_top:NO label_id:self.roomType.id successBlock:^(NSArray<QXRoomListModel *> * _Nonnull list, BOOL isAppStore) {
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
@strongify(self)
|
||||
if (self.page == 1) {
|
||||
[self.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadData];
|
||||
[self.dataArray addObjectsFromArray:list];
|
||||
[self.collectionView reloadData];
|
||||
if (list.count == 0) {
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
self.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
[self.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
@strongify(self)
|
||||
[self.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
@@ -113,10 +121,12 @@
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXHomeRoomCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXHomeRoomCell"];
|
||||
MJWeakSelf
|
||||
// MJWeakSelf
|
||||
@weakify(self)
|
||||
_collectionView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getRoomList];
|
||||
@strongify(self)
|
||||
self.page++;
|
||||
[self getRoomList];
|
||||
}];
|
||||
}
|
||||
return _collectionView;
|
||||
|
||||
Reference in New Issue
Block a user