Commit 76ece84e authored by admin's avatar admin

修复图片放大问题

parent 540d7b37
...@@ -8,10 +8,9 @@ ...@@ -8,10 +8,9 @@
#ifndef Url_h #ifndef Url_h
#define Url_h #define Url_h
// url 测试环境 // url 测试环境
// #define kRedStarURL @"http://218.244.151.129:7580/" // #define kRedStarURL @"http://218.244.151.129:7580/"
#define kRedStarURL @"http://219.235.234.225:7580/" #define kRedStarURL @"http://219.235.234.225:7580/"
// 最新正式环境 // 最新正式环境
// #define kRedStarURL @"http://219.235.234.212:7580/" // #define kRedStarURL @"http://219.235.234.212:7580/"
......
...@@ -361,29 +361,40 @@ ...@@ -361,29 +361,40 @@
#pragma mark - UITableView DataSource/Delegate #pragma mark - UITableView DataSource/Delegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{ {
if ([self.titleStr isEqualToString:CategrayTitle]) { // if ([self.titleStr isEqualToString:CategrayTitle]) {
return 4; // return 4;
} else { // } else {
return 3; // return 3;
} // }
return 4;
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
// if (section == 0) {
// return 1;
// } else if (section == 1) {
// return _picTextArray.count;
// } else {
// if ([self.titleStr isEqualToString:CategrayTitle]) {
// if (section == 2) {
// return _attachmentArray.count;
// } else {
// return _allCommentArray.count;
// }
// }
// return _allCommentArray.count;
// }
if (section == 0) { if (section == 0) {
return 1; return 1;
} else if (section == 1) { } else if (section == 1) {
return _picTextArray.count; return _picTextArray.count;
} else if (section == 2) {
return _attachmentArray.count;
} else { } else {
if ([self.titleStr isEqualToString:CategrayTitle]) {
if (section == 2) {
return _attachmentArray.count;
} else {
return _allCommentArray.count;
}
}
return _allCommentArray.count; return _allCommentArray.count;
} }
} }
// cell显示的内容 // cell显示的内容
...@@ -462,63 +473,59 @@ ...@@ -462,63 +473,59 @@
cell.descriptionLabel.text = picText.describeStr; cell.descriptionLabel.text = picText.describeStr;
return cell; return cell;
} }
} else { } else if (indexPath.section == 2) {
// 判断当前页面是否为 口碑巡店 // 显示 附件cell
if ([self.titleStr isEqualToString:CategrayTitle]) {
// 是 口碑巡店 AttachmentTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAttachmentTableViwCell];
if (indexPath.section == 2) { if (!cell) {
// 显示 附件cell cell = [[AttachmentTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAttachmentTableViwCell];
}
AttachmentTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAttachmentTableViwCell]; AttachmentModel *atta = _attachmentArray[indexPath.row];
if (!cell) { NSString *name = atta.fileName;
cell = [[AttachmentTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAttachmentTableViwCell]; [cell.nameBtn setTitle:name forState:UIControlStateNormal];
} cell.nameBtn.titleLabel.numberOfLines = 0;
AttachmentModel *atta = _attachmentArray[indexPath.row];
NSString *name = atta.fileName; [cell.nameBtn addTarget:self action:@selector(showFile:) forControlEvents:UIControlEventTouchUpInside];
[cell.nameBtn setTitle:name forState:UIControlStateNormal]; [cell.downloadBtn addTarget:self action:@selector(downloadFile:) forControlEvents:UIControlEventTouchUpInside];
cell.nameBtn.titleLabel.numberOfLines = 0; cell.downloadBtn.tag = 998473 + indexPath.row;
cell.nameBtn.tag = 998473 + indexPath.row;
[cell.nameBtn addTarget:self action:@selector(showFile:) forControlEvents:UIControlEventTouchUpInside];
[cell.downloadBtn addTarget:self action:@selector(downloadFile:) forControlEvents:UIControlEventTouchUpInside]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
cell.downloadBtn.tag = 998473 + indexPath.row; NSString *path = paths.lastObject;
cell.nameBtn.tag = 998473 + indexPath.row; NSString *url = [NSString stringWithFormat:@"%@/%@", path, atta.fileName];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *path = paths.lastObject; if ([fileManager fileExistsAtPath:url]) {
NSString *url = [NSString stringWithFormat:@"%@/%@", path, atta.fileName]; cell.downloadBtn.selected = YES;
cell.downloadBtn.backgroundColor = [UIColor grayColor];
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:url]) {
cell.downloadBtn.selected = YES;
cell.downloadBtn.backgroundColor = [UIColor grayColor];
} else {
cell.downloadBtn.selected = NO;
cell.downloadBtn.backgroundColor = [UIColor colorWithRed:47 / 255.0 green:209/ 255.0 blue:92 / 255.0 alpha:1.0];
}
return cell;
} else {
// 显示 评论cell
PictureCommentTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kPictureCommentTableCell];
if (!cell) {
cell = [[PictureCommentTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPictureCommentTableCell];
}
cell.comment = _allCommentArray[indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
} else { } else {
// 评论 cell.downloadBtn.selected = NO;
PictureCommentTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kPictureCommentTableCell]; cell.downloadBtn.backgroundColor = [UIColor colorWithRed:47 / 255.0 green:209/ 255.0 blue:92 / 255.0 alpha:1.0];
if (!cell) {
cell = [[PictureCommentTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPictureCommentTableCell]; }
} return cell;
cell.comment = _allCommentArray[indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone; } else {
return cell; // 显示 评论cell
PictureCommentTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kPictureCommentTableCell];
if (!cell) {
cell = [[PictureCommentTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPictureCommentTableCell];
} }
cell.comment = _allCommentArray[indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} }
// } else {
// // 评论
// PictureCommentTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kPictureCommentTableCell];
// if (!cell) {
// cell = [[PictureCommentTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPictureCommentTableCell];
// }
// cell.comment = _allCommentArray[indexPath.row];
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
// return cell;
// }
// }
} }
- (void)showFile:(UIButton *)sender - (void)showFile:(UIButton *)sender
...@@ -648,12 +655,12 @@ ...@@ -648,12 +655,12 @@
// 自定义section // 自定义section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{ {
NSInteger num = 0; NSInteger num = 3;
if ([self.titleStr isEqualToString:CategrayTitle]) { // if ([self.titleStr isEqualToString:CategrayTitle]) {
num = 3; // num = 3;
} else { // } else {
num = 2; // num = 2;
} // }
if (section == num) { if (section == num) {
// 创建sectionView // 创建sectionView
UIView *sectionView = [[UIView alloc] init]; UIView *sectionView = [[UIView alloc] init];
...@@ -716,19 +723,19 @@ ...@@ -716,19 +723,19 @@
// section高度 // section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{ {
if ([self.titleStr isEqualToString:CategrayTitle]) { // if ([self.titleStr isEqualToString:CategrayTitle]) {
if (section == 3) { if (section == 3) {
return 50; return 50;
} else { } else {
return CGFLOAT_MIN; return CGFLOAT_MIN;
} }
} else { // } else {
if (section == 2) { // if (section == 2) {
return 50; // return 50;
} else { // } else {
return CGFLOAT_MIN; // return CGFLOAT_MIN;
} // }
} // }
} }
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
UIImageView *imageView = [[UIImageView alloc] init]; UIImageView *imageView = [[UIImageView alloc] init];
imageView.userInteractionEnabled = YES;
imageView.tag = 1115 + i; imageView.tag = 1115 + i;
imageView.translatesAutoresizingMaskIntoConstraints = NO; imageView.translatesAutoresizingMaskIntoConstraints = NO;
NSDictionary *imageDict = questionDetail.attachments[i]; NSDictionary *imageDict = questionDetail.attachments[i];
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
{ {
_questionDetail = questionDetail; _questionDetail = questionDetail;
NSString *questionNameText = [NSString stringWithFormat:@"问题名称:%@", questionDetail.title]; NSString *questionNameText = [NSString stringWithFormat:@"联系方式:%@", questionDetail.title];
NSMutableAttributedString *questionNameAttr = [[NSMutableAttributedString alloc] initWithString:questionNameText]; NSMutableAttributedString *questionNameAttr = [[NSMutableAttributedString alloc] initWithString:questionNameText];
[questionNameAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,5)]; [questionNameAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,5)];
[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)];
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
UIImageView *imageView = [[UIImageView alloc] init]; UIImageView *imageView = [[UIImageView alloc] init];
imageView.userInteractionEnabled = YES;
imageView.tag = 1115 + i; imageView.tag = 1115 + i;
imageView.translatesAutoresizingMaskIntoConstraints = NO; imageView.translatesAutoresizingMaskIntoConstraints = NO;
NSDictionary *imageDict = questionDetail.attachments[i]; NSDictionary *imageDict = questionDetail.attachments[i];
......
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