Commit a9851bc8 authored by admin's avatar admin

抽查评分完成

parent e5a2b0ea
This diff is collapsed.
......@@ -13,5 +13,21 @@
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>
......@@ -128,10 +128,11 @@
#define kAnnounceHeaderColor [UIColor colorWithRed:236 / 255.0 green:238 / 255.0 blue:250 / 255.0 alpha:1.0]
#define kResultTitleBackColor [UIColor colorWithRed:238 / 255.0 green:238 / 255.0 blue:244 / 255.0 alpha:1.0]
#define kCommentViewHeight 300
#define kCommentWithStarViewHeight 325
#define kTaxisViewHeight 150
#define kScreenViewHeight 240
#define kMoreScreenViewHeight 410
......
//
// OnLineResultDetailCell.h
// redstar
//
// Created by admin on 15/12/9.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineResultDetailCell : UITableViewCell
@property (nonatomic, strong) UILabel *shopNameLabel;
@property (nonatomic, strong) UIView *whiteView;
@property (nonatomic, strong) UILabel *addressLabel;
@property (nonatomic, strong) UIScrollView *showScrollView; // 轮播图
@end
//
// OnLineResultDetailCell.m
// redstar
//
// Created by admin on 15/12/9.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineResultDetailCell.h"
#import <UIButton+WebCache.h>
@implementation OnLineResultDetailCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setupScrollView];
}
return self;
}
- (void)setupScrollView
{
int imageCount = 4;
CGFloat marginW = 5.0;
CGFloat imageViewW = 90 + 2 * marginW;
CGFloat imageViewH = self.showScrollView.bounds.size.height - 4;
self.showScrollView.contentSize = CGSizeMake(imageCount *imageViewW, imageViewH + 4);
for (int i = 0; i < imageCount; i++) {
UIButton *button = [[UIButton alloc] init];
// 这是真正的
// NSDictionary *dict = (NSDictionary *)self.storePictures[i];
// 这是假的
NSDictionary *dict = [NSDictionary dictionary];
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,dict[@"fileUrl"]]];
[button sd_setImageWithURL:imageUrl forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"default_pic"]];
button.frame = CGRectMake(i * imageViewW + 2, 2, imageViewW - 2 * marginW, imageViewH);
//[button addTarget:self action:@selector(showBigPic:) forControlEvents:UIControlEventTouchUpInside];
[self.showScrollView addSubview:button];
}
}
- (UILabel *)shopNameLabel
{
if (!_shopNameLabel) {
_shopNameLabel = [[UILabel alloc] init];
_shopNameLabel.translatesAutoresizingMaskIntoConstraints = NO;
_shopNameLabel.textColor = kDetailSection0TitleColor;
_shopNameLabel.font = [UIFont systemFontOfSize:18.0];
[self.contentView addSubview:_shopNameLabel];
// label
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_shopNameLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:titleTop];
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_shopNameLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_shopNameLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_shopNameLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:46];
[self.contentView addConstraint:titleHeight];
}
return _shopNameLabel;
}
- (UIView *)whiteView
{
if (!_whiteView) {
_whiteView = [[UIView alloc] init];
_whiteView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_whiteView];
// label
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_whiteView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.shopNameLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:titleTop];
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_whiteView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_whiteView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_whiteView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:110];
[self.contentView addConstraint:titleHeight];
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_whiteView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:titleBottom];
}
return _whiteView;
}
- (UILabel *)addressLabel
{
if (!_addressLabel) {
_addressLabel = [[UILabel alloc] init];
_addressLabel.translatesAutoresizingMaskIntoConstraints = NO;
_addressLabel.textColor = kLightGray;
_addressLabel.font = [UIFont systemFontOfSize:14.0];
[self.whiteView addSubview:_addressLabel];
// label
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_addressLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.whiteView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.whiteView addConstraint:titleTop];
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_addressLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.whiteView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.whiteView addConstraint:titleLeft];
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_addressLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.whiteView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.whiteView addConstraint:titleRight];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_addressLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35];
[self.whiteView addConstraint:titleHeight];
}
return _addressLabel;
}
- (UIScrollView *)showScrollView
{
if (!_showScrollView) {
_showScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(20, 35, kScreenWidth - 40, 70)];
_showScrollView.showsHorizontalScrollIndicator = NO;
_showScrollView.showsVerticalScrollIndicator = NO;
[self.whiteView addSubview:_showScrollView];
}
return _showScrollView;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// OnLineResultFootView.h
// redstar
//
// Created by admin on 15/12/10.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineResultFootView : UIView
@property (nonatomic, strong) UILabel *introLabel;
@property (nonatomic, strong) UIButton *returnButton;
- (instancetype)initWithPicArray:(NSArray *)picArray;
@end
//
// OnLineResultFootView.m
// redstar
//
// Created by admin on 15/12/10.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineResultFootView.h"
#import <UIImageView+WebCache.h>
@implementation OnLineResultFootView
- (instancetype)initWithPicArray:(NSArray *)picArray
{
self = [super init];
if (self) {
[self setupWithPicArray:picArray];
}
return self;
}
- (void)setupWithPicArray:(NSArray *)picArray
{
// 备注
UILabel *remarkLanel = [[UILabel alloc] initWithFrame:CGRectMake(20, 5 ,kScreenWidth - 40, 30)];
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:90];
[self addConstraint:overDateWidth];
// textView
UITextView *textView = [[UITextView alloc] init];
textView.text = [NSString stringWithFormat:@"%@", @"测试的处理说明,已经按照任务要求进行拍照处理"];
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];
UILabel *picLabel = [[UILabel alloc] init];
picLabel.translatesAutoresizingMaskIntoConstraints = NO;
picLabel.font = [UIFont systemFontOfSize:15.0];
picLabel.textColor = kLightGray;
picLabel.text = @"现场照片";
[self addSubview:picLabel];
NSLayoutConstraint *picLabelTop = [NSLayoutConstraint constraintWithItem:picLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:5];
[self addConstraint:picLabelTop];
NSLayoutConstraint *picLabelLeft = [NSLayoutConstraint constraintWithItem:picLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:picLabelLeft];
NSLayoutConstraint *picLabelRight = [NSLayoutConstraint constraintWithItem:picLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:picLabelRight];
NSLayoutConstraint *picLabelHeight = [NSLayoutConstraint constraintWithItem:picLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self addConstraint:picLabelHeight];
// 所有的现场图片
self.backgroundColor = kSectionBackGroundColor;
CGFloat imageMaginX = 20;
CGFloat imageMaginY = 10;
CGFloat imageW = (kScreenWidth - imageMaginX * 3) / 2;
CGFloat imageH = 100;
int answerCount = (int)picArray.count;
int answerRow = 0;
if (answerCount % 2 == 0) {
answerRow = answerCount / 2;
} else {
answerRow = (answerCount + 1) / 2;
}
// 现场照片
for (int i = 0; i < picArray.count; i++) {
UIImageView *imageView = [[UIImageView alloc] init];
imageView.userInteractionEnabled = YES;
NSDictionary *dict = (NSDictionary *)picArray[i];
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", kRedStarURL ,dict[@"fileUrl"]]];
[imageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"default_pic"]];
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageCilck:)];
// [imageView addGestureRecognizer:tap];
int j = 0;
if ((i + 1) % 2 == 0) {
j = (i + 1) / 2;
imageView.frame = CGRectMake(imageMaginX + (imageW + imageMaginX), 165 + (j-1) * (imageH + imageMaginY), imageW, imageH);
} else {
j = (i + 2) / 2;
imageView.frame = CGRectMake(imageMaginX, 165 + (j-1) * (imageH + imageMaginY), imageW, imageH);
}
[self addSubview:imageView];
}
// 返回上一页
UIButton *returnButton = [[UIButton alloc] init];
returnButton.frame = CGRectMake(20, 175 + answerRow * (imageH + imageMaginY), kScreenWidth - 40, 35);
returnButton.backgroundColor = kNavigationBarColor;
returnButton.layer.cornerRadius = 4;
[returnButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[returnButton setTitle:@"打分评论" forState:UIControlStateNormal];
returnButton.titleLabel.font = [UIFont systemFontOfSize:20.0];
[self addSubview:returnButton];
_returnButton = returnButton;
self.height = 165 + answerRow * (imageH + imageMaginY) + 65;
}
@end
//
// OnLineResultViewController.h
// redstar
//
// Created by admin on 15/12/9.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineResultViewController : UIViewController
@end
......@@ -22,7 +22,28 @@
#pragma mark - Private Methods
- (void)setup
{
CGFloat imageW = 16.5;
CGFloat imageH = 16;
CGFloat spaceX = 7;
for (int i = 0; i < 5; i++) {
UIImageView *imageView = [[UIImageView alloc] init];
imageView.image = [UIImage imageNamed:@"star_after"];
imageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:imageView];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.shopName attribute:NSLayoutAttributeBottom multiplier:1.0 constant:2];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.iconImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:11 + i * (imageW + spaceX)];
[self.contentView addConstraint:Left];
NSLayoutConstraint *width = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:imageW];
[self.contentView addConstraint:width];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:imageH];
[self.contentView addConstraint:Height];
}
}
- (UIImageView *)iconImageView
{
......@@ -54,12 +75,11 @@
if (!_shopName) {
_shopName = [[UILabel alloc] init];
_shopName.font = [UIFont systemFontOfSize:17.0];
_shopName.backgroundColor= [UIColor greenColor];
_shopName.textColor = kLightBlack;
_shopName.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_shopName];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_shopName attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_shopName attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:12];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_shopName attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.iconImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:10];
......@@ -86,7 +106,7 @@
_reportTime.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_reportTime];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_reportTime attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.shopName attribute:NSLayoutAttributeBottom multiplier:1.0 constant:25];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_reportTime attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.shopName attribute:NSLayoutAttributeBottom multiplier:1.0 constant:23];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_reportTime attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.iconImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:10];
......
//
// OnLineCompleteHeadView.h
// OnLineCompleteDetailCell.h
// redstar
//
// Created by admin on 15/11/29.
// Created by admin on 15/12/9.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineCompleteHeadView : UIView
@interface OnLineCompleteDetailCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *startDateLabel; // 商店名称
@property (nonatomic, strong) UILabel *overDateLabel; // 截止时间
@property (nonatomic, strong) UILabel *taskContentLabel; // 发起人
@property (nonatomic, strong) UILabel *startDate; // 商店名称
@property (nonatomic, strong) UILabel *overDate; // 截止时间
@property (nonatomic, strong) UILabel *taskContent;
@property (nonatomic, strong) UIButton *unfoldBtn; // 发起人
@property (nonatomic, strong) UIImageView *arrowImageView; // 发起人
@property (nonatomic, strong) UILabel *taskDetailLabel;
@end
......@@ -7,14 +7,17 @@
//
#import "OnLineCompleteViewController.h"
#import "OnLineCompleteHeadView.h"
#import "OnLineCompleteCell.h"
#import "OnLineCompleteDetailCell.h"
#import "OnLineResultViewController.h"
#define kOnLineCompleteCell @"onLineCompleteCell"
#define kOnLineCompleteDetailCell @"onLineCompleteDetailCell"
@interface OnLineCompleteViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) OnLineCompleteHeadView *headerView;
@property (nonatomic, assign) BOOL isOpen;
@end
@implementation OnLineCompleteViewController
......@@ -36,6 +39,8 @@
self.tableView.delegate = self;
self.tableView.dataSource = self;
_isOpen = NO;
}
#pragma mark - Private Mothods
......@@ -63,37 +68,93 @@
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
- (void)unfoldCilck:(UIButton *)sender
{
_isOpen = !_isOpen;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
if (section == 0) {
return 1;
} else {
return 10;
}
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
OnLineCompleteCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineCompleteCell];
if (!cell) {
cell = [[OnLineCompleteCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineCompleteCell];
if (indexPath.section == 0) {
OnLineCompleteDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineCompleteDetailCell];
if (!cell) {
cell = [[OnLineCompleteDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineCompleteDetailCell];
}
cell.titleLabel.text = @"2015年十一促销临时抽查";
cell.startDate.text = @"发起时间:2015-09-30 12:20:12";
cell.overDate.text = @"截止时间:2015-10-03";
cell.taskContent.text = @"任务内容:";
[cell.unfoldBtn addTarget:self action:@selector(unfoldCilck:) forControlEvents:UIControlEventTouchUpInside];
cell.arrowImageView.image = [UIImage imageNamed:@"grey-trilateral_down"];
if (_isOpen) {
cell.taskDetailLabel.text = [NSString stringWithFormat:@"%@", @"在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 "];
} else {
cell.taskDetailLabel.text = @"";
}
return cell;
} else {
OnLineCompleteCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineCompleteCell];
if (!cell) {
cell = [[OnLineCompleteCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineCompleteCell];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.iconImageView.image = [UIImage imageNamed:@"default_pic"];
cell.shopName.text = @"上海真北店";
cell.reportTime.text = @"上报时间:2015-10-02 12:10:16";
return cell;
}
cell.iconImageView.image = [UIImage imageNamed:@"default_pic"];
cell.shopName.text = @"上海真北店";
cell.reportTime.text = @"上报时间:2015-10-02 12:10:16";
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 45;
if (section == 0) {
return CGFLOAT_MIN;
} else {
return 45;
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
[self.navigationController pushViewController:onLineResult animated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if (section == 0) {
return nil;
}
UIView *sectionView = [[UIView alloc] init];
sectionView.backgroundColor = kSectionBackGroundColor;
UILabel *shopList = [[UILabel alloc] init];
......@@ -129,10 +190,10 @@
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableHeaderView = self.headerView;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 200.0;
[_tableView registerClass:[OnLineCompleteCell class] forCellReuseIdentifier:kOnLineCompleteCell];
[_tableView registerClass:[OnLineCompleteDetailCell class] forCellReuseIdentifier:kOnLineCompleteDetailCell];
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
......@@ -150,13 +211,5 @@
return _tableView;
}
- (OnLineCompleteHeadView *)headerView
{
if (!_headerView) {
_headerView = [[OnLineCompleteHeadView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 123)];
_tableView.backgroundColor = [UIColor whiteColor];
}
return _headerView;
}
@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