From 6a6c65f192faf81bc2ece632957acd0a478da797 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Fri, 25 Oct 2019 16:02:50 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E7=AB=9E=E8=B5=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/competition/Registration.js | 85 +++++++++++++++----
1 file changed, 69 insertions(+), 16 deletions(-)
diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js
index cd6254981..ec87fec9d 100644
--- a/public/react/src/modules/competition/Registration.js
+++ b/public/react/src/modules/competition/Registration.js
@@ -117,8 +117,8 @@ class Registration extends React.Component {
personal: result.data.personal,
enroll_ended: result.data.enroll_ended,
enrolled: result.data.enrolled,
- teacher_staff: result.data.teacher_staff === undefined || result.data.teacher_staff === null ? undefined : result.data.teacher_staff,
- member_staff: result.data.member_staff === undefined || result.data.member_staff === null ? undefined : result.data.member_staff,
+ teacher_staff: result.data.teacher_staff === undefined || result.data.teacher_staff === null ? null : result.data.teacher_staff,
+ member_staff: result.data.member_staff === undefined || result.data.member_staff === null ? null : result.data.member_staff,
})
@@ -442,14 +442,40 @@ class Registration extends React.Component {
* 加入战队
* */
Jointheteam = () => {
- if (this.state.enrolled === true) {
- //已经报名
- this.setState({
- messagePerbool: true,
- intpermessages: "你已经报名,不能重复报名"
- })
- return;
+ if (this.props.user.is_teacher === true) {
+ try {
+ if (this.props.teamutiple_limited === true) {
+ if (this.state.enrolled === true) {
+ //已经报名
+ this.setState({
+ messagePerbool: true,
+ intpermessages: "你已经报名,不能重复报名"
+ })
+ return;
+ }
+ }
+ } catch (e) {
+
+ }
+
+ } else {
+ try {
+ if (this.props.mutiple_limited === true) {
+ if (this.state.enrolled === true) {
+ //已经报名
+ this.setState({
+ messagePerbool: true,
+ intpermessages: "你已经报名,不能重复报名"
+ })
+ return;
+ }
+ }
+ } catch (e) {
+
+ }
}
+
+
if (this.state.enroll_ended === true) {
//报名截止
this.setState({
@@ -458,6 +484,8 @@ class Registration extends React.Component {
})
return
}
+
+
if (this.props.user.is_teacher === true) {
//老师
if (this.state.teacher_staff === null) {
@@ -496,13 +524,37 @@ class Registration extends React.Component {
**/
Createateam = () => {
//
- if (this.state.enrolled === true) {
- //已经报名
- this.setState({
- messagePerbool: true,
- intpermessages: "您已报名,无需重复报"
- })
- return;
+ if (this.props.user.is_teacher === true) {
+ try {
+ if (this.props.teamutiple_limited === true) {
+ if (this.state.enrolled === true) {
+ //已经报名
+ this.setState({
+ messagePerbool: true,
+ intpermessages: "你已经报名,不能重复报名"
+ })
+ return;
+ }
+ }
+ } catch (e) {
+
+ }
+
+ } else {
+ try {
+ if (this.props.mutiple_limited === true) {
+ if (this.state.enrolled === true) {
+ //已经报名
+ this.setState({
+ messagePerbool: true,
+ intpermessages: "你已经报名,不能重复报名"
+ })
+ return;
+ }
+ }
+ } catch (e) {
+
+ }
}
if (this.state.enroll_ended === true) {
//报名截止
@@ -512,6 +564,7 @@ class Registration extends React.Component {
})
return
}
+
if (this.props.user.is_teacher === true) {
//老师
if (this.state.teacher_staff === null) {
From 6014a6a56d75c376dc6ba4e9fe73905de3d45a17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Fri, 25 Oct 2019 16:05:17 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E7=AB=9E=E8=B5=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/competition/Registration.js | 2 +-
.../src/modules/competition/personal/PersonalCompetititem.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js
index ec87fec9d..86133231b 100644
--- a/public/react/src/modules/competition/Registration.js
+++ b/public/react/src/modules/competition/Registration.js
@@ -849,7 +849,7 @@ class Registration extends React.Component {
(
data && data.map((item, index) => {
return (
-