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
898d2d88
Commit
898d2d88
authored
Dec 04, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复部分bug
parent
de243197
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
189 additions
and
64 deletions
+189
-64
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Constant.h
redstar/Classes/Macro/Constant.h
+3
-0
CommentView.h
redstar/Classes/Module/Comment/View/CommentView.h
+1
-0
CommentView.m
redstar/Classes/Module/Comment/View/CommentView.m
+0
-1
AddQuestionViewController.m
...on/AddQuestion/ViewController/AddQuestionViewController.m
+21
-1
QuestionDetailCell.h
...unction/Question/QuestionDetail/Cell/QuestionDetailCell.h
+1
-0
QuestionDetailCell.m
...unction/Question/QuestionDetail/Cell/QuestionDetailCell.m
+43
-9
QuestionDetailViewController.m
...stionDetail/ViewController/QuestionDetailViewController.m
+38
-18
QuestionViewController.m
...tion/QuestionList/ViewController/QuestionViewController.m
+15
-1
InspectNotUploadViewController.m
...ectDetail/ViewController/InspectNotUploadViewController.m
+3
-1
InspectListViewController.m
...ct/InspectList/ViewController/InspectListViewController.m
+6
-1
InspectTaskViewController.m
...ct/InspectTask/ViewController/InspectTaskViewController.m
+6
-1
HomeViewController.m
...r/Classes/Module/Home/ViewController/HomeViewController.m
+52
-31
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
898d2d88
No preview for this file type
redstar/Classes/Macro/Constant.h
View file @
898d2d88
...
@@ -135,6 +135,9 @@
...
@@ -135,6 +135,9 @@
#define kTaxisViewHeight 150
#define kTaxisViewHeight 150
#define kScreenViewHeight 240
#define kScreenViewHeight 240
#define kRefreshInspectPointNotification @"refreshInspectPoint"
#define kRefreshQuestionNotification @"refershQuestionList"
#import "UIView+Extension.h"
#import "UIView+Extension.h"
...
...
redstar/Classes/Module/Comment/View/CommentView.h
View file @
898d2d88
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
@interface
CommentView
:
UIView
<
UITextViewDelegate
>
@interface
CommentView
:
UIView
<
UITextViewDelegate
>
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
@property
(
nonatomic
,
strong
)
UIButton
*
quitBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
quitBtn
;
@property
(
nonatomic
,
strong
)
UILabel
*
placeholderLabel2
;
@property
(
nonatomic
,
strong
)
UILabel
*
commentLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
commentLabel
;
...
...
redstar/Classes/Module/Comment/View/CommentView.m
View file @
898d2d88
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
#define kStarBarWidth 235
#define kStarBarWidth 235
@interface
CommentView
()
@interface
CommentView
()
@property
(
nonatomic
,
strong
)
UILabel
*
placeholderLabel2
;
@property
(
nonatomic
,
strong
)
UIImageView
*
backImageView2
;
@property
(
nonatomic
,
strong
)
UIImageView
*
backImageView2
;
@end
@end
...
...
redstar/Classes/Module/Function/Question/AddQuestion/ViewController/AddQuestionViewController.m
View file @
898d2d88
...
@@ -149,6 +149,7 @@
...
@@ -149,6 +149,7 @@
NSLog
(
@"上传新问题 response= %@, error = %@"
,
response
,
error
);
NSLog
(
@"上传新问题 response= %@, error = %@"
,
response
,
error
);
if
(
response
[
@"success"
])
{
if
(
response
[
@"success"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"新问题提报成功!"
delegate
:
self
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"新问题提报成功!"
delegate
:
self
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
alert
.
tag
=
90393
;
[
alert
show
];
[
alert
show
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
else
{
}
else
{
...
@@ -157,7 +158,6 @@
...
@@ -157,7 +158,6 @@
}
}
}];
}];
}
}
// 返回上一页面
// 返回上一页面
...
@@ -175,6 +175,17 @@
...
@@ -175,6 +175,17 @@
#pragma mark - UIAlertViewDelegate
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
buttonIndex
==
0
&&
alertView
.
tag
==
90393
)
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
NSNotificationCenter
*
notification
=
[
NSNotificationCenter
defaultCenter
];
[
notification
postNotificationName
:
kRefreshQuestionNotification
object
:
self
];
}
}
#pragma mark - TakePhoto Delegate
#pragma mark - TakePhoto Delegate
-
(
void
)
deletePhoto
:
(
UIButton
*
)
button
-
(
void
)
deletePhoto
:
(
UIButton
*
)
button
{
{
...
@@ -448,9 +459,18 @@
...
@@ -448,9 +459,18 @@
if
([
text
isEqualToString
:
@"
\n
"
])
{
if
([
text
isEqualToString
:
@"
\n
"
])
{
[
self
.
footerView
.
titleTextView
resignFirstResponder
];
[
self
.
footerView
.
titleTextView
resignFirstResponder
];
[
self
.
footerView
.
contentTextView
resignFirstResponder
];
[
self
.
footerView
.
contentTextView
resignFirstResponder
];
if
(
textView
.
text
.
length
!=
0
)
{
self
.
footerView
.
placeholderLabel1
.
hidden
=
YES
;
self
.
footerView
.
placeholderLabel2
.
hidden
=
YES
;
}
else
{
self
.
footerView
.
placeholderLabel1
.
hidden
=
NO
;
self
.
footerView
.
placeholderLabel2
.
hidden
=
NO
;
}
return
NO
;
return
NO
;
}
}
return
YES
;
return
YES
;
}
}
...
...
redstar/Classes/Module/Function/Question/QuestionDetail/Cell/QuestionDetailCell.h
View file @
898d2d88
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#import "QuestionDetailModel.h"
#import "QuestionDetailModel.h"
@interface
QuestionDetailCell
:
UITableViewCell
@interface
QuestionDetailCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
questionName
;
// 问题名称
@property
(
nonatomic
,
strong
)
UILabel
*
stateLabel
;
// 状态
@property
(
nonatomic
,
strong
)
UILabel
*
stateLabel
;
// 状态
@property
(
nonatomic
,
strong
)
ZanButton
*
thumbBtn
;
// 状态
@property
(
nonatomic
,
strong
)
ZanButton
*
thumbBtn
;
// 状态
@property
(
nonatomic
,
strong
)
UILabel
*
sortLabel
;
// 分类
@property
(
nonatomic
,
strong
)
UILabel
*
sortLabel
;
// 分类
...
...
redstar/Classes/Module/Function/Question/QuestionDetail/Cell/QuestionDetailCell.m
View file @
898d2d88
...
@@ -32,18 +32,24 @@
...
@@ -32,18 +32,24 @@
{
{
_questionDetail
=
questionDetail
;
_questionDetail
=
questionDetail
;
NSString
*
questionNameText
=
[
NSString
stringWithFormat
:
@"问题名称:%@"
,
questionDetail
.
title
];
NSMutableAttributedString
*
questionNameAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
questionNameText
];
[
questionNameAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kDetailCellDescribeTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
0
,
5
)];
[
questionNameAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kdetailCellTitleColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
5
,
questionNameText
.
length
-
5
)];
[
self
.
questionName
setAttributedText
:
questionNameAttr
];
// 状态
// 状态
if
([
questionDetail
.
state
isEqualToString
:
@"resolved"
])
{
if
([
questionDetail
.
state
isEqualToString
:
@"resolved"
])
{
NSString
*
stateText
=
[
NSString
stringWithFormat
:
@"状态:已解决"
];
NSString
*
stateText
=
[
NSString
stringWithFormat
:
@"状态:已解决"
];
NSMutableAttributedString
*
stateAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
stateText
];
NSMutableAttributedString
*
stateAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
stateText
];
[
stateAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kDetailCellDescribeTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
0
,
3
)];
[
stateAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kDetailCellDescribeTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
0
,
3
)];
[
stateAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kNavigationBarColor
,
NSFontAttributeName
:
[
UIFont
boldS
ystemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
3
,
stateText
.
length
-
3
)];
[
stateAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kNavigationBarColor
,
NSFontAttributeName
:
[
UIFont
s
ystemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
3
,
stateText
.
length
-
3
)];
[
self
.
stateLabel
setAttributedText
:
stateAttr
];
[
self
.
stateLabel
setAttributedText
:
stateAttr
];
}
else
{
}
else
{
NSString
*
stateText
=
[
NSString
stringWithFormat
:
@"状态:已创建"
];
NSString
*
stateText
=
[
NSString
stringWithFormat
:
@"状态:已创建"
];
NSMutableAttributedString
*
stateAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
stateText
];
NSMutableAttributedString
*
stateAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
stateText
];
[
stateAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kDetailCellDescribeTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
0
,
3
)];
[
stateAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kDetailCellDescribeTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
0
,
3
)];
[
stateAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kdetailCellTitleColor
,
NSFontAttributeName
:
[
UIFont
boldS
ystemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
3
,
stateText
.
length
-
3
)];
[
stateAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kdetailCellTitleColor
,
NSFontAttributeName
:
[
UIFont
s
ystemFontOfSize
:
15
.
0
f
]}
range
:
NSMakeRange
(
3
,
stateText
.
length
-
3
)];
[
self
.
stateLabel
setAttributedText
:
stateAttr
];
[
self
.
stateLabel
setAttributedText
:
stateAttr
];
}
}
...
@@ -91,6 +97,34 @@
...
@@ -91,6 +97,34 @@
}
}
#pragma mark - lazy loading
#pragma mark - lazy loading
-
(
UILabel
*
)
questionName
{
if
(
!
_questionName
)
{
_questionName
=
[[
UILabel
alloc
]
init
];
_questionName
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
contentView
addSubview
:
_questionName
];
// 顶端
NSLayoutConstraint
*
stateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_questionName
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
10
];
[
self
.
contentView
addConstraint
:
stateTop
];
// 左边
NSLayoutConstraint
*
stateLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_questionName
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
.
contentView
addConstraint
:
stateLeft
];
// 右边
NSLayoutConstraint
*
stateRight
=
[
NSLayoutConstraint
constraintWithItem
:
_questionName
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
thumbBtn
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:-
5
];
[
self
.
contentView
addConstraint
:
stateRight
];
// 高度
NSLayoutConstraint
*
stateHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_questionName
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
25
];
[
self
.
contentView
addConstraint
:
stateHeight
];
}
return
_questionName
;
}
-
(
UILabel
*
)
stateLabel
-
(
UILabel
*
)
stateLabel
{
{
if
(
!
_stateLabel
)
{
if
(
!
_stateLabel
)
{
...
@@ -99,7 +133,7 @@
...
@@ -99,7 +133,7 @@
[
self
.
contentView
addSubview
:
_stateLabel
];
[
self
.
contentView
addSubview
:
_stateLabel
];
// 顶端
// 顶端
NSLayoutConstraint
*
stateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_stateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
0
];
NSLayoutConstraint
*
stateTop
=
[
NSLayoutConstraint
constraintWithItem
:
_stateLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
questionName
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
contentView
addConstraint
:
stateTop
];
[
self
.
contentView
addConstraint
:
stateTop
];
// 左边
// 左边
...
@@ -124,20 +158,20 @@
...
@@ -124,20 +158,20 @@
[
_thumbBtn
setImage
:[
UIImage
imageNamed
:
@"commend"
]
forState
:
UIControlStateNormal
];
[
_thumbBtn
setImage
:[
UIImage
imageNamed
:
@"commend"
]
forState
:
UIControlStateNormal
];
[
_thumbBtn
setImage
:[
UIImage
imageNamed
:
@"commend_after"
]
forState
:
UIControlStateSelected
];
[
_thumbBtn
setImage
:[
UIImage
imageNamed
:
@"commend_after"
]
forState
:
UIControlStateSelected
];
_thumbBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_thumbBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_thumbBtn
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
1
5
.
0
];
_thumbBtn
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
1
6
.
0
];
[
_thumbBtn
setTitleColor
:
kNavigationBarColor
forState
:
UIControlStateNormal
];
[
_thumbBtn
setTitleColor
:
kNavigationBarColor
forState
:
UIControlStateNormal
];
[
self
.
contentView
addSubview
:
_thumbBtn
];
[
self
.
contentView
addSubview
:
_thumbBtn
];
// 顶端
// 顶端
NSLayoutConstraint
*
thumbTop
=
[
NSLayoutConstraint
constraintWithItem
:
_thumbBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
3
];
NSLayoutConstraint
*
thumbTop
=
[
NSLayoutConstraint
constraintWithItem
:
_thumbBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
2
];
[
self
.
contentView
addConstraint
:
thumbTop
];
[
self
.
contentView
addConstraint
:
thumbTop
];
// 左边
//
// 左边
NSLayoutConstraint
*
thumbWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_thumbBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
80
];
NSLayoutConstraint
*
thumbWidth
=
[
NSLayoutConstraint
constraintWithItem
:
_thumbBtn
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
75
];
[
self
.
contentView
addConstraint
:
thumbWidth
];
[
self
.
contentView
addConstraint
:
thumbWidth
];
// 右边
// 右边
NSLayoutConstraint
*
thumbRight
=
[
NSLayoutConstraint
constraintWithItem
:
_thumbBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
2
0
];
NSLayoutConstraint
*
thumbRight
=
[
NSLayoutConstraint
constraintWithItem
:
_thumbBtn
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
contentView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
1
0
];
[
self
.
contentView
addConstraint
:
thumbRight
];
[
self
.
contentView
addConstraint
:
thumbRight
];
// 高度
// 高度
...
...
redstar/Classes/Module/Function/Question/QuestionDetail/ViewController/QuestionDetailViewController.m
View file @
898d2d88
...
@@ -161,24 +161,6 @@
...
@@ -161,24 +161,6 @@
}
}
-
(
void
)
textViewDidBeginEditing
:
(
UITextView
*
)
textView
{
[
UIView
animateWithDuration
:
0
.
3
animations
:
^
{
_commentView
.
frame
=
CGRectMake
(
0
,
self
.
view
.
frame
.
size
.
height
-
kCommentViewHeight
-
173
,
kScreenWidth
,
kCommentViewHeight
);
}];
}
-
(
void
)
textViewDidEndEditing
:
(
UITextView
*
)
textView
{
[
UIView
animateWithDuration
:
0
.
3
animations
:
^
{
_commentView
.
frame
=
CGRectMake
(
0
,
self
.
view
.
frame
.
size
.
height
-
kCommentViewHeight
,
kScreenWidth
,
kCommentViewHeight
);
}];
}
//-(void)textFieldDidBeginEditing:(UITextField *)textField
//{
//
//}
...
@@ -296,6 +278,44 @@
...
@@ -296,6 +278,44 @@
#pragma mark - UItextDelegate
-
(
void
)
textViewDidBeginEditing
:
(
UITextView
*
)
textView
{
[
UIView
animateWithDuration
:
0
.
3
animations
:
^
{
_commentView
.
frame
=
CGRectMake
(
0
,
self
.
view
.
frame
.
size
.
height
-
kCommentViewHeight
-
173
,
kScreenWidth
,
kCommentViewHeight
);
}];
}
-
(
void
)
textViewDidEndEditing
:
(
UITextView
*
)
textView
{
[
UIView
animateWithDuration
:
0
.
3
animations
:
^
{
_commentView
.
frame
=
CGRectMake
(
0
,
self
.
view
.
frame
.
size
.
height
-
kCommentViewHeight
,
kScreenWidth
,
kCommentViewHeight
);
}];
}
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldChangeTextInRange
:
(
NSRange
)
range
replacementText
:
(
NSString
*
)
text
{
if
(
!
[
text
isEqualToString
:
@""
])
{
_commentView
.
placeholderLabel2
.
hidden
=
YES
;
}
if
([
text
isEqualToString
:
@""
]
&&
range
.
location
==
0
&&
range
.
length
==
1
)
{
_commentView
.
placeholderLabel2
.
hidden
=
NO
;
}
if
([
text
isEqualToString
:
@"
\n
"
])
{
[
_commentView
.
contentTextView
resignFirstResponder
];
if
(
textView
.
text
.
length
!=
0
)
{
_commentView
.
placeholderLabel2
.
hidden
=
YES
;
}
else
{
_commentView
.
placeholderLabel2
.
hidden
=
NO
;
}
return
NO
;
}
return
YES
;
}
#pragma mark - UITableView Delegate/DataSource
#pragma mark - UITableView Delegate/DataSource
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
{
...
...
redstar/Classes/Module/Function/Question/QuestionList/ViewController/QuestionViewController.m
View file @
898d2d88
...
@@ -64,9 +64,19 @@
...
@@ -64,9 +64,19 @@
[
self
requestQuestionList
];
[
self
requestQuestionList
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
requestQuestionList
)
name
:
kRefreshQuestionNotification
object
:
nil
];
}
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
{
[
super
viewWillAppear
:
animated
];
[
super
viewWillAppear
:
animated
];
...
@@ -91,6 +101,7 @@
...
@@ -91,6 +101,7 @@
}
}
#pragma mark - Private Methods
#pragma mark - Private Methods
-
(
void
)
requestQuestionList
-
(
void
)
requestQuestionList
{
{
// 初始化数组
// 初始化数组
...
@@ -117,16 +128,19 @@
...
@@ -117,16 +128,19 @@
NSDictionary
*
dataDict
=
(
NSDictionary
*
)
response
[
@"data"
];
NSDictionary
*
dataDict
=
(
NSDictionary
*
)
response
[
@"data"
];
NSDictionary
*
recordsDict
=
(
NSDictionary
*
)
dataDict
[
@"records"
];
NSDictionary
*
recordsDict
=
(
NSDictionary
*
)
dataDict
[
@"records"
];
NSLog
(
@"问题与知识列表recods = %@"
,
response
);
NSLog
(
@"问题与知识列表recods = %@"
,
response
);
NSMutableArray
*
tempArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
questionDict
in
recordsDict
)
{
for
(
NSDictionary
*
questionDict
in
recordsDict
)
{
QuestionModel
*
question
=
[[
QuestionModel
alloc
]
init
];
QuestionModel
*
question
=
[[
QuestionModel
alloc
]
init
];
[
question
setValuesForKeysWithDictionary
:
questionDict
];
[
question
setValuesForKeysWithDictionary
:
questionDict
];
[
weakSelf
.
allQuestion
Array
addObject
:
question
];
[
temp
Array
addObject
:
question
];
}
}
_allQuestionArray
=
tempArray
;
if
(
_allQuestionArray
.
count
==
0
)
{
if
(
_allQuestionArray
.
count
==
0
)
{
weakSelf
.
noDataView
.
backgroundColor
=
[
UIColor
whiteColor
];
weakSelf
.
noDataView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
else
{
}
else
{
[
weakSelf
setupTableView
];
[
weakSelf
setupTableView
];
[
self
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/ViewController/InspectNotUploadViewController.m
View file @
898d2d88
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
@implementation
InspectNotUploadViewController
@implementation
InspectNotUploadViewController
-
(
void
)
viewDidLoad
-
(
void
)
viewDidLoad
{
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
...
@@ -284,7 +286,7 @@
...
@@ -284,7 +286,7 @@
if
(
buttonIndex
==
0
&&
alertView
.
tag
==
39429234
)
{
if
(
buttonIndex
==
0
&&
alertView
.
tag
==
39429234
)
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
NSNotificationCenter
*
notification
=
[
NSNotificationCenter
defaultCenter
];
NSNotificationCenter
*
notification
=
[
NSNotificationCenter
defaultCenter
];
[
notification
postNotificationName
:
@"kReloadTableView"
object
:
self
];
[
notification
postNotificationName
:
kRefreshInspectPointNotification
object
:
self
];
}
}
}
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectList/ViewController/InspectListViewController.m
View file @
898d2d88
...
@@ -83,11 +83,16 @@
...
@@ -83,11 +83,16 @@
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
requestCurrentList
)
selector
:
@selector
(
requestCurrentList
)
name
:
@"kReloadTableView"
name
:
kRefreshInspectPointNotification
object
:
nil
];
object
:
nil
];
}
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
{
[
super
viewWillAppear
:
animated
];
[
super
viewWillAppear
:
animated
];
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/ViewController/InspectTaskViewController.m
View file @
898d2d88
...
@@ -77,10 +77,15 @@
...
@@ -77,10 +77,15 @@
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
requestCurrentList
)
selector
:
@selector
(
requestCurrentList
)
name
:
@"kReloadTableView"
name
:
kRefreshInspectPointNotification
object
:
nil
];
object
:
nil
];
}
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
didReceiveMemoryWarning
{
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
// Dispose of any resources that can be recreated.
...
...
redstar/Classes/Module/Home/ViewController/HomeViewController.m
View file @
898d2d88
...
@@ -155,7 +155,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
...
@@ -155,7 +155,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
self
.
tableView
.
tableHeaderView
=
self
.
headView
;
self
.
tableView
.
tableHeaderView
=
self
.
headView
;
// 设置下拉刷新
// 设置下拉刷新
self
.
tableView
.
header
=
[
MJRefreshNormalHeader
headerWithRefreshingBlock
:
^
{
self
.
tableView
.
header
=
[
MJRefreshNormalHeader
headerWithRefreshingBlock
:
^
{
// 进入刷新状态后会自动调用这个block
// 进入刷新状态后会自动调用这个block
...
@@ -163,10 +162,57 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
...
@@ -163,10 +162,57 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
}];
}];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
refreshInspectList
)
name
:
kRefreshInspectPointNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
refreshQuestionList
)
name
:
kRefreshQuestionNotification
object
:
nil
];
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
}
-
(
void
)
refreshAllData
-
(
void
)
refreshAllData
{
{
[
self
refreshInspectList
];
[
self
refreshRankingList
];
[
self
refreshQuestionList
];
}
-
(
void
)
refreshInspectList
{
// 口碑任务
NSString
*
url3
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kInspectListURL
];
HttpClient
*
httpCilent3
=
[[
HttpClient
alloc
]
initWithUrl
:
url3
];
NSDictionary
*
parameters3
=
@{
@"userUuid"
:
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
],
@"queryOrders"
:
@[@{
@"field"
:
@"lastModifyInfo"
}],
@"pageNumber"
:
@
(
0
),
@"pageSize"
:
@
(
2
)
};
[
httpCilent3
getInspectListWithParameters
:
parameters3
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"刷新!! = 巡检列表%@"
,
response
);
NSDictionary
*
dataDict
=
response
[
@"data"
];
NSArray
*
dataArray
=
dataDict
[
@"records"
];
NSMutableArray
*
inspectTempArr
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
dict
in
dataArray
)
{
TaskListModel
*
taskList
=
[[
TaskListModel
alloc
]
init
];
[
taskList
setValuesForKeysWithDictionary
:
dict
];
[
inspectTempArr
addObject
:
taskList
];
}
_taskListDataArray
=
inspectTempArr
;
[
self
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
self
.
tableView
.
header
endRefreshing
];
}];
}
-
(
void
)
refreshRankingList
{
// 口碑巡检
// 口碑巡检
NSString
*
url1
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kRankingListURL
];
NSString
*
url1
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kRankingListURL
];
HttpClient
*
httpCilent1
=
[[
HttpClient
alloc
]
initWithUrl
:
url1
];
HttpClient
*
httpCilent1
=
[[
HttpClient
alloc
]
initWithUrl
:
url1
];
...
@@ -190,8 +236,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
...
@@ -190,8 +236,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
[
self
.
tableView
reloadData
];
[
self
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}];
}];
}
-
(
void
)
refreshQuestionList
{
// 问题与知识
// 问题与知识
NSString
*
url2
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kQuestionListURL
];
NSString
*
url2
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kQuestionListURL
];
NSString
*
user_uuid
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
];
NSString
*
user_uuid
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
];
...
@@ -215,38 +262,12 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
...
@@ -215,38 +262,12 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
[
question
setValuesForKeysWithDictionary
:
questionDict
];
[
question
setValuesForKeysWithDictionary
:
questionDict
];
[
questionTempArr
addObject
:
question
];
[
questionTempArr
addObject
:
question
];
}
}
weakSelf
.
allQuestionArray
=
questionTempArr
;
_allQuestionArray
=
questionTempArr
;
[
self
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}];
// 口碑任务
NSString
*
url3
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
kInspectListURL
];
HttpClient
*
httpCilent3
=
[[
HttpClient
alloc
]
initWithUrl
:
url3
];
NSDictionary
*
parameters3
=
@{
@"userUuid"
:
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
],
@"queryOrders"
:
@[@{
@"field"
:
@"lastModifyInfo"
}],
@"pageNumber"
:
@
(
0
),
@"pageSize"
:
@
(
2
)
};
[
httpCilent3
getInspectListWithParameters
:
parameters3
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"刷新!! = 巡检列表%@"
,
response
);
NSDictionary
*
dataDict
=
response
[
@"data"
];
NSArray
*
dataArray
=
dataDict
[
@"records"
];
NSMutableArray
*
inspectTempArr
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
dict
in
dataArray
)
{
TaskListModel
*
taskList
=
[[
TaskListModel
alloc
]
init
];
[
taskList
setValuesForKeysWithDictionary
:
dict
];
[
inspectTempArr
addObject
:
taskList
];
}
_taskListDataArray
=
inspectTempArr
;
[
self
.
tableView
reloadData
];
[
self
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
[
self
.
tableView
.
header
endRefreshing
];
}];
}];
}
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
{
...
...
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