Commit e818d8b4 authored by admin's avatar admin

修改权限问题 修改sop标题

parent 0b9ca0aa
No preview for this file type
......@@ -10,11 +10,13 @@
#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/"
// 最新正式环境
// #define kRedStarURL @"http://219.235.234.212:7580/"
// 检查更新
#define kCheckUpdateURL @"redstar-server/rest/ipapk?type=ipa"
......
......@@ -143,9 +143,11 @@
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = paths.lastObject;
[self downloadFileURL:[NSString stringWithFormat:@"%@%@", kRedStarURL, atta.fileUrl] savePath:path fileName:atta.fileName];
NSString *fileName = [NSString stringWithFormat:@"%@", atta.fileName];
[self downloadFileURL:[NSString stringWithFormat:@"%@%@", kRedStarURL, atta.fileUrl] savePath:path fileName:fileName];
}
- (void)downloadFileURL:(NSString *)aUrl savePath:(NSString *)aSavePath fileName:(NSString *)aFileName
{
NSFileManager *fileManager = [NSFileManager defaultManager];
......@@ -157,14 +159,13 @@
NSLog(@"存在了");
}else{
NSLog(@"不存在");
//创建附件存储目录
if (![fileManager fileExistsAtPath:aSavePath]) {
[fileManager createDirectoryAtPath:aSavePath withIntermediateDirectories:YES attributes:nil error:nil];
}
//下载附件
aUrl = [aUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
aUrl = [aUrl stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSURL *url = [[NSURL alloc] initWithString:aUrl];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
......@@ -172,22 +173,72 @@
operation.inputStream = [NSInputStream inputStreamWithURL:url];
operation.outputStream = [NSOutputStream outputStreamToFileAtPath:fileName append:NO];
//下载进度控制
//已完成下载
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"responseObject == %@", responseObject);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"下载成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
alert.tag = 66690;
[alert show];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
[self.tableView reloadData];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"error == %@", error);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"下载失败!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
[self.tableView reloadData];
}];
[operation start];
}
}
//- (void)downloadFileURL:(NSString *)aUrl savePath:(NSString *)aSavePath fileName:(NSString *)aFileName
//{
// NSFileManager *fileManager = [NSFileManager defaultManager];
//
// //检查本地文件是否已存在
// NSString *fileName = [NSString stringWithFormat:@"%@/%@", aSavePath, aFileName];
// //检查附件是否存在
// if ([fileManager fileExistsAtPath:fileName]) {
// NSLog(@"存在了");
// }else{
// NSLog(@"不存在");
//
// //创建附件存储目录
// if (![fileManager fileExistsAtPath:aSavePath]) {
// [fileManager createDirectoryAtPath:aSavePath withIntermediateDirectories:YES attributes:nil error:nil];
// }
//
// //下载附件
// aUrl = [aUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// NSURL *url = [[NSURL alloc] initWithString:aUrl];
// NSURLRequest *request = [NSURLRequest requestWithURL:url];
//
// AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
// operation.inputStream = [NSInputStream inputStreamWithURL:url];
// operation.outputStream = [NSOutputStream outputStreamToFileAtPath:fileName append:NO];
//
//
// //已完成下载
// [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"下载成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
// alert.tag = 66690;
// [alert show];
// } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"下载失败!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
// [alert show];
// }];
//
// [operation start];
// }
//}
#pragma mark - UIAlertViewDelegate
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
......@@ -245,6 +296,7 @@
cell.downloadBtn.tag = 998473 + indexPath.row;
cell.nameBtn.tag = 998473 + indexPath.row;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = paths.lastObject;
NSString *url = [NSString stringWithFormat:@"%@/%@", path, atta.fileName];
......
......@@ -8,11 +8,14 @@
#import "CheckPicViewController.h"
@interface CheckPicViewController () {
@interface CheckPicViewController ()<UIScrollViewDelegate> {
CGFloat _imageViewW;
CGFloat _imageViewH;
}
@property (nonatomic, strong) UIImageView *takeImageView;
@property (nonatomic, strong) UIScrollView *scrollView;
@end
@implementation CheckPicViewController
......@@ -24,20 +27,21 @@
CGFloat imageW = self.checkImage.size.width;
CGFloat imageH = self.checkImage.size.height;
CGFloat imageViewW,imageViewH;
//CGFloat imageViewW,imageViewH;
if ((imageH / imageW) > (kScreenHeight / kScreenWidth)) {
imageViewH = kScreenHeight;
imageViewW = imageW * (kScreenHeight / imageH);
_imageViewH = kScreenHeight;
_imageViewW = imageW * (kScreenHeight / imageH);
} else {
imageViewH = imageH * (kScreenWidth / imageW);
imageViewW = kScreenWidth;
_imageViewH = imageH * (kScreenWidth / imageW);
_imageViewW = kScreenWidth;
}
self.takeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, imageViewW, imageViewH)];
self.takeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, _imageViewW, _imageViewH)];
_takeImageView.center = CGPointMake(kScreenWidth / 2, (kScreenHeight - 64) / 2);
_takeImageView.image = _checkImage;
_takeImageView.userInteractionEnabled = YES;
[self.view addSubview:_takeImageView];
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
......@@ -48,6 +52,10 @@
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
// self.scrollView.frame = CGRectMake(0, 0, _imageViewW, _imageViewH);
// _scrollView.center = CGPointMake(kScreenWidth / 2, (kScreenHeight - 64) / 2);
// self.scrollView.contentSize = CGSizeMake(_imageViewW, _imageViewH);
}
......@@ -72,15 +80,16 @@
UIView *view = pinchGestureRecognizer.view;
if (pinchGestureRecognizer.state == UIGestureRecognizerStateBegan || pinchGestureRecognizer.state == UIGestureRecognizerStateChanged) {
view.transform = CGAffineTransformScale(view.transform, pinchGestureRecognizer.scale, pinchGestureRecognizer.scale);
if (_takeImageView.frame.size.width < kScreenWidth) {
_takeImageView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
if (_takeImageView.frame.size.width < _imageViewW) {
_takeImageView.frame = CGRectMake(0, (kScreenHeight - 64 - _imageViewH) / 2 , _imageViewW, _imageViewH);
//让图片无法缩得比原图小
}
if (_takeImageView.frame.size.width > 3 * kScreenWidth) {
_takeImageView.frame = CGRectMake(-kScreenWidth, -kScreenHeight, 3 * kScreenWidth, 3 * kScreenHeight);
if (_takeImageView.frame.size.width > 2 * _imageViewW) {
_takeImageView.frame = CGRectMake(-_imageViewW, -_imageViewH, 2 * _imageViewW, 2 * _imageViewH);
}
pinchGestureRecognizer.scale = 1;
}
}
// 处理拖拉手势
......@@ -99,6 +108,27 @@
// Dispose of any resources that can be recreated.
}
- (UIScrollView *)scrollView
{
if (!_scrollView) {
_scrollView = [[UIScrollView alloc] init];
_scrollView.delegate = self;
_scrollView.maximumZoomScale = 2.0;
_scrollView.minimumZoomScale = 1.0;
[self.view addSubview:_scrollView];
}
return _scrollView;
}
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
NSLog(@"image.siz=== %@ scrll.contentSize = %@ ", NSStringFromCGSize(_takeImageView.size), NSStringFromCGSize(scrollView.contentSize) );
return _takeImageView;
}
/*
#pragma mark - Navigation
......
......@@ -33,7 +33,7 @@
[self setupNav];
self.titleArray = [NSArray arrayWithObjects:@"商场风采",@"优秀案例",@"巡店报告", nil];
self.detailTitleArray = [NSArray arrayWithObjects:@"SOP:标准作业程序",@"内部精品培训课程讲义资料...",@"专家讲师精品课程视频分享...", nil];
//self.detailTitleArray = [NSArray arrayWithObjects:@"SOP:标准作业程序",@"内部精品培训课程讲义资料...",@"专家讲师精品课程视频分享...", nil];
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
......
......@@ -199,7 +199,8 @@
- (void)addComment:(UIButton *)sender
{
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500303"]) {
if (!_backGroundView) {
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
......@@ -228,7 +229,12 @@
_commentView.frame = toFrame;
}];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有添加评论的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
}
}
......
......@@ -124,9 +124,16 @@
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
// [alert show];
AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
addPic.category = self.category;
[self.navigationController pushViewController:addPic animated:YES];
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500303"]) {
AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
addPic.category = self.category;
[self.navigationController pushViewController:addPic animated:YES];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有新增图说口碑的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
}
}
- (void)requestPicturePraise
......
......@@ -313,7 +313,7 @@
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"SOP分类查询"];
[customLab setText:@"营运标准"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
......@@ -410,7 +410,13 @@
-(void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
// if ([[self.navigationController.viewControllers objectAtIndex:0] isKindOfClass:[StandardViewController class]]) {
// StandardViewController *masterVC = (StandardViewController *)[self.navigationController.viewControllers objectAtIndex:0];
// [self.navigationController popToViewController:masterVC animated:YES];
// }
// [self.navigationController dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - UIAlertViewDelegate
......
......@@ -31,8 +31,8 @@
[self setupNav];
self.titleArray = [NSArray arrayWithObjects:@"SOP",@"培训讲义",@"培训视频", nil];
self.detailTitleArray = [NSArray arrayWithObjects:@"SOP:标准作业程序",@"内部精品培训课程讲义资料...",@"专家讲师精品课程视频分享...", nil];
self.titleArray = [NSArray arrayWithObjects:@"营运标准",@"培训讲义",@"培训视频", nil];
self.detailTitleArray = [NSArray arrayWithObjects:@"服务口碑管理手册",@"内部精品培训课程讲义资料...",@"专家讲师精品课程视频分享...", nil];
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
......
......@@ -20,5 +20,5 @@
@property (nonatomic, strong) UIButton *showAllBtn; // 展开全部
@property (nonatomic, strong) TaskDetailModel *taskDetail;
@property (nonatomic, strong) UIImageView *arrowImageView2;
@end
......@@ -10,7 +10,6 @@
@interface RankDetailHeaderView ()
@property (nonatomic, strong) UIImageView *arrowImageView1;
@property (nonatomic, strong) UIImageView *arrowImageView2;
@end
......
......@@ -231,12 +231,17 @@
{
sender.selected = !sender.selected;
if (sender.selected) {
_rankDetailHeaderView.arrowImageView2.transform = CGAffineTransformMakeRotation(-M_PI);
_treeView.expandsChildRowsWhenRowExpands = YES;
for (TaskGroup *taskGroup in self.taskData) {
[_treeView expandRowForItem:taskGroup expandChildren:YES withRowAnimation:RATreeViewRowAnimationFade];
}
} else {
_rankDetailHeaderView.arrowImageView2.transform = CGAffineTransformMakeRotation(0);
_treeView.expandsChildRowsWhenRowExpands = NO;
for (TaskGroup *taskGroup in self.taskData) {
......@@ -334,7 +339,7 @@
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell.mainTitleBtn setTitle:[NSString stringWithFormat:@"%d、%@", (int)(data.index + 1) ,data.title] forState:UIControlStateNormal];
if (data.score == NULL || data.score == nil) {
if (data.score == NULL || data.score == nil || [data.score isEqual:[NSNull null]]) {
cell.scoreLabel.text = [NSString stringWithFormat:@"0分"];
} else {
cell.scoreLabel.text = [NSString stringWithFormat:@"%@分", data.score];
......
......@@ -526,6 +526,7 @@
}
#pragma mark - lazy loading
- (UITableView *)tableView
......
......@@ -72,7 +72,8 @@
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:[NSString stringWithFormat:@"%@%@", kRedStarURL, kCheckUpdateURL]];
[httpCilent checkAndUpdateCurrentVersionWithCompletion:^(id response, NSError *error) {
NSLog(@"检查更新 = %@", response);
if (response[@"data"] == nil && response[@"data"] == NULL && response[@"data"] == [NSNull null]) {
if (response[@"data"] == nil || response[@"data"] == NULL || [response[@"data"] isEqual:[NSNull null]] || response[@"data"] == Nil) {
return;
} else {
NSDictionary *dict = response[@"data"];
......
......@@ -134,7 +134,7 @@
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:[NSString stringWithFormat:@"%@%@", kRedStarURL, kCheckUpdateURL]];
[httpCilent checkAndUpdateCurrentVersionWithCompletion:^(id response, NSError *error) {
NSLog(@"检查更新 = %@", response);
if (response[@"data"] == nil && response[@"data"] == NULL && response[@"data"] == [NSNull null]) {
if (response[@"data"] == nil || response[@"data"] == NULL || [response[@"data"] isEqual:[NSNull null]] || response[@"data"] == Nil) {
return;
} else {
NSDictionary *dict = response[@"data"];
......
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