Commit 04cebd92 authored by admin's avatar admin

5:问题加条件现在,如果非已解决,不能点赞和添加评论

parent 30be1a46
......@@ -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>
......@@ -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;
}
......
......@@ -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_000"] forState:UIControlStateNormal];
[_onLineSamplingBtn setImage:[UIImage imageNamed:@"task_001"] 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_001"] forState:UIControlStateNormal];
[_wordOfMouthBtn setImage:[UIImage imageNamed:@"task_005"] forState:UIControlStateNormal];
_wordOfMouthBtn.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_wordOfMouthBtn];
......@@ -153,7 +153,7 @@
{
if (!_standardBtn) {
_standardBtn = [[FuncItem alloc] init];
[_standardBtn setImage:[UIImage imageNamed:@"task_002"] forState:UIControlStateNormal];
[_standardBtn setImage:[UIImage imageNamed:@"task_004"] 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_004"] forState:UIControlStateNormal];
[_questionBtn setImage:[UIImage imageNamed:@"task_002"] 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_005"] forState:UIControlStateNormal];
[_rankBtn setImage:[UIImage imageNamed:@"task_000"] forState:UIControlStateNormal];
_rankBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_rankBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
......
......@@ -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];
}
......
......@@ -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
......
......@@ -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];
}
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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
......
......@@ -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:@"口碑排名"];
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment