Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
红
红星美凯龙管理在线APP IOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
红星美凯龙管理在线APP IOS
Commits
7fbcb01a
Commit
7fbcb01a
authored
Dec 12, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分bug
parent
fff7b6b9
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
483 additions
and
537 deletions
+483
-537
project.pbxproj
redstar.xcodeproj/project.pbxproj
+12
-12
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Breakpoints_v2.xcbkptlist
...ta/admin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+0
-16
AnnoTableViewCell.h
...ses/Module/Announce/AnnounceList/Cell/AnnoTableViewCell.h
+1
-0
AnnoTableViewCell.m
...ses/Module/Announce/AnnounceList/Cell/AnnoTableViewCell.m
+31
-5
CommentView.m
redstar/Classes/Module/Comment/View/CommentView.m
+1
-1
CommentWithStarView.m
redstar/Classes/Module/Comment/View/CommentWithStarView.m
+1
-1
OnLineFooterView.m
.../Module/Function/OnLine/AddOnLine/View/OnLineFooterView.m
+2
-2
LookOnLineFootView.m
...unction/OnLine/LookOnLineDetail/View/LookOnLineFootView.m
+1
-1
InspectSortTableCell.m
...rdOfMouth/Inspect/InspectTask/Cell/InspectSortTableCell.m
+3
-0
InspectTaskDetailCell.h
...dOfMouth/Inspect/InspectTask/Cell/InspectTaskDetailCell.h
+10
-12
InspectTaskDetailCell.m
...dOfMouth/Inspect/InspectTask/Cell/InspectTaskDetailCell.m
+243
-208
InspectTitleTableViewCell.h
...outh/Inspect/InspectTask/Cell/InspectTitleTableViewCell.h
+12
-0
InspectTitleTableViewCell.m
...outh/Inspect/InspectTask/Cell/InspectTitleTableViewCell.m
+55
-0
InspectDetailHeaderView.h
...fMouth/Inspect/InspectTask/View/InspectDetailHeaderView.h
+0
-18
InspectDetailHeaderView.m
...fMouth/Inspect/InspectTask/View/InspectDetailHeaderView.m
+0
-182
InspectTaskViewController.m
...ct/InspectTask/ViewController/InspectTaskViewController.m
+111
-79
No files found.
redstar.xcodeproj/project.pbxproj
View file @
7fbcb01a
...
...
@@ -20,6 +20,8 @@
846206BB1C06AFF50015C456
/* RankCommentCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
846206BA1C06AFF50015C456
/* RankCommentCell.m */
;
};
8462C6EC1BF5F3BE00344DDD
/* MenuButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8462C6EB1BF5F3BE00344DDD
/* MenuButton.m */
;
};
84720BC11C0377D300314099
/* CommentWithStarView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84720BC01C0377D300314099
/* CommentWithStarView.m */
;
};
8473E3881C1BBFF600960257
/* InspectTaskDetailCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8473E3871C1BBFF600960257
/* InspectTaskDetailCell.m */
;
};
8473E38B1C1BCFC400960257
/* InspectTitleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8473E38A1C1BCFC400960257
/* InspectTitleTableViewCell.m */
;
};
8474A01C1BE368D700315F30
/* HomeCellItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8474A01B1BE368D700315F30
/* HomeCellItem.m */
;
};
8474C5831BE751A2007DCF19
/* CommonFunc.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8474C5821BE751A2007DCF19
/* CommonFunc.m */
;
};
8474C5911BE78A85007DCF19
/* QuestionListTableCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8474C58C1BE78A85007DCF19
/* QuestionListTableCell.m */
;
};
...
...
@@ -72,12 +74,10 @@
84A673C11C0C7AEB000F828E
/* AnnounceViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84A673BD1C0C7AEB000F828E
/* AnnounceViewController.m */
;
};
84A673C41C0C7B0A000F828E
/* AnnoDetailViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84A673C31C0C7B0A000F828E
/* AnnoDetailViewController.m */
;
};
84A673C71C0C7E0C000F828E
/* AnnounceDetailHeadView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84A673C61C0C7E0C000F828E
/* AnnounceDetailHeadView.m */
;
};
84AD4F201BF425AC00BFB37C
/* InspectDetailView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F1F1BF425AC00BFB37C
/* InspectDetailView.m */
;
};
84AD4F221BF42F8E00BFB37C
/* classfiy.plist in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F211BF42F8E00BFB37C
/* classfiy.plist */
;
};
84AD4F261BF4356A00BFB37C
/* TaskModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F251BF4356A00BFB37C
/* TaskModel.m */
;
};
84AD4F291BF4360E00BFB37C
/* TaskGroup.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F281BF4360E00BFB37C
/* TaskGroup.m */
;
};
84AD4F2F1BF4370E00BFB37C
/* InspectHeaderView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F2E1BF4370E00BFB37C
/* InspectHeaderView.m */
;
};
84AD4F321BF443E700BFB37C
/* InspectDetailHeaderView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F311BF443E700BFB37C
/* InspectDetailHeaderView.m */
;
};
84AD4F361BF45BEB00BFB37C
/* InspectSortTableCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F351BF45BEB00BFB37C
/* InspectSortTableCell.m */
;
};
84AD4F3A1BF4844600BFB37C
/* RankDetailHeaderView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F391BF4844600BFB37C
/* RankDetailHeaderView.m */
;
};
84AD4F3D1BF4894D00BFB37C
/* RankDetailView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84AD4F3C1BF4894D00BFB37C
/* RankDetailView.m */
;
};
...
...
@@ -183,6 +183,10 @@
8462C6EB1BF5F3BE00344DDD
/* MenuButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
MenuButton.m
;
sourceTree
=
"<group>"
;
};
84720BBF1C0377D300314099
/* CommentWithStarView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CommentWithStarView.h
;
sourceTree
=
"<group>"
;
};
84720BC01C0377D300314099
/* CommentWithStarView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CommentWithStarView.m
;
sourceTree
=
"<group>"
;
};
8473E3861C1BBFF600960257
/* InspectTaskDetailCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
InspectTaskDetailCell.h
;
sourceTree
=
"<group>"
;
};
8473E3871C1BBFF600960257
/* InspectTaskDetailCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
InspectTaskDetailCell.m
;
sourceTree
=
"<group>"
;
};
8473E3891C1BCFC400960257
/* InspectTitleTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
InspectTitleTableViewCell.h
;
sourceTree
=
"<group>"
;
};
8473E38A1C1BCFC400960257
/* InspectTitleTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
InspectTitleTableViewCell.m
;
sourceTree
=
"<group>"
;
};
8474A01A1BE368D700315F30
/* HomeCellItem.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
HomeCellItem.h
;
sourceTree
=
"<group>"
;
};
8474A01B1BE368D700315F30
/* HomeCellItem.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
HomeCellItem.m
;
sourceTree
=
"<group>"
;
};
8474C5811BE751A2007DCF19
/* CommonFunc.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CommonFunc.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -290,8 +294,6 @@
84A673C31C0C7B0A000F828E
/* AnnoDetailViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
AnnoDetailViewController.m
;
sourceTree
=
"<group>"
;
};
84A673C51C0C7E0C000F828E
/* AnnounceDetailHeadView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
AnnounceDetailHeadView.h
;
sourceTree
=
"<group>"
;
};
84A673C61C0C7E0C000F828E
/* AnnounceDetailHeadView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
AnnounceDetailHeadView.m
;
sourceTree
=
"<group>"
;
};
84AD4F1E1BF425AC00BFB37C
/* InspectDetailView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
InspectDetailView.h
;
sourceTree
=
"<group>"
;
};
84AD4F1F1BF425AC00BFB37C
/* InspectDetailView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
InspectDetailView.m
;
sourceTree
=
"<group>"
;
};
84AD4F211BF42F8E00BFB37C
/* classfiy.plist */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.plist.xml
;
path
=
classfiy.plist
;
sourceTree
=
"<group>"
;
};
84AD4F241BF4356A00BFB37C
/* TaskModel.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TaskModel.h
;
sourceTree
=
"<group>"
;
};
84AD4F251BF4356A00BFB37C
/* TaskModel.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TaskModel.m
;
sourceTree
=
"<group>"
;
};
...
...
@@ -299,8 +301,6 @@
84AD4F281BF4360E00BFB37C
/* TaskGroup.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TaskGroup.m
;
sourceTree
=
"<group>"
;
};
84AD4F2D1BF4370E00BFB37C
/* InspectHeaderView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
InspectHeaderView.h
;
sourceTree
=
"<group>"
;
};
84AD4F2E1BF4370E00BFB37C
/* InspectHeaderView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
InspectHeaderView.m
;
sourceTree
=
"<group>"
;
};
84AD4F301BF443E700BFB37C
/* InspectDetailHeaderView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
InspectDetailHeaderView.h
;
sourceTree
=
"<group>"
;
};
84AD4F311BF443E700BFB37C
/* InspectDetailHeaderView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
InspectDetailHeaderView.m
;
sourceTree
=
"<group>"
;
};
84AD4F341BF45BEB00BFB37C
/* InspectSortTableCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
InspectSortTableCell.h
;
sourceTree
=
"<group>"
;
};
84AD4F351BF45BEB00BFB37C
/* InspectSortTableCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
InspectSortTableCell.m
;
sourceTree
=
"<group>"
;
};
84AD4F381BF4844600BFB37C
/* RankDetailHeaderView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
RankDetailHeaderView.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1382,10 +1382,6 @@
84AD4F1D1BF4257C00BFB37C
/* View */
=
{
isa
=
PBXGroup
;
children
=
(
84AD4F301BF443E700BFB37C
/* InspectDetailHeaderView.h */
,
84AD4F311BF443E700BFB37C
/* InspectDetailHeaderView.m */
,
84AD4F1E1BF425AC00BFB37C
/* InspectDetailView.h */
,
84AD4F1F1BF425AC00BFB37C
/* InspectDetailView.m */
,
84AD4F2D1BF4370E00BFB37C
/* InspectHeaderView.h */
,
84AD4F2E1BF4370E00BFB37C
/* InspectHeaderView.m */
,
);
...
...
@@ -1410,6 +1406,10 @@
children
=
(
84AD4F341BF45BEB00BFB37C
/* InspectSortTableCell.h */
,
84AD4F351BF45BEB00BFB37C
/* InspectSortTableCell.m */
,
8473E3861C1BBFF600960257
/* InspectTaskDetailCell.h */
,
8473E3871C1BBFF600960257
/* InspectTaskDetailCell.m */
,
8473E3891C1BCFC400960257
/* InspectTitleTableViewCell.h */
,
8473E38A1C1BCFC400960257
/* InspectTitleTableViewCell.m */
,
);
path
=
Cell
;
sourceTree
=
"<group>"
;
...
...
@@ -2056,7 +2056,6 @@
84BB16A21C191A7F00383A64
/* OnLineResultFootView.m in Sources */
,
84846E971BE069BC0010550A
/* DateButton.m in Sources */
,
84CC34CC1C093C2F002F10E2
/* OnLineTableViewCell.m in Sources */
,
84AD4F201BF425AC00BFB37C
/* InspectDetailView.m in Sources */
,
84E363D21BFAC5200061547E
/* TaskListModel.m in Sources */
,
84C9574E1BDB344900083584
/* UIView+Frame.m in Sources */
,
848699B01BDF810900859DFE
/* InspectListCell.m in Sources */
,
...
...
@@ -2086,7 +2085,6 @@
8474C5831BE751A2007DCF19
/* CommonFunc.m in Sources */
,
84AD4F491BF4BC0600BFB37C
/* RankDetailTableCell.m in Sources */
,
848699B31BDF810900859DFE
/* InspectTaskViewController.m in Sources */
,
84AD4F321BF443E700BFB37C
/* InspectDetailHeaderView.m in Sources */
,
84CC34D81C094682002F10E2
/* StandardTableViewCell.m in Sources */
,
84CC34EC1C09AD98002F10E2
/* LookOnLineDetailView.m in Sources */
,
84E420471BE88AE000689976
/* RootTabBarController.m in Sources */
,
...
...
@@ -2103,6 +2101,7 @@
84A673C41C0C7B0A000F828E
/* AnnoDetailViewController.m in Sources */
,
84AD4F2F1BF4370E00BFB37C
/* InspectHeaderView.m in Sources */
,
8480BEAC1C143A1600E2F18F
/* CategoryTableView.m in Sources */
,
8473E3881C1BBFF600960257
/* InspectTaskDetailCell.m in Sources */
,
84F57C9C1BECA73800DDEEB1
/* StarBar.m in Sources */
,
84F57C4C1BEC785E00DDEEB1
/* AddQuestionViewController.m in Sources */
,
84C9729F1C1ADD17003A3276
/* PictureCommentTableCell.m in Sources */
,
...
...
@@ -2112,6 +2111,7 @@
84C9574D1BDB344900083584
/* UIBarButtonItem+Create.m in Sources */
,
84AD4F3D1BF4894D00BFB37C
/* RankDetailView.m in Sources */
,
84C972961C1ABE08003A3276
/* PicScreenView.m in Sources */
,
8473E38B1C1BCFC400960257
/* InspectTitleTableViewCell.m in Sources */
,
84ECCF1B1C0210F000EA4960
/* CommentModel.m in Sources */
,
84E0ABCD1BFB082E001C8F45
/* TaskDetailModel.m in Sources */
,
8490C4D31BF9DEF0006B6569
/* PictureTableCell.m in Sources */
,
...
...
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
7fbcb01a
No preview for this file type
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
7fbcb01a
...
...
@@ -13,21 +13,5 @@
stopOnStyle =
"0"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
shouldBeEnabled =
"No"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"redstar/Classes/Module/Function/OnLine/OnLineTaskComplete/Cell/OnLineCompleteDetailCell.m"
timestampString =
"471346560.745287"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"178"
endingLineNumber =
"178"
landmarkName =
"-taskDetailLabel"
landmarkType =
"5"
>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
redstar/Classes/Module/Announce/AnnounceList/Cell/AnnoTableViewCell.h
View file @
7fbcb01a
...
...
@@ -15,6 +15,7 @@
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
peopleLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
dateLabel
;
@property
(
nonatomic
,
strong
)
AnnounceModel
*
announce
;
@property
(
nonatomic
,
copy
)
NSString
*
currentState
;
...
...
redstar/Classes/Module/Announce/AnnounceList/Cell/AnnoTableViewCell.m
View file @
7fbcb01a
...
...
@@ -20,9 +20,8 @@
self
.
titleLabel
.
attributedText
=
attrStr
;
//self.titleLabel.text = [NSString stringWithFormat:@"%@", announce.content];
self
.
peopleLabel
.
text
=
[
NSString
stringWithFormat
:
@"发布人:%@ 发布日期:%@"
,
announce
.
lastModify_operName
,
announce
.
lastModify_time
];
self
.
peopleLabel
.
text
=
[
NSString
stringWithFormat
:
@"发布人:%@"
,
announce
.
lastModify_operName
];
self
.
dateLabel
.
text
=
[
NSString
stringWithFormat
:
@"发布日期:%@"
,
announce
.
lastModify_time
];
if
([
self
.
currentState
isEqualToString
:
@"false"
])
{
if
(
announce
.
priority
==
0
)
{
self
.
stateLabel
.
text
=
@"低"
;
...
...
@@ -94,7 +93,7 @@
_titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
[
self
.
contentView
addSubview
:
_titleLabel
];
NSLayoutConstraint
*
overDateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
7
];
NSLayoutConstraint
*
overDateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
7
];
[
self
.
contentView
addConstraint
:
overDateTop
];
NSLayoutConstraint
*
overDateLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
55
];
...
...
@@ -130,13 +129,40 @@
[
self
.
contentView
addConstraint
:
overDateRight
];
NSLayoutConstraint
*
overDateHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_peopleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
20
];
NSLayoutConstraint
*
overDateHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_peopleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
18
];
[
self
.
contentView
addConstraint
:
overDateHeight
];
}
return
_peopleLabel
;
}
-
(
UILabel
*
)
dateLabel
{
if
(
!
_dateLabel
)
{
_dateLabel
=
[[
UILabel
alloc
]
init
];
_dateLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_dateLabel
.
textColor
=
kLightGray
;
_dateLabel
.
font
=
[
UIFont
systemFontOfSize
:
13
.
0
];
[
self
.
contentView
addSubview
:
_dateLabel
];
NSLayoutConstraint
*
overDateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_dateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
peopleLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
1
];
[
self
.
contentView
addConstraint
:
overDateTop
];
NSLayoutConstraint
*
overDateLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_dateLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
55
];
[
self
.
contentView
addConstraint
:
overDateLeft
];
NSLayoutConstraint
*
overDateRight
=
[
NSLayoutConstraint
constraintWithItem
:
_dateLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
overDateRight
];
NSLayoutConstraint
*
overDateHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_dateLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
18
];
[
self
.
contentView
addConstraint
:
overDateHeight
];
}
return
_dateLabel
;
}
-
(
UILabel
*
)
stateLabel
{
if
(
!
_stateLabel
)
{
...
...
redstar/Classes/Module/Comment/View/CommentView.m
View file @
7fbcb01a
...
...
@@ -48,7 +48,7 @@
self
.
contentTextView
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
placeholderLabel2
.
text
=
@"请输入评论内容
...
"
;
self
.
placeholderLabel2
.
text
=
@"请输入评论内容
,不超过200字
"
;
[
self
.
sureBtn
setTitle
:
@"确定"
forState
:
UIControlStateNormal
];
...
...
redstar/Classes/Module/Comment/View/CommentWithStarView.m
View file @
7fbcb01a
...
...
@@ -43,7 +43,7 @@
self
.
contentTextView
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
placeholderLabel2
.
text
=
@"请输入评论内容
...
"
;
self
.
placeholderLabel2
.
text
=
@"请输入评论内容
,不超过200字
"
;
[
self
.
sureBtn
setTitle
:
@"确定"
forState
:
UIControlStateNormal
];
...
...
redstar/Classes/Module/Function/OnLine/AddOnLine/View/OnLineFooterView.m
View file @
7fbcb01a
...
...
@@ -87,8 +87,8 @@
self
.
titleTextView
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
contentTextView
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
placeholderLabel1
.
text
=
@"请输入文字
...
"
;
self
.
placeholderLabel2
.
text
=
@"请输入文字
...
"
;
self
.
placeholderLabel1
.
text
=
@"请输入文字
,不超过500字
"
;
self
.
placeholderLabel2
.
text
=
@"请输入文字
,不超过500字
"
;
[
self
.
saveButton
setTitle
:
@"保存并下达"
forState
:
UIControlStateNormal
];
...
...
redstar/Classes/Module/Function/OnLine/LookOnLineDetail/View/LookOnLineFootView.m
View file @
7fbcb01a
...
...
@@ -31,7 +31,7 @@
self
.
backImageView1
.
image
=
resizingName
;
self
.
contentTextView
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
placeholderLabel2
.
text
=
@"请输入文字
...
"
;
self
.
placeholderLabel2
.
text
=
@"请输入文字
,不超过500字
"
;
[
self
.
resultButton
setTitle
:
@"上报结果"
forState
:
UIControlStateNormal
];
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/Cell/InspectSortTableCell.m
View file @
7fbcb01a
...
...
@@ -78,6 +78,9 @@
NSLayoutConstraint
*
tableBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
tableBottom
];
NSLayoutConstraint
*
tableHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
44
];
[
self
.
contentView
addConstraint
:
tableHeight
];
}
return
_titleLabel
;
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/
View/InspectDetailView
.h
→
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/
Cell/InspectTaskDetailCell
.h
View file @
7fbcb01a
//
// Inspect
DetailView
.h
// Inspect
TaskDetailCell
.h
// redstar
//
// Created by admin on 15/1
1
/12.
// Created by admin on 15/1
2
/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "
InspectListCel
l.h"
#import "
TaskDetailMode
l.h"
@interface
InspectTaskDetailCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
@interface
InspectDetailView
:
UIView
@property
(
nonatomic
,
strong
)
UILabel
*
shopnameLabel
;
// 商店名称
@property
(
nonatomic
,
strong
)
UILabel
*
startDateLabel
;
// 起始时间
@property
(
nonatomic
,
strong
)
UILabel
*
overDateLabel
;
// 截止时间
@property
(
nonatomic
,
strong
)
UILabel
*
progressLabel
;
// 完成进度
@property
(
nonatomic
,
strong
)
UILabel
*
alreadyLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
allLabel
;
//@property (nonatomic, assign) ProgressState progressState;
@property
(
nonatomic
,
assign
)
CGFloat
multiplier
;
@property
(
nonatomic
,
strong
)
UIButton
*
unfoldBtn
;
@property
(
nonatomic
,
strong
)
UIImageView
*
arrowImageView
;
@property
(
nonatomic
,
strong
)
UILabel
*
dayLabel
;
// 剩余天数
@property
(
nonatomic
,
strong
)
UIImageView
*
alreadyView
;
@property
(
nonatomic
,
strong
)
UIView
*
allView
;
@property
(
nonatomic
,
strong
)
UILabel
*
introDetailLabel
;
@property
(
nonatomic
,
strong
)
TaskDetailModel
*
taskDetail
;
@end
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/
View/InspectDetailView
.m
→
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/
Cell/InspectTaskDetailCell
.m
View file @
7fbcb01a
//
// Inspect
DetailView
.m
// Inspect
TaskDetailCell
.m
// redstar
//
// Created by admin on 15/1
1
/12.
// Created by admin on 15/1
2
/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "Inspect
DetailView
.h"
#import "Inspect
TaskDetailCell
.h"
@interface
Inspect
DetailView
()
@interface
Inspect
TaskDetailCell
()
@property
(
nonatomic
,
strong
)
UILabel
*
shopname
;
// 商店名称
@property
(
nonatomic
,
strong
)
UILabel
*
startDate
;
// 起始时间
@property
(
nonatomic
,
strong
)
UILabel
*
overDate
;
// 截止时间
...
...
@@ -20,25 +20,12 @@
@property
(
nonatomic
,
strong
)
UILabel
*
day
;
// 天
@property
(
nonatomic
,
strong
)
UIImageView
*
number
;
// 天
@property
(
nonatomic
,
strong
)
UIView
*
upLineView
;
// 天
@property
(
nonatomic
,
strong
)
UIView
*
downLineView
;
// 天
@end
@implementation
InspectDetailView
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
[
self
setup
];
}
return
self
;
}
-
(
instancetype
)
initWithFrame
:
(
CGRect
)
frame
@implementation
InspectTaskDetailCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
self
=
[
super
initWith
Frame
:
frame
];
self
=
[
super
initWith
Style
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
[
self
setup
];
}
...
...
@@ -46,13 +33,8 @@
}
#pragma mark - Private Methods
#pragma mark Private Methods
-
(
void
)
setup
{
self
.
upLineView
.
backgroundColor
=
kSeparateLineColor
;
self
.
downLineView
.
backgroundColor
=
kSeparateLineColor
;
-
(
void
)
setup
{
self
.
shopname
.
text
=
@"商场名称"
;
self
.
startDate
.
text
=
@"起始时间"
;
self
.
overDate
.
text
=
@"截止时间"
;
...
...
@@ -63,90 +45,119 @@
self
.
day
.
text
=
@"天"
;
self
.
number
.
image
=
[
UIImage
imageNamed
:
@"figure_bg"
];
self
.
surplus
.
text
=
@"剩余"
;
self
.
unfoldBtn
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
1
2
.
0
];
self
.
unfoldBtn
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
1
3
.
0
];
self
.
arrowImageView
.
image
=
[
UIImage
imageNamed
:
@"grey-trilateral_down"
];
self
.
introDetailLabel
.
text
=
@""
;
}
//- (void)setProgressState:(ProgressState)progressState
//{
// _progressState = progressState;
// if (_progressState == ProgressStateUnSettled) {
// self.progressLabel.text = [NSString stringWithFormat:@"未处理 %f", _multiplier];;
// self.progressLabel.textColor = kProgressUnSettledColor;
// self.alreadyLabel.textColor = kProgressUnSettledColor;
// self.allLabel.textColor = kProgressUnSettledColor;
// self.allView.backgroundColor = kProgressViewAllBackColor;
// UIImage *image = [UIImage imageNamed:@"progress-bar"];
// image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
// self.alreadyView.image = image;
// } else if (_progressState == ProgressStateDealWith) {
//
// self.progressLabel.text = [NSString stringWithFormat:@"进行中 %f", _multiplier];
// self.progressLabel.textColor = kProgressDealWithColor;
// self.alreadyLabel.textColor = kProgressDealWithColor;
// self.allLabel.textColor = kProgressDealWithColor;
// self.allView.backgroundColor = kProgressViewAllBackColor;
// UIImage *image = [UIImage imageNamed:@"progress-bar"];
// image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
// self.alreadyView.image = image;
// } else {
//
// self.progressLabel.text = [NSString stringWithFormat:@"已过期 %f", _multiplier];
// self.progressLabel.textColor = kProgressOverDueColor;
// self.alreadyLabel.textColor = kProgressOverDueColor;
// self.allLabel.textColor = kProgressOverDueColor;
// self.allView.backgroundColor = kProgressViewAllBackColor;
// UIImage *image = [UIImage imageNamed:@"progress-bar"];
// image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
// self.alreadyView.image = image;
// }
//}
#pragma mark - lazy loading
-
(
UIView
*
)
upLineView
-
(
void
)
setTaskDetail
:
(
TaskDetailModel
*
)
taskDetail
{
if
(
!
_upLineView
)
{
_upLineView
=
[[
UIView
alloc
]
init
];
_upLineView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_upLineView
];
NSLayoutConstraint
*
upLineTop
=
[
NSLayoutConstraint
constraintWithItem
:
_upLineView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
upLineTop
];
NSLayoutConstraint
*
upLineLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_upLineView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
upLineLeft
];
NSLayoutConstraint
*
upLineRight
=
[
NSLayoutConstraint
constraintWithItem
:
_upLineView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
upLineRight
];
NSLayoutConstraint
*
upLineHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_upLineView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
1
];
[
self
addConstraint
:
upLineHeight
];
_taskDetail
=
taskDetail
;
self
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
name
];
self
.
shopnameLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
store_name
];
self
.
startDateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
beginDate
];
self
.
overDateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
endDate
];
if
(
taskDetail
.
questionCount
==
0
||
taskDetail
.
reportCount
==
0
)
{
self
.
multiplier
=
0
;
}
else
{
self
.
multiplier
=
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
;
}
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"yyyy-MM-dd"
];
// 当前时间
NSDate
*
date
=
[
NSDate
date
];
NSString
*
strDate
=
[
dateFormatter
stringFromDate
:
date
];
NSDate
*
today
=
[
dateFormatter
dateFromString
:
strDate
];
NSLog
(
@"today = %@"
,
today
);
// endTime
NSDate
*
endTime
=
[
dateFormatter
dateFromString
:[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
endDate
]];
NSLog
(
@"endTime = %@"
,
endTime
);
NSCalendar
*
cal
=
[
NSCalendar
currentCalendar
];
unsigned
int
unitFlags
=
NSYearCalendarUnit
|
NSMonthCalendarUnit
|
NSDayCalendarUnit
;
NSDateComponents
*
d
=
[
cal
components
:
unitFlags
fromDate
:
today
toDate
:
endTime
options
:
0
];
if
(
d
.
day
>
0
)
{
self
.
dayLabel
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)
d
.
day
];
}
else
{
self
.
dayLabel
.
text
=
@"0"
;
}
if
([
taskDetail
.
state
isEqualToString
:
@"initial"
])
{
if
(
taskDetail
.
reportCount
==
0
||
taskDetail
.
questionCount
==
0
)
{
self
.
progressLabel
.
text
=
@"0%"
;
}
else
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"未处理 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
}
self
.
progressLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
alreadyLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
allLabel
.
textColor
=
kProgressUnSettledColor
;
}
else
if
([
taskDetail
.
state
isEqualToString
:
@"processing"
])
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"进行中 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
allLabel
.
textColor
=
kProgressDealWithColor
;
}
else
if
([
taskDetail
.
state
isEqualToString
:
@"reported"
])
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已上报 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
allLabel
.
textColor
=
kProgressDealWithColor
;
}
else
if
([
taskDetail
.
state
isEqualToString
:
@"finished"
])
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已评分 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
allLabel
.
textColor
=
kProgressDealWithColor
;
}
else
if
([
taskDetail
.
state
isEqualToString
:
@"published"
])
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已发布 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
allLabel
.
textColor
=
kProgressDealWithColor
;
}
else
{
self
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已过期 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
progressLabel
.
textColor
=
kProgressOverDueColor
;
self
.
alreadyLabel
.
textColor
=
kProgressOverDueColor
;
self
.
allLabel
.
textColor
=
kProgressOverDueColor
;
}
return
_upLineView
;
self
.
allView
.
backgroundColor
=
kProgressViewAllBackColor
;
self
.
alreadyView
.
backgroundColor
=
kProgressViewAlreadyBackColor
;
self
.
alreadyLabel
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
taskDetail
.
reportCount
];
self
.
allLabel
.
text
=
[
NSString
stringWithFormat
:
@"/%d"
,
taskDetail
.
questionCount
];
}
-
(
UIView
*
)
downLineView
-
(
UILabel
*
)
titleLabel
{
if
(
!
_downLineView
)
{
_downLineView
=
[[
UIView
alloc
]
init
];
_downLineView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_downLineView
];
NSLayoutConstraint
*
upLineBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_downLineView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
upLineBottom
];
NSLayoutConstraint
*
upLineLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_downLineView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
upLineLeft
];
NSLayoutConstraint
*
upLineRight
=
[
NSLayoutConstraint
constraintWithItem
:
_downLineView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
upLineRight
];
NSLayoutConstraint
*
upLineHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_downLineView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
1
];
[
self
addConstraint
:
upLineHeight
];
if
(
!
_titleLabel
)
{
_titleLabel
=
[[
UILabel
alloc
]
init
];
_titleLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_titleLabel
.
textAlignment
=
NSTextAlignmentCenter
;
_titleLabel
.
textColor
=
kAnnounceTextColor
;
_titleLabel
.
backgroundColor
=
kSectionBackGroundColor
;
_titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
[
self
.
contentView
addSubview
:
_titleLabel
];
NSLayoutConstraint
*
titleLabelTop
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
titleLabelTop
];
NSLayoutConstraint
*
titleLabelLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
titleLabelLeft
];
NSLayoutConstraint
*
titleLabelWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
titleLabelWidth
];
NSLayoutConstraint
*
titleLabelHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_titleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
45
];
[
self
.
contentView
addConstraint
:
titleLabelHeight
];
}
return
_
downLineView
;
return
_
titleLabel
;
}
#pragma mark - lazy loading
-
(
UILabel
*
)
shopname
{
...
...
@@ -155,19 +166,19 @@
_shopname
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_shopname
.
textColor
=
kLightGray
;
_shopname
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_shopname
];
[
self
.
contentView
addSubview
:
_shopname
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_shopname
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
10
];
[
self
addConstraint
:
Top
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_shopname
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_shopname
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
Left
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_shopname
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
.
contentView
addConstraint
:
Left
];
NSLayoutConstraint
*
Width
=
[
NSLayoutConstraint
constraintWithItem
:
_shopname
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
65
];
[
self
addConstraint
:
Width
];
[
self
.
contentView
addConstraint
:
Width
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_shopname
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_shopname
;
}
...
...
@@ -180,19 +191,19 @@
_startDate
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_startDate
.
textColor
=
kLightGray
;
_startDate
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_startDate
];
[
self
.
contentView
addSubview
:
_startDate
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_startDate
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
shopname
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
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
];
[
self
.
contentView
addConstraint
:
Width
];
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
;
}
...
...
@@ -204,19 +215,19 @@
_overDate
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_overDate
.
textColor
=
kLightGray
;
_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
:
5
];
[
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
];
[
self
.
contentView
addConstraint
:
Width
];
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
;
}
...
...
@@ -228,19 +239,19 @@
_progress
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_progress
.
textColor
=
kLightGray
;
_progress
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_progress
];
[
self
.
contentView
addSubview
:
_progress
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_progress
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
overDate
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_progress
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
Left
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_progress
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
.
contentView
addConstraint
:
Left
];
NSLayoutConstraint
*
Width
=
[
NSLayoutConstraint
constraintWithItem
:
_progress
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
65
];
[
self
addConstraint
:
Width
];
[
self
.
contentView
addConstraint
:
Width
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_progress
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_progress
;
}
...
...
@@ -254,19 +265,19 @@
_allView
.
layer
.
masksToBounds
=
YES
;
_allView
.
layer
.
borderWidth
=
1
;
_allView
.
layer
.
borderColor
=
kUsernameBorderColor
;
[
self
addSubview
:
_allView
];
[
self
.
contentView
addSubview
:
_allView
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_allView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
progress
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
7
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_allView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
Left
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_allView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
.
contentView
addConstraint
:
Left
];
NSLayoutConstraint
*
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_allView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
addConstraint
:
Right
];
NSLayoutConstraint
*
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_allView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
Right
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_allView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
18
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_allView
;
}
...
...
@@ -289,7 +300,7 @@
NSLayoutConstraint
*
overDateBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:-
1
];
[
self
.
allView
addConstraint
:
overDateBottom
];
NSLayoutConstraint
*
overDatewidth
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyView
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allView
attribute
:
NSLayoutAttributeWidth
multiplier
:
self
.
multiplier
constant
:-
1
];
[
self
.
allView
addConstraint
:
overDatewidth
];
...
...
@@ -305,19 +316,19 @@
_introLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_introLabel
.
textColor
=
kLightGray
;
_introLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_introLabel
];
[
self
.
contentView
addSubview
:
_introLabel
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_introLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
7
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_introLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
Left
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_introLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
.
contentView
addConstraint
:
Left
];
NSLayoutConstraint
*
Width
=
[
NSLayoutConstraint
constraintWithItem
:
_introLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
65
];
[
self
addConstraint
:
Width
];
[
self
.
contentView
addConstraint
:
Width
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_introLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_introLabel
;
}
...
...
@@ -329,19 +340,19 @@
_shopnameLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_shopnameLabel
.
textColor
=
kLightBlack
;
_shopnameLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_shopnameLabel
];
[
self
.
contentView
addSubview
:
_shopnameLabel
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_shopnameLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
10
];
[
self
addConstraint
:
Top
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_shopnameLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_shopnameLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
shopname
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
15
];
[
self
addConstraint
:
Left
];
[
self
.
contentView
addConstraint
:
Left
];
// NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self
attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self
addConstraint:Right];
// NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView
attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self.contentView
addConstraint:Right];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_shopnameLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_shopnameLabel
;
}
...
...
@@ -355,19 +366,19 @@
_day
.
textColor
=
kLightBlack
;
_day
.
textAlignment
=
NSTextAlignmentCenter
;
_day
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_day
];
[
self
.
contentView
addSubview
:
_day
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_day
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
shopnameLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_day
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
addConstraint
:
Right
];
NSLayoutConstraint
*
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_day
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
Right
];
NSLayoutConstraint
*
width
=
[
NSLayoutConstraint
constraintWithItem
:
_day
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
width
];
[
self
.
contentView
addConstraint
:
width
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_day
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_day
;
}
...
...
@@ -378,19 +389,19 @@
if
(
!
_number
)
{
_number
=
[[
UIImageView
alloc
]
init
];
_number
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_number
];
[
self
.
contentView
addSubview
:
_number
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_number
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
shopnameLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_number
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
day
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
Right
];
[
self
.
contentView
addConstraint
:
Right
];
NSLayoutConstraint
*
width
=
[
NSLayoutConstraint
constraintWithItem
:
_number
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
26
];
[
self
addConstraint
:
width
];
[
self
.
contentView
addConstraint
:
width
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_number
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_number
;
}
...
...
@@ -403,19 +414,19 @@
_surplus
.
textColor
=
kLightBlack
;
_surplus
.
textAlignment
=
NSTextAlignmentCenter
;
_surplus
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_surplus
];
[
self
.
contentView
addSubview
:
_surplus
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_surplus
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
shopnameLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_surplus
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
number
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
Right
];
[
self
.
contentView
addConstraint
:
Right
];
NSLayoutConstraint
*
width
=
[
NSLayoutConstraint
constraintWithItem
:
_surplus
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
40
];
[
self
addConstraint
:
width
];
[
self
.
contentView
addConstraint
:
width
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_surplus
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_surplus
;
}
...
...
@@ -429,19 +440,19 @@
_startDateLabel
.
textColor
=
kLightBlack
;
_startDateLabel
.
textAlignment
=
NSTextAlignmentLeft
;
_startDateLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_startDateLabel
];
[
self
.
contentView
addSubview
:
_startDateLabel
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_startDateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
shopnameLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_startDateLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
100
];
[
self
addConstraint
:
Left
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_startDateLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
100
];
[
self
.
contentView
addConstraint
:
Left
];
// NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_startDateLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self
.surplus attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self
addConstraint:Right];
// NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_startDateLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView
.surplus attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self.contentView
addConstraint:Right];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_startDateLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_startDateLabel
;
}
...
...
@@ -455,18 +466,18 @@
_overDateLabel
.
textColor
=
kLightBlack
;
_overDateLabel
.
textAlignment
=
NSTextAlignmentLeft
;
_overDateLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_overDateLabel
];
[
self
.
contentView
addSubview
:
_overDateLabel
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_overDateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
startDateLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_overDateLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
overDate
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
80
];
[
self
addConstraint
:
Left
];
[
self
.
contentView
addConstraint
:
Left
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_overDateLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_overDateLabel
;
}
...
...
@@ -477,19 +488,19 @@
_progressLabel
=
[[
UILabel
alloc
]
init
];
_progressLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_progressLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_progressLabel
];
[
self
.
contentView
addSubview
:
_progressLabel
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_progressLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
overDateLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
Top
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_progressLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
100
];
[
self
addConstraint
:
Left
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_progressLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
100
];
[
self
.
contentView
addConstraint
:
Left
];
NSLayoutConstraint
*
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_progressLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
alreadyLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
Right
];
[
self
.
contentView
addConstraint
:
Right
];
NSLayoutConstraint
*
Height
=
[
NSLayoutConstraint
constraintWithItem
:
_progressLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
Height
];
[
self
.
contentView
addConstraint
:
Height
];
}
return
_progressLabel
;
}
...
...
@@ -500,19 +511,19 @@
_alreadyLabel
=
[[
UILabel
alloc
]
init
];
_alreadyLabel
.
textAlignment
=
NSTextAlignmentRight
;
_alreadyLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_alreadyLabel
];
[
self
.
contentView
addSubview
:
_alreadyLabel
];
NSLayoutConstraint
*
overDateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
overDateLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
overDateTop
];
[
self
.
contentView
addConstraint
:
overDateTop
];
NSLayoutConstraint
*
overDateWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allLabel
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
overDateWidth
];
[
self
.
contentView
addConstraint
:
overDateWidth
];
NSLayoutConstraint
*
overDateRight
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
overDateRight
];
[
self
.
contentView
addConstraint
:
overDateRight
];
NSLayoutConstraint
*
overDateHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_alreadyLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
overDateHeight
];
[
self
.
contentView
addConstraint
:
overDateHeight
];
}
return
_alreadyLabel
;
}
...
...
@@ -522,19 +533,19 @@
if
(
!
_allLabel
)
{
_allLabel
=
[[
UILabel
alloc
]
init
];
_allLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_allLabel
];
[
self
.
contentView
addSubview
:
_allLabel
];
NSLayoutConstraint
*
overDateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_allLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
overDateLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
addConstraint
:
overDateTop
];
NSLayoutConstraint
*
overDateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_allLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
overDateLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
.
contentView
addConstraint
:
overDateTop
];
NSLayoutConstraint
*
overDateWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_allLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
32
];
[
self
addConstraint
:
overDateWidth
];
[
self
.
contentView
addConstraint
:
overDateWidth
];
NSLayoutConstraint
*
overDateRight
=
[
NSLayoutConstraint
constraintWithItem
:
_allLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
18
];
[
self
addConstraint
:
overDateRight
];
NSLayoutConstraint
*
overDateRight
=
[
NSLayoutConstraint
constraintWithItem
:
_allLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
18
];
[
self
.
contentView
addConstraint
:
overDateRight
];
NSLayoutConstraint
*
overDateHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_allLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
addConstraint
:
overDateHeight
];
[
self
.
contentView
addConstraint
:
overDateHeight
];
}
return
_allLabel
;
}
...
...
@@ -547,19 +558,19 @@
[
_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
.
allView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
10
];
[
self
addConstraint
:
overDateTop
];
[
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
;
}
...
...
@@ -569,19 +580,19 @@
if
(
!
_arrowImageView
)
{
_arrowImageView
=
[[
UIImageView
alloc
]
init
];
_arrowImageView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_arrowImageView
];
[
self
.
contentView
addSubview
:
_arrowImageView
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_arrowImageView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
allView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
19
];
[
self
addConstraint
:
Top
];
[
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
;
}
...
...
@@ -611,12 +622,36 @@
return
_dayLabel
;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
-
(
UILabel
*
)
introDetailLabel
{
if
(
!
_introDetailLabel
)
{
_introDetailLabel
=
[[
UILabel
alloc
]
init
];
_introDetailLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_introDetailLabel
.
textColor
=
kLightBlack
;
_introDetailLabel
.
numberOfLines
=
0
;
_introDetailLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
contentView
addSubview
:
_introDetailLabel
];
NSLayoutConstraint
*
Top
=
[
NSLayoutConstraint
constraintWithItem
:
_introDetailLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
introLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
5
];
[
self
.
contentView
addConstraint
:
Top
];
NSLayoutConstraint
*
Left
=
[
NSLayoutConstraint
constraintWithItem
:
_introDetailLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
.
contentView
addConstraint
:
Left
];
NSLayoutConstraint
*
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_introDetailLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
Right
];
NSLayoutConstraint
*
Bottom
=
[
NSLayoutConstraint
constraintWithItem
:
_introDetailLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:-
10
];
[
self
.
contentView
addConstraint
:
Bottom
];
}
return
_introDetailLabel
;
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
*/
@end
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/Cell/InspectTitleTableViewCell.h
0 → 100644
View file @
7fbcb01a
//
// InspectTitleTableViewCell.h
// redstar
//
// Created by admin on 15/12/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
InspectTitleTableViewCell
:
UITableViewCell
@end
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/Cell/InspectTitleTableViewCell.m
0 → 100644
View file @
7fbcb01a
//
// InspectTitleTableViewCell.m
// redstar
//
// Created by admin on 15/12/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectTitleTableViewCell.h"
@implementation
InspectTitleTableViewCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
self
.
contentView
.
backgroundColor
=
kSectionBackGroundColor
;
[
self
setup
];
}
return
self
;
}
#pragma mark - Private Methods
-
(
void
)
setup
{
UILabel
*
titleLabel
=
[[
UILabel
alloc
]
init
];
titleLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
titleLabel
.
backgroundColor
=
[
UIColor
clearColor
];
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
titleLabel
.
textColor
=
kLightBlack
;
titleLabel
.
text
=
@"分类项目"
;
[
self
.
contentView
addSubview
:
titleLabel
];
NSLayoutConstraint
*
titleLabelTop
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
titleLabelTop
];
NSLayoutConstraint
*
titleLabelLeft
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
.
contentView
addConstraint
:
titleLabelLeft
];
NSLayoutConstraint
*
titleLabelWidth
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
titleLabelWidth
];
NSLayoutConstraint
*
titleLabelHeight
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
40
];
[
self
.
contentView
addConstraint
:
titleLabelHeight
];
NSLayoutConstraint
*
titleLabelBottom
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
titleLabelBottom
];
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/View/InspectDetailHeaderView.h
deleted
100644 → 0
View file @
fff7b6b9
//
// InspectDetailHeaderView.h
// redstar
//
// Created by admin on 15/11/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "InspectDetailView.h"
#import "TaskDetailModel.h"
@interface
InspectDetailHeaderView
:
UIView
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
@property
(
nonatomic
,
strong
)
InspectDetailView
*
detailView
;
@property
(
nonatomic
,
strong
)
TaskDetailModel
*
taskDetail
;
@end
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/View/InspectDetailHeaderView.m
deleted
100644 → 0
View file @
fff7b6b9
//
// InspectDetailHeaderView.m
// redstar
//
// Created by admin on 15/11/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectDetailHeaderView.h"
@implementation
InspectDetailHeaderView
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
[
self
setup
];
}
return
self
;
}
-
(
instancetype
)
initWithFrame
:
(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
[
self
setup
];
}
return
self
;
}
#pragma mark - Private Methods
-
(
void
)
setup
{
UILabel
*
titleLabel
=
[[
UILabel
alloc
]
init
];
titleLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
titleLabel
.
textAlignment
=
NSTextAlignmentCenter
;
titleLabel
.
textColor
=
kAnnounceTextColor
;
titleLabel
.
backgroundColor
=
kSectionBackGroundColor
;
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
[
self
addSubview
:
titleLabel
];
NSLayoutConstraint
*
titleLabelTop
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleLabelTop
];
NSLayoutConstraint
*
titleLabelLeft
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleLabelLeft
];
NSLayoutConstraint
*
titleLabelWidth
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleLabelWidth
];
NSLayoutConstraint
*
titleLabelHeight
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
45
];
[
self
addConstraint
:
titleLabelHeight
];
_titleLabel
=
titleLabel
;
self
.
detailView
.
backgroundColor
=
[
UIColor
whiteColor
];
UILabel
*
classifyLabel
=
[[
UILabel
alloc
]
init
];
classifyLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
classifyLabel
.
textColor
=
kAnnounceTextColor
;
classifyLabel
.
backgroundColor
=
[
UIColor
clearColor
];
classifyLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
classifyLabel
.
text
=
@"分类项目"
;
[
self
addSubview
:
classifyLabel
];
NSLayoutConstraint
*
classifyTop
=
[
NSLayoutConstraint
constraintWithItem
:
classifyLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
245
];
[
self
addConstraint
:
classifyTop
];
NSLayoutConstraint
*
classifyLeft
=
[
NSLayoutConstraint
constraintWithItem
:
classifyLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
classifyLeft
];
NSLayoutConstraint
*
classifyHeight
=
[
NSLayoutConstraint
constraintWithItem
:
classifyLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
39
];
[
self
addConstraint
:
classifyHeight
];
}
-
(
void
)
setTaskDetail
:
(
TaskDetailModel
*
)
taskDetail
{
_taskDetail
=
taskDetail
;
self
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
name
];
self
.
detailView
.
shopnameLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
store_name
];
self
.
detailView
.
startDateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
beginDate
];
self
.
detailView
.
overDateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
endDate
];
if
(
taskDetail
.
questionCount
==
0
||
taskDetail
.
reportCount
==
0
)
{
self
.
detailView
.
multiplier
=
0
;
}
else
{
self
.
detailView
.
multiplier
=
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
;
}
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"yyyy-MM-dd"
];
// 当前时间
NSDate
*
date
=
[
NSDate
date
];
NSString
*
strDate
=
[
dateFormatter
stringFromDate
:
date
];
NSDate
*
today
=
[
dateFormatter
dateFromString
:
strDate
];
NSLog
(
@"today = %@"
,
today
);
// endTime
NSDate
*
endTime
=
[
dateFormatter
dateFromString
:[
NSString
stringWithFormat
:
@"%@"
,
taskDetail
.
endDate
]];
NSLog
(
@"endTime = %@"
,
endTime
);
NSCalendar
*
cal
=
[
NSCalendar
currentCalendar
];
unsigned
int
unitFlags
=
NSYearCalendarUnit
|
NSMonthCalendarUnit
|
NSDayCalendarUnit
;
NSDateComponents
*
d
=
[
cal
components
:
unitFlags
fromDate
:
today
toDate
:
endTime
options
:
0
];
if
(
d
.
day
>
0
)
{
self
.
detailView
.
dayLabel
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)
d
.
day
];
}
else
{
self
.
detailView
.
dayLabel
.
text
=
@"0"
;
}
if
([
taskDetail
.
state
isEqualToString
:
@"initial"
])
{
if
(
taskDetail
.
reportCount
==
0
||
taskDetail
.
questionCount
==
0
)
{
self
.
detailView
.
progressLabel
.
text
=
@"0%"
;
}
else
{
self
.
detailView
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"未处理 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
}
self
.
detailView
.
progressLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
detailView
.
alreadyLabel
.
textColor
=
kProgressUnSettledColor
;
self
.
detailView
.
allLabel
.
textColor
=
kProgressUnSettledColor
;
}
else
if
([
taskDetail
.
state
isEqualToString
:
@"processing"
])
{
self
.
detailView
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"进行中 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
detailView
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
detailView
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
detailView
.
allLabel
.
textColor
=
kProgressDealWithColor
;
}
else
if
([
taskDetail
.
state
isEqualToString
:
@"reported"
])
{
self
.
detailView
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已上报 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
detailView
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
detailView
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
detailView
.
allLabel
.
textColor
=
kProgressDealWithColor
;
}
else
if
([
taskDetail
.
state
isEqualToString
:
@"finished"
])
{
self
.
detailView
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已评分 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
detailView
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
detailView
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
detailView
.
allLabel
.
textColor
=
kProgressDealWithColor
;
}
else
if
([
taskDetail
.
state
isEqualToString
:
@"published"
])
{
self
.
detailView
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已发布 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
detailView
.
progressLabel
.
textColor
=
kProgressDealWithColor
;
self
.
detailView
.
alreadyLabel
.
textColor
=
kProgressDealWithColor
;
self
.
detailView
.
allLabel
.
textColor
=
kProgressDealWithColor
;
}
else
{
self
.
detailView
.
progressLabel
.
text
=
[
NSString
stringWithFormat
:
@"已过期 %.0f%%"
,
(
CGFloat
)
taskDetail
.
reportCount
/
taskDetail
.
questionCount
*
100
];
self
.
detailView
.
progressLabel
.
textColor
=
kProgressOverDueColor
;
self
.
detailView
.
alreadyLabel
.
textColor
=
kProgressOverDueColor
;
self
.
detailView
.
allLabel
.
textColor
=
kProgressOverDueColor
;
}
self
.
detailView
.
allView
.
backgroundColor
=
kProgressViewAllBackColor
;
self
.
detailView
.
alreadyView
.
backgroundColor
=
kProgressViewAlreadyBackColor
;
self
.
detailView
.
alreadyLabel
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
taskDetail
.
reportCount
];
self
.
detailView
.
allLabel
.
text
=
[
NSString
stringWithFormat
:
@"/%d"
,
taskDetail
.
questionCount
];
}
-
(
InspectDetailView
*
)
detailView
{
if
(
!
_detailView
)
{
_detailView
=
[[
InspectDetailView
alloc
]
init
];
_detailView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_detailView
];
NSLayoutConstraint
*
titleLabelTop
=
[
NSLayoutConstraint
constraintWithItem
:
_detailView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
45
];
[
self
addConstraint
:
titleLabelTop
];
NSLayoutConstraint
*
titleLabelLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_detailView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleLabelLeft
];
NSLayoutConstraint
*
titleLabelWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_detailView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleLabelWidth
];
NSLayoutConstraint
*
titleLabelHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_detailView
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
200
];
[
self
addConstraint
:
titleLabelHeight
];
}
return
_detailView
;
}
@end
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/ViewController/InspectTaskViewController.m
View file @
7fbcb01a
...
...
@@ -7,11 +7,8 @@
//
#import "InspectTaskViewController.h"
#import "InspectDetailView.h"
#import "InspectSortTableCell.h"
#import "InspectDetailHeaderView.h"
#import "TaskGroup.h"
#import "TaskModel.h"
#import "InspectHeaderView.h"
...
...
@@ -26,12 +23,17 @@
#define kTaskSortCell @"InspectTaskSortCell"
#import "InspectTaskDetailCell.h"
#define kTaskDetailCell @"inspectTaskDetailCell"
#import "InspectTitleTableViewCell.h"
#define kTAskTitleCell @"inspectTitleTaViewCell"
@interface
InspectTaskViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
InspectHeaderDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
NSArray
*
taskData
;
@property
(
nonatomic
,
strong
)
InspectDetailHeaderView
*
detailHeaderView
;
@property
(
nonatomic
,
assign
)
BOOL
isOpen
;
@property
(
nonatomic
,
strong
)
TaskDetailModel
*
taskDetail
;
@end
...
...
@@ -64,7 +66,6 @@
self
.
navigationItem
.
leftBarButtonItem
=
backItem
;
UILabel
*
customLab
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
40
,
30
)];
[
customLab
setTextColor
:[
UIColor
whiteColor
]];
[
customLab
setText
:
@"口碑巡检任务"
];
...
...
@@ -74,6 +75,7 @@
// 口碑巡检明细
[
self
requestRankingDetail
];
_isOpen
=
NO
;
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
requestCurrentList
)
...
...
@@ -101,13 +103,11 @@
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@/%@"
,
kRedStarURL
,
kInspectDetailURL
,
self
.
uuid
,
self
.
store_uuid
];
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
__block
InspectTaskViewController
*
weakSelf
=
self
;
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
httpClient
getPraiseDetailWithParameters
:
nil
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"口碑巡检明细PraiseDetail = %@"
,
response
);
NSDictionary
*
dataDict
=
response
[
@"data"
];
TaskDetailModel
*
taskDetail
=
[
TaskDetailModel
taskDetailModelWithDict
:
dataDict
];
weakSelf
.
detailHeaderView
.
taskDetail
=
taskDetail
;
_taskDetail
=
taskDetail
;
NSArray
*
dataArray
=
dataDict
[
@"categories"
];
...
...
@@ -138,14 +138,12 @@
NSLog
(
@"url = %@"
,
url
);
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
__block
InspectTaskViewController
*
weakSelf
=
self
;
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
httpClient
getPraiseDetailWithParameters
:
nil
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"口碑巡检明细PraiseDetail = %@"
,
response
);
NSLog
(
@"error = %@"
,
error
);
NSDictionary
*
dataDict
=
response
[
@"data"
];
TaskDetailModel
*
taskDetail
=
[
TaskDetailModel
taskDetailModelWithDict
:
dataDict
];
weakSelf
.
detailHeaderView
.
taskDetail
=
taskDetail
;
_taskDetail
=
taskDetail
;
NSArray
*
dataArray
=
dataDict
[
@"categories"
];
...
...
@@ -167,80 +165,123 @@
}];
}
-
(
void
)
unfoldCilck
:
(
UIButton
*
)
sender
{
_isOpen
=
!
_isOpen
;
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
];
[
self
.
tableView
reloadRowsAtIndexPaths
:[
NSArray
arrayWithObject
:
indexPath
]
withRowAnimation
:
UITableViewRowAnimationFade
];
}
#pragma mark - TableView Delegate/DataSource
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
_taskData
.
count
;
return
_taskData
.
count
+
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
TaskGroup
*
taskGroup
=
_taskData
[
section
];
NSInteger
count
=
taskGroup
.
isOpened
?
taskGroup
.
answers
.
count
:
0
;
return
count
;
if
(
section
==
0
)
{
return
2
;
}
else
{
TaskGroup
*
taskGroup
=
_taskData
[
section
-
1
];
NSInteger
count
=
taskGroup
.
isOpened
?
taskGroup
.
answers
.
count
:
0
;
return
count
;
}
}
// cell显示的内容
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
InspectSortTableCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kTaskSortCell
];
if
(
!
cell
)
{
cell
=
[[
InspectSortTableCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kTaskSortCell
];
if
(
indexPath
.
section
==
0
)
{
if
(
indexPath
.
row
==
0
)
{
InspectTaskDetailCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kTaskDetailCell
];
if
(
!
cell
)
{
cell
=
[[
InspectTaskDetailCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kTaskDetailCell
];
}
cell
.
taskDetail
=
_taskDetail
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
[
cell
.
unfoldBtn
addTarget
:
self
action
:
@selector
(
unfoldCilck
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
if
(
_isOpen
)
{
cell
.
introDetailLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
_taskDetail
.
remark
];
}
else
{
cell
.
introDetailLabel
.
text
=
@""
;
}
return
cell
;
}
else
{
InspectTitleTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kTAskTitleCell
];
if
(
!
cell
)
{
cell
=
[[
InspectTitleTableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kTAskTitleCell
];
}
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
return
cell
;
}
}
else
{
InspectSortTableCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kTaskSortCell
];
if
(
!
cell
)
{
cell
=
[[
InspectSortTableCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kTaskSortCell
];
}
TaskGroup
*
taskGroup
=
_taskData
[
indexPath
.
section
-
1
];
TaskModel
*
task
=
taskGroup
.
answers
[
indexPath
.
row
];
cell
.
task
=
task
;
cell
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%d、%@"
,
(
int
)
indexPath
.
row
+
1
,
task
.
title
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
return
cell
;
}
TaskGroup
*
taskGroup
=
_taskData
[
indexPath
.
section
];
TaskModel
*
task
=
taskGroup
.
answers
[
indexPath
.
row
];
cell
.
task
=
task
;
cell
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%d、%@"
,
(
int
)
indexPath
.
row
+
1
,
task
.
title
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
TaskGroup
*
taskGroup
=
_taskData
[
indexPath
.
section
]
;
TaskModel
*
task
=
taskGroup
.
answers
[
indexPath
.
row
];
if
(
task
.
state
==
0
)
{
if
(
indexPath
.
section
==
0
)
{
return
;
}
else
{
TaskGroup
*
taskGroup
=
_taskData
[
indexPath
.
section
-
1
];
TaskModel
*
task
=
taskGroup
.
answers
[
indexPath
.
row
];
NSArray
*
permissions
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"permissions"
];
if
([
permissions
containsObject
:
@"500103"
])
{
if
(
task
.
state
==
0
)
{
//InspectNoUpLoadViewController *inspectNotVC = [[InspectNoUpLoadViewController alloc] init];
InspectNotUploadViewController
*
inspectNotVC
=
[[
InspectNotUploadViewController
alloc
]
init
];
inspectNotVC
.
questionCount
=
taskGroup
.
questionCount
;
inspectNotVC
.
taskModel
=
task
;
inspectNotVC
.
store_uuid
=
_taskDetail
.
store_uuid
;
inspectNotVC
.
praiseUuid
=
_taskDetail
.
uuid
;
inspectNotVC
.
questionUuid
=
task
.
uuid
;
[
self
.
navigationController
pushViewController
:
inspectNotVC
animated
:
YES
];
NSArray
*
permissions
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"permissions"
];
if
([
permissions
containsObject
:
@"500103"
])
{
//InspectNoUpLoadViewController *inspectNotVC = [[InspectNoUpLoadViewController alloc] init];
InspectNotUploadViewController
*
inspectNotVC
=
[[
InspectNotUploadViewController
alloc
]
init
];
inspectNotVC
.
questionCount
=
taskGroup
.
questionCount
;
inspectNotVC
.
taskModel
=
task
;
inspectNotVC
.
store_uuid
=
_taskDetail
.
store_uuid
;
inspectNotVC
.
praiseUuid
=
_taskDetail
.
uuid
;
inspectNotVC
.
questionUuid
=
task
.
uuid
;
[
self
.
navigationController
pushViewController
:
inspectNotVC
animated
:
YES
];
}
else
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"您没有编辑检查点的权限!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
}
}
else
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"您没有编辑检查点的权限!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
InspectUploadedViewController
*
inspectVC
=
[[
InspectUploadedViewController
alloc
]
init
];
inspectVC
.
questionCount
=
taskGroup
.
questionCount
;
inspectVC
.
taskModel
=
task
;
[
self
.
navigationController
pushViewController
:
inspectVC
animated
:
YES
];
}
}
else
{
InspectUploadedViewController
*
inspectVC
=
[[
InspectUploadedViewController
alloc
]
init
];
inspectVC
.
questionCount
=
taskGroup
.
questionCount
;
inspectVC
.
taskModel
=
task
;
[
self
.
navigationController
pushViewController
:
inspectVC
animated
:
YES
];
}
}
// cell的高度
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
44
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForHeaderInSection
:
(
NSInteger
)
section
{
return
50
;
if
(
section
==
0
)
{
return
0
;
}
else
{
return
50
;
}
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForFooterInSection
:
(
NSInteger
)
section
...
...
@@ -251,10 +292,14 @@
// 自定义section
-
(
UIView
*
)
tableView
:
(
UITableView
*
)
tableView
viewForHeaderInSection
:
(
NSInteger
)
section
{
InspectHeaderView
*
headView
=
[
InspectHeaderView
headViewWithTableView
:
tableView
];
headView
.
delegate
=
self
;
headView
.
taskGroup
=
_taskData
[
section
];
return
headView
;
if
(
section
==
0
)
{
return
nil
;
}
else
{
InspectHeaderView
*
headView
=
[
InspectHeaderView
headViewWithTableView
:
tableView
];
headView
.
delegate
=
self
;
headView
.
taskGroup
=
_taskData
[
section
-
1
];
return
headView
;
}
}
-
(
void
)
clickHeadView
...
...
@@ -270,10 +315,15 @@
_tableView
.
showsVerticalScrollIndicator
=
NO
;
_tableView
.
showsHorizontalScrollIndicator
=
NO
;
[
_tableView
registerClass
:[
InspectSortTableCell
class
]
forCellReuseIdentifier
:
kTaskSortCell
];
_tableView
.
tableHeaderView
=
self
.
detailHeaderView
;
[
_tableView
registerClass
:[
InspectTaskDetailCell
class
]
forCellReuseIdentifier
:
kTaskDetailCell
];
[
_tableView
registerClass
:[
InspectTitleTableViewCell
class
]
forCellReuseIdentifier
:
kTAskTitleCell
];
_tableView
.
rowHeight
=
UITableViewAutomaticDimension
;
_tableView
.
estimatedRowHeight
=
150
.
0
;
[
self
.
view
addSubview
:
_tableView
];
NSLayoutConstraint
*
tableTop
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
tableTop
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
-
35
];
[
self
.
view
addConstraint
:
tableTop
];
NSLayoutConstraint
*
tableLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
...
...
@@ -288,22 +338,4 @@
return
_tableView
;
}
-
(
InspectDetailHeaderView
*
)
detailHeaderView
{
if
(
!
_detailHeaderView
)
{
_detailHeaderView
=
[[
InspectDetailHeaderView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
285
)];
}
return
_detailHeaderView
;
}
/*
#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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment