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
0250e7e1
Commit
0250e7e1
authored
Nov 02, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
福气排行榜popup
parent
e12f6af6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
38 deletions
+32
-38
src/components/blessingRank/index.js
+32
-38
No files found.
src/components/blessingRank/index.js
View file @
0250e7e1
import
React
,
{
Component
}
from
'react'
;
import
{
connect
}
from
'react-redux'
;
import
{
http
}
from
"@/utils"
;
import
{
Popup
}
from
'@/common'
;
import
AddressPopup
from
'./../blessingPreheat/addressPopup/index'
;
import
'./index.scss'
;
import
React
,
{
Component
}
from
'react'
import
{
connect
}
from
'react-redux'
import
{
http
}
from
"@/utils"
import
{
Popup
}
from
'@/common'
import
AddressPopup
from
'./../blessingPreheat/addressPopup/index'
import
'./index.scss'
@
connect
(({
user
})
=>
(
@
connect
(({
user
})
=>
(
{
uid
:
user
.
data
.
uid
||
''
}
))
class
BlessingRank
extends
Component
{
constructor
(
props
)
{
super
(
props
)
;
super
(
props
)
this
.
state
=
{
isAddress
:
false
,
rankList
:
[],
rules
:
[
'1、排行榜名次以2019年11月13日24点七月在线公布的排行榜为准,榜单确认后,得奖小伙伴请及时填写邮寄信息,7个自然日内不填写,视为主动放弃奖品;'
,
...
...
@@ -26,37 +25,39 @@ class BlessingRank extends Component {
}
componentDidMount
()
{
this
.
fetchRankData
()
;
this
.
fetchRankData
()
}
fetchRankData
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/blessing/ranking`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
;
if
(
code
===
200
)
{
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
this
.
setState
({
rankList
:
data
,
})
;
})
}
})
;
})
}
handleToSwitch
=
(
bool
)
=>
{
const
{
history
,
uid
}
=
this
.
props
;
if
(
bool
&&
!
uid
)
{
history
.
push
(
'/passport'
);
}
else
{
this
.
setState
({
isAddress
:
bool
});
const
{
history
,
uid
}
=
this
.
props
if
(
bool
&&
!
uid
)
{
history
.
push
(
'/passport'
)
}
else
{
Popup
({
title
:
'收货信息'
,
content
:
<
AddressPopup
handleToHide
=
{()
=>
this
.
handleToSwitch
(
false
)}
/
>
})
}
}
formatString
=
(
str
,
len
)
=>
{
return
str
.
length
>
len
?
`
${
str
.
substr
(
0
,
len
)}
...`
:
str
;
return
str
.
length
>
len
?
`
${
str
.
substr
(
0
,
len
)}
...`
:
str
}
render
()
{
const
{
isAddress
,
rankList
,
rules
}
=
this
.
state
;
const
{
rankList
,
rules
}
=
this
.
state
return
(
<>
<
div
className
=
"rank__banner"
><
/div
>
...
...
@@ -76,10 +77,10 @@ class BlessingRank extends Component {
<
dd
className
=
"rank__table-column"
>
{
index
<
3
?
(
<
i
className
=
"rank__table-num"
data
-
num
=
{
index
+
1
}
><
/i
>
)
:
index
+
1
?
(
<
i
className
=
"rank__table-num"
data
-
num
=
{
index
+
1
}
><
/i
>
)
:
index
+
1
}
<
/dd
>
<
dd
className
=
"rank__table-column"
>
...
...
@@ -91,10 +92,10 @@ class BlessingRank extends Component {
<
dd
className
=
"rank__table-column"
>
{
item
.
blessing_value
}
<
/dd
>
<
dd
className
=
"rank__table-column"
>
{
this
.
formatString
(
item
.
prize_name
,
7
)}
<
/dd
>
<
/dl
>
)
;
)
})
}
<
/div
>
<
div
className
=
"rank__rule"
>
<
h2
className
=
"rank__rule-title"
>
活动规则
<
/h2
>
...
...
@@ -104,16 +105,10 @@ class BlessingRank extends Component {
))
}
<
/div
>
<
Popup
visible
=
{
isAddress
}
title
=
"收货信息"
>
<
AddressPopup
handleToHide
=
{()
=>
this
.
handleToSwitch
(
false
)}
/
>
<
/Popup
>
<
/div
>
<
/
>
)
;
)
}
}
export
default
BlessingRank
;
\ No newline at end of file
export
default
BlessingRank
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