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
04e044ce
Commit
04e044ce
authored
Dec 17, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加并列排名
parent
26faa242
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
14 deletions
+33
-14
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
RankListModel.h
...ion/WordOfMouth/Ranking/RankingList/Model/RankListModel.h
+2
-0
RankListHeaderView.h
...WordOfMouth/Ranking/RankingList/View/RankListHeaderView.h
+1
-1
RankListHeaderView.m
...WordOfMouth/Ranking/RankingList/View/RankListHeaderView.m
+6
-7
RankingListViewController.m
...ng/RankingList/ViewController/RankingListViewController.m
+24
-6
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
04e044ce
No preview for this file type
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/Model/RankListModel.h
View file @
04e044ce
...
...
@@ -28,4 +28,6 @@
+
(
instancetype
)
rankListModelWithDict
:(
NSDictionary
*
)
dict
;
-
(
instancetype
)
initWithDict
:(
NSDictionary
*
)
dict
;
@property
(
nonatomic
,
assign
)
int
index
;
@end
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/View/RankListHeaderView.h
View file @
04e044ce
...
...
@@ -21,5 +21,5 @@
@property
(
nonatomic
,
strong
)
UIButton
*
pushButton
;
+
(
instancetype
)
headViewWithTableView
:(
UITableView
*
)
tableView
section
:(
NSInteger
)
section
;
+
(
instancetype
)
headViewWithTableView
:(
UITableView
*
)
tableView
section
:(
NSInteger
)
section
index
:(
int
)
index
;
@end
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/View/RankListHeaderView.m
View file @
04e044ce
...
...
@@ -27,19 +27,19 @@
@end
@implementation
RankListHeaderView
+
(
instancetype
)
headViewWithTableView
:(
UITableView
*
)
tableView
section
:(
NSInteger
)
section
+
(
instancetype
)
headViewWithTableView
:(
UITableView
*
)
tableView
section
:(
NSInteger
)
section
index
:(
int
)
index
{
static
NSString
*
headIdentifier
=
@"header"
;
RankListHeaderView
*
headView
=
(
RankListHeaderView
*
)[
tableView
dequeueReusableCellWithIdentifier
:
headIdentifier
];
if
(
headView
==
nil
)
{
headView
=
[[
RankListHeaderView
alloc
]
initWithReuseIdentifier
:
headIdentifier
section
:(
NSInteger
)
section
];
headView
=
[[
RankListHeaderView
alloc
]
initWithReuseIdentifier
:
headIdentifier
section
:(
NSInteger
)
section
index
:
index
];
}
return
headView
;
}
-
(
id
)
initWithReuseIdentifier
:(
NSString
*
)
reuseIdentifier
section
:(
NSInteger
)
section
-
(
id
)
initWithReuseIdentifier
:(
NSString
*
)
reuseIdentifier
section
:(
NSInteger
)
section
index
:(
int
)
index
{
if
(
self
=
[
super
initWithReuseIdentifier
:
reuseIdentifier
])
{
...
...
@@ -71,9 +71,8 @@
[
self
addSubview
:
scoreLabel
];
_scoreLabel
=
scoreLabel
;
if
(
section
<
3
)
{
UIImageView
*
gradeImageView
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:[
NSString
stringWithFormat
:
@"medal_0%d"
,
(
int
)
section
+
1
]]];
if
(
index
<
3
)
{
UIImageView
*
gradeImageView
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:[
NSString
stringWithFormat
:
@"medal_0%d"
,
index
]]];
[
self
addSubview
:
gradeImageView
];
_gradeImageView
=
gradeImageView
;
...
...
@@ -83,7 +82,7 @@
gradeLabel
.
textAlignment
=
NSTextAlignmentCenter
;
[
self
addSubview
:
gradeLabel
];
NSString
*
rankStr
=
[
NSString
stringWithFormat
:
@"第 %d 名"
,
(
int
)
section
+
1
];
NSString
*
rankStr
=
[
NSString
stringWithFormat
:
@"第 %d 名"
,
index
];
NSMutableAttributedString
*
rankAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
rankStr
];
[
rankAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kRankHeadTitleTextColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
14
.
0
f
]}
range
:
NSMakeRange
(
0
,
1
)];
[
rankAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kGradeNumberTextColor
}
range
:
NSMakeRange
(
1
,
rankStr
.
length
-
2
)];
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/ViewController/RankingListViewController.m
View file @
04e044ce
...
...
@@ -140,7 +140,15 @@
[
tgArray
addObject
:
rankList
];
}
_rankData
=
(
NSMutableArray
*
)[
self
sortRankListWithRankListArray
:
tgArray
];
for
(
int
i
=
0
;
i
<
_rankData
.
count
;
i
++
)
{
RankListModel
*
rank
=
_rankData
[
i
];
if
(
i
==
0
)
{
rank
.
index
=
i
+
1
;
}
else
{
RankListModel
*
prevRank
=
_rankData
[
i
-
1
];
rank
.
index
=
rank
.
score
==
prevRank
.
score
?
prevRank
.
index
:
i
+
1
;
}
}
if
(
_rankData
.
count
==
0
)
{
weakSelf
.
noDataView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
...
...
@@ -199,6 +207,17 @@
[
tgArray
addObject
:
rankList
];
}
_rankData
=
(
NSMutableArray
*
)[
self
sortRankListWithRankListArray
:
tgArray
];
for
(
int
i
=
0
;
i
<
_rankData
.
count
;
i
++
)
{
RankListModel
*
rank
=
_rankData
[
i
];
if
(
i
==
0
)
{
rank
.
index
=
i
+
1
;
}
else
{
RankListModel
*
prevRank
=
_rankData
[
i
-
1
];
rank
.
index
=
rank
.
score
==
prevRank
.
score
?
prevRank
.
index
:
i
+
1
;
}
}
[
self
.
tableView
reloadData
];
[
MBProgressHUD
hideHUDForView
:
self
.
view
animated
:
YES
];
...
...
@@ -416,11 +435,11 @@
if
(
section
==
0
)
{
return
nil
;
}
else
{
RankListHeaderView
*
headView
=
[
RankListHeaderView
headViewWithTableView
:
tableView
section
:
section
-
1
];
RankListModel
*
rankList
=
_rankData
[
section
-
1
];
RankListHeaderView
*
headView
=
[
RankListHeaderView
headViewWithTableView
:
tableView
section
:
section
-
1
index
:
rankList
.
index
];
headView
.
delegate
=
self
;
[
headView
.
pushButton
addTarget
:
self
action
:
@selector
(
pushclick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
headView
.
rankListModel
=
_rankData
[
section
-
1
]
;
headView
.
rankListModel
=
rankList
;
return
headView
;
}
}
...
...
@@ -428,8 +447,7 @@
-
(
void
)
pushclick
:
(
UIButton
*
)
sender
{
NSInteger
section
=
sender
.
tag
-
kPushTag
;
RankListModel
*
rankList
=
_rankData
[
section
-
1
];
RankListModel
*
rankList
=
_rankData
[
section
];
RankDetailViewController
*
rankDetailVC
=
[[
RankDetailViewController
alloc
]
init
];
rankDetailVC
.
indexRow
=
section
-
1
;
...
...
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