Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
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
baiguangyao
mr-julyedu
Commits
c768c3b5
Commit
c768c3b5
authored
Dec 16, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rank length is 0
parent
ee2358a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
src/components/activity/newyear-2019/treasure-box/rank.js
+8
-1
No files found.
src/components/activity/newyear-2019/treasure-box/rank.js
View file @
c768c3b5
...
...
@@ -21,13 +21,14 @@ class TreasureRank extends Component {
http
.
get
(
`
${
API
.
home
}
/sys/treasure/ranking`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
;
if
(
code
===
200
)
{
if
(
JSON
.
stringify
(
data
)
!==
'{}'
)
{
if
(
data
.
length
>
5
)
{
this
.
setState
({
rank
:
data
.
filter
((
item
,
index
)
=>
index
<
5
),
rankList
:
data
,
isMore
:
true
,
});
}
else
{
}
else
if
()
{
this
.
setState
({
rank
:
data
,
rankList
:
data
,
...
...
@@ -35,6 +36,7 @@ class TreasureRank extends Component {
});
}
}
}
});
}
...
...
@@ -56,6 +58,9 @@ class TreasureRank extends Component {
render
()
{
const
{
rank
,
isMore
}
=
this
.
state
;
return
(
<>
{
rank
.
length
!==
0
&&
<
div
data
-
skip
=
"rank"
>
<
div
className
=
"rank-title"
>
<
i
className
=
"rank-title__decorate"
><
/i
>
...
...
@@ -102,6 +107,8 @@ class TreasureRank extends Component {
<
/div
>
<
/div
>
<
/div
>
}
<
/
>
)
}
}
...
...
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