Commit 0b9ca0aa authored by admin's avatar admin

首页添加了 优秀案例 巡店报告

parent c102b2e0
...@@ -13,21 +13,5 @@ ...@@ -13,21 +13,5 @@
stopOnStyle = "0"> stopOnStyle = "0">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redstar/Classes/Module/Function/Picture/PictureDetail/ViewController/PictureStoryViewController.m"
timestampString = "473182309.370969"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "81"
endingLineNumber = "81"
landmarkName = "-imageManager:transformDownloadedImage:withURL:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>
...@@ -152,7 +152,6 @@ ...@@ -152,7 +152,6 @@
//检查本地文件是否已存在 //检查本地文件是否已存在
NSString *fileName = [NSString stringWithFormat:@"%@/%@", aSavePath, aFileName]; NSString *fileName = [NSString stringWithFormat:@"%@/%@", aSavePath, aFileName];
//检查附件是否存在 //检查附件是否存在
if ([fileManager fileExistsAtPath:fileName]) { if ([fileManager fileExistsAtPath:fileName]) {
NSLog(@"存在了"); NSLog(@"存在了");
...@@ -165,6 +164,7 @@ ...@@ -165,6 +164,7 @@
} }
//下载附件 //下载附件
aUrl = [aUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [[NSURL alloc] initWithString:aUrl]; NSURL *url = [[NSURL alloc] initWithString:aUrl];
NSURLRequest *request = [NSURLRequest requestWithURL:url]; NSURLRequest *request = [NSURLRequest requestWithURL:url];
...@@ -172,11 +172,9 @@ ...@@ -172,11 +172,9 @@
operation.inputStream = [NSInputStream inputStreamWithURL:url]; operation.inputStream = [NSInputStream inputStreamWithURL:url];
operation.outputStream = [NSOutputStream outputStreamToFileAtPath:fileName append:NO]; operation.outputStream = [NSOutputStream outputStreamToFileAtPath:fileName append:NO];
//下载进度控制
//已完成下载 //已完成下载
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"下载成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"下载成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
alert.tag = 66690; alert.tag = 66690;
[alert show]; [alert show];
...@@ -250,7 +248,6 @@ ...@@ -250,7 +248,6 @@
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = paths.lastObject; NSString *path = paths.lastObject;
NSString *url = [NSString stringWithFormat:@"%@/%@", path, atta.fileName]; NSString *url = [NSString stringWithFormat:@"%@/%@", path, atta.fileName];
NSFileManager *fileManager = [NSFileManager defaultManager]; NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:url]) { if ([fileManager fileExistsAtPath:url]) {
cell.downloadBtn.selected = YES; cell.downloadBtn.selected = YES;
......
...@@ -148,7 +148,6 @@ ...@@ -148,7 +148,6 @@
} }
NSLog(@"22url ==== %@", url);
[MBProgressHUD showHUDAddedTo:self.view animated:YES]; [MBProgressHUD showHUDAddedTo:self.view animated:YES];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url]; HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
......
...@@ -40,17 +40,8 @@ ...@@ -40,17 +40,8 @@
self.navigationController.navigationBar.translucent = NO; self.navigationController.navigationBar.translucent = NO;
} }
self.view.backgroundColor = kFootViewBackGroundColor; self.view.backgroundColor = kFootViewBackGroundColor;
// UIButton *rightButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 20)];
// [rightButton setTitle:@"全部重置" forState:UIControlStateNormal];
// [rightButton addTarget:self action:@selector(resetClick:) forControlEvents:UIControlEventTouchUpInside];
// [rightButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
// rightButton.titleLabel.font = [UIFont systemFontOfSize:15];
// UIBarButtonItem *rightButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightButton];
// self.navigationItem.rightBarButtonItem = rightButtonItem;
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)]; UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]]; [customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"选择商场"]; [customLab setText:@"选择商场"];
...@@ -70,7 +61,7 @@ ...@@ -70,7 +61,7 @@
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn]; UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem; self.navigationItem.leftBarButtonItem = backItem;
self.treeView.backgroundColor = [UIColor whiteColor];
[self requestQueryLowerOrgs]; [self requestQueryLowerOrgs];
[self.sureButton addTarget:self action:@selector(sureClick:) forControlEvents:UIControlEventTouchUpInside]; [self.sureButton addTarget:self action:@selector(sureClick:) forControlEvents:UIControlEventTouchUpInside];
...@@ -163,7 +154,7 @@ ...@@ -163,7 +154,7 @@
} }
self.treeView.nodeData = tree1; self.treeView.nodeData = tree1;
[self.treeView reloadData];
}]; }];
} }
......
...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
#import <UIImageView+WebCache.h> #import <UIImageView+WebCache.h>
#import <UIButton+WebCache.h> #import <UIButton+WebCache.h>
#import <SDWebImageManager.h>
#import <SDImageCache.h>
#define kPictureDetailTableCell @"PictureDetailTableViewCell" #define kPictureDetailTableCell @"PictureDetailTableViewCell"
#define kPictureTextTableCell @"PictureTextTableViewCell" #define kPictureTextTableCell @"PictureTextTableViewCell"
...@@ -55,6 +54,8 @@ ...@@ -55,6 +54,8 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
self.tabBarController.tabBar.hidden = YES;
} }
- (void)viewDidLoad { - (void)viewDidLoad {
...@@ -70,16 +71,8 @@ ...@@ -70,16 +71,8 @@
_clickNumber = 0; _clickNumber = 0;
[self requestPicturePraiseDetail]; [self requestPicturePraiseDetail];
} }
- (UIImage *)imageManager:(SDWebImageManager *)imageManager transformDownloadedImage:(UIImage *)image withURL:(NSURL *)imageURL
{
return [self reSizeImage:image toSize:CGSizeMake(kScreenWidth - 40, 170)];
}
#pragma mark - Private Methods #pragma mark - Private Methods
...@@ -355,36 +348,7 @@ ...@@ -355,36 +348,7 @@
UIImage *defaultImage = [UIImage imageNamed:@"default_pic"]; UIImage *defaultImage = [UIImage imageNamed:@"default_pic"];
SDWebImageManager *manager = [SDWebImageManager sharedManager]; [cell.bigImageView sd_setImageWithURL:imageUrl placeholderImage:defaultImage];
manager.delegate = self;
[manager downloadImageWithURL:imageUrl
options:0
progress:nil
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
if (image) {
cell.bigImageView.image = image;
}
}];
// [imageVview sd_setImageWithURL:imageUrl placeholderImage:defaultImage completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
// cacheType = SDImageCacheTypeDisk;
// // UIImage *image00 = [UIImage image:image fillSize:CGSizeMake(kScreenWidth - 40, 170)];
// UIImage *image00 = [self reSizeImage:image toSize:CGSizeMake(kScreenWidth - 40, 170)];
// // UIImage *image11 = [self scaleImage:image toScale:<#(float)#>]
//
//
// cell.bigImageView.image = image00;
// }];
// [cell.bigImageView sd_setImageWithURL:imageUrl placeholderImage:defaultImage];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick:)]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick:)];
[cell.bigImageView addGestureRecognizer:tap]; [cell.bigImageView addGestureRecognizer:tap];
......
...@@ -16,4 +16,5 @@ ...@@ -16,4 +16,5 @@
@property (nonatomic, strong) UILabel *placeholderLabel1; @property (nonatomic, strong) UILabel *placeholderLabel1;
@property (nonatomic, strong) UILabel *placeholderLabel2; @property (nonatomic, strong) UILabel *placeholderLabel2;
@end @end
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
@property (nonatomic, strong) UIImageView *backImageView1; @property (nonatomic, strong) UIImageView *backImageView1;
@property (nonatomic, strong) UIImageView *backImageView2; @property (nonatomic, strong) UIImageView *backImageView2;
@property (nonatomic, strong) UILabel *pictureLabel;
@end @end
@implementation AddQuestionTableCell @implementation AddQuestionTableCell
...@@ -44,7 +47,7 @@ ...@@ -44,7 +47,7 @@
NSLayoutConstraint *contentLabelRight = [NSLayoutConstraint constraintWithItem:contentLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; NSLayoutConstraint *contentLabelRight = [NSLayoutConstraint constraintWithItem:contentLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:contentLabelRight]; [self.contentView addConstraint:contentLabelRight];
NSLayoutConstraint *contentLabelHeight = [NSLayoutConstraint constraintWithItem:contentLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]; NSLayoutConstraint *contentLabelHeight = [NSLayoutConstraint constraintWithItem:contentLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self.contentView addConstraint:contentLabelHeight]; [self.contentView addConstraint:contentLabelHeight];
...@@ -65,7 +68,7 @@ ...@@ -65,7 +68,7 @@
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:titleRight]; [self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]; NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self.contentView addConstraint:titleHeight]; [self.contentView addConstraint:titleHeight];
...@@ -79,6 +82,8 @@ ...@@ -79,6 +82,8 @@
self.titleTextView.backgroundColor = [UIColor clearColor]; self.titleTextView.backgroundColor = [UIColor clearColor];
self.placeholderLabel1.text = @"请输入文字..."; self.placeholderLabel1.text = @"请输入文字...";
self.pictureLabel.text = @"现场照片";
} }
#pragma mark - lazy loading #pragma mark - lazy loading
...@@ -92,7 +97,7 @@ ...@@ -92,7 +97,7 @@
_backImageView2.translatesAutoresizingMaskIntoConstraints = NO; _backImageView2.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_backImageView2]; [self.contentView addSubview:_backImageView2];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_backImageView2 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:50]; NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_backImageView2 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:45];
[self.contentView addConstraint:contentTop]; [self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_backImageView2 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20]; NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_backImageView2 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
...@@ -139,7 +144,7 @@ ...@@ -139,7 +144,7 @@
_backImageView1.translatesAutoresizingMaskIntoConstraints = NO; _backImageView1.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_backImageView1]; [self.contentView addSubview:_backImageView1];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:160]; NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:155];
[self.contentView addConstraint:contentTop]; [self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20]; NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
...@@ -151,8 +156,6 @@ ...@@ -151,8 +156,6 @@
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:120]; NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:120];
[self.contentView addConstraint:contentHeight]; [self.contentView addConstraint:contentHeight];
NSLayoutConstraint *contentBottom = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-10];
[self.contentView addConstraint:contentBottom];
} }
return _backImageView1; return _backImageView1;
} }
...@@ -232,6 +235,34 @@ ...@@ -232,6 +235,34 @@
return _placeholderLabel1; return _placeholderLabel1;
} }
- (UILabel *)pictureLabel
{
if (!_pictureLabel) {
_pictureLabel = [[UILabel alloc] init];
_pictureLabel.translatesAutoresizingMaskIntoConstraints = NO;
_pictureLabel.font = [UIFont systemFontOfSize:16.0];
_pictureLabel.textColor = kOnLineCellTitleColor;
[self.contentView addSubview:_pictureLabel];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_pictureLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_pictureLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:contentLeft];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_pictureLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self.contentView addConstraint:contentHeight];
NSLayoutConstraint *contentBottom = [NSLayoutConstraint constraintWithItem:_pictureLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:contentBottom];
}
return _pictureLabel;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self.contentView endEditing:YES]; [self.contentView endEditing:YES];
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
- (void)setup - (void)setup
{ {
[self.reportBtn setTitle:@"上报问题" forState:UIControlStateNormal]; [self.reportBtn setTitle:@"上报问题" forState:UIControlStateNormal];
} }
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
[_reportBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_reportBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self addSubview:_reportBtn]; [self addSubview:_reportBtn];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_reportBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:10]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_reportBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:15];
[self addConstraint:tableTop]; [self addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_reportBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20]; NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_reportBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_reportBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20]; NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_reportBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:tableRight]; [self addConstraint:tableRight];
NSLayoutConstraint *tableHeight = [NSLayoutConstraint constraintWithItem:_reportBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40]; NSLayoutConstraint *tableHeight = [NSLayoutConstraint constraintWithItem:_reportBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35];
[self addConstraint:tableHeight]; [self addConstraint:tableHeight];
} }
return _reportBtn; return _reportBtn;
......
...@@ -134,6 +134,7 @@ ...@@ -134,6 +134,7 @@
{ {
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kAddQuestionCell]; [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kAddQuestionCell];
self.tableView.tableFooterView = self.footerView; self.tableView.tableFooterView = self.footerView;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
} }
- (void)createImagePicker:(UIButton *)sender - (void)createImagePicker:(UIButton *)sender
...@@ -297,7 +298,6 @@ ...@@ -297,7 +298,6 @@
HttpClient *client = [[HttpClient alloc] initWithUrl:url]; HttpClient *client = [[HttpClient alloc] initWithUrl:url];
[MBProgressHUD showHUDAddedTo:self.view animated:YES]; [MBProgressHUD showHUDAddedTo:self.view animated:YES];
[client uploadNewQuestionWithParameters:parameters completion:^(id response, NSError *error) { [client uploadNewQuestionWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"上传新问题 response= %@, error = %@", response, error);
if (response[@"success"]) { if (response[@"success"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"新问题提报成功!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"新问题提报成功!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
alert.tag = 90393; alert.tag = 90393;
...@@ -334,6 +334,9 @@ ...@@ -334,6 +334,9 @@
cell.textLabel.textColor = kOnLineCellTitleColor; cell.textLabel.textColor = kOnLineCellTitleColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(15, 49, kScreenWidth, 1)];
line.backgroundColor = kSeparateLineColor;
[cell.contentView addSubview:line];
if (indexPath.row == 0) { if (indexPath.row == 0) {
if (!self.selectLabel) { if (!self.selectLabel) {
...@@ -398,6 +401,8 @@ ...@@ -398,6 +401,8 @@
} }
cell.titleTextView.delegate = self; cell.titleTextView.delegate = self;
cell.contentTextView.delegate = self; cell.contentTextView.delegate = self;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
} else if (indexPath.row == _rowNumber - 1) { } else if (indexPath.row == _rowNumber - 1) {
if ((_imageNameArray.count + 1) % 2 == 0) { if ((_imageNameArray.count + 1) % 2 == 0) {
...@@ -415,7 +420,7 @@ ...@@ -415,7 +420,7 @@
cell.photoButton2.tag = 2201; cell.photoButton2.tag = 2201;
[cell.photoButton2 addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside]; [cell.photoButton2 addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
} else { } else {
...@@ -424,6 +429,8 @@ ...@@ -424,6 +429,8 @@
if (!cell) { if (!cell) {
cell = [[InspectAddCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; cell = [[InspectAddCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
} }
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.photoButton.tag = 2200; cell.photoButton.tag = 2200;
[cell.photoButton addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside]; [cell.photoButton addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
...@@ -555,7 +562,7 @@ ...@@ -555,7 +562,7 @@
- (AddQuestionFooterView *)footerView - (AddQuestionFooterView *)footerView
{ {
if (!_footerView) { if (!_footerView) {
_footerView = [[AddQuestionFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 50)]; _footerView = [[AddQuestionFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 65)];
} }
return _footerView; return _footerView;
} }
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
[questionNameAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(5,questionNameText.length - 5)]; [questionNameAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(5,questionNameText.length - 5)];
[self.questionName setAttributedText:questionNameAttr]; [self.questionName setAttributedText:questionNameAttr];
NSLog(@"questionDetail.state = %@",questionDetail.state);
// 状态 // 状态
if ([questionDetail.state isEqualToString:@"resolved"]) { if ([questionDetail.state isEqualToString:@"resolved"]) {
NSString *stateText = [NSString stringWithFormat:@"状态:已解决"]; NSString *stateText = [NSString stringWithFormat:@"状态:已解决"];
...@@ -75,7 +74,7 @@ ...@@ -75,7 +74,7 @@
self.shopLabel.text = @"商场:"; self.shopLabel.text = @"商场:";
self.shopLabel.textColor = kDetailCellDescribeTextColor; self.shopLabel.textColor = kDetailCellDescribeTextColor;
} else { } else {
NSString *shopText = [NSString stringWithFormat:@"商场:%@", questionDetail.storePath]; NSString *shopText = [NSString stringWithFormat:@"商场:%@", questionDetail.store_name];
NSMutableAttributedString *shopAttr = [[NSMutableAttributedString alloc] initWithString:shopText]; NSMutableAttributedString *shopAttr = [[NSMutableAttributedString alloc] initWithString:shopText];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)]; [shopAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(3,shopText.length - 3)]; [shopAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(3,shopText.length - 3)];
......
...@@ -257,7 +257,6 @@ ...@@ -257,7 +257,6 @@
NSString *path = paths.lastObject; NSString *path = paths.lastObject;
NSString *fileName = [NSString stringWithFormat:@"%@", atta.fileName]; NSString *fileName = [NSString stringWithFormat:@"%@", atta.fileName];
fileName = [fileName stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
[self downloadFileURL:[NSString stringWithFormat:@"%@%@", kRedStarURL, atta.fileUrl] savePath:path fileName:fileName]; [self downloadFileURL:[NSString stringWithFormat:@"%@%@", kRedStarURL, atta.fileUrl] savePath:path fileName:fileName];
} }
...@@ -267,7 +266,6 @@ ...@@ -267,7 +266,6 @@
//检查本地文件是否已存在 //检查本地文件是否已存在
NSString *fileName = [NSString stringWithFormat:@"%@/%@", aSavePath, aFileName]; NSString *fileName = [NSString stringWithFormat:@"%@/%@", aSavePath, aFileName];
//检查附件是否存在 //检查附件是否存在
if ([fileManager fileExistsAtPath:fileName]) { if ([fileManager fileExistsAtPath:fileName]) {
NSLog(@"存在了"); NSLog(@"存在了");
...@@ -278,11 +276,8 @@ ...@@ -278,11 +276,8 @@
if (![fileManager fileExistsAtPath:aSavePath]) { if (![fileManager fileExistsAtPath:aSavePath]) {
[fileManager createDirectoryAtPath:aSavePath withIntermediateDirectories:YES attributes:nil error:nil]; [fileManager createDirectoryAtPath:aSavePath withIntermediateDirectories:YES attributes:nil error:nil];
} }
NSLog(@"aurlllll === %@", aUrl);
//下载附件 //下载附件
aUrl = [aUrl stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; aUrl = [aUrl stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSLog(@"aurlllll === %@", aUrl);
NSURL *url = [[NSURL alloc] initWithString:aUrl]; NSURL *url = [[NSURL alloc] initWithString:aUrl];
NSURLRequest *request = [NSURLRequest requestWithURL:url]; NSURLRequest *request = [NSURLRequest requestWithURL:url];
...@@ -294,16 +289,19 @@ ...@@ -294,16 +289,19 @@
//已完成下载 //已完成下载
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
[self closeRedView];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"下载成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"下载成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
alert.tag = 66690; alert.tag = 66690;
[alert show]; [alert show];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"error ==== %@", error);
[self.tableView reloadData]; [self.tableView reloadData];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
[self closeRedView]; [self closeRedView];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"下载失败!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"下载失败!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show]; [alert show];
[self.tableView reloadData];
}]; }];
[operation start]; [operation start];
...@@ -447,7 +445,7 @@ ...@@ -447,7 +445,7 @@
AttachmentModel *atta = _attachmentArray[indexPath.row]; AttachmentModel *atta = _attachmentArray[indexPath.row];
NSString *name = atta.fileName; NSString *name = atta.fileName;
[cell.nameBtn setTitle:name forState:UIControlStateNormal]; [cell.nameBtn setTitle:name forState:UIControlStateNormal];
cell.nameBtn.titleLabel.numberOfLines = 0;
[cell.nameBtn addTarget:self action:@selector(showFile:) forControlEvents:UIControlEventTouchUpInside]; [cell.nameBtn addTarget:self action:@selector(showFile:) forControlEvents:UIControlEventTouchUpInside];
[cell.downloadBtn addTarget:self action:@selector(downloadFile:) forControlEvents:UIControlEventTouchUpInside]; [cell.downloadBtn addTarget:self action:@selector(downloadFile:) forControlEvents:UIControlEventTouchUpInside];
...@@ -457,7 +455,6 @@ ...@@ -457,7 +455,6 @@
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = paths.lastObject; NSString *path = paths.lastObject;
NSString *url = [NSString stringWithFormat:@"%@/%@", path, atta.fileName]; NSString *url = [NSString stringWithFormat:@"%@/%@", path, atta.fileName];
NSFileManager *fileManager = [NSFileManager defaultManager]; NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:url]) { if ([fileManager fileExistsAtPath:url]) {
cell.downloadBtn.selected = YES; cell.downloadBtn.selected = YES;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#pragma mark - Private Methods #pragma mark - Private Methods
- (void)setup - (void)setup
{ {
self.contentView.backgroundColor = [UIColor colorWithRed:239 / 255.0 green:239 / 255.0 blue:239 / 255.0 alpha:239 / 255.0]; self.contentView.backgroundColor = kFootViewBackGroundColor;
} }
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
toItem:self.contentView toItem:self.contentView
attribute:NSLayoutAttributeBottom attribute:NSLayoutAttributeBottom
multiplier:1.0 multiplier:1.0
constant:-5]; constant:-10];
[self.contentView addConstraint:overDateBottom]; [self.contentView addConstraint:overDateBottom];
} }
return _photoButton; return _photoButton;
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
_pictureLabel.translatesAutoresizingMaskIntoConstraints = NO; _pictureLabel.translatesAutoresizingMaskIntoConstraints = NO;
_pictureLabel.font = [UIFont systemFontOfSize:15.0]; _pictureLabel.font = [UIFont systemFontOfSize:15.0];
_pictureLabel.backgroundColor = [UIColor clearColor]; _pictureLabel.backgroundColor = [UIColor clearColor];
_pictureLabel.textColor = kLightGray; _pictureLabel.textColor = kLightBlack;
[self.bgView addSubview:_pictureLabel]; [self.bgView addSubview:_pictureLabel];
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#pragma mark - Private Methods #pragma mark - Private Methods
- (void)setup - (void)setup
{ {
self.contentView.backgroundColor = [UIColor colorWithRed:239 / 255.0 green:239 / 255.0 blue:239 / 255.0 alpha:239 / 255.0]; self.contentView.backgroundColor = kFootViewBackGroundColor;
} }
- (UIButton *)photoButton1 - (UIButton *)photoButton1
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
toItem:self.contentView toItem:self.contentView
attribute:NSLayoutAttributeBottom attribute:NSLayoutAttributeBottom
multiplier:1.0 multiplier:1.0
constant:-5]; constant:-10];
[self.contentView addConstraint:overDateBottom]; [self.contentView addConstraint:overDateBottom];
} }
return _photoButton1; return _photoButton1;
......
...@@ -124,7 +124,13 @@ ...@@ -124,7 +124,13 @@
// textView // textView
UITextView *textView = [[UITextView alloc] init]; UITextView *textView = [[UITextView alloc] init];
if (remark == nil || remark == NULL || [remark isEqual:[NSNull null]] || remark == Nil || [remark isEqualToString:@"(null)"]) {
textView.text = [NSString stringWithFormat:@""];
} else {
textView.text = [NSString stringWithFormat:@"%@", remark]; textView.text = [NSString stringWithFormat:@"%@", remark];
}
textView.backgroundColor = [UIColor clearColor]; textView.backgroundColor = [UIColor clearColor];
textView.translatesAutoresizingMaskIntoConstraints = NO; textView.translatesAutoresizingMaskIntoConstraints = NO;
[bgImageView addSubview:textView]; [bgImageView addSubview:textView];
......
...@@ -79,8 +79,6 @@ ...@@ -79,8 +79,6 @@
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _taskModel.title]; cell.titleLabel.text = [NSString stringWithFormat:@"%@", _taskModel.title];
cell.titleDetailLabel.text = [NSString stringWithFormat:@"要求图片%d张", _taskModel.attachmentNumber]; cell.titleDetailLabel.text = [NSString stringWithFormat:@"要求图片%d张", _taskModel.attachmentNumber];
cell.introLabel.text = @"参考说明"; cell.introLabel.text = @"参考说明";
cell.introDetailLabel.text = [NSString stringWithFormat:@"%@", _taskModel.reference];
NSString *refrer = [NSString stringWithFormat:@"%@", _taskModel.reference]; NSString *refrer = [NSString stringWithFormat:@"%@", _taskModel.reference];
if (refrer == nil || refrer == NULL || [refrer isEqual:[NSNull null]] || refrer == Nil || [refrer isEqualToString:@"(null)"]) { if (refrer == nil || refrer == NULL || [refrer isEqual:[NSNull null]] || refrer == Nil || [refrer isEqualToString:@"(null)"]) {
cell.introDetailLabel.text = @""; cell.introDetailLabel.text = @"";
......
...@@ -582,7 +582,7 @@ ...@@ -582,7 +582,7 @@
_arrowImageView.translatesAutoresizingMaskIntoConstraints = NO; _arrowImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_arrowImageView]; [self.contentView addSubview:_arrowImageView];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:19]; NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:18];
[self.contentView addConstraint:Top]; [self.contentView addConstraint:Top];
NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20]; NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
......
...@@ -205,7 +205,12 @@ ...@@ -205,7 +205,12 @@
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell.unfoldBtn addTarget:self action:@selector(unfoldCilck:) forControlEvents:UIControlEventTouchUpInside]; [cell.unfoldBtn addTarget:self action:@selector(unfoldCilck:) forControlEvents:UIControlEventTouchUpInside];
if (_isOpen) { if (_isOpen) {
if (_taskDetail.remark == nil || _taskDetail.remark == NULL || [_taskDetail.remark isEqual:[NSNull null]] || _taskDetail.remark == Nil || [_taskDetail.remark isEqualToString:@"(null)"]) {
cell.introDetailLabel.text = @"";
cell.arrowImageView.transform = CGAffineTransformMakeRotation(M_PI);
} else {
cell.introDetailLabel.text = [NSString stringWithFormat:@"%@", _taskDetail.remark]; cell.introDetailLabel.text = [NSString stringWithFormat:@"%@", _taskDetail.remark];
}
} else { } else {
cell.introDetailLabel.text = @""; cell.introDetailLabel.text = @"";
} }
......
...@@ -77,6 +77,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -77,6 +77,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
@property (nonatomic, strong) NSMutableArray *taskListDataArray; // 问题与知识 @property (nonatomic, strong) NSMutableArray *taskListDataArray; // 问题与知识
@property (nonatomic, strong) NSMutableArray *allRankListArray; @property (nonatomic, strong) NSMutableArray *allRankListArray;
@property (nonatomic, strong) NSMutableArray *allPraiseListArray; @property (nonatomic, strong) NSMutableArray *allPraiseListArray;
@property (nonatomic, strong) NSMutableArray *allExcellentCaseArray; // 优秀案例
@property (nonatomic, strong) NSMutableArray *allPatrolReportArray; // 巡店报告
@end @end
@implementation HomeViewController @implementation HomeViewController
...@@ -94,7 +97,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -94,7 +97,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
self.navigationItem.titleView = customLab; self.navigationItem.titleView = customLab;
self.titleArray = [NSMutableArray array]; self.titleArray = [NSMutableArray array];
self.sectionArray = [NSMutableArray arrayWithObjects:@"口碑报告",@"商场风采", @"问题知识",@"口碑巡检",nil]; self.sectionArray = [NSMutableArray arrayWithObjects:@"口碑报告",@"商场风采",@"优秀案例",@"巡店报告", @"问题知识",@"口碑巡检",nil];
self.allRankListArray = [NSMutableArray array]; self.allRankListArray = [NSMutableArray array];
self.taskListDataArray = [NSMutableArray array]; self.taskListDataArray = [NSMutableArray array];
self.allQuestionArray = [NSMutableArray array]; self.allQuestionArray = [NSMutableArray array];
...@@ -114,8 +117,21 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -114,8 +117,21 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
[_sectionArray removeObject:@"口碑报告"]; [_sectionArray removeObject:@"口碑报告"];
} }
// @"casus";
//
// sopVC.category = @"report";
[self.titleArray addObject:@"商场风采"]; [self.titleArray addObject:@"商场风采"];
[self requestPicturePraise];
NSArray *typeArray = [NSArray arrayWithObjects:@"store", @"casus",@"report",nil];
// 商场风采
[self requestPicturePraiseWithType:typeArray[0]];
// 优秀案例
[self requestPicturePraiseWithType:typeArray[1]];
// 巡店报告
[self requestPicturePraiseWithType:typeArray[2]];
if ([permissions containsObject:@"500301"] || [permissions containsObject:@"500302"]) { if ([permissions containsObject:@"500301"] || [permissions containsObject:@"500302"]) {
[self.titleArray addObject:@"图说口碑"]; [self.titleArray addObject:@"图说口碑"];
...@@ -321,8 +337,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -321,8 +337,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
[httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) { [httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) {
// [self requestPicturePraise];
NSLog(@"口碑报告response = %@", response); NSLog(@"口碑报告response = %@", response);
NSDictionary *dataDict = response[@"data"]; NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"]; NSArray *dataArray = dataDict[@"records"];
...@@ -445,7 +459,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -445,7 +459,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
}]; }];
} }
- (void)requestPicturePraise - (void)requestPicturePraiseWithType:(NSString *)type
{ {
// 请求地址 // 请求地址
...@@ -454,7 +468,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -454,7 +468,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSDictionary *parameters = @{ NSDictionary *parameters = @{
@"scope":@"all", @"scope":@"all",
@"user":user_uuid, @"user":user_uuid,
@"type":@"store", @"type":type,
@"pageNumber":@(0), @"pageNumber":@(0),
@"pageSize":@(2) @"pageSize":@(2)
}; };
...@@ -474,10 +488,24 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -474,10 +488,24 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
[picList setValuesForKeysWithDictionary:dict]; [picList setValuesForKeysWithDictionary:dict];
[tempArray addObject:picList]; [tempArray addObject:picList];
} }
if ([type isEqualToString:@"store"]) {
_allPraiseListArray = [NSMutableArray arrayWithArray:tempArray]; _allPraiseListArray = [NSMutableArray arrayWithArray:tempArray];
if (_allPraiseListArray.count == 0) { if (_allPraiseListArray.count == 0) {
[_sectionArray removeObject:@"商场风采"]; [_sectionArray removeObject:@"商场风采"];
} }
} else if ([type isEqualToString:@"casus"]) {
_allExcellentCaseArray = [NSMutableArray arrayWithArray:tempArray];
if (_allExcellentCaseArray.count == 0) {
[_sectionArray removeObject:@"优秀案例"];
}
} else {
_allPatrolReportArray = [NSMutableArray arrayWithArray:tempArray];
if (_allPatrolReportArray.count == 0) {
[_sectionArray removeObject:@"巡店报告"];
}
}
[self.tableView reloadData]; [self.tableView reloadData];
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
}]; }];
...@@ -563,6 +591,18 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -563,6 +591,18 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
pic.titleStr = @"商场风采"; pic.titleStr = @"商场风采";
pic.category = @"store"; pic.category = @"store";
nav = [[UINavigationController alloc] initWithRootViewController:pic]; nav = [[UINavigationController alloc] initWithRootViewController:pic];
} else if ([_sectionArray[section] isEqualToString:@"优秀案例"]) {
PictureViewController *pic = [[PictureViewController alloc] init];
pic.come = @"首页";
pic.titleStr = @"优秀案例";
pic.category = @"casus";
nav = [[UINavigationController alloc] initWithRootViewController:pic];
} else if ([_sectionArray[section] isEqualToString:@"巡店报告"]) {
PictureViewController *pic = [[PictureViewController alloc] init];
pic.come = @"首页";
pic.titleStr = @"巡店报告";
pic.category = @"report";
nav = [[UINavigationController alloc] initWithRootViewController:pic];
} }
[nav.navigationBar setBarTintColor:kNavigationBarColor]; [nav.navigationBar setBarTintColor:kNavigationBarColor];
...@@ -625,6 +665,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -625,6 +665,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"]; NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"]; NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"]; NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
if ([_sectionArray[section] isEqualToString:@"口碑巡检"] && section == s1) { if ([_sectionArray[section] isEqualToString:@"口碑巡检"] && section == s1) {
return _taskListDataArray.count; return _taskListDataArray.count;
...@@ -634,6 +677,10 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -634,6 +677,10 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
return _allQuestionArray.count; return _allQuestionArray.count;
} else if ([_sectionArray[section] isEqualToString:@"商场风采"] && section == s4) { } else if ([_sectionArray[section] isEqualToString:@"商场风采"] && section == s4) {
return _allPraiseListArray.count; return _allPraiseListArray.count;
} else if ([_sectionArray[section] isEqualToString:@"优秀案例"] && section == s5) {
return _allExcellentCaseArray.count;
} else if ([_sectionArray[section] isEqualToString:@"巡店报告"] && section == s6) {
return _allPatrolReportArray.count;
} else { } else {
return 0; return 0;
} }
...@@ -647,6 +694,8 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -647,6 +694,8 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"]; NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"]; NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"]; NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡检"] && indexPath.section == s1) { if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡检"] && indexPath.section == s1) {
InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell]; InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell];
...@@ -706,6 +755,20 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -706,6 +755,20 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
} }
cell.pictureList = _allPraiseListArray[indexPath.row]; cell.pictureList = _allPraiseListArray[indexPath.row];
return cell; return cell;
} else if ([_sectionArray[indexPath.section] isEqualToString:@"优秀案例"] && indexPath.section == s5) {
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:KHomePicTableCell];
if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:KHomePicTableCell];
}
cell.pictureList = _allExcellentCaseArray[indexPath.row];
return cell;
} else if ([_sectionArray[indexPath.section] isEqualToString:@"巡店报告"] && indexPath.section == s6) {
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:KHomePicTableCell];
if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:KHomePicTableCell];
}
cell.pictureList = _allPatrolReportArray[indexPath.row];
return cell;
} else { } else {
return nil; return nil;
} }
...@@ -722,6 +785,8 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -722,6 +785,8 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"]; NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"]; NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"]; NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡检"] && indexPath.section == s1) { if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡检"] && indexPath.section == s1) {
InspectTaskViewController *inspectTaskVC = [[InspectTaskViewController alloc] init]; InspectTaskViewController *inspectTaskVC = [[InspectTaskViewController alloc] init];
TaskListModel *taskList = self.taskListDataArray[indexPath.row]; TaskListModel *taskList = self.taskListDataArray[indexPath.row];
...@@ -753,6 +818,21 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -753,6 +818,21 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
PictureListModel *picList = _allPraiseListArray[indexPath.row]; PictureListModel *picList = _allPraiseListArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init]; PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid; storyVC.uuid = picList.uuid;
storyVC.titleStr = @"商场风采";
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"优秀案例"] && indexPath.section == s5) {
PictureListModel *picList = _allExcellentCaseArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
storyVC.titleStr = @"优秀案例";
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"巡店报告"] && indexPath.section == s6) {
PictureListModel *picList = _allPatrolReportArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
storyVC.titleStr = @"巡店报告";
self.hidesBottomBarWhenPushed = YES; self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES]; [self.navigationController pushViewController:storyVC animated:YES];
} else { } else {
......
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