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
e77cc79d
Commit
e77cc79d
authored
Dec 10, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
心愿单
parent
51b062f6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
14 deletions
+118
-14
src/components/activity/newyear-2019/preheat/YearCourse/index.js
+0
-0
src/components/activity/newyear-2019/preheat/YearCourse/index.scss
+15
-0
src/components/activity/newyear-2019/preheat/index.js
+74
-7
src/components/activity/newyear-2019/year-wish/index.js
+29
-7
No files found.
src/components/activity/newyear-2019/preheat/YearCourse/index.js
View file @
e77cc79d
This diff is collapsed.
Click to expand it.
src/components/activity/newyear-2019/preheat/YearCourse/index.scss
View file @
e77cc79d
...
...
@@ -251,4 +251,18 @@
.sub__code_container
{
padding
:
20px
;
}
.save-image
{
display
:
block
;
width
:
133px
;
height
:
30px
;
margin
:
20px
auto
0
auto
;
background
:
rgba
(
83
,
39
,
250
,
1
);
border-radius
:
15px
;
font-size
:
14px
;
color
:
#fff
;
-webkit-appearance
:
none
;
outline
:
0
;
border
:
none
;
}
}
\ No newline at end of file
src/components/activity/newyear-2019/preheat/index.js
View file @
e77cc79d
...
...
@@ -5,13 +5,78 @@ import YearCourse from './YearCourse/index'
import
TreasureBox
from
'./../treasure-box/index'
import
TreasureNav
from
'./nav'
import
CommonPopup
from
'./../common/commonPopup/index'
import
cookie
from
"js-cookie"
import
{
setCurrentUser
,
startFetchUser
}
from
"@/store/userAction"
import
{
addDays
}
from
"date-fns"
export
default
class
index
extends
Component
{
state
=
{
userInfoList
:
[],
userInfo
:
{},
isAppUpdate
:
false
,
showMark
:
false
,
banner
:
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/m_banner_bj%402x.png'
}
componentDidMount
()
{
const
_this
=
this
// 获取App登录信息
window
[
'loginInfo'
]
=
result
=>
{
_this
.
loginInfo
(
result
)
}
}
// 获取app登录数据
loginInfo
=
(
result
)
=>
{
this
.
setState
({
userInfoList
:
result
},
()
=>
{
if
(
this
.
state
.
userInfoList
.
length
)
{
this
.
props
.
startFetchUser
()
this
.
appLogin
()
}
})
}
// 保存cookie
appLogin
=
()
=>
{
let
expires
=
addDays
(
new
Date
(),
90
)
this
.
state
.
userInfoList
.
map
((
item
,
index
)
=>
{
cookie
.
set
(
"token"
,
item
.
token
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
cookie
.
set
(
"plat"
,
item
.
plat
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
cookie
.
set
(
"uid"
,
item
.
uid
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
cookie
.
set
(
"uname"
,
item
.
uname
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
cookie
.
set
(
"avatar_file"
,
item
.
avatar_file
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
})
if
(
cookie
.
get
(
"token"
)
&&
cookie
.
get
(
"uid"
))
{
this
.
setState
({
isAppUpdate
:
true
})
}
this
.
props
.
setCurrentUser
(
this
.
transformUser
(
this
.
state
.
userInfoList
))
}
transformUser
=
res
=>
{
let
payload
res
.
map
((
item
,
index
)
=>
{
payload
=
{
hasError
:
false
,
data
:
{
username
:
item
.
uname
,
avatar
:
item
.
avatar_file
,
token
:
item
.
token
,
uid
:
item
.
uid
},
isFetching
:
false
}
})
return
payload
}
// 关闭弹框
closePopup
=
()
=>
{
this
.
setState
({
...
...
@@ -20,22 +85,23 @@ export default class index extends Component {
}
render
()
{
const
{
banner
}
=
this
.
state
;
const
{
banner
}
=
this
.
state
return
(
<
div
className
=
{
'year-index'
}
>
<
div
className
=
"banner-treasure"
>
<
div
id
=
"banner"
className
=
"banner-treasure__header"
style
=
{{
backgroundImage
:
`url(
${
banner
}
)`
}}
><
/div
>
<
div
id
=
"banner"
className
=
"banner-treasure__header"
style
=
{{
backgroundImage
:
`url(
${
banner
}
)`
}}
><
/div
>
<
div
className
=
"banner-treasure__nav"
>
<
TreasureNav
id
=
"banner"
/>
<
TreasureNav
id
=
"banner"
/>
<
/div
>
<
div
className
=
"banner-treasure__decorate"
><
/div
>
<
/div
>
{
/* 大咖直播 */
}
<
LiveRoom
/>
<
LiveRoom
/>
{
/* 组队开宝箱 */
}
<
TreasureBox
/>
<
YearCourse
/>
<
TreasureBox
/>
<
YearCourse
isAppUpdate
=
{
this
.
state
.
isAppUpdate
}
/
>
{
/*好友加入队伍提醒;获得宝箱提醒;开售提醒弹窗,需要自取,注意修改文案*/
}
{
...
...
@@ -44,7 +110,8 @@ export default class index extends Component {
<
div
className
=
'sub__code_container'
>
<
p
className
=
'sub__title'
>
提醒服务
<
/p
>
<
p
className
=
'sub__tip'
>
有好友加入队伍后第一时间通知我
~<
/p
>
<
img
className
=
'sub__qr_code'
id
=
{
'live-qr-code'
}
src
=
'//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018christyear/h5/qrcode.jpg'
alt
=
""
/>
<
img
className
=
'sub__qr_code'
id
=
{
'live-qr-code'
}
src
=
'//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018christyear/h5/qrcode.jpg'
alt
=
""
/>
<
p
className
=
'sub__tip'
>
长按识别
/
扫码
关注【七月在线】服务号即可预约
<
/p
>
<
/div
>
<
/CommonPopup
>
...
...
src/components/activity/newyear-2019/year-wish/index.js
View file @
e77cc79d
...
...
@@ -3,17 +3,29 @@ import './index.scss'
import
{
http
,
SendMessageToApp
,
getParam
}
from
'@/utils'
import
CommonContainer
from
'./../common/commonContainer/index'
import
CourseItem
from
'../../../blessingPreheat/courseItem/index'
import
{
Link
,
withRouter
}
from
"react-router-dom"
import
{
withRouter
}
from
"react-router-dom"
class
YarnWish
extends
Component
{
state
=
{
list
:
[]
list
:
[],
activityStage
:
1
,
}
componentDidMount
()
{
this
.
fetchCourse
()
this
.
getStage
()
}
componentWillUpdate
()
{
const
{
activityStage
}
=
this
.
state
;
if
(
activityStage
==
1
)
{
document
.
title
=
`七月在线年终大回馈,人气好课免费学,精品课程1分抢!`
}
else
{
document
.
title
=
`七月在线年终大回馈,人气好课免费学,精品课程1分抢!`
}
}
fetchCourse
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/activity/wish_course`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
...
...
@@ -24,6 +36,16 @@ class YarnWish extends Component {
}
})
}
getStage
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
this
.
setState
({
activityStage
:
data
.
activity_stage
// 0-不在活动时间 1-预热 2-正式 3-返场
})
}
})
}
// 去课程详情页
toCourse
=
(
courseId
)
=>
{
...
...
@@ -36,7 +58,7 @@ class YarnWish extends Component {
}
render
()
{
const
{
list
}
=
this
.
state
const
{
list
,
activityStage
}
=
this
.
state
return
(
<
div
className
=
'yarn-wish'
>
...
...
@@ -132,10 +154,10 @@ class YarnWish extends Component {
<
/CommonContainer
>
:
<
div
className
=
"notData"
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/PC/icon-empty.png"
alt
=
""
/>
<
p
>
你的心愿单目前空空如也,
<
br
/>
快去挑选更多优惠课程吧~
<
/p
>
{
/*活动期间文案*/
}
{
/*<p>你的心愿单没有课程哦,感兴趣的课程可在双旦主会场直接购买!</p>*/
}
{
activityStage
==
1
?
<
p
>
你的心愿单目前空空如也,
<
br
/>
快去挑选更多优惠课程吧~
<
/p
>
:
<
p
>
你的心愿单没有课程哦,
<
br
/>
感兴趣的课程可在双旦主会场直接购买!
<
/p
>
}
<
/div
>
}
<
/div
>
...
...
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