粉丝团开通特权弹窗

This commit is contained in:
chenguilong
2022-04-07 15:02:22 +08:00
parent 3df8f50081
commit a1cbfcc2af
38 changed files with 964 additions and 21 deletions

View File

@@ -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];