本地版本测试版-9.8.5

This commit is contained in:
wbzhan_macbook 2019-06-03 09:41:16 +08:00
parent 35d2db06a6
commit 1ff1ff84b1
12 changed files with 200 additions and 221 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -2367,7 +2367,6 @@
88F5EFD91D48D08100CC7CAF /* MyControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 88F5EF5C1D48D08100CC7CAF /* MyControl.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 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"; }; }; 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 */; }; 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 */; }; CB0F4E8622951A130091C76D /* SVRadialGradientLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = CB0F4E7B22951A130091C76D /* SVRadialGradientLayer.m */; };
CB0F4E8722951A130091C76D /* SVIndefiniteAnimatedView.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */; }; CB0F4E8722951A130091C76D /* SVIndefiniteAnimatedView.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */; };
CB0F4E8822951A130091C76D /* SVProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E7D22951A130091C76D /* SVProgressHUD.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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; CB0F4E7D22951A130091C76D /* SVProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVProgressHUD.h; sourceTree = "<group>"; };
@ -12369,7 +12367,6 @@
CB0F4E622294F2B00091C76D /* Networking */ = { CB0F4E622294F2B00091C76D /* Networking */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
CB0F4E642294F37E0091C76D /* UrlAdress.h */,
); );
path = Networking; path = Networking;
sourceTree = "<group>"; sourceTree = "<group>";
@ -12599,7 +12596,6 @@
CBA6167F228F9AB100ED380D /* MASViewConstraint.h in Headers */, CBA6167F228F9AB100ED380D /* MASViewConstraint.h in Headers */,
3D1C5122221A9EE00096AE43 /* IfishRecVideoViewCell.h in Headers */, 3D1C5122221A9EE00096AE43 /* IfishRecVideoViewCell.h in Headers */,
3D1C5137221A9EE10096AE43 /* ifishdeviceListCell.h in Headers */, 3D1C5137221A9EE10096AE43 /* ifishdeviceListCell.h in Headers */,
CB0F4E652294F37E0091C76D /* UrlAdress.h in Headers */,
3D1C5038221A9EDE0096AE43 /* MD5Manager.h in Headers */, 3D1C5038221A9EDE0096AE43 /* MD5Manager.h in Headers */,
3D1C5079221A9EDF0096AE43 /* RtspInterface.h in Headers */, 3D1C5079221A9EDF0096AE43 /* RtspInterface.h in Headers */,
3D1C5085221A9EDF0096AE43 /* KTPhotoBrowserGlobal.h in Headers */, 3D1C5085221A9EDF0096AE43 /* KTPhotoBrowserGlobal.h in Headers */,

View File

@ -164,13 +164,16 @@ static const void *NotificationCenterKey = &NotificationCenterKey;
NSLog(@"注册成功 device_token = %@",device_Id); NSLog(@"注册成功 device_token = %@",device_Id);
[FuncUserDefault setStr:device_Id key:kDeviceToken];//devicetoken [FuncUserDefault setStr:device_Id key:kDeviceToken];//devicetoken
if (userId!=nil) { if (userId!=nil) {
NSArray *keys = @[@"deviceId",@"userId"]; NSDictionary *params = @{@"deviceId":device_Id,
NSArray *values = @[device_Id,userId]; @"userId":userId,
@"phoneType":@"iOS"
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_BindDevice_Url keys:keys values:values success:^(NSDictionary *successDic) { };
[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]; [FuncUserDefault setBool:YES key:is_Bind_DeviceToken];//devicetoken
} failure:^(NSDictionary *errorDic) { } failure:^(NSError *err) {
}]; }];
} }

View File

