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
ce9164a1
Commit
ce9164a1
authored
Dec 03, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限修改完毕
parent
c694e41b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
39 deletions
+114
-39
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
HomeViewController.m
...r/Classes/Module/Home/ViewController/HomeViewController.m
+114
-39
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
ce9164a1
No preview for this file type
redstar/Classes/Module/Home/ViewController/HomeViewController.m
View file @
ce9164a1
...
...
@@ -97,6 +97,11 @@
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
];
...
...
@@ -108,23 +113,19 @@
[
self
requestQuestionList
];
}
if
([
permissions
containsObject
:
@"500101"
]
||
[
permissions
containsObject
:
@"500102"
])
{
[
self
.
titleArray
addObject
:
@"口碑巡检"
];
[
self
requestInspectList
];
}
if
([
permissions
containsObject
:
@"500301"
]
||
[
permissions
containsObject
:
@"500302"
])
{
//
[self.titleArray addObject:@"图说口碑"];
[
self
.
titleArray
addObject
:
@"图说口碑"
];
}
if
([
permissions
containsObject
:
@"500401"
]
||
[
permissions
containsObject
:
@"500402"
])
{
//
[self.titleArray addObject:@"口碑标准"];
[
self
.
titleArray
addObject
:
@"口碑标准"
];
}
if
([
permissions
containsObject
:
@"500701"
]
||
[
permissions
containsObject
:
@"500702"
])
{
//
[self.titleArray addObject:@"在线抽查"];
[
self
.
titleArray
addObject
:
@"在线抽查"
];
}
NSLog
(
@"self.titlar = %@"
,
self
.
titleArray
);
// 初始化容器
//self.titleArray = [NSMutableArray arrayWithObjects:@"图说口碑", @"8月口碑巡检",@"问题与知识",@"口碑任务", nil];
self
.
btnTitleArray
=
[
NSArray
arrayWithObjects
:
@"在线抽查"
,
@"口碑巡检"
,
@"口碑标准"
,
@"图说口碑"
,
@"问题知识"
,
@"口碑排名"
,
@"查看抽查"
,
nil
];
...
...
@@ -399,15 +400,17 @@
UINavigationController
*
nav
;
if
(
button
.
tag
-
332892
==
0
)
{
InspectListViewController
*
inspectListVC
=
[[
InspectListViewController
alloc
]
init
];
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
inspectListVC
];
}
else
if
(
button
.
tag
-
332892
==
1
)
{
RankingListViewController
*
rankingListVC
=
[[
RankingListViewController
alloc
]
init
];
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
rankingListVC
];
}
else
if
(
button
.
tag
-
332892
==
1
)
{
}
else
{
QuestionViewController
*
questionVC
=
[[
QuestionViewController
alloc
]
init
];
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
questionVC
];
}
else
{
InspectListViewController
*
inspectListVC
=
[[
InspectListViewController
alloc
]
init
];
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
inspectListVC
];
}
[
nav
.
navigationBar
setBarTintColor
:
kNavigationBarColor
];
...
...
@@ -453,7 +456,11 @@
#pragma mark - TableView Delegate/DataSource
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
_titleArray
.
count
;
if
(
_titleArray
.
count
==
6
)
{
return
3
;
}
else
{
return
_titleArray
.
count
;
}
}
...
...
@@ -461,20 +468,41 @@
{
if
(
section
==
0
)
{
return
_allRankListArray
.
count
+
1
;
return
_taskListDataArray
.
count
;
}
else
if
(
section
==
1
)
{
return
_allQuestionArray
.
count
;
return
_allRankListArray
.
count
+
1
;
}
else
{
return
_taskListDataArray
.
count
;
return
_allQuestionArray
.
count
;
}
}
// cell显示的内容
// cell显示的内容
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
section
==
0
)
{
InspectListCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kHomeInspectListCell
];
if
(
!
cell
)
{
cell
=
[[
InspectListCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kHomeInspectListCell
];
}
TaskListModel
*
taskList
=
_taskListDataArray
[
indexPath
.
row
];
cell
.
taskList
=
taskList
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
allView
.
backgroundColor
=
kProgressViewAllBackColor
;
UIImage
*
image
=
[
UIImage
imageNamed
:
@"progress-bar"
];
image
=
[
image
resizableImageWithCapInsets
:
UIEdgeInsetsZero
resizingMode
:
UIImageResizingModeTile
];
cell
.
alreadyView
.
image
=
image
;
return
cell
;
}
else
if
(
indexPath
.
section
==
1
)
{
if
(
indexPath
.
row
==
0
)
{
HomeTitleTableCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kHomeTitleTableCell
];
if
(
!
cell
)
{
...
...
@@ -492,7 +520,13 @@
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
return
cell
;
}
}
else
if
(
indexPath
.
section
==
1
)
{
}
else
{
// 问题与知识
QuestionListTableCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kHomeQuestionListTableCell
];
if
(
!
cell
)
{
...
...
@@ -503,26 +537,74 @@
cell
.
question
=
question
;
return
cell
;
}
else
{
InspectListCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kHomeInspectListCell
];
if
(
!
cell
)
{
cell
=
[[
InspectListCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kHomeInspectListCell
];
}
TaskListModel
*
taskList
=
_taskListDataArray
[
indexPath
.
row
];
cell
.
taskList
=
taskList
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
allView
.
backgroundColor
=
kProgressViewAllBackColor
;
UIImage
*
image
=
[
UIImage
imageNamed
:
@"progress-bar"
];
image
=
[
image
resizableImageWithCapInsets
:
UIEdgeInsetsZero
resizingMode
:
UIImageResizingModeTile
];
cell
.
alreadyView
.
image
=
image
;
return
cell
;
}
}
// if ([title isEqualToString:@"口碑排名"]) {
// if (indexPath.section == i) {
// HomeTitleTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeTitleTableCell];
// if (!cell) {
// cell = [[HomeTitleTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeTitleTableCell];
// }
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
// return cell;
// } else {
// RankingListCell *cell = [tableView dequeueReusableCellWithIdentifier:kHomeRankingListCell];
// if (!cell) {
// cell = [[RankingListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeRankingListCell];
// }
// cell.rankList = _allRankListArray[indexPath.row - 1];
// cell.gradeImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"medal_0%d", (int)indexPath.row]];
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
// return cell;
// }
// } else if ([title isEqualToString:@"问题知识"]) {
// if (indexPath.section == i) {
// // 问题与知识
// QuestionListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:kHomeQuestionListTableCell];
// if (!cell) {
// cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeQuestionListTableCell];
// }
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
// QuestionModel *question = _allQuestionArray[indexPath.row];
// cell.question = question;
// return cell;
// }
// } else if ([title isEqualToString:@"口碑巡检"]) {
// InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell];
// if (!cell) {
// cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeInspectListCell];
// }
// TaskListModel *taskList = _taskListDataArray[indexPath.row];
// cell.taskList = taskList;
// cell.selectionStyle = UITableViewCellSelectionStyleNone;
// cell.allView.backgroundColor = kProgressViewAllBackColor;
// UIImage *image = [UIImage imageNamed:@"progress-bar"];
// image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
// cell.alreadyView.image = image;
// return cell;
//
// } else {
// return nil;
// }
// cell点击事件
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
section
==
0
)
{
InspectTaskViewController
*
inspectTaskVC
=
[[
InspectTaskViewController
alloc
]
init
];
TaskListModel
*
taskList
=
self
.
taskListDataArray
[
indexPath
.
row
];
inspectTaskVC
.
uuid
=
taskList
.
uuid
;
inspectTaskVC
.
store_uuid
=
taskList
.
store_uuid
;
inspectTaskVC
.
multiplier
=
(
CGFloat
)
taskList
.
reportCount
/
taskList
.
questionCount
;
self
.
hidesBottomBarWhenPushed
=
YES
;
[
self
.
navigationController
pushViewController
:
inspectTaskVC
animated
:
YES
];
}
else
if
(
indexPath
.
section
==
1
)
{
if
(
indexPath
.
row
==
0
)
{
NSLog
(
@"不能点击"
);
}
else
{
...
...
@@ -537,22 +619,15 @@
[
self
.
navigationController
pushViewController
:
rankDetailVC
animated
:
YES
];
}
}
else
if
(
indexPath
.
section
==
1
)
{
}
else
{
QuestionDetailViewController
*
questionDetailVC
=
[[
QuestionDetailViewController
alloc
]
init
];
QuestionModel
*
question
=
self
.
allQuestionArray
[
indexPath
.
row
];
questionDetailVC
.
questionUuid
=
question
.
uuid
;
self
.
hidesBottomBarWhenPushed
=
YES
;
[
self
.
navigationController
pushViewController
:
questionDetailVC
animated
:
YES
];
}
else
{
InspectTaskViewController
*
inspectTaskVC
=
[[
InspectTaskViewController
alloc
]
init
];
TaskListModel
*
taskList
=
self
.
taskListDataArray
[
indexPath
.
row
];
inspectTaskVC
.
uuid
=
taskList
.
uuid
;
inspectTaskVC
.
store_uuid
=
taskList
.
store_uuid
;
inspectTaskVC
.
multiplier
=
(
CGFloat
)
taskList
.
reportCount
/
taskList
.
questionCount
;
self
.
hidesBottomBarWhenPushed
=
YES
;
[
self
.
navigationController
pushViewController
:
inspectTaskVC
animated
:
YES
];
}
}
...
...
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