粉丝团开通特权弹窗
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#import "GiftValueInfoModel.h"
|
||||
#import "AcrossRoomPKPanelModel.h"
|
||||
#import "LittleGameInfoModel.h"
|
||||
#import "XPAnchorFansRelationModel.h"
|
||||
///View
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "XPAnchorAudienceUpMicView.h"
|
||||
@@ -49,6 +50,11 @@
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XPLittleGameMiniStageView.h"
|
||||
#import "XPLittleGameRoomListView.h"
|
||||
#import "XPAnchorFansTeamEntranceView.h"
|
||||
#import "XPAnchorFansTeamViewController.h"
|
||||
#import "XPAnchorFansTaskViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
|
||||
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate, XPRoomLittleGameListViewDelegate>
|
||||
///host 代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
|
||||
@@ -60,6 +66,8 @@
|
||||
@property (nonatomic, strong) dispatch_source_t followAnchorTimer;
|
||||
///个播房房主魅力值
|
||||
@property (nonatomic, strong) AnchorGiftValueView *anchorGiftValueView;
|
||||
///个播粉丝团入口
|
||||
@property (nonatomic, strong) XPAnchorFansTeamEntranceView *fansTeamEntranceView;
|
||||
///话题的容器
|
||||
@property (nonatomic,strong) UIStackView *topicStackView;
|
||||
///话题
|
||||
@@ -113,6 +121,7 @@
|
||||
[self addSubview:self.contributionButton];
|
||||
[self addSubview:self.anchorGiftValueView];
|
||||
[self addSubview:self.topicStackView];
|
||||
[self addSubview:self.fansTeamEntranceView];
|
||||
[self.topicStackView addArrangedSubview:self.topicLabel];
|
||||
[self.topicStackView addArrangedSubview:self.editButton];
|
||||
}
|
||||
@@ -129,7 +138,12 @@
|
||||
make.centerY.mas_equalTo(self.contributionButton);
|
||||
make.height.mas_equalTo(26);
|
||||
}];
|
||||
|
||||
[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);
|
||||
}];
|
||||
[self.topicStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.height.mas_equalTo(15);
|
||||
@@ -256,6 +270,13 @@
|
||||
[self.contributionButton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(statusbarHeight+49);
|
||||
}];
|
||||
if (roomInfo.hadChangeRoomType) {
|
||||
///进房初始化当前用户与房间粉丝团关系
|
||||
[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]];
|
||||
}
|
||||
} else {
|
||||
[self.contributionButton setTitle:@"房间榜" forState:UIControlStateNormal];
|
||||
self.anchorGiftValueView.hidden = YES;
|
||||
@@ -280,7 +301,12 @@
|
||||
[self setFollowAnchorTimer];
|
||||
}
|
||||
} uid:uid isLikeUid:roomUid];
|
||||
}
|
||||
}
|
||||
///进房初始化当前用户与房间粉丝团关系
|
||||
[Api requestInRoomFansTeam:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
XPAnchorFansRelationModel *model = [XPAnchorFansRelationModel modelWithJSON:data.data];
|
||||
[self updateFansTeamEntranceView:model];
|
||||
} teamUid:roomUid];
|
||||
}
|
||||
|
||||
if (roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode) {
|
||||
@@ -600,6 +626,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tapFansTeamRecognizer {
|
||||
if (self.fansTeamEntranceView.hidden) {
|
||||
return;
|
||||
}
|
||||
NSString *roomUid = [NSString stringWithFormat:@"%zd", self.delegate.getRoomInfo.uid];
|
||||
RoomInfoModel *roomInfo = self.delegate.getRoomInfo;
|
||||
|
||||
if ([[[AccountInfoStorage instance] getUid] isEqualToString:roomUid]) {///是房主
|
||||
if (roomInfo.hadOpenAnchorFans) {
|
||||
|
||||
} else {
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kAnchorFansOpenURL);
|
||||
[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];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 房间话题
|
||||
- (void)updateRoomTopicViewConstraint {
|
||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
@@ -742,6 +793,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
#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 {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPRoomLittleGameListViewDelegate
|
||||
- (void)xPRoomLittleGameListView:(XPLittleGameRoomListView *)view didSelectItem:(LittleGameInfoModel *)itemInfo {
|
||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
@@ -834,6 +901,16 @@
|
||||
return _anchorGiftValueView;
|
||||
}
|
||||
|
||||
- (XPAnchorFansTeamEntranceView *)fansTeamEntranceView {
|
||||
if (!_fansTeamEntranceView) {
|
||||
_fansTeamEntranceView = [[XPAnchorFansTeamEntranceView alloc]init];
|
||||
// _fansTeamEntranceView.hidden = YES;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapFansTeamRecognizer)];
|
||||
[_fansTeamEntranceView addGestureRecognizer:tap];
|
||||
}
|
||||
return _fansTeamEntranceView;
|
||||
}
|
||||
|
||||
- (UIStackView *)topicStackView {
|
||||
if (!_topicStackView) {
|
||||
_topicStackView = [[UIStackView alloc] init];
|
||||
|
Reference in New Issue
Block a user