Commit e5a2b0ea authored by admin's avatar admin

完成上报抽检 商检抽检列表的逻辑

parent 9a039119
...@@ -32,10 +32,7 @@ ...@@ -32,10 +32,7 @@
// 口碑排名列表 // 口碑排名列表
#define kRankingListURL @"redstar-server/rest/praise/ranking" #define kRankingListURL @"redstar-server/rest/praise/ranking"
// 提交评论 // 提交评论
//#define kAddCommentURL @"redstar-server/rest/comment/submit?time=2015-06-25+13:59:26&operId=admin&operName=admin"
#define kAddCommentURL @"redstar-server/rest/comment/submit" #define kAddCommentURL @"redstar-server/rest/comment/submit"
// 点赞 // 点赞
...@@ -62,4 +59,20 @@ ...@@ -62,4 +59,20 @@
// 管理层的抽查列表 // 管理层的抽查列表
#define kManageSportcheckURL @"redstar-server/rest/sportcheck/query" #define kManageSportcheckURL @"redstar-server/rest/sportcheck/query"
// 商场的抽查列表
#define kStoreSportcheckURL @"redstar-server/rest/sportcheck/query_store"
// 发起抽查
#define kSaveSportcheckURL @"redstar-server/rest/spotcheck/save?time="
// 抽查任务的明细
#define kSportcheckDetailURL @"redstar-server/rest/spotcheck/get/"
// 上报抽查结果
#define kReportCheckResultURL @"redstar-server/rest/spotcheck/report/"
// 抽查评分
#define kGradeCheckResultURL @"redstar-server/rest/spotcheck/grade?time="
#endif /* Url_h */ #endif /* Url_h */
...@@ -11,9 +11,11 @@ ...@@ -11,9 +11,11 @@
#import "OnLineFooterView.h" #import "OnLineFooterView.h"
#import "SpotCheckOnLineViewController.h" #import "SpotCheckOnLineViewController.h"
#import "HttpClient.h"
#define kOnLineTableViewCell @"onlineTableViewCell" #define kOnLineTableViewCell @"onlineTableViewCell"
@interface OnLineViewController () <UITableViewDelegate, UITableViewDataSource> @interface OnLineViewController () <UITableViewDelegate, UITableViewDataSource, UIAlertViewDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *titleArray; @property (nonatomic, strong) NSArray *titleArray;
...@@ -46,7 +48,7 @@ ...@@ -46,7 +48,7 @@
self.navigationItem.leftBarButtonItem = backItem; self.navigationItem.leftBarButtonItem = backItem;
} }
-(void)doBack:(id)sender - (void)doBack:(id)sender
{ {
if ([[self.navigationController.viewControllers objectAtIndex:0] isKindOfClass:[SpotCheckOnLineViewController class]]) { if ([[self.navigationController.viewControllers objectAtIndex:0] isKindOfClass:[SpotCheckOnLineViewController class]]) {
SpotCheckOnLineViewController *spotCheckVC = (SpotCheckOnLineViewController *)[self.navigationController.viewControllers objectAtIndex:0]; SpotCheckOnLineViewController *spotCheckVC = (SpotCheckOnLineViewController *)[self.navigationController.viewControllers objectAtIndex:0];
...@@ -54,9 +56,6 @@ ...@@ -54,9 +56,6 @@
} }
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
...@@ -72,7 +71,46 @@ ...@@ -72,7 +71,46 @@
- (void)saveClick:(UIButton *)sender - (void)saveClick:(UIButton *)sender
{ {
NSLog(@"保存并下达"); // 提示框
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要下达新的抽查任务吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 334281;
alert.delegate = self;
[alert show];
}
#pragma mark - TableView Delegate/DateSource
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag == 334281) {
if (buttonIndex == 1) {
NSDate *date = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:date];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
NSString *url = [NSString stringWithFormat:@"%@%@%@&operId=%@&operName=%@", kRedStarURL, kSaveSportcheckURL, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSLog(@"发起抽查url = %@", url);
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"title":self.footView.titleTextView.text,
@"content":self.footView.contentTextView.text,
@"endDate":dateString,
@"state":@"initial"
};
[httpClient saveSportCheckWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"发起抽查 response = %@", response);
NSLog(@"发起抽查 error = %@", error);
}];
}
}
} }
#pragma mark - TableView Delegate/DateSource #pragma mark - TableView Delegate/DateSource
......
...@@ -14,6 +14,11 @@ ...@@ -14,6 +14,11 @@
#import "LookOnLineTableViewCell.h" #import "LookOnLineTableViewCell.h"
#import "LookOnLineDetailViewController.h" #import "LookOnLineDetailViewController.h"
#import "HttpClient.h"
#import <MBProgressHUD.h>
#import <MJRefresh.h>
#import "NoDataView.h"
#define kLookOnLineCell @"LookOnLineTableViewCell" #define kLookOnLineCell @"LookOnLineTableViewCell"
@interface LookOnLineViewController ()<UITableViewDelegate, UITableViewDataSource,ScreenTableDelegate, TaxisViewDelegate, InspectTableViewDelegate> @interface LookOnLineViewController ()<UITableViewDelegate, UITableViewDataSource,ScreenTableDelegate, TaxisViewDelegate, InspectTableViewDelegate>
...@@ -28,6 +33,11 @@ ...@@ -28,6 +33,11 @@
@property (nonatomic, strong) UIView *bgView; @property (nonatomic, strong) UIView *bgView;
@property (nonatomic, assign) NSInteger selectRow; @property (nonatomic, assign) NSInteger selectRow;
@property (nonatomic, assign) NSInteger timeSelectNum; @property (nonatomic, assign) NSInteger timeSelectNum;
@property (nonatomic, strong) NSMutableArray *allLookOnLineList;
@property (nonatomic, strong) NoDataView *noDataView;
@property (nonatomic, assign) int page;
@end @end
@implementation LookOnLineViewController @implementation LookOnLineViewController
...@@ -46,24 +56,21 @@ ...@@ -46,24 +56,21 @@
[self setupNav]; [self setupNav];
self.allLookOnLineList = [NSMutableArray array];
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
[self requestLookOnLineList];
_page = 0;
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
{ {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self.menuView.taxiButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
[self.menuView.screenButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
self.tabBarController.tabBar.hidden = YES; self.tabBarController.tabBar.hidden = YES;
} }
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.menuView removeFromSuperview];
self.menuView = nil;
}
#pragma mark - Private Mothods #pragma mark - Private Mothods
- (void)doBack:(id)sender - (void)doBack:(id)sender
...@@ -90,6 +97,64 @@ ...@@ -90,6 +97,64 @@
self.navigationItem.leftBarButtonItem = backItem; self.navigationItem.leftBarButtonItem = backItem;
} }
- (void)requestLookOnLineList
{
HttpClient *http = [[HttpClient alloc] initWithUrl:[NSString stringWithFormat:@"%@%@", kRedStarURL, kStoreSportcheckURL]];
// 相关参数
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters = @{@"user":user_uuid,
@"pageNumber":@(0),
@"pageSize":@(10)
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[http getStoreSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"获取 商场 抽查列表 response= %@", response);
NSLog(@"获取 商场 抽查列表 error= %@", error);
// if (_allLookOnLineList.count == 0) {
// if (_tableView) {
// [_tableView removeFromSuperview];
// _tableView = nil;
// }
// self.noDataView.backgroundColor = [UIColor whiteColor];
//
// } else {
// if (_noDataView) {
// [_noDataView removeFromSuperview];
// _noDataView = nil;
// }
// self.tableView.delegate = self;
// self.tableView.dataSource = self;
// // 下拉加载更多
// self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
// [self requestMoreList];
// }];
// [self.tableView reloadData];
// }
[MBProgressHUD hideHUDForView:self.view animated:YES];
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
}];
}
- (void)requestMoreList
{
_page++;
HttpClient *http = [[HttpClient alloc] initWithUrl:[NSString stringWithFormat:@"%@%@", kRedStarURL, kStoreSportcheckURL]];
// 相关参数
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters = @{@"user":user_uuid,
@"pageNumber":@(_page),
@"pageSize":@(10)
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[http getStoreSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"上拉加载获取 更多 商场 抽查列表 response= %@", response);
NSLog(@"上拉加载获取 更多 商场 抽查列表 error= %@", error);
}];
}
- (void)dropCilck:(MenuButton *)sender - (void)dropCilck:(MenuButton *)sender
{ {
sender.isDrop = !sender.isDrop; sender.isDrop = !sender.isDrop;
...@@ -150,10 +215,11 @@ ...@@ -150,10 +215,11 @@
} }
} }
- (void)showRedView - (void)showRedView
{ {
if (!_bgView) { if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:self.view.bounds]; _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 45, kScreenWidth, kScreenHeight - 45)];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)]; UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)];
[_bgView addGestureRecognizer:tapGR]; [_bgView addGestureRecognizer:tapGR];
} }
...@@ -170,12 +236,11 @@ ...@@ -170,12 +236,11 @@
_bgView.backgroundColor = [UIColor blackColor]; _bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kTaxisViewHeight); CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kTaxisViewHeight);
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight); _taxisView.alpha = 0.0;
_taxisView.frame = toFrame;
_taxisView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6; _bgView.alpha = 0.6;
_taxisView.frame = toFrame; _taxisView.alpha = 1.0;
}]; }];
} }
...@@ -185,10 +250,9 @@ ...@@ -185,10 +250,9 @@
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
_selctedButton.selected = NO; _selctedButton.selected = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal]; [_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight);
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f; _bgView.alpha = .0f;
_taxisView.frame = fromFrame; _taxisView.alpha = 0.0;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[_bgView removeFromSuperview]; [_bgView removeFromSuperview];
[_taxisView removeFromSuperview]; [_taxisView removeFromSuperview];
...@@ -199,7 +263,7 @@ ...@@ -199,7 +263,7 @@
- (void)showGreenView - (void)showGreenView
{ {
if (!_bgView) { if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:self.view.bounds]; _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 45, kScreenWidth, kScreenHeight - 45)];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeGreenView)]; UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeGreenView)];
[_bgView addGestureRecognizer:tapGR]; [_bgView addGestureRecognizer:tapGR];
} }
...@@ -219,12 +283,11 @@ ...@@ -219,12 +283,11 @@
_bgView.backgroundColor = [UIColor blackColor]; _bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kScreenViewHeight); CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kScreenViewHeight);
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight); _screenView.alpha = 0.0;
_screenView.frame = toFrame;
_screenView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6; _bgView.alpha = 0.6;
_screenView.frame = toFrame; _screenView.alpha = 1.0;
}]; }];
} }
...@@ -234,16 +297,14 @@ ...@@ -234,16 +297,14 @@
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
_selctedButton.selected = NO; _selctedButton.selected = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal]; [_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight);
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f; _bgView.alpha = .0f;
_screenView.frame = fromFrame; _screenView.alpha = 0.0;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[_bgView removeFromSuperview]; [_bgView removeFromSuperview];
[_screenView removeFromSuperview]; [_screenView removeFromSuperview];
}]; }];
} }
// 重置按钮 // 重置按钮
- (void)resetClick:(UIButton *)sender - (void)resetClick:(UIButton *)sender
{ {
...@@ -350,7 +411,6 @@ ...@@ -350,7 +411,6 @@
return _menuView; return _menuView;
} }
#pragma mark - lazy laoding
- (UITableView *)tableView - (UITableView *)tableView
{ {
if (!_tableView) { if (!_tableView) {
...@@ -382,7 +442,27 @@ ...@@ -382,7 +442,27 @@
return _tableView; return _tableView;
} }
- (NoDataView *)noDataView
{
if (!_noDataView) {
_noDataView = [[NoDataView alloc] init];
_noDataView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_noDataView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:45];
[self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
}
return _noDataView;
}
/* /*
#pragma mark - Navigation #pragma mark - Navigation
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "LookOnLineDetailViewController.h" #import "LookOnLineDetailViewController.h"
#import "LookOnLineDetailView.h" #import "LookOnLineDetailView.h"
#import "LookOnLineFootView.h" #import "LookOnLineFootView.h"
#import "HttpClient.h"
#import "InspectAddCell.h" #import "InspectAddCell.h"
#define kOnLineInspectAddCell @"onLineInspectAddCell" #define kOnLineInspectAddCell @"onLineInspectAddCell"
...@@ -20,7 +21,7 @@ ...@@ -20,7 +21,7 @@
#define kLookOnLineDetailCell @"LookOnLineDetailCell" #define kLookOnLineDetailCell @"LookOnLineDetailCell"
@interface LookOnLineDetailViewController () <UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate> @interface LookOnLineDetailViewController () <UIAlertViewDelegate,UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) LookOnLineDetailView *headerView; @property (nonatomic, strong) LookOnLineDetailView *headerView;
@property (nonatomic, strong) LookOnLineFootView *footView; @property (nonatomic, strong) LookOnLineFootView *footView;
...@@ -72,6 +73,15 @@ ...@@ -72,6 +73,15 @@
self.navigationItem.titleView = customLab; self.navigationItem.titleView = customLab;
} }
- (void)reportRestult:(UIButton *)sender
{
// 提示框
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要上报当前任务处理结果吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 314331;
alert.delegate = self;
[alert show];
}
- (void)doBack:(id)sender - (void)doBack:(id)sender
{ {
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
...@@ -111,6 +121,40 @@ ...@@ -111,6 +121,40 @@
[imageData writeToFile:fullPath atomically:NO]; [imageData writeToFile:fullPath atomically:NO];
} }
#pragma mark - TableView Delegate/DateSource
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag == 314331) {
if (buttonIndex == 1) {
NSDate *date = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:date];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kReportCheckResultURL,@"checkId", dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSLog(@"上报抽检结果 url = %@", url);
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"storeUuid":@"",
@"processNote":self.footView.contentTextView.text,
@"attachments":@[],
};
[httpClient reportCheckResultWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"上报抽检结果 response = %@", response);
NSLog(@"上报抽检结果 error = %@", error);
}];
}
}
}
#pragma mark - UIImagePickerController 代理方法 #pragma mark - UIImagePickerController 代理方法
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{ {
...@@ -232,6 +276,7 @@ ...@@ -232,6 +276,7 @@
if (!_footView) { if (!_footView) {
_footView = [[LookOnLineFootView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 180)]; _footView = [[LookOnLineFootView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 180)];
_footView.backgroundColor = [UIColor clearColor]; _footView.backgroundColor = [UIColor clearColor];
[_footView.resultButton addTarget:self action:@selector(reportRestult:) forControlEvents:UIControlEventTouchUpInside];
} }
return _footView; return _footView;
} }
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
@property (nonatomic, strong) NSMutableArray *allSpotCheckList; @property (nonatomic, strong) NSMutableArray *allSpotCheckList;
@property (nonatomic, strong) NoDataView *noDataView; @property (nonatomic, strong) NoDataView *noDataView;
@property (nonatomic, assign) int page;
@end @end
...@@ -59,6 +61,7 @@ ...@@ -59,6 +61,7 @@
self.tableView.dataSource = self; self.tableView.dataSource = self;
[self requestSpotCheckList]; [self requestSpotCheckList];
_page = 0;
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
...@@ -116,37 +119,47 @@ ...@@ -116,37 +119,47 @@
if (_allSpotCheckList.count == 0) { // if (_allSpotCheckList.count == 0) {
if (_tableView) { // if (_tableView) {
[_tableView removeFromSuperview]; // [_tableView removeFromSuperview];
_tableView = nil; // _tableView = nil;
} // }
self.noDataView.backgroundColor = [UIColor whiteColor]; // self.noDataView.backgroundColor = [UIColor whiteColor];
[MBProgressHUD hideHUDForView:self.view animated:YES]; //
// } else {
} else { // if (_noDataView) {
if (_noDataView) { // [_noDataView removeFromSuperview];
[_noDataView removeFromSuperview]; // _noDataView = nil;
_noDataView = nil; // }
} // self.tableView.delegate = self;
self.tableView.delegate = self; // self.tableView.dataSource = self;
self.tableView.dataSource = self; // // 下拉加载更多
// 下拉加载更多 // self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ // [self requestMoreList];
[self requestMoreList]; // }];
}]; // [self.tableView reloadData];
[self.tableView reloadData]; // }
[MBProgressHUD hideHUDForView:self.view animated:YES];
}
[MBProgressHUD hideHUDForView:self.view animated:YES];
self.menuView.backgroundColor = kInspectSectionBackGroundColor; self.menuView.backgroundColor = kInspectSectionBackGroundColor;
}]; }];
} }
- (void)requestMoreList - (void)requestMoreList
{ {
_page++;
HttpClient *http = [[HttpClient alloc] initWithUrl:[NSString stringWithFormat:@"%@%@", kRedStarURL, kManageSportcheckURL]];
// 相关参数
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters = @{@"user":user_uuid,
@"pageNumber":@(0),
@"pageSize":@(10)
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[http getManageSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"上拉加载更多 管理层抽查列表 response= %@", response);
NSLog(@"上拉加载更多 管理层抽查列表 error= %@", error);
}];
} }
...@@ -346,7 +359,7 @@ ...@@ -346,7 +359,7 @@
#pragma mark - UITableView Delegate/DataSource #pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
return _allSpotCheckList.count; return 7;
} }
// cell显示的内容 // cell显示的内容
......
...@@ -533,7 +533,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -533,7 +533,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSUInteger s1 = [titleArray indexOfObject:@"口碑巡检"]; NSUInteger s1 = [titleArray indexOfObject:@"口碑巡检"];
NSUInteger s2 = [titleArray indexOfObject:@"口碑排名"]; NSUInteger s2 = [titleArray indexOfObject:@"口碑排名"];
NSUInteger s3 = [titleArray indexOfObject:@"问题知识"]; NSUInteger s3 = [titleArray indexOfObject:@"问题知识"];
NSLog(@"_title = %@", _titleArray);
if ([titleArray[section] isEqualToString:@"口碑巡检"] && section == s1) { if ([titleArray[section] isEqualToString:@"口碑巡检"] && section == s1) {
return _taskListDataArray.count; return _taskListDataArray.count;
} else if ([titleArray[section] isEqualToString:@"口碑排名"] && section == s2) { } else if ([titleArray[section] isEqualToString:@"口碑排名"] && section == s2) {
......
...@@ -67,4 +67,20 @@ typedef void (^completionBlock) (id response, NSError *error); ...@@ -67,4 +67,20 @@ typedef void (^completionBlock) (id response, NSError *error);
// 获取管理层的抽查任务的列表 // 获取管理层的抽查任务的列表
- (void)getManageSportCheckListWithParameters:(id)parameters completion:(completionBlock)completion; - (void)getManageSportCheckListWithParameters:(id)parameters completion:(completionBlock)completion;
// 获取商场的抽查列表
- (void)getStoreSportCheckListWithParameters:(id)parameters completion:(completionBlock)completion;
// 发起抽查
- (void)saveSportCheckWithParameters:(id)parameters completion:(completionBlock)completion;
// 抽查任务的明细
- (void)getSportCheckDetailWithCompletion:(completionBlock)completion;
// 上报抽查结果
- (void)reportCheckResultWithParameters:(id)parameters completion:(completionBlock)completion;
// 抽查评分
- (void)gradeCheckResultWithParameters:(id)parameters completion:(completionBlock)completion;
@end @end
...@@ -251,4 +251,55 @@ ...@@ -251,4 +251,55 @@
}]; }];
} }
// 获取商场的抽查列表
- (void)getStoreSportCheckListWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
// 发起抽查
- (void)saveSportCheckWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
// 抽查任务的明细
- (void)getSportCheckDetailWithCompletion:(completionBlock)completion
{
[self getParameters:nil completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
// 上报抽查结果
- (void)reportCheckResultWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
// 抽查评分
- (void)gradeCheckResultWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
@end @end
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