Commit fc6efa4b authored by admin's avatar admin

参考标准完成

parent f29fa7ad
......@@ -63,10 +63,12 @@
84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574A1BDB344900083584 /* UIBarButtonItem+Create.m */; };
84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574C1BDB344900083584 /* UIView+Frame.m */; };
84C957551BDB54D600083584 /* AnnounceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C957541BDB54D600083584 /* AnnounceViewController.m */; };
84CF0ED51BE9AC1400C855CE /* InspectSettleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0ED41BE9AC1400C855CE /* InspectSettleCell.m */; };
84CF0ED81BE9AC7E00C855CE /* InspectSettleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0ED71BE9AC7E00C855CE /* InspectSettleViewController.m */; };
84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */; };
84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */; };
84D3E5F01C04BC8C001FF1DD /* InspectUploadedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */; };
84D3E5F31C04BCD3001FF1DD /* InspectNotUploadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5F21C04BCD3001FF1DD /* InspectNotUploadViewController.m */; };
84D3E5F91C04BD8E001FF1DD /* InspectNotUpLoadCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5F81C04BD8E001FF1DD /* InspectNotUpLoadCell.m */; };
84D3E6021C04DA85001FF1DD /* InspectUpLoadFootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E6011C04DA85001FF1DD /* InspectUpLoadFootView.m */; };
84D80EB51BF714BE00A10EA4 /* GroupItems.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D80EB21BF714BE00A10EA4 /* GroupItems.m */; };
84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D80EB41BF714BE00A10EA4 /* GroupTabBar.m */; };
84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8257E1BDD2F7E00CC61F7 /* MineTableFooterView.m */; };
......@@ -227,14 +229,18 @@
84C9574F1BDB38AA00083584 /* redstar.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = redstar.pch; sourceTree = "<group>"; };
84C957531BDB54D600083584 /* AnnounceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnounceViewController.h; sourceTree = "<group>"; };
84C957541BDB54D600083584 /* AnnounceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnnounceViewController.m; sourceTree = "<group>"; };
84CF0ED31BE9AC1400C855CE /* InspectSettleCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectSettleCell.h; sourceTree = "<group>"; };
84CF0ED41BE9AC1400C855CE /* InspectSettleCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectSettleCell.m; sourceTree = "<group>"; };
84CF0ED61BE9AC7E00C855CE /* InspectSettleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectSettleViewController.h; sourceTree = "<group>"; };
84CF0ED71BE9AC7E00C855CE /* InspectSettleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectSettleViewController.m; sourceTree = "<group>"; };
84CF0F1C1BE9B40400C855CE /* InspectDetailFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectDetailFooterView.h; sourceTree = "<group>"; };
84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailFooterView.m; sourceTree = "<group>"; };
84CF0FA01BE9EDA900C855CE /* TakePhotoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TakePhotoView.h; sourceTree = "<group>"; };
84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TakePhotoView.m; sourceTree = "<group>"; };
84D3E5EE1C04BC8C001FF1DD /* InspectUploadedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectUploadedViewController.h; sourceTree = "<group>"; };
84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectUploadedViewController.m; sourceTree = "<group>"; };
84D3E5F11C04BCD3001FF1DD /* InspectNotUploadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectNotUploadViewController.h; sourceTree = "<group>"; };
84D3E5F21C04BCD3001FF1DD /* InspectNotUploadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectNotUploadViewController.m; sourceTree = "<group>"; };
84D3E5F71C04BD8E001FF1DD /* InspectNotUpLoadCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectNotUpLoadCell.h; sourceTree = "<group>"; };
84D3E5F81C04BD8E001FF1DD /* InspectNotUpLoadCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectNotUpLoadCell.m; sourceTree = "<group>"; };
84D3E6001C04DA85001FF1DD /* InspectUpLoadFootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectUpLoadFootView.h; sourceTree = "<group>"; };
84D3E6011C04DA85001FF1DD /* InspectUpLoadFootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectUpLoadFootView.m; sourceTree = "<group>"; };
84D80EB11BF714BE00A10EA4 /* GroupItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupItems.h; sourceTree = "<group>"; };
84D80EB21BF714BE00A10EA4 /* GroupItems.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupItems.m; sourceTree = "<group>"; };
84D80EB31BF714BE00A10EA4 /* GroupTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupTabBar.h; sourceTree = "<group>"; };
......@@ -1121,8 +1127,8 @@
84CF0ECB1BE9A7EF00C855CE /* Cell */ = {
isa = PBXGroup;
children = (
84CF0ED31BE9AC1400C855CE /* InspectSettleCell.h */,
84CF0ED41BE9AC1400C855CE /* InspectSettleCell.m */,
84D3E5F71C04BD8E001FF1DD /* InspectNotUpLoadCell.h */,
84D3E5F81C04BD8E001FF1DD /* InspectNotUpLoadCell.m */,
);
path = Cell;
sourceTree = "<group>";
......@@ -1130,8 +1136,10 @@
84CF0ECC1BE9A7EF00C855CE /* ViewController */ = {
isa = PBXGroup;
children = (
84CF0ED61BE9AC7E00C855CE /* InspectSettleViewController.h */,
84CF0ED71BE9AC7E00C855CE /* InspectSettleViewController.m */,
84D3E5EE1C04BC8C001FF1DD /* InspectUploadedViewController.h */,
84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */,
84D3E5F11C04BCD3001FF1DD /* InspectNotUploadViewController.h */,
84D3E5F21C04BCD3001FF1DD /* InspectNotUploadViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
......@@ -1143,6 +1151,8 @@
84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */,
84CF0FA01BE9EDA900C855CE /* TakePhotoView.h */,
84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */,
84D3E6001C04DA85001FF1DD /* InspectUpLoadFootView.h */,
84D3E6011C04DA85001FF1DD /* InspectUpLoadFootView.m */,
);
path = View;
sourceTree = "<group>";
......@@ -1570,6 +1580,7 @@
848699B31BDF810900859DFE /* InspectTaskViewController.m in Sources */,
84AD4F321BF443E700BFB37C /* InspectDetailHeaderView.m in Sources */,
84E420471BE88AE000689976 /* RootTabBarController.m in Sources */,
84D3E5F01C04BC8C001FF1DD /* InspectUploadedViewController.m in Sources */,
840826211BE5D2400022B795 /* OnLineFooterView.m in Sources */,
8487D80C1BF218F900E63E90 /* MenuView.m in Sources */,
8474C5921BE78A85007DCF19 /* QuestionViewController.m in Sources */,
......@@ -1580,7 +1591,6 @@
8408261A1BE5CEDD0022B795 /* OnLineViewController.m in Sources */,
84F57C9C1BECA73800DDEEB1 /* StarBar.m in Sources */,
84F57C4C1BEC785E00DDEEB1 /* AddQuestionViewController.m in Sources */,
84CF0ED51BE9AC1400C855CE /* InspectSettleCell.m in Sources */,
84C957551BDB54D600083584 /* AnnounceViewController.m in Sources */,
84D80EB51BF714BE00A10EA4 /* GroupItems.m in Sources */,
84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */,
......@@ -1590,7 +1600,8 @@
8490C4D31BF9DEF0006B6569 /* PictureTableCell.m in Sources */,
84970E391BD8E0B300C1728A /* LoginView.m in Sources */,
84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */,
84CF0ED81BE9AC7E00C855CE /* InspectSettleViewController.m in Sources */,
84D3E5F31C04BCD3001FF1DD /* InspectNotUploadViewController.m in Sources */,
84D3E5F91C04BD8E001FF1DD /* InspectNotUpLoadCell.m in Sources */,
84ECCF1F1C021E7F00EA4960 /* RedStarTools.m in Sources */,
84ECCF181C01FA2600EA4960 /* QuestionDetailModel.m in Sources */,
84846E9A1BE07CDF0010550A /* RankingListCell.m in Sources */,
......@@ -1602,6 +1613,7 @@
84DB9BC71BDCD67200822CC4 /* UIView+Extension.m in Sources */,
8462C6EC1BF5F3BE00344DDD /* MenuButton.m in Sources */,
8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */,
84D3E6021C04DA85001FF1DD /* InspectUpLoadFootView.m in Sources */,
8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */,
8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */,
8490C4D71BF9DF1D006B6569 /* PictureStoryViewController.m in Sources */,
......
//
// InspectInterfaceCell.h
// redstar
//
// Created by admin on 15/11/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface InspectInterfaceCell : UITableViewCell
@end
//
// InspectInterfaceCell.m
// redstar
//
// Created by admin on 15/11/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectInterfaceCell.h"
@implementation InspectInterfaceCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// InspectSettleCell.h
// InspectNotUpLoadCell.h
// redstar
//
// Created by admin on 15/11/4.
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface InspectSettleCell : UITableViewCell
@interface InspectNotUpLoadCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *titleDetailLabel;
@property (nonatomic, strong) UILabel *introLabel;
@property (nonatomic, strong) UILabel *introDetailLabel;
@end
//
// InspectSettleCell.m
// InspectNotUpLoadCell.m
// redstar
//
// Created by admin on 15/11/4.
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectSettleCell.h"
#import "InspectNotUpLoadCell.h"
@implementation InspectSettleCell
@implementation InspectNotUpLoadCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
......@@ -20,8 +20,8 @@
#pragma mark - Private Methods
- (void)setup {
}
#pragma - lazy loading
......@@ -125,4 +125,12 @@
return _introDetailLabel;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// InspectUpLoadFootView.h
// redstar
//
// Created by admin on 15/11/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol InspectUpLoadFootDelegate <NSObject>
- (void)returnParentsViewController;
@end
@interface InspectUpLoadFootView : UIView
@property (nonatomic, strong) UILabel *titleLabel;
- (instancetype)initWithAnswerAttachments:(NSArray *)answerAttachments
referenceAttachments:(NSArray *)referenceAttachments
remark:(NSString *)remark;
@property (nonatomic, assign) id <InspectUpLoadFootDelegate> delegate;
@end
//
// InspectNotUploadViewController.h
// redstar
//
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TaskModel.h"
@interface InspectNotUploadViewController : UIViewController
@property (nonatomic, assign) int questionCount;
@property (nonatomic, strong) TaskModel *taskModel;
@end
//
// InspectSettleViewController.m
// InspectNotUploadViewController.m
// redstar
//
// Created by admin on 15/11/4.
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectSettleViewController.h"
#import "InspectSettleCell.h"
#import "InspectDetailFooterView.h"
#import "InspectNotUploadViewController.h"
#import "InspectNotUpLoadCell.h"
#import "CheckPicViewController.h"
#import "InspectDetailFooterView.h"
#import "HttpClient.h"
#define kInspectSettleCell @"InspectSettleCell"
#define kInspectNotUploadCell @"InspectNotUploadCell"
@interface InspectSettleViewController () <UITableViewDelegate, UITableViewDataSource, TakePhotoViewDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@interface InspectNotUploadViewController () <UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate , TakePhotoViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) InspectDetailFooterView *footerView;
@end
@implementation InspectSettleViewController
- (void)viewDidLoad {
@implementation InspectNotUploadViewController
- (void)viewDidLoad
{
[super viewDidLoad];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
......@@ -41,14 +43,10 @@
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
[self.tableView registerClass:[InspectSettleCell class] forCellReuseIdentifier:kInspectSettleCell];
[self.tableView registerClass:[InspectNotUpLoadCell class] forCellReuseIdentifier:kInspectNotUploadCell];
self.tableView.tableFooterView = self.footerView;
self.footerView.takePhotoView.delegate = self;
}
- (void)didReceiveMemoryWarning {
......@@ -115,7 +113,7 @@
// 创建一个新的控件
UIButton *newButton = [self.footerView.takePhotoView createButtonWithImage:image];
[newButton addTarget:self action:@selector(takePhotoShowPicture:) forControlEvents:UIControlEventTouchUpInside];
[self.footerView.takePhotoView insertSubview:newButton atIndex:self.footerView.takePhotoView.subviews.count - 1];
[self.footerView.takePhotoView.allImages addObject:image];
......@@ -135,6 +133,8 @@
[picker dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark - TableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
......@@ -145,38 +145,22 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
InspectSettleCell *cell=[tableView dequeueReusableCellWithIdentifier:kInspectSettleCell];
InspectNotUpLoadCell *cell=[tableView dequeueReusableCellWithIdentifier:kInspectNotUploadCell];
if (!cell) {
cell = [[InspectSettleCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectSettleCell];
cell = [[InspectNotUpLoadCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectNotUploadCell];
}
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _taskModel.title];
cell.titleDetailLabel.text = [NSString stringWithFormat:@"要求图片%d张", _taskModel.attachmentNumber];
cell.introLabel.text = @"参考说明";
cell.introDetailLabel.text = [self filterHTML:[NSString stringWithFormat:@"%@", _taskModel.reference]];
cell.introDetailLabel.text = [NSString stringWithFormat:@"%@", _taskModel.reference];
return cell;
}
- (NSString *)filterHTML:(NSString *)html
{
NSScanner * scanner = [NSScanner scannerWithString:html];
NSString * text = nil;
while([scanner isAtEnd]==NO)
{
//找到标签的起始位置
[scanner scanUpToString:@"<" intoString:nil];
//找到标签的结束位置
[scanner scanUpToString:@">" intoString:&text];
//替换字符
html = [html stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@>",text] withString:@""];
}
// NSString * regEx = @"<([^>]*)>";
// html = [html stringByReplacingOccurrencesOfString:regEx withString:@""];
return html;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
......@@ -203,7 +187,7 @@
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 200.0;
_tableView.estimatedRowHeight = 300.0;
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
......@@ -233,4 +217,14 @@
[self.view endEditing:YES];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// InspectSettleViewController.h
// InspectUploadedViewController.h
// redstar
//
// Created by admin on 15/11/4.
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TaskModel.h"
@interface InspectSettleViewController : UIViewController
@interface InspectUploadedViewController : UIViewController
@property (nonatomic, assign) int questionCount;
@property (nonatomic, strong) TaskModel *taskModel;
@end
//
// InspectUploadedViewController.m
// redstar
//
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectUploadedViewController.h"
#import "InspectNotUpLoadCell.h"
#import "InspectUpLoadFootView.h"
#define kInspectnotLoadTableViewCell @"InspectnotLoadTableViewCell"
#define kInspectReferencePicCell @"InspectReferencePiccell"
@interface InspectUploadedViewController ()<UITableViewDelegate, UITableViewDataSource,InspectUpLoadFootDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) InspectUpLoadFootView *footerView;
@end
@implementation InspectUploadedViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = kSectionBackGroundColor;
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
[customLab setTextColor:[UIColor whiteColor]];
customLab.textAlignment = NSTextAlignmentCenter;
[customLab setText:[NSString stringWithFormat:@"检查点--%@(%@/%d)", self.taskModel.category, self.taskModel.lineNo, self.questionCount]];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
[self.tableView registerClass:[InspectNotUpLoadCell class] forCellReuseIdentifier:kInspectnotLoadTableViewCell];
self.tableView.tableFooterView = self.footerView;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - private Methods
// 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - TableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
InspectNotUpLoadCell *cell=[tableView dequeueReusableCellWithIdentifier:kInspectnotLoadTableViewCell];
if (!cell) {
cell = [[InspectNotUpLoadCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectnotLoadTableViewCell];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _taskModel.title];
cell.titleDetailLabel.text = [NSString stringWithFormat:@"要求图片%d张", _taskModel.attachmentNumber];
cell.introLabel.text = @"参考说明";
cell.introDetailLabel.text = [NSString stringWithFormat:@"%@", _taskModel.reference];
return cell;
}
// section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
#pragma mark - InspectFootDelegate
- (void)returnParentsViewController
{
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero];
_tableView.backgroundColor = kSectionBackGroundColor;
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 200.0;
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
}
return _tableView;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
}
- (InspectUpLoadFootView *)footerView
{
if (!_footerView) {
_footerView = [[InspectUpLoadFootView alloc] initWithAnswerAttachments:self.taskModel.answerAttachments referenceAttachments:self.taskModel.referenceAttachments remark:self.taskModel.remark];
_footerView.delegate = self;
}
return _footerView;
}
@end
......@@ -7,7 +7,6 @@
//
#import "InspectTaskViewController.h"
#import "InspectSettleViewController.h"
#import "InspectDetailView.h"
#import "InspectSortTableCell.h"
......@@ -21,6 +20,9 @@
#import "TaskDetailModel.h"
#import <MBProgressHUD.h>
#import "InspectNotUploadViewController.h"
#import "InspectUploadedViewController.h"
#define kTaskSortCell @"InspectTaskSortCell"
......@@ -161,12 +163,15 @@
TaskModel *task = taskGroup.answers[indexPath.row];
if (task.readonly) {
InspectSettleViewController *inspectVC = [[InspectSettleViewController alloc] init];
InspectUploadedViewController *inspectVC = [[InspectUploadedViewController alloc] init];
inspectVC.questionCount = taskGroup.questionCount;
inspectVC.taskModel = task;
[self.navigationController pushViewController:inspectVC animated:YES];
} else {
InspectNotUploadViewController *inspectNotVC = [[InspectNotUploadViewController alloc] init];
inspectNotVC.questionCount = taskGroup.questionCount;
inspectNotVC.taskModel = task;
[self.navigationController pushViewController:inspectNotVC animated:YES];
}
......
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