| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- //
- // MORoomContriListView.m
- // MiMoLive
- //
- // Created by SuperC on 2025/7/3.
- //
- #import "MORoomContriListView.h"
- #import "MORoomContriView.h"
- @interface MORoomContriListView ()
- @property (weak, nonatomic) IBOutlet UIView *bgView;
- @property (weak, nonatomic) IBOutlet UIButton *contributionBtn;
- @property (nonatomic, strong) MORoomContriView *contributionView;
- @end
- @implementation MORoomContriListView
- + (instancetype)moRoomContriListView{
- return [[[NSBundle mainBundle] loadNibNamed:@"MORoomContriListView" owner:self options:nil] firstObject];
- }
- - (void)awakeFromNib{
- [super awakeFromNib];
-
- self.bgView.layer.cornerRadius = 16.0;
- self.bgView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
- self.bgView.layer.masksToBounds = YES;
-
- UIView *lineTwoView = [[UIView alloc] init];
- lineTwoView.backgroundColor = [MOTools colorWithHexString:@"#DADCE6" alpha:0.6];
- [self.bgView addSubview:lineTwoView];
- [lineTwoView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.bgView).offset(50.0);
- make.left.right.equalTo(self.bgView);
- make.height.equalTo(@0.5);
- }];
-
- [self.bgView addSubview:self.contributionView];
- [self.contributionView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.bottom.equalTo(self.bgView);
- make.top.equalTo(lineTwoView.mas_bottom);
- }];
-
- [self.contributionBtn setFont:[MOTextTools poppinsMediumFont:16.0]];
- [self.contributionBtn setTitleColor:kBaseTextColor_1 forState:UIControlStateNormal];
- [self.contributionBtn setTitle:NSLocalString(@"mimo_2_live_contri") forState:UIControlStateNormal];
-
- [self setTableViewBlock];
- }
- - (void)setTableViewBlock{
- WEAKSELF
- self.contributionView.headBtnClickBlock = ^(MOUserBase * _Nonnull userBase) {
-
- weakSelf.contriHeadClickBlock ? weakSelf.contriHeadClickBlock(userBase) : nil;
-
- [weakSelf dismissListView];
- };
- }
- - (void)getAllHttpData{
- self.contributionView.roomId = self.roomId;
- }
- - (IBAction)dismissBtnClick:(id)sender {
- //隐藏
- [self dismissListView];
- }
- - (void)showListView{
- self.frame = CGRectMake(0, 0, SCREENWIDTH, SCREENHEIGHT);
-
- CGRect actionViewRect = self.bgView.frame;
- actionViewRect.origin.y = SCREENHEIGHT;
- self.bgView.frame = actionViewRect;
-
- WEAKSELF
- [UIView animateWithDuration:0.3 animations:^{
- CGRect actionViewRect = weakSelf.bgView.frame;
- actionViewRect.origin.y = SCREENHEIGHT - 560;
- weakSelf.bgView.frame = actionViewRect;
- }];
-
- //不能滑动
- SendNotification(@"MOShowLivePagesVCCannotScroll")
- }
- - (void)dismissListView{
- //完成下移动画
- WEAKSELF
- [UIView animateWithDuration:0.3 animations:^
- {
- CGRect actionSheetViewRect = weakSelf.bgView.frame;
- actionSheetViewRect.origin.y = SCREENHEIGHT;
- weakSelf.bgView.frame = actionSheetViewRect;
- } completion:^(BOOL finished)
- {
- [self removeFromSuperview];
- }];
-
- //可以滑动
- SendNotification(@"MOShowLivePagesVCCanScroll")
- }
- - (MORoomContriView *)contributionView{
- if(!_contributionView){
- _contributionView = [[MORoomContriView alloc] init];
-
- }
- return _contributionView;
- }
- @end
|