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
71b4f546
Commit
71b4f546
authored
Dec 14, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '00' of gitlab.julyedu.com:baiguangyao/mr-julyedu into 00
parents
7d3cecb5
69a89854
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
87 deletions
+139
-87
src/components/activity/newyear-2019/common/prizes/index.js
+3
-0
src/components/activity/newyear-2019/common/user-bullet-screen/bullet-screen.scss
+3
-0
src/components/activity/newyear-2019/common/user-bullet-screen/index.js
+2
-4
src/components/activity/newyear-2019/landing/index.js
+88
-59
src/components/activity/newyear-2019/preheat/YearCourse/index.js
+2
-2
src/components/activity/newyear-2019/preheat/index.js
+26
-4
src/components/activity/newyear-2019/preheat/nav.js
+15
-18
No files found.
src/components/activity/newyear-2019/common/prizes/index.js
View file @
71b4f546
...
@@ -115,6 +115,9 @@ class Prizes extends Component {
...
@@ -115,6 +115,9 @@ class Prizes extends Component {
)
)
})
})
}
}
<
li
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/prize-placeholder.png"
alt
=
""
/>
<
/li
>
<
/ul
>
<
/ul
>
<
/div
>
<
/div
>
<
div
className
=
"show-more"
onClick
=
{
this
.
showMore
}
>
<
div
className
=
"show-more"
onClick
=
{
this
.
showMore
}
>
...
...
src/components/activity/newyear-2019/common/user-bullet-screen/bullet-screen.scss
View file @
71b4f546
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
span
{
span
{
font-size
:
12px
;
font-size
:
12px
;
color
:
#fff
;
color
:
#fff
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
}
}
}
#user-bullet-screen
{
#user-bullet-screen
{
...
...
src/components/activity/newyear-2019/common/user-bullet-screen/index.js
View file @
71b4f546
...
@@ -51,8 +51,7 @@ class UserBulletScreen extends Component {
...
@@ -51,8 +51,7 @@ class UserBulletScreen extends Component {
return
`
return
`
<li class="swiper-slide">
<li class="swiper-slide">
<img class="avatar" src="
${
item
.
avatar_file
}
" alt="">
<img class="avatar" src="
${
item
.
avatar_file
}
" alt="">
<span>
${
item
.
user_name
}
</span>
<span>
${
item
.
user_name
}
${
item
.
msg
}
</span>
<span>
${
item
.
msg
}
</span>
</li>
</li>
`
`
})
})
...
@@ -87,8 +86,7 @@ class UserBulletScreen extends Component {
...
@@ -87,8 +86,7 @@ class UserBulletScreen extends Component {
<
li
className
=
'swiper-slide'
key
=
{
index
}
>
<
li
className
=
'swiper-slide'
key
=
{
index
}
>
<
img
src
=
{
item
[
'avatar_file'
]}
<
img
src
=
{
item
[
'avatar_file'
]}
alt
=
""
className
=
"avatar"
/>
alt
=
""
className
=
"avatar"
/>
<
span
>
{
item
.
user_name
}
<
/span
>
<
span
>
{
item
.
user_name
}
{
item
.
msg
}
<
/span
>
<
span
>
{
item
.
msg
}
<
/span
>
<
/li
>
<
/li
>
)
)
})
})
...
...
src/components/activity/newyear-2019/landing/index.js
View file @
71b4f546
This diff is collapsed.
Click to expand it.
src/components/activity/newyear-2019/preheat/YearCourse/index.js
View file @
71b4f546
...
@@ -404,7 +404,7 @@ class YearCourse extends Component {
...
@@ -404,7 +404,7 @@ class YearCourse extends Component {
<
div
className
=
"coupon-course__footer"
>
<
div
className
=
"coupon-course__footer"
>
{
{
item
.
is_buy
==
1
&&
item
.
is_buy
==
1
&&
<
a
onClick
=
{
this
.
toCourse
}
className
=
"btn to-study"
>
开始学习
<
/a
>
<
a
onClick
=
{
()
=>
this
.
toCourse
(
item
.
course_id
)
}
className
=
"btn to-study"
>
开始学习
<
/a
>
}
}
{
{
item
.
is_buy
==
0
&&
item
.
is_buy
==
0
&&
...
@@ -440,7 +440,7 @@ class YearCourse extends Component {
...
@@ -440,7 +440,7 @@ class YearCourse extends Component {
<
div
className
=
"coupon-course__footer"
>
<
div
className
=
"coupon-course__footer"
>
{
{
item
.
is_buy
==
1
&&
item
.
is_buy
==
1
&&
<
a
toCourse
=
{
this
.
toCourse
}
className
=
"btn to-study"
>
开始学习
<
/a
>
<
a
onClick
=
{()
=>
this
.
toCourse
(
item
.
course_id
)
}
className
=
"btn to-study"
>
开始学习
<
/a
>
}
}
{
{
item
.
is_buy
==
0
&&
item
.
is_buy
==
0
&&
...
...
src/components/activity/newyear-2019/preheat/index.js
View file @
71b4f546
...
@@ -7,9 +7,10 @@ import TreasureNav from './nav'
...
@@ -7,9 +7,10 @@ import TreasureNav from './nav'
import
CommonPopup
from
'./../common/commonPopup/index'
import
CommonPopup
from
'./../common/commonPopup/index'
import
cookie
from
"js-cookie"
import
cookie
from
"js-cookie"
import
{
setCurrentUser
,
startFetchUser
}
from
"@/store/userAction"
import
{
setCurrentUser
,
startFetchUser
}
from
"@/store/userAction"
import
{
SendMessageToApp
,
getParam
}
from
'@/utils'
import
{
SendMessageToApp
,
getParam
,
http
}
from
'@/utils'
import
{
addDays
}
from
"date-fns"
import
{
addDays
}
from
"date-fns"
import
{
connect
}
from
"react-redux"
import
{
connect
}
from
"react-redux"
import
{
Toast
}
from
'antd-mobile'
;
@
connect
(
state
=>
({
@
connect
(
state
=>
({
user
:
state
.
user
user
:
state
.
user
...
@@ -19,6 +20,8 @@ export default class index extends Component {
...
@@ -19,6 +20,8 @@ export default class index extends Component {
state
=
{
state
=
{
removable
:
0
,
// 未拆宝箱的数量
removable
:
0
,
// 未拆宝箱的数量
currentOpenId
:
0
,
// 当前要拆的宝箱的队伍的ID
currentOpenId
:
0
,
// 当前要拆的宝箱的队伍的ID
treasure_stage
:
0
,
// 宝箱的活动阶段
active_stage
:
0
,
// 整个活动的阶段
userInfoList
:
[],
userInfoList
:
[],
userInfo
:
{},
userInfo
:
{},
isAppUpdate
:
false
,
isAppUpdate
:
false
,
...
@@ -32,6 +35,8 @@ export default class index extends Component {
...
@@ -32,6 +35,8 @@ export default class index extends Component {
window
[
'loginInfo'
]
=
result
=>
{
window
[
'loginInfo'
]
=
result
=>
{
_this
.
loginInfo
(
result
)
_this
.
loginInfo
(
result
)
}
}
_this
.
getStage
();
}
}
// 获取app登录数据
// 获取app登录数据
...
@@ -118,6 +123,21 @@ export default class index extends Component {
...
@@ -118,6 +123,21 @@ export default class index extends Component {
}
}
}
}
// 获取活动以及宝箱的阶段
getStage
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
const
{
code
,
data
,
msg
}
=
res
.
data
;
if
(
code
===
200
)
{
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this
.
setState
({
treasure_stage
:
data
.
treasure_stage
})
}
else
{
Toast
.
info
(
msg
,
2
);
}
});
}
toYearWish
=
()
=>
{
toYearWish
=
()
=>
{
const
isLogin
=
!
this
.
props
.
user
.
hasError
const
isLogin
=
!
this
.
props
.
user
.
hasError
if
(
isLogin
)
{
if
(
isLogin
)
{
...
@@ -139,14 +159,14 @@ export default class index extends Component {
...
@@ -139,14 +159,14 @@ export default class index extends Component {
}
}
render
()
{
render
()
{
const
{
banner
,
removable
}
=
this
.
state
const
{
banner
,
removable
,
treasure_stage
}
=
this
.
state
return
(
return
(
<
div
className
=
{
'year-index'
}
>
<
div
className
=
{
'year-index'
}
>
<
div
className
=
"banner-treasure"
>
<
div
className
=
"banner-treasure"
>
<
div
id
=
"banner"
className
=
"banner-treasure__header"
<
div
id
=
"banner"
className
=
"banner-treasure__header"
style
=
{{
backgroundImage
:
`url(
${
banner
}
)`
}}
><
/div
>
style
=
{{
backgroundImage
:
`url(
${
banner
}
)`
}}
><
/div
>
<
div
className
=
"banner-treasure__nav"
>
<
div
className
=
"banner-treasure__nav"
>
<
TreasureNav
id
=
"banner"
/>
<
TreasureNav
id
=
"banner"
treasure_stage
=
{
treasure_stage
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"banner-treasure__decorate"
><
/div
>
<
div
className
=
"banner-treasure__decorate"
><
/div
>
<
/div
>
<
/div
>
...
@@ -171,7 +191,9 @@ export default class index extends Component {
...
@@ -171,7 +191,9 @@ export default class index extends Component {
<
LiveRoom
/>
<
LiveRoom
/>
{
/* 组队开宝箱 */
}
{
/* 组队开宝箱 */
}
<
TreasureBox
getRemovable
=
{
this
.
getRemovable
}
/
>
{
treasure_stage
===
1
&&
<
TreasureBox
getRemovable
=
{
this
.
getRemovable
}
/
>
}
{
/*课程*/
}
{
/*课程*/
}
<
YearCourse
isAppUpdate
=
{
this
.
state
.
isAppUpdate
}
getSum
=
{
this
.
sonToPar
.
bind
(
this
)}
/
>
<
YearCourse
isAppUpdate
=
{
this
.
state
.
isAppUpdate
}
getSum
=
{
this
.
sonToPar
.
bind
(
this
)}
/
>
...
...
src/components/activity/newyear-2019/preheat/nav.js
View file @
71b4f546
...
@@ -40,7 +40,6 @@ class TreasureNav extends Component {
...
@@ -40,7 +40,6 @@ class TreasureNav extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
initNav
();
window
.
addEventListener
(
'scroll'
,
this
.
calcNavActive
)
window
.
addEventListener
(
'scroll'
,
this
.
calcNavActive
)
}
}
...
@@ -48,24 +47,22 @@ class TreasureNav extends Component {
...
@@ -48,24 +47,22 @@ class TreasureNav extends Component {
window
.
removeEventListener
(
'scroll'
,
this
.
calcNavActive
);
window
.
removeEventListener
(
'scroll'
,
this
.
calcNavActive
);
}
}
initNav
=
()
=>
{
componentWillReceiveProps
(
nextProps
)
{
const
{
navs
}
=
this
.
state
;
this
.
initNav
(
nextProps
.
treasure_stage
);
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
}
const
{
code
,
data
}
=
res
.
data
;
if
(
code
===
200
)
{
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
initNav
=
(
treasure_stage
)
=>
{
if
(
data
.
treasure_stage
===
0
)
{
let
{
navs
}
=
this
.
state
;
this
.
setState
({
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
formatNavs
:
navs
.
filter
(
item
=>
item
.
id
!==
'year-treasure'
)
if
(
treasure_stage
===
0
)
{
});
this
.
setState
({
}
else
{
formatNavs
:
navs
.
filter
(
item
=>
item
.
id
!==
'year-treasure'
)
this
.
setState
({
});
formatNavs
:
navs
}
else
{
})
this
.
setState
({
}
formatNavs
:
navs
}
}
)
}
);
}
}
}
calcNavActive
=
()
=>
{
calcNavActive
=
()
=>
{
...
...
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