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
e639546a
Commit
e639546a
authored
Jan 26, 2016
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改问题与知识界面相关
parent
3e71de06
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
200 additions
and
112 deletions
+200
-112
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Constant.h
redstar/Classes/Macro/Constant.h
+1
-1
QuestionListTableCell.m
...nction/Question/QuestionList/Cell/QuestionListTableCell.m
+23
-5
MoreScreenView.h
...dule/Function/Question/QuestionList/View/MoreScreenView.h
+2
-2
MoreScreenView.m
...dule/Function/Question/QuestionList/View/MoreScreenView.m
+65
-63
QuestionViewController.m
...tion/QuestionList/ViewController/QuestionViewController.m
+109
-41
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
e639546a
No preview for this file type
redstar/Classes/Macro/Constant.h
View file @
e639546a
...
@@ -136,7 +136,7 @@
...
@@ -136,7 +136,7 @@
#define kCommentWithStarViewHeight 325
#define kCommentWithStarViewHeight 325
#define kTaxisViewHeight 150
#define kTaxisViewHeight 150
#define kScreenViewHeight 240
#define kScreenViewHeight 240
#define kMoreScreenViewHeight
4
10
#define kMoreScreenViewHeight
3
10
#define kRefreshInspectPointNotification @"refreshInspectPoint"
#define kRefreshInspectPointNotification @"refreshInspectPoint"
...
...
redstar/Classes/Module/Function/Question/QuestionList/Cell/QuestionListTableCell.m
View file @
e639546a
...
@@ -30,7 +30,16 @@
...
@@ -30,7 +30,16 @@
_question
=
question
;
_question
=
question
;
// 标题
// 标题
self
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
question
.
title
];
// self.titleLabel.text = [NSString stringWithFormat:@"%@",question.title];
// NSString *intro = [NSString stringWithFormat:@"%@", question.content];
// NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:intro];
// NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
// [paragraphStyle setLineSpacing:3];
// [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, intro.length)];
// [self.detailsLabel setAttributedText:attributedString];
// 反馈(副标题)
// 反馈(副标题)
self
.
detailsLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
question
.
content
];
self
.
detailsLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
question
.
content
];
// 服务类型
// 服务类型
...
@@ -118,24 +127,33 @@
...
@@ -118,24 +127,33 @@
if
(
!
_detailsLabel
)
{
if
(
!
_detailsLabel
)
{
_detailsLabel
=
[[
UILabel
alloc
]
init
];
_detailsLabel
=
[[
UILabel
alloc
]
init
];
_detailsLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_detailsLabel
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_detailsLabel
.
numberOfLines
=
2
;
_detailsLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_detailsLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_detailsLabel
.
textColor
=
kQuestionCellTitleColor
;
_detailsLabel
.
textColor
=
kQuestionCellTitleColor
;
[
self
.
contentView
addSubview
:
_detailsLabel
];
[
self
.
contentView
addSubview
:
_detailsLabel
];
// 顶端
// 顶端
NSLayoutConstraint
*
detailsTop
=
[
NSLayoutConstraint
constraintWithItem
:
_detailsLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
NSLayoutConstraint
*
detailsTop
=
[
NSLayoutConstraint
constraintWithItem
:
_detailsLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
8
];
[
self
.
contentView
addConstraint
:
detailsTop
];
[
self
.
contentView
addConstraint
:
detailsTop
];
// 左边
// 左边
NSLayoutConstraint
*
detailsLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_detailsLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
NSLayoutConstraint
*
detailsLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_detailsLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
.
contentView
addConstraint
:
detailsLeft
];
[
self
.
contentView
addConstraint
:
detailsLeft
];
// NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.hotLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:-15];
// [self.contentView addConstraint:titleRight];
// 右边
// 右边
NSLayoutConstraint
*
detailsRight
=
[
NSLayoutConstraint
constraintWithItem
:
_detailsLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
2
0
];
NSLayoutConstraint
*
detailsRight
=
[
NSLayoutConstraint
constraintWithItem
:
_detailsLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
hotLabel
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:-
1
0
];
[
self
.
contentView
addConstraint
:
detailsRight
];
[
self
.
contentView
addConstraint
:
detailsRight
];
// // 右边
// NSLayoutConstraint *detailsRight = [NSLayoutConstraint constraintWithItem:_detailsLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self.contentView addConstraint:detailsRight];
// 高度
// 高度
NSLayoutConstraint
*
detailsHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_detailsLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
2
5
];
NSLayoutConstraint
*
detailsHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_detailsLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
4
5
];
[
self
.
contentView
addConstraint
:
detailsHeight
];
[
self
.
contentView
addConstraint
:
detailsHeight
];
}
}
return
_detailsLabel
;
return
_detailsLabel
;
...
@@ -152,7 +170,7 @@
...
@@ -152,7 +170,7 @@
[
self
.
contentView
addSubview
:
_stateLabel
];
[
self
.
contentView
addSubview
:
_stateLabel
];
// 顶端
// 顶端
NSLayoutConstraint
*
stateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_stateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
detailsLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
3
];
NSLayoutConstraint
*
stateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_stateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
detailsLabel
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
stateTop
];
[
self
.
contentView
addConstraint
:
stateTop
];
// 左边
// 左边
...
...
redstar/Classes/Module/Function/Question/QuestionList/View/MoreScreenView.h
View file @
e639546a
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
@property
(
nonatomic
,
strong
)
ScopeTableView
*
scopeTableView
;
@property
(
nonatomic
,
strong
)
ScopeTableView
*
scopeTableView
;
@property
(
nonatomic
,
strong
)
GroupTableView
*
groupTableView
;
@property
(
nonatomic
,
strong
)
GroupTableView
*
groupTableView
;
@property
(
nonatomic
,
strong
)
CategoryTableView
*
categoryTableView
;
@property
(
nonatomic
,
strong
)
CategoryTableView
*
categoryTableView
;
@property
(
nonatomic
,
strong
)
UITextView
*
textView1
;
//
@property (nonatomic, strong) UITextView *textView1;
@property
(
nonatomic
,
strong
)
UITextView
*
textView2
;
//
@property (nonatomic, strong) UITextView *textView2;
@property
(
nonatomic
,
strong
)
StateTableView
*
stateTableView
;
@property
(
nonatomic
,
strong
)
StateTableView
*
stateTableView
;
...
...
redstar/Classes/Module/Function/Question/QuestionList/View/MoreScreenView.m
View file @
e639546a
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
-
(
void
)
setup
-
(
void
)
setup
{
{
self
.
groupTabBar
=
[[
GroupTabBar
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
100
,
3
50
)];
self
.
groupTabBar
=
[[
GroupTabBar
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
100
,
2
50
)];
_groupTabBar
.
delegate
=
self
;
_groupTabBar
.
delegate
=
self
;
[
self
addSubview
:
_groupTabBar
];
[
self
addSubview
:
_groupTabBar
];
...
@@ -56,25 +56,25 @@
...
@@ -56,25 +56,25 @@
self
.
categoryTableView
=
[[
CategoryTableView
alloc
]
init
];
self
.
categoryTableView
=
[[
CategoryTableView
alloc
]
init
];
GroupItems
*
categoryItem
=
[[
GroupItems
alloc
]
initWithTitle
:
@"问题分类"
view
:
_categoryTableView
];
GroupItems
*
categoryItem
=
[[
GroupItems
alloc
]
initWithTitle
:
@"问题分类"
view
:
_categoryTableView
];
self
.
textView1
=
[[
UITextView
alloc
]
init
];
//
self.textView1 = [[UITextView alloc] init];
_textView1
.
delegate
=
self
;
//
_textView1.delegate = self;
_textView1
.
tag
=
9991
;
//
_textView1.tag = 9991;
self
.
placeholderLabel1
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
5
,
0
,
100
,
30
)];
//
self.placeholderLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 100, 30)];
self
.
placeholderLabel1
.
text
=
@"请输入标题..."
;
//
self.placeholderLabel1.text = @"请输入标题...";
self
.
placeholderLabel1
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
//
self.placeholderLabel1.font = [UIFont systemFontOfSize:15.0];
self
.
placeholderLabel1
.
textColor
=
kOnLineCellDetailColor
;
//
self.placeholderLabel1.textColor = kOnLineCellDetailColor;
[
self
.
textView1
addSubview
:
self
.
placeholderLabel1
];
//
[self.textView1 addSubview:self.placeholderLabel1];
GroupItems
*
textViewItem1
=
[[
GroupItems
alloc
]
initWithTitle
:
@"标题类似于"
view
:
_textView1
];
//
GroupItems *textViewItem1 = [[GroupItems alloc] initWithTitle:@"标题类似于" view:_textView1];
//
self
.
textView2
=
[[
UITextView
alloc
]
init
];
//
self.textView2 = [[UITextView alloc] init];
_textView2
.
delegate
=
self
;
//
_textView2.delegate = self;
_textView2
.
tag
=
9992
;
//
_textView2.tag = 9992;
self
.
placeholderLabel2
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
5
,
0
,
100
,
30
)];
//
self.placeholderLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 100, 30)];
self
.
placeholderLabel2
.
text
=
@"请输入关键字..."
;
//
self.placeholderLabel2.text = @"请输入关键字...";
self
.
placeholderLabel2
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
//
self.placeholderLabel2.font = [UIFont systemFontOfSize:15.0];
self
.
placeholderLabel2
.
textColor
=
kOnLineCellDetailColor
;
//
self.placeholderLabel2.textColor = kOnLineCellDetailColor;
[
self
.
textView2
addSubview
:
self
.
placeholderLabel2
];
//
[self.textView2 addSubview:self.placeholderLabel2];
GroupItems
*
textViewItem2
=
[[
GroupItems
alloc
]
initWithTitle
:
@"关键字类似于"
view
:
_textView2
];
//
GroupItems *textViewItem2 = [[GroupItems alloc] initWithTitle:@"关键字类似于" view:_textView2];
self
.
stateTableView
=
[[
StateTableView
alloc
]
init
];
self
.
stateTableView
=
[[
StateTableView
alloc
]
init
];
GroupItems
*
stateItem
=
[[
GroupItems
alloc
]
initWithTitle
:
@"问题状态"
view
:
_stateTableView
];
GroupItems
*
stateItem
=
[[
GroupItems
alloc
]
initWithTitle
:
@"问题状态"
view
:
_stateTableView
];
...
@@ -85,12 +85,14 @@
...
@@ -85,12 +85,14 @@
[
self
insertSubview
:
_scopeTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_scopeTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_groupTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_groupTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_categoryTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_categoryTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_textView1
belowSubview
:
_groupTabBar
];
//
[self insertSubview:_textView1 belowSubview:_groupTabBar];
[
self
insertSubview
:
_textView2
belowSubview
:
_groupTabBar
];
//
[self insertSubview:_textView2 belowSubview:_groupTabBar];
[
self
insertSubview
:
_stateTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_stateTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_timeTableView
belowSubview
:
_groupTabBar
];
[
self
insertSubview
:
_timeTableView
belowSubview
:
_groupTabBar
];
_groupTabBar
.
items
=
@[
scopeItem
,
groupItem
,
categoryItem
,
textViewItem1
,
textViewItem2
,
stateItem
,
timeItem
];
_groupTabBar
.
items
=
@[
scopeItem
,
groupItem
,
categoryItem
,
stateItem
,
timeItem
];
// _groupTabBar.items = @[scopeItem, groupItem, categoryItem, textViewItem1, textViewItem2, stateItem, timeItem];
[
_groupTabBar
showIndex
:
0
];
[
_groupTabBar
showIndex
:
0
];
self
.
backView
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
backView
.
backgroundColor
=
[
UIColor
whiteColor
];
...
@@ -184,45 +186,45 @@
...
@@ -184,45 +186,45 @@
return
_submitBtn
;
return
_submitBtn
;
}
}
#pragma mark - UITextView Delegate
//
#pragma mark - UITextView Delegate
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldChangeTextInRange
:
(
NSRange
)
range
replacementText
:
(
NSString
*
)
text
{
//
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if
(
!
[
text
isEqualToString
:
@""
])
{
//
if (![text isEqualToString:@""]) {
if
(
textView
.
tag
==
9991
)
{
//
if (textView.tag == 9991) {
self
.
placeholderLabel1
.
hidden
=
YES
;
//
self.placeholderLabel1.hidden = YES;
}
else
{
//
} else {
self
.
placeholderLabel2
.
hidden
=
YES
;
//
self.placeholderLabel2.hidden = YES;
}
//
}
}
//
}
//
if
([
text
isEqualToString
:
@""
]
&&
range
.
location
==
0
&&
range
.
length
==
1
)
{
//
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
if
(
textView
.
tag
==
9991
)
{
//
if (textView.tag == 9991) {
self
.
placeholderLabel1
.
hidden
=
NO
;
//
self.placeholderLabel1.hidden = NO;
}
else
{
//
} else {
self
.
placeholderLabel2
.
hidden
=
NO
;
//
self.placeholderLabel2.hidden = NO;
}
//
}
}
//
}
//
if
([
text
isEqualToString
:
@"
\n
"
])
{
//
if ([text isEqualToString:@"\n"]) {
[
self
.
textView1
resignFirstResponder
];
//
[self.textView1 resignFirstResponder];
[
self
.
textView2
resignFirstResponder
];
//
[self.textView2 resignFirstResponder];
//
if
(
textView
.
tag
==
9991
)
{
//
if (textView.tag == 9991) {
if
(
textView
.
text
.
length
!=
0
)
{
//
if (textView.text.length != 0) {
self
.
placeholderLabel1
.
hidden
=
YES
;
//
self.placeholderLabel1.hidden = YES;
}
else
{
//
} else {
self
.
placeholderLabel1
.
hidden
=
NO
;
//
self.placeholderLabel1.hidden = NO;
}
//
}
}
else
{
//
} else {
if
(
textView
.
text
.
length
!=
0
)
{
//
if (textView.text.length != 0) {
self
.
placeholderLabel2
.
hidden
=
YES
;
//
self.placeholderLabel2.hidden = YES;
}
else
{
//
} else {
self
.
placeholderLabel2
.
hidden
=
NO
;
//
self.placeholderLabel2.hidden = NO;
}
//
}
}
//
}
return
NO
;
//
return NO;
}
//
}
//
return
YES
;
//
return YES;
}
//
}
@end
@end
redstar/Classes/Module/Function/Question/QuestionList/ViewController/QuestionViewController.m
View file @
e639546a
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
// 分组
// 分组
@property
(
nonatomic
,
assign
)
NSInteger
groupRow
;
@property
(
nonatomic
,
assign
)
NSInteger
groupRow
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allGroupNameArray
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allGroupNameArray
;
@property
(
nonatomic
,
strong
)
NSArray
*
queryOrders
;
// 分类
// 分类
@property
(
nonatomic
,
copy
)
NSString
*
categoryName
;
@property
(
nonatomic
,
copy
)
NSString
*
categoryName
;
@property
(
nonatomic
,
assign
)
NSInteger
stateRow
;
@property
(
nonatomic
,
assign
)
NSInteger
stateRow
;
...
@@ -132,13 +132,18 @@
...
@@ -132,13 +132,18 @@
NSString
*
urlStr
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kQuestionListURL
];
NSString
*
urlStr
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kQuestionListURL
];
NSString
*
user_uuid
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
];
NSString
*
user_uuid
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
];
NSArray
*
queryOrders
=
@[@{
@"field"
:
@"resolveTime"
,
@"direction"
:
@"desc"
}];
_queryOrders
=
queryOrders
;
// 请求参数
// 请求参数
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
@"scope"
:
@"all"
,
@"scope"
:
@"all"
,
@"pageNumber"
:
@
(
0
),
@"pageNumber"
:
@
(
0
),
@"pageSize"
:
@
(
20
)
@"pageSize"
:
@
(
20
),
@"queryOrders"
:
queryOrders
};
};
// 发起请求
// 发起请求
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
urlStr
];
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
urlStr
];
//
//
...
@@ -184,7 +189,8 @@
...
@@ -184,7 +189,8 @@
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
@"scope"
:
@"all"
,
@"scope"
:
@"all"
,
@"pageNumber"
:
@
(
_page
),
@"pageNumber"
:
@
(
_page
),
@"pageSize"
:
pageSize
@"pageSize"
:
pageSize
,
@"queryOrders"
:
_queryOrders
};
};
// 发起请求
// 发起请求
...
@@ -335,6 +341,7 @@
...
@@ -335,6 +341,7 @@
}
}
if
(
!
_taxisView
)
{
if
(
!
_taxisView
)
{
_taxisView
=
[[
TaxisView
alloc
]
init
];
_taxisView
=
[[
TaxisView
alloc
]
init
];
_taxisView
.
tag
=
3928342
;
_taxisView
.
backgroundColor
=
[
UIColor
whiteColor
];
_taxisView
.
backgroundColor
=
[
UIColor
whiteColor
];
}
}
...
@@ -423,24 +430,80 @@
...
@@ -423,24 +430,80 @@
-
(
void
)
searchBarClick
:
(
UIButton
*
)
sender
-
(
void
)
searchBarClick
:
(
UIButton
*
)
sender
{
{
NSPredicate
*
predicate
=
[
NSPredicate
predicateWithFormat
:
@"content CONTAINS %@ || title CONTAINS %@"
,
self
.
searchBar
.
searchTextFiled
.
text
,
self
.
searchBar
.
searchTextFiled
.
text
];
if
(
_searchBar
.
searchTextFiled
.
text
.
length
==
0
)
{
NSArray
*
arrayPre
=
[
_allQuestionArray
filteredArrayUsingPredicate
:
predicate
];
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"请输入问题的关键字!"
delegate
:
self
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
_allQuestionArray
=
[
NSMutableArray
arrayWithArray
:
arrayPre
];
[
alert
show
];
if
(
_allQuestionArray
.
count
==
0
)
{
if
(
_tableView
)
{
[
_tableView
removeFromSuperview
];
_tableView
=
nil
;
}
self
.
noDataView
.
backgroundColor
=
[
UIColor
whiteColor
];
}
else
{
}
else
{
if
(
_noDataView
)
{
NSString
*
urlStr
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kQuestionListURL
];
[
_noDataView
removeFromSuperview
];
NSString
*
user_uuid
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
];
_noDataView
=
nil
;
NSNumber
*
pageSize
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"requestNumber"
];
}
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
self
.
searchBar
.
backgroundColor
=
kSectionBackGroundColor
;
@"pageNumber"
:
@
(
0
),
[
self
.
tableView
reloadData
];
@"pageSize"
:
pageSize
,
@"keyword"
:
_searchBar
.
searchTextFiled
.
text
,
@"queryOrders"
:
@[@{
@"field"
:
@"keyword"
,
@"direction"
:
@"asc"
}]
};
// 发起请求
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
urlStr
];
//
__block
QuestionViewController
*
weakSelf
=
self
;
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
// 请求问题列表
[
httpClient
getQuestionListWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSDictionary
*
dataDict
=
(
NSDictionary
*
)
response
[
@"data"
];
NSDictionary
*
recordsDict
=
(
NSDictionary
*
)
dataDict
[
@"records"
];
NSMutableArray
*
tempArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
questionDict
in
recordsDict
)
{
QuestionModel
*
question
=
[[
QuestionModel
alloc
]
init
];
[
question
setValuesForKeysWithDictionary
:
questionDict
];
[
tempArray
addObject
:
question
];
}
_allQuestionArray
=
tempArray
;
if
(
_allQuestionArray
.
count
==
0
)
{
if
(
_tableView
)
{
[
_tableView
removeFromSuperview
];
_tableView
=
nil
;
}
weakSelf
.
noDataView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
MBProgressHUD
hideHUDForView
:
weakSelf
.
view
animated
:
YES
];
}
else
{
if
(
_noDataView
)
{
[
_noDataView
removeFromSuperview
];
_noDataView
=
nil
;
}
weakSelf
.
tableView
.
delegate
=
weakSelf
;
weakSelf
.
tableView
.
dataSource
=
weakSelf
;
[
weakSelf
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
weakSelf
.
view
animated
:
YES
];
}
self
.
menuView
.
backgroundColor
=
kInspectSectionBackGroundColor
;
}];
}
}
// NSPredicate *predicate = [NSPredicate predicateWithFormat:@"content CONTAINS %@ || title CONTAINS %@", self.searchBar.searchTextFiled.text, self.searchBar.searchTextFiled.text];
// NSArray *arrayPre=[_allQuestionArray filteredArrayUsingPredicate:predicate];
// _allQuestionArray = [NSMutableArray arrayWithArray:arrayPre];
//
// if (_allQuestionArray.count == 0) {
// if (_tableView) {
// [_tableView removeFromSuperview];
// _tableView = nil;
// }
// self.noDataView.backgroundColor = [UIColor whiteColor];
// } else {
// if (_noDataView) {
// [_noDataView removeFromSuperview];
// _noDataView = nil;
// }
// self.searchBar.backgroundColor = kSectionBackGroundColor;
// [self.tableView reloadData];
// }
}
}
// 重置按钮
// 重置按钮
...
@@ -454,8 +517,8 @@
...
@@ -454,8 +517,8 @@
[
_screenView
.
stateTableView
selectRowAtIndexPath
:
selectedIndexPath
animated
:
NO
scrollPosition
:
UITableViewScrollPositionNone
];
[
_screenView
.
stateTableView
selectRowAtIndexPath
:
selectedIndexPath
animated
:
NO
scrollPosition
:
UITableViewScrollPositionNone
];
[
_screenView
.
timeTableView
selectRowAtIndexPath
:
selectedIndexPath
animated
:
NO
scrollPosition
:
UITableViewScrollPositionNone
];
[
_screenView
.
timeTableView
selectRowAtIndexPath
:
selectedIndexPath
animated
:
NO
scrollPosition
:
UITableViewScrollPositionNone
];
_screenView
.
textView1
.
text
=
@""
;
//
_screenView.textView1.text = @"";
_screenView
.
textView2
.
text
=
@""
;
//
_screenView.textView2.text = @"";
}
}
...
@@ -501,19 +564,22 @@
...
@@ -501,19 +564,22 @@
NSArray
*
array
=
@[@{
@"field"
:
@"category"
,
NSArray
*
array
=
@[@{
@"field"
:
@"category"
,
@"direction"
:
@"asc"
}];
@"direction"
:
@"asc"
}];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
}
else
if
(
_screenView
.
groupTabBar
.
selectNumber
==
3
)
{
}
[
parameters
setObject
:
_screenView
.
textView1
.
text
forKey
:
@"contentLike"
];
// else if (_screenView.groupTabBar.selectNumber == 3) {
NSArray
*
array
=
@[@{
@"field"
:
@"contentLike"
,
// [parameters setObject:_screenView.textView1.text forKey:@"contentLike"];
@"direction"
:
@"asc"
}];
// NSArray *array = @[@{@"field":@"contentLike",
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
// @"direction":@"asc"}];
// [parameters setObject:array forKey:@"queryOrders"];
}
else
if
(
_screenView
.
groupTabBar
.
selectNumber
==
4
)
{
//
[
parameters
setObject
:
_screenView
.
textView2
.
text
forKey
:
@"keyword"
];
// }
NSArray
*
array
=
@[@{
@"field"
:
@"keyword"
,
// else if (_screenView.groupTabBar.selectNumber == 4) {
@"direction"
:
@"asc"
}];
// [parameters setObject:_screenView.textView2.text forKey:@"keyword"];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
// NSArray *array = @[@{@"field":@"keyword",
// @"direction":@"asc"}];
}
else
if
(
_screenView
.
groupTabBar
.
selectNumber
==
5
)
{
// [parameters setObject:array forKey:@"queryOrders"];
//
// }
else
if
(
_screenView
.
groupTabBar
.
selectNumber
==
3
)
{
if
(
_stateRow
==
0
)
{
if
(
_stateRow
==
0
)
{
[
parameters
setObject
:
@"created"
forKey
:
@"state"
];
[
parameters
setObject
:
@"created"
forKey
:
@"state"
];
}
else
if
(
_stateRow
==
1
)
{
}
else
if
(
_stateRow
==
1
)
{
...
@@ -524,7 +590,7 @@
...
@@ -524,7 +590,7 @@
NSArray
*
array
=
@[@{
@"field"
:
@"state"
,
NSArray
*
array
=
@[@{
@"field"
:
@"state"
,
@"direction"
:
@"asc"
}];
@"direction"
:
@"asc"
}];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
}
else
if
(
_screenView
.
groupTabBar
.
selectNumber
==
6
)
{
}
else
if
(
_screenView
.
groupTabBar
.
selectNumber
==
4
)
{
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"yyyy-MM-dd HH:mm:ss"
];
[
dateFormatter
setDateFormat
:
@"yyyy-MM-dd HH:mm:ss"
];
...
@@ -657,14 +723,16 @@
...
@@ -657,14 +723,16 @@
}
else
if
(
sender
.
tag
-
kTAxisBtnTag
==
2
)
{
}
else
if
(
sender
.
tag
-
kTAxisBtnTag
==
2
)
{
queryOrders
=
@[@{
@"field"
:
@"
likeCount
"
,
queryOrders
=
@[@{
@"field"
:
@"
resolveTime
"
,
@"direction"
:
@"
de
sc"
}];
@"direction"
:
@"
a
sc"
}];
}
else
{
}
else
{
queryOrders
=
@[@{
@"field"
:
@"
likeCount
"
,
queryOrders
=
@[@{
@"field"
:
@"
resolveTime
"
,
@"direction"
:
@"
a
sc"
}];
@"direction"
:
@"
de
sc"
}];
}
}
_queryOrders
=
queryOrders
;
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
NSDictionary
*
parameters
=
@{
@"user"
:
user_uuid
,
@"scope"
:
@"all"
,
@"scope"
:
@"all"
,
@"pageNumber"
:
@
(
0
),
@"pageNumber"
:
@
(
0
),
...
@@ -747,7 +815,7 @@
...
@@ -747,7 +815,7 @@
// cell的高度
// cell的高度
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
{
return
1
2
0
;
return
1
0
0
;
}
}
...
...
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