个播小时榜飘屏优化,小时榜入口

This commit is contained in:
chenguilong
2022-04-18 20:53:40 +08:00
parent 49cbfc3a43
commit 83cffad070
11 changed files with 124 additions and 1 deletions

View File

@@ -78,6 +78,8 @@
@property (nonatomic, strong) AnchorGiftValueView *anchorGiftValueView;
///
@property (nonatomic, strong) XPAnchorFansTeamEntranceView *fansTeamEntranceView;
///
@property (nonatomic, strong) UIButton *anchorHourRankButton;
///
@property (nonatomic,strong) UIStackView *topicStackView;
///
@@ -134,6 +136,7 @@
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.contributionButton];
[self addSubview:self.anchorHourRankButton];
[self addSubview:self.anchorGiftValueView];
[self addSubview:self.topicStackView];
[self addSubview:self.fansTeamEntranceView];
@@ -148,6 +151,12 @@
make.width.mas_equalTo(90);
make.height.mas_equalTo(26);
}];
[self.anchorHourRankButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(11);
make.centerY.mas_equalTo(self.contributionButton);
make.width.mas_equalTo(67);
make.height.mas_equalTo(22);
}];
[self.anchorGiftValueView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.contributionButton.mas_right).mas_offset(8);
make.centerY.mas_equalTo(self.contributionButton);
@@ -279,6 +288,7 @@
[self.contributionButton setTitle:@"主播榜" forState:UIControlStateNormal];
self.anchorGiftValueView.hidden = !roomInfo.showGiftValue;
self.fansTeamEntranceView.hidden = NO;
self.anchorHourRankButton.hidden = NO;
if (!roomInfo.showGiftValue) {
self.anchorGiftValueView.giftValue = 0;
}
@@ -296,6 +306,7 @@
[self.contributionButton setTitle:@"房间榜" forState:UIControlStateNormal];
self.anchorGiftValueView.hidden = YES;
self.fansTeamEntranceView.hidden = YES;
self.anchorHourRankButton.hidden = YES;
[self.contributionButton mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kNavigationHeight);
}];
@@ -780,6 +791,13 @@
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
}
- (void)onAnchorHourRankButtonAction:(UIButton *)sender {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
webView.url = [NSString stringWithFormat:@"%@?roomUid=%@", URLWithType(kRoomHourRankURL), roomUid];
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
}
- (void)datingProgresButtonAction:(UIButton *)sender {
[TTPopup dismiss];
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
@@ -1125,6 +1143,24 @@
return _contributionButton;
}
- (UIButton *)anchorHourRankButton {
if (!_anchorHourRankButton) {
_anchorHourRankButton = [[UIButton alloc]init];
[_anchorHourRankButton addTarget:self action:@selector(onAnchorHourRankButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_anchorHourRankButton setTitle:@"小时榜" forState:UIControlStateNormal];
[_anchorHourRankButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x322BFF), UIColorFromRGB(0x49ACFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(67, 22)] forState:UIControlStateNormal];
[_anchorHourRankButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_anchorHourRankButton.titleLabel.font = [UIFont systemFontOfSize:10];
_anchorHourRankButton.layer.cornerRadius = 11;
_anchorHourRankButton.layer.masksToBounds = YES;
[_anchorHourRankButton setImage:[UIImage imageNamed:@"anchor_hourRank_btn"] forState:UIControlStateNormal];
_anchorHourRankButton.imageEdgeInsets = UIEdgeInsetsMake(0, -8, 0, 0);
_anchorHourRankButton.titleEdgeInsets = UIEdgeInsetsMake(0, -2, 0, 0);
_anchorHourRankButton.hidden = YES;
}
return _anchorHourRankButton;
}
- (UIButton *)datingProgresButton {
if (!_datingProgresButton) {
_datingProgresButton = [UIButton buttonWithType:UIButtonTypeCustom];