Commit cc721218 authored by admin's avatar admin

修改bug

parent eb9daac3
......@@ -76,6 +76,10 @@
84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D80EB41BF714BE00A10EA4 /* GroupTabBar.m */; };
84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8257E1BDD2F7E00CC61F7 /* MineTableFooterView.m */; };
84D825821BDD35E000CC61F7 /* HomeHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D825811BDD35E000CC61F7 /* HomeHeaderView.m */; };
84DAB3EA1C07605F00F3E416 /* InspectNoUpLoadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DAB3E91C07605F00F3E416 /* InspectNoUpLoadViewController.m */; };
84DAB3ED1C07645F00F3E416 /* InspectPointCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DAB3EC1C07645F00F3E416 /* InspectPointCell.m */; };
84DAB3F01C076C2E00F3E416 /* InpectPictureCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DAB3EF1C076C2E00F3E416 /* InpectPictureCell.m */; };
84DAB3F61C0802FD00F3E416 /* FuncItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DAB3F51C0802FD00F3E416 /* FuncItem.m */; };
84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */; };
84DB9BC71BDCD67200822CC4 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC61BDCD67200822CC4 /* UIView+Extension.m */; };
84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E0ABCC1BFB082E001C8F45 /* TaskDetailModel.m */; };
......@@ -258,6 +262,14 @@
84D8257E1BDD2F7E00CC61F7 /* MineTableFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineTableFooterView.m; sourceTree = "<group>"; };
84D825801BDD35E000CC61F7 /* HomeHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeHeaderView.h; sourceTree = "<group>"; };
84D825811BDD35E000CC61F7 /* HomeHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeHeaderView.m; sourceTree = "<group>"; };
84DAB3E81C07605F00F3E416 /* InspectNoUpLoadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectNoUpLoadViewController.h; sourceTree = "<group>"; };
84DAB3E91C07605F00F3E416 /* InspectNoUpLoadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectNoUpLoadViewController.m; sourceTree = "<group>"; };
84DAB3EB1C07645F00F3E416 /* InspectPointCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectPointCell.h; sourceTree = "<group>"; };
84DAB3EC1C07645F00F3E416 /* InspectPointCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectPointCell.m; sourceTree = "<group>"; };
84DAB3EE1C076C2E00F3E416 /* InpectPictureCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InpectPictureCell.h; sourceTree = "<group>"; };
84DAB3EF1C076C2E00F3E416 /* InpectPictureCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InpectPictureCell.m; sourceTree = "<group>"; };
84DAB3F41C0802FD00F3E416 /* FuncItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FuncItem.h; sourceTree = "<group>"; };
84DAB3F51C0802FD00F3E416 /* FuncItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FuncItem.m; sourceTree = "<group>"; };
84DB9BC21BDCD4B600822CC4 /* CustomDropMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomDropMenuView.h; sourceTree = "<group>"; };
84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomDropMenuView.m; sourceTree = "<group>"; };
84DB9BC51BDCD67200822CC4 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; };
......@@ -642,6 +654,7 @@
8486999B1BDF810900859DFE /* Inspect */ = {
isa = PBXGroup;
children = (
84DAB3E41C07600000F3E416 /* InspectionPoint */,
84CF0ECA1BE9A7EF00C855CE /* InspectDetail */,
8486999C1BDF810900859DFE /* InspectList */,
848699A51BDF810900859DFE /* InspectTask */,
......@@ -1122,6 +1135,8 @@
84C957511BDB54BB00083584 /* View */ = {
isa = PBXGroup;
children = (
84DAB3F41C0802FD00F3E416 /* FuncItem.h */,
84DAB3F51C0802FD00F3E416 /* FuncItem.m */,
);
path = View;
sourceTree = "<group>";
......@@ -1178,6 +1193,19 @@
path = View;
sourceTree = "<group>";
};
84DAB3E41C07600000F3E416 /* InspectionPoint */ = {
isa = PBXGroup;
children = (
84DAB3E81C07605F00F3E416 /* InspectNoUpLoadViewController.h */,
84DAB3E91C07605F00F3E416 /* InspectNoUpLoadViewController.m */,
84DAB3EB1C07645F00F3E416 /* InspectPointCell.h */,
84DAB3EC1C07645F00F3E416 /* InspectPointCell.m */,
84DAB3EE1C076C2E00F3E416 /* InpectPictureCell.h */,
84DAB3EF1C076C2E00F3E416 /* InpectPictureCell.m */,
);
path = InspectionPoint;
sourceTree = "<group>";
};
84DB9BC11BDCD49900822CC4 /* CustomDropMenu */ = {
isa = PBXGroup;
children = (
......@@ -1568,6 +1596,8 @@
840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */,
8497B62B1C043671007ECBE6 /* InspectTableView.m in Sources */,
84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */,
84DAB3ED1C07645F00F3E416 /* InspectPointCell.m in Sources */,
84DAB3F01C076C2E00F3E416 /* InpectPictureCell.m in Sources */,
841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */,
84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */,
846206BB1C06AFF50015C456 /* RankCommentCell.m in Sources */,
......@@ -1637,8 +1667,10 @@
84AD4F461BF4A9E800BFB37C /* RankHeadView.m in Sources */,
84E420411BE849FC00689976 /* QuestionDescribeCell.m in Sources */,
84DB9BC71BDCD67200822CC4 /* UIView+Extension.m in Sources */,
84DAB3EA1C07605F00F3E416 /* InspectNoUpLoadViewController.m in Sources */,
8462C6EC1BF5F3BE00344DDD /* MenuButton.m in Sources */,
8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */,
84DAB3F61C0802FD00F3E416 /* FuncItem.m in Sources */,
84D3E6021C04DA85001FF1DD /* InspectUpLoadFootView.m in Sources */,
8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */,
8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_00@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_00@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_01@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_01@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_02@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_02@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_03@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_03@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_04@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_04@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_05@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_05@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
//
// FuncItem.h
// redstar
//
// Created by admin on 15/11/27.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FuncItem : UIButton
@end
//
// FuncItem.m
// redstar
//
// Created by admin on 15/11/27.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "FuncItem.h"
@implementation FuncItem
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
self.imageView.contentMode = UIViewContentModeCenter;
[self setTitleColor:kHomeItemTextColor forState:UIControlStateNormal];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.font = [UIFont systemFontOfSize:15];
[self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[self setTitleColor:[UIColor orangeColor] forState:UIControlStateSelected];
self.layer.borderWidth = 0.5;
self.layer.borderColor = kLineCGColor;
}
return self;
}
- (void)layoutSubviews
{
[super layoutSubviews];
CGFloat btnW = self.width;
CGFloat btnH = self.height;
CGFloat imageH = btnH * 0.7;
self.imageView.frame = CGRectMake(0, 7, btnW, imageH);
CGFloat titleH = btnH - imageH;
CGFloat titleY = imageH - 5;
self.titleLabel.frame = CGRectMake(0, titleY, btnW, titleH);
}
@end
......@@ -7,7 +7,13 @@
//
#import <UIKit/UIKit.h>
#import "FuncItem.h"
@interface AnnounceViewController : UIViewController
@property (nonatomic, strong) FuncItem *onLineSamplingBtn; // 在线抽查按钮
@property (nonatomic, strong) FuncItem *wordOfMouthBtn; // 口碑按钮
@property (nonatomic, strong) FuncItem *standardBtn; // 口碑标准按钮
@property (nonatomic, strong) FuncItem *pictureBtn; // 图说口碑按钮
@property (nonatomic, strong) FuncItem *questionBtn; // 问题与知识按钮
@property (nonatomic, strong) FuncItem *caseBtn; // 优秀案例按钮
@end
......@@ -7,9 +7,15 @@
//
#import "AnnounceViewController.h"
#import "InspectListViewController.h"
#import "RankingListViewController.h"
#import "PictureViewController.h"
#import "QuestionViewController.h"
@interface AnnounceViewController ()
@interface AnnounceViewController ()
@property (nonatomic, strong) UIView *lineView;
@end
@implementation AnnounceViewController
......@@ -19,14 +25,247 @@
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"公告"];
[customLab setText:@"功能"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
self.view.backgroundColor = [UIColor orangeColor];
// Do any additional setup after loading the view.
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
[self setup];
}
#pragma mark - Private Methods
- (void)setup
{
[self.onLineSamplingBtn setTitle:@"在线抽查" forState:UIControlStateNormal];
[self.wordOfMouthBtn setTitle:@"口碑巡检" forState:UIControlStateNormal];
[self.standardBtn setTitle:@"口碑标准" forState:UIControlStateNormal];
[self.pictureBtn setTitle:@"图说口碑" forState:UIControlStateNormal];
[self.questionBtn setTitle:@"问题与知识" forState:UIControlStateNormal];
[self.caseBtn setTitle:@"优秀案例" forState:UIControlStateNormal];
self.lineView.backgroundColor = kSeparateLineViewColor;
}
- (void)itemClick:(FuncItem *)sender
{
FuncItem *item = (FuncItem *)sender;
UINavigationController *nav;
if ([item.titleLabel.text isEqualToString:@"在线抽查"]) {
return;
} else if ([item.titleLabel.text isEqualToString:@"口碑巡检"]) {
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
return;
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
PictureViewController *pictureVC = [[PictureViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:pictureVC];
} else if ([item.titleLabel.text isEqualToString:@"问题与知识"]) {
QuestionViewController *questionVC = [[QuestionViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:questionVC];
} else if ([item.titleLabel.text isEqualToString:@"优秀案例"]) {
RankingListViewController *rankingListVC = [[RankingListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:rankingListVC];
} else {
return;
}
[nav.navigationBar setBarTintColor:kNavigationBarColor];
[nav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
[self presentViewController:nav animated:YES completion:nil];
}
#pragma mark - lazy loading
- (FuncItem *)onLineSamplingBtn
{
if (!_onLineSamplingBtn) {
_onLineSamplingBtn = [[FuncItem alloc] init];
_onLineSamplingBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_onLineSamplingBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[_onLineSamplingBtn setImage:[UIImage imageNamed:@"task_000"] forState:UIControlStateNormal];
[self.view addSubview:_onLineSamplingBtn];
NSLayoutConstraint *onLineSamplingTop = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:onLineSamplingTop];
NSLayoutConstraint *onLineSamplingLeft = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:onLineSamplingLeft];
NSLayoutConstraint *onLineSamplingWidth = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.wordOfMouthBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.view addConstraint:onLineSamplingWidth];
NSLayoutConstraint *onLineSamplingRight = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.wordOfMouthBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:onLineSamplingRight];
NSLayoutConstraint *onLineSamplingHeight = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:119];
[self.view addConstraint:onLineSamplingHeight];
}
return _onLineSamplingBtn;
}
- (FuncItem *)wordOfMouthBtn
{
if (!_wordOfMouthBtn) {
_wordOfMouthBtn = [[FuncItem alloc] init];
[_wordOfMouthBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[_wordOfMouthBtn setImage:[UIImage imageNamed:@"task_001"] forState:UIControlStateNormal];
_wordOfMouthBtn.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_wordOfMouthBtn];
NSLayoutConstraint *wordOfMouthTop = [NSLayoutConstraint constraintWithItem:_wordOfMouthBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:wordOfMouthTop];
NSLayoutConstraint *wordOfMouthRight = [NSLayoutConstraint constraintWithItem:_wordOfMouthBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.standardBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:wordOfMouthRight];
NSLayoutConstraint *wordOfMouthWithd = [NSLayoutConstraint constraintWithItem:_wordOfMouthBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.standardBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.view addConstraint:wordOfMouthWithd];
NSLayoutConstraint *wordOfMouthHeight = [NSLayoutConstraint constraintWithItem:_wordOfMouthBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_onLineSamplingBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.view addConstraint:wordOfMouthHeight];
}
return _wordOfMouthBtn;
}
- (FuncItem *)standardBtn
{
if (!_standardBtn) {
_standardBtn = [[FuncItem alloc] init];
[_standardBtn setImage:[UIImage imageNamed:@"task_002"] forState:UIControlStateNormal];
_standardBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_standardBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_standardBtn];
NSLayoutConstraint *standardRight = [NSLayoutConstraint constraintWithItem:_standardBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:standardRight];
NSLayoutConstraint *standardHeight = [NSLayoutConstraint constraintWithItem:_standardBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_wordOfMouthBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.view addConstraint:standardHeight];
NSLayoutConstraint *standardTop = [NSLayoutConstraint constraintWithItem:_standardBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:standardTop];
}
return _standardBtn;
}
- (FuncItem *)pictureBtn
{
if (!_pictureBtn) {
_pictureBtn = [[FuncItem alloc] init];
[_pictureBtn setImage:[UIImage imageNamed:@"task_003"] forState:UIControlStateNormal];
_pictureBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_pictureBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_pictureBtn];
NSLayoutConstraint *pictureTop = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.onLineSamplingBtn attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:pictureTop];
NSLayoutConstraint *pictureLeft = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:pictureLeft];
NSLayoutConstraint *pictureRight = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.questionBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:pictureRight];
NSLayoutConstraint *pictureWidth = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.questionBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.view addConstraint:pictureWidth];
NSLayoutConstraint *pictureHeight = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.onLineSamplingBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.view addConstraint:pictureHeight];
}
return _pictureBtn;
}
- (FuncItem *)questionBtn
{
if (!_questionBtn) {
_questionBtn = [[FuncItem alloc] init];
[_questionBtn setImage:[UIImage imageNamed:@"task_004"] forState:UIControlStateNormal];
_questionBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_questionBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_questionBtn];
NSLayoutConstraint *questionWidth = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.caseBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.view addConstraint:questionWidth];
NSLayoutConstraint *questionRight = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.caseBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:questionRight];
NSLayoutConstraint *questionTop = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_pictureBtn attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:questionTop];
NSLayoutConstraint *questionHeight = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_pictureBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.view addConstraint:questionHeight];
}
return _questionBtn;
}
- (FuncItem *)caseBtn
{
if (!_caseBtn) {
_caseBtn = [[FuncItem alloc] init];
[_caseBtn setImage:[UIImage imageNamed:@"task_005"] forState:UIControlStateNormal];
_caseBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_caseBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_caseBtn];
NSLayoutConstraint *caseTop = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_questionBtn attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:caseTop];
NSLayoutConstraint *caseRight = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:caseRight];
NSLayoutConstraint *caseHeight = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_questionBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.view addConstraint:caseHeight];
}
return _caseBtn;
}
- (UIView *)lineView
{
if (!_lineView) {
_lineView = [[UIView alloc] init];
_lineView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_lineView];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:lineViewLeft];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:lineViewRight];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.caseBtn attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:lineViewTop];
NSLayoutConstraint *lineViewHeight = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:1];
[self.view addConstraint:lineViewHeight];
}
return _lineView;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -69,6 +69,11 @@
_placeholderLabel2.hidden = NO;
}
if ([text isEqualToString:@"\n"]) {
[self.contentTextView resignFirstResponder];
return NO;
}
return YES;
}
......@@ -269,8 +274,12 @@
return _sureBtn;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self endEditing:YES];
if (![self.contentTextView isExclusiveTouch]) {
[self.contentTextView resignFirstResponder];
}
}
@end
......@@ -64,6 +64,11 @@
_placeholderLabel2.hidden = NO;
}
if ([text isEqualToString:@"\n"]) {
[self.contentTextView resignFirstResponder];
return NO;
}
return YES;
}
......
......@@ -114,6 +114,11 @@
}
}
if ([text isEqualToString:@"\n"]) {
[self.contentTextView resignFirstResponder];
return NO;
}
return YES;
}
......
......@@ -119,6 +119,12 @@
}
}
if ([text isEqualToString:@"\n"]) {
[self.titleTextView resignFirstResponder];
[self.contentTextView resignFirstResponder];
return NO;
}
return YES;
}
......
......@@ -138,7 +138,6 @@
_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];
......
......@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
@interface SearchToolBar : UIView
@interface SearchToolBar : UIView <UITextFieldDelegate>
@property (nonatomic, strong) UITextField *searchTextFiled; // 搜索框
@property (nonatomic, strong) UIButton *queryButton; // 快速查询按钮
......
......@@ -45,6 +45,7 @@
{
if (!_searchTextFiled) {
_searchTextFiled = [[UITextField alloc] init];
_searchTextFiled.delegate = self;
_searchTextFiled.font = [UIFont systemFontOfSize:14.0];
_searchTextFiled.backgroundColor = [UIColor whiteColor];
_searchTextFiled.translatesAutoresizingMaskIntoConstraints = NO;
......@@ -108,4 +109,12 @@
return _queryButton;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
if ([textField resignFirstResponder]) {
return YES;
}
return NO;
}
@end
......@@ -729,6 +729,16 @@
return _noDataView;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if (![_screenView.textView isExclusiveTouch]) {
[_screenView.textView resignFirstResponder];
}
if (![self.searchBar.searchTextFiled isExclusiveTouch]) {
[self.searchBar.searchTextFiled resignFirstResponder];
}
}
/*
#pragma mark - Navigation
......
......@@ -88,6 +88,13 @@
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
_placeholderLabel2.hidden = NO;
}
if ([text isEqualToString:@"\n"]) {
[self.contentTextView resignFirstResponder];
return NO;
}
return YES;
}
......
......@@ -302,10 +302,12 @@
return _footerView;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
if (![_footerView.contentTextView isExclusiveTouch]) {
[self.footerView.contentTextView resignFirstResponder];
}
}
/*
#pragma mark - Navigation
......
......@@ -679,4 +679,12 @@
return _noDataView;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if (![_screenView.textView isExclusiveTouch]) {
[_screenView.textView resignFirstResponder];
}
}
@end
......@@ -22,6 +22,7 @@
#import "InspectNotUploadViewController.h"
#import "InspectUploadedViewController.h"
#import "InspectNoUpLoadViewController.h"
#define kTaskSortCell @"InspectTaskSortCell"
......@@ -166,6 +167,9 @@
TaskModel *task = taskGroup.answers[indexPath.row];
if (task.state == 0) {
//InspectNoUpLoadViewController *inspectNotVC = [[InspectNoUpLoadViewController alloc] init];
InspectNotUploadViewController *inspectNotVC = [[InspectNotUploadViewController alloc] init];
inspectNotVC.questionCount = taskGroup.questionCount;
inspectNotVC.taskModel = task;
......
//
// InpectPictureCell.h
// redstar
//
// Created by admin on 15/11/27.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface InpectPictureCell : UITableViewCell
@property (nonatomic, strong) UIButton *photoButton;
@property (nonatomic, strong) NSLayoutConstraint *overDateLeft;
@property (nonatomic, strong) NSLayoutConstraint *overDateRight;
@end
//
//
// redstar
//
// Created by admin on 15/11/27.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InpectPictureCell.h"
@implementation InpectPictureCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
#pragma mark - Private Methods
- (void)setup
{
}
- (UIButton *)photoButton
{
if (!_photoButton) {
_photoButton = [[UIButton alloc] init];
_photoButton.translatesAutoresizingMaskIntoConstraints = NO;
_photoButton.backgroundColor = [UIColor redColor];
[self.contentView addSubview:_photoButton];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint
constraintWithItem:_photoButton
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeTop
multiplier:1.0
constant:5];
[self.contentView addConstraint:overDateTop];
self.overDateLeft = [NSLayoutConstraint
constraintWithItem:_photoButton
attribute:NSLayoutAttributeLeft
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeLeft
multiplier:1.0
constant:20];
[self.contentView addConstraint:_overDateLeft];
self.overDateRight = [NSLayoutConstraint
constraintWithItem:_photoButton
attribute:NSLayoutAttributeRight
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeRight
multiplier:1.0
constant:-(kScreenWidth / 2 + 10)];
[self.contentView addConstraint:_overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
constraintWithItem:_photoButton
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1.0
constant:90];
[self.contentView addConstraint:overDateHeight];
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint
constraintWithItem:_photoButton
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeBottom
multiplier:1.0
constant:-5];
[self.contentView addConstraint:overDateBottom];
}
return _photoButton;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// InspectNoUpLoadViewController.h
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TaskModel.h"
@interface InspectNoUpLoadViewController : UIViewController
@property (nonatomic, assign) int questionCount;
@property (nonatomic, strong) TaskModel *taskModel;
@property(nonatomic, strong) NSString *store_uuid;
@property (nonatomic, strong) NSString *uuid; // 口碑巡检uuid
@property (nonatomic, strong) NSString *praiseUuid;
@property (nonatomic, strong) NSString *questionUuid;
@end
//
// InspectNoUpLoadViewController.m
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectNoUpLoadViewController.h"
#import "InspectPointCell.h"
#import "InpectPictureCell.h"
#define kImageW (kScreenWidth - kSpaceX * 3) / 2
#define kSpaceX 20
#define kInspectPointCell @"InspectPointCell"
@interface InspectNoUpLoadViewController () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, assign) int rowNumber;
@property (nonatomic, assign) int random;
@property (nonatomic, assign) BOOL isFull;
@end
@implementation InspectNoUpLoadViewController
- (void)viewDidLoad
{
[super viewDidLoad];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
[customLab setTextColor:[UIColor whiteColor]];
customLab.textAlignment = NSTextAlignmentCenter;
[customLab setText:[NSString stringWithFormat:@"检查点--%@(%@/%d)", self.taskModel.category, self.taskModel.lineNo, self.questionCount]];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
[self.tableView registerClass:[InspectPointCell class] forCellReuseIdentifier:kInspectPointCell];
_rowNumber = 3;
_isFull = NO;
_random = 0;
}
#pragma mark - private methods
// 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)reloadTableView:(UIButton *)sender
{
// sender.selected = !sender.selected;
// if (sender.selected) {
// UIButton *addBtn = [[UIButton alloc] init];
// addBtn.translatesAutoresizingMaskIntoConstraints = NO;
// addBtn.layer.borderWidth = 0.5;
// addBtn.backgroundColor = [UIColor greenColor];
// addBtn.layer.borderColor = kSeparateLineCGColor;
// // 添加长按手势,用作删除. 加号按钮不添加
// UILongPressGestureRecognizer *gester = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
// [addBtn addGestureRecognizer:gester];
// [cell.contentView addSubview:addBtn];
//
// NSLayoutConstraint *overDateTop = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeTop
// relatedBy:NSLayoutRelationEqual
// toItem:cell.contentView
// attribute:NSLayoutAttributeTop
// multiplier:1.0
// constant:5];
// [cell.contentView addConstraint:overDateTop];
//
// NSLayoutConstraint *overDateLeft = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeLeft
// relatedBy:NSLayoutRelationEqual
// toItem:cell.contentView
// attribute:NSLayoutAttributeLeft
// multiplier:1.0
// constant:20];
// [cell.contentView addConstraint:overDateLeft];
//
// NSLayoutConstraint *overDateRight = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeRight
// relatedBy:NSLayoutRelationEqual
// toItem:cell.contentView
// attribute:NSLayoutAttributeCenterX
// multiplier:1.0
// constant:-10];
// [cell.contentView addConstraint:overDateRight];
//
// NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeHeight
// relatedBy:NSLayoutRelationEqual
// toItem:nil
// attribute:NSLayoutAttributeNotAnAttribute
// multiplier:1.0
// constant:90];
// [cell.contentView addConstraint:overDateHeight];
//
// NSLayoutConstraint *overDateBottom = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeBottom
// relatedBy:NSLayoutRelationEqual
// toItem:cell.contentView
// attribute:NSLayoutAttributeBottom
// multiplier:1.0
// constant:-5];
// [cell.contentView addConstraint:overDateBottom];
//
// cell.overDateLeft.constant = kScreenWidth / 2 + 10;
// cell.overDateRight.constant = - 20;
// [UIView animateWithDuration:0.3 animations:^{
// [cell.contentView layoutIfNeeded];
// }];
// } else {
// UIButton *addBtn = [[UIButton alloc] init];
// addBtn.translatesAutoresizingMaskIntoConstraints = NO;
// addBtn.layer.borderWidth = 0.5;
// addBtn.backgroundColor = [UIColor greenColor];
// addBtn.layer.borderColor = kSeparateLineCGColor;
// // 添加长按手势,用作删除. 加号按钮不添加
// UILongPressGestureRecognizer *gester = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
// [addBtn addGestureRecognizer:gester];
// [cell.contentView addSubview:addBtn];
//
// NSLayoutConstraint *overDateTop = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeTop
// relatedBy:NSLayoutRelationEqual
// toItem:cell.contentView
// attribute:NSLayoutAttributeTop
// multiplier:1.0
// constant:5];
// [cell.contentView addConstraint:overDateTop];
//
// NSLayoutConstraint *overDateLeft = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeLeft
// relatedBy:NSLayoutRelationEqual
// toItem:cell.contentView
// attribute:NSLayoutAttributeLeft
// multiplier:1.0
// constant:kScreenWidth / 2 + 10];
// [cell.contentView addConstraint:overDateLeft];
//
// NSLayoutConstraint *overDateRight = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeRight
// relatedBy:NSLayoutRelationEqual
// toItem:cell.contentView
// attribute:NSLayoutAttributeRight
// multiplier:1.0
// constant:- 20];
// [cell.contentView addConstraint:overDateRight];
//
// NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeHeight
// relatedBy:NSLayoutRelationEqual
// toItem:nil
// attribute:NSLayoutAttributeNotAnAttribute
// multiplier:1.0
// constant:90];
// [cell.contentView addConstraint:overDateHeight];
//
// NSLayoutConstraint *overDateBottom = [NSLayoutConstraint
// constraintWithItem:addBtn
// attribute:NSLayoutAttributeBottom
// relatedBy:NSLayoutRelationEqual
// toItem:cell.contentView
// attribute:NSLayoutAttributeBottom
// multiplier:1.0
// constant:-5];
// [cell.contentView addConstraint:overDateBottom];
//
// [cell.photoButton removeFromSuperview];
// cell.photoButton = nil;
// _rowNumber += 1;
// [self.tableView reloadData];
//
// }
InpectPictureCell *cell = (InpectPictureCell *)[[sender superview] superview];
if (_isFull) {
UIButton *addBtn = [[UIButton alloc] init];
addBtn.translatesAutoresizingMaskIntoConstraints = NO;
addBtn.layer.borderWidth = 0.5;
addBtn.backgroundColor = [UIColor greenColor];
addBtn.layer.borderColor = kSeparateLineCGColor;
// 添加长按手势,用作删除. 加号按钮不添加
UILongPressGestureRecognizer *gester = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
[addBtn addGestureRecognizer:gester];
[cell.contentView addSubview:addBtn];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeTop
multiplier:1.0
constant:5];
[cell.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeLeft
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeLeft
multiplier:1.0
constant:kScreenWidth / 2 + 10];
[cell.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeRight
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeRight
multiplier:1.0
constant:- 20];
[cell.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1.0
constant:90];
[cell.contentView addConstraint:overDateHeight];
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeBottom
multiplier:1.0
constant:-5];
[cell.contentView addConstraint:overDateBottom];
cell.photoButton.hidden = YES;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:_rowNumber inSection:0];
_rowNumber += 1;
NSArray *indexArray = @[indexPath];
[self.tableView beginUpdates];
[self.tableView insertRowsAtIndexPaths:indexArray withRowAnimation:UITableViewRowAnimationFade];
[self.tableView endUpdates];
} else {
UIButton *addBtn = [[UIButton alloc] init];
addBtn.translatesAutoresizingMaskIntoConstraints = NO;
addBtn.layer.borderWidth = 0.5;
addBtn.backgroundColor = [UIColor greenColor];
addBtn.layer.borderColor = kSeparateLineCGColor;
// 添加长按手势,用作删除. 加号按钮不添加
UILongPressGestureRecognizer *gester = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
[addBtn addGestureRecognizer:gester];
[cell.contentView addSubview:addBtn];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeTop
multiplier:1.0
constant:5];
[cell.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeLeft
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeLeft
multiplier:1.0
constant:20];
[cell.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeRight
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeCenterX
multiplier:1.0
constant:-10];
[cell.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1.0
constant:90];
[cell.contentView addConstraint:overDateHeight];
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint
constraintWithItem:addBtn
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeBottom
multiplier:1.0
constant:-5];
[cell.contentView addConstraint:overDateBottom];
cell.overDateLeft.constant = kScreenWidth / 2 + 10;
cell.overDateRight.constant = - 20;
[UIView animateWithDuration:0.3 animations:^{
[cell.contentView layoutIfNeeded];
}];
}
_isFull = !_isFull;
}
- (void)longPress:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
// 获取到点击的显示图片的按钮
UIButton *showButton = (UIButton *)gestureRecognizer.view;
// 创建长按删除的按钮
UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
deleteButton.backgroundColor = [UIColor redColor];
// deleteButton.bounds = CGRectMake(0, 0, deleImageWH, deleImageWH);
// [deleteButton setImage:[UIImage imageNamed:kAdeleImage] forState:UIControlStateNormal];
[deleteButton addTarget:self action:@selector(deletePicture:) forControlEvents:UIControlEventTouchUpInside];
deleteButton.frame = CGRectMake(showButton.frame.size.width - deleteButton.frame.size.width, 0, deleteButton.frame.size.width, deleteButton.frame.size.height);
[showButton addSubview:deleteButton];
}
}
- (void)deletePicture:(UIButton *)button
{
// 从存放所有Image的数组里移除当前点击的Image
// [self.footerView.takePhotoView.allImages removeObject:[(UIButton *)button.superview imageForState:UIControlStateNormal]];
// 移除显示Image的Button
[button.superview removeFromSuperview];
NSString *imageName = @"";
//_imageNameArray[button.superview.tag - 1];
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
NSFileManager* fileManager = [NSFileManager defaultManager];
BOOL blHave=[[NSFileManager defaultManager] fileExistsAtPath:fullPath];
if (!blHave) {
return ;
} else {
BOOL blDele= [fileManager removeItemAtPath:fullPath error:nil];
if (blDele) {
NSLog(@"dele success");
}else {
NSLog(@"dele fail");
}
}
}
#pragma mark - TableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _rowNumber;
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row < 2) {
InspectPointCell *cell=[tableView dequeueReusableCellWithIdentifier:kInspectPointCell];
if (!cell) {
cell = [[InspectPointCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectPointCell];
}
if (indexPath.row == 0) {
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _taskModel.title];
cell.detailLabel.text = [NSString stringWithFormat:@"要求图片%d张", _taskModel.attachmentNumber];
} else {
cell.titleLabel.text = @"参考说明";
cell.detailLabel.text = [NSString stringWithFormat:@"%@", _taskModel.reference];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
NSString *identifier = [NSString stringWithFormat:@"InspectPictureCell%d", _random++];
InpectPictureCell *cell=[tableView dequeueReusableCellWithIdentifier:identifier];
if (!cell) {
cell = [[InpectPictureCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
}
[cell.photoButton addTarget:self action:@selector(reloadTableView:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
// section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 300.0;
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[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;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// InspectPointCell.h
// redstar
//
// Created by admin on 15/11/27.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface InspectPointCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *detailLabel;
@end
//
// InspectPointCell.m
// redstar
//
// Created by admin on 15/11/27.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectPointCell.h"
@implementation InspectPointCell
#pragma - lazy loading
- (UILabel *)titleLabel
{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_titleLabel.font = [UIFont systemFontOfSize:15.0];
_titleLabel.textColor = kLightGray;
[self.contentView addSubview:_titleLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateWidth = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:23];
[self.contentView addConstraint:overDateWidth];
}
return _titleLabel;
}
- (UILabel *)detailLabel
{
if (!_detailLabel) {
_detailLabel = [[UILabel alloc] init];
_detailLabel.translatesAutoresizingMaskIntoConstraints = NO;
_detailLabel.font = [UIFont systemFontOfSize:15.0];
_detailLabel.textColor = kLightBlack;
_detailLabel.numberOfLines = 0;
[self.contentView addSubview:_detailLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_detailLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:2];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_detailLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:_detailLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint constraintWithItem:_detailLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self.contentView addConstraint:overDateBottom];
}
return _detailLabel;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -50,7 +50,7 @@
UIButton *bgButton = [UIButton buttonWithType:UIButtonTypeCustom];
bgButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
bgButton.contentEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 10);
bgButton.titleEdgeInsets = UIEdgeInsetsMake(0, 45, 0, 0);
bgButton.titleEdgeInsets = UIEdgeInsetsMake(0, 30, 0, 0);
[bgButton setTitleColor:kLightBlack forState:UIControlStateNormal];
bgButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
[bgButton addTarget:self action:@selector(headBtnClick) forControlEvents:UIControlEventTouchUpInside];
......
......@@ -30,17 +30,16 @@
CGFloat btnW = self.width;
CGFloat btnH = self.height;
CGFloat imageH = btnH * 0.7;
self.imageView.frame = CGRectMake(0, 7, btnW, imageH);
self.imageView.frame = CGRectMake((btnW - 45) / 2 , 13, 45, 45);
CGFloat titleH = btnH - imageH;
CGFloat titleY = imageH - 5;
CGFloat titleH = btnH - 55;
CGFloat titleY = 61;
self.titleLabel.frame = CGRectMake(0, titleY, btnW, titleH);
// // 设置badgeView尺寸
// self.badgeView.x = self.width - self.badgeView.width - HMMargin;
//
// self.badgeView.y = 0;
// // 设置badgeView尺寸
// self.badgeView.x = self.width - self.badgeView.width - HMMargin;
//
// self.badgeView.y = 0;
}
......
......@@ -85,7 +85,7 @@
- (UIScrollView *)scrollView
{
if (!_scrollView) {
_scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 120)];
_scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 86)];
_scrollView.bounces = NO;
_scrollView.backgroundColor = [UIColor whiteColor];
_scrollView.pagingEnabled = YES;
......
......@@ -240,7 +240,7 @@
self.bgImageView.image = image;
self.searchTextField.backgroundColor = [UIColor clearColor];
self.nameLabel.backgroundColor = [UIColor clearColor];
_nameLabel.text = @"东方明珠,你好!";
_nameLabel.text = @"超级管理员,你好!";
self.shopnameLabel.backgroundColor = [UIColor clearColor];
_shopnameLabel.text = @"上海真北店";
......@@ -248,16 +248,16 @@
- (void)setupTableView
{
self.headView = [[HomeHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 149)];
self.headView = [[HomeHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 115)];
self.headView.scrollView.contentSize = CGSizeMake(2 * kScreenWidth, 120);
CGFloat itemW = kScreenWidth / 3;
self.headView.scrollView.contentSize = CGSizeMake(2 * kScreenWidth, 86);
CGFloat itemW = kScreenWidth / 4;
CGFloat itemH = self.headView.scrollView.frame.size.height;
for (int i = 0; i < 6; i++) {
HomeCellItem *item = [[HomeCellItem alloc] init];
item.frame = CGRectMake(i * itemW, 0, itemW, itemH);
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"task_00%d", i]];
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"task_0%d", i]];
[item setImage:image forState:UIControlStateNormal];
[item setTitleColor:kPictureCellDetailsColor forState:UIControlStateNormal];
[item setTitle:[NSString stringWithFormat:@"%@", self.btnTitleArray[i]] forState:UIControlStateNormal];
......@@ -524,7 +524,7 @@
if (!cell) {
cell = [[RankCommentCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeRankingListCell];
}
RankListModel *rankListModel = _rankData[indexPath.section];
RankListModel *rankListModel = _rankData[indexPath.section - 2];
RankCommentModel *commentModel = rankListModel.comments[indexPath.row];
cell.rankComment = commentModel;
return cell;
......@@ -560,9 +560,9 @@
[self.navigationController pushViewController:inspectTaskVC animated:YES];
} else {
RankListModel *rankList = _rankData[indexPath.section];
RankListModel *rankList = _rankData[indexPath.section - 2];
RankDetailViewController *rankDetailVC = [[RankDetailViewController alloc] init];
rankDetailVC.indexRow = indexPath.section;
rankDetailVC.indexRow = indexPath.section - 2;
rankDetailVC.uuid = rankList.uuid;
rankDetailVC.store_uuid = rankList.store_uuid;
rankDetailVC.storeAddress = rankList.storeAddress;
......@@ -726,7 +726,7 @@
return sectionView;
} else {
RankListHeaderView *headerView = [RankListHeaderView headViewWithTableView:tableView section:section];
RankListHeaderView *headerView = [RankListHeaderView headViewWithTableView:tableView section:section - 2];
headerView.delegate = self;
[headerView.pushButton addTarget:self action:@selector(pushclick:) forControlEvents:UIControlEventTouchUpInside];
headerView.rankListModel = _rankData[section-2];
......@@ -831,7 +831,7 @@
NSLayoutConstraint *bgImageBottom = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.bgImageView addConstraint:bgImageBottom];
NSLayoutConstraint *bgImageWidth = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:95];
NSLayoutConstraint *bgImageWidth = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:110];
[self.bgImageView addConstraint:bgImageWidth];
}
return _nameLabel;
......
......@@ -45,7 +45,7 @@
self.loginView.usernameTextFiled.delegate = self;
self.loginView.passwordTextFiled.delegate = self;
// 初始化数组
self.allUserDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"thoradmin", @"admin", nil];
......@@ -207,7 +207,7 @@
if ([self.loginView.usernameTextFiled isFirstResponder]) {
// 创建下拉菜单
self.menu = [CustomDropMenuView defaultMenuView];
_menu.showTop = 260;
_menu.showTop = 300;
_menu.showLeft = 20;
_menu.showRight = -20;
_menu.showHeight = 40 * _allUserDict.count;
......@@ -247,5 +247,12 @@
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
if ([textField resignFirstResponder]) {
return YES;
}
return NO;
}
@end
......@@ -33,13 +33,13 @@
[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;
//
// 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;
......
......@@ -133,6 +133,12 @@
}
if ([text isEqualToString:@"\n"]) {
[self.textView resignFirstResponder];
return NO;
}
return YES;
}
......@@ -222,6 +228,8 @@
return _submitBtn;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
......
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