1、变更推送为阿里云推,清除云信IM以及推送内容;
2、消息页面全新改版; 3、部分微小Bug修复
This commit is contained in:
@@ -11,8 +11,6 @@
|
||||
#import "TabBarDeviceShouYeCell.h"
|
||||
#import "DXPopover.h"
|
||||
#import "LXPopView.h"
|
||||
//#import "SelectDeviceViewController.h"
|
||||
//#import "IfishSelectCardViewController.h"
|
||||
#import "IfishBindDeviceSelectViewController.h"
|
||||
#import "IfishDataUnity.h"
|
||||
#import "IfishP2PMonitorController.h"
|
||||
@@ -40,10 +38,10 @@
|
||||
#import <AlibcTradeSDK/AlibcTradeSDK.h>
|
||||
#import "IfishAlibcWebViewController.h"
|
||||
#import "MBProgressHUD.h"
|
||||
#import "NTESSessionListViewController.h"
|
||||
#import "RunSunChangeNameViewController.h"
|
||||
|
||||
@interface IfishDeviceViewController ()<UITableViewDelegate,UITableViewDataSource,LxPopViewDelegate,ShopTtemListDelegate,NIMSystemNotificationManagerDelegate,NIMConversationManagerDelegate>
|
||||
#import "IfishMessageViewController.h"
|
||||
#import "PushMessageModel.h"
|
||||
@interface IfishDeviceViewController ()<UITableViewDelegate,UITableViewDataSource,LxPopViewDelegate,ShopTtemListDelegate>
|
||||
|
||||
@property(nonatomic,strong)UITableView *tableView;
|
||||
|
||||
@@ -79,6 +77,7 @@
|
||||
@property (nonatomic,strong) MBProgressHUD *progressHud;
|
||||
@property (nonatomic,strong) UILabel *mesglabel;
|
||||
@property(nonatomic,assign)NSInteger curDeviceIdx;
|
||||
Assign NSInteger messageCount;//消息个数
|
||||
//@property (nonatomic,strong) UIView *redView;
|
||||
@end
|
||||
|
||||
@@ -87,6 +86,7 @@
|
||||
- (void)viewDidLoad {
|
||||
|
||||
[super viewDidLoad];
|
||||
self.messageCount = 0;
|
||||
// Do any additional setup after loading the view.
|
||||
//self.view.backgroundColor = [];
|
||||
_adViewData = [[NSMutableArray alloc] init];
|
||||
@@ -98,8 +98,6 @@
|
||||
[self initUI];
|
||||
[self showProgress];
|
||||
[self addDataRequestQueue];
|
||||
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
|
||||
[[NIMSDK sharedSDK].conversationManager addDelegate:self];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deleteCurDevice) name:@"DeleteCurDevice" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateDevice) name:@"updateDevice" object:nil];
|
||||
}
|
||||
@@ -120,6 +118,7 @@
|
||||
//dispatch_queue_t queue = dispatch_queue_create("com.privateQueue",NULL);
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self getMessageData];
|
||||
[self getMoreUserData];
|
||||
[self initBannerData];
|
||||
[self loadGoodsData];
|
||||
@@ -138,6 +137,37 @@
|
||||
}
|
||||
|
||||
|
||||
-(void)getMessageData{
|
||||
|
||||
NSDictionary *resalutDic = [CommonUtils getCacheDataWithKey:Cache_Message];
|
||||
NSString *pushId = @"";
|
||||
if (resalutDic==nil) {
|
||||
pushId = @"";
|
||||
}else{
|
||||
NSArray *dataArray = [resalutDic objectForKey:@"data"];
|
||||
PushmessageModel *model = [PushmessageModel yy_modelWithJSON:dataArray.firstObject];
|
||||
pushId = model.pushId;
|
||||
}
|
||||
UserModel*userModel=[dataContorl getUserInfo];
|
||||
NSDictionary *reqDic = @{@"pushId":pushId,
|
||||
@"userId":userModel.userId,
|
||||
@"firstResult":@(0),
|
||||
@"pageSize":@(999)
|
||||
};
|
||||
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Url params:reqDic success:^(NSDictionary *successDic) {
|
||||
|
||||
NSString *totalCount = [successDic objectForKey:@"total"];
|
||||
if ([totalCount integerValue]>0) {
|
||||
//有新消息
|
||||
self.messageCount = [totalCount integerValue];
|
||||
[self setRedViewData];
|
||||
}else{
|
||||
}
|
||||
|
||||
} failure:^(NSDictionary *errorDic) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - 首页广告位
|
||||
|
||||
-(void)initBannerData{
|
||||
@@ -150,7 +180,7 @@
|
||||
NSArray *data= reDic[@"data"];
|
||||
for (NSDictionary *dic in data) {
|
||||
IfishBannerData *bannerdata = [[IfishBannerData alloc] initWithDict:dic];
|
||||
[_adViewData addObject:bannerdata];
|
||||
[self.adViewData addObject:bannerdata];
|
||||
}
|
||||
NSIndexSet *asset = [NSIndexSet indexSetWithIndex:1];
|
||||
[weakSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationNone];
|
||||
@@ -576,7 +606,7 @@
|
||||
_mesglabel.backgroundColor = [UIColor redColor];
|
||||
[navMeaasageBtn addSubview:_mesglabel];
|
||||
_mesglabel.font = [UIFont boldSystemFontOfSize:10];
|
||||
[self setRedViewData];
|
||||
// [self setRedViewData];
|
||||
|
||||
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
|
||||
self.navigationItem.backBarButtonItem = item;
|
||||
@@ -593,9 +623,9 @@
|
||||
|
||||
-(void)setRedViewData{
|
||||
|
||||
NSInteger count = [[[NIMSDK sharedSDK] conversationManager] allUnreadCount];
|
||||
if (count !=0) {
|
||||
_mesglabel.text = [NSString stringWithFormat:@"%ld",(long)count];
|
||||
// NSInteger count = [[[NIMSDK sharedSDK] conversationManager] allUnreadCount];
|
||||
if (self.messageCount> 0) {
|
||||
_mesglabel.text = [NSString stringWithFormat:@"%ld",(long)self.messageCount];
|
||||
_mesglabel.hidden = NO;
|
||||
}else{
|
||||
_mesglabel.text =@"";
|
||||
@@ -603,48 +633,10 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - NIMSystemNotificationManagerDelegate
|
||||
- (void)onSystemNotificationCountChanged:(NSInteger)unreadCount
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - NIMConversationManagerDelegate
|
||||
|
||||
- (void)didUpdateRecentSession:(NIMRecentSession *)recentSession
|
||||
totalUnreadCount:(NSInteger)totalUnreadCount{
|
||||
//用户在当前界面收到推送时 更新角标
|
||||
if (totalUnreadCount !=0) {
|
||||
_mesglabel.text = [NSString stringWithFormat:@"%ld",(long)totalUnreadCount];
|
||||
_mesglabel.hidden = NO;
|
||||
}else{
|
||||
_mesglabel.text =@"";
|
||||
_mesglabel.hidden = YES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)popAppear{
|
||||
|
||||
[self pushWiFiConnectVC];
|
||||
|
||||
/*UIImage *image = [UIImage imageNamed:@"popover_background_image_notrangle"];
|
||||
NSArray *titleImgs = @[@"ifish_qiehuan_device",@"ifishdropview_add_device"];
|
||||
NSArray *titles=@[@"切换设备",@"添加设备"];
|
||||
LXPopView *pop=[[LXPopView alloc] init];
|
||||
pop.frame = CGRectMake(0, 10, 160, 160*(image.size.height/image.size.width));
|
||||
pop.delegate = self;
|
||||
pop.backgroundImage =image
|
||||
;
|
||||
pop.titles = titles;
|
||||
pop.titleImgs =titleImgs;
|
||||
DXPopover *popover = [DXPopover popover];
|
||||
|
||||
self.popover = popover;
|
||||
popover.arrowSize = CGSizeMake(0.0,0.0);
|
||||
[popover showAtView:self.rightButton withContentView:pop];*/
|
||||
|
||||
}
|
||||
|
||||
-(void)disSelectedPopViewIndex:(NSIndexPath *)Index{
|
||||
@@ -1608,17 +1600,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - 导航栏消息
|
||||
#pragma mark - 导航栏消息,跳转进入消息列表
|
||||
-(void)navMeaasageBtnAction{
|
||||
|
||||
NTESSessionListViewController *sessionList = [[NTESSessionListViewController alloc] init];
|
||||
// UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:sessionList];
|
||||
// [nav.navigationBar resetBackgroundImage];
|
||||
// nav.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
|
||||
// [self presentViewController:nav animated:YES completion:nil];
|
||||
|
||||
IfishMessageViewController *message = [[IfishMessageViewController alloc]init];
|
||||
self.hidesBottomBarWhenPushed = YES;
|
||||
[self.navigationController pushViewController:sessionList animated:YES];
|
||||
[self.navigationController pushViewController:message animated:YES];
|
||||
self.hidesBottomBarWhenPushed = NO;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user