Commit 4b9a9bb0 authored by admin's avatar admin

添加巡检商场字段

parent 2abcb09c
...@@ -233,7 +233,6 @@ ...@@ -233,7 +233,6 @@
// 退出图片选择控制器 // 退出图片选择控制器
[picker dismissViewControllerAnimated:YES completion:nil]; [picker dismissViewControllerAnimated:YES completion:nil];
NSLog(@"222222self.tableView.frame = %@, self.contentSize = %@, self.contentOff = %@", NSStringFromCGRect(self.tableView.frame),NSStringFromCGSize(self.tableView.contentSize), NSStringFromCGPoint(self.tableView.contentOffset)); NSLog(@"222222self.tableView.frame = %@, self.contentSize = %@, self.contentOff = %@", NSStringFromCGRect(self.tableView.frame),NSStringFromCGSize(self.tableView.contentSize), NSStringFromCGPoint(self.tableView.contentOffset));
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
@property (nonatomic, strong) UILabel *titleLabel; // 标题 @property (nonatomic, strong) UILabel *titleLabel; // 标题
@property (nonatomic, strong) UILabel *startDate; // 起始日期 @property (nonatomic, strong) UILabel *startDate; // 起始日期
@property (nonatomic, strong) UILabel *overDate; // 截止日期 @property (nonatomic, strong) UILabel *overDate; // 截止日期
@property (nonatomic, strong) UILabel *address;
@property (nonatomic, strong) UILabel *progressLabel; @property (nonatomic, strong) UILabel *progressLabel;
@property (nonatomic, strong) UILabel *alreadyLabel; @property (nonatomic, strong) UILabel *alreadyLabel;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
self.titleLabel.font = [UIFont systemFontOfSize:19.0]; self.titleLabel.font = [UIFont systemFontOfSize:19.0];
self.startDate.textColor = kCellDetailColor; self.startDate.textColor = kCellDetailColor;
self.overDate.textColor = kCellDetailColor; self.overDate.textColor = kCellDetailColor;
self.address.textColor = kCellDetailColor;
self.progressLabel.font = [UIFont systemFontOfSize:14.0]; self.progressLabel.font = [UIFont systemFontOfSize:14.0];
self.alreadyLabel.font = [UIFont systemFontOfSize:15.0]; self.alreadyLabel.font = [UIFont systemFontOfSize:15.0];
self.allLabel.font = [UIFont systemFontOfSize:15.0]; self.allLabel.font = [UIFont systemFontOfSize:15.0];
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
self.titleLabel.text = [NSString stringWithFormat:@"%@", taskList.name]; self.titleLabel.text = [NSString stringWithFormat:@"%@", taskList.name];
self.startDate.text = [NSString stringWithFormat:@"起始时间:%@", taskList.beginDate]; self.startDate.text = [NSString stringWithFormat:@"起始时间:%@", taskList.beginDate];
self.overDate.text = [NSString stringWithFormat:@"截止时间:%@", taskList.endDate]; self.overDate.text = [NSString stringWithFormat:@"截止时间:%@", taskList.endDate];
self.address.text = [NSString stringWithFormat:@"巡检商场:%@", taskList.store_name];
self.alreadyLabel.text = [NSString stringWithFormat:@"%d", taskList.reportCount]; self.alreadyLabel.text = [NSString stringWithFormat:@"%d", taskList.reportCount];
self.allLabel.text = [NSString stringWithFormat:@"/%d", taskList.questionCount]; self.allLabel.text = [NSString stringWithFormat:@"/%d", taskList.questionCount];
...@@ -188,6 +189,30 @@ ...@@ -188,6 +189,30 @@
return _overDate; return _overDate;
} }
- (UILabel *)address
{
if (!_address) {
_address = [[UILabel alloc] init];
_address.font = [UIFont systemFontOfSize:14.0];
_address.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_address];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_address attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_address attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:_address attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint constraintWithItem:_address attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
[self.contentView addConstraint:overDateHeight];
}
return _address;
}
- (UILabel *)progressLabel - (UILabel *)progressLabel
{ {
if (!_progressLabel) { if (!_progressLabel) {
...@@ -195,7 +220,7 @@ ...@@ -195,7 +220,7 @@
_progressLabel.translatesAutoresizingMaskIntoConstraints = NO; _progressLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_progressLabel]; [self.contentView addSubview:_progressLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.address attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:overDateTop]; [self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20]; NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
...@@ -218,7 +243,7 @@ ...@@ -218,7 +243,7 @@
_alreadyLabel.translatesAutoresizingMaskIntoConstraints = NO; _alreadyLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_alreadyLabel]; [self.contentView addSubview:_alreadyLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_alreadyLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_alreadyLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.address attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:overDateTop]; [self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateWidth = [NSLayoutConstraint constraintWithItem:_alreadyLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.allLabel attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0]; NSLayoutConstraint *overDateWidth = [NSLayoutConstraint constraintWithItem:_alreadyLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.allLabel attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
...@@ -240,7 +265,7 @@ ...@@ -240,7 +265,7 @@
_allLabel.translatesAutoresizingMaskIntoConstraints = NO; _allLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_allLabel]; [self.contentView addSubview:_allLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_allLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_allLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.address attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:overDateTop]; [self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateWidth = [NSLayoutConstraint constraintWithItem:_allLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:32]; NSLayoutConstraint *overDateWidth = [NSLayoutConstraint constraintWithItem:_allLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:32];
...@@ -268,7 +293,7 @@ ...@@ -268,7 +293,7 @@
_allView.layer.borderColor = kUsernameBorderColor; _allView.layer.borderColor = kUsernameBorderColor;
[self.contentView addSubview:_allView]; [self.contentView addSubview:_allView];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_allView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.progressLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:5]; NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_allView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.allLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:5];
[self.contentView addConstraint:overDateTop]; [self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_allView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20]; NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_allView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
......
...@@ -637,11 +637,11 @@ ...@@ -637,11 +637,11 @@
[self.navigationController pushViewController:inspectTaskVC animated:YES]; [self.navigationController pushViewController:inspectTaskVC animated:YES];
} }
// cell的高度 //// cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath //- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{ //{
return 145; // return 145;
} //}
// section高度 // section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
...@@ -689,8 +689,8 @@ ...@@ -689,8 +689,8 @@
_tableView.showsVerticalScrollIndicator = NO; _tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO; _tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = [[UIView alloc] init]; _tableView.tableFooterView = [[UIView alloc] init];
// [_tableView registerClass:[InspectListCell class] forCellReuseIdentifier:kInspectListCell]; _tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 150.0;
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:45]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:45];
......
...@@ -1037,7 +1037,8 @@ ...@@ -1037,7 +1037,8 @@
- (void)searchClick:(UIButton *)sender - (void)searchClick:(UIButton *)sender
{ {
if (!_searchTextField.text) { NSLog(@"_searchTextField.text = %@", _searchTextField.text);
if (![_searchTextField.text isEqualToString:@""]) {
SearchViewController *searchVC = [[SearchViewController alloc] init]; SearchViewController *searchVC = [[SearchViewController alloc] init];
searchVC.customStr = _searchTextField.text; searchVC.customStr = _searchTextField.text;
[self.navigationController pushViewController:searchVC animated:YES]; [self.navigationController pushViewController:searchVC 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