dev_sync_trustie
杨树林 5 years ago
parent ec97013ebd
commit bf7caa73ab

@ -596,39 +596,16 @@ class Registration extends React.Component {
//个人竞赛 //个人竞赛
// /competitions/:identifier/competition_teams.json // /competitions/:identifier/competition_teams.json
Personalregistration = () => { Personalregistration = () => {
let {teacher_staff, member_staff, data, enroll_ended} = this.state; let {teacher_staff, member_staff, data, enroll_ended, enrolled} = this.state;
if (enroll_ended === true) { if (enroll_ended === true) {
//已截止 //已截止
this.props.showNotification(`报名已截止`); this.props.showNotification(`报名已截止`);
return; return;
} }
if (teacher_staff) { if (enrolled === true) {
if (teacher_staff.mutiple_limited) { this.props.showNotification(`你已经报名,不能重复报名!`);
if (teacher_staff.mutiple_limited === true) { return;
if (data) {
if (data.length > teacher_staff.maximum) {
this.props.showNotification(`你已经报名,不能重复报名!`);
return
}
}
}
}
}
if (member_staff) {
if (member_staff.mutiple_limited) {
if (member_staff.mutiple_limited === true) {
if (data) {
if (data.length > member_staff.maximum) {
this.props.showNotification(`你已经报名,不能重复报名!`);
return;
}
}
}
}
} }
const url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`; const url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
axios.post(url).then((response) => { axios.post(url).then((response) => {
@ -636,14 +613,14 @@ class Registration extends React.Component {
if (response.data) { if (response.data) {
this.props.showNotification(`报名成功,预祝您夺得桂冠!`); this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
this.Refreshteam(); this.Refreshteam();
} }
} }
}).catch((error) => { }).catch((error) => {
}); });
} }
render() { render() {
const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state; const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state;
// var listItems = ""; // var listItems = "";

@ -57,8 +57,8 @@ class PersonalCompetititem extends React.Component {
// const listItems = mydatas.map((item, index) => // const listItems = mydatas.map((item, index) =>
// //
// ); // );
console.log("PersonalCompetititem"); // console.log("PersonalCompetititem");
console.log(data); // console.log(data);
return ( return (
<div> <div>
{ {

Loading…
Cancel
Save