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
ea559b8a
Commit
ea559b8a
authored
Nov 26, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评论数据目前为写死测试数据修改
parent
b996770e
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
588 additions
and
277 deletions
+588
-277
project.pbxproj
redstar.xcodeproj/project.pbxproj
+26
-0
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Url.h
redstar/Classes/Macro/Url.h
+4
-3
TaskListModel.h
...ion/WordOfMouth/Inspect/InspectList/Model/TaskListModel.h
+1
-0
TaskDetailModel.h
...n/WordOfMouth/Inspect/InspectTask/Model/TaskDetailModel.h
+1
-0
RankCommentCell.h
...on/WordOfMouth/Ranking/RankingList/Cell/RankCommentCell.h
+17
-0
RankCommentCell.m
...on/WordOfMouth/Ranking/RankingList/Cell/RankCommentCell.m
+120
-0
RankingListCell.m
...on/WordOfMouth/Ranking/RankingList/Cell/RankingListCell.m
+1
-1
RankCommentModel.h
.../WordOfMouth/Ranking/RankingList/Model/RankCommentModel.h
+21
-0
RankCommentModel.m
.../WordOfMouth/Ranking/RankingList/Model/RankCommentModel.m
+24
-0
RankListModel.h
...ion/WordOfMouth/Ranking/RankingList/Model/RankListModel.h
+5
-1
RankListHeaderView.h
...WordOfMouth/Ranking/RankingList/View/RankListHeaderView.h
+25
-0
RankListHeaderView.m
...WordOfMouth/Ranking/RankingList/View/RankListHeaderView.m
+154
-0
RankingListViewController.m
...ng/RankingList/ViewController/RankingListViewController.m
+187
-272
LoginViewController.m
...Classes/Module/Login/ViewController/LoginViewController.m
+2
-0
No files found.
redstar.xcodeproj/project.pbxproj
View file @
ea559b8a
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
841D24FB1BEB75CA0005CC9F
/* QuestionDetailFooterView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
841D24FA1BEB75CA0005CC9F
/* QuestionDetailFooterView.m */
;
};
841D24FB1BEB75CA0005CC9F
/* QuestionDetailFooterView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
841D24FA1BEB75CA0005CC9F
/* QuestionDetailFooterView.m */
;
};
842547FC1BF03977006C79C5
/* QuestionModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
842547FB1BF03977006C79C5
/* QuestionModel.m */
;
};
842547FC1BF03977006C79C5
/* QuestionModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
842547FB1BF03977006C79C5
/* QuestionModel.m */
;
};
8442BA5C1BDB8FDB005E5657
/* MineTableHeaderView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8442BA5B1BDB8FDB005E5657
/* MineTableHeaderView.m */
;
};
8442BA5C1BDB8FDB005E5657
/* MineTableHeaderView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8442BA5B1BDB8FDB005E5657
/* MineTableHeaderView.m */
;
};
846206B51C06AF700015C456
/* RankListHeaderView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
846206B41C06AF700015C456
/* RankListHeaderView.m */
;
};
846206B81C06AFCA0015C456
/* RankCommentModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
846206B71C06AFCA0015C456
/* RankCommentModel.m */
;
};
846206BB1C06AFF50015C456
/* RankCommentCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
846206BA1C06AFF50015C456
/* RankCommentCell.m */
;
};
8462C6EC1BF5F3BE00344DDD
/* MenuButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8462C6EB1BF5F3BE00344DDD
/* MenuButton.m */
;
};
8462C6EC1BF5F3BE00344DDD
/* MenuButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8462C6EB1BF5F3BE00344DDD
/* MenuButton.m */
;
};
84720BC11C0377D300314099
/* CommentWithStarView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84720BC01C0377D300314099
/* CommentWithStarView.m */
;
};
84720BC11C0377D300314099
/* CommentWithStarView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84720BC01C0377D300314099
/* CommentWithStarView.m */
;
};
8474A01C1BE368D700315F30
/* HomeCellItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8474A01B1BE368D700315F30
/* HomeCellItem.m */
;
};
8474A01C1BE368D700315F30
/* HomeCellItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8474A01B1BE368D700315F30
/* HomeCellItem.m */
;
};
...
@@ -135,6 +138,12 @@
...
@@ -135,6 +138,12 @@
842547FB1BF03977006C79C5
/* QuestionModel.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
QuestionModel.m
;
sourceTree
=
"<group>"
;
};
842547FB1BF03977006C79C5
/* QuestionModel.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
QuestionModel.m
;
sourceTree
=
"<group>"
;
};
8442BA5A1BDB8FDB005E5657
/* MineTableHeaderView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
MineTableHeaderView.h
;
sourceTree
=
"<group>"
;
};
8442BA5A1BDB8FDB005E5657
/* MineTableHeaderView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
MineTableHeaderView.h
;
sourceTree
=
"<group>"
;
};
8442BA5B1BDB8FDB005E5657
/* MineTableHeaderView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
MineTableHeaderView.m
;
sourceTree
=
"<group>"
;
};
8442BA5B1BDB8FDB005E5657
/* MineTableHeaderView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
MineTableHeaderView.m
;
sourceTree
=
"<group>"
;
};
846206B31C06AF700015C456
/* RankListHeaderView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
RankListHeaderView.h
;
sourceTree
=
"<group>"
;
};
846206B41C06AF700015C456
/* RankListHeaderView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
RankListHeaderView.m
;
sourceTree
=
"<group>"
;
};
846206B61C06AFCA0015C456
/* RankCommentModel.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
RankCommentModel.h
;
sourceTree
=
"<group>"
;
};
846206B71C06AFCA0015C456
/* RankCommentModel.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
RankCommentModel.m
;
sourceTree
=
"<group>"
;
};
846206B91C06AFF50015C456
/* RankCommentCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
RankCommentCell.h
;
sourceTree
=
"<group>"
;
};
846206BA1C06AFF50015C456
/* RankCommentCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
RankCommentCell.m
;
sourceTree
=
"<group>"
;
};
8462C6EA1BF5F3BE00344DDD
/* MenuButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
MenuButton.h
;
sourceTree
=
"<group>"
;
};
8462C6EA1BF5F3BE00344DDD
/* MenuButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
MenuButton.h
;
sourceTree
=
"<group>"
;
};
8462C6EB1BF5F3BE00344DDD
/* MenuButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
MenuButton.m
;
sourceTree
=
"<group>"
;
};
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>"
;
};
84720BBF1C0377D300314099
/* CommentWithStarView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CommentWithStarView.h
;
sourceTree
=
"<group>"
;
};
...
@@ -532,6 +541,15 @@
...
@@ -532,6 +541,15 @@
path
=
WordOfMouth
;
path
=
WordOfMouth
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
846206B21C06AF700015C456
/* View */
=
{
isa
=
PBXGroup
;
children
=
(
846206B31C06AF700015C456
/* RankListHeaderView.h */
,
846206B41C06AF700015C456
/* RankListHeaderView.m */
,
);
path
=
View
;
sourceTree
=
"<group>"
;
};
8474C5801BE751A2007DCF19
/* CommonFunc */
=
{
8474C5801BE751A2007DCF19
/* CommonFunc */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
...
@@ -721,6 +739,7 @@
...
@@ -721,6 +739,7 @@
848699AD1BDF810900859DFE
/* RankingList */
=
{
848699AD1BDF810900859DFE
/* RankingList */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
846206B21C06AF700015C456
/* View */
,
84F30DA11BFC19DF00CBAD13
/* Model */
,
84F30DA11BFC19DF00CBAD13
/* Model */
,
848699AE1BDF810900859DFE
/* Cell */
,
848699AE1BDF810900859DFE
/* Cell */
,
848699AF1BDF810900859DFE
/* ViewController */
,
848699AF1BDF810900859DFE
/* ViewController */
,
...
@@ -735,6 +754,8 @@
...
@@ -735,6 +754,8 @@
84846E961BE069BC0010550A
/* DateButton.m */
,
84846E961BE069BC0010550A
/* DateButton.m */
,
84846E981BE07CDF0010550A
/* RankingListCell.h */
,
84846E981BE07CDF0010550A
/* RankingListCell.h */
,
84846E991BE07CDF0010550A
/* RankingListCell.m */
,
84846E991BE07CDF0010550A
/* RankingListCell.m */
,
846206B91C06AFF50015C456
/* RankCommentCell.h */
,
846206BA1C06AFF50015C456
/* RankCommentCell.m */
,
);
);
path
=
Cell
;
path
=
Cell
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -1207,6 +1228,8 @@
...
@@ -1207,6 +1228,8 @@
84F30DA11BFC19DF00CBAD13
/* Model */
=
{
84F30DA11BFC19DF00CBAD13
/* Model */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
846206B61C06AFCA0015C456
/* RankCommentModel.h */
,
846206B71C06AFCA0015C456
/* RankCommentModel.m */
,
84F30DA21BFC19F200CBAD13
/* RankListModel.h */
,
84F30DA21BFC19F200CBAD13
/* RankListModel.h */
,
84F30DA31BFC19F200CBAD13
/* RankListModel.m */
,
84F30DA31BFC19F200CBAD13
/* RankListModel.m */
,
);
);
...
@@ -1547,11 +1570,13 @@
...
@@ -1547,11 +1570,13 @@
84AD4F261BF4356A00BFB37C
/* TaskModel.m in Sources */
,
84AD4F261BF4356A00BFB37C
/* TaskModel.m in Sources */
,
841D24FB1BEB75CA0005CC9F
/* QuestionDetailFooterView.m in Sources */
,
841D24FB1BEB75CA0005CC9F
/* QuestionDetailFooterView.m in Sources */
,
84CF0FA21BE9EDA900C855CE
/* TakePhotoView.m in Sources */
,
84CF0FA21BE9EDA900C855CE
/* TakePhotoView.m in Sources */
,
846206BB1C06AFF50015C456
/* RankCommentCell.m in Sources */
,
841D24F81BEB473C0005CC9F
/* CheckPicViewController.m in Sources */
,
841D24F81BEB473C0005CC9F
/* CheckPicViewController.m in Sources */
,
84D80EB61BF714BE00A10EA4
/* GroupTabBar.m in Sources */
,
84D80EB61BF714BE00A10EA4
/* GroupTabBar.m in Sources */
,
8487D7721BF19A9C00E63E90
/* SearchToolBar.m in Sources */
,
8487D7721BF19A9C00E63E90
/* SearchToolBar.m in Sources */
,
84970E361BD8E09D00C1728A
/* LoginViewController.m in Sources */
,
84970E361BD8E09D00C1728A
/* LoginViewController.m in Sources */
,
84720BC11C0377D300314099
/* CommentWithStarView.m in Sources */
,
84720BC11C0377D300314099
/* CommentWithStarView.m in Sources */
,
846206B81C06AFCA0015C456
/* RankCommentModel.m in Sources */
,
84FD8A0A1BDA01D1006E442A
/* MineViewController.m in Sources */
,
84FD8A0A1BDA01D1006E442A
/* MineViewController.m in Sources */
,
848699B21BDF810900859DFE
/* InspectListViewController.m in Sources */
,
848699B21BDF810900859DFE
/* InspectListViewController.m in Sources */
,
84846E971BE069BC0010550A
/* DateButton.m in Sources */
,
84846E971BE069BC0010550A
/* DateButton.m in Sources */
,
...
@@ -1559,6 +1584,7 @@
...
@@ -1559,6 +1584,7 @@
84E363D21BFAC5200061547E
/* TaskListModel.m in Sources */
,
84E363D21BFAC5200061547E
/* TaskListModel.m in Sources */
,
84C9574E1BDB344900083584
/* UIView+Frame.m in Sources */
,
84C9574E1BDB344900083584
/* UIView+Frame.m in Sources */
,
848699B01BDF810900859DFE
/* InspectListCell.m in Sources */
,
848699B01BDF810900859DFE
/* InspectListCell.m in Sources */
,
846206B51C06AF700015C456
/* RankListHeaderView.m in Sources */
,
84AD4F3A1BF4844600BFB37C
/* RankDetailHeaderView.m in Sources */
,
84AD4F3A1BF4844600BFB37C
/* RankDetailHeaderView.m in Sources */
,
8490C4D41BF9DEF0006B6569
/* PictureViewController.m in Sources */
,
8490C4D41BF9DEF0006B6569
/* PictureViewController.m in Sources */
,
8474C5951BE78AE1007DCF19
/* QuestionDetailViewController.m in Sources */
,
8474C5951BE78AE1007DCF19
/* QuestionDetailViewController.m in Sources */
,
...
...
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
ea559b8a
No preview for this file type
redstar/Classes/Macro/Url.h
View file @
ea559b8a
...
@@ -29,9 +29,7 @@
...
@@ -29,9 +29,7 @@
// 口碑排名列表
// 口碑排名列表
#define kRankingListURL @"redstar-server/rest/praise/ranking"
#define kRankingListURL @"redstar-server/rest/praise/ranking"
// 提交问题
// http://.../redstar-server/rest/question/submit?time={time}&operId={operId}&operName={operName}
#define kAddQuestionURL @""
// 提交评论
// 提交评论
//#define kAddCommentURL @"redstar-server/rest/comment/submit?time=2015-06-25+13:59:26&operId=admin&operName=admin"
//#define kAddCommentURL @"redstar-server/rest/comment/submit?time=2015-06-25+13:59:26&operId=admin&operName=admin"
...
@@ -46,4 +44,7 @@
...
@@ -46,4 +44,7 @@
// 上传新问题
// 上传新问题
#define kUpLoadQuestionURL @"redstar-server/rest/question/submit"
#define kUpLoadQuestionURL @"redstar-server/rest/question/submit"
// 上报巡检结果
#define kUpLoadInspectResult @"redstar-server/rest/praise/report/"
#endif
/* Url_h */
#endif
/* Url_h */
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectList/Model/TaskListModel.h
View file @
ea559b8a
...
@@ -34,4 +34,5 @@
...
@@ -34,4 +34,5 @@
@property
(
nonatomic
,
copy
)
NSArray
*
stores
;
@property
(
nonatomic
,
copy
)
NSArray
*
stores
;
@property
(
nonatomic
,
copy
)
NSString
*
uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
version
;
@property
(
nonatomic
,
copy
)
NSString
*
version
;
@property
(
nonatomic
,
copy
)
NSString
*
storePath
;
@end
@end
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/Model/TaskDetailModel.h
View file @
ea559b8a
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
@property
(
nonatomic
,
copy
)
NSString
*
uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
version
;
@property
(
nonatomic
,
copy
)
NSString
*
version
;
@property
(
nonatomic
,
copy
)
NSString
*
storePath
;
+
(
instancetype
)
taskDetailModelWithDict
:(
NSDictionary
*
)
dict
;
+
(
instancetype
)
taskDetailModelWithDict
:(
NSDictionary
*
)
dict
;
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/Cell/RankCommentCell.h
0 → 100644
View file @
ea559b8a
//
// RankCommentCell.h
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RankCommentModel.h"
@interface
RankCommentCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
peopleLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
dateLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
commentLabel
;
@property
(
nonatomic
,
strong
)
RankCommentModel
*
rankComment
;
@end
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/Cell/RankCommentCell.m
0 → 100644
View file @
ea559b8a
//
// RankCommentCell.m
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankCommentCell.h"
@interface
RankCommentCell
()
@end
@implementation
RankCommentCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
}
return
self
;
}
-
(
void
)
setRankComment
:(
RankCommentModel
*
)
rankComment
{
_rankComment
=
rankComment
;
self
.
peopleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
rankComment
.
commentor_name
];
self
.
dateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
rankComment
.
commentTime
];
self
.
commentLabel
.
text
=
[
NSString
stringWithFormat
:
@"评论:%@"
,
rankComment
.
comment
];
}
-
(
UILabel
*
)
peopleLabel
{
if
(
!
_peopleLabel
)
{
_peopleLabel
=
[[
UILabel
alloc
]
init
];
_peopleLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_peopleLabel
.
textColor
=
kRankHeadTitleTextColor
;
_peopleLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
contentView
addSubview
:
_peopleLabel
];
NSLayoutConstraint
*
shoppingTop
=
[
NSLayoutConstraint
constraintWithItem
:
_peopleLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
shoppingTop
];
NSLayoutConstraint
*
shoppingRight
=
[
NSLayoutConstraint
constraintWithItem
:
_peopleLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeCenterX
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
shoppingRight
];
NSLayoutConstraint
*
shoppingWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_peopleLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
30
];
[
self
.
contentView
addConstraint
:
shoppingWidth
];
NSLayoutConstraint
*
shoppingHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_peopleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
.
contentView
addConstraint
:
shoppingHeight
];
}
return
_peopleLabel
;
}
-
(
UILabel
*
)
dateLabel
{
if
(
!
_dateLabel
)
{
_dateLabel
=
[[
UILabel
alloc
]
init
];
_dateLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_dateLabel
.
textColor
=
kRankHeadTitleTextColor
;
_dateLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
contentView
addSubview
:
_dateLabel
];
NSLayoutConstraint
*
shoppingTop
=
[
NSLayoutConstraint
constraintWithItem
:
_dateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
shoppingTop
];
NSLayoutConstraint
*
shoppingRight
=
[
NSLayoutConstraint
constraintWithItem
:
_dateLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
shoppingRight
];
NSLayoutConstraint
*
shoppingWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_dateLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeCenterX
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
shoppingWidth
];
NSLayoutConstraint
*
shoppingHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_dateLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
.
contentView
addConstraint
:
shoppingHeight
];
}
return
_dateLabel
;
}
-
(
UILabel
*
)
commentLabel
{
if
(
!
_commentLabel
)
{
_commentLabel
=
[[
UILabel
alloc
]
init
];
_commentLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_commentLabel
.
textColor
=
kRankHeadTitleTextColor
;
_commentLabel
.
numberOfLines
=
0
;
_commentLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
contentView
addSubview
:
_commentLabel
];
NSLayoutConstraint
*
shoppingTop
=
[
NSLayoutConstraint
constraintWithItem
:
_commentLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
peopleLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
shoppingTop
];
NSLayoutConstraint
*
shoppingRight
=
[
NSLayoutConstraint
constraintWithItem
:
_commentLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
.
contentView
addConstraint
:
shoppingRight
];
NSLayoutConstraint
*
shoppingWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_commentLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
30
];
[
self
.
contentView
addConstraint
:
shoppingWidth
];
NSLayoutConstraint
*
shoppingHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_commentLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:-
5
];
[
self
.
contentView
addConstraint
:
shoppingHeight
];
}
return
_commentLabel
;
}
-
(
void
)
awakeFromNib
{
// Initialization code
}
-
(
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/Ranking/RankingList/Cell/RankingListCell.m
View file @
ea559b8a
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
{
{
_rankList
=
rankList
;
_rankList
=
rankList
;
[
self
.
shopNameButton
setTitle
:[
NSString
stringWithFormat
:
@"%@"
,
rankList
.
store_name
]
forState
:
UIControlStateNormal
];
[
self
.
shopNameButton
setTitle
:[
NSString
stringWithFormat
:
@"%@"
,
rankList
.
store_name
]
forState
:
UIControlStateNormal
];
self
.
scoreLabel
.
text
=
[
NSString
stringWithFormat
:
@"%
.0f
"
,
rankList
.
score
];
self
.
scoreLabel
.
text
=
[
NSString
stringWithFormat
:
@"%
@
"
,
rankList
.
score
];
}
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/Model/RankCommentModel.h
0 → 100644
View file @
ea559b8a
//
// RankCommentModel.h
// redstar
//
// Created by admin on 15/11/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface
RankCommentModel
:
NSObject
@property
(
nonatomic
,
copy
)
NSString
*
uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
commentor_uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
commentor_code
;
@property
(
nonatomic
,
copy
)
NSString
*
commentor_name
;
@property
(
nonatomic
,
copy
)
NSString
*
comment
;
@property
(
nonatomic
,
copy
)
NSString
*
commentTime
;
+
(
instancetype
)
rankCommentModelWithDict
:(
NSDictionary
*
)
dict
;
-
(
instancetype
)
initWithDict
:(
NSDictionary
*
)
dict
;
@end
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/Model/RankCommentModel.m
0 → 100644
View file @
ea559b8a
//
// RankCommentModel.m
// redstar
//
// Created by admin on 15/11/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankCommentModel.h"
@implementation
RankCommentModel
+
(
instancetype
)
rankCommentModelWithDict
:(
NSDictionary
*
)
dict
{
return
[[
self
alloc
]
initWithDict
:
dict
];
}
-
(
instancetype
)
initWithDict
:(
NSDictionary
*
)
dict
{
if
(
self
=
[
super
init
])
{
[
self
setValuesForKeysWithDictionary
:
dict
];
}
return
self
;
}
@end
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/Model/RankListModel.h
View file @
ea559b8a
...
@@ -14,11 +14,15 @@
...
@@ -14,11 +14,15 @@
@property
(
nonatomic
,
copy
)
NSString
*
store_uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
store_uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
store_code
;
@property
(
nonatomic
,
copy
)
NSString
*
store_code
;
@property
(
nonatomic
,
copy
)
NSString
*
store_name
;
@property
(
nonatomic
,
copy
)
NSString
*
store_name
;
@property
(
nonatomic
,
assign
)
double
score
;
@property
(
nonatomic
,
copy
)
NSString
*
score
;
@property
(
nonatomic
,
copy
)
NSString
*
reported
;
@property
(
nonatomic
,
copy
)
NSString
*
reported
;
@property
(
nonatomic
,
copy
)
NSString
*
commentId
;
@property
(
nonatomic
,
copy
)
NSString
*
commentId
;
@property
(
nonatomic
,
copy
)
NSString
*
ranking
;
@property
(
nonatomic
,
copy
)
NSString
*
ranking
;
@property
(
nonatomic
,
copy
)
NSString
*
storePath
;
@property
(
nonatomic
,
copy
)
NSString
*
storeAddress
;
@property
(
nonatomic
,
strong
)
NSArray
*
storePictures
;
@property
(
nonatomic
,
assign
,
getter
=
isOpened
)
BOOL
opened
;
@property
(
nonatomic
,
strong
)
NSArray
*
comments
;
@property
(
nonatomic
,
strong
)
NSArray
*
comments
;
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/View/RankListHeaderView.h
0 → 100644
View file @
ea559b8a
//
// RankListHeaderView.h
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@class
RankListModel
;
@protocol
RankListHeaderDelegate
<
NSObject
>
@optional
-
(
void
)
clickHeadView
;
@end
@interface
RankListHeaderView
:
UITableViewHeaderFooterView
@property
(
nonatomic
,
strong
)
RankListModel
*
rankListModel
;
@property
(
nonatomic
,
weak
)
id
<
RankListHeaderDelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
UIButton
*
pushButton
;
+
(
instancetype
)
headViewWithTableView
:(
UITableView
*
)
tableView
section
:(
NSInteger
)
section
;
@end
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/View/RankListHeaderView.m
0 → 100644
View file @
ea559b8a
//
// RankListHeaderView.m
// redstar
//
// Created by admin on 15/11/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankListHeaderView.h"
#import "RankListModel.h"
#define kPushTag 2354924
@interface
RankListHeaderView
()
{
UIView
*
_bgView
;
UIImageView
*
_arrowImageView
;
UIButton
*
_bgButton
;
UIButton
*
_otherButton
;
UILabel
*
_scoreLabel
;
NSInteger
_section
;
UILabel
*
_gradeLabel
;
UIImageView
*
_gradeImageView
;
}
@end
@implementation
RankListHeaderView
+
(
instancetype
)
headViewWithTableView
:(
UITableView
*
)
tableView
section
:(
NSInteger
)
section
{
static
NSString
*
headIdentifier
=
@"header"
;
RankListHeaderView
*
headView
=
(
RankListHeaderView
*
)[
tableView
dequeueReusableCellWithIdentifier
:
headIdentifier
];
if
(
headView
==
nil
)
{
headView
=
[[
RankListHeaderView
alloc
]
initWithReuseIdentifier
:
headIdentifier
section
:(
NSInteger
)
section
];
}
return
headView
;
}
-
(
id
)
initWithReuseIdentifier
:(
NSString
*
)
reuseIdentifier
section
:(
NSInteger
)
section
{
if
(
self
=
[
super
initWithReuseIdentifier
:
reuseIdentifier
])
{
UIView
*
bgView
=
[[
UIView
alloc
]
init
];
bgView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
self
addSubview
:
bgView
];
_bgView
=
bgView
;
UIButton
*
bgButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
bgButton
.
contentHorizontalAlignment
=
UIControlContentHorizontalAlignmentLeft
;
bgButton
.
contentEdgeInsets
=
UIEdgeInsetsMake
(
0
,
0
,
0
,
10
);
bgButton
.
titleEdgeInsets
=
UIEdgeInsetsMake
(
0
,
45
,
0
,
0
);
[
bgButton
setTitleColor
:
kLightBlack
forState
:
UIControlStateNormal
];
bgButton
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
18
.
0
];
[
bgButton
addTarget
:
self
action
:
@selector
(
headBtnClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
bgButton
.
backgroundColor
=
[
UIColor
whiteColor
];
[
self
addSubview
:
bgButton
];
_bgButton
=
bgButton
;
UIImageView
*
arrowIMView
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"grey-trilateral_right"
]];
[
self
addSubview
:
arrowIMView
];
_arrowImageView
=
arrowIMView
;
UILabel
*
scoreLabel
=
[[
UILabel
alloc
]
init
];
scoreLabel
.
textAlignment
=
NSTextAlignmentCenter
;
scoreLabel
.
textColor
=
kNavigationBarColor
;
scoreLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
[
self
addSubview
:
scoreLabel
];
_scoreLabel
=
scoreLabel
;
if
(
section
<
3
)
{
UIImageView
*
gradeImageView
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:[
NSString
stringWithFormat
:
@"medal_0%ld"
,
section
+
1
]]];
[
self
addSubview
:
gradeImageView
];
_gradeImageView
=
gradeImageView
;
}
else
{
UILabel
*
gradeLabel
=
[[
UILabel
alloc
]
init
];
gradeLabel
.
textAlignment
=
NSTextAlignmentCenter
;
gradeLabel
.
textColor
=
kLightBlack
;
gradeLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
.
0
];
[
self
addSubview
:
gradeLabel
];
gradeLabel
.
text
=
[
NSString
stringWithFormat
:
@"第%ld名"
,
section
+
1
];
_gradeLabel
=
gradeLabel
;
}
_section
=
section
;
UIButton
*
pushButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
pushButton
.
tag
=
kPushTag
+
section
;
[
_bgView
addSubview
:
pushButton
];
_pushButton
=
pushButton
;
}
return
self
;
}
-
(
void
)
headBtnClick
{
_rankListModel
.
opened
=
!
_rankListModel
.
isOpened
;
if
([
_delegate
respondsToSelector
:
@selector
(
clickHeadView
)])
{
[
_delegate
clickHeadView
];
}
}
-
(
void
)
setRankListModel
:
(
RankListModel
*
)
rankListModel
{
_rankListModel
=
rankListModel
;
[
_bgButton
setTitle
:
rankListModel
.
store_name
forState
:
UIControlStateNormal
];
_scoreLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@ 分"
,
rankListModel
.
score
];
}
-
(
void
)
didMoveToSuperview
{
if
(
_rankListModel
.
isOpened
)
{
[
UIView
animateWithDuration
:
0
.
2
animations
:
^
{
_arrowImageView
.
transform
=
CGAffineTransformIdentity
;
_arrowImageView
.
transform
=
CGAffineTransformMakeRotation
(
M_PI
/
2
);
}];
}
else
{
[
UIView
animateWithDuration
:
0
.
2
animations
:
^
{
_arrowImageView
.
transform
=
CGAffineTransformIdentity
;
_arrowImageView
.
transform
=
CGAffineTransformMakeRotation
(
0
);
}];
}
}
-
(
void
)
layoutSubviews
{
[
super
layoutSubviews
];
_bgView
.
frame
=
self
.
bounds
;
_bgButton
.
frame
=
CGRectMake
(
30
,
0
,
0
.
3
*
kScreenWidth
,
self
.
bounds
.
size
.
height
);
_arrowImageView
.
frame
=
CGRectMake
(
20
,
(
self
.
frame
.
size
.
height
-
11
)
/
2
,
9
,
10
);
_scoreLabel
.
frame
=
CGRectMake
(
0
.
4
*
kScreenWidth
,
0
,
0
.
3
*
kScreenWidth
,
50
);
if
(
_section
<
3
)
{
_gradeImageView
.
frame
=
CGRectMake
(
0
.
8
*
kScreenWidth
,
9
,
36
,
33
);
}
else
{
_gradeLabel
.
frame
=
CGRectMake
(
0
.
7
*
kScreenWidth
,
0
,
0
.
3
*
kScreenWidth
,
50
);
}
_pushButton
.
frame
=
CGRectMake
(
30
+
0
.
3
*
kScreenWidth
,
0
,
0
.
7
*
kScreenWidth
-
30
,
self
.
bounds
.
size
.
height
);;
}
@end
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/ViewController/RankingListViewController.m
View file @
ea559b8a
...
@@ -13,20 +13,31 @@
...
@@ -13,20 +13,31 @@
#import "HttpClient.h"
#import "HttpClient.h"
#import "RankListModel.h"
#import "RankListModel.h"
#import "NoDataView.h"
#import "NoDataView.h"
#import "RankCommentModel.h"
#import "RankListHeaderView.h"
#import "RankCommentCell.h"
#import <MBProgressHUD.h>
#import <MBProgressHUD.h>
#define kRankingCell @"RankingTableViewCell"
#define kRankingCell @"RankingTableViewCell"
#define kShopNameBtnTag 15000
#define kShopNameBtnTag 15000
#define kPushTag 2354924
@interface
RankingListViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
@interface
RankingListViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
RankListHeaderDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
UIView
*
headView
;
@property
(
nonatomic
,
strong
)
UIView
*
headView
;
@property
(
nonatomic
,
strong
)
UIView
*
lineView1
;
@property
(
nonatomic
,
strong
)
UIView
*
lineView1
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
selectedIndexes
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allRankListArray
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allRankListArray
;
@property
(
nonatomic
,
strong
)
NoDataView
*
noDataView
;
@property
(
nonatomic
,
strong
)
NoDataView
*
noDataView
;
@property
(
nonatomic
,
strong
)
UILabel
*
shoppingLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
scoreLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
gradeLabel
;
@property
(
nonatomic
,
strong
)
NSArray
*
rankData
;
@end
@end
@implementation
RankingListViewController
@implementation
RankingListViewController
...
@@ -56,14 +67,16 @@
...
@@ -56,14 +67,16 @@
self
.
edgesForExtendedLayout
=
UIRectEdgeNone
;
self
.
edgesForExtendedLayout
=
UIRectEdgeNone
;
}
}
// 初始化容器
self
.
selectedIndexes
=
[[
NSMutableDictionary
alloc
]
init
];
[
self
addTableViews
];
[
self
addTableViews
];
[
self
requestRankingList
];
[
self
requestRankingList
];
self
.
shoppingLabel
.
text
=
@"商场名称"
;
self
.
scoreLabel
.
text
=
@"总分"
;
self
.
gradeLabel
.
text
=
@"排名"
;
}
}
-
(
void
)
didReceiveMemoryWarning
{
-
(
void
)
didReceiveMemoryWarning
{
...
@@ -97,11 +110,17 @@
...
@@ -97,11 +110,17 @@
NSLog
(
@"口碑排名response = %@"
,
response
);
NSLog
(
@"口碑排名response = %@"
,
response
);
NSDictionary
*
dataDict
=
response
[
@"data"
];
NSDictionary
*
dataDict
=
response
[
@"data"
];
NSArray
*
dataArray
=
dataDict
[
@"records"
];
NSArray
*
dataArray
=
dataDict
[
@"records"
];
NSMutableArray
*
tgArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
ListDict
in
dataArray
)
{
for
(
NSDictionary
*
ListDict
in
dataArray
)
{
RankListModel
*
rankList
=
[
RankListModel
rankListModelWithDict
:
ListDict
];
RankListModel
*
rankList
=
[
RankListModel
rankListModelWithDict
:
ListDict
];
[
weakSelf
.
allRankList
Array
addObject
:
rankList
];
[
tg
Array
addObject
:
rankList
];
}
}
if
(
_allRankListArray
.
count
==
0
)
{
_rankData
=
tgArray
;
if
(
_rankData
.
count
==
0
)
{
weakSelf
.
noDataView
.
backgroundColor
=
[
UIColor
whiteColor
];
weakSelf
.
noDataView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
...
@@ -109,7 +128,7 @@
...
@@ -109,7 +128,7 @@
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
self
.
tableView
.
dataSource
=
self
;
NSString
*
shopCount
=
[
NSString
stringWithFormat
:
@"%lu 家"
,
(
unsigned
long
)
_
allRankListArray
.
count
];
NSString
*
shopCount
=
[
NSString
stringWithFormat
:
@"%lu 家"
,
(
unsigned
long
)
_
rankData
.
count
];
NSMutableAttributedString
*
shopAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
shopCount
];
NSMutableAttributedString
*
shopAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
shopCount
];
[
shopAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kShopCountTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
21
.
0
f
]}
range
:
NSMakeRange
(
0
,
shopCount
.
length
-
2
)];
[
shopAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kShopCountTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
21
.
0
f
]}
range
:
NSMakeRange
(
0
,
shopCount
.
length
-
2
)];
[
shopAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
[
UIColor
blackColor
],
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
shopCount
.
length
-
2
,
2
)];
[
shopAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
[
UIColor
blackColor
],
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
shopCount
.
length
-
2
,
2
)];
...
@@ -140,201 +159,51 @@
...
@@ -140,201 +159,51 @@
}
}
-
(
BOOL
)
cellIsSelected
:
(
NSIndexPath
*
)
indexPath
{
// Return whether the cell at the specified index path is selected or not
NSNumber
*
selectedIndex
=
[
_selectedIndexes
objectForKey
:
indexPath
];
return
selectedIndex
==
nil
?
FALSE
:
[
selectedIndex
boolValue
];
}
-
(
void
)
loadMoreInfo
:
(
UIButton
*
)
sender
#pragma mark - UITableView DataSource/Delegate
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
{
NSInteger
key
=
sender
.
tag
-
kShopNameBtnTag
;
return
_rankData
.
count
;
RankListModel
*
rankList
=
_allRankListArray
[
key
];
NSArray
*
infoArray
=
rankList
.
comments
;
RankingListCell
*
cell
=
(
RankingListCell
*
)[[
sender
superview
]
superview
];
cell
.
isDrop
=
!
cell
.
isDrop
;
NSIndexPath
*
path
=
[
self
.
tableView
indexPathForCell
:
cell
];
[
_tableView
deselectRowAtIndexPath
:
path
animated
:
TRUE
];
BOOL
isSelected
=
!
[
self
cellIsSelected
:
path
];
NSNumber
*
selectedIndex
=
[
NSNumber
numberWithBool
:
isSelected
];
[
_selectedIndexes
setObject
:
selectedIndex
forKey
:
path
];
if
(
cell
.
isDrop
)
{
[
UIView
animateWithDuration
:
0
.
2
animations
:
^
{
cell
.
arrowImageView
.
transform
=
CGAffineTransformIdentity
;
cell
.
arrowImageView
.
transform
=
CGAffineTransformMakeRotation
(
M_PI
/
2
);
}];
cell
.
someoneLabel
=
[[
UILabel
alloc
]
init
];
cell
.
someoneLabel
.
text
=
@"集团领导某总"
;
cell
.
someoneLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
cell
.
someoneLabel
.
textAlignment
=
NSTextAlignmentCenter
;
cell
.
someoneLabel
.
textColor
=
kRankHeadTitleTextColor
;
cell
.
someoneLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
cell
.
contentView
addSubview
:
cell
.
someoneLabel
];
cell
.
dateLabel
=
[[
UILabel
alloc
]
init
];
cell
.
dateLabel
.
text
=
@"2015-09-25 12:12:09"
;
cell
.
dateLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
cell
.
dateLabel
.
textAlignment
=
NSTextAlignmentCenter
;
cell
.
dateLabel
.
textColor
=
kRankHeadTitleTextColor
;
cell
.
dateLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
cell
.
contentView
addSubview
:
cell
.
dateLabel
];
cell
.
remarkLabel
=
[[
UILabel
alloc
]
init
];
cell
.
remarkLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
cell
.
remarkLabel
.
text
=
@"评语:该店进步非常大,值得大家一起学习!"
;
cell
.
remarkLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
cell
.
remarkLabel
.
textColor
=
kRankHeadTitleTextColor
;
[
cell
.
contentView
addSubview
:
cell
.
remarkLabel
];
NSLayoutConstraint
*
someoneTop
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
someoneLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
shopNameButton
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
cell
.
contentView
addConstraint
:
someoneTop
];
NSLayoutConstraint
*
someoneCenterX
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
someoneLabel
attribute
:
NSLayoutAttributeCenterX
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
shopNameButton
attribute
:
NSLayoutAttributeCenterX
multiplier
:
1
.
0
constant
:
5
];
[
cell
.
contentView
addConstraint
:
someoneCenterX
];
NSLayoutConstraint
*
someoneWidth
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
someoneLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
100
];
[
cell
.
contentView
addConstraint
:
someoneWidth
];
NSLayoutConstraint
*
someoneHeight
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
someoneLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
cell
.
contentView
addConstraint
:
someoneHeight
];
//
NSLayoutConstraint
*
dateTop
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
dateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
shopNameButton
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
cell
.
contentView
addConstraint
:
dateTop
];
NSLayoutConstraint
*
dateLeft
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
dateLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
someoneLabel
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
10
];
[
cell
.
contentView
addConstraint
:
dateLeft
];
NSLayoutConstraint
*
dateRight
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
dateLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
cell
.
contentView
addConstraint
:
dateRight
];
NSLayoutConstraint
*
dateHeight
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
dateLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
cell
.
contentView
addConstraint
:
dateHeight
];
//
NSLayoutConstraint
*
remarkTop
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
remarkLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
someoneLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
cell
.
contentView
addConstraint
:
remarkTop
];
NSLayoutConstraint
*
remarkLeft
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
remarkLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
someoneLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
3
];
[
cell
.
contentView
addConstraint
:
remarkLeft
];
NSLayoutConstraint
*
remarkRight
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
remarkLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
cell
.
contentView
addConstraint
:
remarkRight
];
NSLayoutConstraint
*
remarkHeight
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
remarkLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
cell
.
contentView
addConstraint
:
remarkHeight
];
if
(
!
infoArray
.
count
==
0
)
{
NSDictionary
*
infoDict
=
infoArray
[
0
];
cell
.
someoneLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
infoDict
[
@"commentor"
]];
cell
.
dateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
infoDict
[
@"commentTime"
]];
cell
.
remarkLabel
.
text
=
[
NSString
stringWithFormat
:
@"评语:%@"
,
infoDict
[
@"comment"
]];
}
}
else
{
[
UIView
animateWithDuration
:
0
.
2
animations
:
^
{
cell
.
arrowImageView
.
transform
=
CGAffineTransformIdentity
;
cell
.
arrowImageView
.
transform
=
CGAffineTransformMakeRotation
(
0
);
}];
if
(
cell
.
someoneLabel
)
{
[
cell
.
someoneLabel
removeFromSuperview
];
cell
.
someoneLabel
=
nil
;
}
if
(
cell
.
dateLabel
)
{
[
cell
.
dateLabel
removeFromSuperview
];
cell
.
dateLabel
=
nil
;
}
if
(
cell
.
remarkLabel
)
{
[
cell
.
remarkLabel
removeFromSuperview
];
cell
.
remarkLabel
=
nil
;
}
}
[
_tableView
beginUpdates
];
[
_tableView
endUpdates
];
}
}
#pragma mark - UITableView DataSource/Delegate
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
{
return
_allRankListArray
.
count
;
RankListModel
*
rankList
=
_rankData
[
section
];
NSInteger
count
=
rankList
.
isOpened
?
rankList
.
comments
.
count
:
0
;
return
count
;
}
}
// cell显示的内容
// cell显示的内容
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
{
Rank
ingLis
tCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kRankingCell
];
Rank
Commen
tCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kRankingCell
];
if
(
!
cell
)
{
if
(
!
cell
)
{
cell
=
[[
Rank
ingLis
tCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kRankingCell
];
cell
=
[[
Rank
Commen
tCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kRankingCell
];
}
}
// 前三个店名次显示图片
RankListModel
*
rankListModel
=
_rankData
[
indexPath
.
section
];
if
(
indexPath
.
row
<
3
)
{
RankCommentModel
*
commentModel
=
rankListModel
.
comments
[
indexPath
.
row
];
cell
.
scoreState
=
ScoreStateHigh
;
cell
.
rankComment
=
commentModel
;
NSString
*
imageName
=
[
NSString
stringWithFormat
:
@"medal_0%ld"
,
(
long
)(
indexPath
.
row
+
1
)];
cell
.
gradeImageView
.
image
=
[
UIImage
imageNamed
:
imageName
];
}
else
{
cell
.
scoreState
=
ScoreStateLow
;
NSString
*
rankStr
=
[
NSString
stringWithFormat
:
@"第 %ld 名"
,
(
long
)(
indexPath
.
row
+
1
)];
NSMutableAttributedString
*
rankAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
rankStr
];
[
rankAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kRankHeadTitleTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
14
.
0
f
]}
range
:
NSMakeRange
(
0
,
1
)];
[
rankAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kGradeNumberTextColor
}
range
:
NSMakeRange
(
1
,
rankStr
.
length
-
2
)];
[
rankAttr
addAttribute
:
NSFontAttributeName
value
:[
UIFont
fontWithName
:
@"Arial-BoldMT"
size
:
18
.
0
]
range
:
NSMakeRange
(
1
,
rankStr
.
length
-
2
)];
[
rankAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kRankHeadTitleTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
14
.
0
f
]}
range
:
NSMakeRange
(
rankStr
.
length
-
1
,
1
)];
[
cell
.
gradeLabel
setAttributedText
:
rankAttr
];
}
RankListModel
*
rankList
=
_allRankListArray
[
indexPath
.
row
];
[
cell
.
shopNameButton
setTitle
:
rankList
.
store_name
forState
:
UIControlStateNormal
];
cell
.
scoreLabel
.
text
=
[
NSString
stringWithFormat
:
@"%.0f"
,
rankList
.
score
];
cell
.
shopNameButton
.
tag
=
(
kShopNameBtnTag
+
indexPath
.
row
);
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
// 添加点击事件
[
cell
.
shopNameButton
addTarget
:
self
action
:
@selector
(
loadMoreInfo
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
return
cell
;
return
cell
;
}
}
// cell的点击事件
// cell的点击事件
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
{
RankListModel
*
rankList
=
_
allRankListArray
[
indexPath
.
row
];
RankListModel
*
rankList
=
_
rankData
[
indexPath
.
section
];
RankDetailViewController
*
rankDetailVC
=
[[
RankDetailViewController
alloc
]
init
];
RankDetailViewController
*
rankDetailVC
=
[[
RankDetailViewController
alloc
]
init
];
rankDetailVC
.
indexRow
=
indexPath
.
row
;
rankDetailVC
.
indexRow
=
indexPath
.
section
;
rankDetailVC
.
uuid
=
rankList
.
uuid
;
rankDetailVC
.
uuid
=
rankList
.
uuid
;
rankDetailVC
.
store_uuid
=
rankList
.
store_uuid
;
rankDetailVC
.
store_uuid
=
rankList
.
store_uuid
;
[
self
.
navigationController
pushViewController
:
rankDetailVC
animated
:
YES
];
[
self
.
navigationController
pushViewController
:
rankDetailVC
animated
:
YES
];
}
}
// cell的高度
// cell的高度
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
([
self
cellIsSelected
:
indexPath
])
{
return
108
;
}
return
50
;
}
// section高度
// section高度
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForHeaderInSection
:
(
NSInteger
)
section
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForHeaderInSection
:
(
NSInteger
)
section
{
{
return
4
0
;
return
5
0
;
}
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForFooterInSection
:
(
NSInteger
)
section
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForFooterInSection
:
(
NSInteger
)
section
...
@@ -345,77 +214,24 @@
...
@@ -345,77 +214,24 @@
// 自定义section
// 自定义section
-
(
UIView
*
)
tableView
:
(
UITableView
*
)
tableView
viewForHeaderInSection
:
(
NSInteger
)
section
-
(
UIView
*
)
tableView
:
(
UITableView
*
)
tableView
viewForHeaderInSection
:
(
NSInteger
)
section
{
{
// 创建sectionView
RankListHeaderView
*
headView
=
[
RankListHeaderView
headViewWithTableView
:
tableView
section
:
section
];
UIView
*
sectionView
=
[[
UIView
alloc
]
init
];
headView
.
delegate
=
self
;
sectionView
.
backgroundColor
=
kSectionBackGroundColor
;
[
headView
.
pushButton
addTarget
:
self
action
:
@selector
(
pushclick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
headView
.
rankListModel
=
_rankData
[
section
];
// 商场
return
headView
;
UILabel
*
shoppingLabel
=
[[
UILabel
alloc
]
init
];
}
shoppingLabel
.
text
=
@"商场名称"
;
shoppingLabel
.
textAlignment
=
NSTextAlignmentCenter
;
-
(
void
)
pushclick
:
(
UIButton
*
)
sender
shoppingLabel
.
textColor
=
kRankHeadTitleTextColor
;
{
shoppingLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
NSInteger
section
=
sender
.
tag
-
kPushTag
;
shoppingLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
sectionView
addSubview
:
shoppingLabel
];
// 总分
UILabel
*
scoreLabel
=
[[
UILabel
alloc
]
init
];
scoreLabel
.
text
=
@"总分"
;
scoreLabel
.
textAlignment
=
NSTextAlignmentCenter
;
scoreLabel
.
textColor
=
kRankHeadTitleTextColor
;
scoreLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
scoreLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
sectionView
addSubview
:
scoreLabel
];
// 排名
UILabel
*
gradeLabel
=
[[
UILabel
alloc
]
init
];
gradeLabel
.
text
=
@"排名"
;
gradeLabel
.
textAlignment
=
NSTextAlignmentCenter
;
gradeLabel
.
textColor
=
kRankHeadTitleTextColor
;
gradeLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
gradeLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
sectionView
addSubview
:
gradeLabel
];
//
NSLayoutConstraint
*
shoppingTop
=
[
NSLayoutConstraint
constraintWithItem
:
shoppingLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
5
];
[
sectionView
addConstraint
:
shoppingTop
];
NSLayoutConstraint
*
shoppingLeft
=
[
NSLayoutConstraint
constraintWithItem
:
shoppingLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
sectionView
addConstraint
:
shoppingLeft
];
NSLayoutConstraint
*
shoppingRight
=
[
NSLayoutConstraint
constraintWithItem
:
shoppingLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
scoreLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
sectionView
addConstraint
:
shoppingRight
];
NSLayoutConstraint
*
shoppingBottom
=
[
NSLayoutConstraint
constraintWithItem
:
shoppingLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
sectionView
addConstraint
:
shoppingBottom
];
NSLayoutConstraint
*
shoppingWidth
=
[
NSLayoutConstraint
constraintWithItem
:
shoppingLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
scoreLabel
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
2
constant
:
0
];
[
sectionView
addConstraint
:
shoppingWidth
];
//
NSLayoutConstraint
*
scoreTop
=
[
NSLayoutConstraint
constraintWithItem
:
scoreLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
5
];
[
sectionView
addConstraint
:
scoreTop
];
NSLayoutConstraint
*
scoreRight
=
[
NSLayoutConstraint
constraintWithItem
:
scoreLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
gradeLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
sectionView
addConstraint
:
scoreRight
];
NSLayoutConstraint
*
scoreWidth
=
[
NSLayoutConstraint
constraintWithItem
:
scoreLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
gradeLabel
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
[
sectionView
addConstraint
:
scoreWidth
];
NSLayoutConstraint
*
scoreBottom
=
[
NSLayoutConstraint
constraintWithItem
:
scoreLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
sectionView
addConstraint
:
scoreBottom
];
//
NSLayoutConstraint
*
gradeTop
=
[
NSLayoutConstraint
constraintWithItem
:
gradeLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
5
];
[
sectionView
addConstraint
:
gradeTop
];
NSLayoutConstraint
*
gradeRight
=
[
NSLayoutConstraint
constraintWithItem
:
gradeLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
sectionView
addConstraint
:
gradeRight
];
NSLayoutConstraint
*
gradeBottom
=
[
NSLayoutConstraint
constraintWithItem
:
gradeLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
sectionView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
RankListModel
*
rankList
=
_rankData
[
section
];
[
sectionView
addConstraint
:
gradeBottom
];
return
sectionView
;
RankDetailViewController
*
rankDetailVC
=
[[
RankDetailViewController
alloc
]
init
];
rankDetailVC
.
indexRow
=
section
;
rankDetailVC
.
uuid
=
rankList
.
uuid
;
rankDetailVC
.
store_uuid
=
rankList
.
store_uuid
;
[
self
.
navigationController
pushViewController
:
rankDetailVC
animated
:
YES
];
}
}
...
@@ -546,31 +362,6 @@
...
@@ -546,31 +362,6 @@
return
_shoppingCountLabel
;
return
_shoppingCountLabel
;
}
}
-
(
UITableView
*
)
tableView
{
if
(
!
_tableView
)
{
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectZero
style
:
UITableViewStyleGrouped
];
_tableView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_tableView
.
showsVerticalScrollIndicator
=
NO
;
_tableView
.
showsHorizontalScrollIndicator
=
NO
;
[
_tableView
registerClass
:[
RankingListCell
class
]
forCellReuseIdentifier
:
kRankingCell
];
_tableView
.
tableHeaderView
=
self
.
headView
;
[
self
.
view
addSubview
:
_tableView
];
NSLayoutConstraint
*
tableTop
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableTop
];
NSLayoutConstraint
*
tableLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableLeft
];
NSLayoutConstraint
*
tableRight
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableRight
];
NSLayoutConstraint
*
tableBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableBottom
];
}
return
_tableView
;
}
-
(
UIView
*
)
lineView1
-
(
UIView
*
)
lineView1
{
{
...
@@ -579,7 +370,7 @@
...
@@ -579,7 +370,7 @@
_lineView1
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_lineView1
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
headView
addSubview
:
_lineView1
];
[
self
.
headView
addSubview
:
_lineView1
];
NSLayoutConstraint
*
lineBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView1
attribute
:
NSLayoutAttribute
Bottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
lineBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView1
attribute
:
NSLayoutAttribute
Top
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
75
];
[
self
.
headView
addConstraint
:
lineBottom
];
[
self
.
headView
addConstraint
:
lineBottom
];
NSLayoutConstraint
*
lineLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView1
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
lineLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView1
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
...
@@ -588,7 +379,7 @@
...
@@ -588,7 +379,7 @@
NSLayoutConstraint
*
lineRight
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView1
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
lineRight
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView1
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
lineRight
];
[
self
.
headView
addConstraint
:
lineRight
];
NSLayoutConstraint
*
lineHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView1
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
2
];
NSLayoutConstraint
*
lineHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_lineView1
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
1
];
[
_lineView1
addConstraint
:
lineHeight
];
[
_lineView1
addConstraint
:
lineHeight
];
}
}
return
_lineView1
;
return
_lineView1
;
...
@@ -597,12 +388,133 @@
...
@@ -597,12 +388,133 @@
-
(
UIView
*
)
headView
-
(
UIView
*
)
headView
{
{
if
(
!
_headView
)
{
if
(
!
_headView
)
{
_headView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
7
6
)];
_headView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
11
6
)];
_headView
.
backgroundColor
=
[
UIColor
whiteColor
];
_headView
.
backgroundColor
=
[
UIColor
whiteColor
];
}
}
return
_headView
;
return
_headView
;
}
}
-
(
UILabel
*
)
shoppingLabel
{
if
(
!
_shoppingLabel
)
{
// 商场
_shoppingLabel
=
[[
UILabel
alloc
]
init
];
_shoppingLabel
.
textAlignment
=
NSTextAlignmentCenter
;
_shoppingLabel
.
textColor
=
kRankHeadTitleTextColor
;
_shoppingLabel
.
backgroundColor
=
kSectionBackGroundColor
;
_shoppingLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
_shoppingLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
headView
addSubview
:
_shoppingLabel
];
//
NSLayoutConstraint
*
shoppingTop
=
[
NSLayoutConstraint
constraintWithItem
:
_shoppingLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
76
];
[
self
.
headView
addConstraint
:
shoppingTop
];
NSLayoutConstraint
*
shoppingLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_shoppingLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
shoppingLeft
];
NSLayoutConstraint
*
shoppingRight
=
[
NSLayoutConstraint
constraintWithItem
:
_shoppingLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
scoreLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
shoppingRight
];
NSLayoutConstraint
*
shoppingBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_shoppingLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
shoppingBottom
];
NSLayoutConstraint
*
shoppingWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_shoppingLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
scoreLabel
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
2
constant
:
0
];
[
self
.
headView
addConstraint
:
shoppingWidth
];
}
return
_shoppingLabel
;
}
-
(
UILabel
*
)
scoreLabel
{
if
(
!
_scoreLabel
)
{
_scoreLabel
=
[[
UILabel
alloc
]
init
];
_scoreLabel
.
textAlignment
=
NSTextAlignmentCenter
;
_scoreLabel
.
textColor
=
kRankHeadTitleTextColor
;
_scoreLabel
.
backgroundColor
=
kSectionBackGroundColor
;
_scoreLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
_scoreLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
headView
addSubview
:
_scoreLabel
];
//
NSLayoutConstraint
*
scoreTop
=
[
NSLayoutConstraint
constraintWithItem
:
_scoreLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
76
];
[
self
.
headView
addConstraint
:
scoreTop
];
NSLayoutConstraint
*
scoreRight
=
[
NSLayoutConstraint
constraintWithItem
:
_scoreLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
gradeLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
scoreRight
];
NSLayoutConstraint
*
scoreWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_scoreLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
gradeLabel
attribute
:
NSLayoutAttributeWidth
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
scoreWidth
];
NSLayoutConstraint
*
scoreBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_scoreLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
scoreBottom
];
}
return
_scoreLabel
;
}
-
(
UILabel
*
)
gradeLabel
{
if
(
!
_gradeLabel
)
{
_gradeLabel
=
[[
UILabel
alloc
]
init
];
_gradeLabel
.
textAlignment
=
NSTextAlignmentCenter
;
_gradeLabel
.
textColor
=
kRankHeadTitleTextColor
;
_gradeLabel
.
font
=
[
UIFont
systemFontOfSize
:
17
.
0
];
_gradeLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_gradeLabel
.
backgroundColor
=
kSectionBackGroundColor
;
[
self
.
headView
addSubview
:
_gradeLabel
];
//
NSLayoutConstraint
*
gradeTop
=
[
NSLayoutConstraint
constraintWithItem
:
_gradeLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
76
];
[
self
.
headView
addConstraint
:
gradeTop
];
NSLayoutConstraint
*
gradeRight
=
[
NSLayoutConstraint
constraintWithItem
:
_gradeLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
gradeRight
];
NSLayoutConstraint
*
gradeBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_gradeLabel
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
headView
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
headView
addConstraint
:
gradeBottom
];
}
return
_gradeLabel
;
}
-
(
UITableView
*
)
tableView
{
if
(
!
_tableView
)
{
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectZero
style
:
UITableViewStyleGrouped
];
_tableView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_tableView
.
showsVerticalScrollIndicator
=
NO
;
_tableView
.
showsHorizontalScrollIndicator
=
NO
;
_tableView
.
rowHeight
=
UITableViewAutomaticDimension
;
_tableView
.
estimatedRowHeight
=
100
.
0
;
[
_tableView
registerClass
:[
RankCommentCell
class
]
forCellReuseIdentifier
:
kRankingCell
];
_tableView
.
tableHeaderView
=
self
.
headView
;
[
self
.
view
addSubview
:
_tableView
];
NSLayoutConstraint
*
tableTop
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableTop
];
NSLayoutConstraint
*
tableLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableLeft
];
NSLayoutConstraint
*
tableRight
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableRight
];
NSLayoutConstraint
*
tableBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableBottom
];
}
return
_tableView
;
}
-
(
NoDataView
*
)
noDataView
-
(
NoDataView
*
)
noDataView
{
{
...
@@ -626,7 +538,10 @@
...
@@ -626,7 +538,10 @@
return
_noDataView
;
return
_noDataView
;
}
}
-
(
void
)
clickHeadView
{
[
_tableView
reloadData
];
}
/*
/*
#pragma mark - Navigation
#pragma mark - Navigation
...
...
redstar/Classes/Module/Login/ViewController/LoginViewController.m
View file @
ea559b8a
...
@@ -120,6 +120,8 @@
...
@@ -120,6 +120,8 @@
*/
*/
-
(
void
)
loginButtonClick
:
(
UIButton
*
)
sender
-
(
void
)
loginButtonClick
:
(
UIButton
*
)
sender
{
{
self
.
rootTBC
=
[[
RootTabBarController
alloc
]
init
];
[
self
presentViewController
:
_rootTBC
animated
:
YES
completion
:
nil
];
if
(
self
.
loginView
.
usernameTextFiled
.
text
.
length
==
0
||
self
.
loginView
.
passwordTextFiled
.
text
.
length
==
0
)
{
if
(
self
.
loginView
.
usernameTextFiled
.
text
.
length
==
0
||
self
.
loginView
.
passwordTextFiled
.
text
.
length
==
0
)
{
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"账号、密码不能为空"
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"账号、密码不能为空"
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
...
...
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