修正线上首页显示内容不对问题

阿语环境下,有概率会 hot 列表显示为最后一个 tab 的内容
This commit is contained in:
edwinQQQ
2025-03-14 19:44:58 +08:00
parent e7b2f594e8
commit d6e13ac0fe
5 changed files with 171 additions and 142 deletions

View File

@@ -49,7 +49,7 @@
#import "ClientConfig.h"
#import "SessionViewController.h"
#import "Api+Main.h"
#import "XPLoginViewController.h"
#import "LoginViewController.h"
#import "BaseNavigationController.h"
#import "XPAdImageTool.h"
#import "PIHomeCategoryTitleModel.h"
@@ -210,6 +210,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
self.arrowButton.hidden = YES;
}
[self.tabCollectionView reloadData];
@kWeakify(self);
dispatch_async(dispatch_get_main_queue(), ^{
@kStrongify(self);
@@ -223,9 +224,10 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
animated:NO
scrollPosition:UICollectionViewScrollPositionNone];
} else {
[self.tabCollectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
animated:NO
scrollPosition:UICollectionViewScrollPositionNone];
// index
// [self.tabCollectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
// animated:NO
// scrollPosition:UICollectionViewScrollPositionNone];
if (isMSRTL()) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
@@ -389,7 +391,7 @@ XPHomeRecommendOtherRoomViewDelegate>
if ([NIMSDK sharedSDK].loginManager.isLogined) {
[[NIMSDK sharedSDK].loginManager logout:nil];
}
XPLoginViewController *lvc = [[XPLoginViewController alloc] init];
LoginViewController *lvc = [[LoginViewController alloc] init];
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:lvc];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
kWindow.rootViewController = nav;
@@ -462,15 +464,17 @@ XPHomeRecommendOtherRoomViewDelegate>
}
-(void)logOut{
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(requestCheckIp) object:nil];
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(requestCheckIp)
object:nil];
}
-(void)headerRefresh{
[self.presenter getHomeTopData];
[self.presenter getHomeTagList];
[self.presenter getHomeRanks];
PIHomeCategoryTitleModel *tagModel = [self.tagModelList xpSafeObjectAtIndex:self.type];
XPHomePartyViewController *homeVC = [self.validListDict objectForKey:[NSNumber numberWithInteger:self.type]];
homeVC.tagModel = tagModel;
@@ -513,7 +517,7 @@ XPHomeRecommendOtherRoomViewDelegate>
}
- (void)initSubViewConstraints {
[self.pagingView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view).mas_offset(kGetScaleWidth(10));
make.top.equalTo(self.view).mas_offset(10);
make.leading.bottom.trailing.mas_equalTo(0);
}];
}
@@ -610,6 +614,7 @@ XPHomeRecommendOtherRoomViewDelegate>
if (homeV) {
return homeV;
}
XPHomePartyViewController *homeVC = [[XPHomePartyViewController alloc] init];
homeVC.bannerInfoList = self.bannerInfoList;
homeVC.tagModel = [self.tagModelList xpSafeObjectAtIndex:index];
@@ -707,7 +712,7 @@ XPHomeRecommendOtherRoomViewDelegate>
self.titleView.titles = titleArray;
[self.titleView reloadData];
[self createTagScrollView];
[self.categoryTagList setTabArray:list];
}
@@ -777,7 +782,9 @@ XPHomeRecommendOtherRoomViewDelegate>
}else {
NSString * uid = [AccountInfoStorage instance].getUid;
if (model.ID.length > 0 && uid.length > 0) {
@kWeakify(self);
[Api homePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if (code == 200) {
HomeMenuSourceModel * sourceModel = [HomeMenuSourceModel modelWithDictionary:data.data];
if (sourceModel.isPick) {
@@ -866,7 +873,6 @@ XPHomeRecommendOtherRoomViewDelegate>
if (!_pagingView) {
_pagingView = [[JXPagerView alloc] initWithDelegate:self listContainerType:0];
_pagingView.mainTableView.gestureDelegate = self;
// _pagingView.currentScrollingListView.delegate = self;
_pagingView.backgroundColor = [UIColor clearColor];
_pagingView.listContainerView.backgroundColor = [UIColor clearColor];
_pagingView.listContainerView.listCellBackgroundColor = [UIColor clearColor];