Commit 1ffa718e by zhanghaozhe

周年庆

parent 23ae3a76
...@@ -9,6 +9,7 @@ import { Popup } from "@common/index" ...@@ -9,6 +9,7 @@ import { Popup } from "@common/index"
import classnames from 'classnames' import classnames from 'classnames'
import tweenFunctions from 'tween-functions' import tweenFunctions from 'tween-functions'
import storage from 'store2' import storage from 'store2'
import { REDO, addData } from "@components/activity/2020-717/question/store/reducer"
class Anniversary2020 extends Component { class Anniversary2020 extends Component {
...@@ -116,6 +117,7 @@ class Anniversary2020 extends Component { ...@@ -116,6 +117,7 @@ class Anniversary2020 extends Component {
this.getBulletScreenData() this.getBulletScreenData()
this.getRankList() this.getRankList()
this.getStageCourses('zero') this.getStageCourses('zero')
this.props.addData({type: REDO})
if (this.store.session.get('toInvitation') && !this.props.user.hasError) { if (this.store.session.get('toInvitation') && !this.props.user.hasError) {
this.getFollowStaus() this.getFollowStaus()
this.store.session.remove('toInvitation') this.store.session.remove('toInvitation')
...@@ -1251,7 +1253,6 @@ class Anniversary2020 extends Component { ...@@ -1251,7 +1253,6 @@ class Anniversary2020 extends Component {
isShowFollow: false, isShowFollow: false,
}); });
}}></i> }}></i>
</div> </div>
</div> </div>
} }
...@@ -1301,5 +1302,7 @@ function TeamMember({members, close, uid}) { ...@@ -1301,5 +1302,7 @@ function TeamMember({members, close, uid}) {
export default connect( export default connect(
({user}) => ({user}), ({user}) => ({user}),
null, dispatch => ({
addData: data => dispatch(addData(data)),
}),
)(Anniversary2020); )(Anniversary2020);
\ No newline at end of file
import React, { Component } from 'react'; import React, { Component } from 'react';
import './index.scss' import './index.scss'
import { WithFullSize } from "@/HOCs"
import { connect } from "react-redux"; import { connect } from "react-redux";
import { compose } from "redux"; import { compose } from "redux";
import { HeaderBar } from "@common/index" import { HeaderBar } from "@common/index"
...@@ -8,10 +7,11 @@ import { getParam, http, browser, wxShare } from "@/utils" ...@@ -8,10 +7,11 @@ import { getParam, http, browser, wxShare } from "@/utils"
import { Toast } from "antd-mobile"; 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'
class Invitation extends Component { class Invitation extends Component {
store = storage.namespace('anniversary2020')
state = { state = {
prizes: [], prizes: [],
invitationInfo: {}, invitationInfo: {},
...@@ -27,6 +27,7 @@ class Invitation extends Component { ...@@ -27,6 +27,7 @@ class Invitation extends Component {
this.getPrizesInfo() this.getPrizesInfo()
if (getParam('team_code')) { if (getParam('team_code')) {
this.getTeamInfo() this.getTeamInfo()
this.store.session.set('team_code', getParam('team_code'))
} else { } else {
this.getInvitationInfo() this.getInvitationInfo()
} }
...@@ -78,7 +79,7 @@ class Invitation extends Component { ...@@ -78,7 +79,7 @@ class Invitation extends Component {
teamInfo: data, teamInfo: data,
isMaster: data.is_captain || !getParam('team_code'), isMaster: data.is_captain || !getParam('team_code'),
}); });
if(data.is_captain){ if (data.is_captain) {
this.getInvitationInfo() this.getInvitationInfo()
} }
} else { } else {
......
...@@ -8,9 +8,10 @@ import { Link } from "react-router-dom" ...@@ -8,9 +8,10 @@ import { Link } from "react-router-dom"
import { compose } from 'redux' import { compose } from 'redux'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { addData, ADD_RECOMMENDS, ADD_QUESTION, ADD_RESULT, REDO } from './store/reducer' import { addData, ADD_RECOMMENDS, ADD_QUESTION, ADD_RESULT, REDO } from './store/reducer'
import storage from 'store2'
class Question extends Component { class Question extends Component {
store = storage.namespace('anniversary2020')
state = { state = {
question: {}, question: {},
result: {}, result: {},
...@@ -40,6 +41,14 @@ class Question extends Component { ...@@ -40,6 +41,14 @@ class Question extends Component {
type: ADD_QUESTION, type: ADD_QUESTION,
payload: data, payload: data,
}) })
} else if (code === 25004) {
const {history} = this.props
let teamCode = this.store.session.get('team_code')
if (teamCode) {
history.push(`/anniversary_2020/invitation?team_code=${teamCode}`)
} else {
history.push(`/anniversary_2020`)
}
} else { } else {
Toast.info(msg) Toast.info(msg)
} }
...@@ -131,7 +140,7 @@ class Question extends Component { ...@@ -131,7 +140,7 @@ class Question extends Component {
} }
getOptionLabel = (index) => { getOptionLabel = (index) => {
return String.fromCharCode(65 + index) return index >= 0 ? String.fromCharCode(65 + index) : '空'
} }
redo = () => { redo = () => {
...@@ -204,11 +213,9 @@ class Question extends Component { ...@@ -204,11 +213,9 @@ class Question extends Component {
isTeamHead={isTeamHead} isTeamHead={isTeamHead}
isActivityEnd={isActivityEnd} isActivityEnd={isActivityEnd}
submit={() => { submit={() => {
if (this.state.selectedOptionId) { this.setState({
this.setState({ isShowConfirm: true,
isShowConfirm: true, });
})
}
}} }}
redo={this.redo} redo={this.redo}
/> />
...@@ -223,15 +230,20 @@ class Question extends Component { ...@@ -223,15 +230,20 @@ class Question extends Component {
} }
{ {
isResultConfirm && isResultConfirm &&
<ResultConfirm resultFun={this.resultFun} is_correct={this.state.is_correct} <ResultConfirm resultFun={this.resultFun}
is_sign={this.state.is_sign}></ResultConfirm> is_correct={this.state.is_correct}
is_sign={this.state.is_sign}
close={() => {
this.setState({isResultConfirm: false});
}}>
</ResultConfirm>
} }
</div> </div>
) )
} }
} }
function ResultConfirm({resultFun, is_correct, is_sign}) { function ResultConfirm({resultFun, is_correct, is_sign, close}) {
return <div className="modal-cover"> return <div className="modal-cover">
<div className="modal"> <div className="modal">
{ {
...@@ -250,6 +262,7 @@ function ResultConfirm({resultFun, is_correct, is_sign}) { ...@@ -250,6 +262,7 @@ function ResultConfirm({resultFun, is_correct, is_sign}) {
} }
</button> </button>
</div> </div>
<i className="close iconiconfront-2 iconfont" onClick={close}></i>
</div> </div>
</div> </div>
} }
......
...@@ -185,6 +185,15 @@ ...@@ -185,6 +185,15 @@
background-color: rgba(0, 0, 0, .6); background-color: rgba(0, 0, 0, .6);
z-index: 200; z-index: 200;
.close{
position: absolute;
bottom: -54px;
left: 50%;
transform: translateX(-50%);
font-size: 24px;
color: #fff;
}
.modal { .modal {
position: absolute; position: absolute;
top: 50%; top: 50%;
...@@ -193,7 +202,6 @@ ...@@ -193,7 +202,6 @@
width: 300px; width: 300px;
background: #fff; background: #fff;
border-radius: 5px; border-radius: 5px;
overflow: hidden;
} }
.title { .title {
......
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