房间榜单完成

This commit is contained in:
fengshuo
2021-12-15 18:12:55 +08:00
parent 77700bc31f
commit f1ec673b26
51 changed files with 1063 additions and 80 deletions

View File

@@ -0,0 +1,74 @@
//
// XPRoomFunctionContainerView.m
// xplan-ios
//
// Created by on 2021/12/15.
//
#import "XPRoomFunctionContainerView.h"
///Tool
#import "XPMacro.h"
///Third
#import <Masonry/Masonry.h>
///Model
#import "RoomInfoModel.h"
///View
#import "XPRoomRankViewController.h"
@interface XPRoomFunctionContainerView ()
///host
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
///
@property (nonatomic,strong) UIButton *contributionButton;
@end
@implementation XPRoomFunctionContainerView
- (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate {
self = [super init];
if (self) {
self.delegate = delegate;
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.contributionButton];
}
- (void)initSubViewConstraints {
[self.contributionButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(-12);
make.top.mas_equalTo(statusbarHeight+57);
make.width.mas_equalTo(90);
make.height.mas_equalTo(26);
}];
}
#pragma mark - Event Response
- (void)contributionButtonAction:(UIButton *)sender {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
XPRoomRankViewController * rankVC = [[XPRoomRankViewController alloc] initWithRoomUid:roomUid delegate:self.delegate];
[self.delegate.getCurrentNav presentViewController:rankVC animated:YES completion:nil];
}
#pragma mark - Getters And Setters
- (UIButton *)contributionButton {
if (!_contributionButton) {
_contributionButton = [[UIButton alloc]init];
[_contributionButton addTarget:self action:@selector(contributionButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_contributionButton.backgroundColor = [UIColor colorWithWhite:0 alpha:0.2];
[_contributionButton setTitle:@"房间榜" forState:UIControlStateNormal];
[_contributionButton setImage:[UIImage imageNamed:@"room_rank_enter_icon"] forState:UIControlStateNormal];
[_contributionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_contributionButton.titleLabel.font = [UIFont systemFontOfSize:12];
_contributionButton.layer.cornerRadius = 13;
_contributionButton.layer.masksToBounds = YES;
_contributionButton.imageEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
_contributionButton.titleEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
}
return _contributionButton;
}
@end