TCShowLiveMessageView.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // TCShowLiveMessageView.h
  3. // TCShow
  4. //
  5. // Created by AlexiChen on 16/4/14.
  6. // Copyright © 2016年 AlexiChen. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "MLEmojiLabel.h"
  10. #import "AVIMCache.h"
  11. @class TCShowLiveMsgTableViewCell;
  12. @protocol TCShowLiveMsgTableViewCellDelegate <NSObject>
  13. @required
  14. //点击消息列表中的用户名称
  15. - (void)clickCellNameRange:(TCShowLiveMsgTableViewCell *) cell;
  16. //点击消息列表中的具体消息内容(目前会响应点击事件的是:红包)
  17. - (void)clickCellMessageRange:(TCShowLiveMsgTableViewCell *) cell;
  18. //@optional
  19. - (void)clickCellUserInfo:(TCShowLiveMsgTableViewCell *) cell;
  20. @end
  21. @protocol TCShowLiveMessageViewDelegate <NSObject>
  22. @required
  23. //点击消息列表中的用户名称
  24. - (void)clickNameRange:(CustomMessageModel *) customMessageModel;
  25. //点击消息列表中的具体消息内容(目前会响应点击事件的是:红包)
  26. - (void)clickMessageRange:(CustomMessageModel *) customMessageModel;
  27. - (void)clickUserInfo:(cuserModel *)cuser;
  28. - (void)clickGoodsMessage:(CustomMessageModel *) customMessageModel;
  29. @end
  30. @interface TCShowLiveMsgTableViewCell : UITableViewCell<MLEmojiLabelDelegate>
  31. {
  32. UIView *_msgBack; // 消息背景
  33. UIImageView *_msgBgImgView; // 等级图标
  34. UIImageView *_rankImgView; // 等级图标
  35. NSString *_type; // 类型
  36. UIImageView *_vipView;
  37. UIImageView *_stealthView;//隐身
  38. UIImageView *_guardianView;//守护
  39. // UIImageView *_guardianBGView;//守护
  40. UIImageView *_nobleVipView;//贵族
  41. }
  42. @property (nonatomic, weak) id<TCShowLiveMsgTableViewCellDelegate> delegate;
  43. @property (nonatomic, strong) UILabel *msgLabel; // 消息显示标签
  44. @property (nonatomic, strong) UIFont *myFont;
  45. @property (nonatomic, strong) CustomMessageModel *customMessageModel;
  46. @property (nonatomic, strong) cuserModel *cuser;
  47. @property(nonatomic, assign) NSInteger imageCount;
  48. - (void)config:(CustomMessageModel *)item block:(FWVoidBlock)block;
  49. @end
  50. @interface TCShowLiveMessageView : UIView<UITableViewDataSource, UITableViewDelegate,TCShowLiveMsgTableViewCellDelegate>
  51. {
  52. @protected
  53. UITableView *_tableView; // 消息列表
  54. NSInteger _msgCount; // 统计点评的赞数
  55. BOOL _canScrollToBottom; // 当前可以滑动到底部
  56. float _lastContentOffset; // tableview当前内容位置
  57. int _testIndex;
  58. }
  59. @property (nonatomic, weak) id<TCShowLiveMessageViewDelegate>delegate;
  60. // 位置定时器
  61. @property (nonatomic, strong) NSTimer *contentOffsetTimer;
  62. // 消息数量,评论数
  63. @property (nonatomic, readonly) NSInteger msgCount;
  64. // 首次进入某个直播间显示聊天列表中的规则等(后台有设置并且为YES的时候会显示)
  65. @property (nonatomic, assign) BOOL isNeedShowRule;
  66. @property(nonatomic, strong) NSMutableArray *liveMessages; // 缓存的消息数量
  67. - (void)insertMsg:(id<AVIMMsgAble>)msg;
  68. // 延迟显示
  69. - (void)insertCachedMsg:(AVIMCache *)msgCache;
  70. @end