// // YOUPAILZChatRoomBaseVC.m // VQU // // Created by CY on 2021/10/28. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAILZChatRoomBaseVC.h" #import "NSString+YYAdd.h" #import "YBPopupMenu.h" #import "YOUPAILZChatRoomNoticeTitleCell.h" #import "YOUPAILZChatRoomNoticeContentCell.h" #import "YOUPAILZChatRoomEmojiAnimationWindow.h" #import "UIViewController+TFPresent.h" #import "YOUPAILCMessageVC.h" #import "YOUPAILZLiveUserInfoWindow.h" #import "YOUPAILZUserShowVC.h" #import "YOUPAILCReportVC.h" #import "YOUPAILZCommonGiftView.h" #import "YOUPAILPGuardHerVC.h" #import "LZAlertWindow.h" #import "YOUPAILZLiveChatMessageCell.h" #import "YOUPAILZChatRoomInfoEditWindow.h" #import "NIMMessageMaker.h" #import "YOUPAILZChatRoomUpLockWindow.h" #import "YOUPAILZChatRoomBlockListWindow.h" #import "YOUPAILZChatRoomReportWindow.h" #import "SDCycleScrollView.h" #import "YOUPAILCFirstRechargeModel.h" #import "YOUPAIHRChatRoomGiftView.h" #import "YOUPAIHRRechargePayWindow.h" #import "YOUPAILZChatRoomGiftAttachment.h" #import "YOUPAILZMusicLibraryWindow.h" #import "YOUPAILZMusicWindow.h" #import "YOUPAIZYFirstRechargeWindow.h" #import "YOUPAILCFirstRechargeModel.h" #import "YOUPAILZLiveAudienceVC.h" #import "YOUPAILZChatRoomBlindDateProgressView.h" #import "YOUPAILZBlindDateSelectWindow.h" #import "YOUPAIHRWebWindow.h" #import "YOUPAIBBMessageVC.h" #import "YOUPAILZChatRoomGameCenterWindow.h" #import "YOUPAIHRChatRoomContributeListVC.h" #import "YOUPAILZChatRoomSetterBgImgWindow.h" #import #import @interface YOUPAILZChatRoomBaseVC () @property (nonatomic,weak)UIImageView *bgImgV; @property (nonatomic, strong) SVGAPlayer *youpaipBgSvgaPlayer; @property (nonatomic, strong) SVGAParser *youpaipBgParser; @property (nonatomic,weak) UIView *youpaipheaderView; @property (nonatomic,weak) UIButton *youpaipcloseBtn; @property (nonatomic,weak) UIButton *youpaipnoticeBtn; /// 公告 @property (nonatomic,weak) UIButton *youpaipintroduceBtn; /// 玩法介绍 @property (nonatomic,weak) YOUPAILZChatRoomBlindDateProgressView *youpaipblindDateProgressView; // 相亲玩法进度 @property (nonatomic,strong) YBPopupMenu *youpaipnoticePopupMenu;// 公告弹窗 //广告相关 @property (nonatomic,strong) SDCycleScrollView* youpaipcycleScrollView; @property (nonatomic,strong) YOUPAILCFirstRechargeModel *youpaipfirstRechargeModel; @property (nonatomic,strong) YOUPAILCFirstRechargeModel *youpaipfirstRechargeModel1; @property (nonatomic,assign) CGFloat youpaipmusicPlayerViewY; @property (nonatomic,assign) BOOL isLoadingUserInfo; // 是否正在加载用户信息 @end @implementation YOUPAILZChatRoomBaseVC - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [YOUPAILZChatRoomManager shareManager].chatroomWindow.hidden = YES; [self.youpaipfooterView youpaifupdateUnread]; } - (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; self.navigationController.navigationBarHidden = NO; // [self.youpaipchatroomInfoView.titleL marqueeOfSettingWithState:MarqueeShutDown_H]; [self youpaifnoticePopupMenuDismiss]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; self.navigationController.navigationBarHidden = YES; // [self.youpaipchatroomInfoView.titleL marqueeOfSettingWithState:MarqueeStart_H]; } - (void)viewDidDisappear:(BOOL)animated{ [super viewDidDisappear:animated]; if ([YOUPAILZChatRoomManager shareManager].chatroomController != nil) { [YOUPAILZChatRoomManager shareManager].chatroomWindow.hidden = self.youpaipisClose; } } - (void)viewDidLoad { [super viewDidLoad]; [self youpaifinitBgImgV]; [self youpaifinitHeaderView]; [self youpaifinitNoticeView]; [self youpaifinitBoardView]; [self youpaifinitSeatHostView]; [self youpaifinitSeatOtherView]; [self youpaifinitFooterView]; [self youpaifinitMessageTableView]; [self youpaifinitKeyboardView]; [self youpaifinitApplySeatButton]; [self youpaifinitializeAgoraEngine]; [self youpaifinitAdvertView]; [self youpaifinitMusicLyrieView]; [self youpaifloadAdvert1]; [self youpaifinitPlayTypeIntroduce]; [self youpaifinitBlindDateProgressView]; self.youpaipchatroomInfoView.youpaiptitleL.text = self.youpaipchatroomModel.youpaiproom_title; self.youpaipchatroomInfoView.youpaiphotValueL.text = self.youpaipchatroomModel.youpaiproom_score; self.youpaipchatroomInfoView.youpaipchatroomIDL.text = [NSString stringWithFormat:@"房间号:%@",self.youpaipchatroomModel.youpaiproom_number]; self.youpaipchatroomInfoView.youpaipfollowBtn.selected = self.youpaipchatroomModel.youpaipis_follow; [self performSelector:@selector(youpaifnoticeBtnClick) withObject:nil afterDelay:0.5f]; [self performSelector:@selector(youpaifnoticePopupMenuDismiss) withObject:nil afterDelay:3.0f]; } //获取首冲弹框数据 -(void)youpaifloadAdvert1{ @weakify(self); [LCHttpHelper requestWithURLString:GetAdvert parameters:@{@"position":@"7"} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { @strongify(self); NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code==0) {//成功 self.youpaipfirstRechargeModel1 = [YOUPAILCFirstRechargeModel mj_objectWithKeyValues:dict[@"data"]]; for (int i = 0; i KScreenHeight - TabbarHeight - self.youpaiplyrieView.mj_h){ self.youpaiplyrieView.mj_y = KScreenHeight - TabbarHeight - self.youpaiplyrieView.mj_h; } }]; } } - (void)youpaifmusicHandleTap{ [self youpaifbackgoundMusic]; } /// 上麦处理按钮事件 - (void)youpaifapplySeatButtonClick{ } /// 初始化声网SDK - (void)youpaifinitializeAgoraEngine{ [[YOUPAILZChatRoomManager shareManager] youpaifinitializeAgoraEngine]; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.youpaipkeyboardView resignFirstResponder]; self.youpaipkeyboardView.hidden = YES; } /// 关闭按钮事件 - (void)youpaifcloseBtnClick{ [self.navigationController popViewControllerAnimated:YES]; } /// 点击公告事件 - (void)youpaifnoticeBtnClick{ if (self.youpaipchatroomModel.youpaiptalk_notice.length == 0) { return; } @weakify(self); self.youpaipnoticePopupMenu = [YBPopupMenu showRelyOnView:self.youpaipnoticeBtn titles:@[@"",@""] icons:@[@"",@""] menuWidth:KScreenWidth - 32.0f otherSettings:^(YBPopupMenu *popupMenu) { @strongify(self) popupMenu.delegate = self; popupMenu.borderWidth = 0.5f; popupMenu.borderColor = HexColorFromRGB(0x4F4B5B); popupMenu.backColor = HexColorFromRGB(0x2A2935); }]; self.youpaipnoticePopupMenu.mj_h = 41.0f + [self.youpaipchatroomModel.youpaiptalk_notice heightForFont:LCFont(13.0f) width:KScreenWidth - 32.0f - 34.0f] + 40.0f + 10.0f; } - (void)youpaifnoticePopupMenuDismiss{ [self.youpaipnoticePopupMenu dismiss]; } // 展示个人信息 - (void)youpaifshowUserInfoWithUserId:(NSString *)userId{ if (self.isLoadingUserInfo) { return; } self.isLoadingUserInfo = YES; @weakify(self); [LCHttpHelper requestWithURLString:UserShowPage parameters:@{@"user_id":userId,@"no_visitor":@"1"} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { @strongify(self); self.isLoadingUserInfo = NO; NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code==0) {//成功 YOUPAILCUserShowModel *showModel = [YOUPAILCUserShowModel mj_objectWithKeyValues:[dict objectForKey:@"data"]]; [self youpaifshowUserInfoWithModel:showModel]; } } failure:^(NSError *error) { @strongify(self); self.isLoadingUserInfo = NO; }]; } - (void)youpaifshowUserInfoWithModel:(YOUPAILCUserShowModel *)showModel{ @weakify(self); YOUPAILZLiveUserInfoWindow *vc = [[YOUPAILZLiveUserInfoWindow alloc] initWithModel:showModel isAnchor:NO isManage:NO]; vc.isTouchDismiss = YES; // 个人中心 [vc setYoupaipuserShowBlock:^(YOUPAILCUserShowModel * _Nonnull model) { @strongify(self); YOUPAILZUserShowVC *vc = [[YOUPAILZUserShowVC alloc] init]; vc.youpaipuserId = model.youpaipinfo.youpaipuserid; [self.navigationController pushViewController:vc animated:YES]; }]; // 举报 [vc setYoupaipreportBlock:^(YOUPAILCUserShowModel * _Nonnull model) { @strongify(self); ZCAlertAction *action = [ZCAlertAction actionWithTitle:@"举报" andblock:^{//举报 @strongify(self); YOUPAILCReportVC* report = [[YOUPAILCReportVC alloc]init]; report.youpaipreport_uid = model.youpaipinfo.youpaipuserid; report.youpaiptype = 5; [self.navigationController pushViewController:report animated:YES]; }]; ZCAlertAction *action1 = [ZCAlertAction actionWithTitle:@"拉黑" andblock:^{//举报 @strongify(self); [self youpaifshowAddBlackWithUserId:model.youpaipinfo.youpaipuserid]; }]; ZCAlertSheetView* alertSheet = [[ZCAlertSheetView alloc]initWithTitle:nil andShowCancelButton:YES andAction:@[action,action1]]; alertSheet.alertWindow.hidden = NO; [alertSheet show]; }]; // 礼物 [vc setYoupaipgiftBlock:^(YOUPAILCUserShowModel * _Nonnull model) { @strongify(self); NSString *to_uid = model.youpaipinfo.youpaipuserid; YOUPAILZCommonGiftView *view = [YOUPAILZCommonGiftView new]; view.isTouchDismiss = YES; view.youpaipcountDown = 3; view.youpaipisAnchor = NO; [view setYoupaiplzgiftblock:^(YOUPAILCGiftModel * _Nonnull model, NSInteger count,NSString*categoryID) { @strongify(self); [LCHttpHelper requestWithURLString:TalkSendGift parameters:@{@"to_uid":to_uid,@"gift_id":model.youpaipid,@"num":@(count),@"room_id":self.youpaipchatroomModel.youpaiproom_id,@"gift_type_id":categoryID} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code==0) {//成功 [ZCHUDHelper showTitle:@"礼物赠送成功"]; } } failure:^(NSError *error) { }]; }]; // 广告 [view setYoupaiptouchAdvertBlock:^(YOUPAILCBannerModel * _Nonnull bannerModel) { @strongify(self); if (bannerModel.youpaiplink_type==1) { ZCBaseWebVC* baseWeb = [[ZCBaseWebVC alloc]init]; baseWeb.contentUrl = bannerModel.youpaiplink_url; [self.navigationController pushViewController:baseWeb animated:YES]; }else if (bannerModel.youpaiplink_type==2||bannerModel.youpaiplink_type==3){ [self youpaifpageToStr:bannerModel.youpaiplink_url]; } }]; [view setJumToWalletBlock1:^{ @strongify(self); // YOUPAIHRRechargePayWindow *payWindow = [YOUPAIHRRechargePayWindow new]; // payWindow.isTouchDismiss = NO; // [self TFPresentVC:payWindow completion:^{ // // }]; YMAccountBalanceViewModel *accountBalanceVM = [[YMAccountBalanceViewModel alloc]initWithParams:@{ ParamsId:@([[LCSaveModel getUserModel].youpaipuserinfo.youpaipuser_id intValue]) }]; YMAccountBalanceRechargePopupView *customView = [[YMAccountBalanceRechargePopupView alloc]init]; [customView ym_bindViewModel:accountBalanceVM]; YMPopupView *popupView = [YMPopupView initWithCustomView:customView parentView:nil popStyle:YMPopupStyleSmoothFromBottom dismissStyle:YMDismissStyleSmoothToBottom]; popupView.priority = 999; popupView.cornerRadius = adapt(10); popupView.rectCorners = UIRectCornerTopLeft|UIRectCornerTopRight; popupView.positionStyle = YMPositionStyleBottom; popupView.isClickBgDismiss = YES; popupView.isHideBg = NO; popupView.bgAlpha = 0.5; [popupView pop]; @weakify(popupView) customView.dismissBlock = ^{ @strongify(popupView) [popupView dismissWithStyle:YMDismissStyleSmoothToBottom duration:2.0]; }; }]; [self TFPresentVC:view completion:^{ }]; }]; // 守护 [vc setYoupaipguardBlock:^(YOUPAILCUserShowModel * _Nonnull model) { @strongify(self); [LCHttpHelper requestWithURLString:UserShowPage parameters:@{@"user_id":[LCSaveModel getUserModel].youpaipuserinfo.youpaipuser_id,@"no_visitor":@"1"} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { NSDictionary* dict = (NSDictionary*)responseObject; NSInteger code = [[dict objectForKey:@"code"] integerValue]; if (code==0) {//成功 @strongify(self); YOUPAILCUserShowModel *showModel = [YOUPAILCUserShowModel mj_objectWithKeyValues:[dict objectForKey:@"data"]]; YOUPAILPGuardHerVC *VC= [[YOUPAILPGuardHerVC alloc]init]; VC.youpaipdelegate = self; VC.youpaipuser_id = model.youpaipinfo.youpaipuserid; VC.youpaiproomid = self.youpaipchatroomModel.youpaiproom_id; VC.vWidth = KScreenWidth-54; VC.vHeight = ((KScreenWidth-54)*165)/321.0+261.5; VC.youpaipinfoModel = showModel.youpaipguard; VC.youpaipisChatRoom = YES; VC.isTouchDismiss = YES; if(VC.youpaipinfoModel!=nil) [self TFPresentVC:VC completion:^{ }]; }else{ [ZCHUDHelper showTitle:[dict objectForKey:@"message"]]; } } failure:^(NSError *error) { [ZCHUDHelper showTitle:error.localizedDescription]; }]; }]; // 私信 [vc setYoupaipsiXinBlock:^(YOUPAILCUserShowModel * _Nonnull model) { @strongify(self); [self goChatPageWithUserId:model.youpaipinfo.youpaipuserid]; }]; // [vc setManageBlock:^(YOUPAILCUserShowModel * _Nonnull model, BOOL isAnchor) { //// @strongify(self); //// [self youpaifshowliveMembersManageWithModel:model isAnchor:isAnchor]; // }]; [self TFPresentVC:vc completion:^{}]; } - (void)goChatPageWithUserId:(NSString *)userId{ @weakify(self); // [LCHttpHelper requestWithURLString:IsChat parameters:@{@"user_id":userId} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) { // NSDictionary* dict = (NSDictionary*)responseObject; // NSInteger code = [[dict objectForKey:@"code"] integerValue]; // if (code==0) {//成功 // NSInteger is_chat = [[[dict objectForKey:@"data"] objectForKey:@"is_chat"] integerValue]; // NSString *msg = [[dict objectForKey:@"data"] objectForKey:@"msg"]; // @strongify(self); // if (is_chat == 0) { /// 0不可以 1可以私信 // LZAlertAction *cancelAction = [LZAlertAction actionWithTitle:@"再想想" handler:^(LZAlertAction *action) { // // }]; // cancelAction.cornerRadius = 5.0f; // cancelAction.bgColor = HexColorFromRGB(0x9F9DA5); // LZAlertAction *confimAction = [LZAlertAction actionWithTitle:@"去充值" handler:^(LZAlertAction *action) { // @strongify(self); // YOUPAIHRRechargePayWindow *payWindow = [YOUPAIHRRechargePayWindow new]; // payWindow.isTouchDismiss = NO; // [self.navigationController TFPresentVC:payWindow completion:^{ // // }]; // }]; // confimAction.cornerRadius = 5.0f; // confimAction.bgColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake((KScreenWidth - 105.0f) / 2.0f, 48.0f) FromColors:@[ZYGradientOneColor,ZYGradientTwoColor] ByGradientType:GradientLeftToRight]]; // LZAlertWindow *alert = [LZAlertWindow alertWithTitle:@"提示" content:msg action:@[cancelAction,confimAction]]; // alert.contentTextAlignment = NSTextAlignmentCenter; // [self TFPresentVC:alert completion:^{}]; // }else{ NIMSession *session = [NIMSession session:userId type:NIMSessionTypeP2P]; if (session) { [ZCHUDHelper show]; [[[NIMSDK sharedSDK] userManager] fetchUserInfos:@[session.sessionId] completion:^(NSArray * _Nullable users, NSError * _Nullable error) { @strongify(self); [ZCHUDHelper dismiss]; YOUPAILCIMSessionVC *vc = [[YOUPAILCIMSessionVC alloc] initWithSession:session]; [self.navigationController pushViewController:vc animated:YES]; }]; } // } // } // } failure:^(NSError *error) { // }]; } /// 拉黑弹框 - (void)youpaifshowAddBlackWithUserId:(NSString *)userId{ @weakify(self); LZAlertAction *cancelAction = [LZAlertAction actionWithTitle:@"取消" handler:^(LZAlertAction *action) { }]; cancelAction.cornerRadius = 24.0f; cancelAction.bgColor = HexColorFromRGB(0x9F9DA5); LZAlertAction *confimAction = [LZAlertAction actionWithTitle:@"确定" handler:^(LZAlertAction *action) { @strongify(self); [LCCommonHttp blackUserId:userId]; }]; confimAction.cornerRadius = 24.0f; confimAction.bgColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake((KScreenWidth - 105.0f) / 2.0f, 48.0f) FromColors:@[ZYGradientOneColor,ZYGradientTwoColor] ByGradientType:GradientLeftToRight]]; LZAlertWindow *alert = [LZAlertWindow alertWithTitle:@"提示" content:@"拉黑后,你将不再收到对方的消息,并且你们互相看不到对方的动态更新。可以在“设置-黑名单”中解除。" action:@[cancelAction,confimAction]]; alert.contentTextAlignment = NSTextAlignmentCenter; [self TFPresentVC:alert completion:^{}]; } - (void)youpaifaddGuardSuccess{ } // 展示选择座位 - (void)youpaifshowSelectedSeatWindowWithUserId:(NSString *)userId youpaipisInviation:(BOOL)youpaipisInviation{ } /// 处理点击用户操作 - (void)youpaifhandleUserOperationWithUserId:(NSString *)userId{ } #pragma mark - YBPopupMenuDelegate - (UITableViewCell *)ybPopupMenu:(YBPopupMenu *)ybPopupMenu cellForRowAtIndex:(NSInteger)index{ if (index == 0) { NSString *cellID = @"YOUPAILZChatRoomNoticeTitleCell"; YOUPAILZChatRoomNoticeTitleCell *cell = [ybPopupMenu.tableView dequeueReusableCellWithIdentifier:cellID]; if (cell == nil) { cell = [[YOUPAILZChatRoomNoticeTitleCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; } cell.youpaiptitleL.text = @"房间公告"; return cell; }else{ NSString *cellID = @"YOUPAILZChatRoomNoticeContentCell"; YOUPAILZChatRoomNoticeContentCell *cell = [ybPopupMenu.tableView dequeueReusableCellWithIdentifier:cellID]; if (cell == nil) { cell = [[YOUPAILZChatRoomNoticeContentCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; } cell.youpaipcontentL.text = self.youpaipchatroomModel.youpaiptalk_notice; return cell; } } - (CGFloat)ybPopupMenu:(YBPopupMenu *)ybPopupMenu heightForRowAtIndex:(NSInteger)index{ if (index == 0) { return 41.0f; }else{ return [self.youpaipchatroomModel.youpaiptalk_notice heightForFont:LCFont(13.0f) width:KScreenWidth - 32.0f - 34.0f] + 40.0f; } } #pragma mark - UICollectionViewDataSource - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ return self.youpaipchatroomModel.youpaipnormalSeats.count; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ YOUPAILZChatRoomOthearSeatCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass(YOUPAILZChatRoomOthearSeatCell.class) forIndexPath:indexPath]; [cell youpaifreloadWithModel:self.youpaipchatroomModel.youpaipnormalSeats[indexPath.item]]; return cell; } #pragma mark - UICollectionViewDelegate - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ [self youpaifotherSeatClickWithIndex:indexPath.item]; [self.youpaipkeyboardView resignFirstResponder]; self.youpaipkeyboardView.hidden = YES; } #pragma mark - UITableViewDataSource - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return self.youpaipmessages.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ NSString *cellID = @"YOUPAILZLiveChatMessageCell"; YOUPAILZLiveChatMessageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; if (cell == nil) { cell = [[YOUPAILZLiveChatMessageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } if ([self.youpaipmessages[indexPath.row] isKindOfClass:NIMMessage.class]) { NIMMessage *message = self.youpaipmessages[indexPath.row]; [cell youpaifreloadWithModel:message font:LCFont14 indexPath:indexPath]; }else if ([self.youpaipmessages[indexPath.row] isKindOfClass:YOUPAILZChatRoomGiftAttachment.class]){ YOUPAILZChatRoomGiftAttachment *attachment = self.youpaipmessages[indexPath.row]; [cell youpaifreloadWithAttachment:attachment font:LCFont14 indexPath:indexPath]; } @weakify(self); [cell setShowUserInfoBlock:^(NSIndexPath * _Nonnull indexPath1) { @strongify(self); if ([self.youpaipmessages[indexPath1.row] isKindOfClass:NIMMessage.class]) { NIMMessage *message = self.youpaipmessages[indexPath1.row]; if (message.session.sessionType == NIMSessionTypeChatroom && message.messageType == NIMMessageTypeNotification){ /// 如果是聊天室并且消息类型为通知类型 NIMNotificationObject *object = message.messageObject; if (![object.content isKindOfClass:[NIMUnsupportedNotificationContent class]]) { NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)object.content; NSString *fromId = nil; for (NIMChatroomNotificationMember *memebr in content.targets) { fromId = memebr.userId; } if (content.eventType == NIMChatroomEventTypeEnter) { /// 有成员加入聊天室 fromId = message.from; }else if(content.eventType == NIMChatroomEventTypeExit){ /// 有成员离开聊天室 fromId = message.from; }else if(content.eventType == NIMChatroomEventTypeKicked){ /// 聊天室成员被踢 fromId = message.from; } [self youpaifhandleUserOperationWithUserId:fromId]; } }else{ [self youpaifhandleUserOperationWithUserId:message.from]; } }else if ([self.youpaipmessages[indexPath1.row] isKindOfClass:YOUPAILZChatRoomGiftAttachment.class]){ YOUPAILZChatRoomGiftAttachment *attachment = self.youpaipmessages[indexPath1.row]; [self youpaifhandleUserOperationWithUserId:[NSString stringWithFormat:@"%@",@(attachment.from_uid)]]; } }]; // [cell setReplyBlock:^(NSIndexPath * _Nonnull indexPath) { // @strongify(self); // NSString *nick = [NIMKitUtil showNick:message.from inMessage:message]; // self.sendMessageTF.text = [NSString stringWithFormat:@"@%@ ",nick]; // [self youpaifsendMessageBecomeFirstResponder]; // }]; return cell; } #pragma mark - UITableViewDelegate - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return CGFLOAT_MIN; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return CGFLOAT_MIN; } //- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ // UIView *v = [[UIView alloc] initWithFrame:CGRectMake(.0f, 0.0f, 276.0f, [self.liveModel youpaifnoticeTextHeight])]; // v.transform = CGAffineTransformMakeRotation(M_PI); // UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(5.0f, 0, 266.0f, [self.liveModel youpaifnoticeTextHeight])]; // bgV.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3f]; // bgV.layer.cornerRadius = 10.0f; // bgV.clipsToBounds = YES; // UILabel *textL = [[UILabel alloc] initWithFrame:CGRectMake(15.0f, 10.0f, 236.0f, bgV.mj_h - 20.0f)]; // NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:self.liveModel.notice_text]; // NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init]; // paragraphStyle1.alignment=NSTextAlignmentJustified; // NSDictionary * dic =@{ // NSParagraphStyleAttributeName:paragraphStyle1, // NSUnderlineStyleAttributeName:[NSNumber numberWithInteger:NSUnderlineStyleNone], // }; // [attributedString1 setAttributes:dic range:NSMakeRange(0, attributedString1.length)]; // textL.attributedText = attributedString1; // textL.numberOfLines = 0; // textL.textColor = HexColorFromRGB(0xFFA68B); // textL.font = self.liveModel.isMaxFont ? self.liveModel.maxFont : self.liveModel.minFont; // [bgV addSubview:textL]; // [v addSubview:bgV]; // return v; //} - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ // NIMMessage *message = self.messages[indexPath.row]; // if ([message isKindOfClass:[YOUPAILZLiveModel class]]) { // [self youpaifshowUserInfoWithUserId:self.liveModel.user_info.user_id]; // }else{ // [self youpaifshowUserInfoWithUserId:message.from]; // } } - (NSMutableArray *)youpaipmessages{ if (!_youpaipmessages) { _youpaipmessages = [NSMutableArray array]; } return _youpaipmessages; } - (YOUPAILZChatRoomMoreModel *)youpaipmoreModel{ if (!_youpaipmoreModel) { _youpaipmoreModel = [[YOUPAILZChatRoomMoreModel alloc] init]; } return _youpaipmoreModel; } @end