147 lines
4.2 KiB
Objective-C
147 lines
4.2 KiB
Objective-C
//
|
|
// XPRoomViewController.m
|
|
// xplan-ios
|
|
//
|
|
// Created by 冯硕 on 2021/10/11.
|
|
//
|
|
|
|
#import "XPRoomViewController.h"
|
|
///Third
|
|
#import <Masonry/Masonry.h>
|
|
///Tool
|
|
#import "XPMacro.h"
|
|
///Model
|
|
#import "RoomInfoModel.h"
|
|
///View
|
|
#import "XPRoomActivityContainerView.h"
|
|
#import "XPRoomBackContainerView.h"
|
|
#import "XPRoomMenuContainerView.h"
|
|
#import "XPRoomMessageContainerView.h"
|
|
#import "XPRoomPositionContainView.h"
|
|
#import "XPRoomInfoContainerView.h"
|
|
|
|
@interface XPRoomViewController ()
|
|
///背景
|
|
@property (nonatomic,strong) XPRoomBackContainerView *backContainerView;
|
|
///房间信息
|
|
@property (nonatomic,strong) XPRoomInfoContainerView *roomInfoContainerView;
|
|
///坑位信息
|
|
@property (nonatomic,strong) XPRoomPositionContainView *positionContainerView;
|
|
///公屏
|
|
@property (nonatomic,strong) XPRoomMessageContainerView *messageContainerView;
|
|
///底部操作栏
|
|
@property (nonatomic,strong) XPRoomMenuContainerView *menuContainerView;
|
|
///活动
|
|
@property (nonatomic,strong) XPRoomActivityContainerView *activityContainerView;
|
|
@end
|
|
|
|
@implementation XPRoomViewController
|
|
|
|
- (BOOL)isHiddenNavBar {
|
|
return YES;
|
|
}
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
[self initSubViews];
|
|
[self initSubViewConstraints];
|
|
}
|
|
|
|
#pragma mark - Private Method
|
|
- (void)initSubViews {
|
|
[self.view addSubview:self.backContainerView];
|
|
[self.view addSubview:self.roomInfoContainerView];
|
|
[self.view addSubview:self.positionContainerView];
|
|
[self.view addSubview:self.messageContainerView];
|
|
[self.view addSubview:self.menuContainerView];
|
|
[self.view addSubview:self.activityContainerView];
|
|
}
|
|
|
|
- (void)initSubViewConstraints {
|
|
[self.backContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.edges.mas_equalTo(self.view);
|
|
}];
|
|
|
|
[self.roomInfoContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.right.top.mas_equalTo(self.view);
|
|
make.height.mas_equalTo(kNavigationHeight);
|
|
}];
|
|
|
|
[self.positionContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.right.mas_equalTo(self.view);
|
|
make.top.mas_equalTo(self.roomInfoContainerView.mas_bottom);
|
|
make.height.mas_equalTo([self.positionContainerView positionContainerViewHeight]);
|
|
}];
|
|
|
|
[self.messageContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.top.equalTo(self.positionContainerView.mas_bottom);
|
|
make.bottom.equalTo(self.menuContainerView.mas_top).offset(-5);
|
|
make.left.equalTo(self.view);
|
|
make.right.equalTo(self.activityContainerView.mas_left).offset(-10);
|
|
}];
|
|
|
|
[self.menuContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.right.mas_equalTo(self.view);
|
|
make.bottom.mas_equalTo(-kSafeAreaBottomHeight- 8);
|
|
make.height.mas_equalTo(40);
|
|
}];
|
|
|
|
[self.activityContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.top.mas_equalTo(self.messageContainerView);
|
|
make.right.mas_equalTo(self.view);
|
|
make.bottom.mas_equalTo(self.menuContainerView.mas_top).offset(-5);
|
|
make.width.mas_equalTo(80);
|
|
}];
|
|
}
|
|
|
|
|
|
#pragma mark - Getters And Setters
|
|
- (void)setRoomInfo:(RoomInfoModel *)roomInfo {
|
|
_roomInfo = roomInfo;
|
|
self.roomInfoContainerView.roomInfo = _roomInfo;
|
|
}
|
|
|
|
- (XPRoomBackContainerView *)backContainerView {
|
|
if (!_backContainerView) {
|
|
_backContainerView = [[XPRoomBackContainerView alloc] init];
|
|
}
|
|
return _backContainerView;
|
|
}
|
|
|
|
- (XPRoomInfoContainerView *)roomInfoContainerView {
|
|
if (!_roomInfoContainerView) {
|
|
_roomInfoContainerView = [[XPRoomInfoContainerView alloc] init];
|
|
}
|
|
return _roomInfoContainerView;
|
|
}
|
|
|
|
- (XPRoomPositionContainView *)positionContainerView {
|
|
if (!_positionContainerView) {
|
|
_positionContainerView = [[XPRoomPositionContainView alloc] init];
|
|
}
|
|
return _positionContainerView;
|
|
}
|
|
|
|
- (XPRoomMessageContainerView *)messageContainerView {
|
|
if (!_messageContainerView) {
|
|
_messageContainerView = [[XPRoomMessageContainerView alloc] init];
|
|
}
|
|
return _messageContainerView;
|
|
}
|
|
|
|
- (XPRoomMenuContainerView *)menuContainerView {
|
|
if (!_menuContainerView) {
|
|
_menuContainerView = [[XPRoomMenuContainerView alloc] init];
|
|
}
|
|
return _menuContainerView;
|
|
}
|
|
|
|
- (XPRoomActivityContainerView *)activityContainerView {
|
|
if (!_activityContainerView) {
|
|
_activityContainerView = [[XPRoomActivityContainerView alloc] init];
|
|
}
|
|
return _activityContainerView;
|
|
}
|
|
|
|
@end
|