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
04cebd92
Commit
04cebd92
authored
Dec 06, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5:问题加条件现在,如果非已解决,不能点赞和添加评论
parent
30be1a46
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
440 additions
and
294 deletions
+440
-294
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Breakpoints_v2.xcbkptlist
...ta/admin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+0
-32
AnnounceViewController.m
...unce/AnnounceList/ViewController/AnnounceViewController.m
+9
-4
FunctionViewController.m
redstar/Classes/Module/Function/FunctionViewController.m
+10
-10
SpotCheckOnLineViewController.m
...heckOnLine/ViewController/SpotCheckOnLineViewController.m
+4
-2
PictureViewController.m
...icture/PictureList/ViewController/PictureViewController.m
+5
-2
AddQuestionTableCell.m
...Function/Question/AddQuestion/Cell/AddQuestionTableCell.m
+2
-42
AddQuestionViewController.m
...on/AddQuestion/ViewController/AddQuestionViewController.m
+199
-72
QuestionDetailViewController.m
...stionDetail/ViewController/QuestionDetailViewController.m
+102
-68
StandardViewController.m
.../Function/Standar/ViewController/StandardViewController.m
+8
-4
InspectNotUploadViewController.m
...ectDetail/ViewController/InspectNotUploadViewController.m
+65
-49
InspectDetailHeaderView.m
...fMouth/Inspect/InspectTask/View/InspectDetailHeaderView.m
+1
-4
RankDetailViewController.m
...king/RankDetail/ViewController/RankDetailViewController.m
+10
-0
RankingListViewController.m
...ng/RankingList/ViewController/RankingListViewController.m
+2
-0
MineViewController.m
...r/Classes/Module/Mine/ViewController/MineViewController.m
+23
-5
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
04cebd92
No preview for this file type
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
04cebd92
...
...
@@ -13,37 +13,5 @@
stopOnStyle =
"0"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
shouldBeEnabled =
"No"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"redstar/Classes/Module/Function/Question/AddQuestion/Cell/AddQuestionTableCell.m"
timestampString =
"470919794.364077"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"114"
endingLineNumber =
"114"
landmarkName =
"-contentTextView"
landmarkType =
"5"
>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.FileBreakpoint"
>
<BreakpointContent
shouldBeEnabled =
"No"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
filePath =
"redstar/Classes/Module/Function/Question/AddQuestion/Cell/AddQuestionTableCell.m"
timestampString =
"470919794.364077"
startingColumnNumber =
"9223372036854775807"
endingColumnNumber =
"9223372036854775807"
startingLineNumber =
"190"
endingLineNumber =
"190"
landmarkName =
"-titleTextView"
landmarkType =
"5"
>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
redstar/Classes/Module/Announce/AnnounceList/ViewController/AnnounceViewController.m
View file @
04cebd92
...
...
@@ -43,7 +43,7 @@
self
.
allAnnoArray
=
[
NSMutableArray
array
];
self
.
isRead
=
NO
;
self
.
stateStr
=
@"
false
"
;
self
.
stateStr
=
@"
0
"
;
[
self
setNav
];
...
...
@@ -70,6 +70,9 @@
int
page_number
=
0
;
int
page_size
=
10
;
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?read=%@&page_number=%d&page_size=%d"
,
kRedStarURL
,
kAnnounceListURL
,
user_uuid
,
_stateStr
,
page_number
,
page_size
];
//NSString *url = [NSString stringWithFormat:@"%@%@%@?page_number=%d&page_size=%d", kRedStarURL, kAnnounceListURL ,user_uuid, page_number, page_size];
NSLog
(
@"urlll = %@"
,
url
);
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
httpClient
getAnnounceListWithCompletion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"公告response = %@"
,
response
);
...
...
@@ -125,10 +128,10 @@
int
page_number
=
0
;
int
page_size
=
10
;
if
(
sender
.
selectedSegmentIndex
==
0
)
{
self
.
stateStr
=
@"
false
"
;
self
.
stateStr
=
@"
0
"
;
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?read=%@&page_number=%d&page_size=%d"
,
kRedStarURL
,
kAnnounceListURL
,
user_uuid
,
_stateStr
,
page_number
,
page_size
];
}
else
if
(
sender
.
selectedSegmentIndex
==
1
)
{
self
.
stateStr
=
@"
true
"
;
self
.
stateStr
=
@"
1
"
;
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?read=%@&page_number=%d&page_size=%d"
,
kRedStarURL
,
kAnnounceListURL
,
user_uuid
,
_stateStr
,
page_number
,
page_size
];
}
else
{
self
.
stateStr
=
@""
;
...
...
@@ -150,8 +153,9 @@
[
annoArray
addObject
:
anno
];
}
_allAnnoArray
=
annoArray
;
[
self
.
tableView
reloadData
];
}
[
self
.
tableView
reloadData
];
}];
...
...
@@ -160,6 +164,7 @@
#pragma mark - UITableView Delegate/DataSource
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
NSLog
(
@"cooount = %d"
,
(
int
)
_allAnnoArray
.
count
);
return
_allAnnoArray
.
count
;
}
...
...
redstar/Classes/Module/Function/FunctionViewController.m
View file @
04cebd92
...
...
@@ -50,12 +50,12 @@
#pragma mark - Private Methods
-
(
void
)
setup
{
[
self
.
onLineSamplingBtn
setTitle
:
@"
在线抽查
"
forState
:
UIControlStateNormal
];
[
self
.
wordOfMouthBtn
setTitle
:
@"口碑
巡检
"
forState
:
UIControlStateNormal
];
[
self
.
standardBtn
setTitle
:
@"
口碑标准
"
forState
:
UIControlStateNormal
];
[
self
.
onLineSamplingBtn
setTitle
:
@"
口碑巡检
"
forState
:
UIControlStateNormal
];
[
self
.
wordOfMouthBtn
setTitle
:
@"口碑
排名
"
forState
:
UIControlStateNormal
];
[
self
.
standardBtn
setTitle
:
@"
问题与知识
"
forState
:
UIControlStateNormal
];
[
self
.
pictureBtn
setTitle
:
@"图说口碑"
forState
:
UIControlStateNormal
];
[
self
.
questionBtn
setTitle
:
@"
问题与知识
"
forState
:
UIControlStateNormal
];
[
self
.
rankBtn
setTitle
:
@"
口碑排名
"
forState
:
UIControlStateNormal
];
[
self
.
questionBtn
setTitle
:
@"
口碑标准
"
forState
:
UIControlStateNormal
];
[
self
.
rankBtn
setTitle
:
@"
在线抽查
"
forState
:
UIControlStateNormal
];
//self.lineView.backgroundColor = kSeparateLineViewColor;
...
...
@@ -98,7 +98,7 @@
_onLineSamplingBtn
=
[[
FuncItem
alloc
]
init
];
_onLineSamplingBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
_onLineSamplingBtn
addTarget
:
self
action
:
@selector
(
itemClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_onLineSamplingBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
0
"
]
forState
:
UIControlStateNormal
];
[
_onLineSamplingBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
1
"
]
forState
:
UIControlStateNormal
];
[
self
.
view
addSubview
:
_onLineSamplingBtn
];
NSLayoutConstraint
*
onLineSamplingTop
=
[
NSLayoutConstraint
constraintWithItem
:
_onLineSamplingBtn
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
...
...
@@ -128,7 +128,7 @@
_wordOfMouthBtn
=
[[
FuncItem
alloc
]
init
];
[
_wordOfMouthBtn
addTarget
:
self
action
:
@selector
(
itemClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_wordOfMouthBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
1
"
]
forState
:
UIControlStateNormal
];
[
_wordOfMouthBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
5
"
]
forState
:
UIControlStateNormal
];
_wordOfMouthBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
view
addSubview
:
_wordOfMouthBtn
];
...
...
@@ -153,7 +153,7 @@
{
if
(
!
_standardBtn
)
{
_standardBtn
=
[[
FuncItem
alloc
]
init
];
[
_standardBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
2
"
]
forState
:
UIControlStateNormal
];
[
_standardBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
4
"
]
forState
:
UIControlStateNormal
];
_standardBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
_standardBtn
addTarget
:
self
action
:
@selector
(
itemClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
...
...
@@ -208,7 +208,7 @@
{
if
(
!
_questionBtn
)
{
_questionBtn
=
[[
FuncItem
alloc
]
init
];
[
_questionBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
4
"
]
forState
:
UIControlStateNormal
];
[
_questionBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
2
"
]
forState
:
UIControlStateNormal
];
_questionBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
_questionBtn
addTarget
:
self
action
:
@selector
(
itemClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
...
...
@@ -233,7 +233,7 @@
{
if
(
!
_rankBtn
)
{
_rankBtn
=
[[
FuncItem
alloc
]
init
];
[
_rankBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
5
"
]
forState
:
UIControlStateNormal
];
[
_rankBtn
setImage
:[
UIImage
imageNamed
:
@"task_00
0
"
]
forState
:
UIControlStateNormal
];
_rankBtn
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
_rankBtn
addTarget
:
self
action
:
@selector
(
itemClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
...
...
redstar/Classes/Module/Function/OnLine/SpotCheckOnLine/ViewController/SpotCheckOnLineViewController.m
View file @
04cebd92
...
...
@@ -344,8 +344,10 @@
// cell的点击事件
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
OnLineCompleteViewController
*
completeVC
=
[[
OnLineCompleteViewController
alloc
]
init
];
[
self
.
navigationController
pushViewController
:
completeVC
animated
:
YES
];
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"该功能正在努力开发中!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
// OnLineCompleteViewController *completeVC = [[OnLineCompleteViewController alloc] init];
// [self.navigationController pushViewController:completeVC animated:YES];
}
...
...
redstar/Classes/Module/Function/Picture/PictureList/ViewController/PictureViewController.m
View file @
04cebd92
...
...
@@ -122,8 +122,11 @@
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
PictureStoryViewController
*
storyVC
=
[[
PictureStoryViewController
alloc
]
init
];
[
self
.
navigationController
pushViewController
:
storyVC
animated
:
YES
];
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"该功能正在努力开发中!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
// PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
// [self.navigationController pushViewController:storyVC animated:YES];
}
// 自定义section
...
...
redstar/Classes/Module/Function/Question/AddQuestion/Cell/AddQuestionTableCell.m
View file @
04cebd92
...
...
@@ -8,10 +8,8 @@
#import "AddQuestionTableCell.h"
@interface
AddQuestionTableCell
()
<
UITextViewDelegate
>
{
UITextView
*
_titleTextView
;
UITextView
*
_contentTextView
;
}
@interface
AddQuestionTableCell
()
@property
(
nonatomic
,
strong
)
UIImageView
*
backImageView1
;
@property
(
nonatomic
,
strong
)
UIImageView
*
backImageView2
;
@end
...
...
@@ -114,7 +112,6 @@
if
(
!
_contentTextView
)
{
_contentTextView
=
[[
UITextView
alloc
]
init
];
_contentTextView
.
tag
=
1002
;
_contentTextView
.
delegate
=
self
;
_contentTextView
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_contentTextView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
backImageView2
addSubview
:
_contentTextView
];
...
...
@@ -190,7 +187,6 @@
if
(
!
_titleTextView
)
{
_titleTextView
=
[[
UITextView
alloc
]
init
];
_titleTextView
.
tag
=
1001
;
_titleTextView
.
delegate
=
self
;
_titleTextView
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_titleTextView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
backImageView1
addSubview
:
_titleTextView
];
...
...
@@ -236,42 +232,6 @@
return
_placeholderLabel1
;
}
#pragma mark - UITextView Delegate
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldChangeTextInRange
:
(
NSRange
)
range
replacementText
:
(
NSString
*
)
text
{
if
(
!
[
text
isEqualToString
:
@""
])
{
if
(
textView
.
tag
==
1001
)
{
self
.
placeholderLabel1
.
hidden
=
YES
;
}
else
{
self
.
placeholderLabel2
.
hidden
=
YES
;
}
}
if
([
text
isEqualToString
:
@""
]
&&
range
.
location
==
0
&&
range
.
length
==
1
)
{
if
(
textView
.
tag
==
1001
)
{
self
.
placeholderLabel1
.
hidden
=
NO
;
}
else
{
self
.
placeholderLabel2
.
hidden
=
NO
;
}
}
if
([
text
isEqualToString
:
@"
\n
"
])
{
[
self
.
titleTextView
resignFirstResponder
];
[
self
.
contentTextView
resignFirstResponder
];
if
(
textView
.
text
.
length
!=
0
)
{
self
.
placeholderLabel1
.
hidden
=
YES
;
self
.
placeholderLabel2
.
hidden
=
YES
;
}
else
{
self
.
placeholderLabel1
.
hidden
=
NO
;
self
.
placeholderLabel2
.
hidden
=
NO
;
}
return
NO
;
}
return
YES
;
}
-
(
void
)
touchesEnded
:
(
NSSet
*
)
touches
withEvent
:
(
UIEvent
*
)
event
{
[
self
.
contentView
endEditing
:
YES
];
}
...
...
redstar/Classes/Module/Function/Question/AddQuestion/ViewController/AddQuestionViewController.m
View file @
04cebd92
...
...
@@ -19,9 +19,6 @@
#import <MBProgressHUD.h>
#import "AddQuestionTableCell.h"
#define kTitleTextViewTag 9283222
#define kContentTextViewTag 9283333
#define CATEGORYLIST @"服务", @"环境企划", @"环境物业", nil
#define QUESTIONLIST @"15分钟退单", @"便民服务", @"基础管理",@"轻松购系统",@"全员服务",@"人员信息",@"营运物流及服务硬件", nil
...
...
@@ -106,71 +103,76 @@
return
;
}
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForRow
:
2
inSection
:
0
];
AddQuestionTableCell
*
cell
=
(
AddQuestionTableCell
*
)[
_tableView
cellForRowAtIndexPath
:
indexPath
];
NSString
*
title
=
[
cell
titleTextView
].
text
;
NSString
*
content
=
[
cell
contentTextView
].
text
;
NSDictionary
*
parameters
;
if
(
_imageNameArray
.
count
==
0
)
{
parameters
=
@{
@"category"
:
_selectLabel
.
text
,
@"group"
:
_selectLabel1
.
text
,
@"title"
:
content
,
@"content"
:
title
};
}
else
{
NSMutableArray
*
imageArray
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
_imageNameArray
.
count
;
i
++
)
{
NSString
*
imageName
=
_imageNameArray
[
i
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
NSData
*
imageData
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
NSString
*
imageBase64
=
[
imageData
base64EncodedStringWithOptions
:
0
];
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
[
dict
setObject
:
imageBase64
forKey
:
@"fileContent"
];
[
dict
setObject
:
imageName
forKey
:
@"fileName"
];
[
dict
setObject
:
@
(
i
)
forKey
:
@"index"
];
[
imageArray
addObject
:
dict
];
}
parameters
=
@{
@"category"
:
_selectLabel
.
text
,
@"group"
:
_selectLabel1
.
text
,
@"title"
:
content
,
@"content"
:
title
,
@"attachments"
:
imageArray
};
}
NSLog
(
@"par = %@"
,
parameters
);
NSDate
*
date
=
[
NSDate
date
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
date
];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
NSString
*
operName
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_name"
];
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"您确定要提交新问题吗?"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确定"
,
nil
];
alert
.
tag
=
9211232
;
[
alert
show
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@?time=%@&operId=%@&operName=%@"
,
kRedStarURL
,
kUpLoadQuestionURL
,
dateString
,
operId
,
operName
];
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
HttpClient
*
client
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
client
uploadNewQuestionWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"上传新问题 response= %@, error = %@"
,
response
,
error
);
if
(
response
[
@"success"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"新问题提报成功!"
delegate
:
self
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
alert
.
tag
=
90393
;
[
alert
show
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
else
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"警告"
message
:
@"新问题提报失败!"
delegate
:
self
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
[
alert
show
];
}
}];
// NSIndexPath *indexPath = [NSIndexPath indexPathForRow:2 inSection:0];
//
// AddQuestionTableCell *cell = (AddQuestionTableCell *)[_tableView cellForRowAtIndexPath:indexPath];
//
// NSString *title = [cell titleTextView].text;
// NSString *content = [cell contentTextView].text;
//
// NSDictionary *parameters;
// if (_imageNameArray.count == 0) {
// parameters = @{@"category":_selectLabel.text,
// @"group":_selectLabel1.text,
// @"title":content,
// @"content":title
// };
// } else {
// NSMutableArray *imageArray = [NSMutableArray array];
// for (int i = 0; i < _imageNameArray.count; i++) {
// NSString *imageName = _imageNameArray[i];
// NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
// UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
// NSData *imageData = UIImageJPEGRepresentation(image, 0.5);
// NSString *imageBase64 = [imageData base64EncodedStringWithOptions:0];
// NSMutableDictionary *dict = [NSMutableDictionary dictionary];
// [dict setObject:imageBase64 forKey:@"fileContent"];
// [dict setObject:imageName forKey:@"fileName"];
// [dict setObject:@(i) forKey:@"index"];
// [imageArray addObject:dict];
// }
//
// parameters = @{@"category":_selectLabel.text,
// @"group":_selectLabel1.text,
// @"title":content,
// @"content":title,
// @"attachments":imageArray};
// }
//
// NSLog(@"par = %@", parameters);
//
//
// NSDate *date = [NSDate date];
// NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
// [dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
// NSString *dateString = [dateFormatter stringFromDate:date];
//
// NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
// NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
//
//
// NSString *url = [NSString stringWithFormat:@"%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kUpLoadQuestionURL, dateString, operId, operName];
// url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
//
// HttpClient *client = [[HttpClient alloc] initWithUrl:url];
// [MBProgressHUD showHUDAddedTo:self.view animated:YES];
// [client uploadNewQuestionWithParameters:parameters completion:^(id response, NSError *error) {
// NSLog(@"上传新问题 response= %@, error = %@", response, error);
// if (response[@"success"]) {
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"新问题提报成功!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
// alert.tag = 90393;
// [alert show];
// [MBProgressHUD hideHUDForView:self.view animated:YES];
// } else {
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"新问题提报失败!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
// [alert show];
// }
// }];
}
...
...
@@ -234,13 +236,138 @@
}
#pragma mark - UITextView Delegate
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldChangeTextInRange
:
(
NSRange
)
range
replacementText
:
(
NSString
*
)
text
{
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForRow
:
2
inSection
:
0
];
AddQuestionTableCell
*
cell
=
(
AddQuestionTableCell
*
)[
_tableView
cellForRowAtIndexPath
:
indexPath
];
if
(
!
[
text
isEqualToString
:
@""
])
{
if
(
textView
.
tag
==
1001
)
{
cell
.
placeholderLabel1
.
hidden
=
YES
;
}
else
{
cell
.
placeholderLabel2
.
hidden
=
YES
;
}
}
if
([
text
isEqualToString
:
@""
]
&&
range
.
location
==
0
&&
range
.
length
==
1
)
{
if
(
textView
.
tag
==
1001
)
{
cell
.
placeholderLabel1
.
hidden
=
NO
;
}
else
{
cell
.
placeholderLabel2
.
hidden
=
NO
;
}
}
if
([
text
isEqualToString
:
@"
\n
"
])
{
[
cell
.
titleTextView
resignFirstResponder
];
[
cell
.
contentTextView
resignFirstResponder
];
if
(
textView
.
tag
==
1001
)
{
if
(
textView
.
text
.
length
!=
0
)
{
cell
.
placeholderLabel1
.
hidden
=
YES
;
}
else
{
cell
.
placeholderLabel1
.
hidden
=
NO
;
}
}
else
{
if
(
textView
.
text
.
length
!=
0
)
{
cell
.
placeholderLabel2
.
hidden
=
YES
;
}
else
{
cell
.
placeholderLabel2
.
hidden
=
NO
;
}
}
return
NO
;
}
if
(
range
.
location
>=
500
)
{
return
NO
;
}
else
{
return
YES
;
}
return
YES
;
}
#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
];
if
(
alertView
.
tag
==
90393
)
{
if
(
buttonIndex
==
0
)
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
NSNotificationCenter
*
notification
=
[
NSNotificationCenter
defaultCenter
];
[
notification
postNotificationName
:
kRefreshQuestionNotification
object
:
self
];
}
}
else
if
(
alertView
.
tag
==
9211232
)
{
if
(
buttonIndex
==
0
)
{
return
;
}
else
{
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForRow
:
2
inSection
:
0
];
AddQuestionTableCell
*
cell
=
(
AddQuestionTableCell
*
)[
_tableView
cellForRowAtIndexPath
:
indexPath
];
NSString
*
title
=
[
cell
titleTextView
].
text
;
NSString
*
content
=
[
cell
contentTextView
].
text
;
NSDictionary
*
parameters
;
if
(
_imageNameArray
.
count
==
0
)
{
parameters
=
@{
@"category"
:
_selectLabel
.
text
,
@"group"
:
_selectLabel1
.
text
,
@"title"
:
content
,
@"content"
:
title
};
}
else
{
NSMutableArray
*
imageArray
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
_imageNameArray
.
count
;
i
++
)
{
NSString
*
imageName
=
_imageNameArray
[
i
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
NSData
*
imageData
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
NSString
*
imageBase64
=
[
imageData
base64EncodedStringWithOptions
:
0
];
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
[
dict
setObject
:
imageBase64
forKey
:
@"fileContent"
];
[
dict
setObject
:
imageName
forKey
:
@"fileName"
];
[
dict
setObject
:
@
(
i
)
forKey
:
@"index"
];
[
imageArray
addObject
:
dict
];
}
parameters
=
@{
@"category"
:
_selectLabel
.
text
,
@"group"
:
_selectLabel1
.
text
,
@"title"
:
content
,
@"content"
:
title
,
@"attachments"
:
imageArray
};
}
NSLog
(
@"par = %@"
,
parameters
);
NSDate
*
date
=
[
NSDate
date
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
date
];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
NSString
*
operName
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_name"
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@?time=%@&operId=%@&operName=%@"
,
kRedStarURL
,
kUpLoadQuestionURL
,
dateString
,
operId
,
operName
];
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
HttpClient
*
client
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
client
uploadNewQuestionWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"上传新问题 response= %@, error = %@"
,
response
,
error
);
if
(
response
[
@"success"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"新问题提报成功!"
delegate
:
self
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
alert
.
tag
=
90393
;
[
alert
show
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
else
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"警告"
message
:
@"新问题提报失败!"
delegate
:
self
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
[
alert
show
];
}
}];
}
}
}
...
...
@@ -328,8 +455,8 @@
if
(
!
cell
)
{
cell
=
[[
AddQuestionTableCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
@"kAddQuestionCell"
];
}
cell
.
titleTextView
.
tag
=
kTitleTextViewTag
;
cell
.
contentTextView
.
tag
=
kContentTextViewTag
;
cell
.
titleTextView
.
delegate
=
self
;
cell
.
contentTextView
.
delegate
=
self
;
return
cell
;
}
else
if
(
indexPath
.
row
==
_rowNumber
-
1
)
{
if
((
_imageNameArray
.
count
+
1
)
%
2
==
0
)
{
...
...
redstar/Classes/Module/Function/Question/QuestionDetail/ViewController/QuestionDetailViewController.m
View file @
04cebd92
...
...
@@ -28,7 +28,7 @@
@property
(
nonatomic
,
strong
)
CommentView
*
commentView
;
@property
(
nonatomic
,
strong
)
QuestionDetailModel
*
questionDetailModel
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
allCommentArray
;
@property
(
nonatomic
,
assign
)
int
clickNumber
;
@end
...
...
@@ -53,6 +53,7 @@
self
.
view
.
backgroundColor
=
kSectionBackGroundColor
;
_clickNumber
=
0
;
}
...
...
@@ -124,6 +125,12 @@
-
(
void
)
addComment
:
(
UIButton
*
)
sender
{
if
([
_questionDetailModel
.
state
isEqualToString
:
@"created"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"当前问题尚未解决,暂不能评论!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
return
;
}
NSArray
*
permissions
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"permissions"
];
if
([
permissions
containsObject
:
@"500504"
])
{
if
(
!
_backGroundView
)
{
...
...
@@ -167,44 +174,11 @@
// 提交评论
-
(
void
)
submitComment
:
(
UIButton
*
)
sender
{
NSDate
*
date
=
[
NSDate
date
];
NSTimeZone
*
zone
=
[
NSTimeZone
systemTimeZone
];
NSInteger
interval
=
[
zone
secondsFromGMTForDate
:
date
];
NSDate
*
localeDate
=
[
date
dateByAddingTimeInterval
:
interval
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
localeDate
];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
NSString
*
operName
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_name"
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@?time=%@&operId=%@&operName=%@"
,
kRedStarURL
,
kAddCommentURL
,
dateString
,
operId
,
operName
];
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
NSLog
(
@"url = %@"
,
url
);
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
NSDictionary
*
parameters
=
@{
@"entityType"
:
@"question"
,
@"entityUuid"
:
_questionUuid
,
@"comment"
:
_commentView
.
contentTextView
.
text
};
NSLog
(
@"parameters = %@"
,
parameters
);
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
httpClient
submitCommentWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"respo = %@, error = %@"
,
response
,
error
);
if
([
response
[
@"message"
]
isEqualToString
:
@"ok"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"添加评论成功"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
alert
.
delegate
=
self
;
[
alert
show
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
else
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"警告"
message
:
@"添加评论失败"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
}];
[
self
closeBackGroundView
];
// 提示框
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"您确定要提交评论吗?"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确定"
,
nil
];
alert
.
tag
=
3652234
;
alert
.
delegate
=
self
;
[
alert
show
];
}
-
(
void
)
closeBackGroundView
...
...
@@ -221,18 +195,27 @@
-
(
void
)
addZan
:
(
ZanButton
*
)
sender
{
if
([
_questionDetailModel
.
state
isEqualToString
:
@"created"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"当前问题尚未解决,暂不能点赞!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
return
;
}
_clickNumber
++
;
if
(
_clickNumber
>
4
)
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"您点赞过于频繁,请稍后再试!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
return
;
}
NSArray
*
permissions
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"permissions"
];
if
([
permissions
containsObject
:
@"500505"
])
{
sender
.
selected
=
!
sender
.
selected
;
NSDate
*
date
=
[
NSDate
date
];
NSTimeZone
*
zone
=
[
NSTimeZone
systemTimeZone
];
NSInteger
interval
=
[
zone
secondsFromGMTForDate
:
date
];
NSDate
*
localeDate
=
[
date
dateByAddingTimeInterval
:
interval
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
localeD
ate
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
d
ate
];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
...
...
@@ -295,6 +278,7 @@
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldChangeTextInRange
:
(
NSRange
)
range
replacementText
:
(
NSString
*
)
text
{
if
(
!
[
text
isEqualToString
:
@""
])
{
_commentView
.
placeholderLabel2
.
hidden
=
YES
;
}
...
...
@@ -313,6 +297,13 @@
return
NO
;
}
if
(
range
.
location
>=
200
)
{
return
NO
;
}
else
{
return
YES
;
}
return
YES
;
}
...
...
@@ -448,32 +439,75 @@
#pragma mark - UIAlertViewDelegate
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
buttonIndex
==
0
)
{
NSString
*
user_uuid
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?userUuid=%@"
,
kRedStarURL
,
kQuestionDetailURL
,
_questionUuid
,
user_uuid
];
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
httpClient
getQuestionDetailWithParameters
:
nil
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSDictionary
*
dict
=
response
[
@"data"
];
NSLog
(
@"问题详情 = %@"
,
dict
);
QuestionDetailModel
*
quesDetail
=
[[
QuestionDetailModel
alloc
]
init
];
[
quesDetail
setValuesForKeysWithDictionary
:
dict
];
_questionDetailModel
=
quesDetail
;
if
(
alertView
.
tag
==
3652234
)
{
if
(
buttonIndex
==
0
)
{
return
;
}
else
{
// 提交数据
NSDate
*
date
=
[
NSDate
date
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
date
];
NSArray
*
commentArray
=
_questionDetailModel
.
comments
;
NSMutableArray
*
tempArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
dict
in
commentArray
)
{
CommentModel
*
comment
=
[[
CommentModel
alloc
]
init
];
[
comment
setValuesForKeysWithDictionary
:
dict
];
[
tempArray
addObject
:
comment
];
}
_allCommentArray
=
tempArray
;
[
self
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
NSString
*
operName
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_name"
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@?time=%@&operId=%@&operName=%@"
,
kRedStarURL
,
kAddCommentURL
,
dateString
,
operId
,
operName
];
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
NSLog
(
@"url = %@"
,
url
);
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
NSDictionary
*
parameters
=
@{
@"entityType"
:
@"question"
,
@"entityUuid"
:
_questionUuid
,
@"comment"
:
_commentView
.
contentTextView
.
text
};
NSLog
(
@"parameters = %@"
,
parameters
);
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
httpClient
submitCommentWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"respo = %@, error = %@"
,
response
,
error
);
if
([
response
[
@"message"
]
isEqualToString
:
@"ok"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"添加评论成功"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
alert
.
delegate
=
self
;
alert
.
tag
=
455232
;
[
alert
show
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
else
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"警告"
message
:
@"添加评论失败"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}
}];
[
self
closeBackGroundView
];
}
}
else
if
(
alertView
.
tag
==
455232
)
{
// 刷新当前问题详情的评论列表
if
(
buttonIndex
==
0
)
{
NSString
*
user_uuid
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_uuid"
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?userUuid=%@"
,
kRedStarURL
,
kQuestionDetailURL
,
_questionUuid
,
user_uuid
];
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
httpClient
getQuestionDetailWithParameters
:
nil
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSDictionary
*
dict
=
response
[
@"data"
];
NSLog
(
@"问题详情 = %@"
,
dict
);
QuestionDetailModel
*
quesDetail
=
[[
QuestionDetailModel
alloc
]
init
];
[
quesDetail
setValuesForKeysWithDictionary
:
dict
];
_questionDetailModel
=
quesDetail
;
NSArray
*
commentArray
=
_questionDetailModel
.
comments
;
NSMutableArray
*
tempArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
dict
in
commentArray
)
{
CommentModel
*
comment
=
[[
CommentModel
alloc
]
init
];
[
comment
setValuesForKeysWithDictionary
:
dict
];
[
tempArray
addObject
:
comment
];
}
_allCommentArray
=
tempArray
;
[
self
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}];
}
}
}
...
...
redstar/Classes/Module/Function/Standar/ViewController/StandardViewController.m
View file @
04cebd92
...
...
@@ -102,10 +102,14 @@
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
section
==
1
)
{
HandOutViewController
*
hoandOutVC
=
[[
HandOutViewController
alloc
]
init
];
[
self
.
navigationController
pushViewController
:
hoandOutVC
animated
:
YES
];
}
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"该功能正在努力开发中!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
[
alert
show
];
// if (indexPath.section == 1) {
// HandOutViewController *hoandOutVC = [[HandOutViewController alloc] init];
// [self.navigationController pushViewController:hoandOutVC animated:YES];
// }
}
#pragma mark - lazy laoding
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectDetail/ViewController/InspectNotUploadViewController.m
View file @
04cebd92
...
...
@@ -78,51 +78,9 @@
return
;
}
NSMutableArray
*
imageArray
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
_imageNameArray
.
count
;
i
++
)
{
NSString
*
imageName
=
_imageNameArray
[
i
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
NSData
*
imageData
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
NSString
*
imageBase64
=
[
imageData
base64EncodedStringWithOptions
:
0
];
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
[
dict
setObject
:
imageBase64
forKey
:
@"fileContent"
];
[
dict
setObject
:
imageName
forKey
:
@"fileName"
];
[
dict
setObject
:
@
(
i
)
forKey
:
@"index"
];
[
imageArray
addObject
:
dict
];
}
NSDate
*
date
=
[
NSDate
date
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
date
];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
NSString
*
operName
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_name"
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?time=%@&operId=%@&operName=%@"
,
kRedStarURL
,
kUpLoadInspectResult
,
self
.
praiseUuid
,
dateString
,
operId
,
operName
];
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
NSLog
(
@"上传检查点url = %@"
,
url
);
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
NSDictionary
*
parameters
=
@{
@"questionUuid"
:
self
.
questionUuid
,
@"storeUuid"
:
self
.
store_uuid
,
@"remark"
:
self
.
footerView
.
contentTextView
.
text
,
@"attachments"
:
imageArray
};
[
httpClient
uploadInspectResultWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"上传检查点 respose =%@ error = %@"
,
response
,
error
);
if
(
response
[
@"success"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"检查点上报成功!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
alert
.
delegate
=
self
;
alert
.
tag
=
39429234
;
[
alert
show
];
}
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}];
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:[
NSString
stringWithFormat
:
@"你确定要上传检查点的相关信息吗?"
]
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确定"
,
nil
];
alert
.
tag
=
533292
;
[
alert
show
];
}
// 返回上一页面
...
...
@@ -283,10 +241,62 @@
#pragma mark - UIAlertViewDelegate
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
buttonIndex
==
0
&&
alertView
.
tag
==
39429234
)
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
NSNotificationCenter
*
notification
=
[
NSNotificationCenter
defaultCenter
];
[
notification
postNotificationName
:
kRefreshInspectPointNotification
object
:
self
];
if
(
alertView
.
tag
==
39429234
)
{
if
(
buttonIndex
==
0
)
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
NSNotificationCenter
*
notification
=
[
NSNotificationCenter
defaultCenter
];
[
notification
postNotificationName
:
kRefreshInspectPointNotification
object
:
self
];
}
}
else
if
(
alertView
.
tag
==
533292
)
{
if
(
buttonIndex
==
0
)
{
return
;
}
else
{
NSMutableArray
*
imageArray
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
_imageNameArray
.
count
;
i
++
)
{
NSString
*
imageName
=
_imageNameArray
[
i
];
NSString
*
fullPath
=
[[
NSHomeDirectory
()
stringByAppendingPathComponent
:
@"Documents"
]
stringByAppendingPathComponent
:
imageName
];
UIImage
*
image
=
[
UIImage
imageWithContentsOfFile
:
fullPath
];
NSData
*
imageData
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
NSString
*
imageBase64
=
[
imageData
base64EncodedStringWithOptions
:
0
];
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
[
dict
setObject
:
imageBase64
forKey
:
@"fileContent"
];
[
dict
setObject
:
imageName
forKey
:
@"fileName"
];
[
dict
setObject
:
@
(
i
)
forKey
:
@"index"
];
[
imageArray
addObject
:
dict
];
}
NSDate
*
date
=
[
NSDate
date
];
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"YYYY-MM-dd+hh:mm:ss"
];
NSString
*
dateString
=
[
dateFormatter
stringFromDate
:
date
];
NSString
*
operId
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_code"
];
NSString
*
operName
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"user_name"
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@?time=%@&operId=%@&operName=%@"
,
kRedStarURL
,
kUpLoadInspectResult
,
self
.
praiseUuid
,
dateString
,
operId
,
operName
];
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
NSLog
(
@"上传检查点url = %@"
,
url
);
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
NSDictionary
*
parameters
=
@{
@"questionUuid"
:
self
.
questionUuid
,
@"storeUuid"
:
self
.
store_uuid
,
@"remark"
:
self
.
footerView
.
contentTextView
.
text
,
@"attachments"
:
imageArray
};
[
httpClient
uploadInspectResultWithParameters
:
parameters
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"上传检查点 respose =%@ error = %@"
,
response
,
error
);
if
(
response
[
@"success"
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"检查点上报成功!"
delegate
:
self
cancelButtonTitle
:
nil
otherButtonTitles
:
@"确定"
,
nil
];
alert
.
delegate
=
self
;
alert
.
tag
=
39429234
;
[
alert
show
];
}
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
}];
}
}
}
...
...
@@ -369,6 +379,12 @@
return
NO
;
}
if
(
range
.
location
>=
200
)
{
return
NO
;
}
else
{
return
YES
;
}
return
YES
;
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/View/InspectDetailHeaderView.m
View file @
04cebd92
...
...
@@ -93,10 +93,7 @@
[
dateFormatter
setDateFormat
:
@"yyyy-MM-dd"
];
// 当前时间
NSDate
*
date
=
[
NSDate
date
];
NSTimeZone
*
zone
=
[
NSTimeZone
systemTimeZone
];
NSInteger
interval
=
[
zone
secondsFromGMTForDate
:
date
];
NSDate
*
localeDate
=
[
date
dateByAddingTimeInterval
:
interval
];
NSString
*
strDate
=
[
dateFormatter
stringFromDate
:
localeDate
];
NSString
*
strDate
=
[
dateFormatter
stringFromDate
:
date
];
NSDate
*
today
=
[
dateFormatter
dateFromString
:
strDate
];
NSLog
(
@"today = %@"
,
today
);
// endTime
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/ViewController/RankDetailViewController.m
View file @
04cebd92
...
...
@@ -177,6 +177,16 @@
}];
}
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldChangeTextInRange
:
(
NSRange
)
range
replacementText
:
(
NSString
*
)
text
{
if
(
range
.
location
>=
200
)
{
return
NO
;
}
else
{
return
YES
;
}
}
// 提交评论
-
(
void
)
submitComment
:
(
UIButton
*
)
sender
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/ViewController/RankingListViewController.m
View file @
04cebd92
...
...
@@ -45,6 +45,8 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
UILabel
*
customLab
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
40
,
30
)];
[
customLab
setTextColor
:[
UIColor
whiteColor
]];
[
customLab
setText
:
@"口碑排名"
];
...
...
redstar/Classes/Module/Mine/ViewController/MineViewController.m
View file @
04cebd92
...
...
@@ -91,12 +91,30 @@
-
(
void
)
quitLoginClick
:
(
UIButton
*
)
sender
{
NSUserDefaults
*
userDefault
=
[
NSUserDefaults
standardUserDefaults
];
[
userDefault
removeObjectForKey
:
@"loginMessage"
];
[
userDefault
removeObjectForKey
:
@"username"
];
[
userDefault
removeObjectForKey
:
@"password"
];
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"您确定要退出登录吗?"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确定"
,
nil
];
alert
.
tag
=
7838347
;
[
alert
show
];
}
[
self
.
tabBarController
dismissViewControllerAnimated
:
YES
completion
:
nil
];
#pragma mark - UIAlertViewDelegate
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
alertView
.
tag
==
7838347
)
{
if
(
buttonIndex
==
0
)
{
return
;
}
else
{
NSUserDefaults
*
userDefault
=
[
NSUserDefaults
standardUserDefaults
];
[
userDefault
removeObjectForKey
:
@"loginMessage"
];
[
userDefault
removeObjectForKey
:
@"username"
];
[
userDefault
removeObjectForKey
:
@"password"
];
[
self
.
tabBarController
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
}
}
#pragma mark - Private Methods
...
...
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