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
d14a6e9e
Commit
d14a6e9e
authored
Jan 03, 2020
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pull
parent
9783df22
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
185 additions
and
125 deletions
+185
-125
src/App.js
+2
-7
src/assets/css/index.scss
+0
-16
src/components/activity/newyear-2019/landing/index.js
+18
-2
src/components/activity/newyear-2019/myTreasure/index.js
+6
-0
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
+4
-4
src/components/activity/newyear-2019/preheat/YearCourse/index.js
+85
-63
src/components/activity/newyear-2019/preheat/YearCourse/index.scss
+9
-1
src/components/activity/newyear-2019/preheat/index.js
+22
-5
src/components/activity/newyear-2019/preheat/index.scss
+6
-0
src/components/activity/newyear-2019/preheat/nav.js
+13
-12
src/components/activity/newyear-2019/year-wish/index.js
+20
-15
No files found.
src/App.js
View file @
d14a6e9e
...
...
@@ -166,7 +166,7 @@ class App extends Component {
return
}
http
.
get
(
`
${
API
[
'home'
]}
/m/wx_loginInfo/code/
${
code
}
?redirect=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
)
http
.
get
(
`
${
API
[
"passport-api"
]}
/m/wx_loginInfo/code/
${
code
}
?redirect=
${
encodeURIComponent
(
window
.
location
.
href
)}
`
)
.
then
(
res
=>
{
let
data
=
res
.
data
if
(
data
.
errno
==
200
)
{
...
...
@@ -277,12 +277,7 @@ class App extends Component {
}
render
()
{
return
<>
<
Routes
/>
<
Link
className
=
{
'year19-index'
}
to
=
"/year/yearindex"
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/gift-package.png"
alt
=
""
/>
<
/Link
>
<
/
>
return
<
Routes
/>
}
}
...
...
src/assets/css/index.scss
View file @
d14a6e9e
...
...
@@ -512,18 +512,3 @@ input[type="radio"]:checked:before {
color
:
#333
;
font-size
:
15px
;
}
.year19-index
{
display
:
block
;
width
:
58px
;
height
:
70px
;
position
:
fixed
;
top
:
50%
;
right
:
0
;
margin-top
:
-35px
;
z-index
:
9
;
img
{
width
:
100%
;
height
:
100%
;
}
}
\ No newline at end of file
src/components/activity/newyear-2019/landing/index.js
View file @
d14a6e9e
...
...
@@ -38,6 +38,7 @@ class Landing extends Component {
}
componentDidMount
()
{
this
.
getStage
();
this
.
fetchPageData
()
window
.
showFollowAlert
=
this
.
remind
.
bind
(
this
,
'create'
)
document
.
title
=
'七月在线年终大回馈,幸运宝箱随你开,100%有奖!'
...
...
@@ -64,8 +65,23 @@ class Landing extends Component {
this
.
shareTipPopup
&&
this
.
shareTipPopup
.
remove
()
}
createMeta
=
(
title
,
dec
,
imgname
)
=>
{
let
meta
=
document
.
createElement
(
'meta'
)
// 获取活动以及宝箱的阶段
getStage
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
const
{
code
,
data
,
msg
}
=
res
.
data
if
(
code
===
200
)
{
if
(
Number
(
data
.
activity_stage
)
===
0
)
{
this
.
props
.
history
.
push
(
'/'
);
return
;
}
}
else
{
Toast
.
info
(
msg
,
2
)
}
})
}
createMeta
=
(
title
,
dec
,
imgname
)
=>
{
let
meta
=
document
.
createElement
(
'meta'
);
meta
.
setAttribute
(
'name'
,
'description'
)
meta
.
setAttribute
(
'itemprop'
,
'description'
)
meta
.
setAttribute
(
'content'
,
dec
)
...
...
src/components/activity/newyear-2019/myTreasure/index.js
View file @
d14a6e9e
...
...
@@ -51,6 +51,8 @@ class MyTreasure extends Component {
const
{
userInfo
}
=
nextProp
if
(
!
userInfo
.
uid
)
{
history
.
push
(
'/passport'
)
}
else
{
this
.
fetchMyTreasure
();
}
}
...
...
@@ -307,6 +309,10 @@ class MyTreasure extends Component {
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
if
(
Number
(
data
.
activity_stage
)
===
0
)
{
this
.
props
.
history
.
push
(
'/'
);
return
;
}
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
if
(
data
.
treasure_stage
===
0
)
{
this
.
startCountDown
()
...
...
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
View file @
d14a6e9e
...
...
@@ -66,7 +66,7 @@ class LiveRoom extends Component {
}
});
}
}
// 已预约 给提示
tip
=
()
=>
{
...
...
@@ -88,7 +88,7 @@ class LiveRoom extends Component {
this
.
toLogin
();
}
else
{
const
vCourseId
=
url
.
split
(
'/'
)[
0
];
history
.
push
(
`/play/video?id=
${
vCourseId
}
`
)
window
.
location
.
href
=
`/play/video?id=
${
vCourseId
}
`
}
}
// 关闭弹框
...
...
@@ -140,7 +140,7 @@ class LiveRoom extends Component {
<
/CommonPopup
>
)
}
<
CommonContainer
title
=
'大咖直播'
id
=
"year-live"
>
<
ul
className
=
'live__list'
>
{
...
...
@@ -177,7 +177,7 @@ class LiveRoom extends Component {
item
.
on_live
==
0
&&
item
.
is_end
==
0
&&
item
.
is_subscribe
==
1
&&
(
<
span
onClick
=
{
this
.
tip
}
className
=
"order__btn subscribed"
>
已预约
<
/span
>
)
}
}
{
item
.
on_live
==
1
&&
item
.
is_end
==
0
&&
(
<
span
onClick
=
{()
=>
this
.
toLivingRoom
(
item
.
room_url
)}
className
=
"order__btn living"
>
正在直播
<
/span
>
...
...
src/components/activity/newyear-2019/preheat/YearCourse/index.js
View file @
d14a6e9e
...
...
@@ -605,27 +605,46 @@ class YearCourse extends Component {
removable
,
sum
,
}
=
this
.
state
const
{
stage
}
=
this
.
props
const
{
stage
,
treasureStage
}
=
this
.
props
return
(
<
div
className
=
{
'year-index-course'
}
>
{
/*浮框*/
}
<
div
className
=
'nav-right'
>
<
span
onClick
=
{
this
.
toBoxList
}
className
=
'nav-right__link'
>
{
Number
(
treasureStage
)
===
1
&&
<
div
className
=
'nav-right'
>
<
span
onClick
=
{
this
.
toBoxList
}
className
=
'nav-right__link'
>
未开宝箱
{
removable
>
0
&&
<
i
className
=
"nav-right__number"
>
{
removable
}
<
/i
>
}
<
/span
>
<
a
onClick
=
{()
=>
this
.
toYearWish
()}
className
=
'nav-right__link'
>
心愿单
{
sum
>
0
&&
<
i
className
=
"nav-right__number"
>
{
sum
}
<
/i
>
}
<
/a
>
<
/div
>
{
removable
>
0
&&
<
i
className
=
"nav-right__number"
>
{
removable
}
<
/i
>
}
<
/span
>
<
a
onClick
=
{()
=>
this
.
toYearWish
()}
className
=
'nav-right__link'
>
心愿单
{
sum
>
0
&&
<
i
className
=
"nav-right__number"
>
{
sum
}
<
/i
>
}
<
/a
>
<
/div
>
}
{
Number
(
treasureStage
)
===
0
&&
<
div
className
=
'nav-right-wish nav-right'
>
<
a
onClick
=
{()
=>
this
.
toYearWish
()}
className
=
'nav-right__link'
>
心愿单
{
sum
>
0
&&
<
i
className
=
"nav-right__number"
>
{
sum
}
<
/i
>
}
<
/a
>
<
/div
>
}
{
/* 重磅好课 */
}
<
CommonContainer
title
=
'重磅好课'
id
=
'year-course'
>
...
...
@@ -673,57 +692,60 @@ class YearCourse extends Component {
<
/CommonContainer
>
{
/* 人气好课免费学 */
}
<
CommonContainer
title
=
'人气好课免费学'
id
=
'year-free'
>
<
a
className
=
'boss__add'
href
=
"/active/givecourse?activename=shuangdan"
>
更有
42
本技术书籍免费送
<
/a
>
{
(
freecourse
.
course
&&
freecourse
.
course
.
length
>
0
)
&&
<>
<
div
className
=
'freecourse course-box'
>
{
Number
(
stage
)
!==
3
&&
<
CommonContainer
title
=
'人气好课免费学'
id
=
'year-free'
>
<
a
className
=
'boss__add'
href
=
"/active/givecourse?activename=shuangdan"
>
更有
42
本技术书籍免费送
<
/a
>
{
(
freecourse
.
course
&&
freecourse
.
course
.
length
>
0
)
&&
<>
<
div
className
=
'freecourse course-box'
>
{
freecourse
.
course
.
map
(
item
=>
(
<
CourseItem
image
=
{
item
.
image_name
}
key
=
{
item
.
course_id
}
id
=
{
item
.
course_id
}
toCourse
=
{
this
.
toCourse
}
>
<
div
className
=
"coupon-course__footer"
>
{
item
.
is_buy
==
1
&&
<
a
onClick
=
{()
=>
this
.
toCourse
(
item
.
course_id
)}
className
=
"btn to-study"
>
开始学习
<
/a
>
}
{
item
.
is_buy
==
0
&&
<
a
onClick
=
{()
=>
this
.
freeStudy
()}
className
=
"btn free-study"
>
点击免费学
<
/a
>
}
<
p
className
=
"free-course-num"
>
已送出
<
span
>
{
item
.
act_num
}
<
/span>个课
程
<
/p
>
<
/div
>
<
/CourseItem
>
))
}
<
/div
>
{
freecourse
.
course
.
map
(
item
=>
(
<
CourseItem
image
=
{
item
.
image_name
}
key
=
{
item
.
course_id
}
id
=
{
item
.
course_id
}
toCourse
=
{
this
.
toCourse
}
>
<
div
className
=
"coupon-course__footer"
>
{
item
.
is_buy
==
1
&&
<
a
onClick
=
{()
=>
this
.
toCourse
(
item
.
course_id
)}
className
=
"btn to-study"
>
开始学习
<
/a
>
}
{
item
.
is_buy
==
0
&&
<
a
onClick
=
{()
=>
this
.
freeStudy
()}
className
=
"btn free-study"
>
点击免费学
<
/a
>
}
<
p
className
=
"free-course-num"
>
已送出
<
span
>
{
item
.
act_num
}
<
/span>个课
程
<
/p
>
<
/div
>
<
/CourseItem
>
))
(
freecourse
.
courseList
&&
freecourse
.
courseList
.
length
>
4
)
&&
<
button
className
=
"more-button"
onClick
=
{()
=>
this
.
handleToMore
(
'freecourse'
)}
>
{
freecourse
.
isMore
?
'查看更多'
:
'收起'
}
<
/button
>
}
<
/div
>
{
(
freecourse
.
courseList
&&
freecourse
.
courseList
.
length
>
4
)
&&
<
button
className
=
"more-button"
onClick
=
{()
=>
this
.
handleToMore
(
'freecourse'
)}
>
{
freecourse
.
isMore
?
'查看更多'
:
'收起'
}
<
/button
>
}
<
/
>
}
<
/CommonContainer
>
<
/
>
}
<
/CommonContainer
>
}
{
/* stage,活动阶段 0-不在活动时间 1-预热 2-正式 3-返场 */
}
{
Number
(
stage
)
===
2
&&
Number
(
stage
)
!==
1
&&
<>
{
/* 精品好课1分开抢 */
}
<
CommonContainer
title
=
'精品好课1分开抢'
id
=
'year-group'
>
...
...
@@ -998,7 +1020,7 @@ class YearCourse extends Component {
<
/
>
}
{
Number
(
stage
)
!==
2
&&
Number
(
stage
)
===
1
&&
<>
{
/* 精品好课1分开抢 */
}
<
CommonContainer
title
=
'精品好课1分开抢'
id
=
'year-group'
>
...
...
src/components/activity/newyear-2019/preheat/YearCourse/index.scss
View file @
d14a6e9e
...
...
@@ -296,7 +296,7 @@
.groupcourse
[
data-stage
=
"2"
]
.course-container
{
height
:
215px
;
}
.progree-and-sale
{
display
:
flex
;
...
...
@@ -416,5 +416,12 @@
line-height
:
14px
;
}
}
.nav-right-wish
{
background-image
:
url("https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/fanc-bx.png")
;
.nav-right__link
{
top
:
60px
;
left
:
10px
;
}
}
}
\ No newline at end of file
src/components/activity/newyear-2019/preheat/index.js
View file @
d14a6e9e
...
...
@@ -110,11 +110,25 @@ export default class index extends Component {
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
const
{
code
,
data
,
msg
}
=
res
.
data
if
(
code
===
200
)
{
if
(
Number
(
data
.
activity_stage
)
===
0
)
{
this
.
props
.
history
.
push
(
'/'
);
return
;
}
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this
.
setState
({
activity_stage
:
data
.
activity_stage
,
treasure_stage
:
data
.
treasure_stage
})
if
(
data
.
activity_stage
==
3
){
this
.
setState
({
banner
:
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/m_banner_fc.png'
,
})
}
else
{
this
.
setState
({
banner
:
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/m_banner_bj%402x.png'
,
})
}
}
else
{
Toast
.
info
(
msg
,
2
)
}
...
...
@@ -123,8 +137,8 @@ export default class index extends Component {
render
()
{
const
{
banner
,
activity_stage
,
banner
,
activity_stage
,
treasure_stage
,
}
=
this
.
state
return
(
...
...
@@ -133,7 +147,7 @@ export default class index extends Component {
<
div
id
=
"banner"
className
=
"banner-treasure__header"
style
=
{{
backgroundImage
:
`url(
${
banner
}
)`
}}
><
/div
>
<
div
className
=
"banner-treasure__nav"
>
<
TreasureNav
id
=
"banner"
treasure_stage
=
{
treasure_stage
}
/
>
<
TreasureNav
id
=
"banner"
treasure_stage
=
{
treasure_stage
}
activeStage
=
{
activity_stage
}
/
>
<
/div
>
<
div
className
=
"banner-treasure__decorate"
><
/div
>
<
/div
>
...
...
@@ -143,12 +157,12 @@ export default class index extends Component {
{
/* 组队开宝箱 */
}
{
treasure_stage
===
1
&&
treasure_stage
===
1
&&
<
TreasureBox
isAppUpdate
=
{
this
.
state
.
isAppUpdate
}
getRemovable
=
{
this
.
getRemovable
}
/
>
}
{
/* 课程 */
}
<
YearCourse
stage
=
{
activity_stage
}
isAppUpdate
=
{
this
.
state
.
isAppUpdate
}
/
>
<
YearCourse
stage
=
{
activity_stage
}
treasureStage
=
{
treasure_stage
}
isAppUpdate
=
{
this
.
state
.
isAppUpdate
}
/
>
{
/*好友加入队伍提醒;获得宝箱提醒;开售提醒弹窗,需要自取,注意修改文案*/
}
{
...
...
@@ -181,6 +195,9 @@ export default class index extends Component {
<
/div
>
<
/CommonPopup
>
}
<
div
className
=
{
'btm-rule'
}
>*
本活动解释权归北京七月在线科技有限公司所有
*<
/div
>
<
/div
>
)
}
...
...
src/components/activity/newyear-2019/preheat/index.scss
View file @
d14a6e9e
...
...
@@ -59,6 +59,12 @@
}
}
.btm-rule
{
color
:
#fff
;
font-size
:
12px
;
width
:
100%
;
text-align
:
center
;
}
}
.year-index
+
.year19-index
{
...
...
src/components/activity/newyear-2019/preheat/nav.js
View file @
d14a6e9e
...
...
@@ -48,21 +48,22 @@ class TreasureNav extends Component {
}
componentWillReceiveProps
(
nextProps
)
{
this
.
initNav
(
nextProps
.
treasure_stage
);
this
.
initNav
(
nextProps
.
treasure_stage
,
nextProps
.
activeStage
);
}
initNav
=
(
treasure_stage
)
=>
{
initNav
=
(
treasure_stage
,
activeStage
)
=>
{
let
{
navs
}
=
this
.
state
;
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
let
data
=
this
.
state
.
navs
if
(
treasure_stage
===
0
)
{
this
.
setState
({
formatNavs
:
navs
.
filter
(
item
=>
item
.
id
!==
'year-treasure'
)
});
}
else
{
this
.
setState
({
formatNavs
:
navs
})
data
=
navs
.
filter
(
item
=>
item
.
id
!==
'year-treasure'
)
}
if
(
activeStage
===
3
)
{
data
=
data
.
filter
(
item
=>
item
.
id
!==
'year-free'
)
}
this
.
setState
({
formatNavs
:
data
})
}
calcNavActive
=
()
=>
{
...
...
@@ -108,9 +109,9 @@ class TreasureNav extends Component {
<
div
className
=
{
classnames
(
"treasure-nav"
,
{
'fixed'
:
isFixed
})}
data
-
skip
=
"nav"
>
{
formatNavs
.
map
((
item
,
index
)
=>
(
<
a
href
=
{
`#
${
item
.
id
}
`
}
className
=
{
classnames
(
"treasure-nav__item"
,
{
'active'
:
index
===
curIndex
})}
<
a
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/year-wish/index.js
View file @
d14a6e9e
...
...
@@ -46,6 +46,11 @@ class YarnWish extends Component {
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
if
(
Number
(
data
.
activity_stage
)
===
0
)
{
this
.
props
.
history
.
push
(
'/'
);
return
;
}
this
.
setState
({
activityStage
:
data
.
activity_stage
// 0-不在活动时间 1-预热 2-正式 3-返场
})
...
...
@@ -149,25 +154,25 @@ class YarnWish extends Component {
list
.
length
>
0
?
<>
{
activityStage
===
2
&&
activityStage
!==
1
&&
<>
<
CommonContainer
>
<
div
className
=
'groupcourse course-box'
>
{
list
.
map
(
item
=>
(
<
CourseItem
image
=
{
item
.
image_name
}
key
=
{
item
.
course_id
}
<
CourseItem
image
=
{
item
.
image_name
}
key
=
{
item
.
course_id
}
id
=
{
item
.
course_id
}
time
=
{
item
.
type
===
2
||
item
.
type
===
7
?
item
.
end_time
:
''
}
toCourse
=
{
this
.
toCourse
}
>
{
/*
{
/*
* 拼团,正常:未开团1 已开2;一分:未开团5 已开7
* type 1 立即参团 2 已参团 3 我要砍价 4 已参加砍价 可以继续砍价 5 马上抢 6 开始学习 7 已参加一分钱拼团 8 砍价待支付
*/
}
<
div
className
=
"coupon-course__footer"
>
{
...
...
@@ -306,7 +311,7 @@ class YarnWish extends Component {
}
{
item
.
type
===
6
&&
<
a
<
a
onClick
=
{()
=>
this
.
toCourse
(
item
.
course_id
)}
className
=
"btn to-group"
data
-
status
=
"study"
...
...
@@ -322,15 +327,15 @@ class YarnWish extends Component {
<
/
>
}
{
activityStage
!==
2
&&
activityStage
===
1
&&
<>
<
CommonContainer
>
<
div
className
=
'groupcourse course-box'
>
{
list
.
map
(
item
=>
(
<
CourseItem
image
=
{
item
.
image_name
}
key
=
{
item
.
course_id
}
<
CourseItem
image
=
{
item
.
image_name
}
key
=
{
item
.
course_id
}
id
=
{
item
.
course_id
}
toCourse
=
{
this
.
toCourse
}
>
...
...
@@ -343,7 +348,7 @@ class YarnWish extends Component {
item
.
is_buy
==
1
&&
<>
<
p
className
=
{
'course-title text-overflow-1'
}
>
{
item
.
course_title
}
<
/p
>
<
a
<
a
onClick
=
{()
=>
this
.
toCourse
(
item
.
course_id
)}
className
=
"btn to-study"
>
开始学习
<
/a
>
...
...
@@ -382,7 +387,7 @@ class YarnWish extends Component {
<
span
className
=
"old-price"
>
{
item
.
type
==
2
?
''
:
'现价:'
}
<
s
>
¥
{
item
.
price1
}
<
/s></
span
>
<
/div
>
<
div
className
=
"status"
>
<
a
<
a
onClick
=
{()
=>
this
.
toCourse
(
item
.
course_id
)}
className
=
"status-btn to-buy"
>
直接购买
<
/a
>
...
...
@@ -425,7 +430,7 @@ class YarnWish extends Component {
<
div
className
=
"notData"
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/PC/icon-empty.png"
alt
=
""
/>
{
activityStage
==
1
activityStage
==
1
?
<
p
>
你的心愿单目前空空如也,
<
br
/>
快去挑选更多优惠课程吧~
<
/p
>
:
<
p
>
你的心愿单没有课程哦,
<
br
/>
感兴趣的课程可在双旦主会场直接购买!
<
/p
>
}
...
...
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