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
62958d06
Commit
62958d06
authored
Nov 02, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '11-11' of gitlab.julyedu.com:baiguangyao/mr-julyedu into 11-11
parents
bcac670d
0250e7e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
35 deletions
+40
-35
src/components/blessingPreheat/index.js
+12
-1
src/components/blessingRank/index.js
+28
-34
No files found.
src/components/blessingPreheat/index.js
View file @
62958d06
...
@@ -105,11 +105,23 @@ class BlessingPreheat extends Component {
...
@@ -105,11 +105,23 @@ class BlessingPreheat extends Component {
}
}
window
[
'getNewData'
]
=
result
=>
{
window
[
'getNewData'
]
=
result
=>
{
http
.
post
(
`
${
API
.
home
}
/sys/add/blessing`
,
{
share_platform
:
''
,
// 1 朋友圈 2 微博 3 qq
type
:
4
// 1:签到;3:分享;4:浏览课程;
}).
then
(
res
=>
{
const
{
code
}
=
res
.
data
if
(
code
===
200
)
{
Toast
.
info
(
'+2点福气值~'
,
2
,
null
,
false
)
}
})
this
.
fetchUserBlessing
()
this
.
fetchUserBlessing
()
}
}
window
[
'QQWXWBshare'
]
=
result
=>
{
window
[
'QQWXWBshare'
]
=
result
=>
{
if
(
result
!=
0
)
{
this
.
handleToAddBlessing
(
result
)
this
.
handleToAddBlessing
(
result
)
}
}
this
.
fetchUserBlessing
()
}
}
}
...
@@ -223,7 +235,6 @@ class BlessingPreheat extends Component {
...
@@ -223,7 +235,6 @@ class BlessingPreheat extends Component {
const
{
userInfo
}
=
this
.
state
const
{
userInfo
}
=
this
.
state
http
.
get
(
`
${
API
.
home
}
/sys/user/blessing`
).
then
(
res
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/user/blessing`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
const
{
code
,
data
}
=
res
.
data
alert
(
code
)
if
(
code
===
200
)
{
if
(
code
===
200
)
{
this
.
setState
({
this
.
setState
({
isSign
:
!!
data
.
today_signed
,
isSign
:
!!
data
.
today_signed
,
...
...
src/components/blessingRank/index.js
View file @
62958d06
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
import
{
http
}
from
"@/utils"
;
import
{
http
}
from
"@/utils"
import
{
Popup
}
from
'@/common'
;
import
{
Popup
}
from
'@/common'
import
AddressPopup
from
'./../blessingPreheat/addressPopup/index'
;
import
AddressPopup
from
'./../blessingPreheat/addressPopup/index'
import
'./index.scss'
;
import
'./index.scss'
@
connect
(({
user
})
=>
(
@
connect
(({
user
})
=>
(
{
{
uid
:
user
.
data
.
uid
||
''
uid
:
user
.
data
.
uid
||
''
}
}
))
))
class
BlessingRank
extends
Component
{
class
BlessingRank
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
;
super
(
props
)
this
.
state
=
{
this
.
state
=
{
isAddress
:
false
,
rankList
:
[],
rankList
:
[],
rules
:
[
rules
:
[
'1、排行榜名次以2019年11月13日24点七月在线公布的排行榜为准,榜单确认后,得奖小伙伴请及时填写邮寄信息,7个自然日内不填写,视为主动放弃奖品;'
,
'1、排行榜名次以2019年11月13日24点七月在线公布的排行榜为准,榜单确认后,得奖小伙伴请及时填写邮寄信息,7个自然日内不填写,视为主动放弃奖品;'
,
...
@@ -26,37 +25,39 @@ class BlessingRank extends Component {
...
@@ -26,37 +25,39 @@ class BlessingRank extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
fetchRankData
()
;
this
.
fetchRankData
()
}
}
fetchRankData
=
()
=>
{
fetchRankData
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/blessing/ranking`
).
then
(
res
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/blessing/ranking`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
;
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
if
(
code
===
200
)
{
this
.
setState
({
this
.
setState
({
rankList
:
data
,
rankList
:
data
,
})
;
})
}
}
})
;
})
}
}
handleToSwitch
=
(
bool
)
=>
{
handleToSwitch
=
(
bool
)
=>
{
const
{
history
,
uid
}
=
this
.
props
;
const
{
history
,
uid
}
=
this
.
props
if
(
bool
&&
!
uid
)
{
if
(
bool
&&
!
uid
)
{
history
.
push
(
'/passport'
);
history
.
push
(
'/passport'
)
}
else
{
}
else
{
this
.
setState
({
Popup
({
isAddress
:
bool
title
:
'收货信息'
,
});
content
:
<
AddressPopup
handleToHide
=
{()
=>
this
.
handleToSwitch
(
false
)}
/
>
})
}
}
}
}
formatString
=
(
str
,
len
)
=>
{
formatString
=
(
str
,
len
)
=>
{
return
str
.
length
>
len
?
`
${
str
.
substr
(
0
,
len
)}
...`
:
str
;
return
str
.
length
>
len
?
`
${
str
.
substr
(
0
,
len
)}
...`
:
str
}
}
render
()
{
render
()
{
const
{
isAddress
,
rankList
,
rules
}
=
this
.
state
;
const
{
rankList
,
rules
}
=
this
.
state
return
(
return
(
<>
<>
<
div
className
=
"rank__banner"
><
/div
>
<
div
className
=
"rank__banner"
><
/div
>
...
@@ -77,7 +78,7 @@ class BlessingRank extends Component {
...
@@ -77,7 +78,7 @@ class BlessingRank extends Component {
{
{
index
<
3
index
<
3
?
(
?
(
<
i
className
=
"rank__table-num"
data
-
num
=
{
index
+
1
}
><
/i
>
<
i
className
=
"rank__table-num"
data
-
num
=
{
index
+
1
}
><
/i
>
)
)
:
index
+
1
:
index
+
1
}
}
...
@@ -91,7 +92,7 @@ class BlessingRank extends Component {
...
@@ -91,7 +92,7 @@ class BlessingRank extends Component {
<
dd
className
=
"rank__table-column"
>
{
item
.
blessing_value
}
<
/dd
>
<
dd
className
=
"rank__table-column"
>
{
item
.
blessing_value
}
<
/dd
>
<
dd
className
=
"rank__table-column"
>
{
this
.
formatString
(
item
.
prize_name
,
7
)}
<
/dd
>
<
dd
className
=
"rank__table-column"
>
{
this
.
formatString
(
item
.
prize_name
,
7
)}
<
/dd
>
<
/dl
>
<
/dl
>
)
;
)
})
})
}
}
...
@@ -104,16 +105,10 @@ class BlessingRank extends Component {
...
@@ -104,16 +105,10 @@ class BlessingRank extends Component {
))
))
}
}
<
/div
>
<
/div
>
<
Popup
visible
=
{
isAddress
}
title
=
"收货信息"
>
<
AddressPopup
handleToHide
=
{()
=>
this
.
handleToSwitch
(
false
)}
/
>
<
/Popup
>
<
/div
>
<
/div
>
<
/
>
<
/
>
)
;
)
}
}
}
}
export
default
BlessingRank
;
export
default
BlessingRank
\ No newline at end of file
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