dev_sync_trustie
杨树林 5 years ago
parent 582fc40632
commit cf59d7fff7

@ -89,15 +89,16 @@ class RegisListviewdata extends React.Component {
</img>
: index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 6 ?
<img className="regitemimgs22" src={pexjiazai}>
</img>
: ""
</div>
: ""
)
})
}

@ -21,6 +21,7 @@ import MessagePersonModal from './competmodal/MessagePersonModal';
import PersonalModalteam from './competmodal/PersonalModalteam';
import PersonalCompetititem from './personal/PersonalCompetititem';
import ExittheteamModel from './competmodal/ExittheteamModel';
import pexjiazai from "./pexjiazai.png";
// 团队竞赛报名无报名
class Registration extends React.Component {
/***
@ -29,6 +30,7 @@ class Registration extends React.Component {
*"enrolled: false, // 是否已经报名
*"teacher_staff": { // 为空表示不支持老师报名
*"member_staff": { // 为空表示不支持学生报名
* personal// 是否是个人赛
* **/
constructor(props) {
super(props)
@ -61,6 +63,8 @@ class Registration extends React.Component {
exitintpermessages: "是否退出战队",
itemid: undefined,
itemiddata: [],
pint: 0,
}
}
@ -119,72 +123,92 @@ class Registration extends React.Component {
page: page,
per_page: per_page,
};
let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`;
let url = `/competitions/${"gcc-task-2019"}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
if (result) {
if (result.data) {
//// //console.log(result);
if (result.data.my_teams.length === 0) {
// 没有创建数据的
if (admin === true) {
//管理员
this.setState({
type: 4,
count: result.data.count,
data: result.data.my_teams,
competition_teams: result.data.competition_teams
})
} else {
//普通账号
this.setState({
type: 1,
count: result.data.count,
data: result.data.my_teams,
competition_teams: result.data.competition_teams
})
}
} else {
//有数据的
if (admin === true) {
if (result.data.my_teams[0].manage_permission === true) {
this.setState({
type: 5,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams
})
} else {
//// //console.log(result);\
if (result.data.personal === false) {
//不是个人赛
if (result.data.my_teams.length === 0) {
// 没有创建数据的
if (admin === true) {
//管理员
this.setState({
type: 4,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams
})
}
} else {
if (result.data.my_teams[0].manage_permission === true) {
//普通账号true 为创建了竞赛
this.setState({
type: 2,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} else {
//普通账号true 加入了竞赛
//普通账号
this.setState({
type: 3,
data: result.data.my_teams,
type: 1,
count: result.data.count,
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
}
} else {
//有数据的
if (admin === true) {
if (result.data.my_teams[0].manage_permission === true) {
this.setState({
type: 5,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} else {
this.setState({
type: 4,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
} else {
if (result.data.my_teams[0].manage_permission === true) {
//普通账号true 为创建了竞赛
this.setState({
type: 2,
data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
})
} else {
//普通账号true 加入了竞赛
this.setState({
type: 3,
data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
})
}
}
}
}
} else {
this.setState({
type: 6,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
}
}
this.setState({
loadingstate: false,
@ -222,12 +246,14 @@ class Registration extends React.Component {
page: page,
per_page: per_page,
};
let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`;
let url = `/competitions/${"gcc-task-2019"}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
if (result) {
if (result.data) {
//// //console.log(result);
if (result.data.my_teams.length === 0) {
if (result.data.personal === false) {
//不是个人赛
if (result.data.my_teams.length === 0) {
// 没有创建数据的
//管理员
this.setState({
@ -235,6 +261,8 @@ class Registration extends React.Component {
count: result.data.count,
competition_teams: result.data.competition_teams,
data: result.data.my_teams,
personal: result.data.personal,
})
} else {
//有数据的
@ -243,7 +271,9 @@ class Registration extends React.Component {
type: 5,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} else {
@ -251,10 +281,23 @@ class Registration extends React.Component {
type: 4,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
}
} else {
//团队赛
this.setState({
type: 6,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
}
}
@ -262,6 +305,8 @@ class Registration extends React.Component {
loadingstate: false,
})
}).catch((error) => {
console.log(error);
console.log("报错了");
if (admin === true) {
//管理员
this.setState({
@ -290,7 +335,7 @@ class Registration extends React.Component {
loadingstate: true,
})
const {keyword, per_page} = this.state;
this.Getdata(keyword, pageNumber, per_page, this.props.user.admin);
this.Getdatatype5(keyword, pageNumber, per_page, this.props.user.admin);
};
/**
@ -482,7 +527,7 @@ class Registration extends React.Component {
messageexitol: true
})
let url = `/competitions/${"gcc-course-2019"}/competition_teams/${this.state.itemid}/leave.json`;
let url = `/competitions/${"gcc-task-2019"}/competition_teams/${this.state.itemid}/leave.json`;
axios.post(url).then((response) => {
if (response) {
if (response.data) {
@ -515,15 +560,21 @@ class Registration extends React.Component {
})
this.Getdatatype5(value, 1, 20, this.props.user.admin);
}
//个人竞赛
// /competitions/:identifier/competition_teams.json
render() {
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate} = this.state;
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state;
var listItems = "";
if (competition_teams) {
listItems = competition_teams.map((item, index) =>
<RegisListviewdata key={index} item={item}></RegisListviewdata>
);
}
// if (competition_teams) {
// listItems = competition_teams.map((item, index) =>
//
// );
// }
const listItemss = test.map((item, index) =>
<Registrationitem></Registrationitem>
);
return (
<div className="newMain clearfix ">
@ -581,10 +632,33 @@ class Registration extends React.Component {
</div>
{/*大图*/}
<CompetitionMaxImg type={type} Jointheteam={() => this.Jointheteam()}
pint={pint}
{...this.props} {...this.state}
Createateam={() => this.Createateam()}></CompetitionMaxImg>
{/*大图结尾*/}
{/*没数据*/}
{
pint === 1 || pint === 3 ?
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>132</span></p>
</div>
: ""}
{/*列表*/}
{
pint === 1 || pint === 3 ?
<div
style={{
marginTop: "31px"
}}
>
{
listItemss
}
</div>
: ""}
{
type === 1 ?
<RegisNodata></RegisNodata>
@ -617,9 +691,18 @@ class Registration extends React.Component {
{type === 4 || type === 5 ?
<Spin spinning={loadingstate}>
{/*{*/}
{/* listItems*/}
{/*}*/}
{
listItems
competition_teams && competition_teams.map((item, index) => {
return (
<RegisListviewdata key={index} item={item}></RegisListviewdata>
)
})
}
</Spin>
:
""

@ -53,7 +53,15 @@ class RegistrationSearch extends React.Component {
onPressEnter={(e) => this.myonPressEnter(e)}
/>
<p style={{color: "#07140E", fontSize: "16px", marginTop: "7px", marginLeft: "760px"}}>战队总数<span
<p style={{
width: "300px",
color: "#07140E",
fontSize: '16px',
marginTop: " 7px",
marginLeft: "583px",
textAlign: "right",
lineHeight: " 24px"
}}>战队总数<span
style={{color: "#459BE5", fontSize: "16px"}}>{this.props.count}</span></p>
</div>
)

@ -119,14 +119,15 @@ class PersonalCompetititem extends React.Component {
</img>
: index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 6 ?
<img className="regitemimgs22" src={pexjiazai}>
</img>
</div>
: ""
)
})

Loading…
Cancel
Save