dev_sync_trustie
杨树林 5 years ago
parent 1bf72e9314
commit fa47b00a7a

@ -29,6 +29,13 @@ class CompetitionMaxImg extends React.Component {
let {type, pint} = this.props; let {type, pint} = this.props;
return ( return (
<div> <div>
<style>
{
`
`
}
</style>
{ {
type === 1 || type === 2 ? type === 1 || type === 2 ?
<div className="registrationback"> <div className="registrationback">

@ -22,6 +22,7 @@ import PersonalModalteam from './competmodal/PersonalModalteam';
import PersonalCompetititem from './personal/PersonalCompetititem'; import PersonalCompetititem from './personal/PersonalCompetititem';
import ExittheteamModel from './competmodal/ExittheteamModel'; import ExittheteamModel from './competmodal/ExittheteamModel';
import pexjiazai from "./pexjiazai.png"; import pexjiazai from "./pexjiazai.png";
// 团队竞赛报名无报名 // 团队竞赛报名无报名
class Registration extends React.Component { class Registration extends React.Component {
/*** /***
@ -74,6 +75,8 @@ class Registration extends React.Component {
// //// ////console.log("调用子组件 "); // //// ////console.log("调用子组件 ");
// ////console.log(this.props.isAdmin()); // ////console.log(this.props.isAdmin());
// //// ////console.log(this.props.isAdmin()) // //// ////console.log(this.props.isAdmin())
this.GetenrollmentAPI();
this.Getthenavigationbar();
} }
@ -85,12 +88,26 @@ class Registration extends React.Component {
//console.log(this.props.user.admin); //console.log(this.props.user.admin);
const {keyword, page, per_page} = this.state; const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin); this.Getdata(keyword, page, per_page, this.props.user.admin);
this.GetenrollmentAPI();
} }
} }
// 获取导航栏
Getthenavigationbar = () => {
const url = `/competitions/${"gcc-task-2020"}/competition_modules.json`;
axios.get((url)).then((result) => {
if (result) {
if (result.data) {
//// ////console.log("获取报名配置API");
//// ////console.log(result);
console.log(result);
}
}
}).catch((error) => {
//// ////console.log(error);
})
}
//获取报名配置API //获取报名配置API
GetenrollmentAPI = () => { GetenrollmentAPI = () => {
const url = `/competitions/${"gcc-task-2020"}/competition_staff.json`; const url = `/competitions/${"gcc-task-2020"}/competition_staff.json`;
@ -591,35 +608,45 @@ class Registration extends React.Component {
//个人竞赛 //个人竞赛
// /competitions/:identifier/competition_teams.json // /competitions/:identifier/competition_teams.json
Personalregistration = () => { Personalregistration = () => {
let {teacher_staff, member_staff, data} = this.state; let {teacher_staff, member_staff, data, enroll_ended} = this.state;
if (enroll_ended === true) {
//已截止
this.props.showNotification(`报名已截止`);
return;
}
if (teacher_staff) { if (teacher_staff) {
if (teacher_staff.mutiple_limited === true) { if (teacher_staff.mutiple_limited) {
if (data) { if (teacher_staff.mutiple_limited === true) {
if (data.length > teacher_staff.maximum) { if (data) {
message.success('已限制多次报名!'); if (data.length > teacher_staff.maximum) {
return this.props.showNotification(`你已经报名,不能重复报名!`);
return
}
} }
} }
} }
} }
if (member_staff) { if (member_staff) {
if (teacher_staff.mutiple_limited === true) { if (member_staff.mutiple_limited) {
if (member_staff.mutiple_limited === true) {
if (data) { if (data) {
if (data.length > teacher_staff.maximum) { if (data.length > member_staff.maximum) {
message.success('已限制多次报名!'); this.props.showNotification(`你已经报名,不能重复报名!`);
return; return;
} }
} }
} }
}
} }
const url = `/competitions/${"gcc-task-2020"}/competition_teams.json`; const url = `/competitions/${"gcc-task-2020"}/competition_teams.json`;
axios.post(url).then((response) => { axios.post(url).then((response) => {
if (response) { if (response) {
if (response.data) { if (response.data) {
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
this.Refreshteam(); this.Refreshteam();
@ -631,7 +658,7 @@ class Registration extends React.Component {
} }
render() { render() {
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state; const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state;
var listItems = ""; // var listItems = "";
// if (competition_teams) { // if (competition_teams) {
// listItems = competition_teams.map((item, index) => // listItems = competition_teams.map((item, index) =>
@ -716,7 +743,7 @@ class Registration extends React.Component {
: ""} : ""}
{/*列表*/} {/*列表*/}
{ {
pint === 1 || pint === 3 ? type === 6 ?
<div <div
style={{ style={{
marginTop: "31px" marginTop: "31px"
@ -726,7 +753,7 @@ class Registration extends React.Component {
{ {
data && data.map((item, index) => { data && data.map((item, index) => {
return ( return (
<Registrationitem item={item}></Registrationitem> <Registrationitem key={index} item={item}></Registrationitem>
) )
}) })
} }

@ -69,7 +69,7 @@ class Registrationitem extends React.Component {
color: "#999999", color: "#999999",
fontSize: "16px", fontSize: "16px",
textAlign: "center", textAlign: "center",
}}>2019-09-07 08:33</p> }}>{item.created_at}</p>
</div> </div>
</div> </div>

@ -8,16 +8,17 @@
} }
/*All*/ /*All*/
/*Registration.js*/ /*Registration.js*/
.registrationback { /*.registrationback {*/
height: 368px; /* height: 368px;*/
width: 1200px; /* width: 1200px;*/
border: 0.5px solid; /* border: 0.5px solid;*/
display: flex; /* display: flex;*/
display: -webkit-flex; /* display: -webkit-flex;*/
flex-direction: column; /* flex-direction: column;*/
align-items: center; /* align-items: center;*/
background: #0dcecb; /* background:url(../../../../../images/regis/tipregistit.jpg)*/
}
/*}*/
.registrationbackcenter { .registrationbackcenter {
display: flex; display: flex;
@ -26,14 +27,14 @@
align-items: center; align-items: center;
} }
.registrationback1 { /*.registrationback1 {*/
height: 368px; /* height: 368px;*/
width: 1200px; /* width: 1200px;*/
border: 0.5px solid; /* border: 0.5px solid;*/
display: flex; /* display: flex;*/
flex-direction: column; /* flex-direction: column;*/
background: #0dcecb; /* background:url(../../../../../images/regis/tipregistit.jpg)*/
} /*}*/
.registrationbackp1 { .registrationbackp1 {
color: #ffffff; color: #ffffff;
@ -315,6 +316,23 @@
border-bottom: 1px solid #EDEDED; border-bottom: 1px solid #EDEDED;
} }
.registrationback {
height: 368px;
width: 1200px;
display: flex;
display: -webkit-flex;
flex-direction: column;
align-items: center;
background-image: url(./tipregistit.jpg);
}
.registrationback1 {
height: 368px;
width: 1200px;
display: flex;
flex-direction: column;
background-image: url(./tipregistit.jpg);
}
.regitem2 { .regitem2 {
display: flex; display: flex;

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Loading…
Cancel
Save