Commit 1ffa718e by zhanghaozhe

周年庆

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