dev_sync_trustie
杨树林 5 years ago
parent b1658ead34
commit ae71c3e075

@ -62,7 +62,7 @@ class Registration extends React.Component {
itemid: undefined,
itemiddata: [],
pint: 0,
competition_name: undefined,
}
}
@ -101,6 +101,7 @@ class Registration extends React.Component {
//获取报名配置API
GetenrollmentAPI = () => {
console.log("调用了GetenrollmentAPI");
const url = `/competitions/${this.props.match.params.identifier}/competition_staff.json`;
axios.get((url)).then((result) => {
if (result) {
@ -161,6 +162,7 @@ class Registration extends React.Component {
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
})
} else {
//普通账号
@ -291,6 +293,7 @@ class Registration extends React.Component {
competition_teams: result.data.competition_teams,
data: result.data.my_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
})
} else {
@ -556,7 +559,7 @@ class Registration extends React.Component {
messageexitol: true
})
let url = `/competitions/${"gcc-task-2020"}/competition_teams/${this.state.itemid}/leave.json`;
let url = `/competitions/${this.props.match.params.identifier}/competition_teams/${this.state.itemid}/leave.json`;
axios.post(url).then((response) => {
if (response) {
if (response.data) {
@ -618,7 +621,7 @@ class Registration extends React.Component {
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, competition_name} = this.state;
return (
<div className="newMain clearfix ">
@ -646,7 +649,9 @@ class Registration extends React.Component {
tmodalsType === true ?
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={Newtit}
itemiddata={itemiddata} GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}></PersonModal>
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}
GetenrollmentAPIopens={() => this.GetenrollmentAPI()}
></PersonModal>
:
""
}
@ -677,7 +682,8 @@ class Registration extends React.Component {
<div style={{marginBottom: '12px'}}>
<Breadcrumb separator=">">
<Breadcrumb.Item href="/newcompetitions">在线竞赛</Breadcrumb.Item>
<Breadcrumb.Item href="">全国高校计算机大赛</Breadcrumb.Item>
<Breadcrumb.Item
href="">{competition_name === undefined || competition_name === null || competition_name === "" ? "全国高校计算机大赛" : competition_name}</Breadcrumb.Item>
<Breadcrumb.Item href="">报名</Breadcrumb.Item>
</Breadcrumb>
</div>

@ -411,7 +411,7 @@
height: 22px;
width: 22px;
font-size: 21px !important;
margin-top: 21px;
margin-top: 19px;
color: #1C91E8;
}
@ -478,6 +478,7 @@
.packinputs button {
background: #459BE5;
width: 100% !important;
}
.packinputs {

@ -110,30 +110,30 @@ class PersonModal extends Component {
}
componentDidUpdate = (prevProps) => {
if (prevProps.user != this.props.user) {
////console.log("Registration.js componentDidUpdate");
////console.log(this.props);
// ////console.log(prevProps);
//identity职场称
//user_school学校
//real_name姓名
//type 类型
var data = [];
var datas = {
enrollable: false,
id: undefined,
name: this.props.user.real_name,
school_name: this.props.user.user_school,
student_id: null,
identity: this.props.user.user_identity,
type: "导师",
};
data.push(datas);
this.setState({
myuser: this.props.user,
mydatas: data,
})
}
// if (prevProps.user != this.props.user) {
// ////console.log("Registration.js componentDidUpdate");
// ////console.log(this.props);
// // ////console.log(prevProps);
// //identity职场称
// //user_school学校
// //real_name姓名
// //type 类型
// var data = [];
// var datas = {
// enrollable: false,
// id: undefined,
// name: this.props.user.real_name,
// school_name: this.props.user.user_school,
// student_id: null,
// identity: this.props.user.user_identity,
// type: "导师",
// };
// data.push(datas);
// this.setState({
// myuser: this.props.user,
// mydatas: data,
// })
// }
if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) {
////console.log("Registration.js GetenrollmentAPIcomponentDidUpdate");
@ -627,7 +627,7 @@ class PersonModal extends Component {
})
}
deletedata = (item) => {
var {mydatas} = this.state;
var {mydatas, GetenrollmentAPI} = this.state;
if (item) {
var pos = mydatas.indexOf(item);
// ////console.log("deletedata");
@ -641,6 +641,67 @@ class PersonModal extends Component {
mydatas: mydatas,
})
}
var myteaherdata = [];
var myshtudentdata = [];
var i = 0;
try {
for (var a = 0; a < mydatas.length; a++) {
if (mydatas[a].type === "导师") {
i++;
// var objectt = {
// enrollable: mydatas[a].enrollable,
// id: mydatas[a].id,
// identity: mydatas[a].identity,
// name: mydatas[a].name,
// school_name: mydatas[a].school_name,
// }
myteaherdata.push(mydatas[a].id);
} else if (mydatas[a].type === "队员") {
// var objectts = {
// enrollable: mydatas[a].enrollable,
// id: mydatas[a].id,
// name: mydatas[a].name,
// school_name: mydatas[a].school_name,
// student_id: mydatas[a].student_id,
// }
myshtudentdata.push(mydatas[a].id);
}
}
} catch (e) {
}
// console.log("deletedata");
// console.log(i);
try {
if (GetenrollmentAPI) {
if (GetenrollmentAPI.teacher_staff) {
if (GetenrollmentAPI.teacher_staff.minimum > i) {
this.setState({
Thecurrentnumberbool: true,
Thecurrentnumber: i,
booltech: false,
boolstud: false
})
return
} else if (GetenrollmentAPI.teacher_staff.maximum < i) {
this.setState({
Thecurrentnumberbool: true,
Thecurrentnumber: i,
booltech: false,
boolstud: false
})
return
}
this.setState({
Thecurrentnumberbool: false,
Thecurrentnumber: i,
})
}
}
} catch (e) {
}
}
render() {

@ -80,7 +80,7 @@ class PersonalCompetititem extends React.Component {
marginTop: "29px",
marginLeft: "37px"
}}>
<p style={{
<p className="maxnamewidth160" style={{
color: "#05101A",
fontSize: "16px",
@ -138,14 +138,15 @@ class PersonalCompetititem extends React.Component {
<div className=" " style={{
marginLeft: "37px",
}}>
<div style={{marginTop: "23px",}}>
<div style={{marginTop: "23px", width: '113px'}}>
<span style={{
color: "#05101A",
fontSize: "16px",
}}>邀请码</span>
<span
style={{
color: "#05101A",
color: "#05101A",
fontSize: "16px",
}}>{data[0].invite_code === null || data[0].invite_code === undefined ? "" : data[0].invite_code}</span>
</div>

Loading…
Cancel
Save