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
95661967
Commit
95661967
authored
Jul 10, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周年庆
parent
8e30482d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
9 deletions
+59
-9
src/components/activity/2020-717/activity/index.js
+42
-8
src/components/activity/2020-717/activity/index.scss
+17
-1
No files found.
src/components/activity/2020-717/activity/index.js
View file @
95661967
import
React
,
{
Component
}
from
'react'
;
import
{
debounce
,
groupBy
,
isEmpty
}
from
"lodash"
;
import
{
browser
,
http
}
from
"@/utils"
import
{
http
}
from
"@/utils"
import
{
Toast
,
Carousel
}
from
"antd-mobile"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
connect
}
from
"react-redux"
;
...
...
@@ -30,6 +30,7 @@ class Anniversary2020 extends Component {
4.每人只能当1次队员哦
`
drawTimer
=
null
countDownTimer
=
null
hasMore
=
true
state
=
{
...
...
@@ -81,6 +82,7 @@ class Anniversary2020 extends Component {
rankList
:
[],
isShowAllRankList
:
false
,
qrcode
:
undefined
,
countDown
:
''
,
//弹框
userAddress
:
{
name
:
''
,
...
...
@@ -130,17 +132,18 @@ class Anniversary2020 extends Component {
document
.
removeEventListener
(
'scroll'
,
this
.
setNavActive
)
document
.
body
.
style
.
overflow
=
'auto'
clearInterval
(
this
.
drawTimer
)
clearTimeout
(
this
.
countDownTimer
)
}
getActivityStage
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/activity/anniversary/activityStage`
)
.
then
(
res
=>
{
const
{
code
,
msg
,
data
}
=
res
.
data
this
.
setupCountDown
(
data
.
count_down
)
if
(
code
===
200
)
{
this
.
setState
({
activityData
:
data
,
},
this
.
bindNavAction
);
},
this
.
bindNavAction
())
}
else
{
Toast
.
info
(
msg
)
}
...
...
@@ -420,7 +423,7 @@ class Anniversary2020 extends Component {
}
draw
=
debounce
((
i
)
=>
{
if
(
this
.
isGotoLogin
())
{
if
(
this
.
isGotoLogin
())
{
return
}
const
{
activityData
,
prizeData
,
isDrawing
}
=
this
.
state
...
...
@@ -528,6 +531,24 @@ class Anniversary2020 extends Component {
}
}
setupCountDown
=
(
totalSeconds
)
=>
{
this
.
countDownTimer
=
setTimeout
(()
=>
{
totalSeconds
--
const
d
=
Math
.
floor
(
totalSeconds
/
60
/
60
/
24
)
const
h
=
Math
.
floor
(
totalSeconds
/
60
/
60
)
%
24
const
m
=
Math
.
floor
(
totalSeconds
/
60
)
%
60
this
.
setState
({
countDown
:
`
${
d
}
天
${
h
}
时
${
m
}
分`
,
},
()
=>
{
if
(
totalSeconds
>
0
)
{
this
.
setupCountDown
(
totalSeconds
)
}
else
{
this
.
getActivityStage
()
}
});
},
1000
*
60
)
}
render
()
{
const
{
navs
,
...
...
@@ -555,6 +576,7 @@ class Anniversary2020 extends Component {
isShowAllRankList
,
isShowFollow
,
qrcode
,
countDown
,
}
=
this
.
state
const
{
history
,
user
}
=
this
.
props
...
...
@@ -565,7 +587,18 @@ class Anniversary2020 extends Component {
return
(
<
div
className
=
{
'anniversary-2020'
}
>
<
div
className
=
"banner"
>
<
img
src
=
""
alt
=
""
/>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active20_717/m/banner.png"
alt
=
""
/>
{
countDown
&&
<
div
className
=
"count-down"
>
{
countDown
}
{
activityData
.
stage
===
1
?
'后开始'
:
activityData
.
stage
===
2
?
'后结束'
:
null
}
<
/div
>
}
<
/div
>
{
!
activityData
.
is_sign
&&
<
div
className
=
"sign"
onClick
=
{
this
.
sign
}
><
/div
>
...
...
@@ -777,9 +810,10 @@ class Anniversary2020 extends Component {
{
!!
team
.
team_info
&&
team
.
team_info
.
length
&&
team
.
team_info
.
slice
(
0
,
5
).
map
((
item
,
index
)
=>
{
return
<
li
key
=
{
index
}
>
<
img
src
=
"https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/home/avatar_20191104.png"
alt
=
""
/>
{
item
.
head_img
?
<
img
src
=
{
item
.
head_img
}
alt
=
""
/>
:
<
img
src
=
{
item
.
avatar_file
}
alt
=
""
/>
}
<
/li
>
})
}
...
...
src/components/activity/2020-717/activity/index.scss
View file @
95661967
...
...
@@ -3,12 +3,28 @@
padding
:
0
10px
75px
;
.banner
{
position
:
relative
;
height
:
220px
;
img
{
width
:
100%
;
height
:
100%
;
}
.count-down
{
position
:
absolute
;
bottom
:
10px
;
left
:
50%
;
transform
:
translateX
(
-50%
);
width
:
208px
;
height
:
30px
;
background
:
linear-gradient
(
-90deg
,
rgba
(
145
,
51
,
199
,
1
)
0%
,
rgba
(
245
,
47
,
2
,
1
)
100%
);
border-radius
:
15px
;
font-size
:
16px
;
color
:
#fff
;
text-align
:
center
;
line-height
:
30px
;
}
}
@mixin
button
{
...
...
@@ -864,7 +880,7 @@
}
}
a
{
a
{
text-decoration
:
underline
;
}
...
...
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