|
@@ -252,121 +252,81 @@ static int kConversation_AtAll = 2;
|
|
|
|
|
|
-(void)initCollectionData{
|
|
|
[self.collectionDataSource removeAllObjects];
|
|
|
- for (int i = 0;i < 4; i++) {
|
|
|
- MoreAppInfoModel *model = [[MoreAppInfoModel alloc] init];
|
|
|
- switch (i) {
|
|
|
- case 0:{
|
|
|
- model.title = @"通知";
|
|
|
- model.imgName = @"chatmsg_tz_icon";
|
|
|
- model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
- model.type = ChatMenuNoticeType;
|
|
|
- model.readNum = 0;
|
|
|
- model.showEditFlag = NO;
|
|
|
- }break;
|
|
|
- case 1:{
|
|
|
- model.title = @"站内信";
|
|
|
- model.imgName = @"chatmsg_znx_icon";
|
|
|
- model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
- model.type = ChatMenuZhanXinType;
|
|
|
- model.readNum = 0;
|
|
|
- model.showEditFlag = YES;
|
|
|
- }break;
|
|
|
- case 2:{
|
|
|
- model.title = @"话题";
|
|
|
- model.imgName = @"chatmsg_ht_icon";
|
|
|
- model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
- model.type = ChatMenutopicType;
|
|
|
- model.readNum = 0;
|
|
|
- model.showEditFlag = YES;
|
|
|
- }break;
|
|
|
- case 3:{
|
|
|
- model.title = @"通讯录";
|
|
|
- model.imgName = @"chatmsg_txl_icon";
|
|
|
- model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
- model.type = ChatMenuTeleListType;
|
|
|
- model.readNum = 0;
|
|
|
- model.showEditFlag = YES;
|
|
|
- }break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ id chatMenuDict = [[NSUserDefaults standardUserDefaults] objectForKey:CHATMENUBAR];
|
|
|
+ NSMutableArray * commonArray = [NSMutableArray array];
|
|
|
+ NSMutableArray * moreArray = [NSMutableArray array];
|
|
|
+ NSMutableArray * array = [NSMutableArray array];
|
|
|
+ if (![chatMenuDict isKindOfClass:[NSDictionary class]]) {
|
|
|
+ for (int i= 0;i < 5; i++) {
|
|
|
+ MoreAppInfoModel *model = [[MoreAppInfoModel alloc] init];
|
|
|
+ switch (i) {
|
|
|
+ case 0:{
|
|
|
+ model.title = @"通知";
|
|
|
+ model.imgName = @"chatmsg_tz_icon";
|
|
|
+ model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
+ model.type = ChatMenuNoticeType;
|
|
|
+ model.readNum = 0;
|
|
|
+ model.showEditFlag = NO;
|
|
|
+ }break;
|
|
|
+ case 1:{
|
|
|
+ model.title = @"站内信";
|
|
|
+ model.imgName = @"chatmsg_znx_icon";
|
|
|
+ model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
+ model.type = ChatMenuZhanXinType;
|
|
|
+ model.readNum = 0;
|
|
|
+ model.showEditFlag = YES;
|
|
|
+ }break;
|
|
|
+ case 2:{
|
|
|
+ model.title = @"通讯录";
|
|
|
+ model.imgName = @"chatmsg_txl_icon";
|
|
|
+ model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
+ model.type = ChatMenuTeleListType;
|
|
|
+ model.readNum = 0;
|
|
|
+ model.showEditFlag = YES;
|
|
|
+ }break;
|
|
|
+ case 3:{
|
|
|
+ model.title = @"小组";
|
|
|
+ model.imgName = @"chatmsg_xiaozu_icon";
|
|
|
+ model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
+ model.type = ChatMenuGroupType;
|
|
|
+ model.readNum = 0;
|
|
|
+ model.showEditFlag = YES;
|
|
|
+ }break;
|
|
|
+ case 4:{
|
|
|
+ model.title = @"话题";
|
|
|
+ model.imgName = @"chatmsg_ht_icon";
|
|
|
+ model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
+ model.type = ChatMenutopicType;
|
|
|
+ model.readNum = 0;
|
|
|
+ model.showEditFlag = YES;
|
|
|
+ }break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ [array addObject:model];
|
|
|
+ NSDictionary *json = [model modelToJSONObject];
|
|
|
+ [commonArray addObject:json];
|
|
|
+ }
|
|
|
+ for (NSInteger j = 0; j < 1; j ++) {
|
|
|
+ MoreAppInfoModel *model = [[MoreAppInfoModel alloc] init];
|
|
|
+ model.title = @"待办事项";
|
|
|
+ model.imgName = @"chatmsg_dbsx_icon";
|
|
|
+ model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
+ model.type = ChatMenuWaitType;
|
|
|
+ model.readNum = 0;
|
|
|
+ model.showEditFlag = YES;
|
|
|
+ [moreArray addObject:[model modelToJSONObject]];
|
|
|
+ }
|
|
|
+ self.collectionDataSource = array;
|
|
|
+ [[NSUserDefaults standardUserDefaults] setObject:@{@"common":[NSArray arrayWithArray:commonArray],@"more":[NSArray arrayWithArray:moreArray]} forKey:CHATMENUBAR];
|
|
|
+ [[NSUserDefaults standardUserDefaults] synchronize];
|
|
|
+ }else{
|
|
|
+ NSArray * array = [chatMenuDict objectForKey:@"common"];
|
|
|
+ for (NSDictionary * dict in array) {
|
|
|
+ MoreAppInfoModel *model = [MoreAppInfoModel modelWithDictionary:dict];
|
|
|
+ [self.collectionDataSource addObject:model];
|
|
|
}
|
|
|
- [self.collectionDataSource addObject:model];
|
|
|
}
|
|
|
-// id chatMenuDict = [[NSUserDefaults standardUserDefaults] objectForKey:CHATMENUBAR];
|
|
|
-// NSMutableArray * commonArray = [NSMutableArray array];
|
|
|
-// NSMutableArray * moreArray = [NSMutableArray array];
|
|
|
-// NSMutableArray * array = [NSMutableArray array];
|
|
|
-// if (![chatMenuDict isKindOfClass:[NSDictionary class]]) {
|
|
|
-// for (int i=0;i < 5; i++) {
|
|
|
-// MoreAppInfoModel *model = [[MoreAppInfoModel alloc] init];
|
|
|
-// switch (i) {
|
|
|
-// case 0:{
|
|
|
-// model.title = @"通知";
|
|
|
-// model.imgName = @"chatmsg_tz_icon";
|
|
|
-// model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
-// model.type = ChatMenuNoticeType;
|
|
|
-// model.readNum = 0;
|
|
|
-// model.showEditFlag = NO;
|
|
|
-// }break;
|
|
|
-// case 1:{
|
|
|
-// model.title = @"站内信";
|
|
|
-// model.imgName = @"chatmsg_znx_icon";
|
|
|
-// model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
-// model.type = ChatMenuZhanXinType;
|
|
|
-// model.readNum = 0;
|
|
|
-// model.showEditFlag = YES;
|
|
|
-// }break;
|
|
|
-// case 2:{
|
|
|
-// model.title = @"通讯录";
|
|
|
-// model.imgName = @"chatmsg_txl_icon";
|
|
|
-// model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
-// model.type = ChatMenuTeleListType;
|
|
|
-// model.readNum = 0;
|
|
|
-// model.showEditFlag = YES;
|
|
|
-// }break;
|
|
|
-// case 3:{
|
|
|
-// model.title = @"小组";
|
|
|
-// model.imgName = @"chatmsg_xiaozu_icon";
|
|
|
-// model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
-// model.type = ChatMenuGroupType;
|
|
|
-// model.readNum = 0;
|
|
|
-// model.showEditFlag = YES;
|
|
|
-// }break;
|
|
|
-// case 4:{
|
|
|
-// model.title = @"话题";
|
|
|
-// model.imgName = @"chatmsg_ht_icon";
|
|
|
-// model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
-// model.type = ChatMenutopicType;
|
|
|
-// model.readNum = 0;
|
|
|
-// model.showEditFlag = YES;
|
|
|
-// }break;
|
|
|
-// default:
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// [array addObject:model];
|
|
|
-// NSDictionary *json = [model modelToJSONObject];
|
|
|
-// [commonArray addObject:json];
|
|
|
-// }
|
|
|
-// for (NSInteger j = 0; j < 1; j ++) {
|
|
|
-// MoreAppInfoModel *model = [[MoreAppInfoModel alloc] init];
|
|
|
-// model.title = @"待办事项";
|
|
|
-// model.imgName = @"chatmsg_dbsx_icon";
|
|
|
-// model.notImgName = @"chatmsg_tz_hui_icon";
|
|
|
-// model.type = ChatMenuWaitType;
|
|
|
-// model.readNum = 0;
|
|
|
-// model.showEditFlag = YES;
|
|
|
-// [moreArray addObject:[model modelToJSONObject]];
|
|
|
-// }
|
|
|
-// self.collectionDataSource = array;
|
|
|
-// [[NSUserDefaults standardUserDefaults] setObject:@{@"common":[NSArray arrayWithArray:commonArray],@"more":[NSArray arrayWithArray:moreArray]} forKey:CHATMENUBAR];
|
|
|
-// [[NSUserDefaults standardUserDefaults] synchronize];
|
|
|
-// }else{
|
|
|
-// NSArray * array = [chatMenuDict objectForKey:@"common"];
|
|
|
-// for (NSDictionary * dict in array) {
|
|
|
-// MoreAppInfoModel *model = [MoreAppInfoModel modelWithDictionary:dict];
|
|
|
-// [self.collectionDataSource addObject:model];
|
|
|
-// }
|
|
|
-// }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -754,9 +714,9 @@ static int kConversation_AtAll = 2;
|
|
|
case 1:{
|
|
|
ChatMsgListCell *cell = [ChatMsgListCell configCell1:tableView indexPath:indexPath];
|
|
|
[cell.cell1ContentBgView addSubview:self.collectionView];
|
|
|
- self.collectionView.frame = CGRectMake(0, 0, SCREEN_WIDTH, cell.cell1ContentBgView.height);
|
|
|
+// self.collectionView.frame = CGRectMake(0, 0, SCREEN_WIDTH, cell.cell1ContentBgView.height);
|
|
|
|
|
|
-// self.collectionView.frame = CGRectMake(0, 0, (SCREEN_WIDTH - 15 - 7), cell.cell1ContentBgView.height);
|
|
|
+ self.collectionView.frame = CGRectMake(0, 0, (SCREEN_WIDTH - 15 - 7), cell.cell1ContentBgView.height);
|
|
|
[self.collectionView reloadData];
|
|
|
if(self.operationStateEnum == OperationStateEnum0){
|
|
|
WS(weakSelf);
|
|
@@ -923,8 +883,8 @@ static int kConversation_AtAll = 2;
|
|
|
}];
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
[weakSelf.tableView reloadData];
|
|
|
- NSInteger count = (weakSelf.countUnredNum + weakSelf.noticeNum + weakSelf.missiveNum);
|
|
|
-// NSInteger count = (weakSelf.countUnredNum + weakSelf.noticeNum + weakSelf.missiveNum + weakSelf.waitNum);
|
|
|
+// NSInteger count = (weakSelf.countUnredNum + weakSelf.noticeNum + weakSelf.missiveNum);
|
|
|
+ NSInteger count = (weakSelf.countUnredNum + weakSelf.noticeNum + weakSelf.missiveNum + weakSelf.waitNum);
|
|
|
weakSelf.tabBarController.tabBar.items[2].badgeValue = count > 0 ? [NSString stringWithFormat:@"%ld",(long)count] : nil;
|
|
|
});
|
|
|
}
|
|
@@ -1130,9 +1090,9 @@ static int kConversation_AtAll = 2;
|
|
|
/****************************************************/
|
|
|
- (CGSize)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
|
|
|
{
|
|
|
- CGFloat width = SCREEN_WIDTH / 4;
|
|
|
+// CGFloat width = SCREEN_WIDTH / 4;
|
|
|
|
|
|
-// CGFloat width = (SCREEN_WIDTH - (15 + 7)) / 5;
|
|
|
+ CGFloat width = (SCREEN_WIDTH - (15 + 7)) / 5;
|
|
|
CGFloat height = 90;
|
|
|
return CGSizeMake(width, height);
|
|
|
}
|