|
|
|
@ -88,6 +88,7 @@ class Registration extends React.Component {
|
|
|
|
|
// this.Getdata(keyword, page, per_page, this.props.isAdmin());
|
|
|
|
|
// this.GetenrollmentAPI();
|
|
|
|
|
}
|
|
|
|
|
//取模式
|
|
|
|
|
this.Getdataheader();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -100,6 +101,7 @@ class Registration extends React.Component {
|
|
|
|
|
////console.log(this.props.user.admin);
|
|
|
|
|
const {keyword, page, per_page} = this.state;
|
|
|
|
|
this.Getdata(keyword, page, per_page, this.props.user.admin);
|
|
|
|
|
//取报名配置
|
|
|
|
|
this.GetenrollmentAPI();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -144,6 +146,7 @@ class Registration extends React.Component {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
//获取学生是否被限制多次报名
|
|
|
|
|
if (result.data.member_staff) {
|
|
|
|
|
this.setState({
|
|
|
|
|
mutiple_limited: result.data.member_staff.mutiple_limited,
|
|
|
|
@ -157,6 +160,7 @@ class Registration extends React.Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
//获取老师是否被限制多次报名
|
|
|
|
|
if (result.data.teacher_staff) {
|
|
|
|
|
this.setState({
|
|
|
|
|
teamutiple_limited: result.data.teacher_staff.mutiple_limited
|
|
|
|
@ -167,6 +171,7 @@ class Registration extends React.Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//是否是个人赛做处理
|
|
|
|
|
if (result.data.personal === true) {
|
|
|
|
|
if (result.data.enroll_ended === true) {
|
|
|
|
|
this.setState({
|
|
|
|
@ -211,6 +216,17 @@ class Registration extends React.Component {
|
|
|
|
|
// 没有创建数据的
|
|
|
|
|
if (admin === true) {
|
|
|
|
|
//管理员
|
|
|
|
|
try {
|
|
|
|
|
this.setState({
|
|
|
|
|
type: result.data.competition_teams.length === 0 ? 1 : 4,
|
|
|
|
|
count: result.data.count,
|
|
|
|
|
data: result.data.my_teams,
|
|
|
|
|
competition_teams: result.data.competition_teams,
|
|
|
|
|
personal: result.data.personal,
|
|
|
|
|
competition_name: result.data.competition_name,
|
|
|
|
|
members_count: result.data.members_count
|
|
|
|
|
})
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.setState({
|
|
|
|
|
type: 4,
|
|
|
|
|
count: result.data.count,
|
|
|
|
@ -220,6 +236,8 @@ class Registration extends React.Component {
|
|
|
|
|
competition_name: result.data.competition_name,
|
|
|
|
|
members_count: result.data.members_count
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//普通账号
|
|
|
|
|
this.setState({
|
|
|
|
@ -463,6 +481,12 @@ class Registration extends React.Component {
|
|
|
|
|
* 加入战队
|
|
|
|
|
* */
|
|
|
|
|
Jointheteam = () => {
|
|
|
|
|
if (this.props.checkIfLogin() === false) {
|
|
|
|
|
this.props.showLoginDialog()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.props.user.is_teacher === true) {
|
|
|
|
|
try {
|
|
|
|
|
if (this.state.teamutiple_limited === true) {
|
|
|
|
@ -544,7 +568,12 @@ class Registration extends React.Component {
|
|
|
|
|
* 创建战队
|
|
|
|
|
**/
|
|
|
|
|
Createateam = () => {
|
|
|
|
|
//
|
|
|
|
|
if (this.props.checkIfLogin() === false) {
|
|
|
|
|
this.props.showLoginDialog()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.props.user.is_teacher === true) {
|
|
|
|
|
try {
|
|
|
|
@ -734,6 +763,12 @@ class Registration extends React.Component {
|
|
|
|
|
// /competitions/:identifier/competition_teams.json
|
|
|
|
|
Personalregistration = () => {
|
|
|
|
|
let {teacher_staff, member_staff, data, enroll_ended, enrolled} = this.state;
|
|
|
|
|
|
|
|
|
|
if (this.props.checkIfLogin() === false) {
|
|
|
|
|
this.props.showLoginDialog();
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (enroll_ended === true) {
|
|
|
|
|
//已截止
|
|
|
|
|
this.props.showNotification(`报名已截止`);
|
|
|
|
|