粉丝团任务弹窗
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
#import "AcrossRoomPKPanelModel.h"
|
||||
#import "LittleGameInfoModel.h"
|
||||
#import "XPAnchorFansRelationModel.h"
|
||||
#import "XPAnchorFansJoinModel.h"
|
||||
#import "XPAnchorFansTaskModel.h"
|
||||
///View
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "XPAnchorAudienceUpMicView.h"
|
||||
@@ -80,6 +82,8 @@
|
||||
@property (nonatomic,strong) XPLittleGameMiniStageView *littleGameMiniView;
|
||||
///显示游戏的切换
|
||||
@property (nonatomic,strong) XPLittleGameRoomListView *gameListView;
|
||||
|
||||
@property (nonatomic, strong) XPAnchorFansRelationModel *relationFansModel;
|
||||
@end
|
||||
|
||||
@implementation XPRoomFunctionContainerView
|
||||
@@ -140,9 +144,8 @@
|
||||
}];
|
||||
[self.fansTeamEntranceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.contributionButton.mas_bottom).mas_offset(5);
|
||||
make.left.mas_equalTo(-12);
|
||||
make.height.mas_equalTo(26);
|
||||
make.width.mas_equalTo(90);
|
||||
make.left.mas_equalTo(0);
|
||||
make.height.mas_equalTo(37);
|
||||
}];
|
||||
[self.topicStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
@@ -633,22 +636,49 @@
|
||||
NSString *roomUid = [NSString stringWithFormat:@"%zd", self.delegate.getRoomInfo.uid];
|
||||
RoomInfoModel *roomInfo = self.delegate.getRoomInfo;
|
||||
|
||||
if ([[[AccountInfoStorage instance] getUid] isEqualToString:roomUid]) {///是房主
|
||||
if (roomInfo.hadOpenAnchorFans) {
|
||||
|
||||
// if (!self.relationFansModel) {
|
||||
// [Api requestInRoomFansTeam:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
// XPAnchorFansRelationModel *model = [XPAnchorFansRelationModel modelWithJSON:data.data];
|
||||
// [self updateFansTeamEntranceView:model];
|
||||
// } teamUid:[NSString stringWithFormat:@"%ld", roomInfo.uid]];
|
||||
// return;
|
||||
// }
|
||||
if (self.relationFansModel.isCurrentRoomAnchor) {///是房主
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
if (self.relationFansModel.hasFansTeamCurrentRoom) {
|
||||
webVC.url = URLWithType(kAnchorFansListURL);
|
||||
} else {
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kAnchorFansOpenURL);
|
||||
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
|
||||
}
|
||||
webVC.roomUid = roomUid;
|
||||
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
|
||||
} else {
|
||||
// XPAnchorFansTeamViewController *fansTeamVc = [[XPAnchorFansTeamViewController alloc] initWithRoomUid:roomUid];
|
||||
// [self.delegate.getCurrentNav presentViewController:fansTeamVc animated:YES completion:nil];
|
||||
|
||||
XPAnchorFansTaskViewController *fansTaskVc = [[XPAnchorFansTaskViewController alloc] initWithRoomUid:roomUid];
|
||||
[self.delegate.getCurrentNav presentViewController:fansTaskVc animated:YES completion:nil];
|
||||
if (self.relationFansModel.hasFansTeamCurrentRoom) {//开通了粉丝团
|
||||
if (self.relationFansModel.isAnchorFans) {
|
||||
[Api requestFansTeamTask:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code != 200) {
|
||||
[XCHUDTool showErrorWithMessage:msg];
|
||||
return;
|
||||
}
|
||||
XPAnchorFansTaskModel *model = [XPAnchorFansTaskModel modelWithJSON:data.data];
|
||||
XPAnchorFansTaskViewController *fansTaskVc = [[XPAnchorFansTaskViewController alloc] initWithRoomUid:roomUid];
|
||||
fansTaskVc.model = model;
|
||||
[self.delegate.getCurrentNav presentViewController:fansTaskVc animated:YES completion:nil];
|
||||
} teamUid:roomUid];
|
||||
} else {
|
||||
[Api requestJoinFansTeam:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code != 200) {
|
||||
[XCHUDTool showErrorWithMessage:msg];
|
||||
return;
|
||||
}
|
||||
XPAnchorFansJoinModel *model = [XPAnchorFansJoinModel modelWithJSON:data.data];
|
||||
XPAnchorFansTeamViewController *fansTeamVc = [[XPAnchorFansTeamViewController alloc] initWithRoomUid:roomUid];
|
||||
fansTeamVc.model = model;
|
||||
[self.delegate.getCurrentNav presentViewController:fansTeamVc animated:YES completion:nil];
|
||||
} teamUid:roomUid];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 房间话题
|
||||
@@ -795,18 +825,27 @@
|
||||
|
||||
#pragma mark - 个播粉丝团
|
||||
- (void)updateFansTeamEntranceView:(XPAnchorFansRelationModel *)model {
|
||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
if ([[[AccountInfoStorage instance] getUid] integerValue] == roomInfo.uid) {
|
||||
roomInfo.hadOpenAnchorFans = model.hasFansTeamCurrentRoom;
|
||||
roomInfo.anchorFansRedDot = model.isRedPop;
|
||||
if (model.hasFansTeamCurrentRoom) {//已开通粉丝团
|
||||
self.fansTeamEntranceView.hidden = NO;
|
||||
} else {
|
||||
// self.fansTeamEntranceView.hidden = YES;
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
// RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
// roomInfo.anchorFansRedDot = model.isRedPop;
|
||||
// if ([[[AccountInfoStorage instance] getUid] integerValue] == roomInfo.uid) {///是房主
|
||||
// if (model.hasFansTeamCurrentRoom) {//已开通粉丝团
|
||||
// self.fansTeamEntranceView.title = [NSString stringWithFormat:@"粉丝团(%ld)", model.anchorFansNum];
|
||||
// } else {
|
||||
// self.fansTeamEntranceView.title = @"开通粉丝团";
|
||||
// }
|
||||
// } else {
|
||||
// if (model.hasFansTeamCurrentRoom) {//已开通粉丝团
|
||||
// if (model.isAnchorFans) {
|
||||
// self.fansTeamEntranceView.title = [NSString stringWithFormat:@"粉丝团(%ld)", model.anchorFansNum];
|
||||
// } else {
|
||||
// self.fansTeamEntranceView.title = @"加入我的粉丝团吧~";
|
||||
// }
|
||||
// } else {
|
||||
// self.fansTeamEntranceView.title = @"该主播暂未开通粉丝团";
|
||||
// }
|
||||
// }
|
||||
self.fansTeamEntranceView.model = model;
|
||||
self.relationFansModel = model;
|
||||
}
|
||||
|
||||
#pragma mark - XPRoomLittleGameListViewDelegate
|
||||
@@ -904,7 +943,6 @@
|
||||
- (XPAnchorFansTeamEntranceView *)fansTeamEntranceView {
|
||||
if (!_fansTeamEntranceView) {
|
||||
_fansTeamEntranceView = [[XPAnchorFansTeamEntranceView alloc]init];
|
||||
// _fansTeamEntranceView.hidden = YES;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapFansTeamRecognizer)];
|
||||
[_fansTeamEntranceView addGestureRecognizer:tap];
|
||||
}
|
||||
|
Reference in New Issue
Block a user