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
3b38178b
Commit
3b38178b
authored
Jul 15, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周年庆
parent
d48ceb19
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
21 deletions
+31
-21
src/components/Index/TopSwiper/index.js
+6
-3
src/components/Index/index.js
+19
-17
src/components/activity/2020-717/activity/index.js
+1
-1
src/components/activity/2020-717/question/index.scss
+5
-0
No files found.
src/components/Index/TopSwiper/index.js
View file @
3b38178b
...
...
@@ -10,6 +10,7 @@ class Index extends Component {
swiper
=
null
componentDidMount
()
{
if
(
this
.
props
.
bannerList
.
length
>
1
)
{
this
.
swiper
=
new
Swiper
(
'.swiper-container'
,
{
direction
:
'horizontal'
,
loop
:
true
,
...
...
@@ -17,9 +18,10 @@ class Index extends Component {
centeredSlides
:
true
,
slidesPerView
:
'auto'
,
loopedSlides
:
3
,
autoplay
:
true
autoplay
:
true
,
})
}
}
componentWillUnmount
()
{
this
.
swiper
.
destroy
()
...
...
@@ -32,7 +34,8 @@ class Index extends Component {
<
div
className
=
{
'index-banner-swiper'
}
>
<
div
className
=
{
'swiper-container'
}
ref
=
{
el
=>
this
.
container
=
el
}
>
<
ul
className
=
"swiper-wrapper"
>
{
bannerList
&&
bannerList
.
length
>
0
&&
bannerList
.
map
((
item
,
index
)
=>
{
{
bannerList
&&
bannerList
.
length
>
0
&&
bannerList
.
map
((
item
,
index
)
=>
{
return
(
<
li
className
=
{
'swiper-slide'
}
key
=
{
index
}
>
{
...
...
@@ -43,7 +46,7 @@ class Index extends Component {
<
Link
to
=
{{
pathname
:
'/detail'
,
search
:
`?id=
${
item
.
jump_url
}
`
search
:
`?id=
${
item
.
jump_url
}
`
,
}}
key
=
{
index
}
>
...
...
src/components/Index/index.js
View file @
3b38178b
import
React
,
{
Component
}
from
'react'
import
{
CallApp
}
from
'../../common'
import
React
,
{
Component
}
from
'react'
import
{
CallApp
}
from
'../../common'
import
'./index.scss'
import
{
WithTab
}
from
'@/HOCs'
import
{
WithTab
}
from
'@/HOCs'
// import Swiper from 'react-mobile-swiper'
// import createStyle from './createStyle'
import
HomeCourseList
from
'./course-list'
import
{
http
,
isValidUrl
}
from
'@/utils'
import
{
http
,
isValidUrl
}
from
'@/utils'
import
LiveRoom
from
'./liveRoom'
import
{
Link
}
from
"react-router-dom"
import
{
Toast
}
from
'antd-mobile'
import
{
connect
}
from
"react-redux"
import
{
Link
}
from
"react-router-dom"
import
{
Toast
}
from
'antd-mobile'
import
{
connect
}
from
"react-redux"
import
TopSwiper
from
'./TopSwiper'
// import ExpandActiveToast from './expandActiveToast'
import
AllCourseNavigation
from
"./all-course"
import
{
UserGift
}
from
"@common"
import
{
UserGift
}
from
"@common"
// const animateTypes = Swiper.animateTypes
...
...
@@ -65,22 +65,24 @@ class Index extends Component {
this
.
getIndexData
()
this
.
userStatus
()
}
componentWillMount
(){
componentWillMount
()
{
this
.
showUserGiftFun
()
}
userStatus
=
()
=>
{
userStatus
=
()
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/sys/user/new_user_status`
).
then
((
res
)
=>
{
const
{
errno
,
data
}
=
res
.
data
if
(
errno
===
0
)
{
if
(
data
.
status
==
1
)
{
// 新用户登录之后判断是否是新用户
this
.
setState
({
isShowUserGift
:
false
isShowUserGift
:
false
,
})
Toast
.
info
(
'新人大礼包已领取成功!'
,
2
)
}
else
{
this
.
setState
({
isShowUserGift
:
false
isShowUserGift
:
false
,
})
}
}
...
...
@@ -92,23 +94,23 @@ class Index extends Component {
let
now_time
=
(
new
Date
()).
valueOf
()
if
(
!
newer_last_time
||
now_time
-
newer_last_time
>
86400000
)
{
this
.
setState
({
isShowUserGift
:
true
isShowUserGift
:
true
,
})
}
else
{
this
.
setState
({
isShowUserGift
:
false
isShowUserGift
:
false
,
})
}
}
close
=
()
=>
{
this
.
setState
({
isShowUserGift
:
false
isShowUserGift
:
false
,
})
let
now_time
=
(
new
Date
()).
valueOf
()
// 获取当前时间
localStorage
.
setItem
(
'newer_last_time'
,
now_time
)
// 存储关闭时间
}
get_newerModal
=
()
=>
{
get_newerModal
=
()
=>
{
this
.
close
()
this
.
props
.
history
.
push
(
'/passport/login'
)
}
...
...
@@ -120,7 +122,7 @@ class Index extends Component {
const
{
data
}
=
res
.
data
||
{}
const
modules
=
Array
.
isArray
(
data
.
modules
)
?
data
.
modules
:
[]
this
.
setState
({
banner
:
data
.
banner
,
banner
:
data
.
banner
.
slice
(
0
,
1
)
,
lives
:
data
.
lives
,
modules
,
})
...
...
src/components/activity/2020-717/activity/index.js
View file @
3b38178b
...
...
@@ -1002,7 +1002,7 @@ class Anniversary2020 extends Component {
<
/table
>
}
{
!!
_rankList
.
length
&&
!
isShowAllRankList
&&
<
div
className
=
"btn"
>
!!
_rankList
.
length
&&
_rankList
.
length
===
10
&&
!
isShowAllRankList
&&
<
div
className
=
"btn"
>
<
button
onClick
=
{()
=>
{
this
.
setState
({
isShowAllRankList
:
true
,
...
...
src/components/activity/2020-717/question/index.scss
View file @
3b38178b
...
...
@@ -123,11 +123,16 @@
ul
{
display
:
flex
;
justify-content
:
space-between
;
flex-wrap
:
wrap
;
}
li
{
width
:
160px
;
height
:
115px
;
&
:nth-child
(
odd
)
{
margin-bottom
:
20px
;
}
}
img
{
...
...
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