Commit 17f16952 by wangshuo

teaminfo接口修改

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