Commit 4c551c62 authored by admin's avatar admin

修复部分bug

parent 846ad7e6
......@@ -10,9 +10,9 @@
#define Url_h
// url
// #define kRedStarURL @"http://218.244.151.129:7580/"
#define kRedStarURL @"http://218.244.151.129:7580/"
#define kRedStarURL @"http://219.235.234.225:7580/"
// #define kRedStarURL @"http://219.235.234.225:7580/"
// 检查更新
......
......@@ -20,7 +20,23 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.takeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
self.view.backgroundColor = [UIColor whiteColor];
CGFloat imageW = self.checkImage.size.width;
CGFloat imageH = self.checkImage.size.height;
CGFloat imageViewW,imageViewH;
if ((imageH / imageW) > (kScreenHeight / kScreenWidth)) {
imageViewH = kScreenHeight;
imageViewW = imageW * (kScreenHeight / imageH);
} else {
imageViewH = imageH * (kScreenWidth / imageW);
imageViewW = kScreenWidth;
}
self.takeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, imageViewW, imageViewH)];
_takeImageView.center = CGPointMake(kScreenWidth / 2, (kScreenHeight - 64) / 2);
_takeImageView.image = _checkImage;
[self.view addSubview:_takeImageView];
......
......@@ -71,6 +71,8 @@
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
PictureViewController *pictureVC = [[PictureViewController alloc] init];
......
......@@ -491,7 +491,7 @@
{
LookOnLineModel *lookOnLine = _allLookOnLineList[indexPath.row];
LookOnLineDetailViewController *lookDetailVC = [[LookOnLineDetailViewController alloc] init];
lookDetailVC.uuid = lookOnLine.uuid;
lookDetailVC.lookOnLine = lookOnLine;
[self.navigationController pushViewController:lookDetailVC animated:YES];
}
......
......@@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
@class OnLineDetailModel;
@class LookOnLineModel;
@interface LookOnLineDetailView : UIView
@property (nonatomic, strong) UILabel *titleLabel;
......@@ -21,5 +21,5 @@
@property (nonatomic, strong) UILabel *dayLabel; // 剩余天数
@property (nonatomic, strong) OnLineDetailModel *onLineDetail;
@property (nonatomic, strong) LookOnLineModel *lookOnLine;
@end
......@@ -7,6 +7,7 @@
//
#import "LookOnLineDetailView.h"
#import "LookOnLineModel.h"
@interface LookOnLineDetailView ()
@property (nonatomic, strong) UILabel *shopname; // 商店名称
......@@ -41,9 +42,11 @@
}
- (void)setOnLineDetail:(OnLineDetailModel *)onLineDetail
- (void)setLookOnLine:(LookOnLineModel *)lookOnLine
{
_onLineDetail = onLineDetail;
_lookOnLine = lookOnLine;
self.titleLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.title];
self.bgView.backgroundColor = [UIColor whiteColor];
self.shopname.text = @"商场名称";
......@@ -52,12 +55,12 @@
self.startDate.text = @"发起时间";
self.taskContent.text = @"任务内容";
self.shopnameLabel.text = @"上海真北店";
self.overDateLabel.text = @"2015-10-03";
self.shopnameLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.store_name];
self.overDateLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.endDate];
self.peopleLabel.text = @"王XX 集团X领导";
self.startDateLabel.text = @"2015-09-30 12:20:12";
self.startDateLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.reportTime];
NSString *intro = @"1.大厅促销标语、彩旗拍照不少于3张; 2.促销人员着装拍照不少于4张; 3.大厅促销站台拍照不少于3张。";
NSString *intro = [NSString stringWithFormat:@"%@", lookOnLine.content];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:intro];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:5];
......@@ -71,9 +74,9 @@
self.dayLabel.text = @"2";
self.pictureLabel.text = @"现场照片";
}
- (UILabel *)titleLabel
{
if (!_titleLabel) {
......
......@@ -7,7 +7,9 @@
//
#import <UIKit/UIKit.h>
#import "LookOnLineModel.h"
@interface LookOnLineDetailViewController : UIViewController
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, strong) LookOnLineModel *lookOnLine;
@end
......@@ -29,7 +29,6 @@
@property (nonatomic, strong) LookOnLineFootView *footView;
@property (nonatomic, strong) NSMutableArray *imageNameArray;
@property (nonatomic, strong) OnLineDetailModel *onLineDetail;
@property (nonatomic, assign) int rowNumber;
@end
......@@ -52,7 +51,6 @@
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self requestOnLineDetail];
}
......@@ -82,25 +80,6 @@
self.navigationItem.titleView = customLab;
}
- (void)requestOnLineDetail
{
NSString *url = [NSString stringWithFormat:@"%@%@%@?fetch_parts=stores", kRedStarURL, kSportcheckDetailURL,self.uuid];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
[httpClient getSportCheckDetailWithCompletion:^(id response, NSError *error) {
NSLog(@"5.4 抽查明细 response = %@, error = %@", response, error);
NSDictionary *dataDict = response[@"data"];
OnLineDetailModel *onlineDetail = [[OnLineDetailModel alloc] init];
[onlineDetail setValuesForKeysWithDictionary:dataDict];
_onLineDetail = onlineDetail;
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.tableView reloadData];
}];
}
- (void)reportRestult:(UIButton *)sender
{
......@@ -166,7 +145,7 @@
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kReportCheckResultURL,@"checkId", dateString, operId, operName];
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kReportCheckResultURL,_lookOnLine.uuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSLog(@"上报抽检结果 url = %@", url);
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
......@@ -187,7 +166,7 @@
}
NSDictionary *parameters = @{
@"storeUuid":@"",
@"storeUuid":_lookOnLine.store_uuid,
@"processNote":self.footView.contentTextView.text,
@"attachments":imageArray,
};
......@@ -195,9 +174,23 @@
[httpClient reportCheckResultWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"上报抽检结果 response = %@", response);
NSLog(@"上报抽检结果 error = %@", error);
if ([response[@"message"] isEqualToString:@"ok"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"上报成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
alert.tag = 314332;
alert.delegate = self;
[alert show];
}
}];
}
}
if (alertView.tag == 314332) {
if (buttonIndex == 0) {
[self.navigationController popViewControllerAnimated:YES];
}
}
}
#pragma mark - UIImagePickerController 代理方法
......@@ -260,7 +253,6 @@
[cell.photoButton1 setImage:image0 forState:UIControlStateNormal];
NSString *imageName1 = _imageNameArray[(indexPath.row) * 2 + 1];
NSLog(@"imageName = %@", imageName1);
NSString *fullPath1 = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName1];
UIImage *image1 = [UIImage imageWithContentsOfFile:fullPath1];
[cell.photoButton2 setImage:image1 forState:UIControlStateNormal];
......@@ -312,7 +304,7 @@
if (!_headerView) {
_headerView = [[LookOnLineDetailView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 295)];
_headerView.titleLabel.text = @"2015年十一促销临时抽查";
_headerView.onLineDetail = _onLineDetail;
_headerView.lookOnLine = _lookOnLine;
}
return _headerView;
}
......
......@@ -176,10 +176,14 @@
if (indexPath.section == 0) {
return;
} else {
OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
onLineResult.storeDetail = _allStoreArray[indexPath.row];
onLineResult.checkUuid = self.uuid;
[self.navigationController pushViewController:onLineResult animated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
// onLineResult.storeDetail = _allStoreArray[indexPath.row];
// onLineResult.checkUuid = self.uuid;
// [self.navigationController pushViewController:onLineResult animated:YES];
}
}
......
......@@ -193,8 +193,10 @@
- (void)addSpotCheckTaskClick:(UIButton *)sender
{
OnLineViewController *onlineVC = [[OnLineViewController alloc] init];
[self.navigationController pushViewController:onlineVC animated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// OnLineViewController *onlineVC = [[OnLineViewController alloc] init];
// [self.navigationController pushViewController:onlineVC animated:YES];
}
- (void)dropCilck:(MenuButton *)sender
......@@ -380,7 +382,6 @@
[parameters setObject:@"reported" forKey:@"state"];
} else {
[parameters setObject:@"finished" forKey:@"state"];
}
NSArray *array = @[@{@"field":@"state"}];
[parameters setObject:array forKey:@"queryOrders"];
......@@ -490,7 +491,7 @@
#pragma mark - TaxisDelegate
- (void)timeChange:(UIButton *)sender
{
_page = 0;
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kManageSportcheckURL];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSArray *queryOrders;
......@@ -512,7 +513,7 @@
// 相关参数
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters = @{@"userUuid":user_uuid,
@"pageNumber":@(0),
@"pageNumber":@(_page),
@"pageSize":@(10),
@"queryOrders":queryOrders
};
......@@ -520,7 +521,16 @@
[httpCilent getManageSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"管理层的抽查列表 response= %@", response);
NSLog(@"管理层的抽查列表 error= %@", error);
NSDictionary *dataDict = response[@"data"];
NSArray *recordsArray = dataDict[@"records"];
NSMutableArray *tempArray = [NSMutableArray array];
for (NSDictionary *dict in recordsArray) {
SpotCheckModel *spot = [[SpotCheckModel alloc] init];
[spot setValuesForKeysWithDictionary:dict];
[tempArray addObject:spot];
}
_allSpotCheckList = tempArray;
if (_allSpotCheckList.count == 0) {
if (_tableView) {
......
......@@ -115,8 +115,12 @@
- (void)addClick:(UIButton *)sender
{
AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
[self.navigationController pushViewController:addPic animated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
// [self.navigationController pushViewController:addPic animated:YES];
}
- (void)requestPicturePraise
......@@ -531,6 +535,7 @@
#pragma mark - TaxisDelegate
- (void)timeChange:(UIButton *)sender
{
_page = 0;
// 请求地址
NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQueryPicturePraiseURL];
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
......@@ -550,7 +555,7 @@
}
NSDictionary *parameters = @{@"user":user_uuid,
@"pageNumber":@(0),
@"pageNumber":@(_page),
@"pageSize":@(10),
@"queryOrders":queryOrders
};
......
......@@ -43,9 +43,9 @@
{
_spotCheck = spotCheck;
self.titleLabel.text = [NSString stringWithFormat:@"%@", spotCheck.title];
self.startDate.text = [NSString stringWithFormat:@"起始时间:%@", spotCheck.endDate];
self.startDate.text = [NSString stringWithFormat:@"起始时间:%@", spotCheck.create_time];
self.overDate.text = [NSString stringWithFormat:@"截止时间:%@", spotCheck.endDate];
self.address.text = [NSString stringWithFormat:@"巡检商场:%@", spotCheck.content];
self.address.text = [NSString stringWithFormat:@"巡检商场:%@", @"上海真北店"];
self.alreadyLabel.text = [NSString stringWithFormat:@"%d", spotCheck.reportCount];
self.allLabel.text = [NSString stringWithFormat:@"/%d", spotCheck.storeCount];
......
......@@ -121,7 +121,7 @@
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(_page),
@"pageSize":@(10)
};
......@@ -157,7 +157,7 @@
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(0),
@"pageSize":@(10)
};
......@@ -213,7 +213,7 @@
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(0),
@"pageSize":@(10)
};
......
......@@ -229,7 +229,6 @@
TaskGroup *taskGroup = _taskData[indexPath.section - 1];
TaskModel *task = taskGroup.answers[indexPath.row];
cell.task = task;
cell.titleLabel.text = [NSString stringWithFormat:@"%d、%@", (int)indexPath.row + 1 ,task.title];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
......@@ -254,14 +253,20 @@
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500103"]) {
//InspectNoUpLoadViewController *inspectNotVC = [[InspectNoUpLoadViewController alloc] init];
InspectNotUploadViewController *inspectNotVC = [[InspectNotUploadViewController alloc] init];
inspectNotVC.questionCount = taskGroup.questionCount;
inspectNotVC.taskModel = task;
inspectNotVC.store_uuid = _taskDetail.store_uuid;
inspectNotVC.praiseUuid = _taskDetail.uuid;
inspectNotVC.questionUuid = task.uuid;
[self.navigationController pushViewController:inspectNotVC animated:YES];
if ([task.readonly isEqualToString:@"1"]) {
InspectUploadedViewController *inspectVC = [[InspectUploadedViewController alloc] init];
inspectVC.questionCount = taskGroup.questionCount;
inspectVC.taskModel = task;
[self.navigationController pushViewController:inspectVC animated:YES];
} else {
InspectNotUploadViewController *inspectNotVC = [[InspectNotUploadViewController alloc] init];
inspectNotVC.questionCount = taskGroup.questionCount;
inspectNotVC.taskModel = task;
inspectNotVC.store_uuid = _taskDetail.store_uuid;
inspectNotVC.praiseUuid = _taskDetail.uuid;
inspectNotVC.questionUuid = task.uuid;
[self.navigationController pushViewController:inspectNotVC animated:YES];
}
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有编辑检查点的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
......
......@@ -59,6 +59,7 @@
bgButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
[bgButton addTarget:self action:@selector(headBtnClick) forControlEvents:UIControlEventTouchUpInside];
bgButton.backgroundColor = [UIColor whiteColor];
bgButton.titleLabel.numberOfLines = 0;
[self addSubview:bgButton];
_bgButton = bgButton;
......@@ -129,13 +130,6 @@
} else {
_scoreLabel.text = [NSString stringWithFormat:@"%.1f",rankListModel.score];
}
// if (rankListModel.score == nil || rankListModel.score == NULL || [rankListModel.score isEqual:[NSNull null]]) {
// _scoreLabel.text = [NSString stringWithFormat:@"0"];
// } else {
// _scoreLabel.text = [NSString stringWithFormat:@"%@",rankListModel.score];
// }
}
......
......@@ -412,6 +412,7 @@
_pickerView.backgroundColor = [UIColor whiteColor];
_pickerView.pickerView.delegate = self;
_pickerView.pickerView.dataSource = self;
_pickerView.pickerView.showsSelectionIndicator = YES;
}
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
......@@ -512,7 +513,8 @@
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
NSDictionary *dict = _titleArray[row];
return [NSString stringWithFormat:@"%@", dict[@"name"]];
NSString *title = [NSString stringWithFormat:@"%@", dict[@"name"]];
return title;
}
......
......@@ -114,7 +114,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
if ([permissions containsObject:@"500501"] || [permissions containsObject:@"500502"]) {
[self.titleArray addObject:@"问题知识"];
[self requestQuestionList];
}
......@@ -130,17 +129,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
}
[[NSUserDefaults standardUserDefaults] setObject:_titleArray forKey:@"function"];
NSLog(@"-title = =%@", _titleArray);
// 初始化容器
// self.btnTitleArray = [NSArray arrayWithObjects:@"在线抽查", @"口碑巡检",@"口碑标准",@"图说口碑",@"问题知识",@"口碑排名",@"查看抽查", nil];
// self.announeArray = [NSArray arrayWithObjects:@"关于展开10月口碑巡检的说明", @"迎2015十一大促活动启动", @"9月口碑巡检结果排名已公布", nil];
//
// // 初始化
// self.test1Array = [NSArray arrayWithObjects:@"【服务口碑现场】第二期",@"讲述红星人自己的故事",@"【服务口碑现场】第一期", nil];
// self.test2Array = [NSArray arrayWithObjects:@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。",@"变成商场服务提升的契机,变成商场服务提升的契机。",@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。", nil];
// self.test3Array = [NSArray arrayWithObjects:@"2015-08-26",@"2015-08-09",@"2015-07-31", nil];
[self setupNav];
......@@ -193,7 +181,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSString *url3 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
HttpClient *httpCilent3 = [[HttpClient alloc] initWithUrl:url3];
NSDictionary *parameters3 = @{@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(0),
@"pageSize":@(2)
};
......@@ -353,7 +341,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(0),
@"pageSize":@(2)
};
......@@ -504,8 +492,15 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
// LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init];
// nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine];
// StandardViewController *standardVC = [[StandardViewController alloc] init];
// nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
......
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