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
bbc0cecd
Commit
bbc0cecd
authored
Dec 10, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '00' of gitlab.julyedu.com:baiguangyao/mr-julyedu into 00
parents
3fbcff3b
d6215a5b
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
690 additions
and
98 deletions
+690
-98
src/common/addressPopup/index.js
+161
-0
src/common/addressPopup/index.scss
+89
-0
src/common/closable-popup/index.js
+19
-18
src/common/closable-popup/index.scss
+29
-25
src/components/activity/newyear-2019/common/commonContainer/index.js
+2
-1
src/components/activity/newyear-2019/common/splitSuccess/index.js
+49
-0
src/components/activity/newyear-2019/common/splitSuccess/index.scss
+96
-0
src/components/activity/newyear-2019/myTreasure/index.js
+36
-13
src/components/activity/newyear-2019/myTreasure/index.scss
+16
-0
src/components/activity/newyear-2019/myTreasure/team.js
+56
-16
src/components/activity/newyear-2019/myTreasure/team.scss
+2
-0
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
+4
-6
No files found.
src/common/addressPopup/index.js
0 → 100644
View file @
bbc0cecd
import
React
,
{
Component
}
from
'react'
;
import
{
http
}
from
'@/utils'
;
import
{
Formik
,
Form
,
Field
}
from
'formik'
;
import
{
Toast
}
from
"antd-mobile"
;
import
'./index.scss'
;
class
AddressPopup
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
isLoading
:
false
,
addressInfo
:
{
name
:
''
,
phone
:
''
,
address
:
''
,
},
}
}
componentDidMount
()
{
this
.
fetchUserAddress
();
}
// 获取收货信息
fetchUserAddress
=
()
=>
{
const
{
addressInfo
}
=
this
.
state
;
http
.
get
(
`
${
API
.
home
}
/sys/user_address_info`
).
then
(
res
=>
{
const
{
code
,
data
,
msg
}
=
res
.
data
;
if
(
code
===
200
)
{
this
.
setState
({
addressInfo
:
Object
.
assign
({},
addressInfo
,
{
name
:
data
.
name
,
phone
:
data
.
phone
,
address
:
data
.
address
,
}),
isLoading
:
true
,
});
}
});
}
handleToSubmit
=
(
params
=
{})
=>
{
const
{
handleToHide
}
=
this
.
props
;
http
.
post
(
`
${
API
.
home
}
/sys/collect_info`
,
params
).
then
(
res
=>
{
const
{
code
,
msg
}
=
res
.
data
;
if
(
code
===
200
)
{
handleToHide
();
}
else
{
Toast
.
info
(
msg
,
2
,
null
,
false
);
}
});
}
render
()
{
const
{
isLoading
,
addressInfo
}
=
this
.
state
;
const
{
tip
,
prize
,
skip
=
'default'
}
=
this
.
props
;
return
(
<>
{
isLoading
&&
<
Formik
initialValues
=
{{
...
addressInfo
}}
validate
=
{({
name
,
phone
,
address
})
=>
{
const
errors
=
{};
if
(
!
name
)
{
errors
.
name
=
'请输入收件人'
;
}
if
(
!
/^1
[
3-9
]\d{9}
$/
.
test
(
phone
))
{
errors
.
phone
=
'请填写正确格式的手机号'
;
}
if
(
!
address
)
{
errors
.
address
=
'请输入收货地址'
;
}
return
errors
;
}}
validateOnBlur
=
{
false
}
validateOnChange
=
{
false
}
onSubmit
=
{(
values
)
=>
{
this
.
handleToSubmit
(
values
);
}}
render
=
{({
errors
})
=>
(
<
Form
className
=
"address-form"
data
-
skip
=
{
skip
}
>
{
prize
?
(
<
p
className
=
'address__prize'
>
您抽中了
{
prize
}
<
span
style
=
{{
'color'
:
'#FF4000'
}}
>
实物奖品
<
/span></
p
>
)
:
(
null
)
}
{
tip
?
(
<
div
className
=
"address-form__subtitle"
>
{
tip
}
<
/div>
)
:
(
<p className="address-form__desc">请及时填写收货信息,获得实物奖品后将第一时间为您邮寄</
p
>
)
}
<
Field
name
=
"name"
render
=
{({
field
})
=>
(
<
div
className
=
"address-form__item"
>
<
input
{...
field
}
className
=
"address-form__ipt"
type
=
"text"
placeholder
=
"收件人"
/>
{
errors
.
name
&&
<
p
className
=
"address-form__tip"
>
{
errors
.
name
}
<
/p
>
}
<
/div
>
)}
/
>
<
Field
name
=
"phone"
render
=
{({
field
})
=>
(
<
div
className
=
"address-form__item"
>
<
input
{...
field
}
className
=
"address-form__ipt"
type
=
"text"
placeholder
=
"联系方式"
/>
{
errors
.
phone
&&
<
p
className
=
"address-form__tip"
>
{
errors
.
phone
}
<
/p
>
}
<
/div
>
)}
/
>
<
Field
name
=
"address"
render
=
{({
field
})
=>
(
<
div
className
=
"address-form__item"
>
<
input
{...
field
}
className
=
"address-form__ipt"
type
=
"text"
placeholder
=
"收货地址"
/>
{
errors
.
address
&&
<
p
className
=
"address-form__tip"
>
{
errors
.
address
}
<
/p
>
}
<
/div
>
)}
/
>
<
button
className
=
"address-form__submit"
data
-
status
=
"do"
type
=
"submit"
>
提交
<
/button
>
<
/Form
>
)}
/
>
}
<
/
>
);
}
}
export
default
AddressPopup
;
\ No newline at end of file
src/common/addressPopup/index.scss
0 → 100644
View file @
bbc0cecd
// 地址弹窗
[
data-skip
=
"default"
]
{
.address-form__item
{
width
:
250px
;
}
.address-form__submit
{
width
:
120px
;
height
:
34px
;
margin
:
8px
auto
0
;
border-style
:
none
;
border-radius
:
17px
;
color
:
rgba
(
255
,
255
,
255
,
1
);
background-color
:
rgba
(
82
,
92
,
101
,
0
.3
);
&
[
data-status
=
"do"
]
{
background-color
:
#0099FF
;
}
}
}
[
data-skip
=
"year"
]
{
.address-form__subtitle
{
margin
:
0
15px
;
}
.address-form__item
{
width
:
270px
;
margin
:
0
15px
10px
;
}
.address-form__ipt
{
border-radius
:
3px
;
}
.address-form__submit
{
width
:
270px
;
height
:
44px
;
margin
:
15px
auto
0
;
border
:
1px
solid
#090909
;
border-radius
:
5px
;
color
:
#090909
;
background-color
:
#FFE319
;
}
}
.address-form__desc
{
// width: 238px;
margin
:
16px
auto
15px
;
font-size
:
12px
;
color
:
#999
;
}
.address-form__item
{
position
:
relative
;
width
:
250px
;
margin
:
0
auto
16px
;
}
.address-form__ipt
{
display
:
block
;
width
:
100%
;
height
:
40px
;
border
:
1px
solid
rgba
(
221
,
221
,
221
,
1
);
font-size
:
14px
;
font-weight
:
400
;
color
:
rgba
(
153
,
153
,
153
,
1
);
text-indent
:
10px
;
}
.address-form__tip
{
position
:
absolute
;
bottom
:
-14px
;
width
:
100%
;
font-size
:
12px
;
color
:
#ff0000
;
line-height
:
14px
;
}
.address-form__submit
{
display
:
block
;
font-size
:
15px
;
font-weight
:
500
;
cursor
:
pointer
;
outline
:
none
;
}
\ No newline at end of file
src/common/closable-popup/index.js
View file @
bbc0cecd
...
...
@@ -6,15 +6,15 @@ import classnames from 'classnames'
const
re
=
/
(
https
?
|ftp
)
:
\/\/[
-A-Za-z0-9+&@#
/
%?=~_|!:,.;
]
+
[
-A-Za-z0-9+&@#
/
%=~_|
]
/
function
ClosablePopup
({
title
,
content
,
className
,
closable
=
true
,
close
=
function
()
{
}
,
clickMaskClose
=
true
,
closeIcon
=
'iconiconfront-2'
}
=
{})
{
title
,
content
,
className
,
closable
=
true
,
close
=
function
()
{},
clickMaskClose
=
true
,
skip
=
'default'
,
closeIcon
=
'iconiconfront-2'
}
=
{})
{
function
unmountComponent
()
{
...
...
@@ -36,29 +36,30 @@ function ClosablePopup({
}
function
clickMask
()
{
if
(
closable
)
{
if
(
closable
)
{
return
}
if
(
!
clickMaskClose
)
{
if
(
!
clickMaskClose
)
{
return
}
_close
()
}
const
closablePopup
=
(
<
div
className
=
{
'closable-popup-mask'
}
onClick
=
{
clickMask
}
>
<
div
className
=
{
'closable-popup-mask'
}
data
-
skip
=
{
skip
}
onClick
=
{
clickMask
}
>
<
div
className
=
{
classnames
([
'popup-container'
,
className
])}
>
<
div
className
=
"title"
>
{
title
}
<
/div
>
<
div
className
=
"content"
>
{
content
}
<
/div
>
{
closable
&&
(
re
.
test
(
closeIcon
)
?
<
img
src
=
{
closeIcon
}
alt
=
""
className
=
{
'close-icon'
}
onClick
=
{
_close
}
/
>
:
<
i
className
=
{
`close iconfont
${
closeIcon
}
`
}
onClick
=
{
_close
}
/>
)
}
<
/div
>
{
closable
&&
(
re
.
test
(
closeIcon
)
?
<
img
src
=
{
closeIcon
}
alt
=
""
className
=
{
'close-icon'
}
onClick
=
{
_close
}
/
>
:
<
i
className
=
{
`close iconfont
${
closeIcon
}
`
}
onClick
=
{
_close
}
/
>
)
}
<
/div
>
)
const
div
=
document
.
createElement
(
'div'
)
...
...
src/common/closable-popup/index.scss
View file @
bbc0cecd
.closable-popup-mask
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
position
:
fixed
;
top
:
0
;
left
:
0
;
...
...
@@ -7,40 +11,40 @@
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
z-index
:
999
;
&
[
data-skip
=
"default"
]
{
.popup-container
{
border-radius
:
10px
;
}
}
&
[
data-skip
=
"year"
]
{
.popup-container
{
border-radius
:
5px
;
}
}
.popup-container
{
position
:
absolute
;
top
:
165px
;
left
:
50%
;
transform
:
translateX
(
-50%
);
width
:
300px
;
padding
:
20px
10px
;
border-radius
:
10px
;
background
:
#fff
;
background-color
:
#fff
;
.title
{
font-size
:
16px
;
color
:
#525C65
;
text-align
:
center
;
}
}
.close
{
position
:
absolute
;
bottom
:
-74px
;
left
:
50%
;
transform
:
translateX
(
-50%
);
font-size
:
36px
;
color
:
#fff
;
}
.close
{
font-size
:
36px
;
color
:
#fff
;
}
.close-icon
{
position
:
absolute
;
bottom
:
-66px
;
left
:
50%
;
width
:
33px
;
height
:
33px
;
transform
:
translateX
(
-50%
);
font-size
:
36px
;
color
:
#fff
;
}
.close-icon
{
width
:
33px
;
height
:
33px
;
font-size
:
36px
;
color
:
#fff
;
}
}
src/components/activity/newyear-2019/common/commonContainer/index.js
View file @
bbc0cecd
...
...
@@ -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/common/splitSuccess/index.js
0 → 100644
View file @
bbc0cecd
import
React
,
{
Component
}
from
'react'
;
import
'./index.scss'
;
class
SplitSuccess
extends
Component
{
render
()
{
const
{
handleToInvite
}
=
this
.
props
;
return
(
<
div
data
-
skip
=
"split"
>
<
div
className
=
"split-success__image"
>
<
img
src
=
""
alt
=
""
/>
<
/div
>
<
p
className
=
"split-success__prize"
>
AI100
题纸质书
<
/p
>
<
a
href
=
""
className
=
"split-success__link"
>
<
span
>
查看
/
修改收货信息
<
/span
>
<
/a
>
<
div
className
=
"split-success__member"
>
<
div
className
=
"member-item"
>
<
span
className
=
"member-item__avatar"
>
<
i
className
=
"member-item__captain"
>
队长
<
/i
>
<
/span
>
<
span
className
=
"member-item__prize"
>
AI100
题纸质书
<
/span
>
<
/div
>
<
div
className
=
"member-item"
>
<
span
className
=
"member-item__avatar"
>
<
i
className
=
"member-item__captain"
>
队长
<
/i
>
<
/span
>
<
span
className
=
"member-item__prize"
>
AI100
题纸质书
<
/span
>
<
/div
>
<
div
className
=
"member-item"
>
<
span
className
=
"member-item__avatar"
>
<
i
className
=
"member-item__captain"
>
队长
<
/i
>
<
/span
>
<
span
className
=
"member-item__prize"
>
AI100
题纸质书
<
/span
>
<
/div
>
<
div
className
=
"member-item"
>
<
span
className
=
"member-item__avatar"
>
<
i
className
=
"member-item__captain"
>
队长
<
/i
>
<
/span
>
<
span
className
=
"member-item__prize"
>
AI100
题纸质书
<
/span
>
<
/div
>
<
/div
>
<
button
className
=
"split-success__jump"
onClick
=
{
handleToInvite
}
>
继续组队开宝箱
<
/button
>
<
/div
>
);
}
}
export
default
SplitSuccess
;
\ No newline at end of file
src/components/activity/newyear-2019/common/splitSuccess/index.scss
0 → 100644
View file @
bbc0cecd
[
data-skip
=
"split"
]
{
text-align
:
center
;
.split-success__image
{
width
:
130px
;
height
:
103px
;
margin
:
10px
auto
0
;
border
:
2px
solid
#CDCDCD
;
box-sizing
:
border-box
;
img
{
display
:
block
;
width
:
100%
;
}
}
.split-success__prize
{
margin
:
8px
0
0
;
font-size
:
15px
;
font-weight
:
500
;
color
:
#FF232D
;
text-align
:
center
;
line-height
:
1
;
}
.split-success__link
{
display
:
inline-block
;
margin
:
8px
0
0
;
font-size
:
12px
;
color
:
#666
;
text-align
:
center
;
line-height
:
1
;
span
{
text-decoration
:
underline
;
}
}
.split-success__member
{
margin
:
18px
0
0
;
padding
:
4px
12px
;
border-radius
:
6px
;
background-color
:
#EFEFEF
;
}
.member-item
{
display
:
flex
;
align-items
:
center
;
margin
:
8px
0
;
}
.member-item__avatar
{
display
:
inline-block
;
position
:
relative
;
width
:
25px
;
height
:
25px
;
border-radius
:
50%
;
background-color
:
#fff
;
}
.member-item__captain
{
position
:
absolute
;
top
:
-14px
;
right
:
-18px
;
width
:
30px
;
height
:
18px
;
border
:
1px
solid
#fff
;
border-radius
:
9px
9px
9px
0
;
font-size
:
12px
;
font-style
:
normal
;
color
:
#0B7B45
;
text-align
:
center
;
background-color
:
#FFE319
;
}
.member-item__prize
{
padding-left
:
8px
;
font-size
:
12px
;
color
:
#090909
;
}
.split-success__jump
{
width
:
270px
;
height
:
44px
;
margin
:
18px
0
0
;
border
:
1px
solid
#090909
;
border-radius
:
5px
;
box-sizing
:
border-box
;
font-size
:
16px
;
color
:
#090909
;
text-align
:
center
;
line-height
:
44px
;
background-color
:
#FFE319
;
}
}
\ No newline at end of file
src/components/activity/newyear-2019/myTreasure/index.js
View file @
bbc0cecd
import
React
,
{
Component
}
from
'react'
;
import
{
HeaderBar
}
from
'@common'
;
import
{
HeaderBar
,
Popup
}
from
'@common'
;
import
AddressPopup
from
'@common/addressPopup/index'
;
import
TreasureTeam
from
'./team'
;
import
{
http
}
from
'@/utils'
;
import
'./index.scss'
;
...
...
@@ -23,6 +24,29 @@ class MyTreasure extends Component {
}
this
.
fetchMyTreasure
();
this
.
fetchActivityStatus
();
// 绑定地址--宝箱
}
handleToBindPhone
=
()
=>
{
}
handleToBindAddress
=
()
=>
{
this
.
addressInstance
=
Popup
({
title
:
'收货信息'
,
skip
:
'year'
,
content
:
<
AddressPopup
skip
=
"year"
tip
=
{
<>
<
p
className
=
"address-treasure__desc"
>
恭喜您获得
奖品名称奖品名称奖品名称
<
/p
>
<
p
className
=
"address-treasure__notice"
>
请及时填写
/
确认收货信息,活动结束后统一邮寄
<
/p
>
<
/
>
}
handleToHide
=
{()
=>
this
.
addressInstance
.
close
()}
/
>
});
}
fetchMyTreasure
=
()
=>
{
...
...
@@ -32,15 +56,10 @@ class MyTreasure extends Component {
this
.
rule
=
data
.
rule
;
if
(
Array
.
isArray
(
data
.
team
)
&&
data
.
team
.
length
>
0
)
{
const
teams
=
data
.
team
.
map
(
item
=>
{
console
.
log
(
item
);
if
(
item
)
{
return
Object
.
assign
({},
item
,
{
members
:
item
.
member
});
}
return
{};
return
Object
.
assign
({},
item
,
{
members
:
item
.
member
});
});
console
.
log
(
teams
);
this
.
setState
({
isEmpty
:
false
,
teams
,
...
...
@@ -110,13 +129,17 @@ class MyTreasure extends Component {
{
(
!
isEnd
&&
!
isEmpty
)
&&
<
div
className
=
"treasure-content"
>
{
JSON
.
stringify
(
teams
)}
{
teams
.
map
((
item
,
index
)
=>
(
<
TreasureTeam
data
=
{
item
}
key
=
{
index
}
/
>
<
TreasureTeam
data
=
{
item
}
key
=
{
index
}
handleToBindPhone
=
{
this
.
handleToBindPhone
}
handleToBindAddress
=
{
this
.
handleToBindAddress
}
/
>
))
}
<
TreasureTeam
data
=
{{
{
/*
<TreasureTeam data={{
is_captain: 0,
status: 1,
is_open: 1,
...
...
@@ -136,7 +159,7 @@ class MyTreasure extends Component {
prize_name:"带份饭问"
}
]
}}
><
/TreasureTeam
>
}}></TreasureTeam>
*/
}
<
/div
>
}
<
/div
>
...
...
src/components/activity/newyear-2019/myTreasure/index.scss
View file @
bbc0cecd
...
...
@@ -47,4 +47,19 @@
color
:
#090909
;
background-color
:
#FFE319
;
}
}
// 地址弹窗--宝箱
.address-treasure__desc
{
margin
:
10px
0
0
;
font-size
:
14px
;
color
:
#666
;
line-height
:
1
;
}
.address-treasure__notice
{
margin
:
10px
0
16px
;
font-size
:
12px
;
color
:
#FF2121
;
line-height
:
1
;
}
\ No newline at end of file
src/components/activity/newyear-2019/myTreasure/team.js
View file @
bbc0cecd
import
React
,
{
Component
}
from
'react'
;
import
classnames
from
'classnames'
;
import
{
withRouter
,
Link
}
from
'react-router-dom'
;
import
{
http
}
from
'@/utils'
;
import
{
Popup
}
from
'@common'
;
import
SplitSuccess
from
'./../common/splitSuccess/index'
;
import
'./team.scss'
;
class
TreasureTeam
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
team
:
[]
,
team
:
{}
,
currentMember
:
{}
};
}
...
...
@@ -15,6 +19,14 @@ class TreasureTeam extends Component {
this
.
initMemberInfo
();
}
handleToInvite
=
()
=>
{
const
{
history
}
=
this
.
props
;
history
.
push
(
'/activity/newyear-2019/landing'
);
if
(
this
.
splitInstance
)
{
this
.
splitInstance
.
close
();
}
}
initMemberInfo
=
()
=>
{
const
{
data
}
=
this
.
props
;
let
members
=
data
.
members
;
...
...
@@ -36,7 +48,7 @@ class TreasureTeam extends Component {
return
classnames
(
'team-member__item'
,
{
'active'
:
id
===
currentMember
.
uid
&&
is_open
===
1
,
'active'
:
id
===
currentMember
.
uid
&&
is_open
,
}
);
}
...
...
@@ -59,7 +71,28 @@ class TreasureTeam extends Component {
}
toSplitTreasure
=
()
=>
{
const
{
handleToBindPhone
,
handleToBindAddress
}
=
this
.
props
;
const
{
team
:
{
captain_uid
,
team_num
}
}
=
this
.
state
;
http
.
post
(
`
${
API
.
home
}
/sys/split_treasure`
,
{
team_num
:
team_num
,
owner_uid
:
captain_uid
}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
;
if
(
code
===
200
)
{
// 拆宝箱弹窗--成功
this
.
splitInstance
=
Popup
({
title
:
'恭喜你获得'
,
skip
:
'year'
,
content
:
<
SplitSuccess
handleToInvite
=
{
this
.
handleToInvite
}
/
>
});
}
else
if
(
code
===
12000
)
{
// 绑定手机号
handleToBindPhone
();
}
else
if
(
code
===
12001
)
{
// 绑定地址
handleToBindAddress
();
}
});
}
render
()
{
...
...
@@ -83,7 +116,7 @@ class TreasureTeam extends Component {
return
(
<
div
className
=
"team-container"
data
-
skip
=
"team"
>
{
is_captain
===
0
&&
!
is_captain
&&
<
i
className
=
"team-friend"
>
友
<
/i
>
}
...
...
@@ -93,7 +126,14 @@ class TreasureTeam extends Component {
?
<
i
className
=
"team-status"
>
组队中
..
<
/i
>
:
<
i
className
=
"team-decorate"
><
/i
>
}
<
h2
className
=
"team-title"
>
{
team_num
}
号队伍
<
/h2
>
{
/* 队伍类型 */
}
{
is_captain
?
<
h2
className
=
"team-title"
>
{
team_num
}
号队伍
<
/h2
>
:
<
h2
className
=
"team-title"
>
好友队伍
<
/h2
>
}
{
/* 队员情况 */
}
{
...
...
@@ -111,39 +151,39 @@ class TreasureTeam extends Component {
style
=
{
this
.
computedBg
(
item
.
head_img
)}
>
{
item
.
is_captain
===
1
&&
item
.
is_captain
&&
<
span
className
=
"team-member__captain"
>
队长
<
/span
>
}
<
/div
>
))
}
<
/div
>
<
div
className
=
"team-footer"
data
-
layout
=
{
is_open
===
1
?
'column'
:
'row'
}
>
<
div
className
=
"team-footer"
data
-
layout
=
{
is_open
?
'column'
:
'row'
}
>
{
/* 队伍未满 */
}
{
status
===
0
&&
status
===
1
&&
<>
{
is_captain
===
1
?
<
button
className
=
"team-button"
onClick
=
"$emit('to-invite-team')"
>
继续邀请队友
<
/button
>
:
<
button
className
=
"team-button"
onClick
=
"$emit('to-help-team')"
>
帮好友完成组队
<
/button
>
is_captain
?
<
Link
className
=
"team-button"
to
=
"/activity/newyear-2019/landing"
>
继续邀请队友
<
/Link
>
:
<
Link
className
=
"team-button"
to
=
"/activity/newyear-2019/landing"
>
帮好友完成组队
<
/Link
>
}
<
/
>
}
{
/* 可拆状态 */
}
{
(
status
===
1
&&
is_open
===
0
)
&&
(
status
===
2
&&
!
is_open
)
&&
<>
<
span
className
=
"team-icon"
data
-
direction
=
"left"
><
/span
>
<
span
className
=
"team-button--split"
onClick
=
{
()
=>
this
.
toSplitTreasure
(
id
)
}
><
/span
>
<
span
className
=
"team-button--split"
onClick
=
{
this
.
toSplitTreasure
}
><
/span
>
<
span
className
=
"team-icon"
data
-
direction
=
"right"
><
/span
>
<
/
>
}
{
/* 已拆状态 */
}
{
(
status
===
1
&&
is_open
===
1
)
&&
(
status
===
2
&&
is_open
)
&&
<>
<
p
className
=
"team-prize"
>
{
prize_name
}
<
/p
>
...
...
@@ -232,4 +272,4 @@ class TreasureTeam extends Component {
}
}
export
default
TreasureTeam
;
\ No newline at end of file
export
default
withRouter
(
TreasureTeam
);
\ No newline at end of file
src/components/activity/newyear-2019/myTreasure/team.scss
View file @
bbc0cecd
...
...
@@ -144,6 +144,8 @@
box-sizing
:
border-box
;
font-size
:
16px
;
color
:
#090909
;
text-align
:
center
;
line-height
:
44px
;
background-color
:
#FFE319
;
}
...
...
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
View file @
bbc0cecd
...
...
@@ -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 @
bbc0cecd
...
...
@@ -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 @
bbc0cecd
...
...
@@ -8,7 +8,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'
}
// 关闭弹框
...
...
@@ -19,12 +20,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
&&
...
...
@@ -55,7 +67,6 @@ export default class index extends Component {
<
/div
>
<
/CommonPopup
>
}
<
/div
>
)
}
...
...
src/components/activity/newyear-2019/preheat/index.scss
View file @
bbc0cecd
...
...
@@ -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 @
bbc0cecd
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 @
bbc0cecd
...
...
@@ -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 @
bbc0cecd
...
...
@@ -6,12 +6,10 @@ import TeamInfo from './team'
class
TreasureBox
extends
Component
{
render
()
{
return
(
<
div
>
<
CommonContainer
>
<
TeamInfo
/>
<
TreasureRank
/>
<
/CommonContainer
>
<
/div
>
<
CommonContainer
id
=
"year-treasure"
>
<
TeamInfo
/>
<
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