Commit 58a079fc authored by admin's avatar admin

修复bug

parent 5e2b2364
...@@ -80,18 +80,28 @@ ...@@ -80,18 +80,28 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
StandardTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kPicCategoryTableViewCell]; // StandardTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kPicCategoryTableViewCell];
// if (!cell) {
// cell = [[StandardTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPicCategoryTableViewCell];
// }
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kPicCategoryTableViewCell];
if (!cell) { if (!cell) {
cell = [[StandardTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPicCategoryTableViewCell]; cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPicCategoryTableViewCell];
} }
cell.iconImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"pic_0%ld",(long)indexPath.section]]; cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"pic_0%ld",(long)indexPath.section]];
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _titleArray[indexPath.section]]; cell.textLabel.text = [NSString stringWithFormat:@"%@", _titleArray[indexPath.section]];
cell.detailTitleLabel.text = [NSString stringWithFormat:@"%@", _detailTitleArray[indexPath.section]]; cell.textLabel.font = [UIFont systemFontOfSize:18.0];
//cell.detailTitleLabel.text = [NSString stringWithFormat:@"%@", _detailTitleArray[indexPath.section]];
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell; return cell;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 100;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{ {
return 10; return 10;
......
...@@ -305,6 +305,11 @@ ...@@ -305,6 +305,11 @@
} }
PicTextModel *picText = _picTextArray[indexPath.row]; PicTextModel *picText = _picTextArray[indexPath.row];
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,picText.fileUrl]]; NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,picText.fileUrl]];
// UIImageView *imageView = [[UIImageView alloc] init];
// [imageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"default_pic"]];
[cell.bigImageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"default_pic"]]; [cell.bigImageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"default_pic"]];
cell.descriptionLabel.text = [NSString stringWithFormat:@"%@", picText.descriptionText]; cell.descriptionLabel.text = [NSString stringWithFormat:@"%@", picText.descriptionText];
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
...@@ -321,29 +326,6 @@ ...@@ -321,29 +326,6 @@
} }
//裁剪图片
- (UIImage *)cutImage:(UIImage*)image
{
//压缩图片
CGSize newSize;
CGImageRef imageRef = nil;
if ((image.size.width / image.size.height) < (((kScreenWidth - 20 * 3) / 2) / 90)) {
newSize.width = image.size.width;
newSize.height = image.size.width * 90 / ((kScreenWidth - 20 * 3) / 2);
imageRef = CGImageCreateWithImageInRect([image CGImage], CGRectMake(0, fabs(image.size.height - newSize.height) / 2, newSize.width, newSize.height));
} else {
newSize.height = image.size.height;
newSize.width = image.size.height * ((kScreenWidth - 20 * 3) / 2) / 90;
imageRef = CGImageCreateWithImageInRect([image CGImage], CGRectMake(fabs(image.size.width - newSize.width) / 2, 0, newSize.width, newSize.height));
}
return [UIImage imageWithCGImage:imageRef];
}
// 自定义section // 自定义section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
self.scopeTableView = [[ScopeTableView alloc] init]; self.scopeTableView = [[ScopeTableView alloc] initWithTitle:[NSMutableArray arrayWithObjects:@"所有口碑", @"我的口碑", nil]];
GroupItems *scopeItem = [[GroupItems alloc] initWithTitle:@"问题范围" view:_scopeTableView]; GroupItems *scopeItem = [[GroupItems alloc] initWithTitle:@"问题范围" view:_scopeTableView];
self.textView1 = [[UITextView alloc] init]; self.textView1 = [[UITextView alloc] init];
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
self.scopeTableView = [[ScopeTableView alloc] init]; self.scopeTableView = [[ScopeTableView alloc] initWithTitle:[NSMutableArray arrayWithObjects:@"全部问题",@"我的问题", nil]];
GroupItems *scopeItem = [[GroupItems alloc] initWithTitle:@"问题范围" view:_scopeTableView]; GroupItems *scopeItem = [[GroupItems alloc] initWithTitle:@"问题范围" view:_scopeTableView];
self.groupTableView = [[GroupTableView alloc] init]; self.groupTableView = [[GroupTableView alloc] init];
......
...@@ -16,4 +16,6 @@ ...@@ -16,4 +16,6 @@
@interface ScopeTableView : UITableView @interface ScopeTableView : UITableView
@property (nonatomic, assign) id <ScopeTableViewDelegate>scopeDeleagte; @property (nonatomic, assign) id <ScopeTableViewDelegate>scopeDeleagte;
- (instancetype)initWithTitle:(NSMutableArray *)titleArray;
@end @end
...@@ -14,6 +14,16 @@ ...@@ -14,6 +14,16 @@
@implementation ScopeTableView @implementation ScopeTableView
- (instancetype)initWithTitle:(NSMutableArray *)titleArray
{
self = [super init];
if (self) {
_titleArray = titleArray;
[self setup];
}
return self;
}
- (instancetype)init - (instancetype)init
{ {
self = [super init]; self = [super init];
...@@ -35,7 +45,7 @@ ...@@ -35,7 +45,7 @@
- (void)setup - (void)setup
{ {
self.titleArray = [NSMutableArray arrayWithObjects:@"全部问题",@"我的问题", nil]; // self.titleArray = [NSMutableArray arrayWithObjects:@"全部问题",@"我的问题", nil];
self.delegate = self; self.delegate = self;
self.dataSource = self; self.dataSource = self;
......
...@@ -106,7 +106,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -106,7 +106,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
} }
[self.titleArray addObject:@"商场风采"]; [self.titleArray addObject:@"商场风采"];
[self requestPicturePraise]; //[self requestPicturePraise];
if ([permissions containsObject:@"500301"] || [permissions containsObject:@"500302"]) { if ([permissions containsObject:@"500301"] || [permissions containsObject:@"500302"]) {
[self.titleArray addObject:@"图说口碑"]; [self.titleArray addObject:@"图说口碑"];
...@@ -118,12 +118,12 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -118,12 +118,12 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
if ([permissions containsObject:@"500501"] || [permissions containsObject:@"500502"]) { if ([permissions containsObject:@"500501"] || [permissions containsObject:@"500502"]) {
[self.titleArray addObject:@"问题知识"]; [self.titleArray addObject:@"问题知识"];
[self requestQuestionList]; // [self requestQuestionList];
} }
if ([permissions containsObject:@"500101"] || [permissions containsObject:@"500102"]) { if ([permissions containsObject:@"500101"] || [permissions containsObject:@"500102"]) {
[self.titleArray addObject:@"口碑巡检"]; [self.titleArray addObject:@"口碑巡检"];
[self requestInspectList]; //[self requestInspectList];
} }
...@@ -317,6 +317,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -317,6 +317,9 @@ 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"];
...@@ -416,6 +419,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -416,6 +419,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
// 请求问题列表 // 请求问题列表
[httpClient getQuestionListWithParameters:parameters completion:^(id response, NSError *error) { [httpClient getQuestionListWithParameters:parameters completion:^(id response, NSError *error) {
[self requestInspectList];
NSDictionary *dataDict = (NSDictionary *)response[@"data"]; NSDictionary *dataDict = (NSDictionary *)response[@"data"];
NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"]; NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"];
NSLog(@"问题与知识列表recods = %@", response); NSLog(@"问题与知识列表recods = %@", response);
...@@ -455,6 +461,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2); ...@@ -455,6 +461,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
// 请求问题列表 // 请求问题列表
[httpClient queryPicturePraiseWithParameters:parameters completion:^(id response, NSError *error) { [httpClient queryPicturePraiseWithParameters:parameters completion:^(id response, NSError *error) {
[self requestQuestionList];
NSLog(@"图说口碑 response = %@ error = %@" , response, error); NSLog(@"图说口碑 response = %@ error = %@" , response, error);
NSDictionary *dataDict = response[@"data"]; NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"]; NSArray *dataArray = dataDict[@"records"];
......
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