@ -26,7 +26,6 @@
#import <Bugly/BuglyLog.h> #import <Bugly/BuglyLog.h>
#import "UIButton+button.h" #import "UIButton+button.h"
#import "CommonMacros.h" #import "CommonMacros.h"
#import "UrlAdress.h"
#import "FuncUserDefault.h" #import "FuncUserDefault.h"
#import "CommonUtils.h" #import "CommonUtils.h"
#define NTES_USE_CLEAR_BAR - (BOOL)useClearBar{return YES;} #define NTES_USE_CLEAR_BAR - (BOOL)useClearBar{return YES;}

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>4.9.7</string> <string>4.9.8</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
@ -70,7 +70,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>9.8.3</string> <string>9.8.5</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
@ -373,7 +373,7 @@
<true/> <true/>
</dict> </dict>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>爱鱼奇需要您的同意,才能使用相机</string> <string>爱鱼奇需要您的同意,才能使用相机,以使用图片上传或扫一扫等功能</string>
<key>NSLocationAlwaysUsageDescription</key> <key>NSLocationAlwaysUsageDescription</key>
<string>为获取爱鱼奇智能硬件产品及用户的地址区域分布,以提供更好的特色服务,爱鱼奇将获取您的地址</string> <string>为获取爱鱼奇智能硬件产品及用户的地址区域分布,以提供更好的特色服务,爱鱼奇将获取您的地址</string>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
@ -381,7 +381,7 @@
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>爱鱼奇需要您的同意,才能访问麦克风</string> <string>爱鱼奇需要您的同意,才能访问麦克风</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>爱鱼奇需要您的同意,才能访问相册</string> <string>爱鱼奇需要您的同意,才能访问相册,以使用更换头像等图片上传功能</string>
<key>UIApplicationExitsOnSuspend</key> <key>UIApplicationExitsOnSuspend</key>
<false/> <false/>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>

View File

@ -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 */

View File

@ -136,17 +136,20 @@ alpha:1.0]
//#define SOCKETPORT @"app.ifish7.com" //#define SOCKETPORT @"app.ifish7.com"
// 本地 @"192.168.61.128" // 本地 @"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" //云 @"https://app.ifish7.com"
//云图片头像等地址 @"http://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" //测试云 @"https://app.zhangxinyanv5.top"
//测试云图片 @"http://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" //本地 @"http://192.168.61.128:81"
@ -473,7 +476,23 @@ alpha:1.0]
// //
#define getHotBarHistory [NSString stringWithFormat:@"%@/api/user/getDeviceHeaterPhsByDate.do",JIEKOUPORT] #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 */ #endif /* Define_h */

View File

