Commit a9851bc8 authored by admin's avatar admin

抽查评分完成

parent e5a2b0ea
......@@ -41,6 +41,9 @@
8487D7721BF19A9C00E63E90 /* SearchToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D7711BF19A9C00E63E90 /* SearchToolBar.m */; };
8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D8081BF20FAD00E63E90 /* TaxisView.m */; };
8487D80C1BF218F900E63E90 /* MenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D80B1BF218F900E63E90 /* MenuView.m */; };
848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 848A201C1C180C1900422FAB /* OnLineCompleteDetailCell.m */; };
848A20271C183FCB00422FAB /* OnLineResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 848A20261C183FCA00422FAB /* OnLineResultViewController.m */; };
848A202D1C184DC600422FAB /* OnLineResultDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 848A202C1C184DC600422FAB /* OnLineResultDetailCell.m */; };
8490C4C31BF9A394006B6569 /* CustomPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4C21BF9A394006B6569 /* CustomPageControl.m */; };
8490C4C61BF9CE85006B6569 /* HomeTitleTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4C51BF9CE85006B6569 /* HomeTitleTableCell.m */; };
8490C4D31BF9DEF0006B6569 /* PictureTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4CE1BF9DEF0006B6569 /* PictureTableCell.m */; };
......@@ -61,7 +64,6 @@
849B2F741C0CA60E005D809F /* AnnounceDetailFootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 849B2F731C0CA60E005D809F /* AnnounceDetailFootView.m */; };
849B2F771C0CABE6005D809F /* AnnounceDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 849B2F761C0CABE6005D809F /* AnnounceDetailModel.m */; };
84A673881C0B50B4000F828E /* OnLineCompleteViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A673871C0B50B4000F828E /* OnLineCompleteViewController.m */; };
84A6738B1C0B54A6000F828E /* OnLineCompleteHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A6738A1C0B54A6000F828E /* OnLineCompleteHeadView.m */; };
84A6738E1C0BE2D0000F828E /* OnLineCompleteCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A6738D1C0BE2D0000F828E /* OnLineCompleteCell.m */; };
84A673911C0C2681000F828E /* FunctionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A673901C0C2681000F828E /* FunctionViewController.m */; };
84A673BE1C0C7AEB000F828E /* AnnoTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A673B41C0C7AEB000F828E /* AnnoTableViewCell.m */; };
......@@ -82,6 +84,7 @@
84AD4F3F1BF498A900BFB37C /* ranking.plist in Resources */ = {isa = PBXBuildFile; fileRef = 84AD4F3E1BF498A900BFB37C /* ranking.plist */; };
84AD4F461BF4A9E800BFB37C /* RankHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F451BF4A9E800BFB37C /* RankHeadView.m */; };
84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F481BF4BC0600BFB37C /* RankDetailTableCell.m */; };
84BB16A21C191A7F00383A64 /* OnLineResultFootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84BB16A11C191A7F00383A64 /* OnLineResultFootView.m */; };
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 */; };
84CC34CC1C093C2F002F10E2 /* OnLineTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CC34C11C093C2F002F10E2 /* OnLineTableViewCell.m */; };
......@@ -219,6 +222,12 @@
8487D8081BF20FAD00E63E90 /* TaxisView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaxisView.m; sourceTree = "<group>"; };
8487D80A1BF218F900E63E90 /* MenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuView.h; sourceTree = "<group>"; };
8487D80B1BF218F900E63E90 /* MenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuView.m; sourceTree = "<group>"; };
848A201B1C180C1900422FAB /* OnLineCompleteDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineCompleteDetailCell.h; sourceTree = "<group>"; };
848A201C1C180C1900422FAB /* OnLineCompleteDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineCompleteDetailCell.m; sourceTree = "<group>"; };
848A20251C183FCA00422FAB /* OnLineResultViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineResultViewController.h; sourceTree = "<group>"; };
848A20261C183FCA00422FAB /* OnLineResultViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineResultViewController.m; sourceTree = "<group>"; };
848A202B1C184DC600422FAB /* OnLineResultDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineResultDetailCell.h; sourceTree = "<group>"; };
848A202C1C184DC600422FAB /* OnLineResultDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineResultDetailCell.m; sourceTree = "<group>"; };
8490C4C11BF9A394006B6569 /* CustomPageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomPageControl.h; sourceTree = "<group>"; };
8490C4C21BF9A394006B6569 /* CustomPageControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomPageControl.m; sourceTree = "<group>"; };
8490C4C41BF9CE85006B6569 /* HomeTitleTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeTitleTableCell.h; sourceTree = "<group>"; };
......@@ -261,8 +270,6 @@
849B2F761C0CABE6005D809F /* AnnounceDetailModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnnounceDetailModel.m; sourceTree = "<group>"; };
84A673861C0B50B4000F828E /* OnLineCompleteViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineCompleteViewController.h; sourceTree = "<group>"; };
84A673871C0B50B4000F828E /* OnLineCompleteViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineCompleteViewController.m; sourceTree = "<group>"; };
84A673891C0B54A6000F828E /* OnLineCompleteHeadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineCompleteHeadView.h; sourceTree = "<group>"; };
84A6738A1C0B54A6000F828E /* OnLineCompleteHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineCompleteHeadView.m; sourceTree = "<group>"; };
84A6738C1C0BE2D0000F828E /* OnLineCompleteCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineCompleteCell.h; sourceTree = "<group>"; };
84A6738D1C0BE2D0000F828E /* OnLineCompleteCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineCompleteCell.m; sourceTree = "<group>"; };
84A6738F1C0C2681000F828E /* FunctionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionViewController.h; sourceTree = "<group>"; };
......@@ -301,6 +308,8 @@
84AD4F451BF4A9E800BFB37C /* RankHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankHeadView.m; sourceTree = "<group>"; };
84AD4F471BF4BC0600BFB37C /* RankDetailTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankDetailTableCell.h; sourceTree = "<group>"; };
84AD4F481BF4BC0600BFB37C /* RankDetailTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankDetailTableCell.m; sourceTree = "<group>"; };
84BB16A01C191A7F00383A64 /* OnLineResultFootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineResultFootView.h; sourceTree = "<group>"; };
84BB16A11C191A7F00383A64 /* OnLineResultFootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineResultFootView.m; sourceTree = "<group>"; };
84C957491BDB344900083584 /* UIBarButtonItem+Create.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIBarButtonItem+Create.h"; sourceTree = "<group>"; };
84C9574A1BDB344900083584 /* UIBarButtonItem+Create.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+Create.m"; sourceTree = "<group>"; };
84C9574B1BDB344900083584 /* UIView+Frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Frame.h"; sourceTree = "<group>"; };
......@@ -553,6 +562,7 @@
8426A4A41BDF0CD600E5FDF5 /* OnLine */ = {
isa = PBXGroup;
children = (
848A201E1C183F1800422FAB /* LookOnLineResult */,
84A673821C0B4D3B000F828E /* OnLineTaskComplete */,
843D1B991C0B3F6200E30002 /* SpotCheckOnLine */,
84CC34E31C09AD58002F10E2 /* LookOnLineDetail */,
......@@ -892,6 +902,43 @@
path = ViewController;
sourceTree = "<group>";
};
848A201E1C183F1800422FAB /* LookOnLineResult */ = {
isa = PBXGroup;
children = (
848A201F1C183F1800422FAB /* Cell */,
848A20201C183F1800422FAB /* View */,
848A20211C183F1800422FAB /* ViewController */,
);
path = LookOnLineResult;
sourceTree = "<group>";
};
848A201F1C183F1800422FAB /* Cell */ = {
isa = PBXGroup;
children = (
848A202B1C184DC600422FAB /* OnLineResultDetailCell.h */,
848A202C1C184DC600422FAB /* OnLineResultDetailCell.m */,
);
path = Cell;
sourceTree = "<group>";
};
848A20201C183F1800422FAB /* View */ = {
isa = PBXGroup;
children = (
84BB16A01C191A7F00383A64 /* OnLineResultFootView.h */,
84BB16A11C191A7F00383A64 /* OnLineResultFootView.m */,
);
path = View;
sourceTree = "<group>";
};
848A20211C183F1800422FAB /* ViewController */ = {
isa = PBXGroup;
children = (
848A20251C183FCA00422FAB /* OnLineResultViewController.h */,
848A20261C183FCA00422FAB /* OnLineResultViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
8490C4C01BF9A394006B6569 /* PageControl */ = {
isa = PBXGroup;
children = (
......@@ -1194,6 +1241,8 @@
children = (
84A6738C1C0BE2D0000F828E /* OnLineCompleteCell.h */,
84A6738D1C0BE2D0000F828E /* OnLineCompleteCell.m */,
848A201B1C180C1900422FAB /* OnLineCompleteDetailCell.h */,
848A201C1C180C1900422FAB /* OnLineCompleteDetailCell.m */,
);
path = Cell;
sourceTree = "<group>";
......@@ -1201,8 +1250,6 @@
84A673841C0B4D3B000F828E /* View */ = {
isa = PBXGroup;
children = (
84A673891C0B54A6000F828E /* OnLineCompleteHeadView.h */,
84A6738A1C0B54A6000F828E /* OnLineCompleteHeadView.m */,
);
path = View;
sourceTree = "<group>";
......@@ -1983,7 +2030,9 @@
84A6738E1C0BE2D0000F828E /* OnLineCompleteCell.m in Sources */,
84CC34D41C094476002F10E2 /* StandardViewController.m in Sources */,
84FD8A0A1BDA01D1006E442A /* MineViewController.m in Sources */,
848A20271C183FCB00422FAB /* OnLineResultViewController.m in Sources */,
848699B21BDF810900859DFE /* InspectListViewController.m in Sources */,
84BB16A21C191A7F00383A64 /* OnLineResultFootView.m in Sources */,
84846E971BE069BC0010550A /* DateButton.m in Sources */,
84CC34CC1C093C2F002F10E2 /* OnLineTableViewCell.m in Sources */,
84AD4F201BF425AC00BFB37C /* InspectDetailView.m in Sources */,
......@@ -1995,7 +2044,6 @@
8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */,
8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */,
84970DEF1BD8DD8A00C1728A /* main.m in Sources */,
84A6738B1C0B54A6000F828E /* OnLineCompleteHeadView.m in Sources */,
8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */,
84CC34D11C093C5E002F10E2 /* LookOnLineViewController.m in Sources */,
84D863731C11923F00E4F4CC /* AddQuestionTableCell.m in Sources */,
......@@ -2011,6 +2059,7 @@
84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */,
849B2F771C0CABE6005D809F /* AnnounceDetailModel.m in Sources */,
8490C4C31BF9A394006B6569 /* CustomPageControl.m in Sources */,
848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */,
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */,
84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */,
8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */,
......@@ -2061,6 +2110,7 @@
84E420411BE849FC00689976 /* QuestionDescribeCell.m in Sources */,
84DB9BC71BDCD67200822CC4 /* UIView+Extension.m in Sources */,
8462C6EC1BF5F3BE00344DDD /* MenuButton.m in Sources */,
848A202D1C184DC600422FAB /* OnLineResultDetailCell.m in Sources */,
8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */,
84CC34E21C09583D002F10E2 /* LookOnLineTableViewCell.m in Sources */,
8480BEB21C143A4100E2F18F /* StateTableView.m in Sources */,
......
......@@ -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
//
// OnLineResultViewController.m
// redstar
//
// Created by admin on 15/12/9.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineResultViewController.h"
#import "OnLineResultDetailCell.h"
#import "OnLineResultFootView.h"
#import "CommentWithStarView.h"
#import "HttpClient.h"
#define kOnLineResultDetailCell @"lookOnLineResultDetailCell"
@interface OnLineResultViewController () <UITableViewDelegate, UITableViewDataSource, UITextViewDelegate, UIAlertViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) OnLineResultFootView *footView;
@property (nonatomic, strong) UIView *backGroundView;
@property (nonatomic, strong) CommentWithStarView *commentView;
@end
@implementation OnLineResultViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
[self setupNav];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.tableFooterView = self.footView;
}
#pragma mark - Private Mothods
- (void)setupNav
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"临检结果"];
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;
}
- (void)doBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)returnClick:(UIButton *)sender
{
if (!_backGroundView) {
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
[_backGroundView addGestureRecognizer:tapGR];
}
if (!_commentView) {
_commentView = [[CommentWithStarView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor];
}
_commentView.contentTextView.text = @"";
_commentView.contentTextView.delegate = self;
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentWithStarViewHeight, kScreenWidth, kCommentWithStarViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentWithStarViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
}
// 提交评论
- (void)submitComment:(UIButton *)sender
{
// 提示框
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要提交评论吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 3699534;
alert.delegate = self;
[alert show];
}
- (void)closeBackGroundView
{
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentWithStarViewHeight);
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = .0f;
_commentView.frame = fromFrame;
} completion:^(BOOL finished) {
[_backGroundView removeFromSuperview];
[_commentView removeFromSuperview];
}];
}
#pragma mark - UITextView Delegate
- (void)textViewDidBeginEditing:(UITextView *)textView
{
[UIView animateWithDuration:0.3 animations:^{
_commentView.frame = CGRectMake(0, self.view.frame.size.height - kCommentWithStarViewHeight - 173, kScreenWidth, kCommentWithStarViewHeight);
}];
}
- (void)textViewDidEndEditing:(UITextView *)textView
{
[UIView animateWithDuration:0.3 animations:^{
_commentView.frame = CGRectMake(0, self.view.frame.size.height - kCommentWithStarViewHeight, kScreenWidth, kCommentWithStarViewHeight);
}];
}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
if (![text isEqualToString:@""]) {
_commentView.placeholderLabel2.hidden = YES;
}
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
_commentView.placeholderLabel2.hidden = NO;
}
if ([text isEqualToString:@"\n"]) {
[_commentView.contentTextView resignFirstResponder];
if (textView.text.length != 0) {
_commentView.placeholderLabel2.hidden = YES;
} else {
_commentView.placeholderLabel2.hidden = NO;
}
return NO;
}
if (range.location>=500) {
return NO;
}
else {
return YES;
}
}
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
OnLineResultDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineResultDetailCell];
if (!cell) {
cell = [[OnLineResultDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineResultDetailCell];
}
cell.contentView.backgroundColor = kResultTitleBackColor;
cell.shopNameLabel.text = @"上海真北店";
cell.whiteView.backgroundColor = [UIColor whiteColor];
cell.addressLabel.text = @"静安区共和新路1111号";
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
#pragma mark - UIAlertDelegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag == 3699534) {
if (buttonIndex == 1) {
NSDate *date = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:date];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
NSString *url = [NSString stringWithFormat:@"%@%@%@&operId=%@&operName=%@", kRedStarURL, kGradeCheckResultURL, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSLog(@"抽查评分 = %@", url);
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"checkUuid":@"sss",
@"storeUuid":@"sss",
@"score":@(_commentView.starBar.starNumber),
@"comment":_commentView.contentTextView.text,
};
[httpClient gradeCheckResultWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"抽查评分的 response = %@", response);
NSLog(@"抽查评分的 error = %@", error);
}];
}
}
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 200.0;
[_tableView registerClass:[OnLineResultDetailCell class] forCellReuseIdentifier:kOnLineResultDetailCell];
[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;
}
- (OnLineResultFootView *)footView
{
if (!_footView) {
NSArray *array = [NSArray arrayWithObjects:@{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"}, @{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"},nil];
_footView = [[OnLineResultFootView alloc] initWithPicArray:array];
[_footView.returnButton addTarget:self action:@selector(returnClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _footView;
}
@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
//
// OnLineCompleteHeadView.m
// OnLineCompleteDetailCell.m
// redstar
//
// Created by admin on 15/11/29.
// Created by admin on 15/12/9.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineCompleteHeadView.h"
#import "OnLineCompleteDetailCell.h"
@interface OnLineCompleteHeadView ()
@property (nonatomic, strong) UILabel *startDate; // 商店名称
@property (nonatomic, strong) UILabel *overDate; // 截止时间
@property (nonatomic, strong) UILabel *taskContent;
@implementation OnLineCompleteDetailCell
@end
@implementation OnLineCompleteHeadView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
......@@ -28,19 +21,9 @@
- (void)setup
{
self.titleLabel.text = @"2015年十一促销临时抽查";
self.startDate.text = @"发起时间";
self.overDate.text = @"截止时间";
self.taskContent.text = @"任务内容";
self.startDateLabel.text = @"2015-09-30 12:20:12";
self.overDateLabel.text = @"2015-10-03";
self.unfoldBtn.titleLabel.font = [UIFont systemFontOfSize:13.0];
self.arrowImageView.image = [UIImage imageNamed:@"grey-trilateral_down"];
//self.taskContentLabel.text = @"王XX 集团X领导";
self.taskDetailLabel.text = @"";
}
- (UILabel *)titleLabel
{
if (!_titleLabel) {
......@@ -48,23 +31,24 @@
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_titleLabel.textColor = kAnnounceTextColor;
_titleLabel.font = [UIFont systemFontOfSize:18.0];
[self addSubview:_titleLabel];
[self.contentView addSubview:_titleLabel];
NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:10];
[self addConstraint:titleLabelTop];
NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:10];
[self.contentView addConstraint:titleLabelTop];
NSLayoutConstraint *titleLabelLeft = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:titleLabelLeft];
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 attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:titleLabelWidth];
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:27];
[self addConstraint:titleLabelHeight];
[self.contentView addConstraint:titleLabelHeight];
}
return _titleLabel;
}
- (UILabel *)startDate
{
if (!_startDate) {
......@@ -72,19 +56,19 @@
_startDate.font = [UIFont systemFontOfSize:15.0];
_startDate.textColor = kOnLineCompleteHeaderTextColor;
_startDate.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_startDate];
[self.contentView addSubview:_startDate];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:Top];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:Left];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:Left];
NSLayoutConstraint *Width = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:65];
[self addConstraint:Width];
NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:right];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self addConstraint:Height];
[self.contentView addConstraint:Height];
}
return _startDate;
}
......@@ -97,19 +81,20 @@
_overDate.font = [UIFont systemFontOfSize:15.0];
_overDate.textColor = kOnLineCompleteHeaderTextColor;
_overDate.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_overDate];
[self.contentView addSubview:_overDate];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.startDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:Top];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:Left];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:Left];
NSLayoutConstraint *Width = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:65];
[self addConstraint:Width];
NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:right];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self addConstraint:Height];
[self.contentView addConstraint:Height];
}
return _overDate;
}
......@@ -121,90 +106,47 @@
_taskContent.font = [UIFont systemFontOfSize:15.0];
_taskContent.textColor = kOnLineCompleteHeaderTextColor;
_taskContent.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_taskContent];
[self.contentView addSubview:_taskContent];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_taskContent attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:Top];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_taskContent attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:Left];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_taskContent attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:Left];
NSLayoutConstraint *Width = [NSLayoutConstraint constraintWithItem:_taskContent attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:65];
[self addConstraint:Width];
NSLayoutConstraint *Width = [NSLayoutConstraint constraintWithItem:_taskContent attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:80];
[self.contentView addConstraint:Width];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_taskContent attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self addConstraint:Height];
[self.contentView addConstraint:Height];
}
return _taskContent;
}
- (UILabel *)startDateLabel
{
if (!_startDateLabel) {
_startDateLabel = [[UILabel alloc] init];
_startDateLabel.font = [UIFont systemFontOfSize:15.0];
_startDateLabel.textColor = kLightBlack;
_startDateLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_startDateLabel];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_startDateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_startDateLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.startDate attribute:NSLayoutAttributeRight multiplier:1.0 constant:15];
[self addConstraint:Left];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_startDateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self addConstraint:Height];
}
return _startDateLabel;
}
- (UILabel *)overDateLabel
{
if (!_overDateLabel) {
_overDateLabel = [[UILabel alloc] init];
_overDateLabel.font = [UIFont systemFontOfSize:15.0];
_overDateLabel.textColor = kLightBlack;
_overDateLabel.textAlignment = NSTextAlignmentLeft;
_overDateLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_overDateLabel];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_overDateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.startDateLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_overDateLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:100];
[self addConstraint:Left];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_overDateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self addConstraint:Height];
}
return _overDateLabel;
}
- (UIButton *)unfoldBtn
{
if (!_unfoldBtn) {
_unfoldBtn = [[UIButton alloc] init];
_unfoldBtn.titleLabel.font = [UIFont systemFontOfSize:13.0];
[_unfoldBtn setTitle:@"展开" forState:UIControlStateNormal];
[_unfoldBtn setTitleColor:kLightGray forState:UIControlStateNormal];
_unfoldBtn.tag = 2001;
_unfoldBtn.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_unfoldBtn];
[self.contentView addSubview:_unfoldBtn];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_unfoldBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:2];
[self addConstraint:overDateTop];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_unfoldBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateWidth = [NSLayoutConstraint constraintWithItem:_unfoldBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:32];
[self addConstraint:overDateWidth];
[self.contentView addConstraint:overDateWidth];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:_unfoldBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.arrowImageView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self addConstraint:overDateRight];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint constraintWithItem:_unfoldBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self addConstraint:overDateHeight];
[self.contentView addConstraint:overDateHeight];
}
return _unfoldBtn;
}
......@@ -214,48 +156,54 @@
if (!_arrowImageView) {
_arrowImageView = [[UIImageView alloc] init];
_arrowImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_arrowImageView];
_arrowImageView.image = [UIImage imageNamed:@"grey-trilateral_down"];
[self.contentView addSubview:_arrowImageView];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:10];
[self addConstraint:Top];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:8];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:Right];
NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:Right];
NSLayoutConstraint *width = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:11];
[self addConstraint:width];
[self.contentView addConstraint:width];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:8];
[self addConstraint:Height];
[self.contentView addConstraint:Height];
}
return _arrowImageView;
}
- (UILabel *)taskDetailLabel
{
if (!_taskDetailLabel) {
_taskDetailLabel = [[UILabel alloc] init];
_taskDetailLabel.font = [UIFont systemFontOfSize:15.0];
_taskDetailLabel.numberOfLines = 0;
_taskDetailLabel.textColor = kOnLineCompleteHeaderTextColor;
_taskDetailLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_taskDetailLabel];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_taskDetailLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.taskContent attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_taskDetailLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:Left];
NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:_taskDetailLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:right];
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint constraintWithItem:_taskDetailLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-10];
[self.contentView addConstraint:overDateBottom];
_taskDetailLabel.text = @"";
}
return _taskDetailLabel;
}
//- (UILabel *)taskContentLabel
//{
// if (!_taskContentLabel) {
// _taskContentLabel = [[UILabel alloc] init];
// _taskContentLabel.font = [UIFont systemFontOfSize:15.0];
// _taskContentLabel.textColor = kLightBlack;
// _taskContentLabel.textAlignment = NSTextAlignmentLeft;
// _taskContentLabel.translatesAutoresizingMaskIntoConstraints = NO;
// [self addSubview:_taskContentLabel];
//
// NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_taskContentLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDateLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:5];
// [self addConstraint:Top];
//
// NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_taskContentLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:100];
// [self addConstraint:Left];
//
// NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_taskContentLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self addConstraint:Right];
//
// NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_taskContentLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
// [self addConstraint:Height];
// }
// return _taskContentLabel;
//}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@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