|
@@ -122,11 +122,6 @@
|
|
|
|
|
|
|
|
+ (NSDictionary *)requestLogin:(NSString *)user password:(NSString *)pwd {
|
|
+ (NSDictionary *)requestLogin:(NSString *)user password:(NSString *)pwd {
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-// return @{
|
|
|
|
|
-// @"result" : @(RESULT_TRUE)
|
|
|
|
|
-// };
|
|
|
|
|
-
|
|
|
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
user = [[RASingleton sharedInstance] encryptString:user];
|
|
user = [[RASingleton sharedInstance] encryptString:user];
|
|
@@ -179,11 +174,6 @@
|
|
|
|
|
|
|
|
+ (NSDictionary *)requestOrderList {
|
|
+ (NSDictionary *)requestOrderList {
|
|
|
|
|
|
|
|
-// sleep(3.0);
|
|
|
|
|
-// return [self loadFakeData:@"fake_order_list.json"];
|
|
|
|
|
-// return [self fakeError];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -194,11 +184,6 @@
|
|
|
|
|
|
|
|
+ (NSDictionary *)requestMoreOrder:(NSInteger)orderType offset:(NSInteger)offset limit:(NSInteger)limit {
|
|
+ (NSDictionary *)requestMoreOrder:(NSInteger)orderType offset:(NSInteger)offset limit:(NSInteger)limit {
|
|
|
|
|
|
|
|
-// sleep(2.0);
|
|
|
|
|
-// return [self loadFakeData:@"fake_more_order.json"];
|
|
|
|
|
- // return [self fakeError];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
[params setObject:@(orderType) forKey:@"type"];
|
|
[params setObject:@(orderType) forKey:@"type"];
|
|
|
[params setObject:@(offset) forKey:@"offset"];
|
|
[params setObject:@(offset) forKey:@"offset"];
|
|
@@ -211,10 +196,6 @@
|
|
|
|
|
|
|
|
+ (NSDictionary *)requestOrderDetail:(NSString *)orderID type:(NSInteger)type type2:(NSString *)type2 {
|
|
+ (NSDictionary *)requestOrderDetail:(NSString *)orderID type:(NSInteger)type type2:(NSString *)type2 {
|
|
|
|
|
|
|
|
-// sleep(3.0);
|
|
|
|
|
-// return [self loadFakeData:@"fake_order_detail.json"];
|
|
|
|
|
-// return [self fakeError];
|
|
|
|
|
-
|
|
|
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
if (orderID) {
|
|
if (orderID) {
|
|
|
[params setObject:orderID forKey:@"orderID"];
|
|
[params setObject:orderID forKey:@"orderID"];
|
|
@@ -231,10 +212,6 @@
|
|
|
|
|
|
|
|
+ (NSDictionary *)requestUpdateOrder:(NSString *)orderID driverAction:(NSInteger)action {
|
|
+ (NSDictionary *)requestUpdateOrder:(NSString *)orderID driverAction:(NSInteger)action {
|
|
|
|
|
|
|
|
-// sleep(3.0);
|
|
|
|
|
-// return [self loadFakeData:@"fake_order_edit.json"];
|
|
|
|
|
-// return [self fakeError];
|
|
|
|
|
-
|
|
|
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
if (orderID) {
|
|
if (orderID) {
|
|
|
[params setObject:orderID forKey:@"orderID"];
|
|
[params setObject:orderID forKey:@"orderID"];
|
|
@@ -249,9 +226,6 @@
|
|
|
|
|
|
|
|
+ (NSDictionary *)reportAcionToURL:(NSString *)url withParams:(NSMutableDictionary *)params {
|
|
+ (NSDictionary *)reportAcionToURL:(NSString *)url withParams:(NSMutableDictionary *)params {
|
|
|
|
|
|
|
|
-// sleep(3.0);
|
|
|
|
|
-// return @{@"result" : @2};
|
|
|
|
|
-
|
|
|
|
|
NSData* json=[self get_json:url parameters:params file:nil];
|
|
NSData* json=[self get_json:url parameters:params file:nil];
|
|
|
|
|
|
|
|
return [self handleJsonData:json];
|
|
return [self handleJsonData:json];
|
|
@@ -259,21 +233,6 @@
|
|
|
|
|
|
|
|
+ (NSDictionary *)submitEditOrder:(NSMutableDictionary *)params {
|
|
+ (NSDictionary *)submitEditOrder:(NSMutableDictionary *)params {
|
|
|
|
|
|
|
|
-// sleep(3);
|
|
|
|
|
-//
|
|
|
|
|
-// return [self fakeError];
|
|
|
|
|
-//
|
|
|
|
|
-// NSMutableDictionary *result = [NSMutableDictionary dictionary];
|
|
|
|
|
-// [result setObject:@(2) forKey:@"result"];
|
|
|
|
|
-// for (NSString *key in params.allKeys) {
|
|
|
|
|
-// if ([key hasPrefix:@"container_photo"]) {
|
|
|
|
|
-// [result setObject:[NSUUID UUID].UUIDString forKey:key];
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// return result;
|
|
|
|
|
-
|
|
|
|
|
- // ============
|
|
|
|
|
-
|
|
|
|
|
if (![params isKindOfClass:[NSMutableDictionary class]]) {
|
|
if (![params isKindOfClass:[NSMutableDictionary class]]) {
|
|
|
params = [params mutableCopy];
|
|
params = [params mutableCopy];
|
|
|
}
|
|
}
|
|
@@ -295,24 +254,17 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ (NSDictionary *)uploadFile:(NSString *)filePath parameters:(NSMutableDictionary *)params {
|
|
+ (NSDictionary *)uploadFile:(NSString *)filePath parameters:(NSMutableDictionary *)params {
|
|
|
-
|
|
|
|
|
-// sleep(3.0f);
|
|
|
|
|
-
|
|
|
|
|
-// int i = arc4random_uniform(100);
|
|
|
|
|
-// if (i % 2 == 0) {
|
|
|
|
|
-// return @{@"result" : @2};
|
|
|
|
|
-// } else {
|
|
|
|
|
-// return @{@"result" : @1};
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
return [self upload:URL_UPLOAD parameters:params file:filePath];
|
|
return [self upload:URL_UPLOAD parameters:params file:filePath];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ (NSDictionary *)reportCurrentLocation:(NSString *)location {
|
|
+ (NSDictionary *)reportCurrentLocation:(NSString *)location {
|
|
|
|
|
|
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
|
|
+ if (location) {
|
|
|
|
|
+ [params setObject:location forKey:@"location"];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- NSData* json=[self get_json:URL_HOST parameters:params file:nil];
|
|
|
|
|
|
|
+ NSData* json=[self get_json:URL_REPORT_LOCATION parameters:params file:nil];
|
|
|
|
|
|
|
|
return [self handleJsonData:json];
|
|
return [self handleJsonData:json];
|
|
|
}
|
|
}
|
|
@@ -326,7 +278,7 @@
|
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
[params setObject:token forKey:@"token"];
|
|
[params setObject:token forKey:@"token"];
|
|
|
|
|
|
|
|
- NSData* json=[self get_json:URL_HOST parameters:params file:nil];
|
|
|
|
|
|
|
+ NSData* json=[self get_json:URL_REPORT_TOKEN parameters:params file:nil];
|
|
|
|
|
|
|
|
return [self handleJsonData:json];
|
|
return [self handleJsonData:json];
|
|
|
}
|
|
}
|
|
@@ -347,17 +299,14 @@
|
|
|
return [self handleJsonData:jsonData];
|
|
return [self handleJsonData:jsonData];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (NSDictionary *)fakeError {
|
|
|
|
|
|
|
+//+ (NSDictionary *)fakeError {
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
// return @{
|
|
// return @{
|
|
|
-// @"result" : @0,
|
|
|
|
|
-// @"err_msg" : @"server error,please try later."
|
|
|
|
|
|
|
+// @"container_photo_0": @"12346798",
|
|
|
|
|
+// @"container_photo_1": @"78945612",
|
|
|
|
|
+// @"result": @2
|
|
|
// };
|
|
// };
|
|
|
-
|
|
|
|
|
- return @{
|
|
|
|
|
- @"container_photo_0": @"12346798",
|
|
|
|
|
- @"container_photo_1": @"78945612",
|
|
|
|
|
- @"result": @2
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
|
|
+//}
|
|
|
|
|
|
|
|
@end
|
|
@end
|