diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index dad5eef0..c931fbc5 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -149,6 +149,8 @@ 9B2EA7C32804052E00ED17BF /* AnchorPKMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2EA7C22804052E00ED17BF /* AnchorPKMicroView.m */; }; 9B2EA7C628041EFC00ED17BF /* XPAnchorPkPanelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2EA7C528041EFC00ED17BF /* XPAnchorPkPanelView.m */; }; 9B2EA7CC2804245500ED17BF /* XPAnchorPKPanelUserView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2EA7CB2804245500ED17BF /* XPAnchorPKPanelUserView.m */; }; + 9B2F72D028E45A480000E4FA /* XPRoomQuickMessageContainView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2F72CF28E45A480000E4FA /* XPRoomQuickMessageContainView.m */; }; + 9B2F72D328E45C5A0000E4FA /* XPRoomQuidkMessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2F72D228E45C5A0000E4FA /* XPRoomQuidkMessageCell.m */; }; 9B32A04728881845002009D2 /* XPRoomTagListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B32A04628881845002009D2 /* XPRoomTagListView.m */; }; 9B3353BB2881527A00AC2F24 /* XPHomeLivesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3353BA2881527A00AC2F24 /* XPHomeLivesViewController.m */; }; 9B3353BE288156DB00AC2F24 /* XPHomeLivePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3353BD288156DB00AC2F24 /* XPHomeLivePresenter.m */; }; @@ -1466,6 +1468,10 @@ 9B2EA7C528041EFC00ED17BF /* XPAnchorPkPanelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorPkPanelView.m; sourceTree = ""; }; 9B2EA7CA2804245500ED17BF /* XPAnchorPKPanelUserView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorPKPanelUserView.h; sourceTree = ""; }; 9B2EA7CB2804245500ED17BF /* XPAnchorPKPanelUserView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorPKPanelUserView.m; sourceTree = ""; }; + 9B2F72CE28E45A480000E4FA /* XPRoomQuickMessageContainView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomQuickMessageContainView.h; sourceTree = ""; }; + 9B2F72CF28E45A480000E4FA /* XPRoomQuickMessageContainView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomQuickMessageContainView.m; sourceTree = ""; }; + 9B2F72D128E45C5A0000E4FA /* XPRoomQuidkMessageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomQuidkMessageCell.h; sourceTree = ""; }; + 9B2F72D228E45C5A0000E4FA /* XPRoomQuidkMessageCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomQuidkMessageCell.m; sourceTree = ""; }; 9B32A04528881845002009D2 /* XPRoomTagListView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTagListView.h; sourceTree = ""; }; 9B32A04628881845002009D2 /* XPRoomTagListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTagListView.m; sourceTree = ""; }; 9B3353B92881527A00AC2F24 /* XPHomeLivesViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLivesViewController.h; sourceTree = ""; }; @@ -4250,6 +4256,17 @@ path = FaceView; sourceTree = ""; }; + 9B2F72CD28E45A1C0000E4FA /* QuickMessageView */ = { + isa = PBXGroup; + children = ( + 9B2F72CE28E45A480000E4FA /* XPRoomQuickMessageContainView.h */, + 9B2F72CF28E45A480000E4FA /* XPRoomQuickMessageContainView.m */, + 9B2F72D128E45C5A0000E4FA /* XPRoomQuidkMessageCell.h */, + 9B2F72D228E45C5A0000E4FA /* XPRoomQuidkMessageCell.m */, + ); + path = QuickMessageView; + sourceTree = ""; + }; 9B33E3C827D85379003B0E62 /* File */ = { isa = PBXGroup; children = ( @@ -7251,6 +7268,7 @@ E8AEAED8271413530017FCE0 /* View */ = { isa = PBXGroup; children = ( + 9B2F72CD28E45A1C0000E4FA /* QuickMessageView */, 9BA812D328BF52A500783EA7 /* SendRedPacket */, E8751E5128A629EB0056EF44 /* Sailing */, 9BFE0D8F289903F600F53C24 /* TaskTip */, @@ -9135,6 +9153,7 @@ 9BFE992E288142FD009DA429 /* RoomClassifyModel.m in Sources */, E8A88D3027E85EEA00CA8837 /* RoomPKInfoModel.m in Sources */, E8AB633328AE51470023B0D2 /* XPSailingPrizeView.m in Sources */, + 9B2F72D328E45C5A0000E4FA /* XPRoomQuidkMessageCell.m in Sources */, E8A86E0527BA38DB001C21F9 /* NSString+RW.m in Sources */, E800162C2803FE4900D6D17A /* GuildIncomeRecordModel.m in Sources */, 9BE01ACE28925F7D00B50299 /* XPMineNewUserRechargeView.m in Sources */, @@ -9147,6 +9166,7 @@ E8C1CD6627D88EF800376F83 /* XPRoomFaceViewController.m in Sources */, E80DE4102775C34E00BE5BCB /* XPFirstRechargeSuccessView.m in Sources */, E8412FB32779E285006E1101 /* Api+RoomSetting.m in Sources */, + 9B2F72D028E45A480000E4FA /* XPRoomQuickMessageContainView.m in Sources */, E8D34D6028082BA5009C4835 /* XPMineUserDataPresenter.m in Sources */, 9B16A34B27E1915A00E13A98 /* XPTrumpetPresenter.m in Sources */, E8A6C29827CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m in Sources */, diff --git a/xplan-ios/Global/XPConstant.h b/xplan-ios/Global/XPConstant.h index f388d6d4..96a4705e 100644 --- a/xplan-ios/Global/XPConstant.h +++ b/xplan-ios/Global/XPConstant.h @@ -18,6 +18,8 @@ UIKIT_EXTERN NSString * const kVisitorUnReadCountNotificationKey; UIKIT_EXTERN NSString * const kHadShowNewUserGiftKey; UIKIT_EXTERN NSString * const kRedPacketHistory; UIKIT_EXTERN NSString * const kTeenagerStatusChange; +UIKIT_EXTERN NSString * const kRoomQuickMessageCloseCount; +UIKIT_EXTERN NSString * const kRoomQuickMessageCloseTime; typedef NS_ENUM(NSUInteger, KeyType) { KeyType_PasswordEncode,///密码 des 加密的 diff --git a/xplan-ios/Global/XPConstant.m b/xplan-ios/Global/XPConstant.m index 2304a907..61e56bb3 100644 --- a/xplan-ios/Global/XPConstant.m +++ b/xplan-ios/Global/XPConstant.m @@ -27,6 +27,8 @@ NSString * const kFromSearchToHomeViewKey = @"kFromSearchToHomeViewKey";//用户 NSString * const kTabShowAnchorCardKey = @"kTabShowAnchorCardKey"; //tab展示主播卡片 NSString * const kRedPacketHistory = @"kRedPacketHistory"; NSString * const kTeenagerStatusChange = @"kTeenagerStatusChange";//青少年状态改变 +NSString * const kRoomQuickMessageCloseCount = @"kTeenagerStatusChange";//房间快捷发言关闭次数 +NSString * const kRoomQuickMessageCloseTime = @"kRoomQuickMessageCloseTime"; //房间快捷发言最后关闭时间 ///在里面进行判断当前环境是什么 NSString * const KeyWithType(KeyType type) { diff --git a/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.h b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.h new file mode 100644 index 00000000..9984b38e --- /dev/null +++ b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.h @@ -0,0 +1,20 @@ +// +// XPRoomQuickMessageContainView.h +// xplan-ios +// +// Created by GreenLand on 2022/9/28. +// + +#import +#import "RoomHostDelegate.h" +#import "RoomGuestDelegate.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomQuickMessageContainView : UIView + +- (instancetype)initWithDelegate:(id)delegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.m b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.m new file mode 100644 index 00000000..a893ed56 --- /dev/null +++ b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuickMessageContainView.m @@ -0,0 +1,177 @@ +// +// XPRoomQuickMessageContainView.m +// xplan-ios +// +// Created by GreenLand on 2022/9/28. +// + +#import "XPRoomQuickMessageContainView.h" +#import "XPRoomQuidkMessageCell.h" +#import +#import +///Tool +#import "AccountInfoStorage.h" +#import "XPConstant.h" +///Model +#import "XPMessageRemoteExtModel.h" +#import "UserInfoModel.h" +#import "RoomInfoModel.h" + +@interface XPRoomQuickMessageContainView () + +@property (nonatomic, strong) UICollectionView *collectionView; + +@property (nonatomic, strong) NSMutableArray *titleArray; +///关闭 +@property (nonatomic,strong) UIButton *closeButton; +///代理 +@property (nonatomic,weak) id delegate; + +@end + +@implementation XPRoomQuickMessageContainView + +- (instancetype)initWithDelegate:(id)delegate { + self = [super init]; + if (self) { + self.delegate = delegate; + self.clipsToBounds = YES; + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self addSubview:self.collectionView]; + [self addSubview:self.closeButton]; +} + +- (void)initSubViewConstraints { + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self).offset(15); + make.right.mas_equalTo(self.closeButton.mas_left).offset(-8); + make.top.bottom.mas_equalTo(self); + }]; + + [self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-8); + make.width.height.mas_equalTo(30); + make.centerY.mas_equalTo(self); + }]; +} + +#pragma mark - UICollectionViewDataSource +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.titleArray.count; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + XPRoomQuidkMessageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomQuidkMessageCell class]) forIndexPath:indexPath]; + cell.title = self.titleArray[indexPath.row]; + return cell; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + NSString *str = self.titleArray[indexPath.row]; + NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:12]}; + CGSize size = [str boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, 25) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil].size; + return CGSizeMake(size.width + 10, 30); +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + NSString *str = self.titleArray[indexPath.row]; + [self sendText:str]; +} + +- (void)sendText:(NSString *)text { + if ([self.delegate getRoomInfo].isCloseScreen) { + return; + } + //移除记录关闭次数 + [[NSUserDefaults standardUserDefaults] removeObjectForKey:kRoomQuickMessageCloseCount]; + [[NSUserDefaults standardUserDefaults] synchronize]; + + UserInfoModel * userInfo = [self.delegate getUserInfo]; + XPMessageRemoteExtModel *extModel = [[XPMessageRemoteExtModel alloc] init]; + extModel.defUser = userInfo.defUser; + extModel.erbanNo = userInfo.erbanNo; + extModel.carName = userInfo.carName; + extModel.inRoomNameplatePic = userInfo.nameplatePic; + extModel.inRoomNameplateWord = userInfo.nameplateWord; + extModel.charmUrl = userInfo.userLevelVo.charmUrl; + extModel.experLevelSeq = userInfo.userLevelVo.experLevelSeq; + extModel.experUrl = userInfo.userLevelVo.experUrl; + extModel.newUser = userInfo.newUser; + extModel.vipIcon = userInfo.userVipInfoVO.vipIcon; + extModel.androidBubbleUrl = userInfo.androidBubbleUrl; + extModel.iosBubbleUrl = userInfo.iosBubbleUrl; + extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + + NIMMessage * message = [[NIMMessage alloc] init]; + message.text = text; + NSMutableDictionary *remoteExt = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[AccountInfoStorage instance].getUid]; + message.remoteExt = remoteExt; + + ///网易易盾 拦截高风险 + NIMAntiSpamOption *option = [[NIMAntiSpamOption alloc]init]; + option.yidunEnabled = YES; + option.businessId = KeyWithType(keyType_YiDunBussinessId); + message.antiSpamOption = option; + NSString * sessionId = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].roomId]; + //构造会话 + NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) { + }]; +} + +- (void)onCloseButtonClick:(UIButton *)sender { + [self mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(0); + }]; + //记录最后关闭时间 + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + long time = (long)([[NSDate date] timeIntervalSince1970]*1000); + [defaults setObject:@(time) forKey:kRoomQuickMessageCloseTime]; + //记录关闭的次数 + NSNumber *count = [defaults objectForKey:kRoomQuickMessageCloseCount]; + [defaults setObject:@(count.intValue +1) forKey:kRoomQuickMessageCloseCount]; + [defaults synchronize]; + +} + +#pragma mark - Getters And Setters +- (UICollectionView *)collectionView{ + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + layout.minimumInteritemSpacing = 8; + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.showsHorizontalScrollIndicator = NO; + _collectionView.backgroundColor = [UIColor clearColor]; + _collectionView.dataSource = self; + _collectionView.delegate = self; + [_collectionView registerClass:[XPRoomQuidkMessageCell class] forCellWithReuseIdentifier:NSStringFromClass([XPRoomQuidkMessageCell class])]; + } + return _collectionView; +} + +- (NSMutableArray *)titleArray { + if (!_titleArray) { + _titleArray = [NSMutableArray arrayWithObjects:@"萌新求关注", @"ღ( ´・ᴗ・` )比心", @"贴贴", @"这个怎么玩呀?", @"我要上麦", @"么么叽!么么哒", @"老板大气", @"下次一定!", nil]; + } + return _titleArray; +} + + +- (UIButton *)closeButton { + if (!_closeButton) { + _closeButton = [[UIButton alloc] init]; + [_closeButton setImage:[UIImage imageNamed:@"room_gift_graffiti_close"] forState:UIControlStateNormal]; + [_closeButton addTarget:self action:@selector(onCloseButtonClick:) forControlEvents:UIControlEventTouchUpInside]; + } + return _closeButton; +} + +@end diff --git a/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuidkMessageCell.h b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuidkMessageCell.h new file mode 100644 index 00000000..baea04b3 --- /dev/null +++ b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuidkMessageCell.h @@ -0,0 +1,18 @@ +// +// XPRoomQuidkMessageCell.h +// xplan-ios +// +// Created by GreenLand on 2022/9/28. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomQuidkMessageCell : UICollectionViewCell + +@property (nonatomic, copy) NSString *title; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuidkMessageCell.m b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuidkMessageCell.m new file mode 100644 index 00000000..aee87668 --- /dev/null +++ b/xplan-ios/Main/Room/View/QuickMessageView/XPRoomQuidkMessageCell.m @@ -0,0 +1,68 @@ +// +// XPRoomQuidkMessageCell.m +// xplan-ios +// +// Created by GreenLand on 2022/9/28. +// + +#import "XPRoomQuidkMessageCell.h" +///Third +#import +///Model +#import "RoomTagModel.h" +#import "ThemeColor.h" +#import "RoomClassifyModel.h" + +@interface XPRoomQuidkMessageCell () + +@property (nonatomic, strong) UIView *bgView; + +@property (nonatomic, strong) UILabel *tagLabel; + +@end + +@implementation XPRoomQuidkMessageCell + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self addSubview:self.bgView]; + [self addSubview:self.tagLabel]; + [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(22); + make.left.right.mas_equalTo(self.contentView); + make.centerY.mas_equalTo(self.contentView); + }]; + [self.tagLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self); + }]; + } + return self; +} + +- (void)setTitle:(NSString *)title { + self.tagLabel.text = title; +} + +#pragma mark - Getter & Setter +- (UILabel *)tagLabel { + if (!_tagLabel) { + _tagLabel = [[UILabel alloc] init]; + _tagLabel.textColor = UIColor.whiteColor; + _tagLabel.font = [UIFont systemFontOfSize:12]; + _tagLabel.textAlignment = NSTextAlignmentCenter; + } + return _tagLabel; +} + +- (UIView *)bgView { + if (!_bgView) { + _bgView = [[UIView alloc] init]; + _bgView.backgroundColor = UIColorRGBAlpha(0xffffff, 0.4); + _bgView.layer.cornerRadius = 11; + _bgView.layer.masksToBounds = YES; + } + return _bgView; +} + +@end diff --git a/xplan-ios/Main/Room/View/XPRoomViewController.m b/xplan-ios/Main/Room/View/XPRoomViewController.m index cc48dba3..24b763da 100644 --- a/xplan-ios/Main/Room/View/XPRoomViewController.m +++ b/xplan-ios/Main/Room/View/XPRoomViewController.m @@ -36,6 +36,7 @@ #import "XPRoomActivityContainerView.h" #import "XPRoomBackContainerView.h" #import "XPRoomMenuContainerView.h" +#import "XPRoomQuickMessageContainView.h" #import "XPRoomMessageContainerView.h" #import "RoomHeaderView.h" #import "SocialStageView.h" @@ -80,6 +81,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 @property (nonatomic,strong) StageView *stageView; ///公屏 @property (nonatomic,strong) XPRoomMessageContainerView *messageContainerView; +///快捷发言 +@property (nonatomic, strong) XPRoomQuickMessageContainView *quickMessageContainerView; ///底部操作栏 @property (nonatomic,strong) XPRoomMenuContainerView *menuContainerView; ///活动 @@ -239,6 +242,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.view addSubview:self.littleGameView]; [self.view addSubview:self.stageView]; [self.view addSubview:self.messageContainerView]; + [self.view addSubview:self.quickMessageContainerView]; [self.view addSubview:self.menuContainerView]; [self.view addSubview:self.activityContainerView]; [self.view addSubview:self.roomHeaderView]; @@ -264,11 +268,32 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.messageContainerView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.stageView.mas_bottom); - make.bottom.equalTo(self.menuContainerView.mas_top).offset(-5); + make.bottom.equalTo(self.quickMessageContainerView.mas_top).offset(-5); make.left.equalTo(self.view); make.right.equalTo(self.activityContainerView.mas_left).offset(-10); }]; - + CGFloat quickMsgHeight = 30; + //记录最后关闭时间 + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSNumber *closeCount = [defaults objectForKey:kRoomQuickMessageCloseCount]; + NSNumber *lastTime = [defaults objectForKey:kRoomQuickMessageCloseTime]; + NSDate *datenow = [NSDate date];//现在时间 + long time2 = (long)([datenow timeIntervalSince1970]*1000); + long aTime = (time2 - [lastTime longValue]) / 1000; + if (aTime > 24*60 *60) {//大于24小时 + if (closeCount.intValue > 3) { + quickMsgHeight = 0; + } else { + quickMsgHeight = 30; + } + } else { + quickMsgHeight = 0; + } + [self.quickMessageContainerView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.menuContainerView.mas_top); + make.height.mas_equalTo(quickMsgHeight); + make.left.right.mas_equalTo(self.view); + }]; [self.menuContainerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(self.view); make.bottom.mas_equalTo(-kSafeAreaBottomHeight- 8); @@ -278,7 +303,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [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.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); make.width.mas_equalTo(80); }]; @@ -312,6 +337,12 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 make.height.mas_equalTo(self.stageView.hightForStageView); }]; [self.messageContainerView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.stageView.mas_bottom); + make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5); + make.left.equalTo(self.anchorScrollView.middleImageView); + make.right.equalTo(self.activityContainerView.mas_left).offset(-10); + }]; + [self.quickMessageContainerView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.stageView.mas_bottom); make.bottom.mas_equalTo(self.backContainerView).mas_offset(-5-40-8-kSafeAreaBottomHeight); make.left.equalTo(self.anchorScrollView.middleImageView); @@ -325,7 +356,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.activityContainerView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.messageContainerView); make.right.mas_equalTo(self.anchorScrollView.middleImageView); - make.bottom.mas_equalTo(self.backContainerView).mas_offset(-5-40-8-kSafeAreaBottomHeight); + make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5); make.width.mas_equalTo(80); }]; [self.functionView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -426,7 +457,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.messageContainerView mas_remakeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(70); - make.bottom.mas_equalTo(self.menuContainerView.mas_top).offset(-5); + make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); make.left.mas_equalTo(self.view); make.right.mas_equalTo(self.activityContainerView.mas_left).offset(-10); }]; @@ -434,7 +465,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.activityContainerView mas_remakeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(65); make.right.mas_equalTo(self.view); - make.bottom.mas_equalTo(self.menuContainerView.mas_top).offset(-5); + make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); make.width.mas_equalTo(80); }]; } else { @@ -446,7 +477,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.messageContainerView mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.stageView.mas_bottom); - make.bottom.mas_equalTo(self.menuContainerView.mas_top).offset(-5); + make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); make.left.mas_equalTo(self.view); make.right.mas_equalTo(self.activityContainerView.mas_left).offset(-10); }]; @@ -454,7 +485,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.activityContainerView mas_remakeConstraints:^(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.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5); make.width.mas_equalTo(80); }]; } @@ -481,14 +512,19 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 }]; [self.messageContainerView mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.stageView.mas_bottom); - make.bottom.mas_equalTo(self.backContainerView).mas_offset(-5-40-8-kSafeAreaBottomHeight); + make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5); make.left.mas_equalTo(self.anchorScrollView.middleImageView); make.right.mas_equalTo(self.activityContainerView.mas_left).offset(-10); }]; + [self.quickMessageContainerView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(30); + make.bottom.mas_equalTo(self.backContainerView).mas_offset(-5-40-8-kSafeAreaBottomHeight); + make.left.right.mas_equalTo(self.anchorScrollView.middleImageView); + }]; [self.activityContainerView mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.messageContainerView); make.right.mas_equalTo(self.anchorScrollView.middleImageView); - make.bottom.mas_equalTo(self.backContainerView).mas_offset(-5-40-8-kSafeAreaBottomHeight); + make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5); make.width.mas_equalTo(80); }]; } @@ -610,6 +646,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.backContainerView removeFromSuperview]; [self.stageView removeFromSuperview]; [self.messageContainerView removeFromSuperview]; + [self.quickMessageContainerView removeFromSuperview]; [self.activityContainerView removeFromSuperview]; [self.roomHeaderView removeFromSuperview]; [self.functionView removeFromSuperview]; @@ -617,6 +654,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.anchorScrollView addSubview:self.backContainerView]; [self.anchorScrollView addSubview:self.stageView]; [self.anchorScrollView addSubview:self.messageContainerView]; + [self.anchorScrollView addSubview:self.quickMessageContainerView]; [self.anchorScrollView addSubview:self.activityContainerView]; [self.anchorScrollView addSubview:self.roomHeaderView]; [self.anchorScrollView addSubview:self.functionView]; @@ -812,6 +850,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 //2、移除房间子控件 [self.stageView removeFromSuperview]; [self.messageContainerView removeFromSuperview]; + [self.quickMessageContainerView removeFromSuperview]; [self.activityContainerView removeFromSuperview]; [self.roomHeaderView removeFromSuperview]; [self.functionView removeFromSuperview]; @@ -852,6 +891,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.backContainerView removeFromSuperview]; [self.stageView removeFromSuperview]; [self.messageContainerView removeFromSuperview]; + [self.quickMessageContainerView removeFromSuperview]; [self.activityContainerView removeFromSuperview]; [self.roomHeaderView removeFromSuperview]; [self.functionView removeFromSuperview]; @@ -893,6 +933,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.backContainerView removeFromSuperview]; [self.stageView removeFromSuperview]; [self.messageContainerView removeFromSuperview]; + [self.quickMessageContainerView removeFromSuperview]; [self.activityContainerView removeFromSuperview]; [self.roomHeaderView removeFromSuperview]; [self.functionView removeFromSuperview]; @@ -901,6 +942,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.anchorScrollView addSubview:self.backContainerView]; [self.anchorScrollView addSubview:self.stageView]; [self.anchorScrollView addSubview:self.messageContainerView]; + [self.anchorScrollView addSubview:self.quickMessageContainerView]; [self.anchorScrollView addSubview:self.activityContainerView]; [self.anchorScrollView addSubview:self.roomHeaderView]; [self.anchorScrollView addSubview:self.functionView]; @@ -1062,6 +1104,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.backContainerView removeFromSuperview]; [self.stageView removeFromSuperview]; [self.messageContainerView removeFromSuperview]; + [self.quickMessageContainerView removeFromSuperview]; [self.activityContainerView removeFromSuperview]; [self.roomHeaderView removeFromSuperview]; [self.functionView removeFromSuperview]; @@ -1069,6 +1112,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.view addSubview:self.backContainerView]; [self.view addSubview:self.stageView]; [self.view addSubview:self.messageContainerView]; + [self.view addSubview:self.quickMessageContainerView]; [self.view addSubview:self.activityContainerView]; [self.view addSubview:self.roomHeaderView]; [self.view addSubview:self.functionView]; @@ -1515,6 +1559,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.backContainerView removeFromSuperview]; [self.stageView removeFromSuperview]; [self.messageContainerView removeFromSuperview]; + [self.quickMessageContainerView removeFromSuperview]; [self.activityContainerView removeFromSuperview]; [self.roomHeaderView removeFromSuperview]; [self.functionView removeFromSuperview]; @@ -1522,6 +1567,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.anchorScrollView addSubview:self.backContainerView]; [self.anchorScrollView addSubview:self.stageView]; [self.anchorScrollView addSubview:self.messageContainerView]; + [self.anchorScrollView addSubview:self.quickMessageContainerView]; [self.anchorScrollView addSubview:self.activityContainerView]; [self.anchorScrollView addSubview:self.roomHeaderView]; [self.anchorScrollView addSubview:self.functionView]; @@ -1598,6 +1644,13 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 return _messageContainerView; } +- (XPRoomQuickMessageContainView *)quickMessageContainerView { + if(!_quickMessageContainerView) { + _quickMessageContainerView = [[XPRoomQuickMessageContainView alloc] initWithDelegate:self]; + } + return _quickMessageContainerView; +} + - (XPRoomMenuContainerView *)menuContainerView { if (!_menuContainerView) { _menuContainerView = [[XPRoomMenuContainerView alloc] initWithDelegate:self];