Commit e880d0e2 authored by 曹云霄's avatar 曹云霄

Merge branch 'optimizing' into learningCenter

# Conflicts:
#	Class/AllCustomerViewController.m
#	Class/CardBeenUseViewController.m
#	Class/CardDontUseViewController.m
#	Class/CardViewController.m
#	Class/ChangePasswordViewController.m
#	Class/ClientShoppingCarViewController.m
#	Class/ClientViewController.m
#	Class/CustomerOrderViewController.m
#	Class/Login/LoginViewController.m
#	Class/LuckyDrawDetailsViewController.m
#	Class/OrderRecordViewController.m
#	Class/OrderdetailsViewController.m
#	Class/ProductDetailsViewController.m
#	Class/ProductLibraryViewController.m
#	Class/SceneLibraryViewController.m
#	Class/SearchViewController.m
#	Class/SettlementViewController.m
#	Class/Shoppingcart/AddressViewController.m
#	Class/Shoppingcart/GenerateOrdersViewController.m
#	Class/Shoppingcart/ShoppingViewController.m
#	Class/UserViewController.m
#	Lighting.xcodeproj/project.pbxproj
#	Tools/BaseViewController.h
#	Tools/BaseViewController.m
#	Tools/CustomWKWebViewController.m
#	Tools/NetworkRequestClassManager.m
#	Tools/PrefixHeader.pch
#	Tools/SceneViewController.m
#	Tools/ShoppingBagViewController.m
#	Tools/opple_objc_json_client.h
#	Tools/opple_objc_json_client.m
parents f9d20cbc 3f002fd3
......@@ -145,13 +145,13 @@
#pragma mark -获取导购关联客户
- (void)getShoppersAssociatedCustomer:(ConsumerQueryCondition *)condition isRemove:(BOOL)remove
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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.emptyDataSetDelegate = weakSelf;
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:self.allCustomerTableview];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) {
......@@ -184,13 +184,12 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
}WithFailureBlock:^(id error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:weakSelf.allCustomerTableview];
[XBLoadingView hideHUDViewWithDefault];
}];
}
......
......@@ -97,10 +97,10 @@
- (void)getCardDatasAction:(BOOL)isRemove
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CARDINFORMATION) WithRequestType:ZERO WithParameter:self.requestModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
weakSelf.beenUseCardCollectionView.emptyDataSetSource = self;
weakSelf.beenUseCardCollectionView.emptyDataSetDelegate = self;
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
......@@ -113,15 +113,11 @@
[weakSelf.datasArray addObjectsFromArray:cardInformation.list];
[weakSelf.beenUseCardCollectionView reloadData];
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
}WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.beenUseCardCollectionView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -129,19 +125,17 @@
- (void)useJDECard:(NSString *)JDECardNumber
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithCallClass:weakSelf WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf deleteUsedJDECard:JDECardNumber];
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -114,11 +114,11 @@
- (void)getCardDatasAction:(BOOL)isRemove
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
weakSelf.dontUseCardCollectionView.emptyDataSetSource = weakSelf;
weakSelf.dontUseCardCollectionView.emptyDataSetDelegate = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
......@@ -131,15 +131,11 @@
[weakSelf.datasArray addObjectsFromArray:[NSMutableArray arrayWithArray:cardInformation.list]];
[weakSelf.dontUseCardCollectionView reloadData];
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
}WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.dontUseCardCollectionView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -180,7 +176,7 @@
{
GroupByOrderNumber *model = self.datasArray[indexPath.section];
if ([[self class] isBlankString:model.orderReceiptUrl]) {
[self SHOWPrompttext:@"不能查看未激活卡劵,请先上传小票激活卡劵"];
[XBLoadingView showHUDViewWithText:@"不能查看未激活卡劵,请先上传小票激活卡劵"];
}
}
......@@ -204,7 +200,7 @@
else
{
[DeviceDirectionManager instance].isHorizontal=NO;
[weakSelf ErrorMBProgressView:@"相机无法使用"];
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
......@@ -217,7 +213,7 @@
else
{
[DeviceDirectionManager instance].isHorizontal=NO;
[weakSelf ErrorMBProgressView:@"相册无法打开"];
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
......@@ -243,20 +239,24 @@
{
WS(weakSelf);
NSData *data = UIImageJPEGRepresentation(image, 0.5);
XBLoadingView *progressView = [XBLoadingView showHUDViewProgressLabel:@"上传小票中"];
[[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:ONE WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf activationJDECard:returnValue[@"data"]];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithprogressBlock:^(double progress) {
[weakSelf ShowProgressView:progress];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
if (progress >= 1) {
progressView.labelText = @"上传小票成功";
[progressView hide:YES afterDelay:1];
}else {
progressView.progress = progress;
}
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -264,23 +264,20 @@
- (void)activationJDECard:(NSString *)imagePath
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(ACTIVIATIONJDECARD),self.orderNumber,imagePath] WithCallClass:weakSelf WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(ACTIVIATIONJDECARD),self.orderNumber,imagePath] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.isRefreshValue = NO;
[weakSelf.dontUseCardCollectionView.mj_header beginRefreshing];
[weakSelf SuccessMBProgressView:@"激活成功"];
[XBLoadingView showHUDViewWithSuccessText:@"激活成功"];
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -61,7 +61,7 @@
- (void)getCardDatasAction
{
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.emptyDataSetDelegate = weakSelf;
......@@ -75,13 +75,11 @@
}
[weakSelf.cardCollectionView reloadData];
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -89,19 +87,17 @@
- (void)useJDECard:(NSString *)JDECardNumber
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithCallClass:weakSelf WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(USEJDECARD),JDECardNumber] WithRequestType:ZERO WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf deleteUsedJDECard:JDECardNumber];
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -142,7 +138,7 @@
[weakSelf.navigationController pushViewController:cardDetails animated:YES];
}];
}else if ([model.state isEqualToString:CHECK]){
[self ErrorMBProgressView:@"审核中"];
[XBLoadingView showHUDViewWithText:@"审核中"];
}else{
CardAmplificationViewController *cardVC = [[CardAmplificationViewController alloc]init];
self.settingsPopoverController = [[WYPopoverController alloc] initWithContentViewController:cardVC];
......
......@@ -61,18 +61,18 @@
[self.view endEditing:YES];
if ([BaseViewController isBlankString:self.userName.text]) {
[self ErrorMBProgressView:@"账户名不能为空"];
[XBLoadingView showHUDViewWithText:@"账户名不能为空"];
}
else if ([BaseViewController isBlankString:self.oldPassWord.text])
{
[self ErrorMBProgressView:@"旧密码不能为空"];
[XBLoadingView showHUDViewWithText:@"旧密码不能为空"];
}
else if ([BaseViewController isBlankString:self.NewPassWord.text])
{
[self ErrorMBProgressView:@"新密码不能为空"];
[XBLoadingView showHUDViewWithText:@"新密码不能为空"];
}
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
ModifyPasswordRequest *modify = [[ModifyPasswordRequest alloc]init];
modify.oldPassword = self.oldPassWord.text;
modify.fnewPassword = self.NewPassWord.text;
......@@ -80,28 +80,23 @@
//修改密码
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
//保存最新的账号信息
[Shoppersmanager manager].passWordString = weakSelf.NewPassWord.text;
[weakSelf SuccessMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithSuccessText:returnValue[@"message"]];
if ([weakSelf.delegate respondsToSelector:@selector(cancelButtonClick)]) {
[weakSelf.delegate cancelButtonClick];
}
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
}WithFailureBlock:^(id error) {
NSLog(@"%@",error);
}];
}
......
......@@ -73,14 +73,14 @@
#pragma mark -获取购物车商品
- (void)getShoppingCardata:(ShopCartFilter *)shopCar isRemove:(BOOL)remove
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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.emptyDataSetDelegate = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.clientShoppingCarTableView];
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) {
[weakSelf.shopResponseArray removeAllObjects];
......@@ -107,13 +107,10 @@
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
This diff is collapsed.
......@@ -150,13 +150,13 @@
#pragma mark -获取导购下客户订单 ----isdelecte 表示是否清空数组
- (void)getGuideAllcustomerOrder:(BOOL)isdelecte WithorderBill:(OrderFilter *)allOrder
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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.emptyDataSetDelegate = weakSelf;
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.customerOrderTableView];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -171,13 +171,11 @@
[weakSelf.customerOrderTableView reloadData];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
}WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:weakSelf.customerOrderTableView];
[XBLoadingView hideHUDViewWithDefault];
}];
}
......@@ -332,26 +330,24 @@
[alertVC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[weakSelf CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf SuccessMBProgressView:@"撤销成功"];
[XBLoadingView showHUDViewWithSuccessText:@"撤销成功"];
model.order.orderState = @"005";
NSIndexPath *indexapath = [NSIndexPath indexPathForRow:cellindex inSection:0];
[weakSelf.customerOrderTableView reloadRowsAtIndexPaths:@[indexapath] withRowAnimation:UITableViewRowAnimationLeft];
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[self ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}]];
[self presentViewController:alertVC animated:YES completion:nil];
......
......@@ -139,11 +139,11 @@
if ([[self class] isBlankString:self.userName.text]) {
[self ErrorMBProgressView:@"用户名不能为空"];
[XBLoadingView showHUDViewWithText:@"用户名不能为空"];
return;
}else if ([[self class] isBlankString:self.passWord.text])
{
[self ErrorMBProgressView:@"密码不能为空"];
[XBLoadingView showHUDViewWithText:@"密码不能为空"];
return;
}
[self judgeUserNameAndPassword];
......@@ -191,14 +191,14 @@
#pragma mark -判断用户名密码是否正确
- (void)judgeUserNameAndPassword
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
LoginInfo *login = [[LoginInfo alloc]init];
login.username = self.userName.text;
login.password = self.passWord.text;
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
//设置检测用户标示
......@@ -216,12 +216,10 @@
[weakSelf SetTheRootViewController];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -302,7 +300,7 @@
self.identityView.userName.text = self.userName.text;
} else {
[self ErrorMBProgressView:@"请填写您的用户名"];
[XBLoadingView showHUDViewWithText:@"请填写您的用户名"];
self.passWord.text = @"";
return;
}
......@@ -325,31 +323,29 @@
WS(weakSelf);
NSString *inputPhoneNumber = self.identityView.bindingPhoneNumber.text;
if ([[self class] isBlankString:inputPhoneNumber]) {
[self ErrorMBProgressView:@"手机号不能为空"];
[XBLoadingView showHUDViewWithText:@"手机号不能为空"];
return;
}
if (![HENLENSONG isValidateMobile:inputPhoneNumber]) {
[self ErrorMBProgressView:@"手机号码格式不正确"];
[XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];
return;
}
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
//发送验证码
NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(SENDSMS),inputPhoneNumber,self.identityView.userName.text];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:urlString WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:urlString WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf ErrorMBProgressView:@"发送验证码成功"];
[XBLoadingView showHUDViewWithText:@"发送验证码成功"];
[weakSelf.identityView.SendButton setTitle:@"60" forState:UIControlStateNormal];
weakSelf.identityView.SendButton.enabled = NO;
weakSelf.sendTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(SendbuttonChangetitle) userInfo:nil repeats:YES];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -385,7 +381,7 @@
{
// 验证码必须填写
if ([[self class] isBlankString:self.identityView.verificationCode.text]) {
[self ErrorMBProgressView:@"验证码不能为空"];
[XBLoadingView showHUDViewWithText:@"验证码不能为空"];
return;
} else {
......@@ -410,38 +406,36 @@
- (void)ChangPassWordRequest
{
if ([[self class] isBlankString:self.resetPasswordView.newpass.text]) {
[self ErrorMBProgressView:@"新密码为空"];return;
[XBLoadingView showHUDViewWithText:@"新密码为空"];return;
}
if ([[self class] isBlankString:self.resetPasswordView.confirmNewpass.text]){
[self ErrorMBProgressView:@"确认密码为空"];return;
[XBLoadingView showHUDViewWithText:@"确认密码为空"];return;
}
if (![self.resetPasswordView.newpass.text isEqualToString:self.resetPasswordView.confirmNewpass.text]) {
[self ErrorMBProgressView:@"两次密码不相同"];return;
[XBLoadingView showHUDViewWithText:@"两次密码不相同"];return;
}
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
//重置密码接口
ResetPasswordRequest *passwrod = [[ResetPasswordRequest alloc]init];
passwrod.fnewPassword = self.resetPasswordView.newpass.text;
passwrod.username = self.userName.text;
passwrod.smsCode = self.identityView.verificationCode.text;
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf ErrorMBProgressView:@"重置密码成功"];
[XBLoadingView showHUDViewWithText:@"重置密码成功"];
weakSelf.passWord.text = weakSelf.resetPasswordView.newpass.text;
[weakSelf judgeUserNameAndPassword];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
[XBLoadingView hideHUDViewWithDefault];
}];
}
......@@ -472,7 +466,7 @@
//获取服务端版本大小
WS(weakSelf);
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]) {
NSDictionary *dict = returnValue[@"data"];
......@@ -489,11 +483,8 @@
}
[weakSelf presentViewController:alertVC animated:YES completion:nil];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:@"网络不可用,请检查网络连接"];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -127,10 +127,10 @@
- (void)getDrawDatas:(BOOL)isRemove
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithCallClass:weakSelf WithRequestType:ZERO WithParameter:self.drawModel WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithRequestType:ZERO WithParameter:self.drawModel WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.drawDetailsTableView];
weakSelf.drawDetailsTableView.emptyDataSetSource = weakSelf;
weakSelf.drawDetailsTableView.emptyDataSetDelegate = weakSelf;
......@@ -143,13 +143,10 @@
weakSelf.totalPage = [returnValue[@"data"][@"totalpages"] integerValue];
[weakSelf.drawDetailsTableView reloadData];
}else {
[weakSelf SHOWPrompttext:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -205,15 +202,14 @@
#pragma mark - 去抽奖
- (void)drawButtonClickAction:(UIButton *)sender
{
WS(weakSelf);
RsAwardDraw *drawEntity = self.datasArray[sender.tag];
[self showLuckyDrawControl:drawEntity.draw.lotteryId andOrderNumber:drawEntity.draw.orderNumber andDrawid:drawEntity.draw.fid luckyDrawFinish:^(NSDictionary *dict) {
if ([dict isKindOfClass:[NSDictionary class]]) {
if ([BaseViewController isBlankString:dict[@"awardId"]]) {
[weakSelf SHOWPrompttext:@"未中奖"];
[XBLoadingView showHUDViewWithText:@"未中奖"];
}else {
[weakSelf SHOWPrompttext:[NSString stringWithFormat:@"恭喜你获得了 %@",dict[@"description"]]];
[XBLoadingView showHUDViewWithText:[NSString stringWithFormat:@"恭喜你获得了 %@",dict[@"description"]]];
}
}
}];
......
......@@ -73,13 +73,13 @@
#pragma mark -获取客户订单数据
- (void)getGuideAllcustomerOrder:(OrderFilter *)allOrder isRemove:(BOOL)remove
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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.emptyDataSetDelegate = weakSelf;
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.orderRecordTableView];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) {
......@@ -93,13 +93,10 @@
[weakSelf.orderRecordTableView reloadData];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
This diff is collapsed.
......@@ -98,13 +98,13 @@
- (void)getDatasAction:(BOOL)isRemoveAll
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PAYMENTS) WithCallClass:weakSelf WithRequestType:0 WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PAYMENTS) WithRequestType:ZERO WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
weakSelf.paymentsTableView.emptyDataSetSource = self;
weakSelf.paymentsTableView.emptyDataSetDelegate = self;
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemoveAll) {
[weakSelf.resultArray removeAllObjects];
......@@ -117,17 +117,13 @@
[weakSelf.paymentsTableView reloadData];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[weakSelf SHOWPrompttext:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -89,11 +89,11 @@
- (void)getGoodsListDetails
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.entity = [[TOGoodsEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf.productDetilsTableview reloadData];
......@@ -101,12 +101,10 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -250,7 +248,7 @@
if (goodsNumber <= 1) {
//不能小于1
[self ErrorMBProgressView:@"不能小于1"];
[XBLoadingView showHUDViewWithText:@"不能小于1"];
return;
}
goodsNumber --;
......@@ -262,7 +260,7 @@
if (goodsNumber >= self.entity.inv) {
//不能大于库存
[self ErrorMBProgressView:@"超过库存"];
[XBLoadingView showHUDViewWithText:@"超过库存"];
return;
}
goodsNumber ++;
......@@ -282,13 +280,13 @@
NSString *inputString = textField.text;
if (![self isPureInt:inputString]) {
[self ErrorMBProgressView:@"输入格式错误"];
[XBLoadingView showHUDViewWithText:@"输入格式错误"];
textField.text = @"1";
return;
}
if ([inputString integerValue] > self.entity.inv) {
[self ErrorMBProgressView:@"超过库存数量"];
[XBLoadingView showHUDViewWithText:@"超过库存数量"];
textField.text = [NSString stringWithFormat:@"%ld",(long)self.entity.inv];
return;
}
......@@ -369,11 +367,11 @@
//判断是否有当前客户
if (![Shoppersmanager manager].currentCustomer) {
[self ErrorMBProgressView:@"必须设置当前客户"];
[XBLoadingView showHUDViewWithText:@"必须设置当前客户"];
return;
}
if ([self.headerView.goodsNumber.text integerValue] > self.entity.inv) {
[self ErrorMBProgressView:@"超过库存"];
[XBLoadingView showHUDViewWithText:@"超过库存"];
return;
}
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
......@@ -381,22 +379,20 @@
shopCar.goodsId = _goodsID;
shopCar.count = self.headerView.goodsNumber.text;
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithCallClass:weakSelf WithRequestType:0 WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) WithRequestType:ZERO WithParameter:shopCar WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSLog(@"添加购物车成功");
[weakSelf StartAddShoppingCarAnimationWithimage:weakSelf.headerView.goodsImageview.image withStartpoint:[weakSelf.headerView convertPoint:[weakSelf.headerView.goodsImageview center] toView:weakSelf.view.window] withSize:weakSelf.headerView.goodsImageview.frame.size];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf ErrorMBProgressView:@"添加购物车失败"];
}WithFailureBlock:^(id error) {
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:@"添加购物车失败"];
}];
}
......
......@@ -53,10 +53,6 @@
*/
@property (nonatomic,strong) GoodsResponse *temporaryArray;
/**
* 当前页数
*/
@property (nonatomic,assign) int indexPage;
/**
* 搜索结果个数
......@@ -106,6 +102,10 @@
{
if (!_condtionModel) {
_condtionModel = [[GoodsCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = ONE;
page.rows = KROWS;
_condtionModel.page = page;
}
return _condtionModel;
}
......@@ -138,7 +138,7 @@
- (void)getScreeningdatasisRemoveArray:(BOOL)remove
{
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 (remove) {
......@@ -153,13 +153,11 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -168,14 +166,14 @@
#pragma mark -获取商品列表数据
- (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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.emptyDataSetDelegate = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.productCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
GoodsResponse *sponse = [[GoodsResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
......@@ -185,21 +183,16 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.productCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
#pragma mark -布局
- (void)uiConfigAction
{
self.indexPage = ONE;
self.selectedIndex = 9999;//无任何意义
self.productCollectionLayout.itemSize = CGSizeMake((ScreenWidth-100)/3, (ScreenWidth-100)/3);
self.productCollectionLayout.sectionInset = UIEdgeInsetsMake(20, 30, 20, 30);
......@@ -222,12 +215,7 @@
[weakSelf barCodeSearchRequest];
}else
{
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = ONE;
Newpage.rows = KROWS;
weakSelf.condtionModel.page = Newpage;
weakSelf.indexPage = ONE;
weakSelf.condtionModel.page.page = ONE;
//搜索
if (_selectedCode) {
switch (weakSelf.selectedIndex) {
......@@ -280,15 +268,10 @@
[weakSelf barCodeSearchRequest];
}else
{
if ( ++ weakSelf.indexPage > weakSelf.totalPages) {
if ( ++ weakSelf.condtionModel.page.page > weakSelf.totalPages) {
[weakSelf.productCollectionView.mj_footer endRefreshingWithNoMoreData];
}else
{
//分页数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = weakSelf.indexPage;
Newpage.rows = KROWS;
weakSelf.condtionModel.page = Newpage;
//搜索
if (_selectedCode) {
switch (weakSelf.selectedIndex) {
......@@ -337,15 +320,15 @@
- (void)barCodeSearchRequest
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(BARCODESEARCH),_barcode] WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(BARCODESEARCH),_barcode] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf endRefreshingForTableView:self.productCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if ([returnValue[@"data"] isKindOfClass:[NSNull class]]) {
[weakSelf ErrorMBProgressView:@"暂无商品信息"];
[XBLoadingView showHUDViewWithText:@"暂无商品信息"];
return;
}
TOGoodsEntity *goods = [[TOGoodsEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
......@@ -354,15 +337,13 @@
[weakSelf.productCollectionView reloadData];
}else
{
[weakSelf ErrorMBProgressView:@"查询失败"];
[XBLoadingView showHUDViewWithText:@"查询失败"];
}
}WithFailureBlock:^(id error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:self.productCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:self.productCollectionView];
[weakSelf ErrorMBProgressView:@"查询失败"];
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:@"查询失败"];
}];
}
......@@ -408,19 +389,19 @@
[cell setReturnCellCgpoint:^void(CGPoint centerPoint,NSInteger cellindex ,CGSize size) {
//判断是否有当前客户
if (![Shoppersmanager manager].currentCustomer) {
[weakSelf ErrorMBProgressView:@"必须设置当前客户"];
[XBLoadingView showHUDViewWithText:@"必须设置当前客户"];
return;
}
//库存为0时不能加入购物车
if (model.number == 0) {
[weakSelf ErrorMBProgressView:@"此商品库存不足"];
[XBLoadingView showHUDViewWithText:@"此商品库存不足"];
return;
}
TOGoodsEntity *model = [weakSelf.datasArray objectAtIndex_opple:cellindex];
[weakSelf CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
[weakSelf addGoodsShoppingbags:model complate:^{
NSLog(@"加入购物车完成");
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
[weakSelf StartAddShoppingCarAnimationWithimage:weakCell.productImageView.image withStartpoint:centerPoint withSize:size];
}];
}];
......@@ -673,7 +654,7 @@
{
if (self.temporaryArray.goodsEntity.count == 0) {
[self ErrorMBProgressView:@"暂无数据"];
[XBLoadingView showHUDViewWithText:@"暂无数据"];
}else
{
self.datasArray = [NSMutableArray arrayWithArray:self.temporaryArray.goodsEntity];
......@@ -708,22 +689,21 @@
#pragma mark -添加至购物车
- (void)addGoodsShoppingbags:(TOGoodsEntity *)model complate:(void(^)())response
{
WS(weakSelf);
SaveShoppingCartRequest *shopCar = [[SaveShoppingCartRequest alloc]init];
shopCar.consumerId = [Customermanager manager].model.fid;
shopCar.goodsId = model.fid;
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]) {
response();
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf ErrorMBProgressView:@"加入购物车失败"];
}WithFailureBlock:^(id error) {
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:@"加入购物车失败"];
}];
}
......
......@@ -36,36 +36,33 @@
WS(weakSelf);
if ([[self class]isBlankString:self.inputRebateTextField.text]) {
[self SHOWPrompttext:@"请输入提现金额"];return;
[XBLoadingView showHUDViewWithText:@"请输入提现金额"];return;
}
if ([self.inputRebateTextField.text floatValue] > self.rebateAmount) {
[self SHOWPrompttext:@"当前账户余额不足"];return;
[XBLoadingView showHUDViewWithText:@"当前账户余额不足"];return;
}
if ([self.inputRebateTextField.text floatValue] <= 0) {
[self SHOWPrompttext:@"格式不正确"];return;
[XBLoadingView showHUDViewWithText:@"格式不正确"];return;
}
if ([self includeChinese:self.inputRebateTextField.text]) {
[self SHOWPrompttext:@"格式不正确"];return;
[XBLoadingView showHUDViewWithText:@"格式不正确"];return;
}
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:[NSString stringWithFormat:@"请确认提现金额:%@元",self.inputRebateTextField.text] preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[weakSelf CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(WITHDRAWAL) WithCallClass:weakSelf WithRequestType:0 WithParameter:@{@"amount":self.inputRebateTextField.text} WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(WITHDRAWAL) WithRequestType:ZERO WithParameter:@{@"amount":self.inputRebateTextField.text} WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.applyUUID = returnValue[@"data"];
[weakSelf rebateApplySuccess];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
......@@ -98,11 +95,11 @@
#pragma mark - 查询详情
- (void)queryDetails
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
WS(weakSelf);
NSString *urlString = [NSString stringWithFormat:@"%@/%@",WITHDRAWALPROGRESSDETAILS,self.applyUUID];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(urlString) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(urlString) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
TOApplyBillEntity *result = [[TOApplyBillEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf.navigationController popViewControllerAnimated:NO];
......@@ -111,14 +108,10 @@
}
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -204,11 +204,11 @@
- (void)getRebateDatasFromUser
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.model = [[EarningsResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
weakSelf.currentAmountLabel.text = [NSString stringWithFormat:@"%.2f",[returnValue[@"data"][@"accountTotal"] floatValue]];
......@@ -217,15 +217,11 @@
weakSelf.freezeAmountLabel.text = [NSString stringWithFormat:@"%.2f",[returnValue[@"data"][@"applytotal"] floatValue]];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -29,11 +29,6 @@
*/
@property (nonatomic,strong) NSArray *imageArray;
/**
* 当前页数
*/
@property (nonatomic,assign) int indexPage;
/**
* 总页数
*/
......@@ -77,8 +72,11 @@
- (SceneCondition *)conditionModel
{
if (!_conditionModel) {
_conditionModel = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = ONE;
page.rows = KROWS;
_conditionModel.page = page;
}
return _conditionModel;
}
......@@ -115,12 +113,8 @@
//下拉刷新
WS(weakSelf);
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
//默认数据
weakSelf.indexPage = ONE;
DataPage *page = [[DataPage alloc]init];
page.page = weakSelf.indexPage;
page.rows = KROWS;
weakSelf.conditionModel.page = page;
weakSelf.conditionModel.page.page = ONE;
[weakSelf.seceneLibararyCollectionView.mj_footer resetNoMoreData];
[weakSelf getSceneLibrarydatas:weakSelf.conditionModel isRemove:YES];
}];
......@@ -131,15 +125,10 @@
//上拉加载
self.seceneLibararyCollectionView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if ( ++ weakSelf.indexPage > weakSelf.totalPages) {
if ( ++ weakSelf.conditionModel.page.page > weakSelf.totalPages) {
[weakSelf.seceneLibararyCollectionView.mj_footer endRefreshingWithNoMoreData];
}else
{
//默认数据
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = weakSelf.indexPage;
Newpage.rows = KROWS;
weakSelf.conditionModel.page = Newpage;
[weakSelf getSceneLibrarydatas:weakSelf.conditionModel isRemove:NO];
}
}];
......@@ -151,19 +140,16 @@
- (void)getdatasAction
{
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]) {
weakSelf.filter = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
}WithFailureBlock:^(id error) {
}];
}
......@@ -172,14 +158,14 @@
#pragma mark -获取场景列表数据
- (void)getSceneLibrarydatas:(SceneCondition *)condition isRemove:(BOOL)remove
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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.emptyDataSetDelegate = weakSelf;
[weakSelf endRefreshingForTableView:weakSelf.seceneLibararyCollectionView];
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (remove) {
[weakSelf.responseArray removeAllObjects];
......@@ -193,16 +179,13 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.seceneLibararyCollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
}WithFailureBlock:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.seceneLibararyCollectionView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -152,10 +152,10 @@
- (void)getHotSearchdatas
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(HOTSEARCH) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(HOTSEARCH) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.response = [[HotFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
......@@ -163,13 +163,11 @@
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -187,7 +187,7 @@
- (void)getPayQrCode
{
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]) {
......@@ -198,13 +198,11 @@
}else
{
NSLog(@"获取二维码失败");
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -227,11 +225,11 @@
- (IBAction)SureButtonClick:(UIButton *)sender {
if ([self.payTypeButton.currentTitle isEqualToString:@"现金、支票、转账、刷卡"] && !self.payTreasureButton.selected && !self.WeixiPayButton.selected) {
[self ErrorMBProgressView:@"请选择一种支付方式"];
[XBLoadingView showHUDViewWithText:@"请选择一种支付方式"];
}else if ([self.invoiceType.currentTitle isEqualToString:@"公司发票"] && [[self class] isBlankString:self.invoiceHeader.text])
{
[self ErrorMBProgressView:@"请输入发票抬头"];
[XBLoadingView showHUDViewWithText:@"请输入发票抬头"];
}else
{
[self SurePayRequest];
......@@ -250,7 +248,7 @@
[self.payController dismissViewControllerAnimated:NO completion:nil];
if ([self.weiXinLabe isKindOfClass:[NSNull class]]) {
[self SHOWPrompttext:@"微信支付二维码为空,暂停使用!"];return;
[XBLoadingView showHUDViewWithText:@"微信支付二维码为空,暂停使用!"];return;
}
self.showPayQrCodeImageView.hidden = NO;
sender.selected = NO;
......@@ -266,7 +264,7 @@
[self.payController dismissViewControllerAnimated:NO completion:nil];
if ([self.zhiFubaoLabe isKindOfClass:[NSNull class]]) {
[self SHOWPrompttext:@"支付宝支付二维码为空,暂停使用!"];return;
[XBLoadingView showHUDViewWithText:@"支付宝支付二维码为空,暂停使用!"];return;
}
self.showPayQrCodeImageView.hidden = NO;
sender.selected = NO;
......@@ -308,7 +306,7 @@
- (IBAction)invoiceTypeButtonClick:(UIButton *)sender {
if ([self.ISinvoiceButton.currentTitle isEqualToString:@"否"]) {
[self ErrorMBProgressView:@"请选择开票"];
[XBLoadingView showHUDViewWithText:@"请选择开票"];
return;
}
NSArray *arr = @[@"个人发票",@"公司发票"];
......@@ -461,7 +459,7 @@
if ([self.invoiceType.currentTitle isEqualToString:@"公司发票"] && [order.isbill isEqualToString:@"Y"]) {
order.billType = @"002";
if (self.invoiceHeader.text.length == 0 || !self.invoiceHeader.text) {
[self ErrorMBProgressView:@"发票抬头不能为空"];
[XBLoadingView showHUDViewWithText:@"发票抬头不能为空"];
return;
}
order.billTitle = self.invoiceHeader.text;
......@@ -469,12 +467,12 @@
{
order.billType = @"001";
}
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
WS(weakSelf);
NSLog(@"%@",[order toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CONFIRMPAY) WithCallClass:weakSelf WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) {
NSSLog(@"%@",[order toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CONFIRMPAY) WithRequestType:ZERO WithParameter:order WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf dismissViewControllerAnimated:YES completion:^{
if (weakSelf.PaySuccessReturnBlock) {
......@@ -482,12 +480,10 @@
}
}];
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -521,7 +517,7 @@
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
if ([self.ISinvoiceButton.currentTitle isEqualToString:@"否"]) {
[self ErrorMBProgressView:@"请选择开票"];
[XBLoadingView showHUDViewWithText:@"请选择开票"];
return NO;
}
return YES;
......
......@@ -145,20 +145,20 @@
NSString *phoneNumber = self.PhoneNumber.text;
if ([BaseViewController isBlankString:self.recipientPerson.text]) {
[self ErrorMBProgressView:@"请输入收货人姓名"];
[XBLoadingView showHUDViewWithText:@"请输入收货人姓名"];
return;
}
if ([BaseViewController isBlankString:phoneNumber]) {
[self ErrorMBProgressView:@"手机号码不能为空"];
[XBLoadingView showHUDViewWithText:@"手机号码不能为空"];
return;
}
if (![HENLENSONG isValidateMobile:phoneNumber]) {
[self ErrorMBProgressView:@"手机号码格式不正确"];
[XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];
return;
}
if ([BaseViewController isBlankString:self.detailsAddress.text]) {
[self ErrorMBProgressView:@"请输入详细地址"];
[XBLoadingView showHUDViewWithText:@"请输入详细地址"];
return;
}
if ([sender.currentTitle isEqualToString:@"新增"]) {
......@@ -184,11 +184,11 @@
address.province = self.provincesString;
}
address.address = self.detailsAddress.text;
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
AddressModel *model = [[AddressModel alloc]init];
......@@ -214,13 +214,11 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
}WithFailureBlock:^(id error) {
[XBLoadingView hideHUDViewWithDefault];
}];
}
......@@ -239,11 +237,11 @@
address.province = self.provincesString;
}
address.fid = self.model.fid;
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
AddressModel *model = [[AddressModel alloc]init];
......@@ -269,17 +267,11 @@
}
else
{
[self ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
NSLog(@"%@",error);
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
}];
}
......@@ -301,26 +293,25 @@
#pragma mark -删除收货地址
- (void)deleteAddressButtonClick
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf SuccessMBProgressView:@"删除成功"];
[XBLoadingView showHUDViewWithSuccessText:@"删除成功"];
if ([weakSelf.delegate respondsToSelector:@selector(delecteCell:)]) {
[weakSelf.delegate delecteCell:_model.fid];
}
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:@"无网络"];
} WithFailureBlock:^(id error) {
}WithFailureBlock:^(id error) {
[XBLoadingView hideHUDViewWithDefault];
}];
}
......
......@@ -110,11 +110,11 @@
#pragma mark -获得地址信息
- (void)getAddressDatasRequest
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
RsShippingAddrEntity *address = [[RsShippingAddrEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
......@@ -150,13 +150,10 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -393,10 +390,10 @@
//总数量
orderReceiver.goodsNum = [NSString stringWithFormat:@"%ld",allNumber];
order.orderdetailList = (NSArray<TOOrderdetailEntity> *)goodidArr;
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CREATEORDER) WithCallClass:weakSelf WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(CREATEORDER) WithRequestType:ZERO WithParameter:order WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
//商品购物车id
NSMutableArray *codeArrray = [NSMutableArray array];
......@@ -417,18 +414,17 @@
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
return;
}
else if (i == Adressarr.count -1)
{
[self ErrorMBProgressView:@"未选中地址"];
[XBLoadingView showHUDViewWithText:@"未选中地址"];
}
}
}
......@@ -499,7 +495,7 @@
}else
{
if (i == arr.count-1) {
[self ErrorMBProgressView:@"请先勾选一个地址"];
[XBLoadingView showHUDViewWithText:@"请先勾选一个地址"];
}
}
}
......
This diff is collapsed.
......@@ -59,9 +59,13 @@
#pragma mark - 添加添加手势
- (void)addGestureRecognizer
{
[self.userHeader addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(userHeaderClickAction:)]];
[self.rebateBackView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(rebateViewClickAction:)]];
[self.guideIntegralView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(guideIntegralViewClickAction:)]];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",SERVERREQUESTURL(SHOPPERSCOMMISSION),[Shoppersmanager manager].Shoppers.employee.fid] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
// self.rebateLabe.text = [NSString stringWithFormat:@"¥%.2f",[returnValue[@"data"] floatValue]];
}
}WithFailureBlock:^(id error) {
}];
}
#pragma mark -我的账户点击
......@@ -102,7 +106,7 @@
else
{
[DeviceDirectionManager instance].isHorizontal=NO;
[self ErrorMBProgressView:@"相机无法使用"];
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
......@@ -115,7 +119,7 @@
else
{
[DeviceDirectionManager instance].isHorizontal=NO;
[self ErrorMBProgressView:@"相册无法打开"];
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
......@@ -146,7 +150,8 @@
{
WS(weakSelf);
NSData *data = UIImageJPEGRepresentation(image, 0.5);
[[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:1 WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) {
XBLoadingView *progressView = [XBLoadingView showHUDViewProgressLabel:@"上传头像中"];
[[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(UPLOADHEADER) WithRequestType:ONE WithImageDatas:data WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf modifyshoppersInformation:returnValue[@"data"] complete:^{
......@@ -154,23 +159,18 @@
}];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithprogressBlock:^(double progress) {
if (progress >= 1) {
weakSelf.TCHud.labelText = @"上传完成";
[weakSelf RemoveMBProgressHUDLoding];
}else
{
[weakSelf ShowProgressView:progress];
progressView.labelText = @"上传完成";
[progressView hide:YES afterDelay:1];
}else{
progressView.progress = progress;
}
} WithErrorCodeBlock:^(id errorCodeValue) {
weakSelf.TCHud.labelText = @"上传失败";
[weakSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
weakSelf.TCHud.labelText = @"上传失败";
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -178,26 +178,22 @@
#pragma mark -上传完成修改导购个人信息
- (void)modifyshoppersInformation:(NSString *)headerurl complete:(void(^)())block
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
RsEmployeeRequest *employ = [[RsEmployeeRequest alloc]init];
employ.employee = [Shoppersmanager manager].Shoppers.employee;
employ.employee.picture = headerurl;
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
block();
[weakSelf SuccessMBProgressView:@"修改成功"];
[XBLoadingView showHUDViewWithSuccessText:@"修改成功"];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView hideHUDViewWithDefault];
}];
}
......@@ -219,10 +215,10 @@
}]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[weakSelf CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(CANCELLOGIN) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(CANCELLOGIN) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[Shoppersmanager manager].currentCustomer = NO;
......@@ -235,11 +231,8 @@
{
[weakSelf promptCustomerWithString:@"切换用户失败"];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
}];
}]];
[self presentViewController:alertVC animated:YES completion:nil];
......@@ -273,26 +266,26 @@
if ([[self class] isBlankString:self.userName.text]) {
[self ErrorMBProgressView:@"用户名不能为空"];
[XBLoadingView showHUDViewWithText:@"用户名不能为空"];
return;
}
if ([[self class] isBlankString:self.passWord.text]) {
[self ErrorMBProgressView:@"密码不能为空"];
[XBLoadingView showHUDViewWithText:@"密码不能为空"];
return;
}
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
LoginInfo *login = [[LoginInfo alloc]init];
login.username = self.userName.text;
login.password = self.passWord.text;
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf SuccessMBProgressView:@"登陆成功"];
[XBLoadingView showHUDViewWithSuccessText:@"登陆成功"];
LoginResult *result = [[LoginResult alloc] initWithDictionary:returnValue[@"data"] error:nil];
[Shoppersmanager manager].userNameString = weakSelf.userName.text;
[Shoppersmanager manager].passWordString = weakSelf.passWord.text;
......@@ -309,17 +302,12 @@
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
[weakSelf recoveryUsernamePasswrod];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
NSLog(@"%@",errorCodeValue);
} WithFailureBlock:^(id error) {
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
[weakSelf recoveryUsernamePasswrod];
}];
......
......@@ -97,13 +97,13 @@
- (void)getDatasAction:(BOOL)isRemoveAll
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(WITHDRAWALPROGRESS) WithCallClass:weakSelf WithRequestType:0 WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(WITHDRAWALPROGRESS) WithRequestType:ZERO WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
weakSelf.withdrawalTableView.emptyDataSetSource = self;
weakSelf.withdrawalTableView.emptyDataSetDelegate = self;
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[weakSelf RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemoveAll) {
[weakSelf.resultArray removeAllObjects];
......@@ -116,17 +116,11 @@
[weakSelf.withdrawalTableView reloadData];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
}WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -18,13 +18,6 @@
@property (strong, nonatomic) UIWindow *window;
/**
* 网络状态
*/
@property (nonatomic,assign) BOOL Networkstatus;
/**
* 抽屉控制器对象
*/
......
......@@ -85,30 +85,25 @@
#pragma mark -检测网络的可连接性
- (void)detectionNetwork
{
self.Networkstatus = true;
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
switch (status) {
case AFNetworkReachabilityStatusUnknown:
case AFNetworkReachabilityStatusNotReachable:{
NSLog(@"无网络");
self.Networkstatus = false;
[XBLoadingView showHUDViewWithText:NETWORK];
break;
}
case AFNetworkReachabilityStatusReachableViaWiFi:{
NSLog(@"WiFi网络");
self.Networkstatus = true;
break;
}
case AFNetworkReachabilityStatusReachableViaWWAN:{
NSLog(@"流量网络");
self.Networkstatus = true;
break;
}
default:
......
......@@ -145,6 +145,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
if ([subview isKindOfClass:self]) {
return (MBProgressHUD *)subview;
}
NSLog(@"%@",subview);
}
return nil;
}
......
......@@ -20,83 +20,27 @@
*/
- (void)endRefreshingForTableView:(UIScrollView *)TableView;
/**
* MBProgressHUD等待视图
*/
- (void)CreateMBProgressHUDLoding;
/**
* 移除MBProgressHUD等待视图
*/
- (void)RemoveMBProgressHUDLoding;
/**
* 渐隐提示框待回调Block
* 获得我的storyboard对象
*/
- (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed;
/**
* 获得主体的storyboard对象
*/
+ (UIStoryboard *)getMainStoryboardClass;
/**
获得公告storyboard对象
*/
+ (UIStoryboard *)getAnnouncementStoryboardClass;
/**
获得学习中心storyboard对象
*/
+ (UIStoryboard *)getLearningCenterStoryboardClass;
/**
获得积分storyboard对象
*/
+ (UIStoryboard *)getGuideIntegralStoryboardClass;
- (UIStoryboard *)getStoryboardWithName;
/**
* 调用打印机
*/
- (void)callAirprintWithdata:(NSString *)PDFpath SuccessBlock:(void(^)())success ErrorBlock:(void(^)())failed;
/**
提示框
*/
- (void)promptCustomerTitle:(NSString *)title withMessage:(NSString *)message finish:(void (^)())complete;
/**
判断相机权限
* 判断是否有相机权限
*/
+ (BOOL)determineCameraPermissions;
/**
* 成功等待视图
*/
- (void)SuccessMBProgressView:(NSString *)successString;
/**
* 提示信息等待视图
*/
- (void)ErrorMBProgressView:(NSString *)errorString;
/**
* 纯文本提示框
*/
- (void)SHOWPrompttext:(NSString *)Text;
/**
* 显示提示图片、文本
* 提示框
*
*/
- (void)PromptinformationViewWithimage:(UIImage *)image withTitle:(NSString *)title withpoint:(CGPoint)point;
- (void)promptCustomerTitle:(NSString *)title withMessage:(NSString *)message finish:(void (^)())complete;
/**
* 删除提示图片、文本
*/
- (void)RemovePromptinformationView;
/**
* 查询订单状态图片
......@@ -108,10 +52,6 @@
*/
+ (id)ReturnOrderStateTitleWithStateCode:(NSInteger)ordercode withPoint:(CGPoint)point WithCode:(NSInteger)code;
/**
查询兑奖单state对应文字
*/
+ (id)returnPrizeBillStateTitleColor:(NSString *)stateCode;
/**
* 查询购物车数量
......@@ -129,18 +69,6 @@
*/
- (void)promptCustomerWithString:(NSString *)message;
/**
* 进度条
*/
- (void)ShowProgressView:(double)progress;
/**
* 提示框
*/
@property (nonatomic,strong) MBProgressHUD*TCHud;
/**
* 友好化时间
*/
......@@ -161,12 +89,6 @@
*/
+ (BOOL)isBlankString:(NSString *)string;
/**
* 获取当前时间之前或者之后的时间(之前传入负数)
*/
+ (NSString *)getTimeby:(NSInteger)day;
/**
选择框
......
......@@ -29,20 +29,6 @@
@implementation BaseViewController
/**
* 创建MBProgressHUD对象
*
* @return MBProgressHUD
*/
- (MBProgressHUD *)TCHud
{
if (_TCHud == nil) {
_TCHud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
}
return _TCHud;
}
/**
* 初始化提示框
......@@ -69,7 +55,6 @@
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
......@@ -88,7 +73,7 @@
[weakSelf dismissViewControllerAnimated:YES completion:nil];
[Shoppersmanager manager].currentCustomer = NO;
[Customermanager manager].model = nil;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"OppleMain" bundle:nil];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
LoginViewController *loginVC = [storyboard instantiateViewControllerWithIdentifier:@"Login"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:USERNAME];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:PASSWORD];
......@@ -120,123 +105,6 @@
completion:nil];
}
#pragma mark -渐隐提示框回调
- (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed
{
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
hud.labelText = Text;
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText;
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.6];
hud.removeFromSuperViewOnHide = YES;
[hud hide:YES afterDelay:2.0f];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (completed) {
completed();
}
});
}
#pragma mark -显示MBProgressHUD等待视图
- (void)CreateMBProgressHUDLoding
{
self.TCHud.animationType = MBProgressHUDAnimationZoom;
self.TCHud.mode = MBProgressHUDModeIndeterminate;
self.TCHud.color = [UIColor clearColor];
self.TCHud.activityIndicatorColor = kMainBlueColor;
self.TCHud.removeFromSuperViewOnHide = YES;
}
#pragma mark -进度条
- (void)ShowProgressView:(double)progress
{
dispatch_async(dispatch_get_main_queue(), ^{
self.TCHud.mode = MBProgressHUDModeDeterminate;
self.TCHud.labelText = @"上传中....";
self.TCHud.labelFont = [UIFont systemFontOfSize:12];
self.TCHud.progress = progress;
self.TCHud.removeFromSuperViewOnHide = YES;
});
}
#pragma mark -移除MBProgressHUD等待视图
- (void)RemoveMBProgressHUDLoding;
{
dispatch_async(dispatch_get_main_queue(), ^{
if (_TCHud) {
[_TCHud hide:YES];
_TCHud = nil;
}
});
}
#pragma mark -显示成功的提示框
- (void)SuccessMBProgressView:(NSString *)successString
{
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.mode = MBProgressHUDModeCustomView;
UIImage *image = [[UIImage imageNamed:@"Checkmark"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
hud.customView = [[UIImageView alloc] initWithImage:image];
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.6];
hud.labelFont = [UIFont systemFontOfSize:15];
hud.labelText = successString;
[hud hide:YES afterDelay:3];
}
#pragma mark -显示信息的提示框
- (void)ErrorMBProgressView:(NSString *)errorString
{
[self RemoveMBProgressHUDLoding];
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.labelText = errorString;
hud.margin = 10.f;
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(250, 70);
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES;
[hud hide:YES afterDelay:3.0f];
}
#pragma mark - 获取当前时间之前或者之后的时间(之前传入负数)
+ (NSString *)getTimeby:(NSInteger)day
{
NSDate*nowDate = [NSDate date];
NSDate* theDate;
if(day!=0){
NSTimeInterval oneDay = 24*60*60*1; //1天的长度
theDate = [nowDate initWithTimeIntervalSinceNow: oneDay*day];
}else{
theDate = nowDate;
}
NSDateFormatter *date_formatter = [[NSDateFormatter alloc] init];
[date_formatter setDateFormat:@"yyyy-MM-dd 00:00:00"];
NSString *the_date_str = [date_formatter stringFromDate:theDate];
return the_date_str;
}
#pragma mark -渐隐提示框
- (void)SHOWPrompttext:(NSString *)Text
{
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.labelText = Text;
hud.margin = 10.f;
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.minSize = CGSizeMake(200, 50);
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES;
[hud hide:YES afterDelay:3.0f];
}
#pragma mark -结束MJRfresh刷新
- (void)endRefreshingForTableView:(UIScrollView *)TableView
{
......@@ -251,30 +119,9 @@
}
#pragma mark -获得我的storyboard对象
+ (UIStoryboard *)getMainStoryboardClass
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"OppleMain" bundle:nil];
return storyboard;
}
#pragma mark - 获得公告storyboard对象
+ (UIStoryboard *)getAnnouncementStoryboardClass
- (UIStoryboard *)getStoryboardWithName
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Announcement" bundle:nil];
return storyboard;
}
#pragma mark - 获得学习中心storyboard对象
+ (UIStoryboard *)getLearningCenterStoryboardClass
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LearningCenter" bundle:nil];
return storyboard;
}
#pragma mark -获得积分storyboard对象
+ (UIStoryboard *)getGuideIntegralStoryboardClass
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"GuideIntegral" bundle:nil];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
return storyboard;
}
......@@ -323,15 +170,6 @@
}
#pragma mark -提示文本,图片
- (void)PromptinformationViewWithimage:(UIImage *)image withTitle:(NSString *)title withpoint:(CGPoint)point
{
self.promptView.tipsImage.image = image;
self.promptView.tipsTitle.text = title;
self.promptView.frame = CGRectMake(point.x, point.y, 250, 170);
[self.view addSubview:self.promptView];
}
#pragma mark - 提示框
- (void)promptCustomerTitle:(NSString *)title withMessage:(NSString *)message finish:(void (^)())complete
{
......@@ -444,33 +282,18 @@
return nil;
}
#pragma mark - <##>查询兑奖单state对应文字
+ (id)returnPrizeBillStateTitleColor:(NSString *)stateCode
{
NSDictionary *dict;
if ([stateCode isEqualToString:@"requested"]) {
dict = @{@"title":@"已申请",@"color":RGB(127, 192, 62, 1)};
}else if ([stateCode isEqualToString:@"requested"]) {
dict = @{@"title":@"已发货",@"color":RGB(245, 185, 74, 1)};
}
return dict;
}
#pragma mark -查询购物车数量
- (void)QueryShoppingCarNumber
{
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]) {
NSLog(@"更新购物车数量成功");
[[NSNotificationCenter defaultCenter]postNotificationName:ADDSHOPPINGCAR object:returnValue[@"data"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
NSLog(@"更新购物车数量失败");
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -163,17 +163,18 @@
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(null_unspecified WKNavigation *)navigation
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
}
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
[self RemoveMBProgressHUDLoding];
[XBLoadingView hideHUDViewWithDefault];
}
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error
{
[self RemoveMBProgressHUDLoding];
[XBLoadingView showHUDViewWithText:@"加载失败"];
[self dismissViewControllerAnimated:YES completion:nil];
}
......
......@@ -260,7 +260,7 @@
- (IBAction)ShareButtonClickAction:(UIButton *)sender {
if (!self.shareGoodsArray.count) {
[self ErrorMBProgressView:@"没有选择需要分享的商品"];
[XBLoadingView showHUDViewWithText:@"没有选择需要分享的商品"];
return;
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
......@@ -287,7 +287,7 @@
- (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo
{
if (error != NULL) {
[self ErrorMBProgressView:@"保存相册失败"];
[XBLoadingView showHUDViewWithText:@"保存相册失败"];
}
}
......@@ -315,7 +315,7 @@
}
else
{
[self ErrorMBProgressView:@"相机无法使用"];
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
sender.selected = NO;
}
}]];
......@@ -328,7 +328,7 @@
}
else
{
[self ErrorMBProgressView:@"相册无法打开"];
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
sender.selected = NO;
}
}]];
......
//
// 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 提示信息
*/
+ (void)showHUDViewWithSuccessText:(NSString *)text;
/**
显示进度框
@param text 提示信息
@return XBLoadingView
*/
+ (XBLoadingView *)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
/**
显示普通加载框
*/
+ (void)showHUDViewWithDefault
{
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeIndeterminate;
hud.color = [UIColor clearColor];
hud.activityIndicatorColor = kMainBlueColor;
hud.removeFromSuperViewOnHide = YES;
}
/**
显示文本提示框
@param text 提示信息
*/
+ (void)showHUDViewWithText:(NSString *)text
{
[[self class] hideHUDViewWithDefault];
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.labelText = text;
hud.margin = 20.f;
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.5];
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES;
[hud hide:YES afterDelay:3.0f];
}
/**
显示成功提示框
@param text 提示信息
*/
+ (void)showHUDViewWithSuccessText:(NSString *)text
{
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.mode = MBProgressHUDModeCustomView;
UIImage *image = [[UIImage imageNamed:@"Checkmark"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
hud.customView = [[UIImageView alloc] initWithImage:image];
hud.color = [[UIColor blackColor] colorWithAlphaComponent:0.6];
hud.labelFont = [UIFont systemFontOfSize:15];
hud.labelText = text;
[hud hide:YES afterDelay:3];
}
/**
显示进度框
@param text 提示信息
@return XBLoadingView
*/
+ (XBLoadingView *)showHUDViewProgressLabel:(NSString *)text
{
XBLoadingView *hud = [XBLoadingView showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.mode = MBProgressHUDModeDeterminate;
hud.labelText = text;
hud.labelFont = [UIFont systemFontOfSize:12];
hud.removeFromSuperViewOnHide = YES;
return hud;
}
/**
隐藏加载框
*/
+ (void)hideHUDViewWithDefault
{
[[self class] hideHUDForView:SHARED_APPDELEGATE.window animated:YES];
}
@end
......@@ -11,19 +11,16 @@
//定义返回数据的block类型
typedef void (^ReturnValueBlock) (id returnValue);
typedef void (^ErrorCodeBlock) (id errorCodeValue);
typedef void (^FailureBlock)(NSError *error);
//上传图片返回当前进度
typedef void (^UploadprogressBlock)(double progress);
//定义请求类型
typedef enum {
typedef NS_ENUM(NSInteger,NetworkRequestType){
NetworkRequestWithPOST = 0, //POST
NetworkRequestWithGET //GET
}NetworkRequestType;
};
@interface NetworkRequestClassManager : NSObject
......@@ -47,18 +44,12 @@ typedef enum {
* @param failureBlock 失败回调
*/
- (void)NetworkRequestWithURL:(NSString *) requestURLString
WithCallClass:(BaseViewController *)object
WithRequestType:(NetworkRequestType) requestType
WithParameter:(JSONModel *) jastorobject
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock;
/**
* 网络请求传入字典对象
*
......@@ -70,15 +61,11 @@ typedef enum {
* @param failureBlock 失败回调
*/
- (void)NetworkWithDictionaryRequestWithURL:(NSString *) requestURLString
WithCallClass:(BaseViewController *)object
WithRequestType:(NetworkRequestType) requestType
WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock;
/**
* 下载PDF
*
......@@ -89,13 +76,8 @@ typedef enum {
*/
- (void)DownloadPDFdatasWithURL:(NSString *) requestURLString
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock;
/**
* 上传分享图片
*
......@@ -114,7 +96,6 @@ typedef enum {
WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithprogressBlock:(UploadprogressBlock) progressBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock;
......
......@@ -67,30 +67,19 @@ static NetworkRequestClassManager *manager = nil;
*/
- (void)NetworkRequestWithURL:(NSString *) requestURLString
WithCallClass:(BaseViewController *)object
WithRequestType:(NetworkRequestType) requestType
WithParameter:(JSONModel *) jastorobject
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock
{
AFHTTPSessionManager *manager = [self baseHttpRequest];
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
if (requestType == 0) {
[manager POST:requestURLString parameters:[jastorobject toDictionary] progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
//登陆超时
if ([responseObject[@"code"] isEqualToNumber:@1]) {
[object RemoveMBProgressHUDLoding];
[[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil];
}else {
successBlock(responseObject);
......@@ -108,7 +97,6 @@ static NetworkRequestClassManager *manager = nil;
//登陆超时
if ([responseObject[@"code"] isEqualToNumber:@1]) {
[object RemoveMBProgressHUDLoding];
[[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil];
}else{
successBlock(responseObject);
......@@ -134,25 +122,17 @@ static NetworkRequestClassManager *manager = nil;
* @param failureBlock 失败回调
*/
- (void)NetworkWithDictionaryRequestWithURL:(NSString *) requestURLString
WithCallClass:(BaseViewController *)object
WithRequestType:(NetworkRequestType) requestType
WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock
{
AFHTTPSessionManager *manager = [self baseHttpRequest];
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
if (requestType == 0) {
[manager POST:requestURLString parameters:parameter progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
//登陆超时
if ([responseObject[@"code"] isEqualToNumber:@1]) {
[object RemoveMBProgressHUDLoding];
[[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil];
}else {
successBlock(responseObject);
......@@ -165,7 +145,6 @@ static NetworkRequestClassManager *manager = nil;
[manager GET:requestURLString parameters:parameter progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
//登陆超时
if ([responseObject[@"code"] isEqualToNumber:@1]) {
[object RemoveMBProgressHUDLoding];
[[NSNotificationCenter defaultCenter] postNotificationName:LOGINTIMEOUT object:nil];
}else{
successBlock(responseObject);
......@@ -189,7 +168,6 @@ static NetworkRequestClassManager *manager = nil;
*/
- (void)DownloadPDFdatasWithURL:(NSString *) requestURLString
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock
{
......@@ -199,12 +177,6 @@ static NetworkRequestClassManager *manager = nil;
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.requestSerializer.timeoutInterval = 120.0f;
[manager.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField: @"Content-Type"];
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
//构造URL对象
NSURL *url = [NSURL URLWithString:requestURLString];
//构造request对象
......@@ -249,16 +221,8 @@ static NetworkRequestClassManager *manager = nil;
WithParameter:(NSDictionary *) parameter
WithReturnValueBlock:(ReturnValueBlock) successBlock
WithprogressBlock:(UploadprogressBlock) progressBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock
{
//网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) {
errorCodeBlock(BROKEN);
return;
}
AFHTTPSessionManager *manager = [self baseHttpRequest];
[manager POST:requestURLString parameters:parameter constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
......
......@@ -41,6 +41,8 @@
#import "CustomBorderLabel.h"
#import "PNCircleChart.h"
#import "CustomStudyEntity.h"
#import "XBLoadingView.h"
// Include any system framework and library headers here that should be included in all compilation units.
......
......@@ -234,7 +234,7 @@
{
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]) {
......@@ -263,11 +263,8 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
}];
......@@ -311,7 +308,7 @@
- (void)getSceneLibrarydatas:(SceneCondition *)condition isRemove:(BOOL)remove
{
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 endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
......@@ -346,11 +343,8 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) {
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
}];
......@@ -402,8 +396,8 @@
#pragma mark -获取产品筛选数据
- (void)getScreeningdatasisRemoveArray:(BOOL)remove
{
WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithCallClass:weakSelf WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
__weak typeof(self) weakSelf = self;
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(PRODUCTSCREENING) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -456,13 +450,11 @@
}
else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -538,7 +530,7 @@
- (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish
{
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];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -548,15 +540,12 @@
finish(sponse);
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
}WithFailureBlock:^(NSError *error) {
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.sceneOrProductClollectionView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......
......@@ -30,22 +30,19 @@
WS(weakSelf);
if (self.isShareOrderbill) {//分享订单
[self dismissViewControllerAnimated:YES completion:nil];
[weakSelf CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf callSharePlatform:returnValue[@"data"][@"url"] withPlatformTag:sender withTitle:@"欧立方订单一键分享"];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}else//分享商品
{
......@@ -53,11 +50,7 @@
NSData *imageData = UIImageJPEGRepresentation(self.shareImage, 0.5);
NSString *goodsID = [self.goodsIds substringToIndex:[self.goodsIds length]-1];
NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:[goodsID substringToIndex:self.goodsIds.length-1],@"goodsIds",@"",@"title",@"",@"remark",nil];
//上传图片
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:SHARED_APPDELEGATE.window animated:YES];
hud.mode = MBProgressHUDModeDeterminate;
hud.labelText = @"上传中....";
hud.removeFromSuperViewOnHide = YES;
XBLoadingView *progressView = [XBLoadingView showHUDViewProgressLabel:@"上传图片中"];
[[NetworkRequestClassManager Manager] UploadImageWithURL:SERVERREQUESTURL(SHARE) WithRequestType:ZERO WithImageDatas:imageData WithParameter:parameterDict WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
......@@ -65,26 +58,17 @@
[self callSharePlatform:shareWeb withPlatformTag:sender withTitle:ShareTitle];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
}WithprogressBlock:^(double progress) {
if (progress >= 1) {
dispatch_async(dispatch_get_main_queue(), ^{
[hud hide:YES];
});
progressView.labelText = @"上传成功";
[progressView hide:YES afterDelay:1];
}else{
dispatch_async(dispatch_get_main_queue(), ^{
hud.progress = progress;
});
progressView.progress = progress;
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[hud hide:YES];
} WithFailureBlock:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
hud.labelText = @"上传失败";
[hud hide:YES afterDelay:1];
});
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
}
......@@ -92,7 +76,6 @@
#pragma mark - 调用分享
- (void)callSharePlatform:(NSString *)shareWeb withPlatformTag:(UIButton *)sender withTitle:(NSString *)title
{
WS(weakSelf);
switch (sender.tag) {
case 100: //微信好友
{//自定义样式
......@@ -100,7 +83,7 @@
[UMSocialData defaultData].extConfig.wechatSessionData.url = shareWeb;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
[weakSelf SuccessMBProgressView:@"分享微信好友成功"];
[XBLoadingView showHUDViewWithSuccessText:@"分享微信好友成功"];
}
}];
}
......@@ -111,7 +94,7 @@
[UMSocialData defaultData].extConfig.wechatTimelineData.url = shareWeb;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatTimeline] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
[weakSelf SuccessMBProgressView:@"分享微信朋友圈成功"];
[XBLoadingView showHUDViewWithSuccessText:@"分享微信朋友圈成功"];
}
}];
}
......@@ -122,7 +105,7 @@
[UMSocialData defaultData].extConfig.sinaData.shareText = [NSString stringWithFormat:@"%@%@",@"欧普照明",shareWeb];
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToSina] content:title image:self.shareImage location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *shareResponse){
if (shareResponse.responseCode == UMSResponseCodeSuccess) {
[weakSelf SuccessMBProgressView:@"分享新浪微博成功"];
[XBLoadingView showHUDViewWithSuccessText:@"分享新浪微博成功"];
}
}];
}
......
......@@ -210,7 +210,7 @@
}
}
if (!indexpathArray.count) {
[self ErrorMBProgressView:@"未选中任何商品"];
[XBLoadingView showHUDViewWithText:@"未选中任何商品"];
}else
{
for (ShopcarModel *model in delectedModelArray) {
......@@ -237,11 +237,11 @@
}
}
if (!array.count) {
[self ErrorMBProgressView:@"请先勾选商品"];
[XBLoadingView showHUDViewWithText:@"请先勾选商品"];
return;
}
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
NSMutableString *goodsIds = [[NSMutableString alloc]init];
NSMutableString *goodsCounts = [[NSMutableString alloc]init];
for (ShopcarModel *model in self.datasArray) {
......@@ -255,25 +255,22 @@
shopCar.goodsId = [goodsIds substringToIndex:goodsIds.length-1];
shopCar.count = [goodsCounts substringToIndex:goodsCounts.length-1];
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];
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (weakSelf.dismissBlock) {
weakSelf.dismissBlock();
}
[weakSelf dismissViewControllerAnimated:YES completion:nil];
[weakSelf QueryShoppingCarNumber];
[weakSelf SuccessMBProgressView:@"加入购物车成功"];
[XBLoadingView showHUDViewWithSuccessText:@"加入购物车成功"];
}else
{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
......@@ -291,7 +288,7 @@
#pragma mark -修改单个商品数量、价格
- (void)changeGoodsNumber:(NSInteger)goodsNumber WithcostPrice:(CGFloat)costprice Withcellindex:(NSInteger)cellindex returnValue:(void (^)(id))result
{
[self CreateMBProgressHUDLoding];
[XBLoadingView showHUDViewWithDefault];
//保存商品数量
ShopcarModel *model = [self.datasArray objectAtIndex_opple:cellindex];
model.goodsNum = goodsNumber;
......@@ -307,22 +304,19 @@
//商品数量
NSString *goodsNumberString = [NSString stringWithFormat:@"%ld",(long)goodsNumber];
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];
[XBLoadingView hideHUDViewWithDefault];
result(returnValue);//提供是否支持修改的参数
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf CalculateSelectedGoodsAllprice];
[weakSelf QueryShoppingCarNumber];
}else{
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf ErrorMBProgressView:error.localizedDescription];
}WithFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText: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