Commit 7fbcb01a authored by admin's avatar admin

修复部分bug

parent fff7b6b9
This diff is collapsed.
......@@ -13,21 +13,5 @@
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redstar/Classes/Module/Function/OnLine/OnLineTaskComplete/Cell/OnLineCompleteDetailCell.m"
timestampString = "471346560.745287"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "178"
endingLineNumber = "178"
landmarkName = "-taskDetailLabel"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -15,6 +15,7 @@
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *peopleLabel;
@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) AnnounceModel *announce;
@property (nonatomic, copy) NSString *currentState;
......
......@@ -20,9 +20,8 @@
self.titleLabel.attributedText = attrStr;
//self.titleLabel.text = [NSString stringWithFormat:@"%@", announce.content];
self.peopleLabel.text = [NSString stringWithFormat:@"发布人:%@ 发布日期:%@", announce.lastModify_operName ,announce.lastModify_time];
self.peopleLabel.text = [NSString stringWithFormat:@"发布人:%@", announce.lastModify_operName];
self.dateLabel.text = [NSString stringWithFormat:@"发布日期:%@" ,announce.lastModify_time];
if ([self.currentState isEqualToString:@"false"]) {
if (announce.priority == 0) {
self.stateLabel.text = @"低";
......@@ -94,7 +93,7 @@
_titleLabel.font = [UIFont systemFontOfSize:15.0];
[self.contentView addSubview:_titleLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:17];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:7];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:55];
......@@ -130,13 +129,40 @@
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:18];
[self.contentView addConstraint:overDateHeight];
}
return _peopleLabel;
}
- (UILabel *)dateLabel
{
if (!_dateLabel) {
_dateLabel = [[UILabel alloc] init];
_dateLabel.translatesAutoresizingMaskIntoConstraints = NO;
_dateLabel.textColor = kLightGray;
_dateLabel.font = [UIFont systemFontOfSize:13.0];
[self.contentView addSubview:_dateLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.peopleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:1];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:55];
[self.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint constraintWithItem:_dateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:18];
[self.contentView addConstraint:overDateHeight];
}
return _dateLabel;
}
- (UILabel *)stateLabel
{
if (!_stateLabel) {
......
......@@ -48,7 +48,7 @@
self.contentTextView.backgroundColor = [UIColor clearColor];
self.placeholderLabel2.text = @"请输入评论内容...";
self.placeholderLabel2.text = @"请输入评论内容,不超过200字";
[self.sureBtn setTitle:@"确定" forState:UIControlStateNormal];
......
......@@ -43,7 +43,7 @@
self.contentTextView.backgroundColor = [UIColor clearColor];
self.placeholderLabel2.text = @"请输入评论内容...";
self.placeholderLabel2.text = @"请输入评论内容,不超过200字";
[self.sureBtn setTitle:@"确定" forState:UIControlStateNormal];
......
......@@ -87,8 +87,8 @@
self.titleTextView.backgroundColor = [UIColor clearColor];
self.contentTextView.backgroundColor = [UIColor clearColor];
self.placeholderLabel1.text = @"请输入文字...";
self.placeholderLabel2.text = @"请输入文字...";
self.placeholderLabel1.text = @"请输入文字,不超过500字";
self.placeholderLabel2.text = @"请输入文字,不超过500字";
[self.saveButton setTitle:@"保存并下达" forState:UIControlStateNormal];
......
......@@ -31,7 +31,7 @@
self.backImageView1.image = resizingName;
self.contentTextView.backgroundColor = [UIColor clearColor];
self.placeholderLabel2.text = @"请输入文字...";
self.placeholderLabel2.text = @"请输入文字,不超过500字";
[self.resultButton setTitle:@"上报结果" forState:UIControlStateNormal];
}
......
......@@ -78,6 +78,9 @@
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:tableBottom];
NSLayoutConstraint *tableHeight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:44];
[self.contentView addConstraint:tableHeight];
}
return _titleLabel;
}
......
//
// InspectDetailView.h
// InspectTaskDetailCell.h
// redstar
//
// Created by admin on 15/11/12.
// Created by admin on 15/12/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "InspectListCell.h"
#import "TaskDetailModel.h"
@interface InspectTaskDetailCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@interface InspectDetailView : UIView
@property (nonatomic, strong) UILabel *shopnameLabel; // 商店名称
@property (nonatomic, strong) UILabel *startDateLabel; // 起始时间
@property (nonatomic, strong) UILabel *overDateLabel; // 截止时间
@property (nonatomic, strong) UILabel *progressLabel; // 完成进度
@property (nonatomic, strong) UILabel *alreadyLabel;
@property (nonatomic, strong) UILabel *allLabel;
//@property (nonatomic, assign) ProgressState progressState;
@property (nonatomic, assign) CGFloat multiplier;
@property (nonatomic, strong) UIButton *unfoldBtn;
@property (nonatomic, strong) UIImageView *arrowImageView;
@property (nonatomic, strong) UILabel *dayLabel; // 剩余天数
@property (nonatomic, strong) UIImageView *alreadyView;
@property (nonatomic, strong) UIView *allView;
@property (nonatomic, strong) UILabel *introDetailLabel;
@property (nonatomic, strong) TaskDetailModel *taskDetail;
@end
//
// InspectTitleTableViewCell.h
// redstar
//
// Created by admin on 15/12/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface InspectTitleTableViewCell : UITableViewCell
@end
//
// InspectTitleTableViewCell.m
// redstar
//
// Created by admin on 15/12/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectTitleTableViewCell.h"
@implementation InspectTitleTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.contentView.backgroundColor = kSectionBackGroundColor;
[self setup];
}
return self;
}
#pragma mark - Private Methods
- (void)setup
{
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.font = [UIFont systemFontOfSize:15.0];
titleLabel.textColor = kLightBlack;
titleLabel.text = @"分类项目";
[self.contentView addSubview:titleLabel];
NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:titleLabelTop];
NSLayoutConstraint *titleLabelLeft = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:titleLabelLeft];
NSLayoutConstraint *titleLabelWidth = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleLabelWidth];
NSLayoutConstraint *titleLabelHeight = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
[self.contentView addConstraint:titleLabelHeight];
NSLayoutConstraint *titleLabelBottom = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:titleLabelBottom];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// InspectDetailHeaderView.h
// redstar
//
// Created by admin on 15/11/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "InspectDetailView.h"
#import "TaskDetailModel.h"
@interface InspectDetailHeaderView : UIView
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic,strong) InspectDetailView *detailView;
@property (nonatomic, strong) TaskDetailModel *taskDetail;
@end
//
// InspectDetailHeaderView.m
// redstar
//
// Created by admin on 15/11/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectDetailHeaderView.h"
@implementation InspectDetailHeaderView
- (instancetype)init
{
self = [super init];
if (self) {
[self setup];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self setup];
}
return self;
}
#pragma mark - Private Methods
- (void)setup
{
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.textColor = kAnnounceTextColor;
titleLabel.backgroundColor = kSectionBackGroundColor;
titleLabel.font = [UIFont systemFontOfSize:17.0];
[self addSubview:titleLabel];
NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self addConstraint:titleLabelTop];
NSLayoutConstraint *titleLabelLeft = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self addConstraint:titleLabelLeft];
NSLayoutConstraint *titleLabelWidth = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self addConstraint:titleLabelWidth];
NSLayoutConstraint *titleLabelHeight = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self addConstraint:titleLabelHeight];
_titleLabel = titleLabel;
self.detailView.backgroundColor = [UIColor whiteColor];
UILabel *classifyLabel = [[UILabel alloc] init];
classifyLabel.translatesAutoresizingMaskIntoConstraints = NO;
classifyLabel.textColor = kAnnounceTextColor;
classifyLabel.backgroundColor = [UIColor clearColor];
classifyLabel.font = [UIFont systemFontOfSize:15.0];
classifyLabel.text = @"分类项目";
[self addSubview:classifyLabel];
NSLayoutConstraint *classifyTop = [NSLayoutConstraint constraintWithItem:classifyLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:245];
[self addConstraint:classifyTop];
NSLayoutConstraint *classifyLeft = [NSLayoutConstraint constraintWithItem:classifyLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:classifyLeft];
NSLayoutConstraint *classifyHeight = [NSLayoutConstraint constraintWithItem:classifyLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:39];
[self addConstraint:classifyHeight];
}
- (void)setTaskDetail:(TaskDetailModel *)taskDetail
{
_taskDetail = taskDetail;
self.titleLabel.text = [NSString stringWithFormat:@"%@", taskDetail.name];
self.detailView.shopnameLabel.text = [NSString stringWithFormat:@"%@", taskDetail.store_name];
self.detailView.startDateLabel.text = [NSString stringWithFormat:@"%@", taskDetail.beginDate];
self.detailView.overDateLabel.text = [NSString stringWithFormat:@"%@", taskDetail.endDate];
if (taskDetail.questionCount == 0 || taskDetail.reportCount == 0) {
self.detailView.multiplier = 0;
} else {
self.detailView.multiplier = (CGFloat)taskDetail.reportCount / taskDetail.questionCount;
}
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
// 当前时间
NSDate *date = [NSDate date];
NSString *strDate = [dateFormatter stringFromDate:date];
NSDate *today = [dateFormatter dateFromString:strDate];
NSLog(@"today = %@", today);
// endTime
NSDate *endTime = [dateFormatter dateFromString:[NSString stringWithFormat:@"%@", taskDetail.endDate]];
NSLog(@"endTime = %@", endTime);
NSCalendar *cal = [NSCalendar currentCalendar];
unsigned int unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
NSDateComponents *d = [cal components:unitFlags fromDate:today toDate:endTime options:0];
if (d.day > 0) {
self.detailView.dayLabel.text = [NSString stringWithFormat:@"%ld", (long)d.day];
} else {
self.detailView.dayLabel.text = @"0";
}
if ([taskDetail.state isEqualToString:@"initial"]) {
if (taskDetail.reportCount == 0 || taskDetail.questionCount == 0) {
self.detailView.progressLabel.text = @"0%";
} else {
self.detailView.progressLabel.text = [NSString stringWithFormat:@"未处理 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100];
}
self.detailView.progressLabel.textColor = kProgressUnSettledColor;
self.detailView.alreadyLabel.textColor = kProgressUnSettledColor;
self.detailView.allLabel.textColor = kProgressUnSettledColor;
} else if ([taskDetail.state isEqualToString:@"processing"]) {
self.detailView.progressLabel.text = [NSString stringWithFormat:@"进行中 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100];
self.detailView.progressLabel.textColor = kProgressDealWithColor;
self.detailView.alreadyLabel.textColor = kProgressDealWithColor;
self.detailView.allLabel.textColor = kProgressDealWithColor;
} else if ([taskDetail.state isEqualToString:@"reported"]) {
self.detailView.progressLabel.text = [NSString stringWithFormat:@"已上报 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100];
self.detailView.progressLabel.textColor = kProgressDealWithColor;
self.detailView.alreadyLabel.textColor = kProgressDealWithColor;
self.detailView.allLabel.textColor = kProgressDealWithColor;
} else if ([taskDetail.state isEqualToString:@"finished"]) {
self.detailView.progressLabel.text = [NSString stringWithFormat:@"已评分 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100];
self.detailView.progressLabel.textColor = kProgressDealWithColor;
self.detailView.alreadyLabel.textColor = kProgressDealWithColor;
self.detailView.allLabel.textColor = kProgressDealWithColor;
} else if ([taskDetail.state isEqualToString:@"published"]) {
self.detailView.progressLabel.text = [NSString stringWithFormat:@"已发布 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100];
self.detailView.progressLabel.textColor = kProgressDealWithColor;
self.detailView.alreadyLabel.textColor = kProgressDealWithColor;
self.detailView.allLabel.textColor = kProgressDealWithColor;
} else {
self.detailView.progressLabel.text = [NSString stringWithFormat:@"已过期 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100];
self.detailView.progressLabel.textColor = kProgressOverDueColor;
self.detailView.alreadyLabel.textColor = kProgressOverDueColor;
self.detailView.allLabel.textColor = kProgressOverDueColor;
}
self.detailView.allView.backgroundColor = kProgressViewAllBackColor;
self.detailView.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
self.detailView.alreadyLabel.text = [NSString stringWithFormat:@"%d", taskDetail.reportCount];
self.detailView.allLabel.text = [NSString stringWithFormat:@"/%d", taskDetail.questionCount];
}
- (InspectDetailView *)detailView
{
if (!_detailView) {
_detailView = [[InspectDetailView alloc] init];
_detailView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_detailView];
NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:_detailView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:45];
[self addConstraint:titleLabelTop];
NSLayoutConstraint *titleLabelLeft = [NSLayoutConstraint constraintWithItem:_detailView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self addConstraint:titleLabelLeft];
NSLayoutConstraint *titleLabelWidth = [NSLayoutConstraint constraintWithItem:_detailView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self addConstraint:titleLabelWidth];
NSLayoutConstraint *titleLabelHeight = [NSLayoutConstraint constraintWithItem:_detailView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:200];
[self addConstraint:titleLabelHeight];
}
return _detailView;
}
@end
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