Commit 12e8316c by zhanghaozhe

Merge branch '2020-717-formal' into dev

parents b40a7f90 51215669
...@@ -1194,6 +1194,10 @@ ...@@ -1194,6 +1194,10 @@
} }
.members { .members {
ul{
max-height: 230px;
overflow: auto;
}
li { li {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -8,6 +8,7 @@ import { Toast } from "antd-mobile"; ...@@ -8,6 +8,7 @@ import { Toast } from "antd-mobile";
import { CopyToClipboard } from "react-copy-to-clipboard"; import { CopyToClipboard } from "react-copy-to-clipboard";
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import storage from 'store2' import storage from 'store2'
import { CaptchaAli } from "@common/index"
class Invitation extends Component { class Invitation extends Component {
...@@ -21,6 +22,8 @@ class Invitation extends Component { ...@@ -21,6 +22,8 @@ class Invitation extends Component {
isTeamHead: true, isTeamHead: true,
isMaster: !getParam('team_code'), isMaster: !getParam('team_code'),
isActivityEnd: false, isActivityEnd: false,
instance: null,
isShowCaptcha: false,
} }
componentDidMount() { componentDidMount() {
...@@ -90,7 +93,7 @@ class Invitation extends Component { ...@@ -90,7 +93,7 @@ class Invitation extends Component {
}) })
} }
joinTeam = () => { joinTeam = data => {
const {user, history} = this.props const {user, history} = this.props
if (user.hasError) { if (user.hasError) {
if (browser.isWeixin) { if (browser.isWeixin) {
...@@ -100,19 +103,29 @@ class Invitation extends Component { ...@@ -100,19 +103,29 @@ class Invitation extends Component {
} }
return return
} }
http.post(`${API.home}/activity/anniversary/joinTeam`, { if (this.state.teamInfo.is_check && !this.state.isShowCaptcha) {
team_code: getParam('team_code'), 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 => { .then(res => {
const {code, msg} = res.data const {code, msg} = res.data
if (code === 200) { if (code === 200) {
Toast.info('加入成功', 2, null, false) Toast.info('加入成功', 2, null, false)
this.setState((state, props) => { this.setState((state, props) => {
return { 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) { } else if (code === 25015) {
this.setState({ this.setState({
isActivityEnd: true, isActivityEnd: true,
...@@ -142,11 +155,22 @@ class Invitation extends Component { ...@@ -142,11 +155,22 @@ class Invitation extends Component {
} }
render() { render() {
const {prizes, invitationInfo, isShowGuide, teamInfo, isMaster, isActivityEnd} = this.state const {prizes, invitationInfo, isShowGuide, teamInfo, isMaster, isActivityEnd, isShowCaptcha} = this.state
const {location} = this.props const {location} = this.props
return ( return (
<div id={'invitation'}> 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={() => { <HeaderBar title={'答题抽奖'} arrow={true} goBack={() => {
this.props.history.push('/anniversary_2020') this.props.history.push('/anniversary_2020')
}}/> }}/>
...@@ -220,7 +244,6 @@ class Invitation extends Component { ...@@ -220,7 +244,6 @@ class Invitation extends Component {
</> </>
} }
</div> </div>
</div> </div>
); );
} }
......
...@@ -93,6 +93,7 @@ class Question extends Component { ...@@ -93,6 +93,7 @@ class Question extends Component {
resultFun = (e) => { resultFun = (e) => {
const {history} = this.props const {history} = this.props
let notNeedSign = e.target.getAttribute('data-sign') == 0 let notNeedSign = e.target.getAttribute('data-sign') == 0
console.log(notNeedSign)
if (this.state.is_sign || notNeedSign) { if (this.state.is_sign || notNeedSign) {
history.push('/anniversary_2020#lottery') history.push('/anniversary_2020#lottery')
} else { } else {
...@@ -256,7 +257,7 @@ function ResultConfirm({resultFun, is_correct, is_sign, close}) { ...@@ -256,7 +257,7 @@ function ResultConfirm({resultFun, is_correct, is_sign, close}) {
} }
<div className={'btm-button'}> <div className={'btm-button'}>
<button onClick={resultFun}> <button onClick={resultFun} data-sign={(is_correct || is_sign) && 0}>
{ {
is_correct ? '去抽奖' : is_sign ? '去抽奖' : '签到领取抽奖机会' is_correct ? '去抽奖' : is_sign ? '去抽奖' : '签到领取抽奖机会'
} }
......
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
background-color: rgba(0, 0, 0, .6); background-color: rgba(0, 0, 0, .6);
z-index: 200; z-index: 200;
.close{ .close {
position: absolute; position: absolute;
bottom: -54px; bottom: -54px;
left: 50%; left: 50%;
...@@ -271,3 +271,8 @@ ...@@ -271,3 +271,8 @@
} }
} }
} }
.captcha-container{
padding: 40vh 30px;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment