Commit 6218ab28 authored by 曹云霄's avatar 曹云霄

修改项说明:优化代码

parent 8f99944d
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(GETSHOPPERSCONSUMER) WithCallClass:weakSelf WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(GETSHOPPERSCONSUMER) WithRequestType:ZERO WithParameter:condition WithReturnValueBlock:^(id returnValue) {
weakSelf.allCustomerTableview.emptyDataSetSource = weakSelf; weakSelf.allCustomerTableview.emptyDataSetSource = weakSelf;
weakSelf.allCustomerTableview.emptyDataSetDelegate = weakSelf; weakSelf.allCustomerTableview.emptyDataSetDelegate = weakSelf;
...@@ -187,11 +187,7 @@ ...@@ -187,11 +187,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:weakSelf.allCustomerTableview]; [weakSelf endRefreshingForTableView:weakSelf.allCustomerTableview];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
weakSelf.beenUseCardCollectionView.emptyDataSetSource = self; weakSelf.beenUseCardCollectionView.emptyDataSetSource = self;
...@@ -115,12 +115,7 @@ ...@@ -115,12 +115,7 @@
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView]; [weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
...@@ -132,7 +127,7 @@ ...@@ -132,7 +127,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithCallClass:weakSelf WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -140,10 +135,7 @@ ...@@ -140,10 +135,7 @@
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
NSLog(@"%@",[self.requestModel toDictionary]); NSLog(@"%@",[self.requestModel toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
weakSelf.dontUseCardCollectionView.emptyDataSetSource = weakSelf; weakSelf.dontUseCardCollectionView.emptyDataSetSource = weakSelf;
...@@ -133,12 +133,7 @@ ...@@ -133,12 +133,7 @@
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView]; [weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
...@@ -245,7 +240,7 @@ ...@@ -245,7 +240,7 @@
{ {
WS(weakSelf); WS(weakSelf);
NSData *data = UIImageJPEGRepresentation(image, 0.5); NSData *data = UIImageJPEGRepresentation(image, 0.5);
[[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:1 WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:ONE WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf activationJDECard:returnValue[@"data"]]; [weakSelf activationJDECard:returnValue[@"data"]];
...@@ -255,8 +250,6 @@ ...@@ -255,8 +250,6 @@
} }
} WithprogressBlock:^(double progress) { } WithprogressBlock:^(double progress) {
[weakSelf ShowProgressView:progress]; [weakSelf ShowProgressView:progress];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -267,7 +260,7 @@ ...@@ -267,7 +260,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(ACTIVIATIONJDECARD),self.orderNumber,imagePath] WithCallClass:weakSelf WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(ACTIVIATIONJDECARD),self.orderNumber,imagePath] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -279,9 +272,6 @@ ...@@ -279,9 +272,6 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
- (void)getCardDatasAction - (void)getCardDatasAction
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(QUERYALLJDECARD) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(QUERYALLJDECARD) WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
weakSelf.cardCollectionView.emptyDataSetSource = weakSelf; weakSelf.cardCollectionView.emptyDataSetSource = weakSelf;
weakSelf.cardCollectionView.emptyDataSetDelegate = weakSelf; weakSelf.cardCollectionView.emptyDataSetDelegate = weakSelf;
...@@ -78,9 +78,7 @@ ...@@ -78,9 +78,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
...@@ -90,7 +88,7 @@ ...@@ -90,7 +88,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithCallClass:weakSelf WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -98,10 +96,7 @@ ...@@ -98,10 +96,7 @@
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
//修改密码 //修改密码
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(MODIFYPASSWORD) WithCallClass:weakSelf WithRequestType:0 WithParameter:modify WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(MODIFYPASSWORD) WithRequestType:ZERO WithParameter:modify WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -98,17 +98,10 @@ ...@@ -98,17 +98,10 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
NSLog(@"%@",error); NSLog(@"%@",error);
}]; }];
} }
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SHOPPINGBAG) WithCallClass:weakSelf WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SHOPPINGBAG) WithRequestType:ZERO WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
weakSelf.clientShoppingCarTableView.emptyDataSetSource = weakSelf; weakSelf.clientShoppingCarTableView.emptyDataSetSource = weakSelf;
weakSelf.clientShoppingCarTableView.emptyDataSetDelegate = weakSelf; weakSelf.clientShoppingCarTableView.emptyDataSetDelegate = weakSelf;
...@@ -110,10 +110,7 @@ ...@@ -110,10 +110,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(GETSHOPPERSCONSUMER) WithCallClass:weakSelf WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(GETSHOPPERSCONSUMER) WithRequestType:ZERO WithParameter:condition WithReturnValueBlock:^(id returnValue) {
weakSelf.informationTableview.emptyDataSetSource = weakSelf; weakSelf.informationTableview.emptyDataSetSource = weakSelf;
weakSelf.informationTableview.emptyDataSetDelegate = weakSelf; weakSelf.informationTableview.emptyDataSetDelegate = weakSelf;
...@@ -205,12 +205,7 @@ ...@@ -205,12 +205,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf promptCustomerWithString:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.informationTableview]; [weakSelf endRefreshingForTableView:weakSelf.informationTableview];
...@@ -425,7 +420,7 @@ ...@@ -425,7 +420,7 @@
{ {
NSData *data = UIImageJPEGRepresentation(image, 0.5); NSData *data = UIImageJPEGRepresentation(image, 0.5);
__weak typeof(self) weskSelf = self; __weak typeof(self) weskSelf = self;
[[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:1 WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:ONE WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weskSelf modifyshoppersInformation:returnValue[@"data"] complete:^{ [weskSelf modifyshoppersInformation:returnValue[@"data"] complete:^{
...@@ -444,10 +439,7 @@ ...@@ -444,10 +439,7 @@
{ {
[weskSelf ShowProgressView:progress]; [weskSelf ShowProgressView:progress];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
weskSelf.TCHud.labelText = @"上传失败";
[weskSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
weskSelf.TCHud.labelText = @"上传失败"; weskSelf.TCHud.labelText = @"上传失败";
[weskSelf RemoveMBProgressHUDLoding]; [weskSelf RemoveMBProgressHUDLoding];
}]; }];
...@@ -462,7 +454,7 @@ ...@@ -462,7 +454,7 @@
customerEntity = [Customermanager manager].model; customerEntity = [Customermanager manager].model;
customerEntity.picture = headerurl; customerEntity.picture = headerurl;
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDCONSUMER) WithCallClass:weakSelf WithRequestType:0 WithParameter:customerEntity WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDCONSUMER) WithRequestType:ZERO WithParameter:customerEntity WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -472,11 +464,7 @@ ...@@ -472,11 +464,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -505,16 +493,11 @@ ...@@ -505,16 +493,11 @@
{ {
WS(weakSelf); WS(weakSelf);
MyclientEntityModel *model = [Customermanager manager].model; MyclientEntityModel *model = [Customermanager manager].model;
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SAVEVISITEDTIME),model.fid] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SAVEVISITEDTIME),model.fid] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"写入客户访问时间成功"); NSLog(@"写入客户访问时间成功");
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
NSLog(@"写入客户访问时间失败"); NSLog(@"写入客户访问时间失败");
...@@ -603,7 +586,7 @@ ...@@ -603,7 +586,7 @@
} }
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDCONSUMER) WithCallClass:weakSelf WithRequestType:0 WithParameter:customerEntity WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDCONSUMER) WithRequestType:ZERO WithParameter:customerEntity WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -638,13 +621,7 @@ ...@@ -638,13 +621,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(id error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
}]; }];
} }
...@@ -660,7 +637,7 @@ ...@@ -660,7 +637,7 @@
address.miblephone = self.phoneNumberField.text; address.miblephone = self.phoneNumberField.text;
address.address = self.customerAddress.text; address.address = self.customerAddress.text;
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDADDRESS) WithCallClass:weakSelf WithRequestType:0 WithParameter:address WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDADDRESS) WithRequestType:ZERO WithParameter:address WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -670,12 +647,7 @@ ...@@ -670,12 +647,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(id error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf promptCustomerWithString:@"网络连接已断开"];
} WithFailureBlock:^(id error) {
NSLog(@"写入默认收货地址失败"); NSLog(@"写入默认收货地址失败");
}]; }];
......
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(QUERYORDER) WithCallClass:weakSelf WithRequestType:0 WithParameter:allOrder WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(QUERYORDER) WithRequestType:ZERO WithParameter:allOrder WithReturnValueBlock:^(id returnValue) {
weakSelf.customerOrderTableView.emptyDataSetSource = weakSelf; weakSelf.customerOrderTableView.emptyDataSetSource = weakSelf;
weakSelf.customerOrderTableView.emptyDataSetDelegate = weakSelf; weakSelf.customerOrderTableView.emptyDataSetDelegate = weakSelf;
...@@ -174,11 +174,7 @@ ...@@ -174,11 +174,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:weakSelf.customerOrderTableView]; [weakSelf endRefreshingForTableView:weakSelf.customerOrderTableView];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
}]; }];
...@@ -338,7 +334,7 @@ ...@@ -338,7 +334,7 @@
[weakSelf CreateMBProgressHUDLoding]; [weakSelf CreateMBProgressHUDLoding];
OrderBill *model = [weakSelf.datasArray objectAtIndex_opple:cellindex]; OrderBill *model = [weakSelf.datasArray objectAtIndex_opple:cellindex];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@",SERVERREQUESTURL(RESETORDER),model.order.orderNumber,model.order.orderState,@"005"] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@",SERVERREQUESTURL(RESETORDER),model.order.orderNumber,model.order.orderState,@"005"] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -352,10 +348,7 @@ ...@@ -352,10 +348,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[self RemoveMBProgressHUDLoding];
[self ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
login.username = self.userName.text; login.username = self.userName.text;
login.password = self.passWord.text; login.password = self.passWord.text;
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOGIN) WithCallClass:weakSelf WithRequestType:0 WithParameter:login WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOGIN) WithRequestType:ZERO WithParameter:login WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -218,11 +218,7 @@ ...@@ -218,11 +218,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -334,7 +330,7 @@ ...@@ -334,7 +330,7 @@
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
//发送验证码 //发送验证码
NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(SENDSMS),inputPhoneNumber,self.identityView.userName.text]; NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(SENDSMS),inputPhoneNumber,self.identityView.userName.text];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:urlString WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:urlString WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf ErrorMBProgressView:@"发送验证码成功"]; [weakSelf ErrorMBProgressView:@"发送验证码成功"];
...@@ -345,10 +341,7 @@ ...@@ -345,10 +341,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -426,7 +419,7 @@ ...@@ -426,7 +419,7 @@
passwrod.username = self.userName.text; passwrod.username = self.userName.text;
passwrod.smsCode = self.identityView.verificationCode.text; passwrod.smsCode = self.identityView.verificationCode.text;
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(RESETPASSWORD) WithCallClass:weakSelf WithRequestType:0 WithParameter:passwrod WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(RESETPASSWORD) WithRequestType:ZERO WithParameter:passwrod WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -438,9 +431,6 @@ ...@@ -438,9 +431,6 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
...@@ -475,7 +465,7 @@ ...@@ -475,7 +465,7 @@
//获取服务端版本大小 //获取服务端版本大小
WS(weakSelf); WS(weakSelf);
NSString *string = [NSString stringWithFormat:@"/employee/getUpgrade?apptype=IOS&version=%@",version]; NSString *string = [NSString stringWithFormat:@"/employee/getUpgrade?apptype=IOS&version=%@",version];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(string) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(string) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSDictionary *dict = returnValue[@"data"]; NSDictionary *dict = returnValue[@"data"];
...@@ -492,9 +482,6 @@ ...@@ -492,9 +482,6 @@
} }
[weakSelf presentViewController:alertVC animated:YES completion:nil]; [weakSelf presentViewController:alertVC animated:YES completion:nil];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:@"网络不可用,请检查网络连接"];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.drawModel WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithRequestType:ZERO WithParameter:self.drawModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.drawDetailsTableView]; [weakSelf endRefreshingForTableView:weakSelf.drawDetailsTableView];
...@@ -145,10 +145,6 @@ ...@@ -145,10 +145,6 @@
}else { }else {
[weakSelf SHOWPrompttext:returnValue[@"message"]]; [weakSelf SHOWPrompttext:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(QUERYORDER) WithCallClass:weakSelf WithRequestType:0 WithParameter:allOrder WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(QUERYORDER) WithRequestType:ZERO WithParameter:allOrder WithReturnValueBlock:^(id returnValue) {
weakSelf.orderRecordTableView.emptyDataSetSource = weakSelf; weakSelf.orderRecordTableView.emptyDataSetSource = weakSelf;
weakSelf.orderRecordTableView.emptyDataSetDelegate = weakSelf; weakSelf.orderRecordTableView.emptyDataSetDelegate = weakSelf;
...@@ -96,10 +96,7 @@ ...@@ -96,10 +96,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -192,7 +192,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -192,7 +192,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
// 订单详情 // 订单详情
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(ORDERDETAILS),self.orderCode] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(ORDERDETAILS),self.orderCode] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
dispatch_group_leave(group); dispatch_group_leave(group);
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -200,10 +200,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -200,10 +200,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group);
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
...@@ -213,7 +210,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -213,7 +210,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
if (self.isShowPayButton) { if (self.isShowPayButton) {
// 查询实时促销信息 // 查询实时促销信息
dispatch_group_enter(group); dispatch_group_enter(group);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(PROMOTIONAL),self.orderCode] WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(PROMOTIONAL),self.orderCode] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
...@@ -249,11 +246,6 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -249,11 +246,6 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
...@@ -263,7 +255,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -263,7 +255,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
}else { }else {
// 查询历史促销信息 // 查询历史促销信息
dispatch_group_enter(group); dispatch_group_enter(group);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(OLDPROMOTIONAL),self.orderCode] WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(OLDPROMOTIONAL),self.orderCode] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
...@@ -336,12 +328,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -336,12 +328,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[self.sectionTitle addObject:@"促销信息"]; [self.sectionTitle addObject:@"促销信息"];
} }
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
...@@ -361,17 +348,12 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -361,17 +348,12 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
page.page = ZERO; page.page = ZERO;
page.rows = ONE; page.rows = ONE;
queryDrawState.page = page; queryDrawState.page = page;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:queryDrawState WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithRequestType:ZERO WithParameter:queryDrawState WithReturnValueBlock:^(id returnValue) {
dispatch_group_leave(group); dispatch_group_leave(group);
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSDictionary *dict = [returnValue[@"data"][@"list"] firstObject]; NSDictionary *dict = [returnValue[@"data"][@"list"] firstObject];
resultModel = [[RsAwardDraw alloc]initWithDictionary:dict error:nil]; resultModel = [[RsAwardDraw alloc]initWithDictionary:dict error:nil];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group); dispatch_group_leave(group);
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
...@@ -552,7 +534,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -552,7 +534,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:USEWECHATCARD,number,orderNumber,orderTotal] WithCallClass:weakSelf WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:USEWECHATCARD,number,orderNumber,orderTotal] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -574,11 +556,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -574,11 +556,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[weakSelf scanWeChatCardNumber:weakSelf.tempWeChatModel]; [weakSelf scanWeChatCardNumber:weakSelf.tempWeChatModel];
}]; }];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -1052,7 +1030,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -1052,7 +1030,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) [alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action)
{ {
[weakSelf CreateMBProgressHUDLoding]; [weakSelf CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@",SERVERREQUESTURL(RESETORDER),_orderCode,@"001",@"005"] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@",SERVERREQUESTURL(RESETORDER),_orderCode,@"001",@"005"] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf SuccessMBProgressView:@"撤销成功"]; [weakSelf SuccessMBProgressView:@"撤销成功"];
...@@ -1070,10 +1048,6 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -1070,10 +1048,6 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
} else { } else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PAYMENTS) WithCallClass:weakSelf WithRequestType:0 WithParameter:self.model WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PAYMENTS) WithRequestType:ZERO WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
weakSelf.paymentsTableView.emptyDataSetSource = self; weakSelf.paymentsTableView.emptyDataSetSource = self;
weakSelf.paymentsTableView.emptyDataSetDelegate = self; weakSelf.paymentsTableView.emptyDataSetDelegate = self;
...@@ -120,11 +120,7 @@ ...@@ -120,11 +120,7 @@
[weakSelf SHOWPrompttext:returnValue[@"message"]]; [weakSelf SHOWPrompttext:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView]; [weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[weakSelf SHOWPrompttext:error.localizedDescription]; [weakSelf SHOWPrompttext:error.localizedDescription];
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
NSString *url = [NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(GOODSDETAILS),_goodsID]; NSString *url = [NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(GOODSDETAILS),_goodsID];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -103,11 +103,7 @@ ...@@ -103,11 +103,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -385,7 +381,7 @@ ...@@ -385,7 +381,7 @@
shopCar.count = self.headerView.goodsNumber.text; shopCar.count = self.headerView.goodsNumber.text;
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithCallClass:weakSelf WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithRequestType:ZERO WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -395,11 +391,7 @@ ...@@ -395,11 +391,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(id error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"添加购物车失败"]; [weakSelf ErrorMBProgressView:@"添加购物车失败"];
}]; }];
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
- (void)getScreeningdatasisRemoveArray:(BOOL)remove - (void)getScreeningdatasisRemoveArray:(BOOL)remove
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) { if (remove) {
...@@ -156,9 +156,7 @@ ...@@ -156,9 +156,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
} }
...@@ -170,7 +168,7 @@ ...@@ -170,7 +168,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PRODUCTLIST) WithCallClass:weakSelf WithRequestType:0 WithParameter:conditon WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PRODUCTLIST) WithRequestType:ZERO WithParameter:conditon WithReturnValueBlock:^(id returnValue) {
weakSelf.productCollectionView.emptyDataSetSource = weakSelf; weakSelf.productCollectionView.emptyDataSetSource = weakSelf;
weakSelf.productCollectionView.emptyDataSetDelegate = weakSelf; weakSelf.productCollectionView.emptyDataSetDelegate = weakSelf;
...@@ -188,11 +186,7 @@ ...@@ -188,11 +186,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.productCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
[weakSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -340,7 +334,7 @@ ...@@ -340,7 +334,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(BARCODESEARCH),_barcode] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(BARCODESEARCH),_barcode] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf endRefreshingForTableView:self.productCollectionView]; [weakSelf endRefreshingForTableView:self.productCollectionView];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
...@@ -359,13 +353,7 @@ ...@@ -359,13 +353,7 @@
[weakSelf ErrorMBProgressView:@"查询失败"]; [weakSelf ErrorMBProgressView:@"查询失败"];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:self.productCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:self.productCollectionView]; [weakSelf endRefreshingForTableView:self.productCollectionView];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
...@@ -721,17 +709,14 @@ ...@@ -721,17 +709,14 @@
shopCar.consumerId = [Customermanager manager].model.fid; shopCar.consumerId = [Customermanager manager].model.fid;
shopCar.goodsId = model.fid; shopCar.goodsId = model.fid;
shopCar.count = @"1"; shopCar.count = @"1";
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithCallClass:weakSelf WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithRequestType:ZERO WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
response(); response();
}else }else
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"加入购物车失败"]; [weakSelf ErrorMBProgressView:@"加入购物车失败"];
}]; }];
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:[NSString stringWithFormat:@"请确认提现金额:%@元",self.inputRebateTextField.text] preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:[NSString stringWithFormat:@"请确认提现金额:%@元",self.inputRebateTextField.text] preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[weakSelf CreateMBProgressHUDLoding]; [weakSelf CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(WITHDRAWAL) WithCallClass:weakSelf WithRequestType:0 WithParameter:@{@"amount":self.inputRebateTextField.text} WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(WITHDRAWAL) WithRequestType:ZERO WithParameter:@{@"amount":self.inputRebateTextField.text} WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -60,10 +60,7 @@ ...@@ -60,10 +60,7 @@
{ {
[weakSelf SHOWPrompttext:returnValue[@"message"]]; [weakSelf SHOWPrompttext:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription]; [weakSelf SHOWPrompttext:error.localizedDescription];
}]; }];
...@@ -101,7 +98,7 @@ ...@@ -101,7 +98,7 @@
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
NSString *urlString = [NSString stringWithFormat:@"%@/%@",WITHDRAWALPROGRESSDETAILS,self.applyUUID]; NSString *urlString = [NSString stringWithFormat:@"%@/%@",WITHDRAWALPROGRESSDETAILS,self.applyUUID];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(urlString) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(urlString) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
TOApplyBillEntity *result = [[TOApplyBillEntity alloc]initWithDictionary:returnValue[@"data"] error:nil]; TOApplyBillEntity *result = [[TOApplyBillEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
...@@ -113,10 +110,7 @@ ...@@ -113,10 +110,7 @@
{ {
[weakSelf SHOWPrompttext:returnValue[@"message"]]; [weakSelf SHOWPrompttext:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription]; [weakSelf SHOWPrompttext:error.localizedDescription];
}]; }];
......
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
NSString *URL = [NSString stringWithFormat:@"%@/%@",REBATE,[Shoppersmanager manager].Shoppers.employee.fid]; NSString *URL = [NSString stringWithFormat:@"%@/%@",REBATE,[Shoppersmanager manager].Shoppers.employee.fid];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(URL) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(URL) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -220,10 +220,7 @@ ...@@ -220,10 +220,7 @@
[weakSelf SHOWPrompttext:returnValue[@"message"]]; [weakSelf SHOWPrompttext:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription]; [weakSelf SHOWPrompttext:error.localizedDescription];
}]; }];
......
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
- (void)getdatasAction - (void)getdatasAction
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -170,10 +170,7 @@ ...@@ -170,10 +170,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
}]; }];
} }
...@@ -184,7 +181,7 @@ ...@@ -184,7 +181,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENELIST) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:condition WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENELIST) WithRequestType:ZERO WithParameter:condition WithReturnValueBlock:^(id returnValue) {
weakSelf.seceneLibararyCollectionView.emptyDataSetSource = weakSelf; weakSelf.seceneLibararyCollectionView.emptyDataSetSource = weakSelf;
weakSelf.seceneLibararyCollectionView.emptyDataSetDelegate = weakSelf; weakSelf.seceneLibararyCollectionView.emptyDataSetDelegate = weakSelf;
...@@ -206,12 +203,7 @@ ...@@ -206,12 +203,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.seceneLibararyCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.seceneLibararyCollectionView]; [weakSelf endRefreshingForTableView:weakSelf.seceneLibararyCollectionView];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
......
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(HOTSEARCH) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(HOTSEARCH) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -166,10 +166,7 @@ ...@@ -166,10 +166,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
- (void)getPayQrCode - (void)getPayQrCode
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager ] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(QRCODE) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager ] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(QRCODE) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -201,8 +201,6 @@ ...@@ -201,8 +201,6 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -475,7 +473,7 @@ ...@@ -475,7 +473,7 @@
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
NSSLog(@"%@",[order toDictionary]); NSSLog(@"%@",[order toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CONFIRMPAY) WithCallClass:weakSelf WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CONFIRMPAY) WithRequestType:ZERO WithParameter:order WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -487,10 +485,7 @@ ...@@ -487,10 +485,7 @@
}else{ }else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
address.address = self.detailsAddress.text; address.address = self.detailsAddress.text;
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDADDRESS) WithCallClass:weakSelf WithRequestType:0 WithParameter:address WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDADDRESS) WithRequestType:ZERO WithParameter:address WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -219,12 +219,7 @@ ...@@ -219,12 +219,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
}]; }];
} }
...@@ -246,7 +241,7 @@ ...@@ -246,7 +241,7 @@
address.fid = self.model.fid; address.fid = self.model.fid;
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CHANGEADDRESS) WithCallClass:weakSelf WithRequestType:0 WithParameter:address WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CHANGEADDRESS) WithRequestType:ZERO WithParameter:address WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -277,13 +272,8 @@ ...@@ -277,13 +272,8 @@
[self ErrorMBProgressView:returnValue[@"message"]]; [self ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
NSLog(@"%@",error);
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
}]; }];
} }
...@@ -308,7 +298,7 @@ ...@@ -308,7 +298,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(REMOVEADDRESS),_model.fid] WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(REMOVEADDRESS),_model.fid] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -323,11 +313,7 @@ ...@@ -323,11 +313,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
}]; }];
} }
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
{ {
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SHIPPINGADDRESS),[Customermanager manager].model.fid] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SHIPPINGADDRESS),[Customermanager manager].model.fid] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -152,12 +152,7 @@ ...@@ -152,12 +152,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -407,7 +402,7 @@ ...@@ -407,7 +402,7 @@
order.orderdetailList = (NSArray<TOOrderdetailEntity> *)goodidArr; order.orderdetailList = (NSArray<TOOrderdetailEntity> *)goodidArr;
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CREATEORDER) WithCallClass:weakSelf WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CREATEORDER) WithRequestType:ZERO WithParameter:order WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
//商品购物车id //商品购物车id
...@@ -431,10 +426,7 @@ ...@@ -431,10 +426,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
shopcarNumber.dp = Newpage; shopcarNumber.dp = Newpage;
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SHOPPINGBAG) WithCallClass:weakSelf WithRequestType:0 WithParameter:shopcarNumber WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SHOPPINGBAG) WithRequestType:ZERO WithParameter:shopcarNumber WithReturnValueBlock:^(id returnValue) {
weakSelf.shoppingTableview.emptyDataSetSource = weakSelf; weakSelf.shoppingTableview.emptyDataSetSource = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.shoppingTableview]; [weakSelf endRefreshingForTableView:weakSelf.shoppingTableview];
...@@ -268,10 +268,6 @@ ...@@ -268,10 +268,6 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.shoppingTableview];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.shoppingTableview]; [weakSelf endRefreshingForTableView:weakSelf.shoppingTableview];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
...@@ -373,7 +369,7 @@ ...@@ -373,7 +369,7 @@
DeleteCartRequest *delecteGoods = [[DeleteCartRequest alloc]init]; DeleteCartRequest *delecteGoods = [[DeleteCartRequest alloc]init];
delecteGoods.cartIds = goodsCode; delecteGoods.cartIds = goodsCode;
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(REMOVESHOPPINGBAG) WithCallClass:weakSelf WithRequestType:0 WithParameter:delecteGoods WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(REMOVESHOPPINGBAG) WithRequestType:ZERO WithParameter:delecteGoods WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -395,9 +391,6 @@ ...@@ -395,9 +391,6 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
...@@ -474,7 +467,7 @@ ...@@ -474,7 +467,7 @@
} }
delecteGoods.cartIds = codeArr; delecteGoods.cartIds = codeArr;
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(REMOVESHOPPINGBAG) WithCallClass:weakSelf WithRequestType:0 WithParameter:delecteGoods WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(REMOVESHOPPINGBAG) WithRequestType:ZERO WithParameter:delecteGoods WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -497,9 +490,6 @@ ...@@ -497,9 +490,6 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
...@@ -517,14 +507,12 @@ ...@@ -517,14 +507,12 @@
dispatch_group_enter(group); dispatch_group_enter(group);
NSLog(@"%@",[NSString stringWithFormat:@"%@%@/%@/%@/%ld",SERVERREQUESTURL(CHANGESHOPPINGBAGNUMBERPRICE),model.fid,model.goodsId,[model.costPrice stringValue],model.goodsNum]); NSLog(@"%@",[NSString stringWithFormat:@"%@%@/%@/%@/%ld",SERVERREQUESTURL(CHANGESHOPPINGBAGNUMBERPRICE),model.fid,model.goodsId,[model.costPrice stringValue],model.goodsNum]);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@/%ld",SERVERREQUESTURL(CHANGESHOPPINGBAGNUMBERPRICE),model.fid,model.goodsId,[model.costPrice stringValue],model.goodsNum] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@/%ld",SERVERREQUESTURL(CHANGESHOPPINGBAGNUMBERPRICE),model.fid,model.goodsId,[model.costPrice stringValue],model.goodsNum] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
dispatch_group_leave(group); dispatch_group_leave(group);
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
number ++; number ++;
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
dispatch_group_leave(group);
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
dispatch_group_leave(group); dispatch_group_leave(group);
}]; }];
...@@ -565,7 +553,7 @@ ...@@ -565,7 +553,7 @@
//商品数量 //商品数量
NSString *goodsNumberString = [NSString stringWithFormat:@"%ld",(long)goodsNumber]; NSString *goodsNumberString = [NSString stringWithFormat:@"%ld",(long)goodsNumber];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@/%@",SERVERREQUESTURL(CHANGESHOPPINGBAGNUMBERPRICE),carid,goodsis,costpriceString,goodsNumberString] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@/%@",SERVERREQUESTURL(CHANGESHOPPINGBAGNUMBERPRICE),carid,goodsis,costpriceString,goodsNumberString] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
result(returnValue);//提供是否支持修改的参数 result(returnValue);//提供是否支持修改的参数
...@@ -577,10 +565,7 @@ ...@@ -577,10 +565,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
...@@ -57,13 +57,12 @@ ...@@ -57,13 +57,12 @@
- (void)queryShoppersCommission - (void)queryShoppersCommission
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SHOPPERSCOMMISSION),[Shoppersmanager manager].Shoppers.employee.fid] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SHOPPERSCOMMISSION),[Shoppersmanager manager].Shoppers.employee.fid] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
// self.rebateLabe.text = [NSString stringWithFormat:@"¥%.2f",[returnValue[@"data"] floatValue]]; // self.rebateLabe.text = [NSString stringWithFormat:@"¥%.2f",[returnValue[@"data"] floatValue]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(id error) {
} WithFailureBlock:^(id error) {
}]; }];
} }
...@@ -142,7 +141,7 @@ ...@@ -142,7 +141,7 @@
{ {
WS(weakSelf); WS(weakSelf);
NSData *data = UIImageJPEGRepresentation(image, 0.5); NSData *data = UIImageJPEGRepresentation(image, 0.5);
[[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:1 WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:ONE WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf modifyshoppersInformation:returnValue[@"data"] complete:^{ [weakSelf modifyshoppersInformation:returnValue[@"data"] complete:^{
...@@ -161,9 +160,6 @@ ...@@ -161,9 +160,6 @@
{ {
[weakSelf ShowProgressView:progress]; [weakSelf ShowProgressView:progress];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
weakSelf.TCHud.labelText = @"上传失败";
[weakSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
weakSelf.TCHud.labelText = @"上传失败"; weakSelf.TCHud.labelText = @"上传失败";
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
...@@ -179,7 +175,7 @@ ...@@ -179,7 +175,7 @@
employ.employee = [Shoppersmanager manager].Shoppers.employee; employ.employee = [Shoppersmanager manager].Shoppers.employee;
employ.employee.picture = headerurl; employ.employee.picture = headerurl;
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(MODITYSHOPPERSINFORMATION) WithCallClass:weakSelf WithRequestType:0 WithParameter:employ WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(MODITYSHOPPERSINFORMATION) WithRequestType:ZERO WithParameter:employ WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -189,10 +185,7 @@ ...@@ -189,10 +185,7 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
}]; }];
} }
...@@ -216,7 +209,7 @@ ...@@ -216,7 +209,7 @@
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { [alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[weakSelf CreateMBProgressHUDLoding]; [weakSelf CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(CANCELLOGIN) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(CANCELLOGIN) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -232,9 +225,6 @@ ...@@ -232,9 +225,6 @@
{ {
[weakSelf promptCustomerWithString:@"切换用户失败"]; [weakSelf promptCustomerWithString:@"切换用户失败"];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
}]; }];
...@@ -284,7 +274,7 @@ ...@@ -284,7 +274,7 @@
login.username = self.userName.text; login.username = self.userName.text;
login.password = self.passWord.text; login.password = self.passWord.text;
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOGIN) WithCallClass:weakSelf WithRequestType:0 WithParameter:login WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOGIN) WithRequestType:ZERO WithParameter:login WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -309,11 +299,6 @@ ...@@ -309,11 +299,6 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
[weakSelf recoveryUsernamePasswrod]; [weakSelf recoveryUsernamePasswrod];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
NSLog(@"%@",errorCodeValue);
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
{ {
WS(weakSelf); WS(weakSelf);
[self CreateMBProgressHUDLoding]; [self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(WITHDRAWALPROGRESS) WithCallClass:weakSelf WithRequestType:0 WithParameter:self.model WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(WITHDRAWALPROGRESS) WithRequestType:ZERO WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
weakSelf.withdrawalTableView.emptyDataSetSource = self; weakSelf.withdrawalTableView.emptyDataSetSource = self;
weakSelf.withdrawalTableView.emptyDataSetDelegate = self; weakSelf.withdrawalTableView.emptyDataSetDelegate = self;
...@@ -118,12 +118,7 @@ ...@@ -118,12 +118,7 @@
{ {
[weakSelf SHOWPrompttext:returnValue[@"message"]]; [weakSelf SHOWPrompttext:returnValue[@"message"]];
} }
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView]; [weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription]; [weakSelf SHOWPrompttext:error.localizedDescription];
......
...@@ -130,6 +130,7 @@ ...@@ -130,6 +130,7 @@
299876421CD99E4000C90D0A /* OrderdetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876411CD99E4000C90D0A /* OrderdetailsViewController.m */; }; 299876421CD99E4000C90D0A /* OrderdetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876411CD99E4000C90D0A /* OrderdetailsViewController.m */; };
299C7F5A1CE21FA800E7D7CB /* AddressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 299C7F581CE21FA800E7D7CB /* AddressViewController.m */; }; 299C7F5A1CE21FA800E7D7CB /* AddressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 299C7F581CE21FA800E7D7CB /* AddressViewController.m */; };
299C7F5B1CE21FA800E7D7CB /* AddressViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 299C7F591CE21FA800E7D7CB /* AddressViewController.xib */; }; 299C7F5B1CE21FA800E7D7CB /* AddressViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 299C7F591CE21FA800E7D7CB /* AddressViewController.xib */; };
29A5B3441DF01FC000258057 /* XBLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A5B3431DF01FC000258057 /* XBLoadingView.m */; };
29A8D3981CD85A58004D558F /* ClientdetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A8D3971CD85A58004D558F /* ClientdetailsViewController.m */; }; 29A8D3981CD85A58004D558F /* ClientdetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A8D3971CD85A58004D558F /* ClientdetailsViewController.m */; };
29A938221CDADE4700F21E54 /* ProductDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A938211CDADE4700F21E54 /* ProductDetailsTableViewCell.m */; }; 29A938221CDADE4700F21E54 /* ProductDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A938211CDADE4700F21E54 /* ProductDetailsTableViewCell.m */; };
29A938251CDAE31200F21E54 /* ProductDetailsHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A938241CDAE31200F21E54 /* ProductDetailsHeaderView.m */; }; 29A938251CDAE31200F21E54 /* ProductDetailsHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A938241CDAE31200F21E54 /* ProductDetailsHeaderView.m */; };
...@@ -431,6 +432,8 @@ ...@@ -431,6 +432,8 @@
299C7F571CE21FA800E7D7CB /* AddressViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddressViewController.h; sourceTree = "<group>"; }; 299C7F571CE21FA800E7D7CB /* AddressViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddressViewController.h; sourceTree = "<group>"; };
299C7F581CE21FA800E7D7CB /* AddressViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddressViewController.m; sourceTree = "<group>"; }; 299C7F581CE21FA800E7D7CB /* AddressViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddressViewController.m; sourceTree = "<group>"; };
299C7F591CE21FA800E7D7CB /* AddressViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AddressViewController.xib; sourceTree = "<group>"; }; 299C7F591CE21FA800E7D7CB /* AddressViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AddressViewController.xib; sourceTree = "<group>"; };
29A5B3421DF01FC000258057 /* XBLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBLoadingView.h; sourceTree = "<group>"; };
29A5B3431DF01FC000258057 /* XBLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XBLoadingView.m; sourceTree = "<group>"; };
29A8D3961CD85A58004D558F /* ClientdetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientdetailsViewController.h; sourceTree = "<group>"; }; 29A8D3961CD85A58004D558F /* ClientdetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientdetailsViewController.h; sourceTree = "<group>"; };
29A8D3971CD85A58004D558F /* ClientdetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientdetailsViewController.m; sourceTree = "<group>"; }; 29A8D3971CD85A58004D558F /* ClientdetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientdetailsViewController.m; sourceTree = "<group>"; };
29A938201CDADE4700F21E54 /* ProductDetailsTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductDetailsTableViewCell.h; sourceTree = "<group>"; }; 29A938201CDADE4700F21E54 /* ProductDetailsTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductDetailsTableViewCell.h; sourceTree = "<group>"; };
...@@ -798,6 +801,7 @@ ...@@ -798,6 +801,7 @@
2928F7DE1CD085430036D761 /* Tools */ = { 2928F7DE1CD085430036D761 /* Tools */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
29A5B3411DF01F7C00258057 /* LoadingView */,
2985345D1DD4B0100023BBAE /* AirPrint */, 2985345D1DD4B0100023BBAE /* AirPrint */,
291A37741DBA588A00299F0D /* GetJDCardView */, 291A37741DBA588A00299F0D /* GetJDCardView */,
29E2D32A1DB8AFD500443170 /* MDScratchImageView */, 29E2D32A1DB8AFD500443170 /* MDScratchImageView */,
...@@ -1374,6 +1378,15 @@ ...@@ -1374,6 +1378,15 @@
name = cells; name = cells;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
29A5B3411DF01F7C00258057 /* LoadingView */ = {
isa = PBXGroup;
children = (
29A5B3421DF01FC000258057 /* XBLoadingView.h */,
29A5B3431DF01FC000258057 /* XBLoadingView.m */,
);
path = LoadingView;
sourceTree = "<group>";
};
29A8D3951CD85A3C004D558F /* Clientdetails */ = { 29A8D3951CD85A3C004D558F /* Clientdetails */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1909,6 +1922,7 @@ ...@@ -1909,6 +1922,7 @@
2921F3031DB5EBD600D6439B /* PromotionalDeductionModel.m in Sources */, 2921F3031DB5EBD600D6439B /* PromotionalDeductionModel.m in Sources */,
294BFDD51D47227900BFD53F /* ExperienceCentreViewController.m in Sources */, 294BFDD51D47227900BFD53F /* ExperienceCentreViewController.m in Sources */,
29E384C81CE9A8BF00888199 /* SearchCollectionViewCell.m in Sources */, 29E384C81CE9A8BF00888199 /* SearchCollectionViewCell.m in Sources */,
29A5B3441DF01FC000258057 /* XBLoadingView.m in Sources */,
2992493D1CDB3E8900786B1E /* GenerateOrdersModifyTableViewCell.m in Sources */, 2992493D1CDB3E8900786B1E /* GenerateOrdersModifyTableViewCell.m in Sources */,
29BB27741CD9DFAC009A0813 /* SceneLibraryViewController.m in Sources */, 29BB27741CD9DFAC009A0813 /* SceneLibraryViewController.m in Sources */,
29E384D11CE9C65700888199 /* SearchViewController.m in Sources */, 29E384D11CE9C65700888199 /* SearchViewController.m in Sources */,
......
...@@ -17,13 +17,6 @@ ...@@ -17,13 +17,6 @@
@property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UIWindow *window;
/**
* 网络状态
*/
@property (nonatomic,assign) BOOL Networkstatus;
/** /**
* 抽屉控制器对象 * 抽屉控制器对象
*/ */
......
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
#pragma mark -检测网络的可连接性 #pragma mark -检测网络的可连接性
- (void)detectionNetwork - (void)detectionNetwork
{ {
self.Networkstatus = true;
[[AFNetworkReachabilityManager sharedManager] startMonitoring]; [[AFNetworkReachabilityManager sharedManager] startMonitoring];
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
...@@ -96,20 +95,17 @@ ...@@ -96,20 +95,17 @@
case AFNetworkReachabilityStatusNotReachable:{ case AFNetworkReachabilityStatusNotReachable:{
NSLog(@"无网络"); NSLog(@"无网络");
self.Networkstatus = false;
break; break;
} }
case AFNetworkReachabilityStatusReachableViaWiFi:{ case AFNetworkReachabilityStatusReachableViaWiFi:{
NSLog(@"WiFi网络"); NSLog(@"WiFi网络");
self.Networkstatus = true;
break; break;
} }
case AFNetworkReachabilityStatusReachableViaWWAN:{ case AFNetworkReachabilityStatusReachableViaWWAN:{
NSLog(@"流量网络"); NSLog(@"流量网络");
self.Networkstatus = true;
break; break;
} }
default: default:
......
...@@ -406,15 +406,12 @@ ...@@ -406,15 +406,12 @@
- (void)QueryShoppingCarNumber - (void)QueryShoppingCarNumber
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(QUERYSHOPPINGBAGNUMBER),[Customermanager manager].model.fid] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(QUERYSHOPPINGBAGNUMBER),[Customermanager manager].model.fid] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"更新购物车数量成功"); NSLog(@"更新购物车数量成功");
[[NSNotificationCenter defaultCenter]postNotificationName:ADDSHOPPINGCAR object:returnValue[@"data"]]; [[NSNotificationCenter defaultCenter]postNotificationName:ADDSHOPPINGCAR object:returnValue[@"data"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
NSLog(@"更新购物车数量失败"); NSLog(@"更新购物车数量失败");
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
......
//
// XBLoadingView.h
// Lighting
//
// Created by 曹云霄 on 2016/12/1.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <MBProgressHUD/MBProgressHUD.h>
@interface XBLoadingView : MBProgressHUD
/**
显示普通加载框
*/
+ (void)showHUDViewWithDefault;
/**
显示文本提示框
@param text 提示信息
*/
+ (void)showHUDViewWithText:(NSString *)text;
/**
显示进度框
@param text 提示信息
@return XBLoadingView
*/
+ (instancetype)showHUDViewProgressLabel:(NSString *)text;
/**
隐藏加载框
*/
+ (void)hideHUDViewWithDefault;
@end
//
// XBLoadingView.m
// Lighting
//
// Created by 曹云霄 on 2016/12/1.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "XBLoadingView.h"
@implementation XBLoadingView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
...@@ -11,19 +11,16 @@ ...@@ -11,19 +11,16 @@
//定义返回数据的block类型 //定义返回数据的block类型
typedef void (^ReturnValueBlock) (id returnValue); typedef void (^ReturnValueBlock) (id returnValue);
typedef void (^ErrorCodeBlock) (id errorCodeValue);
typedef void (^FailureBlock)(NSError *error); typedef void (^FailureBlock)(NSError *error);
//上传图片返回当前进度 //上传图片返回当前进度
typedef void (^UploadprogressBlock)(double progress); typedef void (^UploadprogressBlock)(double progress);
//定义请求类型 //定义请求类型
typedef enum { typedef NS_ENUM(NSInteger,NetworkRequestType){
NetworkRequestWithPOST = 0, //POST NetworkRequestWithPOST = 0, //POST
NetworkRequestWithGET //GET NetworkRequestWithGET //GET
};
}NetworkRequestType;
@interface NetworkRequestClassManager : NSObject @interface NetworkRequestClassManager : NSObject
...@@ -47,18 +44,12 @@ typedef enum { ...@@ -47,18 +44,12 @@ typedef enum {
* @param failureBlock 失败回调 * @param failureBlock 失败回调
*/ */
- (void)NetworkRequestWithURL:(NSString *) requestURLString - (void)NetworkRequestWithURL:(NSString *) requestURLString
WithCallClass:(BaseViewController *)object
WithRequestType:(NetworkRequestType) requestType WithRequestType:(NetworkRequestType) requestType
WithParameter:(JSONModel *) jastorobject WithParameter:(JSONModel *) jastorobject
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock; WithFailureBlock:(FailureBlock) failureBlock;
/** /**
* 网络请求传入字典对象 * 网络请求传入字典对象
* *
...@@ -70,15 +61,11 @@ typedef enum { ...@@ -70,15 +61,11 @@ typedef enum {
* @param failureBlock 失败回调 * @param failureBlock 失败回调
*/ */
- (void)NetworkWithDictionaryRequestWithURL:(NSString *) requestURLString - (void)NetworkWithDictionaryRequestWithURL:(NSString *) requestURLString
WithCallClass:(BaseViewController *)object
WithRequestType:(NetworkRequestType) requestType WithRequestType:(NetworkRequestType) requestType
WithParameter:(NSDictionary *) parameter WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock; WithFailureBlock:(FailureBlock) failureBlock;
/** /**
* 下载PDF * 下载PDF
* *
...@@ -89,13 +76,8 @@ typedef enum { ...@@ -89,13 +76,8 @@ typedef enum {
*/ */
- (void)DownloadPDFdatasWithURL:(NSString *) requestURLString - (void)DownloadPDFdatasWithURL:(NSString *) requestURLString
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock; WithFailureBlock:(FailureBlock) failureBlock;
/** /**
* 上传分享图片 * 上传分享图片
* *
...@@ -114,7 +96,6 @@ typedef enum { ...@@ -114,7 +96,6 @@ typedef enum {
WithParameter:(NSDictionary *) parameter WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithprogressBlock:(UploadprogressBlock) progressBlock WithprogressBlock:(UploadprogressBlock) progressBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock; WithFailureBlock:(FailureBlock) failureBlock;
......
...@@ -67,30 +67,19 @@ static NetworkRequestClassManager *manager = nil; ...@@ -67,30 +67,19 @@ static NetworkRequestClassManager *manager = nil;
*/ */
- (void)NetworkRequestWithURL:(NSString *) requestURLString - (void)NetworkRequestWithURL:(NSString *) requestURLString
WithCallClass:(BaseViewController *)object
WithRequestType:(NetworkRequestType) requestType WithRequestType:(NetworkRequestType) requestType
WithParameter:(JSONModel *) jastorobject WithParameter:(JSONModel *) jastorobject
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock WithFailureBlock:(FailureBlock) failureBlock
{ {
AFHTTPSessionManager *manager = [self baseHttpRequest]; AFHTTPSessionManager *manager = [self baseHttpRequest];
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
if (requestType == 0) { if (requestType == 0) {
[manager POST:requestURLString parameters:[jastorobject toDictionary] progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [manager POST:requestURLString parameters:[jastorobject toDictionary] progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
//登陆超时 //登陆超时
if ([responseObject[@"code"] isEqualToNumber:@1]) { if ([responseObject[@"code"] isEqualToNumber:@1]) {
[object RemoveMBProgressHUDLoding];
[[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil];
}else { }else {
successBlock(responseObject); successBlock(responseObject);
...@@ -108,7 +97,6 @@ static NetworkRequestClassManager *manager = nil; ...@@ -108,7 +97,6 @@ static NetworkRequestClassManager *manager = nil;
//登陆超时 //登陆超时
if ([responseObject[@"code"] isEqualToNumber:@1]) { if ([responseObject[@"code"] isEqualToNumber:@1]) {
[object RemoveMBProgressHUDLoding];
[[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil];
}else{ }else{
successBlock(responseObject); successBlock(responseObject);
...@@ -134,28 +122,17 @@ static NetworkRequestClassManager *manager = nil; ...@@ -134,28 +122,17 @@ static NetworkRequestClassManager *manager = nil;
* @param failureBlock 失败回调 * @param failureBlock 失败回调
*/ */
- (void)NetworkWithDictionaryRequestWithURL:(NSString *) requestURLString - (void)NetworkWithDictionaryRequestWithURL:(NSString *) requestURLString
WithCallClass:(BaseViewController *)object
WithRequestType:(NetworkRequestType) requestType WithRequestType:(NetworkRequestType) requestType
WithParameter:(NSDictionary *) parameter WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock WithFailureBlock:(FailureBlock) failureBlock
{ {
AFHTTPSessionManager *manager = [self baseHttpRequest]; AFHTTPSessionManager *manager = [self baseHttpRequest];
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
if (requestType == 0) { if (requestType == 0) {
[manager POST:requestURLString parameters:parameter progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [manager POST:requestURLString parameters:parameter progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
//登陆超时 //登陆超时
if ([responseObject[@"code"] isEqualToNumber:@1]) { if ([responseObject[@"code"] isEqualToNumber:@1]) {
[object RemoveMBProgressHUDLoding];
[[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil];
}else { }else {
successBlock(responseObject); successBlock(responseObject);
...@@ -173,7 +150,6 @@ static NetworkRequestClassManager *manager = nil; ...@@ -173,7 +150,6 @@ static NetworkRequestClassManager *manager = nil;
//登陆超时 //登陆超时
if ([responseObject[@"code"] isEqualToNumber:@1]) { if ([responseObject[@"code"] isEqualToNumber:@1]) {
[object RemoveMBProgressHUDLoding];
[[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil];
}else{ }else{
successBlock(responseObject); successBlock(responseObject);
...@@ -200,7 +176,6 @@ static NetworkRequestClassManager *manager = nil; ...@@ -200,7 +176,6 @@ static NetworkRequestClassManager *manager = nil;
*/ */
- (void)DownloadPDFdatasWithURL:(NSString *) requestURLString - (void)DownloadPDFdatasWithURL:(NSString *) requestURLString
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock WithFailureBlock:(FailureBlock) failureBlock
{ {
...@@ -210,12 +185,6 @@ static NetworkRequestClassManager *manager = nil; ...@@ -210,12 +185,6 @@ static NetworkRequestClassManager *manager = nil;
manager.requestSerializer = [AFJSONRequestSerializer serializer]; manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.requestSerializer.timeoutInterval = 120.0f; manager.requestSerializer.timeoutInterval = 120.0f;
[manager.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField: @"Content-Type"]; [manager.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField: @"Content-Type"];
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
//构造URL对象 //构造URL对象
NSURL *url = [NSURL URLWithString:requestURLString]; NSURL *url = [NSURL URLWithString:requestURLString];
//构造request对象 //构造request对象
...@@ -261,16 +230,8 @@ static NetworkRequestClassManager *manager = nil; ...@@ -261,16 +230,8 @@ static NetworkRequestClassManager *manager = nil;
WithParameter:(NSDictionary *) parameter WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithprogressBlock:(UploadprogressBlock) progressBlock WithprogressBlock:(UploadprogressBlock) progressBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock WithFailureBlock:(FailureBlock) failureBlock
{ {
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
AFHTTPSessionManager *manager = [self baseHttpRequest]; AFHTTPSessionManager *manager = [self baseHttpRequest];
[manager POST:requestURLString parameters:parameter constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) { [manager POST:requestURLString parameters:parameter constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
{ {
WS(weakSelf); WS(weakSelf);
//场景筛选条件 //场景筛选条件
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -265,9 +265,6 @@ ...@@ -265,9 +265,6 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
}]; }];
...@@ -313,7 +310,7 @@ ...@@ -313,7 +310,7 @@
- (void)getSceneLibrarydatas:(SceneCondition *)condition isRemove:(BOOL)remove - (void)getSceneLibrarydatas:(SceneCondition *)condition isRemove:(BOOL)remove
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENELIST) WithCallClass:weakSelf WithRequestType:0 WithParameter:condition WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENELIST) WithRequestType:ZERO WithParameter:condition WithReturnValueBlock:^(id returnValue) {
weakSelf.sceneOrProductClollectionView.emptyDataSetSource = weakSelf; weakSelf.sceneOrProductClollectionView.emptyDataSetSource = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView]; [weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
...@@ -350,9 +347,6 @@ ...@@ -350,9 +347,6 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView]; [weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
...@@ -406,7 +400,7 @@ ...@@ -406,7 +400,7 @@
- (void)getScreeningdatasisRemoveArray:(BOOL)remove - (void)getScreeningdatasisRemoveArray:(BOOL)remove
{ {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -461,9 +455,6 @@ ...@@ -461,9 +455,6 @@
{ {
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
...@@ -542,7 +533,7 @@ ...@@ -542,7 +533,7 @@
- (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish - (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish
{ {
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PRODUCTLIST) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:conditon WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PRODUCTLIST) WithRequestType:ZERO WithParameter:conditon WithReturnValueBlock:^(id returnValue) {
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView]; [weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -556,10 +547,7 @@ ...@@ -556,10 +547,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:@"网络连接中断"];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView]; [weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
[weakSelf CreateMBProgressHUDLoding]; [weakSelf CreateMBProgressHUDLoding];
NSString *shareOrderString = [NSString stringWithFormat:@"%@/%@",SHAREORDERBILL,self.orderBillNumber]; NSString *shareOrderString = [NSString stringWithFormat:@"%@/%@",SHAREORDERBILL,self.orderBillNumber];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(shareOrderString) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(shareOrderString) WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -41,9 +41,6 @@ ...@@ -41,9 +41,6 @@
{ {
[weakSelf SHOWPrompttext:returnValue[@"message"]]; [weakSelf SHOWPrompttext:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -77,9 +74,6 @@ ...@@ -77,9 +74,6 @@
hud.progress = progress; hud.progress = progress;
}); });
} }
} WithErrorCodeBlock:^(id errorCodeValue) {
[hud hide:YES];
} WithFailureBlock:^(NSError *error) { } WithFailureBlock:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
hud.labelText = @"上传失败"; hud.labelText = @"上传失败";
......
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
shopCar.goodsId = [goodsIds substringToIndex:goodsIds.length-1]; shopCar.goodsId = [goodsIds substringToIndex:goodsIds.length-1];
shopCar.count = [goodsCounts substringToIndex:goodsCounts.length-1]; shopCar.count = [goodsCounts substringToIndex:goodsCounts.length-1];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithCallClass:weakSelf WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithRequestType:ZERO WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
...@@ -270,10 +270,7 @@ ...@@ -270,10 +270,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
...@@ -309,7 +306,7 @@ ...@@ -309,7 +306,7 @@
//商品数量 //商品数量
NSString *goodsNumberString = [NSString stringWithFormat:@"%ld",(long)goodsNumber]; NSString *goodsNumberString = [NSString stringWithFormat:@"%ld",(long)goodsNumber];
WS(weakSelf); WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@/%@",SERVERREQUESTURL(CHANGESHOPPINGBAGNUMBERPRICE),carid,goodsis,costpriceString,goodsNumberString] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@/%@",SERVERREQUESTURL(CHANGESHOPPINGBAGNUMBERPRICE),carid,goodsis,costpriceString,goodsNumberString] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
result(returnValue);//提供是否支持修改的参数 result(returnValue);//提供是否支持修改的参数
...@@ -321,11 +318,7 @@ ...@@ -321,11 +318,7 @@
[weakSelf ErrorMBProgressView:returnValue[@"message"]]; [weakSelf ErrorMBProgressView:returnValue[@"message"]];
} }
} WithErrorCodeBlock:^(id errorCodeValue) { }WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription]; [weakSelf ErrorMBProgressView:error.localizedDescription];
}]; }];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment