Commit 17f16952 by wangshuo

teaminfo接口修改

parent 18a5f283
......@@ -3,16 +3,15 @@ import './team.scss'
import { getParam, http, SendMessageToApp, browser } from "@/utils"
import { Toast } from 'antd-mobile';
import {withRouter} from 'react-router-dom';
import {compose} from "redux"
import { connect } from "react-redux";
class TeamInfo extends Component {
constructor(props) {
super(props);
this.state = {
is_my_team: true, // 是否有自己的队伍
prize_info: {
name: '',
stage_no: 0,
},
prize_info: [],
info: {
removable: 0,
total: 0
......@@ -47,19 +46,28 @@ class TeamInfo extends Component {
// 跳转到我的宝箱页
toYearTreasure = (close) => {
let search = '';
if(close) {
const {removable_data} = this.state;
let current = removable_data[0];
search = `?team_num=${current.team_num}&owner_uid=${current.captain_uid}`;
if(this.props.user.hasError) {
this.props.history.push('/passport/login');
} else {
let search = '';
if(close) {
const {removable_data} = this.state;
let current = removable_data[0];
search = `?team_num=${current.team_num}&owner_uid=${current.captain_uid}`;
}
this.props.history.push(`/year/yearTreasure${search}`);
}
this.props.history.push(`/year/yearTreasure${search}`);
}
// 邀请好友组队
createTeam = () => {
// TODO 跳转到邀请落地页
this.props.history.push('/activity/newyear-2019/landing')
if(this.props.user.hasError) {
this.props.history.push('/passport/login');
} else {
// TODO 跳转到邀请落地页需要什么参数
this.props.history.push('/activity/newyear-2019/landing')
}
}
// 队伍成员信息必须满五个 不满的需要填充
......@@ -76,7 +84,12 @@ class TeamInfo extends Component {
}
render() {
const { prize_info: { name, stage_no }, is_my_team, info: {removable, total}, member } = this.state;
const { prize_info, is_my_team, info: {removable, total}, member } = this.state;
let name = '', stage_no = 0;
if(prize_info.length > 0) {
name = prize_info[0].name;
stage_no = prize_info[0].stage_no;
}
// 显示文案控制
let Text = '';
if(total === 0) {
......@@ -136,10 +149,16 @@ class TeamInfo extends Component {
}
</div>
{
stage_no && name && <p className='stage_prize'>{`第${stage_no}次必中${name}`}</p>
stage_no > 0 && name && <p className='stage_prize'>{`第${stage_no}次必中${name}`}</p>
}
</div>
)
}
}
export default withRouter(TeamInfo)
export default compose(
connect(
state => ({user: state.user}),
null
),
withRouter
)(TeamInfo)
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