YBImRoomSmallView.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. //
  2. // YBImRoomSmallView.m
  3. // iphoneLive
  4. //
  5. // Created by YB007 on 2022/6/17.
  6. // Copyright © 2022 cat. All rights reserved.
  7. //
  8. #import "YBImRoomSmallView.h"
  9. #import "TConversationCell.h"
  10. #import "THeader.h"
  11. #import "TUIKit.h"
  12. #import "TChatC2CController.h"
  13. #import "MessageListModel.h"
  14. #import "MessageFansVC.h"
  15. #import "MsgTopPubVC.h"
  16. #import "SelPeopleV.h"
  17. #import "JCHATAlertViewWait.h"
  18. #import "MsgSysVC.h"
  19. #import "OrderMessageVC.h"
  20. @interface YBImRoomSmallView()<UIGestureRecognizerDelegate,UITableViewDelegate,UITableViewDataSource,V2TIMConversationListener>{
  21. dispatch_group_t _imgListGroup;
  22. SelPeopleV * _selV;
  23. TConversationCellData *conver_admin1;//官方通知
  24. TConversationCellData *conver_admin2;//系统通知
  25. TConversationCellData *_conversation_fans; //顶部-粉丝
  26. TConversationCellData *_conversation_zan; //顶部-赞
  27. TConversationCellData *_conversation_at; //顶部-@
  28. TConversationCellData *_conversation_comment; //顶部-评论
  29. TConversationCellData *_conversation_ctr; //风控管理员
  30. TConversationCellData *_conversation_goodsorder;
  31. TConversationCellData *_conversation_hostid;
  32. CGFloat _smallViewHeight;
  33. BOOL _stopTap;
  34. }
  35. @property(nonatomic,strong)UIView *bgView;
  36. @property(nonatomic,strong)UILabel *topTitleL;
  37. @property(nonatomic,strong)UIButton *topIgnoreBtn;
  38. @property(nonatomic,strong)UIButton *topLeftBtn;
  39. ///IM列表
  40. @property(nonatomic,strong)NSString *liveUid;
  41. @property (nonatomic, strong) UITableView *tableView;
  42. @property (nonatomic, strong) NSArray *data;
  43. ///C2C
  44. @property(nonatomic,strong)UIView *c2cBgView;
  45. @property(nonatomic,strong)MsgSysVC *c2cSysVC;
  46. @property(nonatomic,strong)TChatC2CController *c2cChatVC;
  47. @end
  48. @implementation YBImRoomSmallView
  49. - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch; {
  50. if ([touch.view isDescendantOfView:self.bgView]) {
  51. return NO;
  52. }
  53. return YES;
  54. }
  55. -(void)dissmissView {
  56. if (_stopTap) {
  57. [self endEditing:YES];
  58. [[NSNotificationCenter defaultCenter] postNotificationName:ybImSamllChange object:@(0)];
  59. [_c2cChatVC.inputController hideFaceAnimation];
  60. return;
  61. }
  62. if (_imSmallType == ImSmall_List && _c2cBgView.hidden == NO) {
  63. [self changeTopDesWithData:nil];
  64. }else{
  65. if (self.imCtrEvent) {
  66. self.imCtrEvent(ImCtr_Dismiss, @{});
  67. }
  68. [self removeNoti];
  69. }
  70. }
  71. +(instancetype)showImListWithLiveUid:(NSString *)liveuid;{
  72. YBImRoomSmallView *view = [[YBImRoomSmallView alloc]init];
  73. view.liveUid = liveuid;
  74. view.frame = CGRectMake(0, 0, _window_width, _window_height);
  75. [[YBBaseAppDelegate sharedAppDelegate].topViewController.view addSubview:view];
  76. [view createUI];
  77. return view;
  78. }
  79. -(void)createUI {
  80. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dissmissView)];
  81. tap.delegate = self;
  82. [self addGestureRecognizer:tap];
  83. _smallViewHeight = _window_height*0.45;
  84. [self addNoti];
  85. self.backgroundColor = RGB_COLOR(@"#000000", 0.1);
  86. _bgView = [[UIView alloc]init];
  87. _bgView.backgroundColor = UIColor.whiteColor;
  88. [self addSubview:_bgView];
  89. [_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  90. make.width.bottom.centerX.equalTo(self);
  91. make.height.mas_equalTo(_smallViewHeight+44);
  92. }];
  93. UIView *topNav = [[UIView alloc]init];
  94. [_bgView addSubview:topNav];
  95. [topNav mas_makeConstraints:^(MASConstraintMaker *make) {
  96. make.width.centerX.top.equalTo(_bgView);
  97. make.height.mas_equalTo(44);
  98. }];
  99. UILabel *topTitleL = [[UILabel alloc]init];
  100. topTitleL.text = YZMsg(@"消息");
  101. topTitleL.font = NaviTitle_Font;
  102. topTitleL.textColor = RGB_COLOR(@"#323232", 1);
  103. [topNav addSubview:topTitleL];
  104. self.topTitleL = topTitleL;
  105. [topTitleL mas_makeConstraints:^(MASConstraintMaker *make) {
  106. make.centerX.centerY.equalTo(topNav);
  107. }];
  108. UIButton *ignoreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  109. [ignoreBtn setTitle:YZMsg(@"忽略未读") forState:0];
  110. ignoreBtn.titleLabel.font = SYS_Font(13);
  111. [ignoreBtn setTitleColor:RGB_COLOR(@"#969696", 1) forState:0];
  112. [ignoreBtn addTarget:self action:@selector(clickIgnoreBtn) forControlEvents:UIControlEventTouchUpInside];
  113. [topNav addSubview:ignoreBtn];
  114. self.topIgnoreBtn = ignoreBtn;
  115. [ignoreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  116. make.height.centerY.equalTo(topNav);
  117. make.right.equalTo(topNav.mas_right).offset(-10);
  118. }];
  119. UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  120. [leftBtn setImage:[UIImage imageNamed:@"gray_back"] forState:0];
  121. [leftBtn addTarget:self action:@selector(clickLeftBtn) forControlEvents:UIControlEventTouchUpInside];
  122. [topNav addSubview:leftBtn];
  123. leftBtn.hidden = YES;
  124. self.topLeftBtn = leftBtn;
  125. [leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  126. make.centerY.equalTo(topNav);
  127. make.width.height.mas_equalTo(40);
  128. make.left.equalTo(topNav.mas_left).offset(0);
  129. }];
  130. ///
  131. _data = [NSArray array];
  132. _imgListGroup = dispatch_group_create();
  133. _tableView = [[UITableView alloc] initWithFrame:CGRectZero];
  134. _tableView.tableFooterView = [[UIView alloc] init];
  135. _tableView.backgroundColor = UIColor.whiteColor;
  136. _tableView.delegate = self;
  137. _tableView.dataSource = self;
  138. _tableView.separatorStyle = 0;
  139. _tableView.showsVerticalScrollIndicator = NO;
  140. _tableView.contentInset = UIEdgeInsetsMake(0, 0, ShowDiff, 0);
  141. [_bgView addSubview:_tableView];
  142. [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  143. make.top.equalTo(topNav.mas_bottom);
  144. make.width.centerX.bottom.equalTo(_bgView);
  145. }];
  146. if (@available(iOS 11.0,*)) {
  147. _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  148. }
  149. if (@available(iOS 15.0, *)) {
  150. _tableView.sectionHeaderTopPadding = 0;
  151. }
  152. ///
  153. [_bgView addSubview:self.c2cBgView];
  154. [_c2cBgView mas_makeConstraints:^(MASConstraintMaker *make) {
  155. make.width.height.centerX.centerY.equalTo(_tableView);
  156. }];
  157. [_bgView layoutIfNeeded];
  158. }
  159. - (void)setImSmallType:(ImSmallType)imSmallType{
  160. _imSmallType = imSmallType;
  161. if (_imSmallType == ImSmall_List) {
  162. [self pullListData];
  163. }
  164. }
  165. -(void)changeTopDesWithData:(TConversationCellData*)cellData {
  166. if (cellData) {
  167. self.topTitleL.text = cellData.userName;
  168. self.topIgnoreBtn.hidden = YES;
  169. self.topLeftBtn.hidden = NO;
  170. _c2cBgView.hidden = NO;
  171. }else{
  172. self.topTitleL.text = YZMsg(@"消息");
  173. self.topIgnoreBtn.hidden = NO;
  174. self.topLeftBtn.hidden = YES;
  175. _c2cBgView.hidden = YES;
  176. _c2cSysVC.listModel = nil;
  177. [self destroyVCView];
  178. }
  179. }
  180. #pragma mark - IM列表开始
  181. -(void)clickLeftBtn {
  182. [self dissmissView];
  183. }
  184. -(void)pullListData {
  185. [self updateConversations];
  186. }
  187. -(void)clearUnreadNum {
  188. for (int i = 0; i < _data.count; i ++) {
  189. TConversationCellData *data = _data[i];
  190. data.unRead = 0;
  191. NSMutableArray *new_a = [NSMutableArray arrayWithArray:_data];
  192. [new_a replaceObjectAtIndex:i withObject:data];
  193. _data = [NSArray arrayWithArray:new_a];
  194. }
  195. [_tableView reloadData];
  196. }
  197. - (void)clickIgnoreBtn {
  198. int unread = 0;
  199. for (TConversationCellData *conversation in _data){
  200. unread += conversation.unRead;
  201. [[YBImManager shareInstance] clearUnreadConvId:conversation.convId sendNot:NO];
  202. }
  203. unread += _conversation_ctr.unRead;
  204. [[YBImManager shareInstance] clearUnreadConvId:_conversation_ctr.convId sendNot:NO];
  205. if (unread == 0) {
  206. [MBProgressHUD showPop:YZMsg(@"当前暂无未读消息")];
  207. }else {
  208. [MBProgressHUD showPop:YZMsg(@"已经忽略未读消息")];
  209. [self updateConversations];
  210. }
  211. }
  212. -(void)addNoti {
  213. [self removeNoti];
  214. NSNotificationCenter *notCenter = [NSNotificationCenter defaultCenter];
  215. // [notCenter addObserver:self selector:@selector(onRefreshConversations:) name:TUIKitNotification_TIMRefreshListener object:nil];
  216. [[V2TIMManager sharedInstance] addConversationListener:self];
  217. [notCenter addObserver:self selector:@selector(imInputHeightChange:) name:ybImSamllChange object:nil];
  218. }
  219. #pragma mark --消息监听
  220. - (void)onTotalUnreadMessageCountChanged:(UInt64)totalUnreadCount {
  221. [self updateConversations];
  222. }
  223. -(void)imInputHeightChange:(NSNotification *)not {
  224. CGFloat changeHeight = [not.object floatValue];
  225. _stopTap = NO;
  226. if (changeHeight>0) {
  227. _stopTap = YES;
  228. }
  229. [_bgView mas_remakeConstraints:^(MASConstraintMaker *make) {
  230. make.width.bottom.centerX.equalTo(self);
  231. make.height.mas_equalTo(_smallViewHeight+44+changeHeight);
  232. }];
  233. [_c2cBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
  234. make.top.equalTo(_bgView.mas_top).offset(44);
  235. make.width.centerX.bottom.equalTo(_bgView);
  236. }];
  237. [_bgView layoutIfNeeded];
  238. [_c2cBgView layoutIfNeeded];
  239. NSLog(@"rk=========================rk_smallim:%f",changeHeight);
  240. _c2cChatVC.view.frame = CGRectMake(0, 0, _window_width, _smallViewHeight+changeHeight);
  241. [_c2cChatVC changeSmallHeight];
  242. }
  243. -(void)removeNoti {
  244. [[NSNotificationCenter defaultCenter] removeObserver:self];
  245. }
  246. - (void)dealloc {
  247. [self removeNoti];
  248. }
  249. - (void)onRefreshConversations:(NSNotification *)notification {
  250. //NSLog(@"xxxxxxokokokokokoko");
  251. [self updateConversations];
  252. }
  253. - (void)updateConversations{
  254. YBWeakSelf;
  255. [[YBImManager shareInstance]getAllConversationList:^(NSMutableArray *CovList, BOOL isSuccess) {
  256. if(isSuccess){
  257. dispatch_async(dispatch_get_main_queue(), ^{
  258. [weakSelf goReload:CovList];
  259. });
  260. }
  261. }];
  262. // [[YBImManager shareInstance] getLastDisplayStringWith:_imgListGroup finish:^(NSArray *transformArray) {
  263. // dispatch_async(dispatch_get_main_queue(), ^{
  264. // [weakSelf goReload:transformArray];
  265. // });
  266. // }];
  267. }
  268. -(void)goReload:(NSArray *)reloadA {
  269. NSSortDescriptor * sortDes = [NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:NO];
  270. NSArray *sortResult = [reloadA sortedArrayUsingDescriptors:@[sortDes]];
  271. NSMutableArray *m_group_array = [NSMutableArray array];
  272. NSMutableArray *m_c2c_array = [NSMutableArray array];
  273. for (TConversationCellData *sortData in sortResult) {
  274. if(sortData.convType == TConv_Type_Group){
  275. [m_group_array addObject:sortData];
  276. }else if (sortData.convType == TConv_Type_C2C){
  277. NSString *imName = sortData.convId;
  278. if ([imName isEqual:@"dsp_admin_1"]) {
  279. //
  280. conver_admin1 = sortData;
  281. }else if ([imName isEqual:@"dsp_admin_2"]){
  282. //
  283. conver_admin2 = sortData;
  284. }else if ([imName isEqual:@"dsp_fans"]) {
  285. //粉丝
  286. _conversation_fans = sortData;
  287. }else if ([imName isEqual:@"dsp_like"]){
  288. //赞
  289. _conversation_zan = sortData;
  290. }else if ([imName isEqual:@"dsp_at"]){
  291. //@
  292. _conversation_at = sortData;
  293. }else if ([imName isEqual:@"dsp_comment"]){
  294. //评论
  295. _conversation_comment = sortData;
  296. }else if ([imName isEqual:@"dsp_admin_control"]){
  297. //风控管理员
  298. _conversation_ctr = sortData;
  299. }else if ([imName isEqual:@"goodsorder_admin"]){
  300. //订单管理员【未要求具体排序这里add即可】
  301. _conversation_goodsorder = sortData;
  302. }else if([imName containsString:@"dsp_user_"]){
  303. // dsp_user_live 【用于推送】
  304. }else if ([imName isEqual:_liveUid]){
  305. // 主播
  306. _conversation_hostid = sortData;
  307. }
  308. else{
  309. [m_c2c_array addObject:sortData];
  310. }
  311. }
  312. }
  313. // 检查dsp_admin_2 、主播是否缺失
  314. if (!conver_admin2) {
  315. conver_admin2 = [[YBImManager shareInstance] createEmptyCellDataWithId:@"dsp_admin_2"];
  316. }
  317. if (!_conversation_hostid && ![_liveUid isEqual:[Config getOwnID]]) {
  318. _conversation_hostid = [[YBImManager shareInstance] createEmptyCellDataWithId:_liveUid];
  319. }
  320. // 风控未读叠加到系统消息
  321. if (_conversation_ctr) {
  322. conver_admin2.unRead += _conversation_ctr.unRead;
  323. }
  324. [m_c2c_array insertObject:_conversation_hostid atIndex:0];
  325. [m_c2c_array insertObject:conver_admin2 atIndex:0];
  326. [self requestUserMessage:[m_c2c_array mutableCopy]];
  327. }
  328. - (void)requestUserMessage:(NSArray *)msgArray{
  329. NSString *uids = @"";
  330. for (TConversationCellData *data in msgArray) {
  331. uids = [uids stringByAppendingFormat:@"%@,",data.convId];
  332. }
  333. if (uids.length > 0) {
  334. //去掉最后一个逗号
  335. uids = [uids substringToIndex:[uids length] - 1];
  336. }
  337. NSMutableArray *m_array = [NSMutableArray array];
  338. [YBNetworking postWithUrl:[NSString stringWithFormat:@"User.getMultiInfo&uids=%@",uids] Dic:@{} Suc:^(int code, id info, NSString *msg) {
  339. if (code == 0) {
  340. for (int i = 0; i < [info count]; i ++) {
  341. NSDictionary *plantSubDic = info[i];
  342. for (TConversationCellData *data in msgArray) {
  343. if ([data.convId isEqual:strFormat([plantSubDic valueForKey:@"id"])]) {
  344. [data updateUserInfo:plantSubDic];
  345. [m_array addObject:data];
  346. }
  347. }
  348. }
  349. _data = [NSArray arrayWithArray:m_array];
  350. [_tableView reloadData];
  351. }
  352. } Fail:^(id fail) {
  353. }];
  354. }
  355. #pragma mark - Table view data source
  356. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  357. return 1;
  358. }
  359. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  360. return _data.count;
  361. }
  362. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  363. return [TConversationCell getSize].height;
  364. }
  365. -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  366. return 0.0;
  367. }
  368. -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  369. return nil;
  370. }
  371. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
  372. return 0;
  373. }
  374. - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
  375. return nil;
  376. }
  377. - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{
  378. if (indexPath.row>1) {
  379. return YES;
  380. }
  381. return NO;
  382. }
  383. - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
  384. return UITableViewCellEditingStyleDelete;
  385. }
  386. - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
  387. return YZMsg(@"删除");
  388. }
  389. - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath{
  390. return NO;
  391. }
  392. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
  393. TConversationCellData *conv = _data[indexPath.row];
  394. NSMutableArray *new_a = [NSMutableArray arrayWithArray:_data];
  395. [new_a removeObjectAtIndex:indexPath.row];
  396. _data = [NSArray arrayWithArray:new_a];
  397. [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationNone];
  398. [[YBImManager shareInstance]clearUnreadConvId:conv.convId sendNot:YES];
  399. NSString *userid = [NSString stringWithFormat:@"c2c_%@",conv.convId];
  400. [[V2TIMManager sharedInstance] deleteConversation:userid succ:^{
  401. NSLog(@"success");
  402. } fail:^(int code, NSString *desc) {
  403. NSLog(@"failure, code:%d, desc:%@", code, desc);
  404. }];
  405. // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  406. // [[NSNotificationCenter defaultCenter] postNotificationName:TUIKitNotification_TIMCancelunread object:nil];
  407. // });
  408. }
  409. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  410. [tableView deselectRowAtIndexPath:indexPath animated:NO];
  411. TConversationCellData *conversation = [_data objectAtIndex:indexPath.row];
  412. [self goChatWithC2CWithConv:conversation];
  413. }
  414. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  415. TConversationCell *cell = [tableView dequeueReusableCellWithIdentifier:TConversationCell_ReuseId];
  416. if(!cell){
  417. cell = [[TConversationCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TConversationCell_ReuseId];
  418. }
  419. TConversationCellData *celldata =[_data objectAtIndex:indexPath.row];
  420. // 改变UI
  421. [cell imsmallViewResetUI];
  422. [cell setData:celldata];
  423. [cell checkImRecordWithHostid:_liveUid];
  424. return cell;
  425. }
  426. - (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller {
  427. return UIModalPresentationNone;
  428. }
  429. #pragma mark - IM列表结束
  430. #pragma mark - IM C2C 开始
  431. -(void)goChatWithC2CWithConv:(TConversationCellData *)conversation {
  432. [self destroyVCView];
  433. // 改变标题
  434. [self changeTopDesWithData:conversation];
  435. [[YBImManager shareInstance] clearUnreadConvId:conversation.convId sendNot:YES];
  436. if ([conversation.convId isEqual:@"dsp_admin_1"]||[conversation.convId isEqual:@"dsp_admin_2"]) {
  437. if ([conversation.convId isEqual:@"dsp_admin_2"]) {
  438. [[YBImManager shareInstance] clearUnreadConvId:_conversation_ctr.convId sendNot:NO];
  439. }
  440. NSMutableDictionary *dic = [NSMutableDictionary dictionary];
  441. [dic setObject:conversation.userHeader forKey:@"avatar"];
  442. [dic setObject:conversation.convId forKey:@"id"];
  443. [dic setObject:conversation.userName forKey:@"user_nickname"];
  444. //[dic setObject:conversation.lastConv forKey:@"conversation"];
  445. MessageListModel *model = [MessageListModel modelWithDic:dic];
  446. [_c2cBgView addSubview:[self c2cSysView]];
  447. _c2cSysVC.view.frame = CGRectMake(0, 0, _window_width, _smallViewHeight);
  448. _c2cSysVC.listModel = model;
  449. [_c2cSysVC imSmallViewReload];
  450. }
  451. else{
  452. [_c2cBgView addSubview:[self c2cChatView]];
  453. _c2cChatVC.view.frame = CGRectMake(0, 0, _window_width, _smallViewHeight);
  454. _c2cChatVC.conversation = conversation;
  455. [_c2cChatVC imSmallViewReload];
  456. }
  457. }
  458. -(void)destroyVCView {
  459. if (_c2cSysVC) {
  460. [_c2cSysVC.view removeFromSuperview];
  461. _c2cSysVC = nil;
  462. }
  463. if (_c2cChatVC) {
  464. [_c2cChatVC.view removeFromSuperview];
  465. _c2cChatVC = nil;
  466. }
  467. }
  468. - (UIView *)c2cBgView{
  469. if (!_c2cBgView) {
  470. _c2cBgView = [[UIView alloc]init];
  471. _c2cBgView.backgroundColor = UIColor.whiteColor;
  472. _c2cBgView.hidden = YES;
  473. }
  474. return _c2cBgView;
  475. }
  476. - (UIView *)c2cSysView {
  477. if (!_c2cSysVC) {
  478. _c2cSysVC = [[MsgSysVC alloc]init];
  479. _c2cSysVC.uiFrom = UiFrom_Samll;
  480. _c2cSysVC.isWhiteStyle = YES;
  481. }
  482. return _c2cSysVC.view;
  483. }
  484. - (UIView *)c2cChatView{
  485. if (!_c2cChatVC) {
  486. _c2cChatVC = [[TChatC2CController alloc]init];
  487. _c2cChatVC.uiFrom = UiFrom_Samll;
  488. }
  489. return _c2cChatVC.view;
  490. }
  491. #pragma mark - IM C2C 结束
  492. @end