From bf7caa73ab71952541efaf561792530a65e425ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 24 Oct 2019 10:42:46 +0800 Subject: [PATCH] jingsai.8 --- .../src/modules/competition/Registration.js | 35 ++++--------------- .../personal/PersonalCompetititem.js | 4 +-- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js index 38a270843..d6be71f13 100644 --- a/public/react/src/modules/competition/Registration.js +++ b/public/react/src/modules/competition/Registration.js @@ -596,39 +596,16 @@ class Registration extends React.Component { //个人竞赛 // /competitions/:identifier/competition_teams.json 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) { //已截止 this.props.showNotification(`报名已截止`); return; } - if (teacher_staff) { - if (teacher_staff.mutiple_limited) { - if (teacher_staff.mutiple_limited === true) { - 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; - } - } - } - } + if (enrolled === true) { + this.props.showNotification(`你已经报名,不能重复报名!`); + return; } const url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`; axios.post(url).then((response) => { @@ -636,14 +613,14 @@ class Registration extends React.Component { if (response.data) { this.props.showNotification(`报名成功,预祝您夺得桂冠!`); this.Refreshteam(); - - } } }).catch((error) => { }); } + + render() { const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state; // var listItems = ""; diff --git a/public/react/src/modules/competition/personal/PersonalCompetititem.js b/public/react/src/modules/competition/personal/PersonalCompetititem.js index 0b888431c..e3863b3a7 100644 --- a/public/react/src/modules/competition/personal/PersonalCompetititem.js +++ b/public/react/src/modules/competition/personal/PersonalCompetititem.js @@ -57,8 +57,8 @@ class PersonalCompetititem extends React.Component { // const listItems = mydatas.map((item, index) => // // ); - console.log("PersonalCompetititem"); - console.log(data); + // console.log("PersonalCompetititem"); + // console.log(data); return (