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
505ddb4a
Commit
505ddb4a
authored
Dec 09, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
banner complete
parent
517626f0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
136 additions
and
25 deletions
+136
-25
src/components/activity/newyear-2019/common/commonContainer/index.js
+2
-1
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
+1
-1
src/components/activity/newyear-2019/preheat/YearCourse/index.js
+6
-6
src/components/activity/newyear-2019/preheat/index.js
+17
-6
src/components/activity/newyear-2019/preheat/index.scss
+20
-0
src/components/activity/newyear-2019/preheat/nav.js
+80
-6
src/components/activity/newyear-2019/preheat/nav.scss
+7
-0
src/components/activity/newyear-2019/treasure-box/index.js
+3
-5
No files found.
src/components/activity/newyear-2019/common/commonContainer/index.js
View file @
505ddb4a
...
...
@@ -6,8 +6,9 @@ export default class CommonContainer extends Component {
super
(
props
)
}
render
()
{
const
{
id
}
=
this
.
props
;
return
(
<
div
className
=
'common_container'
>
<
div
className
=
'common_container'
id
=
{
id
}
>
<
div
className
=
'container_top'
><
/div
>
<
div
className
=
'container_content'
>
{
...
...
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
View file @
505ddb4a
...
...
@@ -120,7 +120,7 @@ class LiveRoom extends Component {
)
}
<
CommonContainer
title
=
'大咖直播'
>
<
CommonContainer
title
=
'大咖直播'
id
=
"year-live"
>
<
ul
className
=
'live__list'
>
{
list
.
length
&&
(
...
...
src/components/activity/newyear-2019/preheat/YearCourse/index.js
View file @
505ddb4a
...
...
@@ -209,8 +209,8 @@ class YarnCourse extends Component {
const
{
bigcourse
,
freecourse
,
groupcourse
,
basic
,
advanced
,
higher
,
expand
}
=
this
.
state
return
(
<
div
>
<
CommonContainer
title
=
'重磅好课'
>
<>
<
CommonContainer
title
=
'重磅好课'
id
=
"year-course"
>
<
div
>
{
(
bigcourse
.
course
&&
bigcourse
.
course
.
length
>
0
)
&&
...
...
@@ -246,7 +246,7 @@ class YarnCourse extends Component {
}
<
/div
>
<
/CommonContainer
>
<
CommonContainer
title
=
'人气好课免费学'
>
<
CommonContainer
title
=
'人气好课免费学'
id
=
"year-free"
>
<
div
>
{
(
freecourse
.
course
&&
freecourse
.
course
.
length
>
0
)
&&
...
...
@@ -284,7 +284,7 @@ class YarnCourse extends Component {
}
<
/div
>
<
/CommonContainer
>
<
CommonContainer
title
=
'精品好课1分开抢'
>
<
CommonContainer
title
=
'精品好课1分开抢'
id
=
"year-group"
>
<
div
>
{
(
groupcourse
.
course
&&
groupcourse
.
course
.
length
>
0
)
&&
...
...
@@ -355,7 +355,7 @@ class YarnCourse extends Component {
}
<
/div
>
<
/CommonContainer
>
<
CommonContainer
title
=
'好课价到,等你抄底'
>
<
CommonContainer
title
=
'好课价到,等你抄底'
id
=
"year-discount"
>
<
div
>
<
h4
className
=
"ai-course__subtitle"
>
基础
<
/h4
>
{
...
...
@@ -722,7 +722,7 @@ class YarnCourse extends Component {
}
<
/div
>
<
/CommonContainer
>
<
/
div
>
<
/
>
)
}
}
...
...
src/components/activity/newyear-2019/preheat/index.js
View file @
505ddb4a
...
...
@@ -9,7 +9,8 @@ import CommonPopup from './../common/commonPopup/index'
export
default
class
index
extends
Component
{
state
=
{
showMark
:
false
showMark
:
false
,
banner
:
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/m_banner_bj%402x.png'
}
// 关闭弹框
...
...
@@ -20,12 +21,23 @@ export default class index extends Component {
}
render
()
{
const
{
banner
}
=
this
.
state
;
return
(
<
div
className
=
{
'year-index'
}
>
<
TreasureNav
><
/TreasureNav
>
<
LiveRoom
/>
<
YearCourse
/>
<
TreasureBox
><
/TreasureBox
>
<
div
className
=
"banner-treasure"
>
<
div
id
=
"banner"
className
=
"banner-treasure__header"
style
=
{{
backgroundImage
:
`url(
${
banner
}
)`
}}
><
/div
>
<
div
className
=
"banner-treasure__nav"
>
<
TreasureNav
id
=
"banner"
/>
<
/div
>
<
div
className
=
"banner-treasure__decorate"
><
/div
>
<
/div
>
{
/* 大咖直播 */
}
<
LiveRoom
/>
{
/* 组队开宝箱 */
}
<
TreasureBox
/>
<
YearCourse
/>
{
/*好友加入队伍提醒;获得宝箱提醒;开售提醒弹窗,需要自取,注意修改文案*/
}
{
this
.
state
.
showMark
&&
...
...
@@ -56,7 +68,6 @@ export default class index extends Component {
<
/div
>
<
/CommonPopup
>
}
<
/div
>
)
}
...
...
src/components/activity/newyear-2019/preheat/index.scss
View file @
505ddb4a
...
...
@@ -2,6 +2,26 @@
padding-bottom
:
30px
;
background-color
:
#BC2A18
;
.banner-treasure
{
}
.banner-treasure__header
{
height
:
320px
;
background-size
:
cover
;
background-position
:
center
;
}
.banner-treasure__nav
{
height
:
30px
;
}
.banner-treasure__decorate
{
height
:
35px
;
background-size
:
cover
;
background-image
:
url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/m_nv_bj%402x.png')
;
}
.sub__code_container
{
padding
:
20px
30px
;
text-align
:
center
;
...
...
src/components/activity/newyear-2019/preheat/nav.js
View file @
505ddb4a
import
React
,
{
Component
}
from
'react'
;
import
classnames
from
'classnames'
;
import
{
http
}
from
'@/utils'
;
import
'./nav.scss'
;
class
TreasureNav
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
isFixed
:
false
,
curIndex
:
1
,
formatNavs
:
[],
navs
:
[
{
id
:
'year-live'
,
name
:
'大咖直播'
},
{
id
:
'year-treasure'
,
name
:
'组队开宝箱'
},
...
...
@@ -26,22 +33,89 @@ class TreasureNav extends Component {
},
{
id
:
'year-discount'
,
name
:
'一折
起购
专区'
name
:
'一折专区'
},
]
};
}
componentDidMount
()
{
this
.
initNav
();
window
.
addEventListener
(
'scroll'
,
this
.
calcNavActive
)
}
componentWillUnmount
()
{
window
.
removeEventListener
(
'scroll'
,
this
.
calcNavActive
);
}
initNav
=
()
=>
{
const
{
navs
}
=
this
.
state
;
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
;
if
(
code
===
200
)
{
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
if
(
data
.
treasure_stage
===
0
)
{
this
.
setState
({
formatNavs
:
navs
.
filter
(
item
=>
item
.
id
!==
'year-treasure'
)
});
}
else
{
this
.
setState
({
formatNavs
:
navs
})
}
}
});
}
calcNavActive
=
()
=>
{
const
{
formatNavs
}
=
this
.
state
;
const
{
id
}
=
this
.
props
;
const
bannerEl
=
document
.
querySelector
(
`#
${
id
}
`
);
setTimeout
(()
=>
{
let
y
=
window
.
scrollY
,
len
=
formatNavs
.
length
-
1
;
this
.
setState
({
isFixed
:
y
>=
bannerEl
.
offsetHeight
});
for
(;
len
>
-
1
;
len
--
)
{
let
el
=
document
.
querySelector
(
`#
${
formatNavs
[
len
].
id
}
`
);
if
(
el
&&
(
y
+
200
)
>=
el
.
offsetTop
)
{
this
.
setState
({
curIndex
:
len
})
break
;
}
}
},
100
);
}
selectToNav
=
(
i
)
=>
{
const
{
formatNavs
}
=
this
.
state
;
const
id
=
`#
${
formatNavs
[
i
][
'id'
]}
`
;
let
el
=
document
.
querySelector
(
id
);
if
(
el
)
{
this
.
setState
({
curIndex
:
i
});
window
.
scrollTo
({
top
:
el
.
offsetTop
,
left
:
0
});
}
}
render
()
{
const
{
curIndex
,
n
avs
}
=
this
.
state
;
const
{
isFixed
,
curIndex
,
formatN
avs
}
=
this
.
state
;
return
(
<
div
className
=
"treasure-nav"
data
-
skip
=
"nav"
>
<
div
className
=
{
classnames
(
"treasure-nav"
,
{
'fixed'
:
isFixed
})}
data
-
skip
=
"nav"
>
{
n
avs
.
map
((
item
,
index
)
=>
(
formatN
avs
.
map
((
item
,
index
)
=>
(
<
a
href
=
""
className
=
{
classnames
(
"treasure-nav__item"
,{
'active'
:
index
===
curIndex
})}
href
=
{
`#
${
item
.
id
}
`
}
className
=
{
classnames
(
"treasure-nav__item"
,
{
'active'
:
index
===
curIndex
})}
key
=
{
item
.
id
}
onClick
=
{()
=>
this
.
selectToNav
(
index
)}
>
{
item
.
name
}
<
/a
>
))
}
...
...
src/components/activity/newyear-2019/preheat/nav.scss
View file @
505ddb4a
...
...
@@ -7,6 +7,13 @@
height
:
30px
;
background-color
:
#357345
;
}
&
.fixed
{
position
:
fixed
;
top
:
0
;
width
:
100%
;
z-index
:
999
;
}
}
[
data-skip
=
"nav"
]
{
...
...
src/components/activity/newyear-2019/treasure-box/index.js
View file @
505ddb4a
...
...
@@ -5,11 +5,9 @@ import TreasureRank from './rank';
class
TreasureBox
extends
Component
{
render
()
{
return
(
<
div
>
<
CommonContainer
>
<
TreasureRank
/>
<
/CommonContainer
>
<
/div
>
<
CommonContainer
id
=
"year-treasure"
>
<
TreasureRank
/>
<
/CommonContainer
>
)
}
}
...
...
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