Commit 50ba09db authored by admin's avatar admin

添加了部分权限

parent 16b457f6
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
LoginViewController *loginVC = [[LoginViewController alloc] init]; LoginViewController *loginVC = [[LoginViewController alloc] init];
self.window.rootViewController = loginVC; self.window.rootViewController = loginVC;
return YES; return YES;
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
[self setupTabbar]; [self setupTabbar];
self.delegate = self; self.delegate = self;
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
...@@ -61,10 +62,6 @@ ...@@ -61,10 +62,6 @@
AnnounceViewController *announce = (AnnounceViewController *)[self setUpOneChildViewController:[[AnnounceViewController alloc] init] title:@"公告" imageName:@"notice_unchecked" selImageName:@"notice_checked"]; AnnounceViewController *announce = (AnnounceViewController *)[self setUpOneChildViewController:[[AnnounceViewController alloc] init] title:@"公告" imageName:@"notice_unchecked" selImageName:@"notice_checked"];
announce.tabBarItem.tag = 3928; announce.tabBarItem.tag = 3928;
// // 添加nav
// UINavigationController *announceNav = [[UINavigationController alloc] initWithRootViewController:announce];
// [announceNav.navigationBar setBarTintColor:kNavigationBarColor];
// [announceNav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
MineViewController *mine = (MineViewController *)[self setUpOneChildViewController:[[MineViewController alloc] init] title:@"我的" imageName:@"aboutme_unchecked" selImageName:@"aboutme_checke"]; MineViewController *mine = (MineViewController *)[self setUpOneChildViewController:[[MineViewController alloc] init] title:@"我的" imageName:@"aboutme_unchecked" selImageName:@"aboutme_checke"];
mine.tabBarItem.tag = 18274; mine.tabBarItem.tag = 18274;
......
...@@ -128,33 +128,40 @@ ...@@ -128,33 +128,40 @@
- (void)addComment:(UIButton *)sender - (void)addComment:(UIButton *)sender
{ {
if (!_backGroundView) { NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds]; if ([permissions containsObject:@"500504"]) {
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)]; if (!_backGroundView) {
[_backGroundView addGestureRecognizer:tapGR]; _backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
} UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
if (!_commentView) { [_backGroundView addGestureRecognizer:tapGR];
_commentView = [[CommentView alloc] init]; }
_commentView.backgroundColor = [UIColor whiteColor]; if (!_commentView) {
_commentView = [[CommentView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor];
}
_commentView.contentTextView.text = @"";
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentViewHeight, kScreenWidth, kCommentViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有添加评论的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} }
_commentView.contentTextView.text = @"";
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentViewHeight, kScreenWidth, kCommentViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
} }
// 提交评论 // 提交评论
...@@ -214,51 +221,58 @@ ...@@ -214,51 +221,58 @@
- (void)addZan:(ZanButton *)sender - (void)addZan:(ZanButton *)sender
{ {
sender.selected = !sender.selected; NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500505"]) {
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"];
if (sender.selected) {
// 点赞
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kAddLikeURL, _questionUuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url]; sender.selected = !sender.selected;
[httpClient likeCountWithParameters:nil completion:^(id response, NSError *error) {
if (response[@"success"]) {
int likeCount = [sender.titleLabel.text intValue];
[sender setTitle:[NSString stringWithFormat:@"%d", likeCount + 1] forState:UIControlStateNormal];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"点赞失败!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
}];
} else {
// 取消点赞
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kCancelLikeURL, _questionUuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url]; NSDate *date = [NSDate date];
[httpClient likeCountWithParameters:nil completion:^(id response, NSError *error) { NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSLog(@"取消点赞response = %@", response); NSInteger interval = [zone secondsFromGMTForDate:date];
if (response[@"success"]) { NSDate *localeDate = [date dateByAddingTimeInterval:interval];
int likeCount = [sender.titleLabel.text intValue]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[sender setTitle:[NSString stringWithFormat:@"%d", likeCount - 1] forState:UIControlStateNormal]; [dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
} else { NSString *dateString = [dateFormatter stringFromDate:localeDate];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"取消点赞失败!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
} NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
}]; NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
if (sender.selected) {
// 点赞
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kAddLikeURL, _questionUuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
[httpClient likeCountWithParameters:nil completion:^(id response, NSError *error) {
if (response[@"success"]) {
int likeCount = [sender.titleLabel.text intValue];
[sender setTitle:[NSString stringWithFormat:@"%d", likeCount + 1] forState:UIControlStateNormal];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"点赞失败!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
}];
} else {
// 取消点赞
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kCancelLikeURL, _questionUuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
[httpClient likeCountWithParameters:nil completion:^(id response, NSError *error) {
NSLog(@"取消点赞response = %@", response);
if (response[@"success"]) {
int likeCount = [sender.titleLabel.text intValue];
[sender setTitle:[NSString stringWithFormat:@"%d", likeCount - 1] forState:UIControlStateNormal];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"取消点赞失败!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
}];
}
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有点赞的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} }
} }
......
...@@ -172,8 +172,16 @@ ...@@ -172,8 +172,16 @@
- (void)addQuestionClick:(UIButton *)sender - (void)addQuestionClick:(UIButton *)sender
{ {
AddQuestionViewController *addQuestionVC = [[AddQuestionViewController alloc] init]; NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
[self.navigationController pushViewController:addQuestionVC animated:YES]; if ([permissions containsObject:@"500503"]) {
AddQuestionViewController *addQuestionVC = [[AddQuestionViewController alloc] init];
[self.navigationController pushViewController:addQuestionVC animated:YES];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有新增问题权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
}
} }
- (void)dropCilck:(MenuButton *)sender - (void)dropCilck:(MenuButton *)sender
......
...@@ -199,28 +199,33 @@ ...@@ -199,28 +199,33 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
TaskGroup *taskGroup = _taskData[indexPath.section]; TaskGroup *taskGroup = _taskData[indexPath.section];
TaskModel *task = taskGroup.answers[indexPath.row]; TaskModel *task = taskGroup.answers[indexPath.row];
if (task.state == 0) { if (task.state == 0) {
//InspectNoUpLoadViewController *inspectNotVC = [[InspectNoUpLoadViewController alloc] init]; NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500103"]) {
InspectNotUploadViewController *inspectNotVC = [[InspectNotUploadViewController alloc] init];
inspectNotVC.questionCount = taskGroup.questionCount; //InspectNoUpLoadViewController *inspectNotVC = [[InspectNoUpLoadViewController alloc] init];
inspectNotVC.taskModel = task; InspectNotUploadViewController *inspectNotVC = [[InspectNotUploadViewController alloc] init];
inspectNotVC.store_uuid = _taskDetail.store_uuid; inspectNotVC.questionCount = taskGroup.questionCount;
inspectNotVC.praiseUuid = _taskDetail.uuid; inspectNotVC.taskModel = task;
inspectNotVC.questionUuid = task.uuid; inspectNotVC.store_uuid = _taskDetail.store_uuid;
[self.navigationController pushViewController:inspectNotVC animated:YES]; 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];
}
} else { } else {
InspectUploadedViewController *inspectVC = [[InspectUploadedViewController alloc] init]; InspectUploadedViewController *inspectVC = [[InspectUploadedViewController alloc] init];
inspectVC.questionCount = taskGroup.questionCount; inspectVC.questionCount = taskGroup.questionCount;
inspectVC.taskModel = task; inspectVC.taskModel = task;
[self.navigationController pushViewController:inspectVC animated:YES]; [self.navigationController pushViewController:inspectVC animated:YES];
} }
} }
// cell的高度 // cell的高度
......
...@@ -124,32 +124,39 @@ ...@@ -124,32 +124,39 @@
} }
- (void)addComment:(UIButton *)sender - (void)addComment:(UIButton *)sender
{ {
if (!_backGroundView) { NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds]; if ([permissions containsObject:@"500202"]) {
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)]; if (!_backGroundView) {
[_backGroundView addGestureRecognizer:tapGR]; _backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
} UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
if (!_commentView) { [_backGroundView addGestureRecognizer:tapGR];
_commentView = [[CommentView alloc] init]; }
_commentView.backgroundColor = [UIColor whiteColor]; if (!_commentView) {
_commentView = [[CommentView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor];
}
_commentView.contentTextView.text = @"";
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentViewHeight, kScreenWidth, kCommentViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有评论的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} }
_commentView.contentTextView.text = @"";
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentViewHeight, kScreenWidth, kCommentViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
} }
...@@ -157,14 +164,10 @@ ...@@ -157,14 +164,10 @@
// 提交评论 // 提交评论
- (void)submitComment:(UIButton *)sender - (void)submitComment:(UIButton *)sender
{ {
NSDate *date = [NSDate date]; NSDate *date = [NSDate date];
NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSInteger interval = [zone secondsFromGMTForDate:date];
NSDate *localeDate = [date dateByAddingTimeInterval:interval];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"]; [dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:localeDate]; NSString *dateString = [dateFormatter stringFromDate:date];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"]; NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) HomeHeaderView *headView; @property (nonatomic, strong) HomeHeaderView *headView;
@property (nonatomic, strong) NSArray *titleArray; // section标题 @property (nonatomic, strong) NSMutableArray *titleArray; // section标题
@property (nonatomic, strong) NSArray *btnTitleArray; // section标题 @property (nonatomic, strong) NSArray *btnTitleArray; // section标题
@property (nonatomic, strong) NSArray *announeArray; // 公告内容 @property (nonatomic, strong) NSArray *announeArray; // 公告内容
...@@ -95,9 +95,36 @@ ...@@ -95,9 +95,36 @@
customLab.font = [UIFont boldSystemFontOfSize:19]; customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab; self.navigationItem.titleView = customLab;
self.titleArray = [NSMutableArray array];
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500101"] || [permissions containsObject:@"500102"]) {
[self.titleArray addObject:@"口碑巡检"];
[self requestInspectList];
}
if ([permissions containsObject:@"500201"]) {
[self.titleArray addObject:@"口碑排名"];
[self requestRankingList];
}
if ([permissions containsObject:@"500301"] || [permissions containsObject:@"500302"]) {
[self.titleArray addObject:@"图说口碑"];
}
if ([permissions containsObject:@"500401"] || [permissions containsObject:@"500402"]) {
[self.titleArray addObject:@"口碑标准"];
}
if ([permissions containsObject:@"500501"] || [permissions containsObject:@"500502"]) {
[self.titleArray addObject:@"问题知识"];
[self requestQuestionList];
}
if ([permissions containsObject:@"500701"] || [permissions containsObject:@"500702"]) {
[self.titleArray addObject:@"在线抽查"];
}
NSLog(@"self.titlar = %@", self.titleArray);
// 初始化容器 // 初始化容器
self.titleArray = [NSArray arrayWithObjects:@"图说口碑", @"8月口碑巡检",@"问题与知识",@"口碑任务", nil]; //self.titleArray = [NSMutableArray arrayWithObjects:@"图说口碑", @"8月口碑巡检",@"问题与知识",@"口碑任务", nil];
self.btnTitleArray = [NSArray arrayWithObjects:@"在线抽查", @"口碑巡检",@"口碑标准",@"图说口碑",@"问题知识",@"口碑排名",@"查看抽查", nil]; self.btnTitleArray = [NSArray arrayWithObjects:@"在线抽查", @"口碑巡检",@"口碑标准",@"图说口碑",@"问题知识",@"口碑排名",@"查看抽查", nil];
self.announeArray = [NSArray arrayWithObjects:@"关于展开10月口碑巡检的说明", @"迎2015十一大促活动启动", @"9月口碑巡检结果排名已公布", nil]; self.announeArray = [NSArray arrayWithObjects:@"关于展开10月口碑巡检的说明", @"迎2015十一大促活动启动", @"9月口碑巡检结果排名已公布", nil];
// 初始化 // 初始化
...@@ -121,13 +148,7 @@ ...@@ -121,13 +148,7 @@
self.tableView.tableHeaderView = self.headView; self.tableView.tableHeaderView = self.headView;
//
[self requestRankingList];
// 巡检列表
[self requestInspectList];
// 问题与知识
[self requestQuestionList];
// 设置下拉刷新 // 设置下拉刷新
self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
...@@ -355,13 +376,14 @@ ...@@ -355,13 +376,14 @@
CGFloat itemW = kScreenWidth / 4; CGFloat itemW = kScreenWidth / 4;
CGFloat itemH = self.headView.scrollView.frame.size.height; CGFloat itemH = self.headView.scrollView.frame.size.height;
for (int i = 0; i < 7; i++) { for (int i = 0; i < _titleArray.count; i++) {
HomeCellItem *item = [[HomeCellItem alloc] init]; HomeCellItem *item = [[HomeCellItem alloc] init];
item.frame = CGRectMake(i * itemW, 0, itemW, itemH); item.frame = CGRectMake(i * itemW, 0, itemW, itemH);
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"task_0%d", i]]; NSString *nameStr = _titleArray[i];
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@", nameStr]];
[item setImage:image forState:UIControlStateNormal]; [item setImage:image forState:UIControlStateNormal];
[item setTitleColor:kPictureCellDetailsColor forState:UIControlStateNormal]; [item setTitleColor:kPictureCellDetailsColor forState:UIControlStateNormal];
[item setTitle:[NSString stringWithFormat:@"%@", self.btnTitleArray[i]] forState:UIControlStateNormal]; [item setTitle:nameStr forState:UIControlStateNormal];
[item addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside]; [item addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[self.headView.scrollView addSubview:item]; [self.headView.scrollView addSubview:item];
} }
...@@ -552,7 +574,7 @@ ...@@ -552,7 +574,7 @@
#pragma mark - TableView Delegate/DataSource #pragma mark - TableView Delegate/DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{ {
return _titleArray.count + _rankData.count; return 4 + _rankData.count;
} }
...@@ -760,13 +782,21 @@ ...@@ -760,13 +782,21 @@
titleLabel.font = [UIFont systemFontOfSize:17.0]; titleLabel.font = [UIFont systemFontOfSize:17.0];
if (section == 0) { if (section == 0) {
titleLabel.text = _titleArray[section]; titleLabel.text = @"测试";
// titleLabel.text = _titleArray[section];
} else if (section == 1) { } else if (section == 1) {
titleLabel.text = _titleArray[section]; titleLabel.text = @"测试";
//titleLabel.text = _titleArray[section];
} else if (section == 2 + _rankData.count) { } else if (section == 2 + _rankData.count) {
titleLabel.text = _titleArray[section - _rankData.count]; titleLabel.text = @"测试";
// titleLabel.text = _titleArray[section - _rankData.count];
} else { } else {
titleLabel.text = _titleArray[section - _rankData.count]; titleLabel.text = @"测试";
//titleLabel.text = _titleArray[section - _rankData.count];
} }
[sectionView addSubview:titleLabel]; [sectionView addSubview:titleLabel];
......
...@@ -144,10 +144,13 @@ ...@@ -144,10 +144,13 @@
NSString *user_code = dict[@"user_code"]; NSString *user_code = dict[@"user_code"];
NSString *user_name = dict[@"user_name"]; NSString *user_name = dict[@"user_name"];
NSString *user_uuid = dict[@"user_uuid"]; NSString *user_uuid = dict[@"user_uuid"];
NSArray *permissions = dict[@"permissions"];
[userDefault setObject:user_code forKey:@"user_code"]; [userDefault setObject:user_code forKey:@"user_code"];
[userDefault setObject:user_name forKey:@"user_name"]; [userDefault setObject:user_name forKey:@"user_name"];
[userDefault setObject:user_uuid forKey:@"user_uuid"]; [userDefault setObject:user_uuid forKey:@"user_uuid"];
[userDefault setObject:permissions forKey:@"permissions"];
self.rootTBC = [[RootTabBarController alloc] init]; self.rootTBC = [[RootTabBarController alloc] init];
[MBProgressHUD hideHUDForView:window animated:YES]; [MBProgressHUD hideHUDForView:window animated:YES];
[self presentViewController:_rootTBC animated:YES completion:nil]; [self presentViewController:_rootTBC animated:YES completion:nil];
...@@ -198,9 +201,11 @@ ...@@ -198,9 +201,11 @@
NSString *user_code = dict[@"user_code"]; NSString *user_code = dict[@"user_code"];
NSString *user_name = dict[@"user_name"]; NSString *user_name = dict[@"user_name"];
NSString *user_uuid = dict[@"user_uuid"]; NSString *user_uuid = dict[@"user_uuid"];
NSArray *permissions = dict[@"permissions"];
[[NSUserDefaults standardUserDefaults] setObject:user_code forKey:@"user_code"]; [[NSUserDefaults standardUserDefaults] setObject:user_code forKey:@"user_code"];
[[NSUserDefaults standardUserDefaults] setObject:user_name forKey:@"user_name"]; [[NSUserDefaults standardUserDefaults] setObject:user_name forKey:@"user_name"];
[[NSUserDefaults standardUserDefaults] setObject:user_uuid forKey:@"user_uuid"]; [[NSUserDefaults standardUserDefaults] setObject:user_uuid forKey:@"user_uuid"];
[[NSUserDefaults standardUserDefaults] setObject:permissions forKey:@"permissions"];
// 进入RootTabBar // 进入RootTabBar
self.rootTBC = [[RootTabBarController alloc] init]; self.rootTBC = [[RootTabBarController alloc] init];
[MBProgressHUD hideHUDForView:window animated:YES]; [MBProgressHUD hideHUDForView:window animated:YES];
......
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