|
|
|
@ -68,7 +68,8 @@ class Registration extends React.Component {
|
|
|
|
|
mutiple_limited: false,
|
|
|
|
|
teamutiple_limited: false,
|
|
|
|
|
members_count: 0,
|
|
|
|
|
mode: 0
|
|
|
|
|
mode: 0,
|
|
|
|
|
region_schools: [],
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -82,8 +83,8 @@ class Registration extends React.Component {
|
|
|
|
|
// //// //////console.log(this.props.isAdmin())
|
|
|
|
|
try {
|
|
|
|
|
const {keyword, page, per_page} = this.state;
|
|
|
|
|
this.Getdata(keyword, page, per_page, this.props.user.admin);
|
|
|
|
|
this.GetenrollmentAPI();
|
|
|
|
|
this.Getdata(keyword, page, per_page, this.props.user.admin);// 获取列表数据
|
|
|
|
|
this.GetenrollmentAPI();//获取我的报名配置
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// const {keyword, page, per_page} = this.state;
|
|
|
|
|
// this.Getdata(keyword, page, per_page, this.props.isAdmin());
|
|
|
|
@ -116,6 +117,7 @@ class Registration extends React.Component {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
this.setState({
|
|
|
|
|
mode: result.data.mode,
|
|
|
|
|
region_schools: result.data.region_schools
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -454,6 +456,31 @@ class Registration extends React.Component {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let {region_schools} = this.state;
|
|
|
|
|
//判断是否是否是同一个学校,数组元素为0就不用判断
|
|
|
|
|
try {
|
|
|
|
|
if (region_schools.length > 0) {
|
|
|
|
|
let i = 0;
|
|
|
|
|
for (var r = 0; r < region_schools.length; r++) {
|
|
|
|
|
if (region_schools[r] !== this.props.user.user_school) {
|
|
|
|
|
// 终止循环
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
i = i + 1;
|
|
|
|
|
}
|
|
|
|
|
if (i === region_schools.length) {
|
|
|
|
|
//如果i 等于region_schools.length,说明本次循环中没有相同的学校,本人不支持报名
|
|
|
|
|
this.props.showNotification(`本竞赛只面向部分学校/单位开放,你暂时没有参赛资格!`);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.props.user.is_teacher === true) {
|
|
|
|
|
try {
|
|
|
|
@ -541,6 +568,29 @@ class Registration extends React.Component {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let {region_schools} = this.state;
|
|
|
|
|
//判断是否是否是同一个学校,数组元素为0就不用判断
|
|
|
|
|
try {
|
|
|
|
|
if (region_schools.length > 0) {
|
|
|
|
|
let i = 0;
|
|
|
|
|
for (var r = 0; r < region_schools.length; r++) {
|
|
|
|
|
if (region_schools[r] !== this.props.user.user_school) {
|
|
|
|
|
// 终止循环
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
i = i + 1;
|
|
|
|
|
}
|
|
|
|
|
if (i === region_schools.length) {
|
|
|
|
|
//如果i 等于region_schools.length,说明本次循环中没有相同的学校,本人不支持报名
|
|
|
|
|
this.props.showNotification(`本竞赛只面向部分学校/单位开放,你暂时没有参赛资格!`);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.props.user.is_teacher === true) {
|
|
|
|
|