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
952637ae
Commit
952637ae
authored
Dec 13, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分享页
parent
926d7be2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
48 deletions
+62
-48
src/components/activity/newyear-2019/landing/index.js
+62
-48
No files found.
src/components/activity/newyear-2019/landing/index.js
View file @
952637ae
...
...
@@ -34,6 +34,7 @@ class Landing extends Component {
componentDidMount
()
{
this
.
fetchPageData
()
this
.
getFollowStatus
()
}
componentDidUpdate
(
prevProps
)
{
...
...
@@ -118,7 +119,7 @@ class Landing extends Component {
})
}
joinSuccess
=
({
id
,
status
,
my_team
:
{
team_num
,
lack_member
,
is_team
}})
=>
{
joinSuccess
=
({
id
,
status
,
my_team
:
{
team_num
,
lack_member
,
is_team
,
treasure_code
}})
=>
{
const
{
history
}
=
this
.
props
this
.
joinSuccessPopup
=
Popup
({
title
:
<
div
className
=
{
'join-success'
}
>
...
...
@@ -132,7 +133,7 @@ class Landing extends Component {
status
===
2
?
'组队成功,恭喜你获得一个宝箱!'
:
is_team
?
`您的
${
<
span
>
{
team_num
}
<
/span>}号队伍还差${<span>{lack_member}</
span
>
}
人即可获得宝箱`
?
<>
您的
{
<
span
>
{
team_num
}
<
/span>}号队伍还差{<span>{lack_member}</
span
>
}
人即可获得宝箱
<
/
>
:
'自己当队长,宝箱内有专属奖品哦~'
}
<
/div
>
...
...
@@ -147,18 +148,22 @@ class Landing extends Component {
/
>
:
is_team
?
<
button
type
=
'button'
onClick
=
{
this
.
inviteMembers
.
bind
(
this
,
t
his
.
state
.
teamData
[
'my_team'
][
'treasure_code'
]
)}
>
继续组队
<
/button
>
onClick
=
{
this
.
inviteMembers
.
bind
(
this
,
t
reasure_code
)}
>
继续组队
<
/button
>
:
<
button
type
=
"button"
onClick
=
{
this
.
createMyTeam
}
>
创建我的队伍
<
/button
>
}
<
/div>
,
closeIcon
:
this
.
closeIcon
,
close
:
()
=>
{
this
.
fetchPageData
()
this
.
getFollowStatus
()
.
then
(
isFollow
=>
{
!
isFollow
&&
this
.
remind
(
'join'
,
getParam
(
'treasure_code'
))
})
}
})
}
inviteMembers
=
(
treasure_code
)
=>
{
inviteMembers
=
treasure_code
=>
{
const
{
history
,
match
,
user
,
location
}
=
this
.
props
if
(
browser
.
isWeixin
)
{
wxShare
({
...
...
@@ -171,53 +176,59 @@ class Landing extends Component {
sessionStorage
.
setItem
(
'showShareTip'
,
'1'
)
history
.
replace
(
`
${
match
.
path
}
?treasure_code=
${
treasure_code
}
&origin=
${
1
}
`
)
this
.
createTeamSuccessPopup
&&
this
.
createTeamSuccessPopup
.
remove
()
&&
(
this
.
createTeamSuccessPopup
=
null
)
this
.
joinSuccessPopup
&&
this
.
joinSuccessPopup
.
remove
()
&&
(
this
.
joinSuccessPopup
=
null
)
this
.
fetchPageData
({
treasure_code
,
origin
:
1
})
this
.
setState
({
isCaptain
:
true
})
}
getFollowStatus
=
()
=>
http
.
get
(
`
${
API
.
home
}
/sys/user/isFollowWeChat`
)
.
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
return
code
===
200
&&
data
[
'is_follow'
]
})
createTeamSuccess
=
(
member
,
team_num
,
lack_member
,
treasure_code
)
=>
{
let
isFollow
=
false
this
.
joinSuccessPopup
&&
this
.
joinSuccessPopup
.
remove
()
&&
(
this
.
joinSuccessPopup
=
null
)
http
.
get
(
`
${
API
.
home
}
/sys/user/isFollowWeChat`
)
.
then
(
res
=>
{
const
{
errno
,
status
}
=
res
.
data
if
(
errno
===
0
&&
status
===
1
)
{
isFollow
=
true
}
})
this
.
createTeamSuccessPopup
=
Popup
({
title
:
'创建成功'
,
className
:
'landing-create-success'
,
content
:
<
div
>
<
div
className
=
"tip"
>
{
<
span
>
{
team_num
}
<
/span>}号队伍 还差{<span>{lack_member}</
span
>
}
名队员即可获得宝箱哦
~<
/div
>
<
img
className
=
{
'treasure-box'
}
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/treasure-box-icon.png"
alt
=
""
/>
<
ul
className
=
'members'
>
{
new
Array
(
5
).
fill
(
'a'
).
map
((
item
,
index
)
=>
{
const
_member
=
member
[
index
]
return
<
li
key
=
{
index
}
>
{
_member
&&
_member
[
'is_captain'
]
&&
<
sup
>
队长
<
/sup>
}
<
img
className
=
{
'avatar'
}
src
=
{
_member
?
_member
[
'head_img'
]
:
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/not-joined-placeholder.png"
}
alt
=
""
/>
<
/li
>
})
this
.
getFollowStatus
()
.
then
(
isFollow
=>
{
this
.
createTeamSuccessPopup
=
Popup
({
title
:
'创建成功'
,
className
:
'landing-create-success'
,
content
:
<
div
>
<
div
className
=
"tip"
>
{
<
span
>
{
team_num
}
<
/span>}号队伍 还差{<span>{lack_member}</
span
>
}
名队员即可获得宝箱哦
~<
/div
>
<
img
className
=
{
'treasure-box'
}
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/treasure-box-icon.png"
alt
=
""
/>
<
ul
className
=
'members'
>
{
new
Array
(
5
).
fill
(
'a'
).
map
((
item
,
index
)
=>
{
const
_member
=
member
[
index
]
return
<
li
key
=
{
index
}
>
{
_member
&&
_member
[
'is_captain'
]
&&
<
sup
>
队长
<
/sup>
}
<
img
className
=
{
'avatar'
}
src
=
{
_member
?
_member
[
'head_img'
]
:
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/not-joined-placeholder.png"
}
alt
=
""
/>
<
/li
>
})
}
<
/ul
>
<
button
type
=
{
'button'
}
onClick
=
{
this
.
inviteMembers
.
bind
(
this
,
treasure_code
)}
>
邀请好友加入队伍
<
/button
>
<
/div>
,
closeIcon
:
this
.
closeIcon
,
afterClose
:
()
=>
{
if
(
!
isFollow
)
{
this
.
remind
(
'create'
,
treasure_code
)
}
}
<
/ul
>
<
button
type
=
{
'button'
}
onClick
=
{
this
.
inviteMembers
.
bind
(
this
,
treasure_code
)}
>
邀请好友加入队伍
<
/button
>
<
/div>
,
closeIcon
:
this
.
closeIcon
,
afterClose
:
()
=>
{
if
(
!
isFollow
)
{
this
.
remind
(
'create'
,
treasure_code
)
}
}
})
})
})
}
remind
=
(
type
=
'create'
,
treasure_code
)
=>
{
...
...
@@ -239,7 +250,7 @@ class Landing extends Component {
<
div
className
=
"des"
>
长按识别
/
扫码
关注【七月在线】服务号即可预约
<
/div
>
<
/div>
,
close
:
()
=>
{
history
.
replace
(
`
${
match
.
path
}
?treasure_code=
${
treasure_code
}
&origin=1`
)
//
history.replace(`${match.path}?treasure_code=${treasure_code}&origin=1`)
this
.
fetchPageData
({
treasure_code
,
origin
:
'1'
...
...
@@ -290,7 +301,10 @@ class Landing extends Component {
closable
:
false
,
close
:
()
=>
{
sessionStorage
.
removeItem
(
'showShareTip'
)
this
.
remind
()
this
.
getFollowStatus
()
.
then
(
isFollow
=>
{
!
isFollow
&&
this
.
remind
(
'create'
,
getParam
(
'treasure_code'
))
})
}
})
}
...
...
@@ -473,7 +487,7 @@ class Landing extends Component {
<
/button
>
}
{
prize_info
&&
!
activityEnd
&&
!
isCaptain
&&
<
div
className
=
"certainly-prompt"
>
prize_info
&&
prize_info
.
length
!==
0
&&
!
activityEnd
&&
!
isCaptain
&&
<
div
className
=
"certainly-prompt"
>
第
{
prize_info
[
0
].
stage_no
}
次必中
{
prize_info
[
0
].
name
}
<
/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