JXMsgViewController.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. //
  2. // JXMsgViewController.h
  3. //
  4. // Created by flyeagleTang on 14-4-3.
  5. // Copyright (c) 2014年 Reese. All rights reserved.
  6. //
  7. #import "JXTableViewController.h"
  8. #import <UIKit/UIKit.h>
  9. #import "JXMessageTableVc.h"
  10. #import "JXXMMainVc.h"
  11. #import "JXMyModel.h"
  12. #import <AVFoundation/AVFoundation.h>
  13. #import "SimpleAudioPlayer.h"
  14. /// <#Description#>
  15. @interface JXMsgViewController : JXMessageTableVc <UIScrollViewDelegate>{
  16. // NSMutableArray *_array;
  17. int _refreshCount;
  18. int _recordCount;
  19. float lastContentOffset;
  20. int upOrDown;
  21. JXAudioPlayer* _audioPlayer;
  22. JXRoomObject *_chatRoom;
  23. roomData* _room;
  24. }
  25. @property(nonatomic,assign) int msgTotal;
  26. @property (nonatomic, strong) NSMutableArray *array;
  27. @property (nonatomic,copy)NSNumber *groupStatus; //客服信息
  28. @property (nonatomic, strong) JXUserObject *chatPerson;
  29. @property (nonatomic, strong) UIView *backView;
  30. @property (nonatomic,copy)NSArray *customerArr; //客服信息
  31. @property (nonatomic,weak) UILabel *titleLb;
  32. - (void)cancelBtnAction;
  33. - (void)getTotalNewMsgCount;
  34. @property (nonatomic,strong) AVPlayer *palyer;
  35. @property (nonatomic,assign) NSInteger reciveScrollViewIndex;
  36. @property (nonatomic,strong) NSMutableArray *dataArrOneOne;
  37. //记录收到的新消息
  38. @property (nonatomic,assign) int reciveNewMessage2222;
  39. @property (nonatomic,assign) int reciveNewMessage;
  40. @property (nonatomic,strong) NSDictionary *dictMsag;
  41. @property (nonatomic,strong) AVAudioPlayer *player;
  42. @end
  43. /*
  44. if( [aDownload.action isEqualToString:act_getGroupOneType] ){
  45. _indexNums++;
  46. [_tempGoundArr addObject:dict];
  47. if (_reciveNewMessage2222==100) {
  48. _dataArrOneOne=_tempGoundArr;
  49. [[NSUserDefaults standardUserDefaults] setObject:_indexGoundArr forKey:@"groundType"];
  50. [[NSUserDefaults standardUserDefaults] synchronize];
  51. [_table reloadData];
  52. }else{
  53. if (_indexNums==_array.count) {
  54. _indexGoundArr=_tempGoundArr;
  55. [[NSUserDefaults standardUserDefaults] setObject:_indexGoundArr forKey:@"groundType"];
  56. [[NSUserDefaults standardUserDefaults] synchronize];
  57. [_table reloadData];
  58. return;
  59. }else{
  60. [_indexGoundArr removeAllObjects];
  61. }
  62. }
  63. //[_tempGoundArr removeAllObjects];
  64. JXCell* cell = [_table cellForRowAtIndexPath:[NSIndexPath indexPathForRow:_reciveScrollViewIndex inSection:0]];
  65. if (dict[@"data"]==nil) {
  66. cell.chujiIMG.image=[UIImage imageNamed:dict[@"typeName"]];
  67. }else{
  68. // cell.chujiIMG.image=[UIImage imageNamed:@""];
  69. }
  70. [_array enumerateObjectsUsingBlock:^(JXMsgAndUserObject *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  71. JXCell* cell = [_table cellForRowAtIndexPath:[NSIndexPath indexPathForRow:idx inSection:1]];
  72. if (dict[@"data"]==nil) {
  73. cell.chujiIMG.image=[UIImage imageNamed:@""];
  74. }else{
  75. if ([dict[@"data"][@"typeName"] isEqualToString:@"普通群"]) {
  76. cell.chujiIMG.image=[UIImage imageNamed:@"msgChuji"];
  77. }if ([dict[@"data"][@"typeName"] isEqualToString:@"msgzhongji"]) {
  78. cell.chujiIMG.image=[UIImage imageNamed:@"msgChuji"];
  79. }if ([dict[@"data"][@"typeName"] isEqualToString:@"高级群"]) {
  80. cell.chujiIMG.image=[UIImage imageNamed:@"msgGaoji"];
  81. }if ([dict[@"data"][@"typeName"] isEqualToString:@"特级群"]) {
  82. cell.chujiIMG.image=[UIImage imageNamed:@"msgTeji"];
  83. }
  84. }
  85. if ([obj.message.fromUserId isEqualToString:@""]) {
  86. }
  87. }];
  88. }
  89. */
  90. //- (void)getLastChatList {
  91. //
  92. // BOOL isFirstSync = [g_default boolForKey:kISFirstGetLastChatList];
  93. //
  94. // long long syncTimeLen;
  95. //
  96. // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  97. //
  98. //
  99. // [self.header endRefreshing];
  100. // });
  101. //
  102. // if (!isFirstSync) {
  103. //// if ([g_myself.chatSyncTimeLen longLongValue] > [g_myself.groupChatSyncTimeLen longLongValue]) {
  104. // syncTimeLen = [g_myself.chatSyncTimeLen longLongValue];
  105. //// }else {
  106. //// syncTimeLen = [g_myself.groupChatSyncTimeLen longLongValue];
  107. //// }
  108. //
  109. // double m = syncTimeLen * 24 * 3600 * 1000;
  110. // syncTimeLen = [[NSDate date] timeIntervalSince1970] * 1000.0 - m;
  111. //
  112. // if ([g_myself.chatSyncTimeLen longLongValue] == 0 || [g_myself.chatSyncTimeLen longLongValue] == -1) {
  113. // syncTimeLen = 0;
  114. // }
  115. //
  116. //
  117. // }else {
  118. // syncTimeLen = g_server.lastOfflineTime * 1000.0;
  119. // }
  120. //
  121. // NSMutableArray* p = [[JXMessageObject sharedInstance] fetchRecentChat];
  122. // _array=p;
  123. // [_table reloadData];
  124. //
  125. //// if ([g_myself.chatSyncTimeLen longLongValue] == -2) {
  126. ////
  127. //// [g_xmpp.roomPool createAll];
  128. //
  129. //// }else {//修改了 去掉最后一条消息
  130. //// [g_server getLastChatListStartTime:@1592203493000 toView:self];
  131. // [g_server getLastChatListStartTime:[NSNumber numberWithLong:syncTimeLen] toView:self];
  132. // [self getAllChatList];
  133. //// }
  134. //
  135. //}
  136. //viewdidapper
  137. // NSMutableArray* p = [[JXMessageObject sharedInstance] fetchRecentChat];
  138. //
  139. // [_array addObjectsFromArray:p];
  140. // [_table reloadData];
  141. // [UIView animateWithDuration:0.4 animations:^{
  142. // self.view.frame = CGRectMake(0, 0, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT);
  143. // }];_reciveNewMessage
  144. // [_array enumerateObjectsUsingBlock:^(JXMsgAndUserObject *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  145. // _reciveNewMessage2222=0;
  146. // NSLog(@".message.isGroup %d",obj.message.isGroup);
  147. //
  148. // JXMessageObject *msgUse=obj.message;
  149. // long time = (long)[[NSDate date] timeIntervalSince1970];
  150. // time = (time *1000 + g_server.timeDifference);
  151. // NSString *salt = [NSString stringWithFormat:@"%ld", time];
  152. //// [g_server Useract_getGroupOneType:salt jid:msgUse.fromUserId andToView:self];
  153. //
  154. // // [g_server getact_act_act_getGroupListType:salt andToView:self];
  155. //
  156. //
  157. // }];