dev_sync_trustie
杨树林 5 years ago
parent cdda2aa1ce
commit ed5d7e7359

@ -132,50 +132,52 @@ class Registration extends React.Component {
* 加入战队
* */
Jointheteam = () => {
if (this.state.enrolled === true) {
//已经报名
this.setState({
messagePerbool: true,
intpermessages: "您已报名,无需重复报"
})
return;
}
if (this.state.enroll_ended === true) {
//报名截止
this.setState({
messagePerbool: true,
intpermessages: "报名已截止,无需报名"
})
return
}
if (this.props.isAdmin() === true) {
//老师
if (this.state.teacher_staff === null) {
//禁止老师
this.setState({
messagePerbool: true,
intpermessages: "已禁止老师报名"
})
return;
}
this.setState({
tmodalsTypes: true
})
} else {
//学生
if (this.state.member_staff === null) {
//禁止学生
this.setState({
messagePerbool: true,
intpermessages: "已禁止学生报名"
})
return;
}
this.setState({
tmodalsTypes: true
})
}
// if (this.state.enrolled === true) {
// //已经报名
// this.setState({
// messagePerbool: true,
// intpermessages: "您已报名,无需重复报"
// })
// return;
// }
// if (this.state.enroll_ended === true) {
// //报名截止
// this.setState({
// messagePerbool: true,
// intpermessages: "报名已截止,无需报名"
// })
// return
// }
// if (this.props.isAdmin() === true) {
// //老师
// if (this.state.teacher_staff === null) {
// //禁止老师
// this.setState({
// messagePerbool: true,
// intpermessages: "已禁止老师报名"
// })
// return;
// }
// this.setState({
// tmodalsTypes: true
// })
// } else {
// //学生
// if (this.state.member_staff === null) {
// //禁止学生
// this.setState({
// messagePerbool: true,
// intpermessages: "已禁止学生报名"
// })
// return;
// }
// this.setState({
// tmodalsTypes: true
// })
// }
this.setState({
tmodalsTypes: true
})
}

@ -25,9 +25,6 @@ class PersonModal extends Component {
super(props);
this.state = {
addonAfter: 0,
test: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
test2: [19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40],
test3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
loading: false,
loading1: false,
loading2: false,
@ -588,7 +585,7 @@ class PersonModal extends Component {
render() {
const {
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2,
addonAfter, Numberofteammentors, Thecurrentnumber, person1, person2,
keywordteachers, team_idteachers, teacher_ids,
keywordstudents, team_idstudents, student_ids,
member_ids, mydatas, booltech, boolstud, GetenrollmentAPI, Thecurrentnumberbool

@ -13,10 +13,33 @@ class PersonalModalteam extends Component {
constructor(props) {
super(props);
this.state = {}
this.state = {
yslzxueshiskmcdm1: "",
}
}
Tmoconfirmto = () => {
let url = `/competitions/${"gcc-course-2019"}/competition_teams/join.json`;
axios.post(url, {
invite_code: this.state.yslzxueshiskmcdm1
}).then((result) => {
if (result) {
if (result.data) {
this.props.Tmoconfirm(true)
}
}
}).catch((error) => {
});
}
studentsonChange = (e) => {
this.setState({
yslzxueshiskmcdm1: e.target.value,
});
}
render() {
const {
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2
@ -68,7 +91,8 @@ class PersonalModalteam extends Component {
`
}
</style>
<Input className={"yslzxueshiskmcdm1"} placeholder="请输入您的邀请码"/>
<Input className={"yslzxueshiskmcdm1"} value={this.state.yslzxueshiskmcdm1}
onChange={(e) => this.studentsonChange(e)} placeholder="请输入您的邀请码"/>
</div>
@ -88,7 +112,7 @@ class PersonalModalteam extends Component {
<p onClick={() => this.props.Tmoconfirm(false)}>取消</p>
</div>
<div className="personaldivbutt2">
<p onClick={() => this.props.Tmoconfirm(true)}>确定</p>
<p onClick={() => this.Tmoconfirmto()}>确定</p>
</div>
</div>
</div>

Loading…
Cancel
Save