123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- //
- // JXMsgViewController.h
- //
- // Created by flyeagleTang on 14-4-3.
- // Copyright (c) 2014年 Reese. All rights reserved.
- //
- #import "JXTableViewController.h"
- #import <UIKit/UIKit.h>
- #import "JXMessageTableVc.h"
- #import "JXXMMainVc.h"
- #import "JXMyModel.h"
- #import <AVFoundation/AVFoundation.h>
- #import "SimpleAudioPlayer.h"
- /// <#Description#>
- @interface JXMsgViewController : JXMessageTableVc <UIScrollViewDelegate>{
- // NSMutableArray *_array;
- int _refreshCount;
- int _recordCount;
- float lastContentOffset;
- int upOrDown;
- JXAudioPlayer* _audioPlayer;
- JXRoomObject *_chatRoom;
- roomData* _room;
- }
- @property(nonatomic,assign) int msgTotal;
- @property (nonatomic, strong) NSMutableArray *array;
- @property (nonatomic, strong) UIView *backView;
- @property (nonatomic,copy)NSArray *customerArr; //客服信息
- @property (nonatomic,weak) UILabel *titleLb;
- - (void)cancelBtnAction;
- - (void)getTotalNewMsgCount;
- @property (nonatomic,strong) AVPlayer *palyer;
- @property (nonatomic,assign) NSInteger reciveScrollViewIndex;
- @property (nonatomic,strong) NSMutableArray *dataArrOneOne;
- //记录收到的新消息
- @property (nonatomic,assign) int reciveNewMessage2222;
- @property (nonatomic,assign) int reciveNewMessage;
- @property (nonatomic,strong) NSDictionary *dictMsag;
- @property (nonatomic,strong) AVAudioPlayer *player;
- @end
-
- /*
- if( [aDownload.action isEqualToString:act_getGroupOneType] ){
- _indexNums++;
- [_tempGoundArr addObject:dict];
-
- if (_reciveNewMessage2222==100) {
- _dataArrOneOne=_tempGoundArr;
- [[NSUserDefaults standardUserDefaults] setObject:_indexGoundArr forKey:@"groundType"];
- [[NSUserDefaults standardUserDefaults] synchronize];
-
- [_table reloadData];
- }else{
-
- if (_indexNums==_array.count) {
- _indexGoundArr=_tempGoundArr;
-
- [[NSUserDefaults standardUserDefaults] setObject:_indexGoundArr forKey:@"groundType"];
- [[NSUserDefaults standardUserDefaults] synchronize];
-
- [_table reloadData];
- return;
- }else{
- [_indexGoundArr removeAllObjects];
- }
- }
-
- //[_tempGoundArr removeAllObjects];
-
-
-
- JXCell* cell = [_table cellForRowAtIndexPath:[NSIndexPath indexPathForRow:_reciveScrollViewIndex inSection:0]];
-
- if (dict[@"data"]==nil) {
- cell.chujiIMG.image=[UIImage imageNamed:dict[@"typeName"]];
- }else{
- // cell.chujiIMG.image=[UIImage imageNamed:@""];
- }
- [_array enumerateObjectsUsingBlock:^(JXMsgAndUserObject *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
- JXCell* cell = [_table cellForRowAtIndexPath:[NSIndexPath indexPathForRow:idx inSection:1]];
-
- if (dict[@"data"]==nil) {
- cell.chujiIMG.image=[UIImage imageNamed:@""];
- }else{
-
- if ([dict[@"data"][@"typeName"] isEqualToString:@"普通群"]) {
- cell.chujiIMG.image=[UIImage imageNamed:@"msgChuji"];
- }if ([dict[@"data"][@"typeName"] isEqualToString:@"msgzhongji"]) {
- cell.chujiIMG.image=[UIImage imageNamed:@"msgChuji"];
-
- }if ([dict[@"data"][@"typeName"] isEqualToString:@"高级群"]) {
- cell.chujiIMG.image=[UIImage imageNamed:@"msgGaoji"];
-
- }if ([dict[@"data"][@"typeName"] isEqualToString:@"特级群"]) {
- cell.chujiIMG.image=[UIImage imageNamed:@"msgTeji"];
-
- }
-
- }
- if ([obj.message.fromUserId isEqualToString:@""]) {
-
- }
-
- }];
-
- }
- */
- //- (void)getLastChatList {
- //
- // BOOL isFirstSync = [g_default boolForKey:kISFirstGetLastChatList];
- //
- // long long syncTimeLen;
- //
- // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- //
- //
- // [self.header endRefreshing];
- // });
- //
- // if (!isFirstSync) {
- //// if ([g_myself.chatSyncTimeLen longLongValue] > [g_myself.groupChatSyncTimeLen longLongValue]) {
- // syncTimeLen = [g_myself.chatSyncTimeLen longLongValue];
- //// }else {
- //// syncTimeLen = [g_myself.groupChatSyncTimeLen longLongValue];
- //// }
- //
- // double m = syncTimeLen * 24 * 3600 * 1000;
- // syncTimeLen = [[NSDate date] timeIntervalSince1970] * 1000.0 - m;
- //
- // if ([g_myself.chatSyncTimeLen longLongValue] == 0 || [g_myself.chatSyncTimeLen longLongValue] == -1) {
- // syncTimeLen = 0;
- // }
- //
- //
- // }else {
- // syncTimeLen = g_server.lastOfflineTime * 1000.0;
- // }
- //
- // NSMutableArray* p = [[JXMessageObject sharedInstance] fetchRecentChat];
- // _array=p;
- // [_table reloadData];
- //
- //// if ([g_myself.chatSyncTimeLen longLongValue] == -2) {
- ////
- //// [g_xmpp.roomPool createAll];
- //
- //// }else {//修改了 去掉最后一条消息
- //// [g_server getLastChatListStartTime:@1592203493000 toView:self];
- // [g_server getLastChatListStartTime:[NSNumber numberWithLong:syncTimeLen] toView:self];
- // [self getAllChatList];
- //// }
- //
- //}
- //viewdidapper
- // NSMutableArray* p = [[JXMessageObject sharedInstance] fetchRecentChat];
- //
- // [_array addObjectsFromArray:p];
- // [_table reloadData];
-
- // [UIView animateWithDuration:0.4 animations:^{
- // self.view.frame = CGRectMake(0, 0, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT);
- // }];_reciveNewMessage
-
- // [_array enumerateObjectsUsingBlock:^(JXMsgAndUserObject *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
- // _reciveNewMessage2222=0;
- // NSLog(@".message.isGroup %d",obj.message.isGroup);
- //
- // JXMessageObject *msgUse=obj.message;
- // long time = (long)[[NSDate date] timeIntervalSince1970];
- // time = (time *1000 + g_server.timeDifference);
- // NSString *salt = [NSString stringWithFormat:@"%ld", time];
- //// [g_server Useract_getGroupOneType:salt jid:msgUse.fromUserId andToView:self];
- //
- // // [g_server getact_act_act_getGroupListType:salt andToView:self];
- //
- //
- // }];
|