feat:强制 web 使用 initWithRoomUID 初始化

This commit is contained in:
eggmanQQQ
2024-10-08 11:47:06 +08:00
parent 259d161df8
commit 94c11e5148
44 changed files with 212 additions and 130 deletions

View File

@@ -301,15 +301,16 @@
}
-(void)pushMyRoomVC{
NSString* roomUid = [[AccountInfoStorage instance] getUid];
// [XPRoomViewController openRoom:roomUid viewController:self];
self.headView.userInteractionEnabled = NO;
[self showLoading];
NSString* roomUid = [[AccountInfoStorage instance] getUid];
@kWeakify(self);
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
[self hideHUD];
self.headView.userInteractionEnabled = YES;
if (code == 200) {
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
if (roomInfo.isReselect) {

View File

@@ -49,7 +49,6 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
///
@property (nonatomic,strong) UITableView *tableView;
///
@property (nonatomic,copy) NSArray<HomePlayRoomModel *> *playTeamList;
///
@@ -61,8 +60,6 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
///cell
@property(nonatomic,strong)XPNewHomePartyTableViewCell *pi_playAudioCell;
@end
@implementation XPHomeRecommendViewController
@@ -76,17 +73,12 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
}
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidAppear:animated];
[self.countDownHelper stopCountDown];
@@ -95,9 +87,8 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
[self.pi_playAudioCell setPlaySoundStatus:NO];
self.pi_playAudioCell = nil;
}
}
-(void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
@@ -109,7 +100,6 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
@@ -117,10 +107,10 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(section == 0) return 1;
return self.personalRoomList.count > 0 ? self.personalRoomList.count : 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -128,7 +118,6 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
return self.playTeamList.count > 0 ? kGetScaleWidth(102) : kGetScaleWidth(75);
}
return self.personalRoomList.count > 0 ? kGetScaleWidth(104) : 300;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -139,7 +128,6 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
cell = [[XPNewHomePlayTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomePlayTableViewCell class])];
}
cell.playRoomList = self.playTeamList;
cell.delegate = self;
@@ -149,16 +137,12 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
if (cell == nil) {
cell = [[XPNewHomePlayEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomePlayEmptyTableViewCell class])];
}
cell.isClan = YES;
cell.delegate = self;
return cell;
}
XPNewHomePartyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPNewHomePartyTableViewCell class])];
if (cell == nil) {
cell = [[XPNewHomePartyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomePartyTableViewCell class])];
@@ -172,20 +156,13 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 0.01;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return 0.01;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if(indexPath.section == 3) {
@@ -269,10 +246,6 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
[self showErrorToast:msg];
}
} uid:uid intoUid:uid];
}
///
-(void)updateRoomInformation:(LittleGameInfoModel *)gameModel roomInfo:(RoomInfoModel *)roomInfo{
@@ -314,16 +287,14 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
#pragma mark - XPHomeBannerTableViewCell
- (void)xPHomeBannerTableViewCell:(XPHomeBannerTableViewCell *)view didClickBanner:(HomeBannerInfoModel *)info {
switch (info.skipType) {
case HomeBannerInfoSkipType_Room:
{
case HomeBannerInfoSkipType_Room: {
if (info.skipUri.length > 0) {
[XPRoomViewController openRoom:info.skipUri viewController:self];
}
}
break;
case HomeBannerInfoSkipType_Web:
{
XPWebViewController *vc = [[XPWebViewController alloc]init];
case HomeBannerInfoSkipType_Web: {
XPWebViewController *vc = [[XPWebViewController alloc] initWithRoomUID:@(self.roomInfo.roomId).stringValue];
vc.url = info.skipUri;
[self.navigationController pushViewController:vc animated:YES];
}
@@ -333,13 +304,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
}
}
#pragma mark - XPHomeRecommendProtocol
- (void)getFriendList:(NSArray *)list{
for (int i = 0;i < list.count;i++) {
HomePlayRoomModel *model = list[i];
NSMutableArray *labels = [NSMutableArray array];

View File

@@ -57,10 +57,6 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
@interface XPNewHomeViewController ()<JXPagerViewDelegate,JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate, XPHomeContainerProtocol, XPNewHomeNavViewDelegate,XPNewHomeHeadViewDelegate,XPHomeRecommendOtherRoomViewDelegate,XPHomeRecommendViewControllerDelegate>
///
//@property (nonatomic,strong) UIImageView *backImageView;
///
//@property (nonatomic,strong) XPNewHomeNavView *navView;
///
@property(nonatomic,strong) XPNewHomeHeadView *headView;
///
@@ -240,7 +236,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
#pragma mark - XPNewHomeNavViewDelegate
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickRank:(UIButton *)sender {
XPWebViewController * webVC =[[XPWebViewController alloc] init];
XPWebViewController * webVC =[[XPWebViewController alloc] initWithRoomUID:nil];
webVC.url = URLWithType(kHomeRankURL);
[self.navigationController pushViewController:webVC animated:YES];
}
@@ -430,7 +426,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
///
-(void)selectItemWithModel:(PIHomeItemModel *)model{
if (model.resourceType == HomeMenuResourceType_H5) {
XPWebViewController * webVC = [[ XPWebViewController alloc] init];
XPWebViewController * webVC = [[ XPWebViewController alloc] initWithRoomUID:nil];
webVC.url = model.resourceContent;
[self.navigationController pushViewController:webVC animated:YES];
}else if (model.resourceType == HomeMenuResourceType_Match) { //
@@ -469,7 +465,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
break;
case HomeBannerInfoSkipType_Web:
{
XPWebViewController *vc = [[XPWebViewController alloc]init];
XPWebViewController *vc = [[XPWebViewController alloc] initWithRoomUID:nil];
vc.url = model.skipUri;
[self.navigationController pushViewController:vc animated:YES];
}