本地版本测试版-9.8.5
This commit is contained in:
parent
35d2db06a6
commit
1ff1ff84b1
|
|
@ -2367,7 +2367,6 @@
|
|||
88F5EFD91D48D08100CC7CAF /* MyControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF5C1D48D08100CC7CAF /* MyControl.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
88F5EFDA1D48D08100CC7CAF /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF5F1D48D08100CC7CAF /* Reachability.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
88F740C01ECC28E800876AED /* ShopAddGoodsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */; };
|
||||
CB0F4E652294F37E0091C76D /* UrlAdress.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E642294F37E0091C76D /* UrlAdress.h */; };
|
||||
CB0F4E8622951A130091C76D /* SVRadialGradientLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = CB0F4E7B22951A130091C76D /* SVRadialGradientLayer.m */; };
|
||||
CB0F4E8722951A130091C76D /* SVIndefiniteAnimatedView.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */; };
|
||||
CB0F4E8822951A130091C76D /* SVProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E7D22951A130091C76D /* SVProgressHUD.h */; };
|
||||
|
|
@ -5764,7 +5763,6 @@
|
|||
88F5EF5F1D48D08100CC7CAF /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
|
||||
88F740BE1ECC28E800876AED /* ShopAddGoodsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopAddGoodsViewController.h; sourceTree = "<group>"; };
|
||||
88F740BF1ECC28E800876AED /* ShopAddGoodsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopAddGoodsViewController.m; sourceTree = "<group>"; };
|
||||
CB0F4E642294F37E0091C76D /* UrlAdress.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UrlAdress.h; sourceTree = "<group>"; };
|
||||
CB0F4E7B22951A130091C76D /* SVRadialGradientLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVRadialGradientLayer.m; sourceTree = "<group>"; };
|
||||
CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVIndefiniteAnimatedView.h; sourceTree = "<group>"; };
|
||||
CB0F4E7D22951A130091C76D /* SVProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVProgressHUD.h; sourceTree = "<group>"; };
|
||||
|
|
@ -12369,7 +12367,6 @@
|
|||
CB0F4E622294F2B00091C76D /* Networking */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CB0F4E642294F37E0091C76D /* UrlAdress.h */,
|
||||
);
|
||||
path = Networking;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -12599,7 +12596,6 @@
|
|||
CBA6167F228F9AB100ED380D /* MASViewConstraint.h in Headers */,
|
||||
3D1C5122221A9EE00096AE43 /* IfishRecVideoViewCell.h in Headers */,
|
||||
3D1C5137221A9EE10096AE43 /* ifishdeviceListCell.h in Headers */,
|
||||
CB0F4E652294F37E0091C76D /* UrlAdress.h in Headers */,
|
||||
3D1C5038221A9EDE0096AE43 /* MD5Manager.h in Headers */,
|
||||
3D1C5079221A9EDF0096AE43 /* RtspInterface.h in Headers */,
|
||||
3D1C5085221A9EDF0096AE43 /* KTPhotoBrowserGlobal.h in Headers */,
|
||||
|
|
|
|||
|
|
@ -164,13 +164,16 @@ static const void *NotificationCenterKey = &NotificationCenterKey;
|
|||
NSLog(@"注册成功 device_token = %@",device_Id);
|
||||
[FuncUserDefault setStr:device_Id key:kDeviceToken];//本机的devicetoken保存在本地
|
||||
if (userId!=nil) {
|
||||
NSArray *keys = @[@"deviceId",@"userId"];
|
||||
NSArray *values = @[device_Id,userId];
|
||||
|
||||
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_BindDevice_Url keys:keys values:values success:^(NSDictionary *successDic) {
|
||||
NSDictionary *params = @{@"deviceId":device_Id,
|
||||
@"userId":userId,
|
||||
@"phoneType":@"iOS"
|
||||
};
|
||||
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_BindDevice_Url params:params success:^(id response) {
|
||||
id resault=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSLog(@"result = %@",resault);
|
||||
//绑定成功
|
||||
[FuncUserDefault setBool:YES key:is_Bind_DeviceToken];
|
||||
} failure:^(NSDictionary *errorDic) {
|
||||
[FuncUserDefault setBool:YES key:is_Bind_DeviceToken];//已经上送了本机的devicetoken
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#import <Bugly/BuglyLog.h>
|
||||
#import "UIButton+button.h"
|
||||
#import "CommonMacros.h"
|
||||
#import "UrlAdress.h"
|
||||
#import "FuncUserDefault.h"
|
||||
#import "CommonUtils.h"
|
||||
#define NTES_USE_CLEAR_BAR - (BOOL)useClearBar{return YES;}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4.9.7</string>
|
||||
<string>4.9.8</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>9.8.3</string>
|
||||
<string>9.8.5</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
|
|
@ -373,7 +373,7 @@
|
|||
<true/>
|
||||
</dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>爱鱼奇需要您的同意,才能使用相机</string>
|
||||
<string>爱鱼奇需要您的同意,才能使用相机,以使用图片上传或扫一扫等功能</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>为获取爱鱼奇智能硬件产品及用户的地址区域分布,以提供更好的特色服务,爱鱼奇将获取您的地址</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
|
|
@ -381,7 +381,7 @@
|
|||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>爱鱼奇需要您的同意,才能访问麦克风</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>爱鱼奇需要您的同意,才能访问相册</string>
|
||||
<string>爱鱼奇需要您的同意,才能访问相册,以使用更换头像等图片上传功能</string>
|
||||
<key>UIApplicationExitsOnSuspend</key>
|
||||
<false/>
|
||||
<key>UIBackgroundModes</key>
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
//
|
||||
// UrlAdress.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by wbzhan on 2019/5/22.
|
||||
// Copyright © 2019 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef UrlAdress_h
|
||||
#define UrlAdress_h
|
||||
|
||||
#define App_Environment 1 //1.测试环境 2.正式环境
|
||||
#if(App_Environment==1)//测试
|
||||
//app接口域名
|
||||
#define Api_DomainName @"http://test.ifish7.com:7080"
|
||||
|
||||
#elif (App_Environment==2)//正式
|
||||
//app接口域名 cv
|
||||
#define Api_DomainName @"http://139.196.24.156:7080"
|
||||
|
||||
#else//其他环境
|
||||
//app接口域名
|
||||
#define Api_DomainName @"http://139.196.24.156:7080"
|
||||
|
||||
#endif
|
||||
|
||||
//获取推送消息列表
|
||||
/**
|
||||
pushID 本地缓存的最大的pushId,第一次无的时候则不传
|
||||
userId 用户id
|
||||
firstResult 开始条数
|
||||
pageSize 每页数据数量
|
||||
@return <#return value description#>
|
||||
*/
|
||||
#define Push_Message_Url Api_DomainName @"/api/pageList/pushListInf.do"
|
||||
//删除消息
|
||||
#define Push_Message_Delete_Url Api_DomainName @"/api/updateUser/deleteMessages.do"
|
||||
//绑定设备
|
||||
#define Push_BindDevice_Url Api_DomainName @"/api/updateUser/bindDevice.do"
|
||||
//用户消息已读
|
||||
#define Push_Message_Readed Api_DomainName @"/api/updateUser/userMessageIsRead.do"
|
||||
//用户未读消息个数
|
||||
#define Push_Message_UnReadCount Api_DomainName @"/api/updateUser/userMessageNoReadCount.do"
|
||||
#endif /* UrlAdress_h */
|
||||
|
|
@ -136,17 +136,20 @@ alpha:1.0]
|
|||
//#define SOCKETPORT @"app.ifish7.com"
|
||||
|
||||
// 本地 @"192.168.61.128"
|
||||
#define SOCKETPORT @"test.ifish7.com"
|
||||
#define SOCKETPORT @"test.ifish7.com:9955"
|
||||
|
||||
//#define JIEKOUPORT @"https://app.ifish7.com"
|
||||
//#define JIEKOUPORT @"http://test.ifish7.com:7080"
|
||||
#define JIEKOUPORT @"http://139.196.24.156:7080"
|
||||
#define JIEKOUPORTHTTP @"https://app.ifish7.com"
|
||||
|
||||
//云 @"https://app.ifish7.com"
|
||||
//云图片头像等地址 @"http://app.ifish7.com"
|
||||
#define JIEKOUPORT @"https://app.ifish7.com"
|
||||
#define JIEKOUPORTHTTP @"https://app.ifish7.com"
|
||||
//#define JIEKOUPORTHTTP @"https://app.ifish7.com"
|
||||
|
||||
//测试云 @"https://app.zhangxinyanv5.top"
|
||||
//测试云图片 @"http://app.zhangxinyanv5.top"
|
||||
//#define JIEKOUPORT @"https://app.zhangxinyanv5.top"
|
||||
//#define JIEKOUPORTHTTP @"https://app.zhangxinyanv5.top"
|
||||
|
||||
|
||||
//本地 @"http://192.168.61.128:81"
|
||||
|
||||
|
|
@ -473,7 +476,23 @@ alpha:1.0]
|
|||
|
||||
//
|
||||
#define getHotBarHistory [NSString stringWithFormat:@"%@/api/user/getDeviceHeaterPhsByDate.do",JIEKOUPORT]
|
||||
|
||||
|
||||
|
||||
/*=====================add V4.9.8=======================================*/
|
||||
//获取推送消息列表
|
||||
/**
|
||||
pushID 本地缓存的最大的pushId,第一次无的时候则不传
|
||||
userId 用户id
|
||||
firstResult 开始条数
|
||||
pageSize 每页数据数量
|
||||
@return <#return value description#>
|
||||
*/
|
||||
#define Push_Message_Url JIEKOUPORT @"/api/pageList/pushListInf.do"
|
||||
//删除消息
|
||||
#define Push_Message_Delete_Url JIEKOUPORT @"/api/updateUser/deleteMessages.do"
|
||||
//绑定设备
|
||||
#define Push_BindDevice_Url JIEKOUPORT @"/api/updateUser/bindDevice.do"
|
||||
//用户消息已读
|
||||
#define Push_Message_Readed JIEKOUPORT @"/api/updateUser/userMessageIsRead.do"
|
||||
//用户未读消息个数
|
||||
#define Push_Message_UnReadCount JIEKOUPORT @"/api/updateUser/userMessageNoReadCount.do"
|
||||
/*=====================add V4.9.8=======================================*/
|
||||
#endif /* Define_h */
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ typedef NS_ENUM(NSInteger, RequestType){
|
|||
#define RESPONSE_SUCCESS @"0" //服务器返回的数据成功信息1、成功,-1,异常,0,错误
|
||||
@interface AFNOHeaderHttpTool : NSObject
|
||||
+ (AFNOHeaderHttpTool *)sharedInstance;
|
||||
//POST请求
|
||||
-(void) postRequestWihtUrl:(NSString *)url
|
||||
keys:(NSArray *)keys
|
||||
values:(NSArray *)values
|
||||
success:(WBCallBackSuccess)success
|
||||
failure:(WBCallBackFailed)failure;
|
||||
////POST请求
|
||||
//-(void) postRequestWihtUrl:(NSString *)url
|
||||
// keys:(NSArray *)keys
|
||||
// values:(NSArray *)values
|
||||
// success:(WBCallBackSuccess)success
|
||||
// failure:(WBCallBackFailed)failure;
|
||||
/**
|
||||
* 发送一个请求 无请求头参数
|
||||
*
|
||||
|
|
|
|||
|
|
@ -78,57 +78,57 @@
|
|||
|
||||
|
||||
//POST请求
|
||||
-(void) postRequestWihtUrl:(NSString *)url
|
||||
keys:(NSArray *)keys
|
||||
values:(NSArray *)values
|
||||
success:(WBCallBackSuccess)success
|
||||
failure:(WBCallBackFailed)failure
|
||||
{
|
||||
|
||||
NSURLSession *session = [NSURLSession sharedSession];
|
||||
NSMutableURLRequest *urlRequest = [self getUrlRequestWithPath:url keysArray:keys valuesArray:values];
|
||||
NSURLSessionDataTask *sessionDataTask = [session dataTaskWithRequest:urlRequest completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||
if ([data length] >0 &&
|
||||
error == nil){
|
||||
[SVProgressHUD dismissWithDelay:0.3];
|
||||
id result=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
|
||||
NSLog(@"获取数据 resalut = %@",result);
|
||||
if ([result isKindOfClass:[NSDictionary class]]) {
|
||||
// NSString *resCode = [NSString stringWithFormat:@"%@",[result objectForKey:RESPONSE_CODE]];//状态码
|
||||
// //返回数据正确 ,则解析到数据接收内容
|
||||
// if([resCode integerValue]==kReqSuccess)
|
||||
// {
|
||||
/**
|
||||
获取后台给定的正确码100,做逻辑处理
|
||||
*/
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
//直接显示成功信息
|
||||
success(result);
|
||||
});
|
||||
// }else{
|
||||
// /*
|
||||
// 获取后台给定的其他错误码,做逻辑处理(暂无数据等)
|
||||
//-(void) postRequestWihtUrl:(NSString *)url
|
||||
// keys:(NSArray *)keys
|
||||
// values:(NSArray *)values
|
||||
// success:(WBCallBackSuccess)success
|
||||
// failure:(WBCallBackFailed)failure
|
||||
//{
|
||||
//
|
||||
// NSURLSession *session = [NSURLSession sharedSession];
|
||||
// NSMutableURLRequest *urlRequest = [self getUrlRequestWithPath:url keysArray:keys valuesArray:values];
|
||||
// NSURLSessionDataTask *sessionDataTask = [session dataTaskWithRequest:urlRequest completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||
// if ([data length] >0 &&
|
||||
// error == nil){
|
||||
// [SVProgressHUD dismissWithDelay:0.3];
|
||||
// id result=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
|
||||
// NSLog(@"获取数据 resalut = %@",result);
|
||||
// if ([result isKindOfClass:[NSDictionary class]]) {
|
||||
//// NSString *resCode = [NSString stringWithFormat:@"%@",[result objectForKey:RESPONSE_CODE]];//状态码
|
||||
//// //返回数据正确 ,则解析到数据接收内容
|
||||
//// if([resCode integerValue]==kReqSuccess)
|
||||
//// {
|
||||
// /**
|
||||
// 获取后台给定的正确码100,做逻辑处理
|
||||
// */
|
||||
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// failure(result);
|
||||
// //直接显示成功信息
|
||||
// success(result);
|
||||
// });
|
||||
// }
|
||||
}else{
|
||||
NSLog(@"json格式错误");
|
||||
}
|
||||
}else if ([data length] == 0 &&
|
||||
error == nil){
|
||||
//请求数据长度为0(服务器返回数据内容问题)
|
||||
[SVProgressHUD dismiss];
|
||||
}else if (error != nil){
|
||||
//反馈错误信息(网络连接失败(服务器关停)等信息)
|
||||
if (error) {
|
||||
[SVProgressHUD dismiss];
|
||||
}
|
||||
}
|
||||
}];
|
||||
[sessionDataTask resume];
|
||||
}
|
||||
//// }else{
|
||||
//// /*
|
||||
//// 获取后台给定的其他错误码,做逻辑处理(暂无数据等)
|
||||
//// */
|
||||
//// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
//// failure(result);
|
||||
//// });
|
||||
//// }
|
||||
// }else{
|
||||
// NSLog(@"json格式错误");
|
||||
// }
|
||||
// }else if ([data length] == 0 &&
|
||||
// error == nil){
|
||||
// //请求数据长度为0(服务器返回数据内容问题)
|
||||
// [SVProgressHUD dismiss];
|
||||
// }else if (error != nil){
|
||||
// //反馈错误信息(网络连接失败(服务器关停)等信息)
|
||||
// if (error) {
|
||||
// [SVProgressHUD dismiss];
|
||||
// }
|
||||
// }
|
||||
// }];
|
||||
// [sessionDataTask resume];
|
||||
//}
|
||||
+(void) requestWihtMethod:(RequestType)
|
||||
methodType url : (NSString *)url
|
||||
params:(NSDictionary *)params
|
||||
|
|
@ -142,7 +142,7 @@ methodType url : (NSString *)url
|
|||
AFHTTPRequestOperationManager*manager=[AFHTTPRequestOperationManager manager];
|
||||
//此类中接口 无安全校验
|
||||
manager.responseSerializer=[AFHTTPResponseSerializer serializer];
|
||||
|
||||
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json",@"text/javascript",@"text/html", nil];;
|
||||
//#ifdef ContentType
|
||||
// manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:ContentType];
|
||||
//#endif
|
||||
|
|
@ -171,10 +171,12 @@ methodType url : (NSString *)url
|
|||
[manager POST:url parameters:params
|
||||
success:^(AFHTTPRequestOperation* operation, NSDictionary* responseObj) {
|
||||
if (success) {
|
||||
[SVProgressHUD dismiss];
|
||||
success(responseObj);
|
||||
}
|
||||
} failure:^(AFHTTPRequestOperation* operation, NSError* error) {
|
||||
if (failure){
|
||||
[SVProgressHUD dismiss];
|
||||
failure(error);
|
||||
}
|
||||
}];
|
||||
|
|
|
|||
|
|
@ -268,20 +268,25 @@ extern BOOL launchedByNotification;
|
|||
[SVProgressHUD show];
|
||||
self.pushId = @"";
|
||||
UserModel*userModel=[dataContorl getUserInfo];
|
||||
NSArray *keys = @[@"pushId",@"userId",@"firstResult",@"pageSize"];
|
||||
NSArray *values = @[self.pushId,userModel.userId,@"0",@"999"];
|
||||
|
||||
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Url keys:keys values:values success:^(NSDictionary *successDic) {
|
||||
|
||||
NSString *totalCount = [successDic objectForKey:@"total"];
|
||||
NSArray *dataArray = [successDic objectForKey:@"data"];
|
||||
NSDictionary *params = @{@"pushId":self.pushId,
|
||||
@"userId":userModel.userId,
|
||||
@"firstResult":@(0),
|
||||
@"pageSize":@(999)
|
||||
};
|
||||
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Url params:params success:^(id response) {
|
||||
[SVProgressHUD dismiss];
|
||||
if (response) {
|
||||
id resault=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
|
||||
NSString *totalCount = [resault objectForKey:@"total"];
|
||||
NSArray *dataArray = [resault objectForKey:@"data"];
|
||||
if ([totalCount integerValue]>0) {
|
||||
NSMutableArray *newMessageArray = InitObject(NSMutableArray);
|
||||
NSMutableArray *oldMessageArray = InitObject(NSMutableArray);
|
||||
for (int i=0; i<dataArray.count; i++) {
|
||||
PushmessageModel *messageModel = [PushmessageModel yy_modelWithJSON:[dataArray objectAtIndex:i]];
|
||||
[messageModel getCellHeight];
|
||||
|
||||
|
||||
if ([messageModel.isRead integerValue]==1) {//未读消息
|
||||
[newMessageArray addObject:messageModel];
|
||||
}else{
|
||||
|
|
@ -292,12 +297,11 @@ extern BOOL launchedByNotification;
|
|||
[self.dataSource addObject:oldMessageArray];
|
||||
}
|
||||
[self.tableView reloadData];
|
||||
|
||||
|
||||
} failure:^(NSDictionary *errorDic) {
|
||||
|
||||
}
|
||||
} failure:^(NSError *err) {
|
||||
[SVProgressHUD dismiss];
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
//发送已读记录
|
||||
-(void)postReadMessageRequestWithIndexPath:(NSIndexPath *)indexPath{
|
||||
|
|
@ -305,20 +309,21 @@ extern BOOL launchedByNotification;
|
|||
PushmessageModel *model = [[self.dataSource objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
|
||||
if([model.isRead integerValue]==1)//未读消息
|
||||
{
|
||||
|
||||
NSArray *keys = @[@"userId",@"pushId"];
|
||||
NSArray *values = @[userModel.userId,self.pushId];
|
||||
|
||||
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Readed keys:keys values:values success:^(NSDictionary *successDic) {
|
||||
|
||||
NSString *result = [successDic objectForKey:RESPONSE_CODE];
|
||||
if ([result integerValue]==kReqSuccess) {
|
||||
//已读
|
||||
}else{
|
||||
|
||||
}
|
||||
} failure:^(NSDictionary *errorDic) {
|
||||
|
||||
NSDictionary *params = @{@"userId":userModel.userId,
|
||||
@"pushId":model.pushId,
|
||||
};
|
||||
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Readed params:params success:^(id response) {
|
||||
if (response) {
|
||||
id resault=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result = [resault objectForKey:RESPONSE_CODE];
|
||||
if ([result integerValue]==kReqSuccess) {
|
||||
//已读
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
|
@ -329,29 +334,27 @@ extern BOOL launchedByNotification;
|
|||
PushmessageModel *model = [[self.dataSource objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
|
||||
NSMutableDictionary *deleteDic = InitObject(NSMutableDictionary);
|
||||
[deleteDic setValue:model.pushId forKey:@"pushId"];
|
||||
|
||||
NSArray *keys = @[@"userId",@"pushIds"];
|
||||
NSArray *values = @[userModel.userId,[CommonUtils arrayToJSONString:@[deleteDic]]];
|
||||
|
||||
NSDictionary *params = @{@"userId":userModel.userId,
|
||||
@"pushIds":[CommonUtils arrayToJSONString:@[deleteDic]]
|
||||
};
|
||||
[SVProgressHUD show];
|
||||
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Delete_Url keys:keys values:values success:^(NSDictionary *successDic) {
|
||||
|
||||
NSString *result = [successDic objectForKey:RESPONSE_CODE];
|
||||
if ([result integerValue]==kReqSuccess) {
|
||||
[[self.dataSource objectAtIndex:indexPath.section] removeObjectAtIndex:indexPath.row];
|
||||
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
// //刷新页面
|
||||
// [self.tableView reloadData];
|
||||
// [self.tableView scrollsToTop];
|
||||
}else{
|
||||
[SVProgressHUD showInfoWithStatus:@"删除失败"];
|
||||
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Delete_Url params:params success:^(id response) {
|
||||
if (response) {
|
||||
id resault=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result = [resault objectForKey:RESPONSE_CODE];
|
||||
if ([result integerValue]==kReqSuccess) {
|
||||
[[self.dataSource objectAtIndex:indexPath.section] removeObjectAtIndex:indexPath.row];
|
||||
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
// //刷新页面
|
||||
// [self.tableView reloadData];
|
||||
// [self.tableView scrollsToTop];
|
||||
}else{
|
||||
[SVProgressHUD showInfoWithStatus:@"删除失败"];
|
||||
}
|
||||
}
|
||||
} failure:^(NSDictionary *errorDic) {
|
||||
[SVProgressHUD showInfoWithStatus:@"删除失败"];
|
||||
// self.deleteBtn.selected = NO;
|
||||
// [self.deleteView setHidden:YES];
|
||||
// [self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
// make.bottom.mas_equalTo(self.view);
|
||||
// }];
|
||||
} failure:^(NSError *err) {
|
||||
[SVProgressHUD showInfoWithStatus:@"删除失败"];
|
||||
}];
|
||||
}
|
||||
//删除接口(多选删除)
|
||||
|
|
@ -364,48 +367,47 @@ extern BOOL launchedByNotification;
|
|||
[deleteDic setValue:pushId forKey:@"pushId"];
|
||||
[deleteArray addObject:deleteDic];
|
||||
}
|
||||
NSArray *keys = @[@"userId",@"pushIds"];
|
||||
NSArray *values = @[userModel.userId,[CommonUtils arrayToJSONString:deleteArray]];
|
||||
NSDictionary *params = @{@"userId":userModel.userId,
|
||||
@"pushIds":[CommonUtils arrayToJSONString:deleteArray]
|
||||
};
|
||||
[SVProgressHUD show];
|
||||
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Delete_Url keys:keys values:values success:^(NSDictionary *successDic) {
|
||||
|
||||
NSString *result = [successDic objectForKey:RESPONSE_CODE];
|
||||
if ([result integerValue]==kReqSuccess) {
|
||||
self.deleteBtn.selected = NO;
|
||||
for (int i=0;i< self.dataSource.count;i++) {
|
||||
NSArray *arr = [self.dataSource objectAtIndex:i];
|
||||
NSMutableArray *newArray = InitObject(NSMutableArray);
|
||||
for (int j=0; j<arr.count; j++) {
|
||||
PushmessageModel *model = [arr objectAtIndex:j];
|
||||
if ([self.deleteArray containsObject:model.pushId]) {
|
||||
|
||||
}else{
|
||||
[newArray addObject:model];
|
||||
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Delete_Url params:params success:^(id response) {
|
||||
if (response) {
|
||||
id successDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result = [successDic objectForKey:RESPONSE_CODE];
|
||||
if ([result integerValue]==kReqSuccess) {
|
||||
self.deleteBtn.selected = NO;
|
||||
for (int i=0;i< self.dataSource.count;i++) {
|
||||
NSArray *arr = [self.dataSource objectAtIndex:i];
|
||||
NSMutableArray *newArray = InitObject(NSMutableArray);
|
||||
for (int j=0; j<arr.count; j++) {
|
||||
PushmessageModel *model = [arr objectAtIndex:j];
|
||||
if ([self.deleteArray containsObject:model.pushId]) {
|
||||
|
||||
}else{
|
||||
[newArray addObject:model];
|
||||
}
|
||||
}
|
||||
[self.dataSource setObject:newArray atIndexedSubscript:i];
|
||||
}
|
||||
[self.dataSource setObject:newArray atIndexedSubscript:i];
|
||||
//走删除接口之后,清空删除内容数组
|
||||
[self.deleteArray removeAllObjects];
|
||||
self.isDelteAll = NO;
|
||||
[self.deleteView setHidden:YES];
|
||||
[self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.view);
|
||||
}];
|
||||
self.isShowDelete = NO;
|
||||
//刷新页面
|
||||
[self.tableView reloadData];
|
||||
[self.tableView scrollsToTop];
|
||||
}else{
|
||||
[SVProgressHUD showInfoWithStatus:@"删除失败"];
|
||||
}
|
||||
//走删除接口之后,清空删除内容数组
|
||||
[self.deleteArray removeAllObjects];
|
||||
self.isDelteAll = NO;
|
||||
[self.deleteView setHidden:YES];
|
||||
[self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.view);
|
||||
}];
|
||||
self.isShowDelete = NO;
|
||||
//刷新页面
|
||||
[self.tableView reloadData];
|
||||
[self.tableView scrollsToTop];
|
||||
}else{
|
||||
[SVProgressHUD showInfoWithStatus:@"删除失败"];
|
||||
}
|
||||
} failure:^(NSDictionary *errorDic) {
|
||||
} failure:^(NSError *err) {
|
||||
[SVProgressHUD showInfoWithStatus:@"删除失败"];
|
||||
// self.deleteBtn.selected = NO;
|
||||
// [self.deleteView setHidden:YES];
|
||||
// [self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
// make.bottom.mas_equalTo(self.view);
|
||||
// }];
|
||||
|
||||
}];
|
||||
}
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
|
|
|
|||
|
|
@ -138,24 +138,25 @@ Assign NSInteger messageCount;//消息个数
|
|||
//获取未读消息个数
|
||||
-(void)getMessageCount{
|
||||
|
||||
UserModel*userModel=[dataContorl getUserInfo];
|
||||
NSArray *keys = @[@"userId"];
|
||||
NSArray *values = @[userModel.userId];
|
||||
UserModel*userModel=[dataContorl getUserInfo];
|
||||
|
||||
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_UnReadCount keys:keys values:values success:^(NSDictionary *successDic) {
|
||||
|
||||
NSDictionary *params = @{@"userId":userModel.userId
|
||||
};
|
||||
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_UnReadCount params:params success:^(id response) {
|
||||
if (response) {
|
||||
id successDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result = [successDic objectForKey:RESPONSE_CODE];
|
||||
NSDictionary *dic = [successDic objectForKey:RESPONSE_DATA];
|
||||
if ([result integerValue]==kReqSuccess) {
|
||||
|
||||
|
||||
NSString *count = [dic objectForKey:@"messageNoReadCount"];
|
||||
self.messageCount = [count integerValue];
|
||||
}
|
||||
[self setRedViewData];
|
||||
|
||||
} failure:^(NSDictionary *errorDic) {
|
||||
|
||||
}];
|
||||
}
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - 首页广告位
|
||||
|
||||
|
|
|
|||
|
|
@ -295,13 +295,14 @@
|
|||
//登陆成功之后,验证当前页面devicetoken是否上送成功,如果还未上送,则重新上送devicetoken
|
||||
if (![[NSUserDefaults standardUserDefaults] boolForKey:is_Bind_DeviceToken]) {
|
||||
UserModel *model=[[UserModel alloc] initWithDict:DataDic];
|
||||
NSArray *keys = @[@"deviceId",@"userId"];
|
||||
NSArray *values = @[[FuncUserDefault strForKey:kDeviceToken],model.userId];
|
||||
|
||||
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_BindDevice_Url keys:keys values:values success:^(NSDictionary *successDic){
|
||||
NSDictionary *params = @{@"deviceId":[FuncUserDefault strForKey:kDeviceToken],
|
||||
@"userId":model.userId,
|
||||
@"phoneType":@"iOS"
|
||||
};
|
||||
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_BindDevice_Url params:params success:^(id response) {
|
||||
//绑定成功
|
||||
[FuncUserDefault setBool:YES key:is_Bind_DeviceToken];//已经上送了本机的devicetoken
|
||||
} failure:^(NSDictionary *errorDic) {
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue