Commit fc6efa4b authored by admin's avatar admin

参考标准完成

No related merge requests found
......@@ -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 */,
......
No preview for this file type
//
// 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];
......@@ -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
//
// InspectUpLoadFootView.m
// redstar
//
// Created by admin on 15/11/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectUpLoadFootView.h"
#import <UIImageView+WebCache.h>
//#define kImageItemWidth
//#define kImageItemHeigh
@implementation InspectUpLoadFootView
- (instancetype)initWithAnswerAttachments:(NSArray *)answerAttachments referenceAttachments:(NSArray *)referenceAttachments remark:(NSString *)remark
{
self = [super init];
if (self) {
self.backgroundColor = kSectionBackGroundColor;
NSLog(@"answerAttachments.count = %ld referenceAttachments.count = %ld", answerAttachments.count , referenceAttachments.count);
CGFloat imageMaginX = 20;
CGFloat imageMaginY = 10;
CGFloat imageW = (kScreenWidth - imageMaginX * 3) / 2;
CGFloat imageH = 100;
int answerCount = (int)answerAttachments.count;
int answerRow = 0;
if (answerCount % 2 == 0) {
answerRow = answerCount / 2;
} else {
answerRow = (answerCount + 1) / 2;
}
int referenceCount = (int)referenceAttachments.count;
int referenceRow = 0;
if (referenceCount % 2 == 0) {
referenceRow = referenceCount / 2;
} else {
referenceRow = (referenceCount + 1) / 2;
}
self.height = imageMaginY + (25 * 2) + answerRow * (imageH + imageMaginY) + imageMaginY + referenceRow * (imageH + imageMaginY) + imageMaginY + 100 + 60;
self.titleLabel.text = @"现场照片";
// 现场照片
for (int i = 0; i < answerAttachments.count; i++) {
UIImageView *imageView = [[UIImageView alloc] init];
NSDictionary *dict = (NSDictionary *)answerAttachments[i];
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,dict[@"fileUrl"]]];
[imageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"default_pic"]];
int j = 0;
if ((i + 1) % 2 == 0) {
j = (i + 1) / 2;
imageView.frame = CGRectMake(imageMaginX + (imageW + imageMaginX), 35 + imageMaginY + (j-1) * (imageH + imageMaginY), imageW, imageH);
} else {
j = (i + 2) / 2;
imageView.frame = CGRectMake(imageMaginX, 35 + imageMaginY + (j-1) * (imageH + imageMaginY), imageW, imageH);
}
[self addSubview:imageView];
}
UILabel *referenceLabel = [[UILabel alloc] initWithFrame:CGRectMake(imageMaginX, 40 + answerRow * imageH + (answerRow + 1) * imageMaginY, kScreenWidth - imageMaginX * 2, 25)];
referenceLabel.font = [UIFont systemFontOfSize:15.0];
referenceLabel.textColor = kLightGray;
referenceLabel.text = @"参考照片";
[self addSubview:referenceLabel];
// 参考照片
for (int i = 0; i < referenceAttachments.count; i++) {
UIImageView *imageView = [[UIImageView alloc] init];
NSDictionary *dict = (NSDictionary *)referenceAttachments[i];
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,dict[@"fileUrl"]]];
[imageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"default_pic"]];
int j = 0;
if ((i + 1) % 2 == 0) {
j = (i + 1) / 2;
imageView.frame = CGRectMake(imageMaginX + (imageW + imageMaginX), 65 + answerRow * imageH + (answerRow + 1) * imageMaginY + imageMaginY + (j-1) * (imageH + imageMaginY), imageW, imageH);
} else {
j = (i + 2) / 2;
imageView.frame = CGRectMake(imageMaginX, 65 + answerRow * imageH + (answerRow + 1) * imageMaginY + imageMaginY + (j-1) * (imageH + imageMaginY), imageW, imageH);
}
[self addSubview:imageView];
}
// 备注
UILabel *remarkLanel = [[UILabel alloc] initWithFrame:CGRectMake(imageMaginX, 65 + answerRow * imageH + (answerRow + 1) * imageMaginY + referenceRow * imageH + (referenceRow + 1) * imageMaginY, kScreenWidth - imageMaginX * 2, 25)];
remarkLanel.font = [UIFont systemFontOfSize:15.0];
remarkLanel.textColor = kLightGray;
remarkLanel.text = @"备注";
[self addSubview:remarkLanel];
// 背景ImageView
UIImageView *bgImageView = [[UIImageView alloc] init];
bgImageView.translatesAutoresizingMaskIntoConstraints = NO;
UIImage *image = [UIImage imageNamed:@"textbox"];
UIImage *resizingName = [image resizableImageWithCapInsets:UIEdgeInsetsMake(1, 1, 24, 24) resizingMode:UIImageResizingModeStretch];
bgImageView.image = resizingName;
[self addSubview:bgImageView];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:bgImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:remarkLanel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:bgImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:bgImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:overDateRight];
NSLayoutConstraint *overDateWidth = [NSLayoutConstraint constraintWithItem:bgImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:70];
[self addConstraint:overDateWidth];
// textView
UITextView *textView = [[UITextView alloc] init];
textView.text = [NSString stringWithFormat:@"%@", remark];
textView.backgroundColor = [UIColor clearColor];
textView.translatesAutoresizingMaskIntoConstraints = NO;
[bgImageView addSubview:textView];
NSLayoutConstraint *textViewTop = [NSLayoutConstraint constraintWithItem:textView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
[bgImageView addConstraint:textViewTop];
NSLayoutConstraint *textViewLeft = [NSLayoutConstraint constraintWithItem:textView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:1];
[bgImageView addConstraint:textViewLeft];
NSLayoutConstraint *textViewRight = [NSLayoutConstraint constraintWithItem:textView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-1];
[bgImageView addConstraint:textViewRight];
NSLayoutConstraint *textViewWidth = [NSLayoutConstraint constraintWithItem:textView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1];
[bgImageView addConstraint:textViewWidth];
// 返回上一页
UIButton *returnButton = [[UIButton alloc] init];
returnButton.translatesAutoresizingMaskIntoConstraints = NO;
returnButton.backgroundColor = kNavigationBarColor;
returnButton.layer.cornerRadius = 4;
[returnButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[returnButton setTitle:@"返回上一页面" forState:UIControlStateNormal];
returnButton.titleLabel.font = [UIFont systemFontOfSize:20.0];
[returnButton addTarget:self action:@selector(returnClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:returnButton];
NSLayoutConstraint *returnButtonTop = [NSLayoutConstraint constraintWithItem:returnButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:10];
[self addConstraint:returnButtonTop];
NSLayoutConstraint *returnButtonLeft = [NSLayoutConstraint constraintWithItem:returnButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:returnButtonLeft];
NSLayoutConstraint *returnButtonRight = [NSLayoutConstraint constraintWithItem:returnButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:returnButtonRight];
NSLayoutConstraint *returnButtonHeight = [NSLayoutConstraint constraintWithItem:returnButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
[self addConstraint:returnButtonHeight];
}
return self;
}
- (void)returnClick:(UIButton *)sender
{
if (_delegate) {
[_delegate returnParentsViewController];
}
}
#pragma - lazy loading
- (UILabel *)titleLabel
{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_titleLabel.font = [UIFont systemFontOfSize:15.0];
_titleLabel.textColor = kLightGray;
[self addSubview:_titleLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:10];
[self addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:overDateRight];
NSLayoutConstraint *overDateWidth = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self addConstraint:overDateWidth];
}
return _titleLabel;
}
@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,12 +43,8 @@
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;
}
......@@ -135,6 +133,8 @@
[picker dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark - TableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
......@@ -145,34 +145,18 @@
- (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