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
12e8316c
Commit
12e8316c
authored
Jul 13, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2020-717-formal' into dev
parents
b40a7f90
51215669
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
78 deletions
+112
-78
src/components/activity/2020-717/activity/index.scss
+4
-0
src/components/activity/2020-717/invitation/index.js
+99
-76
src/components/activity/2020-717/question/index.js
+2
-1
src/components/activity/2020-717/question/index.scss
+7
-1
No files found.
src/components/activity/2020-717/activity/index.scss
View file @
12e8316c
...
...
@@ -1194,6 +1194,10 @@
}
.members
{
ul
{
max-height
:
230px
;
overflow
:
auto
;
}
li
{
display
:
flex
;
align-items
:
center
;
...
...
src/components/activity/2020-717/invitation/index.js
View file @
12e8316c
...
...
@@ -8,6 +8,7 @@ import { Toast } from "antd-mobile";
import
{
CopyToClipboard
}
from
"react-copy-to-clipboard"
;
import
{
Link
}
from
'react-router-dom'
import
storage
from
'store2'
import
{
CaptchaAli
}
from
"@common/index"
class
Invitation
extends
Component
{
...
...
@@ -21,6 +22,8 @@ class Invitation extends Component {
isTeamHead
:
true
,
isMaster
:
!
getParam
(
'team_code'
),
isActivityEnd
:
false
,
instance
:
null
,
isShowCaptcha
:
false
,
}
componentDidMount
()
{
...
...
@@ -90,7 +93,7 @@ class Invitation extends Component {
})
}
joinTeam
=
()
=>
{
joinTeam
=
data
=>
{
const
{
user
,
history
}
=
this
.
props
if
(
user
.
hasError
)
{
if
(
browser
.
isWeixin
)
{
...
...
@@ -100,19 +103,29 @@ class Invitation extends Component {
}
return
}
http
.
post
(
`
${
API
.
home
}
/activity/anniversary/joinTeam`
,
{
team_code
:
getParam
(
'team_code'
),
})
if
(
this
.
state
.
teamInfo
.
is_check
&&
!
this
.
state
.
isShowCaptcha
)
{
this
.
setState
({
isShowCaptcha
:
true
,
});
return
}
let
_data
=
{
team_code
:
getParam
(
'team_code'
)}
if
(
data
)
{
_data
=
{...
_data
,
...
data
}
}
http
.
post
(
`
${
API
.
home
}
/activity/anniversary/joinTeam`
,
_data
)
.
then
(
res
=>
{
const
{
code
,
msg
}
=
res
.
data
if
(
code
===
200
)
{
Toast
.
info
(
'加入成功'
,
2
,
null
,
false
)
this
.
setState
((
state
,
props
)
=>
{
return
{
teamInfo
:
{...
state
.
teamInfo
,
...{
status
:
2
}},
teamInfo
:
{...
state
.
teamInfo
,
...{
status
:
2
,
is_check
:
false
}},
isShowCaptcha
:
false
}
});
}
else
if
(
code
===
5002
)
{
this
.
state
.
instance
&&
this
.
state
.
instance
.
reset
()
}
else
if
(
code
===
25015
)
{
this
.
setState
({
isActivityEnd
:
true
,
...
...
@@ -142,86 +155,96 @@ class Invitation extends Component {
}
render
()
{
const
{
prizes
,
invitationInfo
,
isShowGuide
,
teamInfo
,
isMaster
,
isActivityEnd
}
=
this
.
state
const
{
prizes
,
invitationInfo
,
isShowGuide
,
teamInfo
,
isMaster
,
isActivityEnd
,
isShowCaptcha
}
=
this
.
state
const
{
location
}
=
this
.
props
return
(
<
div
id
=
{
'invitation'
}
>
<
HeaderBar
title
=
{
'答题抽奖'
}
arrow
=
{
true
}
goBack
=
{()
=>
{
this
.
props
.
history
.
push
(
'/anniversary_2020'
)
}}
/
>
{
isMaster
?
<
div
className
=
"banner"
><
/div
>
:
<
div
className
=
"team-head"
>
<
img
src
=
{
teamInfo
.
avatar_file
}
alt
=
""
/>
<
div
className
=
"username"
>
{
teamInfo
.
user_name
}
<
/div
>
<
div
>
加入我的队伍,一起答题抽大奖
<
/div
>
<
/div
>
}
isShowCaptcha
?
<
div
className
=
{
'captcha-container'
}
>
<
CaptchaAli
getInstance
=
{
instance
=>
{
this
.
setState
({
instance
,
});
}}
onVerify
=
{
data
=>
this
.
joinTeam
(
data
)}
/
>
<
/div
>
:
<
div
id
=
{
'invitation'
}
>
<
HeaderBar
title
=
{
'答题抽奖'
}
arrow
=
{
true
}
goBack
=
{()
=>
{
this
.
props
.
history
.
push
(
'/anniversary_2020'
)
}}
/
>
{
isMaster
?
<
div
className
=
"banner"
><
/div
>
:
<
div
className
=
"team-head"
>
<
img
src
=
{
teamInfo
.
avatar_file
}
alt
=
""
/>
<
div
className
=
"username"
>
{
teamInfo
.
user_name
}
<
/div
>
<
div
>
加入我的队伍,一起答题抽大奖
<
/div
>
<
/div
>
}
<
div
className
=
"prize-container"
>
<
div
className
=
{
'h-bar'
}
><
/div
>
<
div
className
=
{
'h-bar'
}
><
/div
>
<
div
className
=
{
'v-bar'
}
><
/div
>
<
div
className
=
{
'v-bar'
}
><
/div
>
<
ul
className
=
"prizes"
>
<
div
className
=
"prize-container"
>
<
div
className
=
{
'h-bar'
}
><
/div
>
<
div
className
=
{
'h-bar'
}
><
/div
>
<
div
className
=
{
'v-bar'
}
><
/div
>
<
div
className
=
{
'v-bar'
}
><
/div
>
<
ul
className
=
"prizes"
>
{
!!
prizes
.
length
&&
prizes
.
map
((
item
,
index
)
=>
{
return
<
li
key
=
{
index
}
className
=
{
index
===
4
?
'empty'
:
''
}
>
{
index
===
4
?
<
div
>
答题抽奖
<
/div
>
:
<
div
className
=
{
'prize'
}
><
img
src
=
{
item
.
img_name
}
alt
=
""
/><
/div
>
}
<
/li
>
})
}
<
/ul
>
<
/div
>
{
isShowGuide
&&
<
div
className
=
"guide"
onClick
=
{()
=>
{
this
.
setState
({
isShowGuide
:
false
,
});
}}
>
<
i
className
=
{
'indicator'
}
><
/i
>
<
div
className
=
"tip"
>
点击右上角,分享给好友
<
/div
>
<
/div
>
}
<
div
className
=
"op"
>
{
!!
prizes
.
length
&&
prizes
.
map
((
item
,
index
)
=>
{
return
<
li
key
=
{
index
}
className
=
{
index
===
4
?
'empty'
:
''
}
>
isMaster
?
<>
<
div
className
=
"tip"
>
再有
{
invitationInfo
.
invite_num
}
位队员答对即可获得
{
invitationInfo
.
draw_chance
}
次抽奖机会
<
/div
>
{
index
===
4
?
<
div
>
答题抽奖
<
/div
>
:
<
div
className
=
{
'prize'
}
><
img
src
=
{
item
.
img_name
}
alt
=
""
/><
/div
>
browser
.
isWeixin
?
<
button
className
=
{
'btn'
}
onClick
=
{
this
.
setupWechatShare
}
>
立即邀请
<
/button
>
:
<
CopyToClipboard
text
=
{
`
${
API
.
m
}${
location
.
pathname
}
?team_code=
${
invitationInfo
.
team_code
||
getParam
(
'team_code'
)}
`
}
onCopy
=
{()
=>
{
Toast
.
info
(
'链接已复制,快去粘贴发给好友吧'
)
}}
>
<
button
className
=
{
'btn'
}
>
立即邀请
<
/button
>
<
/CopyToClipboard
>
}
<
/li
>
})
<
/
>
:
<>
{
teamInfo
.
status
!==
1
&&
<
div
className
=
{
'tip'
}
>
{
teamInfo
.
status
===
2
?
'已加入当前队伍'
:
teamInfo
.
status
===
3
?
'已加入其他队伍'
:
null
}
<
/div
>
}
<
BottomButton
isActivityEnd
=
{
isActivityEnd
}
joinTeam
=
{
this
.
joinTeam
}
status
=
{
teamInfo
.
status
}
drawQuestions
=
{
this
.
drawQuestions
}
isAnswered
=
{
teamInfo
.
is_answer
}
/
>
<
/
>
}
<
/ul
>
<
/div
>
{
isShowGuide
&&
<
div
className
=
"guide"
onClick
=
{()
=>
{
this
.
setState
({
isShowGuide
:
false
,
});
}}
>
<
i
className
=
{
'indicator'
}
><
/i
>
<
div
className
=
"tip"
>
点击右上角,分享给好友
<
/div
>
<
/div
>
}
<
div
className
=
"op"
>
{
isMaster
?
<>
<
div
className
=
"tip"
>
再有
{
invitationInfo
.
invite_num
}
位队员答对即可获得
{
invitationInfo
.
draw_chance
}
次抽奖机会
<
/div
>
{
browser
.
isWeixin
?
<
button
className
=
{
'btn'
}
onClick
=
{
this
.
setupWechatShare
}
>
立即邀请
<
/button
>
:
<
CopyToClipboard
text
=
{
`
${
API
.
m
}${
location
.
pathname
}
?team_code=
${
invitationInfo
.
team_code
||
getParam
(
'team_code'
)}
`
}
onCopy
=
{()
=>
{
Toast
.
info
(
'链接已复制,快去粘贴发给好友吧'
)
}}
>
<
button
className
=
{
'btn'
}
>
立即邀请
<
/button
>
<
/CopyToClipboard
>
}
<
/
>
:
<>
{
teamInfo
.
status
!==
1
&&
<
div
className
=
{
'tip'
}
>
{
teamInfo
.
status
===
2
?
'已加入当前队伍'
:
teamInfo
.
status
===
3
?
'已加入其他队伍'
:
null
}
<
/div
>
}
<
BottomButton
isActivityEnd
=
{
isActivityEnd
}
joinTeam
=
{
this
.
joinTeam
}
status
=
{
teamInfo
.
status
}
drawQuestions
=
{
this
.
drawQuestions
}
isAnswered
=
{
teamInfo
.
is_answer
}
/
>
<
/
>
}
<
/div
>
<
/div
>
);
}
}
...
...
src/components/activity/2020-717/question/index.js
View file @
12e8316c
...
...
@@ -93,6 +93,7 @@ class Question extends Component {
resultFun
=
(
e
)
=>
{
const
{
history
}
=
this
.
props
let
notNeedSign
=
e
.
target
.
getAttribute
(
'data-sign'
)
==
0
console
.
log
(
notNeedSign
)
if
(
this
.
state
.
is_sign
||
notNeedSign
)
{
history
.
push
(
'/anniversary_2020#lottery'
)
}
else
{
...
...
@@ -256,7 +257,7 @@ function ResultConfirm({resultFun, is_correct, is_sign, close}) {
}
<
div
className
=
{
'btm-button'
}
>
<
button
onClick
=
{
resultFun
}
>
<
button
onClick
=
{
resultFun
}
data
-
sign
=
{(
is_correct
||
is_sign
)
&&
0
}
>
{
is_correct
?
'去抽奖'
:
is_sign
?
'去抽奖'
:
'签到领取抽奖机会'
}
...
...
src/components/activity/2020-717/question/index.scss
View file @
12e8316c
...
...
@@ -185,7 +185,7 @@
background-color
:
rgba
(
0
,
0
,
0
,
.6
);
z-index
:
200
;
.close
{
.close
{
position
:
absolute
;
bottom
:
-54px
;
left
:
50%
;
...
...
@@ -270,4 +270,9 @@
}
}
}
}
.captcha-container
{
padding
:
40vh
30px
;
}
\ No newline at end of file
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