@ -47,12 +47,12 @@ typedef NS_ENUM(NSInteger, RequestType){
#define RESPONSE_SUCCESS @"0" //服务器返回的数据成功信息1、成功-1异常0错误 #define RESPONSE_SUCCESS @"0" //服务器返回的数据成功信息1、成功-1异常0错误
@interface AFNOHeaderHttpTool : NSObject @interface AFNOHeaderHttpTool : NSObject
+ (AFNOHeaderHttpTool *)sharedInstance; + (AFNOHeaderHttpTool *)sharedInstance;
//POST请求 ////POST请求
-(void) postRequestWihtUrl:(NSString *)url //-(void) postRequestWihtUrl:(NSString *)url
keys:(NSArray *)keys // keys:(NSArray *)keys
values:(NSArray *)values // values:(NSArray *)values
success:(WBCallBackSuccess)success // success:(WBCallBackSuccess)success
failure:(WBCallBackFailed)failure; // failure:(WBCallBackFailed)failure;
/** /**
* *
* *

View File

@ -78,57 +78,57 @@
//POST //POST
-(void) postRequestWihtUrl:(NSString *)url //-(void) postRequestWihtUrl:(NSString *)url
keys:(NSArray *)keys // keys:(NSArray *)keys
values:(NSArray *)values // values:(NSArray *)values
success:(WBCallBackSuccess)success // success:(WBCallBackSuccess)success
failure:(WBCallBackFailed)failure // failure:(WBCallBackFailed)failure
{ //{
//
NSURLSession *session = [NSURLSession sharedSession]; // NSURLSession *session = [NSURLSession sharedSession];
NSMutableURLRequest *urlRequest = [self getUrlRequestWithPath:url keysArray:keys valuesArray:values]; // NSMutableURLRequest *urlRequest = [self getUrlRequestWithPath:url keysArray:keys valuesArray:values];
NSURLSessionDataTask *sessionDataTask = [session dataTaskWithRequest:urlRequest completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { // NSURLSessionDataTask *sessionDataTask = [session dataTaskWithRequest:urlRequest completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if ([data length] >0 && // if ([data length] >0 &&
error == nil){ // error == nil){
[SVProgressHUD dismissWithDelay:0.3]; // [SVProgressHUD dismissWithDelay:0.3];
id result=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil]; // id result=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
NSLog(@"获取数据 resalut = %@",result); // NSLog(@"获取数据 resalut = %@",result);
if ([result isKindOfClass:[NSDictionary class]]) { // if ([result isKindOfClass:[NSDictionary class]]) {
// NSString *resCode = [NSString stringWithFormat:@"%@",[result objectForKey:RESPONSE_CODE]];// //// NSString *resCode = [NSString stringWithFormat:@"%@",[result objectForKey:RESPONSE_CODE]];//
// // //// //
// if([resCode integerValue]==kReqSuccess) //// if([resCode integerValue]==kReqSuccess)
// { //// {
/** // /**
100 // 100
*/
dispatch_async(dispatch_get_main_queue(), ^{
//
success(result);
});
// }else{
// /*
//
// */ // */
// dispatch_async(dispatch_get_main_queue(), ^{ // dispatch_async(dispatch_get_main_queue(), ^{
// failure(result); // //
// success(result);
// }); // });
// } //// }else{
}else{ //// /*
NSLog(@"json格式错误"); ////
} //// */
}else if ([data length] == 0 && //// dispatch_async(dispatch_get_main_queue(), ^{
error == nil){ //// failure(result);
//0 //// });
[SVProgressHUD dismiss]; //// }
}else if (error != nil){ // }else{
// // NSLog(@"json格式错误");
if (error) { // }
[SVProgressHUD dismiss]; // }else if ([data length] == 0 &&
} // error == nil){
} // //0
}]; // [SVProgressHUD dismiss];
[sessionDataTask resume]; // }else if (error != nil){
} // //
// if (error) {
// [SVProgressHUD dismiss];
// }
// }
// }];
// [sessionDataTask resume];
//}
+(void) requestWihtMethod:(RequestType) +(void) requestWihtMethod:(RequestType)
methodType url : (NSString *)url methodType url : (NSString *)url
params:(NSDictionary *)params params:(NSDictionary *)params
@ -142,7 +142,7 @@ methodType url : (NSString *)url
AFHTTPRequestOperationManager*manager=[AFHTTPRequestOperationManager manager]; AFHTTPRequestOperationManager*manager=[AFHTTPRequestOperationManager manager];
// //
manager.responseSerializer=[AFHTTPResponseSerializer serializer]; manager.responseSerializer=[AFHTTPResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json",@"text/javascript",@"text/html", nil];;
//#ifdef ContentType //#ifdef ContentType
// manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:ContentType]; // manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:ContentType];
//#endif //#endif
@ -171,10 +171,12 @@ methodType url : (NSString *)url
[manager POST:url parameters:params [manager POST:url parameters:params
success:^(AFHTTPRequestOperation* operation, NSDictionary* responseObj) { success:^(AFHTTPRequestOperation* operation, NSDictionary* responseObj) {
if (success) { if (success) {
[SVProgressHUD dismiss];
success(responseObj); success(responseObj);
} }
} failure:^(AFHTTPRequestOperation* operation, NSError* error) { } failure:^(AFHTTPRequestOperation* operation, NSError* error) {
if (failure){ if (failure){
[SVProgressHUD dismiss];
failure(error); failure(error);
} }
}]; }];

View File

@ -268,20 +268,25 @@ extern BOOL launchedByNotification;
[SVProgressHUD show]; [SVProgressHUD show];
self.pushId = @""; self.pushId = @"";
UserModel*userModel=[dataContorl getUserInfo]; UserModel*userModel=[dataContorl getUserInfo];
NSArray *keys = @[@"pushId",@"userId",@"firstResult",@"pageSize"]; NSDictionary *params = @{@"pushId":self.pushId,
NSArray *values = @[self.pushId,userModel.userId,@"0",@"999"]; @"userId":userModel.userId,
@"firstResult":@(0),
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Url keys:keys values:values success:^(NSDictionary *successDic) { @"pageSize":@(999)
};
NSString *totalCount = [successDic objectForKey:@"total"]; [AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Url params:params success:^(id response) {
NSArray *dataArray = [successDic objectForKey:@"data"]; [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) { if ([totalCount integerValue]>0) {
NSMutableArray *newMessageArray = InitObject(NSMutableArray); NSMutableArray *newMessageArray = InitObject(NSMutableArray);
NSMutableArray *oldMessageArray = InitObject(NSMutableArray); NSMutableArray *oldMessageArray = InitObject(NSMutableArray);
for (int i=0; i<dataArray.count; i++) { for (int i=0; i<dataArray.count; i++) {
PushmessageModel *messageModel = [PushmessageModel yy_modelWithJSON:[dataArray objectAtIndex:i]]; PushmessageModel *messageModel = [PushmessageModel yy_modelWithJSON:[dataArray objectAtIndex:i]];
[messageModel getCellHeight]; [messageModel getCellHeight];
if ([messageModel.isRead integerValue]==1) {// if ([messageModel.isRead integerValue]==1) {//
[newMessageArray addObject:messageModel]; [newMessageArray addObject:messageModel];
}else{ }else{
@ -292,12 +297,11 @@ extern BOOL launchedByNotification;
[self.dataSource addObject:oldMessageArray]; [self.dataSource addObject:oldMessageArray];
} }
[self.tableView reloadData]; [self.tableView reloadData];
}
} failure:^(NSError *err) {
} failure:^(NSDictionary *errorDic) { [SVProgressHUD dismiss];
}]; }];
} }
// //
-(void)postReadMessageRequestWithIndexPath:(NSIndexPath *)indexPath{ -(void)postReadMessageRequestWithIndexPath:(NSIndexPath *)indexPath{
@ -305,20 +309,21 @@ extern BOOL launchedByNotification;
PushmessageModel *model = [[self.dataSource objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]; PushmessageModel *model = [[self.dataSource objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
if([model.isRead integerValue]==1)// if([model.isRead integerValue]==1)//
{ {
NSDictionary *params = @{@"userId":userModel.userId,
NSArray *keys = @[@"userId",@"pushId"]; @"pushId":model.pushId,
NSArray *values = @[userModel.userId,self.pushId]; };
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Readed params:params success:^(id response) {
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Readed keys:keys values:values success:^(NSDictionary *successDic) { if (response) {
id resault=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSString *result = [successDic objectForKey:RESPONSE_CODE]; NSString *result = [resault objectForKey:RESPONSE_CODE];
if ([result integerValue]==kReqSuccess) { if ([result integerValue]==kReqSuccess) {
// //
}else{ }else{
} }
} failure:^(NSDictionary *errorDic) { }
} failure:^(NSError *err) {
}]; }];
} }
} }
@ -329,29 +334,27 @@ extern BOOL launchedByNotification;
PushmessageModel *model = [[self.dataSource objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]; PushmessageModel *model = [[self.dataSource objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
NSMutableDictionary *deleteDic = InitObject(NSMutableDictionary); NSMutableDictionary *deleteDic = InitObject(NSMutableDictionary);
[deleteDic setValue:model.pushId forKey:@"pushId"]; [deleteDic setValue:model.pushId forKey:@"pushId"];
NSArray *keys = @[@"userId",@"pushIds"]; NSDictionary *params = @{@"userId":userModel.userId,
NSArray *values = @[userModel.userId,[CommonUtils arrayToJSONString:@[deleteDic]]]; @"pushIds":[CommonUtils arrayToJSONString:@[deleteDic]]
};
[SVProgressHUD show]; [SVProgressHUD show];
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Delete_Url keys:keys values:values success:^(NSDictionary *successDic) { [AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Delete_Url params:params success:^(id response) {
if (response) {
NSString *result = [successDic objectForKey:RESPONSE_CODE]; id resault=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
if ([result integerValue]==kReqSuccess) { NSString *result = [resault objectForKey:RESPONSE_CODE];
[[self.dataSource objectAtIndex:indexPath.section] removeObjectAtIndex:indexPath.row]; if ([result integerValue]==kReqSuccess) {
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; [[self.dataSource objectAtIndex:indexPath.section] removeObjectAtIndex:indexPath.row];
// // [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
// [self.tableView reloadData]; // //
// [self.tableView scrollsToTop]; // [self.tableView reloadData];
}else{ // [self.tableView scrollsToTop];
[SVProgressHUD showInfoWithStatus:@"删除失败"]; }else{
[SVProgressHUD showInfoWithStatus:@"删除失败"];
}
} }
} failure:^(NSDictionary *errorDic) { } failure:^(NSError *err) {
[SVProgressHUD showInfoWithStatus:@"删除失败"]; [SVProgressHUD showInfoWithStatus:@"删除失败"];
// self.deleteBtn.selected = NO;
// [self.deleteView setHidden:YES];
// [self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
// make.bottom.mas_equalTo(self.view);
// }];
}]; }];
} }
//() //()
@ -364,48 +367,47 @@ extern BOOL launchedByNotification;
[deleteDic setValue:pushId forKey:@"pushId"]; [deleteDic setValue:pushId forKey:@"pushId"];
[deleteArray addObject:deleteDic]; [deleteArray addObject:deleteDic];
} }
NSArray *keys = @[@"userId",@"pushIds"]; NSDictionary *params = @{@"userId":userModel.userId,
NSArray *values = @[userModel.userId,[CommonUtils arrayToJSONString:deleteArray]]; @"pushIds":[CommonUtils arrayToJSONString:deleteArray]
};
[SVProgressHUD show]; [SVProgressHUD show];
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_Message_Delete_Url keys:keys values:values success:^(NSDictionary *successDic) { [AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Delete_Url params:params success:^(id response) {
if (response) {
NSString *result = [successDic objectForKey:RESPONSE_CODE]; id successDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
if ([result integerValue]==kReqSuccess) { NSString *result = [successDic objectForKey:RESPONSE_CODE];
self.deleteBtn.selected = NO; if ([result integerValue]==kReqSuccess) {
for (int i=0;i< self.dataSource.count;i++) { self.deleteBtn.selected = NO;
NSArray *arr = [self.dataSource objectAtIndex:i]; for (int i=0;i< self.dataSource.count;i++) {
NSMutableArray *newArray = InitObject(NSMutableArray); NSArray *arr = [self.dataSource objectAtIndex:i];
for (int j=0; j<arr.count; j++) { NSMutableArray *newArray = InitObject(NSMutableArray);
PushmessageModel *model = [arr objectAtIndex:j]; for (int j=0; j<arr.count; j++) {
if ([self.deleteArray containsObject:model.pushId]) { PushmessageModel *model = [arr objectAtIndex:j];
if ([self.deleteArray containsObject:model.pushId]) {
}else{
[newArray addObject:model]; }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:@"删除失败"]; [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 { - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

View File

@ -138,24 +138,25 @@ Assign NSInteger messageCount;//消息个数
// //
-(void)getMessageCount{ -(void)getMessageCount{
UserModel*userModel=[dataContorl getUserInfo]; UserModel*userModel=[dataContorl getUserInfo];
NSArray *keys = @[@"userId"];
NSArray *values = @[userModel.userId];
[[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]; NSString *result = [successDic objectForKey:RESPONSE_CODE];
NSDictionary *dic = [successDic objectForKey:RESPONSE_DATA]; NSDictionary *dic = [successDic objectForKey:RESPONSE_DATA];
if ([result integerValue]==kReqSuccess) { if ([result integerValue]==kReqSuccess) {
NSString *count = [dic objectForKey:@"messageNoReadCount"]; NSString *count = [dic objectForKey:@"messageNoReadCount"];
self.messageCount = [count integerValue]; self.messageCount = [count integerValue];
} }
[self setRedViewData]; [self setRedViewData];
}
} failure:^(NSDictionary *errorDic) { } failure:^(NSError *err) {
}]; }];
} }
#pragma mark - 广 #pragma mark - 广

View File

@ -295,13 +295,14 @@
//devicetokendevicetoken //devicetokendevicetoken
if (![[NSUserDefaults standardUserDefaults] boolForKey:is_Bind_DeviceToken]) { if (![[NSUserDefaults standardUserDefaults] boolForKey:is_Bind_DeviceToken]) {
UserModel *model=[[UserModel alloc] initWithDict:DataDic]; UserModel *model=[[UserModel alloc] initWithDict:DataDic];
NSArray *keys = @[@"deviceId",@"userId"]; NSDictionary *params = @{@"deviceId":[FuncUserDefault strForKey:kDeviceToken],
NSArray *values = @[[FuncUserDefault strForKey:kDeviceToken],model.userId]; @"userId":model.userId,
@"phoneType":@"iOS"
[[AFNOHeaderHttpTool sharedInstance] postRequestWihtUrl:Push_BindDevice_Url keys:keys values:values success:^(NSDictionary *successDic){ };
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_BindDevice_Url params:params success:^(id response) {
// //
[FuncUserDefault setBool:YES key:is_Bind_DeviceToken];//devicetoken [FuncUserDefault setBool:YES key:is_Bind_DeviceToken];//devicetoken
} failure:^(NSDictionary *errorDic) { } failure:^(NSError *err) {
}]; }];
} }