Merge branches 'yslcompetition' and 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into ysm1

dev_sync_trustie
杨树明 5 years ago
commit 540a4a309d

@ -16,9 +16,9 @@ class CompetitionMaxImg extends React.Component {
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) { if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) {
// console.log("团队竞赛报名大图componentDidUpdate"); // //console.log("团队竞赛报名大图componentDidUpdate");
// console.log(this.props); // //console.log(this.props);
// console.log(this.props.GetenrollmentAPI); // //console.log(this.props.GetenrollmentAPI);
this.setState({ this.setState({
GetenrollmentAPI: this.props.GetenrollmentAPI, GetenrollmentAPI: this.props.GetenrollmentAPI,
}) })
@ -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">
@ -83,8 +90,8 @@ class CompetitionMaxImg extends React.Component {
<div className="registrationbackp2button"> <div className="registrationbackp2button">
{ {
pint === 1 ? pint === 1 ?
<div className="registbut1"> <div className="registbut1" onClick={() => this.props.Personalregistration()}>
<p>立即报名</p> <p onClick={() => this.props.Personalregistration()}>立即报名</p>
</div> </div>
: pint === 2 ? : pint === 2 ?
<div className="personreg1"> <div className="personreg1">

@ -30,15 +30,15 @@ class RegisListview extends React.Component {
backgroundPosition: "center", backgroundPosition: "center",
backgroundSize: "110% 100%", backgroundSize: "110% 100%",
}}> }}>
<p className="borders" <p className=" "
style={{fontSize: "16px", color: "#05101A", width: "79px", textAlign: "center"}}>创建者</p> style={{fontSize: "16px", color: "#05101A", width: "79px", textAlign: "center"}}>创建者</p>
<p className="borders" <p className=" "
style={{fontSize: "16px", color: "#05101A", width: "160px", textAlign: "center"}}>战队名称</p> style={{fontSize: "16px", color: "#05101A", width: "160px", textAlign: "center"}}>战队名称</p>
<p className="borders" <p className=" "
style={{fontSize: "16px", color: "#05101A", width: "487px", textAlign: "center"}}>战队成员</p> style={{fontSize: "16px", color: "#05101A", width: "487px", textAlign: "center"}}>战队成员</p>
<p className="borders" <p className=" "
style={{fontSize: "16px", color: "#05101A", width: "134px", textAlign: "center"}}>学校</p> style={{fontSize: "16px", color: "#05101A", width: "134px", textAlign: "center"}}>学校</p>
<p className="borders" <p className=" "
style={{fontSize: "16px", color: "#05101A", width: "151px", textAlign: "center"}}>时间</p> style={{fontSize: "16px", color: "#05101A", width: "151px", textAlign: "center"}}>时间</p>
</div> </div>
</div> </div>

@ -6,72 +6,105 @@ import {
} from 'react-router-dom'; } from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import moment from 'moment'; import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder'; import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC'; import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css'; import competition from './comcss/competition.css';
import pexjiazai from './pexjiazai.png'
import {Button} from 'antd'; import {Button} from 'antd';
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队 // 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class RegisListviewdata extends React.Component { class RegisListviewdata extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = {
item: undefined
}
} }
componentDidMount() {
//console.log("RegisListviewdata");
//console.log(this.props.item)
this.setState({
item: this.props.item
})
}
render() { render() {
const {item} = this.props;
return ( return (
<div className="regitem"> <div>
<div className="regitemimg1 borders"> {
<div className="regitemimg2"> item !== undefined ?
<div className={"yslborderbottom"}>
<div className="regitem22">
<div className="regitemimg1 ">
<img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}>
</img>
<p>{item.creator.name}</p>
</div> </div>
<p>小猫头像</p> <div style={{
</div>
<div className="borders" style={{
marginTop: "29px", marginTop: "29px",
marginLeft: "37px" marginLeft: "37px"
}}> }}>
<p style={{ <p style={{
border: "1px solid",
color: "#05101A", color: "#05101A",
fontSize: "16px", fontSize: "16px",
width: "160px", width: "160px",
textAlign: "center" textAlign: "center"
}}>重庆邮电大学</p> }}>{item.name}</p>
</div> </div>
<div className="borders" style={{ <div style={{
marginLeft: "37px", marginLeft: "37px",
display: "flex", display: "flex",
flexDirection: "initial", flexDirection: "initial",
width: "487px" width: "487px"
}}> }}>
<div className="regitemimgs">
</div> {
<div className="regitemimgs2"> item && item.team_members.map((item, index) => {
return (
</div> index === 0 ?
<div className="regitemimgs2"> <img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
</div> </img>
<div className="regitemimgs2"> : index === 1 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div> </img>
<div className="regitemimgs2"> : index === 2 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div> </img>
<div className="regitemimgs2"> : index === 3 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div> </img>
<div className="regitemimgs22"> : index === 4 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
<img className="regitemimgs22" src={pexjiazai}>
</img>
</div> </div>
: ""
)
})
}
</div> </div>
<div className="borders" style={{ <div style={{
marginLeft: "37px", marginLeft: "41px",
width: "134px", width: "134px",
marginTop: "29px", marginTop: "29px",
}}> }}>
@ -79,9 +112,9 @@ class RegisListviewdata extends React.Component {
color: "#05101A", color: "#05101A",
fontSize: "16px", fontSize: "16px",
textAlign: "center" textAlign: "center"
}}>重庆邮电大学</p> }}>{item.school_name}</p>
</div> </div>
<div className="borders" style={{ <div style={{
marginLeft: "37px", marginLeft: "37px",
width: "151px", width: "151px",
marginTop: "29px", marginTop: "29px",
@ -91,10 +124,12 @@ class RegisListviewdata 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>
: ""
}
</div> </div>

@ -9,7 +9,7 @@ import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder'; import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC'; import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css'; import competition from './comcss/competition.css';
import {Button, Pagination, message} from 'antd'; import {Button, Pagination, message, Spin} from 'antd';
import Registrationitem from './Registrationitem'; import Registrationitem from './Registrationitem';
import RegisNodata from './RegisNodata'; import RegisNodata from './RegisNodata';
import CompetitionMaxImg from './CompetitionMaxImg'; import CompetitionMaxImg from './CompetitionMaxImg';
@ -19,7 +19,10 @@ import RegisListviewdata from './RegisListviewdata';
import PersonModal from './competmodal/PersonModal'; import PersonModal from './competmodal/PersonModal';
import MessagePersonModal from './competmodal/MessagePersonModal'; import MessagePersonModal from './competmodal/MessagePersonModal';
import PersonalModalteam from './competmodal/PersonalModalteam'; import PersonalModalteam from './competmodal/PersonalModalteam';
import PersonalCompetititem from './personal/PersonalCompetititem' import PersonalCompetititem from './personal/PersonalCompetititem';
import ExittheteamModel from './competmodal/ExittheteamModel';
import pexjiazai from "./pexjiazai.png";
// 团队竞赛报名无报名 // 团队竞赛报名无报名
class Registration extends React.Component { class Registration extends React.Component {
/*** /***
@ -28,6 +31,7 @@ class Registration extends React.Component {
*"enrolled: false, // 是否已经报名 *"enrolled: false, // 是否已经报名
*"teacher_staff": { // 为空表示不支持老师报名 *"teacher_staff": { // 为空表示不支持老师报名
*"member_staff": { // 为空表示不支持学生报名 *"member_staff": { // 为空表示不支持学生报名
* personal// 是否是个人赛
* **/ * **/
constructor(props) { constructor(props) {
super(props) super(props)
@ -44,6 +48,7 @@ class Registration extends React.Component {
page: 1, page: 1,
per_page: 20, per_page: 20,
data: [], data: [],
competition_teams: [],
count: 0, count: 0,
GetenrollmentAPI: undefined, GetenrollmentAPI: undefined,
personal: false, personal: false,
@ -53,29 +58,65 @@ class Registration extends React.Component {
member_staff: null, member_staff: null,
messagePer: "提示", messagePer: "提示",
messagePerbool: false, messagePerbool: false,
intpermessages: "确认" intpermessages: "确认",
messageexit: "提示",
messageexitol: false,
exitintpermessages: "是否退出战队",
itemid: undefined,
itemiddata: [],
pint: 0,
} }
} }
componentDidMount() { componentDidMount() {
//console.log("componentDidMount Registration"); // ////console.log("componentDidMount Registration");
// ////console.log("调用子组件 "); // //// ////console.log("调用子组件 ");
//console.log(this.props.isAdmin()); // ////console.log(this.props.isAdmin());
// ////console.log(this.props.isAdmin()) // //// ////console.log(this.props.isAdmin())
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page);
this.GetenrollmentAPI(); this.GetenrollmentAPI();
this.Getthenavigationbar();
}
componentDidUpdate = (prevProps) => {
if (prevProps.user != this.props.user) {
//console.log("Registration");
//console.log("componentDidUpdate");
//console.log(this.props.user.admin);
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
} }
}
// 获取导航栏
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("Getthenavigationbar");
console.log(result);
}
}
}).catch((error) => {
//// ////console.log(error);
})
}
//获取报名配置API //获取报名配置API
GetenrollmentAPI = () => { GetenrollmentAPI = () => {
const url = `/competitions/${"gcc-course-2019"}/competition_staff.json`; const url = `/competitions/${"gcc-task-2020"}/competition_staff.json`;
axios.get((url)).then((result) => { axios.get((url)).then((result) => {
if (result) { if (result) {
if (result.data) { if (result.data) {
////console.log("获取报名配置API"); //// ////console.log("获取报名配置API");
////console.log(result); //// ////console.log(result);
this.setState({ this.setState({
GetenrollmentAPI: result.data, GetenrollmentAPI: result.data,
personal: result.data.personal, personal: result.data.personal,
@ -84,14 +125,27 @@ class Registration extends React.Component {
teacher_staff: result.data.teacher_staff, teacher_staff: result.data.teacher_staff,
member_staff: result.data.member_staff, member_staff: result.data.member_staff,
}) })
if (result.data.enroll_ended === true) {
this.setState({
pint: 0
})
} else if (result.data.enrolled === true) {
this.setState({
pint: 2
})
} else if (result.data.enrolled === false) {
this.setState({
pint: 1
})
}
} }
} }
}).catch((error) => { }).catch((error) => {
////console.log(error); //// ////console.log(error);
}) })
} }
Getdata = (keyword, page, per_page) => { Getdata = (keyword, page, per_page, admin) => {
//搜索关键字 keyword //搜索关键字 keyword
//页数 page //页数 page
//分页 per_page //分页 per_page
@ -100,66 +154,234 @@ class Registration extends React.Component {
page: page, page: page,
per_page: per_page, per_page: per_page,
}; };
let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`; let url = `/competitions/${"gcc-task-2020"}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => { axios.get((url), {params: datas}).then((result) => {
if (result) { if (result) {
if (result.data) { if (result.data) {
////console.log(result); //// ////console.log(result);\
if (result.data.count === 0) { if (result.data.personal === false) {
//不是个人赛
if (result.data.my_teams.length === 0) {
// 没有创建数据的 // 没有创建数据的
if (this.props.isAdmin() === true) { if (admin === true) {
//管理员 //管理员
this.setState({ this.setState({
type: 4, type: 4,
count: result.data.count, count: result.data.count,
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
}) })
} else { } else {
//普通人 //普通账号
this.setState({ this.setState({
type: 1, type: 1,
count: result.data.count, count: result.data.count,
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
}) })
} }
} else { } else {
//有数据的 //有数据的
if (this.props.isAdmin() === true) {
if (admin === true) {
if (result.data.my_teams[0].manage_permission === true) {
this.setState({ this.setState({
type: 5, type: 5,
data: result.data.competition_teams, data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} else {
this.setState({
type: 4,
data: result.data.my_teams,
count: result.data.count, count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
}) })
}
} else { } else {
if (result.data.competition_teams[0].manage_permission === true) { if (result.data.my_teams[0].manage_permission === true) {
//学生true 为创建了竞赛 //普通账号true 为创建了竞赛
this.setState({ this.setState({
type: 2, type: 2,
data: result.data.competition_teams, data: result.data.my_teams,
count: result.data.count, count: result.data.count,
personal: result.data.personal,
}) })
} else { } else {
//学生true 加入了竞赛 //普通账号true 加入了竞赛
this.setState({ this.setState({
type: 3, type: 3,
data: result.data.competition_teams, data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
})
}
}
}
} else {
this.setState({
type: 6,
data: result.data.my_teams,
count: result.data.count, count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
}
}
this.setState({
loadingstate: false,
})
}).catch((error) => {
if (admin === true) {
//管理员
this.setState({
type: 4,
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
})
} else {
//普通账号
this.setState({
type: 1,
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
}) })
} }
})
} }
Getdatatype5 = (keyword, page, per_page, admin) => {
//搜索关键字 keyword
//页数 page
//分页 per_page
const datas = {
keyword: keyword,
page: page,
per_page: per_page,
};
let url = `/competitions/${"gcc-task-2020"}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
this.setState({
loadingstate: false,
})
if (result) {
if (result.data) {
//// ////console.log(result);
if (result.data.personal === false) {
//不是个人赛
//console.log("Getdatatype5");
//console.log(result.data.my_teams.length);
if (result.data.my_teams.length === 0) {
// 没有创建数据的
//管理员
//console.log("a");
//console.log(this.state.competition_teams);
//console.log(result.data.competition_teams);
this.setState({
type: 4,
count: result.data.count,
competition_teams: result.data.competition_teams,
data: result.data.my_teams,
personal: result.data.personal,
})
} else {
//有数据的
//console.log("b");
if (result.data.my_teams[0].manage_permission === true) {
this.setState({
type: 5,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} else {
//console.log("c");
this.setState({
type: 4,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
}
} }
} else {
//团队赛
//console.log("d");
this.setState({
type: 6,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
})
} }
} }
}
}).catch((error) => { }).catch((error) => {
////console.log(error); //console.log("k");
//console.log(error);
//console.log("报错了");
if (admin === true) {
//管理员
this.setState({
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
})
} else {
//普通账号
this.setState({
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
}) })
} }
})
}
//团队竞赛翻页
paginationonChangestwo = (pageNumber) => { paginationonChangestwo = (pageNumber) => {
this.setState({ this.setState({
pages: pageNumber, pages: pageNumber,
loadingstate: true, loadingstate: true,
}) })
const {keyword, per_page} = this.state;
this.Getdatatype5(keyword, pageNumber, per_page, this.props.user.admin);
}; };
/** /**
* 加入战队 * 加入战队
@ -246,7 +468,8 @@ class Registration extends React.Component {
return; return;
} }
this.setState({ this.setState({
tmodalsType: true tmodalsType: true,
Newtit: true,
}) })
} else { } else {
//学生 //学生
@ -259,16 +482,20 @@ class Registration extends React.Component {
return; return;
} }
this.setState({ this.setState({
tmodalsType: true tmodalsType: true,
Newtit: true,
}) })
} }
// this.setState({
// tmodalsType: true
// })
} }
//编辑战队
Createateamedit = (data) => {
this.setState({
tmodalsType: true,
Newtit: false,
itemiddata: data
})
}
Tmoconfirm = (bool) => { Tmoconfirm = (bool) => {
//boolfalse 取消 true 确认 //boolfalse 取消 true 确认
this.setState({ this.setState({
@ -285,7 +512,7 @@ class Registration extends React.Component {
} }
} }
//创建战队确认
Tmoconfirm1 = (bool) => { Tmoconfirm1 = (bool) => {
//boolfalse 取消 true 确认 //boolfalse 取消 true 确认
this.setState({ this.setState({
@ -293,8 +520,7 @@ class Registration extends React.Component {
}) })
if (bool) { if (bool) {
//确认 //确认
this.Refreshteam();
} else { } else {
//取消 //取消
@ -308,12 +534,136 @@ class Registration extends React.Component {
messagePerbool: false messagePerbool: false
}) })
} }
//显示退出战队弹框
Exittheteamshow = (itemid, bool) => {
if (bool === true) {
this.setState({
messageexitol: true,
itemid: itemid,
exitintpermessages: "是否删除战队",
})
} else {
this.setState({
messageexitol: true,
itemid: itemid,
exitintpermessages: "是否退出战队",
})
}
};
//刷新战队
Refreshteam = () => {
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
this.GetenrollmentAPI();
}
//退出战队
Exittheteam = (bool) => {
// ////console.log(this.state.itemid);
if (bool) {
this.setState({
messageexitol: true
})
let url = `/competitions/${"gcc-task-2020"}/competition_teams/${this.state.itemid}/leave.json`;
axios.post(url).then((response) => {
if (response) {
if (response.data) {
////console.log("退出战队");
////console.log(response);
this.Refreshteam();
this.setState({
messageexitol: false
})
}
}
}).catch((error) => {
////console.log(error)
});
} else {
this.setState({
messageexitol: false
})
}
}
//搜索战队
RegistrationSearchvalue = (value) => {
//console.log("RegistrationSearchvalue");
//console.log(this.props.user.admin);
this.setState({
pages: 1,
limit: 20,
})
this.Getdatatype5(value, 1, 20, this.props.user.admin);
}
//个人竞赛
// /competitions/:identifier/competition_teams.json
Personalregistration = () => {
let {teacher_staff, member_staff, data, enroll_ended} = this.state;
if (enroll_ended === true) {
//已截止
this.props.showNotification(`报名已截止`);
return;
}
if (teacher_staff) {
if (teacher_staff.mutiple_limited) {
if (teacher_staff.mutiple_limited === true) {
if (data) {
if (data.length > teacher_staff.maximum) {
this.props.showNotification(`你已经报名,不能重复报名!`);
return
}
}
}
}
}
if (member_staff) {
if (member_staff.mutiple_limited) {
if (member_staff.mutiple_limited === true) {
if (data) {
if (data.length > member_staff.maximum) {
this.props.showNotification(`你已经报名,不能重复报名!`);
return;
}
}
}
}
}
const url = `/competitions/${"gcc-task-2020"}/competition_teams.json`;
axios.post(url).then((response) => {
if (response) {
if (response.data) {
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
this.Refreshteam();
}
}
}).catch((error) => {
});
}
render() { render() {
const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data} = this.state; const {test, page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint} = this.state;
const listItems = test.map((item, index) => // var listItems = "";
<RegisListviewdata></RegisListviewdata>
); // if (competition_teams) {
// listItems = competition_teams.map((item, index) =>
//
// );
// }
// const listItemss = test.map((item, index) =>
//
// );
return ( return (
<div className="newMain clearfix "> <div className="newMain clearfix ">
@ -329,12 +679,36 @@ class Registration extends React.Component {
` `
} }
</style> </style>
{
messagePerbool === true ?
<MessagePersonModal messagePer={this.state.messagePer} {...this.props} {...this.state} <MessagePersonModal messagePer={this.state.messagePer} {...this.props} {...this.state}
messagePerboolbuton={() => this.messagePerboolbuton()}></MessagePersonModal> messagePerboolbuton={() => this.messagePerboolbuton()}
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={true} GetenrollmentAPI={GetenrollmentAPI}></MessagePersonModal>
: ""
}
{
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)}></PersonModal>
:
""
}
{
tmodalsTypes === true ?
<PersonalModalteam tmodalsTypes={tmodalsTypes} {...this.props} {...this.state} <PersonalModalteam tmodalsTypes={tmodalsTypes} {...this.props} {...this.state}
GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam> Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam>
: ""
}
{
messageexitol === true ?
<ExittheteamModel {...this.props} {...this.state} GetenrollmentAPI={GetenrollmentAPI}
Exittheteam={(bool) => this.Exittheteam(bool)}></ExittheteamModel>
: ""
}
<div className="educontent mb20 "> <div className="educontent mb20 ">
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue ">在线竞赛</a> <a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>
@ -347,25 +721,62 @@ class Registration extends React.Component {
</div> </div>
{/*大图*/} {/*大图*/}
<CompetitionMaxImg type={type} Jointheteam={() => this.Jointheteam()} <CompetitionMaxImg type={type} Jointheteam={() => this.Jointheteam()}
pint={pint}
{...this.props} {...this.state} {...this.props} {...this.state}
Createateam={() => this.Createateam()}></CompetitionMaxImg> Createateam={() => this.Createateam()}
Personalregistration={() => this.Personalregistration()}
></CompetitionMaxImg>
{/*大图结尾*/} {/*大图结尾*/}
{/*没数据*/} {/*没数据*/}
{
pint === 1 || pint === 3 ?
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>{data === null || data === undefined ? 0 : data.length}</span>
</p>
</div>
: ""}
{/*列表*/}
{
type === 6 ?
<div
style={{
marginTop: "31px"
}}
>
<Spin spinning={loadingstate}>
{
data && data.map((item, index) => {
return (
<Registrationitem key={index} item={item}></Registrationitem>
)
})
}
</Spin>
</div>
: ""}
{ {
type === 1 ? type === 1 ?
<RegisNodata></RegisNodata> <RegisNodata></RegisNodata>
: :
"" ""
} }
{/*普通账号出现单人 战队弹框*/}
{ {
type === 2 || type === 3 || type === 5 ? type === 2 || type === 3 || type === 5 ?
<PersonalCompetititem type={type} data={data}></PersonalCompetititem> <PersonalCompetititem type={type} data={data}
Exittheteamshow={(itemid) => this.Exittheteamshow(itemid)}
Createateamedit={(itemid) => this.Createateamedit(itemid)}></PersonalCompetititem>
: "" : ""
} }
{ {
type === 4 || type === 5 ? type === 4 || type === 5 ?
<RegistrationSearch></RegistrationSearch> <RegistrationSearch count={count}
RegistrationSearchvalue={(value) => this.RegistrationSearchvalue(value)}></RegistrationSearch>
: "" : ""
} }
{/*<Registrationitem></Registrationitem>*/} {/*<Registrationitem></Registrationitem>*/}
@ -378,19 +789,38 @@ class Registration extends React.Component {
{type === 4 || type === 5 ? {type === 4 || type === 5 ?
listItems <Spin spinning={loadingstate}>
{
competition_teams && competition_teams.map((item, index) => {
return (
<RegisListviewdata key={index} item={item}></RegisListviewdata>
)
})
}
</Spin>
: :
"" ""
} }
{ {
type === 4 || type === 5 ? type === 4 || type === 5 ?
(
count < 20 ? <div style={{
height: "20px",
minHeight: "20px"
}}></div> :
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}> <div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
<Pagination showQuickJumper current={pages} <Pagination showQuickJumper current={pages}
onChange={this.paginationonChangestwo} pageSize={limit} onChange={this.paginationonChangestwo} pageSize={limit}
total={30}></Pagination> total={count}></Pagination>
</div> </div>
: "" )
: <div style={{
height: "20px",
minHeight: "20px"
}}></div>
} }
</div> </div>

@ -24,15 +24,22 @@ class RegistrationSearch extends React.Component {
this.setState({ this.setState({
keywords: e.target.value keywords: e.target.value
}) })
}; };
setdatafuns = (value) => { setdatafuns = (value) => {
console.log("点击了搜索"); console.log("setdatafuns点击了搜索");
console.log(value);
this.setState({ this.setState({
keywords: value keywords: value
}) })
this.props.RegistrationSearchvalue(value);
}; };
myonPressEnter = (e) => {
console.log("点击了回车setdatafunsval点击了搜索");
console.log(e.target.value);
this.props.RegistrationSearchvalue(e.target.value);
}
render() { render() {
return ( return (
<div className="searchhead"> <div className="searchhead">
@ -42,10 +49,20 @@ class RegistrationSearch extends React.Component {
value={this.state.keywords} value={this.state.keywords}
enterButton={<span>搜索</span>} enterButton={<span>搜索</span>}
onInput={(e) => this.setdatafunsval(e)} onInput={(e) => this.setdatafunsval(e)}
onSearch={(value) => this.setdatafuns(value)}/> onSearch={(value) => this.setdatafuns(value)}
onPressEnter={(e) => this.myonPressEnter(e)}
/>
<p style={{color: "#07140E", fontSize: "16px", marginTop: "7px", marginLeft: "760px"}}>战队总数<span <p style={{
style={{color: "#459BE5", fontSize: "16px"}}>271</span></p> width: "300px",
color: "#07140E",
fontSize: '16px',
marginTop: " 7px",
marginLeft: "583px",
textAlign: "right",
lineHeight: " 24px"
}}>战队总数<span
style={{color: "#459BE5", fontSize: "16px"}}>{this.props.count}</span></p>
</div> </div>
) )
} }

@ -6,7 +6,7 @@ import {
} from 'react-router-dom'; } from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import moment from 'moment'; import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder'; import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC'; import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css'; import competition from './comcss/competition.css';
import {Button} from 'antd'; import {Button} from 'antd';
@ -22,14 +22,16 @@ class Registrationitem extends React.Component {
render() { render() {
let {item} = this.props;
return ( return (
<div className="yslborderbottom">
{
item !== undefined ?
<div className="regitem2"> <div className="regitem2">
<div className="perregitemimg1 "> <div className="perregitemimg1 ">
<div className="personregitemimg"> <img className="personregitemimg" src={getImageUrl("images/" + item.creator.image_url)}>
</div> </img>
</div> </div>
<div className="" style={{ <div className="" style={{
marginTop: "19px", marginTop: "19px",
@ -42,14 +44,19 @@ class Registrationitem extends React.Component {
fontSize: "16px", fontSize: "16px",
width: "160px", width: "160px",
textAlign: "center" textAlign: "center"
}}>小猫头像</p> }}>{item.creator.name}</p>
{
item.manage_permission === true ?
<p className="" style={{ <p className="" style={{
color: "#459BE5", color: "#459BE5",
fontSize: "16px", fontSize: "16px",
textAlign: "center", textAlign: "center",
marginLeft: "25px", marginLeft: "25px",
}}>已报名</p> }}>已报名</p>
:
""
}
</div> </div>
<div className="" style={{ <div className="" style={{
@ -62,12 +69,13 @@ 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>
: ""
}
</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;
@ -301,14 +302,42 @@
.regitem { .regitem {
display: flex; display: flex;
flex-direction: initial; flex-direction: initial;
border-bottom: 1px solid #EDEDED;
margin-top: 44px; margin-top: 44px;
} }
.regitem2 { .regitem22 {
display: flex; display: flex;
flex-direction: initial; flex-direction: initial;
margin-top: 27px;
margin-bottom: 19px;
}
.yslborderbottom {
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 {
display: flex;
flex-direction: initial;
padding-bottom: 18px;
margin-top: 19px; margin-top: 19px;
} }
@ -328,16 +357,17 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-left: 26px; margin-left: 26px;
padding-bottom: 18px;
} }
.regitemimg2 { .regitemimg2 {
height: 78px; height: 78px;
width: 78px; width: 78px;
background-color: transparent;
margin-bottom: 9px;
} }
.personregitemimg { .personregitemimg {
border: 0.5px solid;
height: 64px; height: 64px;
width: 64px; width: 64px;
} }
@ -353,7 +383,7 @@
width: 69px; width: 69px;
height: 69px; height: 69px;
margin-top: 3px; margin-top: 3px;
background-color: transparent;
} }
.regitemimgs2 { .regitemimgs2 {
@ -375,7 +405,7 @@
height: 22px; height: 22px;
width: 22px; width: 22px;
font-size: 21px !important; font-size: 21px !important;
margin-top: 22px; margin-top: 21px;
color: #1C91E8; color: #1C91E8;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

@ -0,0 +1,59 @@
import React, {Component} from 'react';
import {getImageUrl} from 'educoder';
import {Modal, Input, Spin, Tooltip, Icon, Dropdown, Button} from 'antd';
import axios from 'axios';
import competition from '../comcss/competition.css';
import Registrationitem from "../Registrationitem";
import InfiniteScroll from 'react-infinite-scroller';
// import PersonModaltion from "./PersonModaltion";
const {Search} = Input;
//退出战队
class ExittheteamModel extends React.Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
const {
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2
} = this.state;
//Modal
//keyboard是否支持键盘 esc 关闭
//closable 是否显示右上角的关闭按钮
//底部内容,当不需要默认底部按钮时,可以设为 footer={null}
//destroyOnClose 关闭时销毁 Modal 里的子元素
//centered 垂直居中展示 Modal
//visible 弹出框是否显示
return (
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title={this.props.messageexit}
centered={true}
visible={this.props.messageexitol === undefined ? false : this.props.messageexitol}
width="480px"
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{this.props.exitintpermessages}</div>
</div>
<div className="task-popup-submit clearfix">
<a className="pop_close task-btn mb10 mr40 colorFFF"
onClick={() => this.props.Exittheteam(false)}>取消</a>
<a className="task-btn task-btn-orange fr" onClick={() => this.props.Exittheteam(true)}>确定</a>
</div>
</Modal>
)
}
}
export default ExittheteamModel;

@ -61,9 +61,9 @@ class PersonModal extends Component {
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if (prevProps.user != this.props.user) { if (prevProps.user != this.props.user) {
console.log("Registration.js componentDidUpdate"); //console.log("Registration.js componentDidUpdate");
console.log(this.props); //console.log(this.props);
//console.log(prevProps); // //console.log(prevProps);
//identity职场称 //identity职场称
//user_school学校 //user_school学校
//real_name姓名 //real_name姓名
@ -86,8 +86,8 @@ class PersonModal extends Component {
} }
if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) { if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) {
console.log("Registration.js GetenrollmentAPIcomponentDidUpdate"); //console.log("Registration.js GetenrollmentAPIcomponentDidUpdate");
console.log(this.props); //console.log(this.props);
this.setState({ this.setState({
GetenrollmentAPI: this.props.GetenrollmentAPI, GetenrollmentAPI: this.props.GetenrollmentAPI,
}) })
@ -95,6 +95,8 @@ class PersonModal extends Component {
}; };
//创建战队 //创建战队
Createateam = () => { Createateam = () => {
const {polls_nametest, mydatas, GetenrollmentAPI} = this.state; const {polls_nametest, mydatas, GetenrollmentAPI} = this.state;
var myteaherdata = []; var myteaherdata = [];
var myshtudentdata = []; var myshtudentdata = [];
@ -102,25 +104,26 @@ class PersonModal extends Component {
for (var a = 0; a < mydatas.length; a++) { for (var a = 0; a < mydatas.length; a++) {
if (mydatas[a].type === "导师") { if (mydatas[a].type === "导师") {
i++; i++;
var objectt = { // var objectt = {
enrollable: mydatas[a].enrollable, // enrollable: mydatas[a].enrollable,
id: mydatas[a].id, // id: mydatas[a].id,
identity: mydatas[a].identity, // identity: mydatas[a].identity,
name: mydatas[a].name, // name: mydatas[a].name,
school_name: mydatas[a].school_name, // school_name: mydatas[a].school_name,
} // }
myteaherdata.push(objectt); myteaherdata.push(mydatas[a].id);
} else if (mydatas[a].type === "队员") { } else if (mydatas[a].type === "队员") {
var objectts = { // var objectts = {
enrollable: mydatas[a].enrollable, // enrollable: mydatas[a].enrollable,
id: mydatas[a].id, // id: mydatas[a].id,
name: mydatas[a].name, // name: mydatas[a].name,
school_name: mydatas[a].school_name, // school_name: mydatas[a].school_name,
student_id: mydatas[a].student_id, // student_id: mydatas[a].student_id,
} // }
myshtudentdata.push(objectts); myshtudentdata.push(mydatas[a].id);
} }
} }
if (GetenrollmentAPI) {
if (GetenrollmentAPI !== undefined || GetenrollmentAPI !== null) { if (GetenrollmentAPI !== undefined || GetenrollmentAPI !== null) {
if (GetenrollmentAPI.teacher_staff !== undefined || GetenrollmentAPI.teacher_staff !== null) { if (GetenrollmentAPI.teacher_staff !== undefined || GetenrollmentAPI.teacher_staff !== null) {
if (GetenrollmentAPI.teacher_staff.minimum > i) { if (GetenrollmentAPI.teacher_staff.minimum > i) {
@ -144,43 +147,46 @@ class PersonModal extends Component {
} }
} }
}
// Thecurrentnumber // Thecurrentnumber
if (this.props.Newtit === true) {
//创建新的战队
let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`; let url = `/competitions/${"gcc-course-2019"}/competition_teams.json`;
axios.post(url, { axios.post(url, {
name: polls_nametest, name: polls_nametest,
teacher_ids: myteaherdata, teacher_ids: myteaherdata,
member_ids: myshtudentdata, member_ids: myshtudentdata,
}).then((result) => { }).then((result) => {
//console.log("获取到创建战队的数据"); // //console.log("获取到创建战队的数据");
//console.log(result); // //console.log(result);
if (result) { if (result) {
if (result.data) { if (result.data) {
this.props.Tmoconfirm1(true); this.props.Tmoconfirm1(true);
} }
} }
}).catch((error) => { }).catch((error) => {
//console.log(error) // //console.log(error)
}); });
} else {
} //编辑战队
creident = (name, teacher_ids, member_ids) => { let url = `/competitions/${"gcc-course-2019"}/competition_teams/${"gcc-course-2019"}.json`;
let collaborators = `/competitions/${"gcc-course-2019"}/competition_teams.json`; axios.post(url, {
axios.post(collaborators, { name: polls_nametest,
name: name, teacher_ids: myteaherdata,
teacher_ids: teacher_ids, member_ids: myshtudentdata,
member_ids: member_ids,
}).then((result) => { }).then((result) => {
// //console.log("获取到编辑战队的数据");
// //console.log(result);
if (result) { if (result) {
if (result.data) { if (result.data) {
this.props.Tmoconfirm1(true);
} }
} }
}).catch((error) => { }).catch((error) => {
//console.log(error) // //console.log(error)
}); });
} }
}
Getteacherdata = (keywordteachers, team_idteachers, teacher_ids) => { Getteacherdata = (keywordteachers, team_idteachers, teacher_ids) => {
this.setState({ this.setState({
person1: true, person1: true,
@ -189,7 +195,7 @@ class PersonModal extends Component {
//老师姓名 keyword //老师姓名 keyword
//当前战队ID team_id //当前战队ID team_id
//当前老师ID数组 teacher_ids //当前老师ID数组 teacher_ids
//console.log("搜索的老师"); // //console.log("搜索的老师");
const datas = { const datas = {
keyword: keywordteachers, keyword: keywordteachers,
team_id: team_idteachers, team_id: team_idteachers,
@ -199,14 +205,14 @@ class PersonModal extends Component {
axios.get((url), {params: datas}).then((result) => { axios.get((url), {params: datas}).then((result) => {
if (result) { if (result) {
if (result.data) { if (result.data) {
//console.log(result); // //console.log(result);
this.setState({ this.setState({
teacher_ids: result.data.teachers teacher_ids: result.data.teachers
}) })
} }
} }
}).catch((error) => { }).catch((error) => {
//console.log(error); // //console.log(error);
}) })
}; };
Getstudentsdata = (keywordstudents, team_idstudents, student_ids) => { Getstudentsdata = (keywordstudents, team_idstudents, student_ids) => {
@ -217,7 +223,7 @@ class PersonModal extends Component {
//学生姓名 keyword //学生姓名 keyword
//当前战队ID team_id //当前战队ID team_id
//当前队员ID数组 student_ids //当前队员ID数组 student_ids
//console.log("搜索的学生"); // //console.log("搜索的学生");
const datas = { const datas = {
keyword: keywordstudents, keyword: keywordstudents,
team_id: team_idstudents, team_id: team_idstudents,
@ -227,7 +233,7 @@ class PersonModal extends Component {
axios.get((url), {params: datas}).then((result) => { axios.get((url), {params: datas}).then((result) => {
if (result) { if (result) {
if (result.data) { if (result.data) {
//console.log(result); // //console.log(result);
this.setState({ this.setState({
member_ids: result.data.teachers member_ids: result.data.teachers
}) })
@ -235,14 +241,14 @@ class PersonModal extends Component {
} }
} }
}).catch((error) => { }).catch((error) => {
//console.log(error); // //console.log(error);
}) })
}; };
//老师输入框事件 //老师输入框事件
teacheronChange = (e) => { teacheronChange = (e) => {
//console.log(e.target.value); // //console.log(e.target.value);
//console.log("老师输入框事件|||||||||||123123123"); // //console.log("老师输入框事件|||||||||||123123123");
this.setState({ this.setState({
keywordteachers: e.target.value, keywordteachers: e.target.value,
booltech: false, booltech: false,
@ -280,8 +286,8 @@ class PersonModal extends Component {
//学生输入框事件 //学生输入框事件
studentsonChange = (e) => { studentsonChange = (e) => {
//console.log("学生输入框事件"); // //console.log("学生输入框事件");
//console.log(e); // //console.log(e);
this.setState({ this.setState({
keywordstudents: e.target.value, keywordstudents: e.target.value,
boolstud: false, boolstud: false,
@ -331,9 +337,9 @@ class PersonModal extends Component {
}; };
var fordabool = false; var fordabool = false;
var forda = this.state.mydatas; var forda = this.state.mydatas;
//console.log("点击获取老师数据"); // //console.log("点击获取老师数据");
//console.log(object); // //console.log(object);
//console.log(forda); // //console.log(forda);
for (var i = 0; i < forda.length; i++) { for (var i = 0; i < forda.length; i++) {
if (forda[i].id) { if (forda[i].id) {
if (forda[i].id === object.id) { if (forda[i].id === object.id) {
@ -372,14 +378,14 @@ class PersonModal extends Component {
}; };
var fordabool = false; var fordabool = false;
var forda = this.state.mydatas; var forda = this.state.mydatas;
//console.log("点击获取学生数据2"); // //console.log("点击获取学生数据2");
//console.log(object); // //console.log(object);
//console.log(forda); // //console.log(forda);
for (var i = 0; i < forda.length; i++) { for (var i = 0; i < forda.length; i++) {
if (forda[i].id) { if (forda[i].id) {
// //console.log(true); // // //console.log(true);
// //console.log(forda[i].id); // // //console.log(forda[i].id);
// //console.log(object.id); // // //console.log(object.id);
if (forda[i].id === object.id) { if (forda[i].id === object.id) {
fordabool = true; fordabool = true;
break break
@ -407,7 +413,7 @@ class PersonModal extends Component {
} }
//输入框事件 //输入框事件
changeTopicName = (e) => { changeTopicName = (e) => {
// //console.log("调用了changeTopicName"); // // //console.log("调用了changeTopicName");
let num = parseInt(e.target.value.length); let num = parseInt(e.target.value.length);
if (num > 60) { if (num > 60) {
return; return;
@ -422,7 +428,7 @@ class PersonModal extends Component {
//onSearchsou //onSearchsou
onSearch = (value) => { onSearch = (value) => {
//console.log("搜索的数据" + value); // //console.log("搜索的数据" + value);
}; };
handleInfiniteOnLoad = () => { handleInfiniteOnLoad = () => {
// this.setState({ // this.setState({
@ -442,12 +448,12 @@ class PersonModal extends Component {
} }
handleInfiniteOnLoad1 = () => { handleInfiniteOnLoad1 = () => {
// //console.log("调用了方法1111"); // // //console.log("调用了方法1111");
// this.setState({ // this.setState({
// loading1: true, // loading1: true,
// }) // })
// setTimeout(() => { // setTimeout(() => {
// //console.log("调用了方法11112"); // // //console.log("调用了方法11112");
// this.setState({ // this.setState({
// loading1: false, // loading1: false,
// hasMore: true, // hasMore: true,
@ -456,13 +462,13 @@ class PersonModal extends Component {
} }
handleInfiniteOnLoad2 = () => { handleInfiniteOnLoad2 = () => {
// //console.log("调用了方法1111"); // // //console.log("调用了方法1111");
// this.setState({ // this.setState({
// loading2: true, // loading2: true,
// //
// }) // })
// setTimeout(() => { // setTimeout(() => {
// //console.log("调用了方法11113"); // // //console.log("调用了方法11113");
// this.setState({ // this.setState({
// hasMore: true, // hasMore: true,
// loading2: false, // loading2: false,
@ -471,23 +477,23 @@ class PersonModal extends Component {
} }
inputOnBlur = (e) => { inputOnBlur = (e) => {
//console.log("inputOnBlur"); // //console.log("inputOnBlur");
//console.log(e); // //console.log(e);
this.setState({ this.setState({
person1: false person1: false
}) })
} }
inputOnBlur2 = (e) => { inputOnBlur2 = (e) => {
//console.log("inputOnBlur"); // //console.log("inputOnBlur");
//console.log(e); // //console.log(e);
this.setState({ this.setState({
person2: false person2: false
}) })
} }
startSearch = (e) => { startSearch = (e) => {
//console.log("startSearch"); // //console.log("startSearch");
//console.log(e); // //console.log(e);
this.setState({ this.setState({
person1: true, person1: true,
person2: false, person2: false,
@ -497,8 +503,8 @@ class PersonModal extends Component {
} }
startSearch2 = (e) => { startSearch2 = (e) => {
//console.log("startSearch2"); // //console.log("startSearch2");
//console.log(e); // //console.log(e);
this.setState({ this.setState({
person1: false, person1: false,
person2: true, person2: true,
@ -508,8 +514,8 @@ class PersonModal extends Component {
} }
inputOnFocus = (e) => { inputOnFocus = (e) => {
//console.log("inputOnFocus"); // //console.log("inputOnFocus");
//console.log(e); // //console.log(e);
try { try {
if (this.state.keywordteachers && this.state.keywordteachers.length > 0) { if (this.state.keywordteachers && this.state.keywordteachers.length > 0) {
this.setState({ this.setState({
@ -533,8 +539,8 @@ class PersonModal extends Component {
} }
inputOnFocus2 = (e) => { inputOnFocus2 = (e) => {
//console.log("inputOnFocus2"); // //console.log("inputOnFocus2");
//console.log(e); // //console.log(e);
try { try {
if (this.state.keywordstudents && this.state.keywordstudents.length > 0) { if (this.state.keywordstudents && this.state.keywordstudents.length > 0) {
this.setState({ this.setState({
@ -559,8 +565,8 @@ class PersonModal extends Component {
} }
inputOnFocus3 = (e) => { inputOnFocus3 = (e) => {
//console.log("inputOnFocus3"); // //console.log("inputOnFocus3");
//console.log(e); // //console.log(e);
this.setState({ this.setState({
person2: false, person2: false,
person1: false, person1: false,
@ -570,13 +576,13 @@ class PersonModal extends Component {
var {mydatas} = this.state; var {mydatas} = this.state;
if (item) { if (item) {
var pos = mydatas.indexOf(item); var pos = mydatas.indexOf(item);
// console.log("deletedata"); // //console.log("deletedata");
// console.log(pos); // //console.log(pos);
var removedItem = mydatas.splice(pos, 1); var removedItem = mydatas.splice(pos, 1);
// console.log("deletedata22222"); // //console.log("deletedata22222");
// console.log(removedItem) // //console.log(removedItem)
//removedItem 是被删除的元素 //removedItem 是被删除的元素
// console.log(mydatas) // //console.log(mydatas)
this.setState({ this.setState({
mydatas: mydatas, mydatas: mydatas,
}) })
@ -764,6 +770,8 @@ class PersonModal extends Component {
</Spin> </Spin>
</div> </div>
); );
console.log("PersonModal");
console.log(this.props);
return ( return (
<Modal <Modal
@ -780,7 +788,7 @@ class PersonModal extends Component {
<style> <style>
{ {
` `
.reglistviewdivss2 a:hover a:hover
{ {
background-color:#F6F4F4; background-color:#F6F4F4;
} }

@ -9,8 +9,20 @@ import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder'; import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC'; import {TPMIndexHOC} from '../../tpm/TPMIndexHOC';
import competition from '../comcss/competition.css'; import competition from '../comcss/competition.css';
import {Button} from 'antd'; import {Button, message} from 'antd';
import pexjiazai from '../pexjiazai.png'
// 点击按钮复制功能
function jsCopy() {
var e = document.getElementById("copy_invite_code");
e.select();
document.execCommand("Copy");
codesuccess()
}
function codesuccess() {
message.success('复制成功');
};
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队 // 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class PersonalCompetititem extends React.Component { class PersonalCompetititem extends React.Component {
constructor(props) { constructor(props) {
@ -22,7 +34,7 @@ class PersonalCompetititem extends React.Component {
} }
componentDidMount() { componentDidMount() {
// //console.log(this.props.data) // // //console.log(this.props.data)
this.setState({ this.setState({
data: this.props.data, data: this.props.data,
}) })
@ -37,21 +49,22 @@ class PersonalCompetititem extends React.Component {
} }
render() { render() {
const {data} = this.state; const {data} = this.props;
//console.log("PersonalCompetititem"); // //console.log("PersonalCompetititem");
//console.log(data); // //console.log(data);
//console.log(data[0]); // //console.log(data[0]);
//console.log(data&&data[0].creator.image_url); // //console.log(data&&data[0].creator.image_url);
// const listItems = mydatas.map((item, index) => // const listItems = mydatas.map((item, index) =>
// //
// ); // );
return ( return (
<div> <div>
{ {
data && data[0] ? <div className="regitem"> data && data[0] ? <div className={"yslborderbottom"}>
<div className="regitemimg1 " style={{ <div className="regitem" style={{
marginBottom: "16px", marginBottom: "19px",
}}> }}>
<div className="regitemimg1 ">
<img className="regitemimg2" src={getImageUrl("images/" + data[0].creator.image_url)}> <img className="regitemimg2" src={getImageUrl("images/" + data[0].creator.image_url)}>
</img> </img>
@ -61,7 +74,7 @@ class PersonalCompetititem extends React.Component {
width: "78px", width: "78px",
textAlign: "center" textAlign: "center"
}}>{data && data[0].name}</p> }}>{data[0].creator.name}</p>
</div> </div>
<div className=" " style={{ <div className=" " style={{
marginTop: "29px", marginTop: "29px",
@ -73,7 +86,7 @@ class PersonalCompetititem extends React.Component {
fontSize: "16px", fontSize: "16px",
width: "160px", width: "160px",
textAlign: "center" textAlign: "center"
}}>{data && data[0].school_name}</p> }}>{data[0].school_name}</p>
</div> </div>
<div className=" " style={{ <div className=" " style={{
marginLeft: "37px", marginLeft: "37px",
@ -90,30 +103,32 @@ class PersonalCompetititem extends React.Component {
</img> </img>
: index === 1 ? : index === 1 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}> <img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div> </img>
: index === 2 ? : index === 2 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}> <img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div> </img>
: index === 3 ? : index === 3 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}> <img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div> </img>
: index === 4 ? : index === 4 ?
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}> <img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</div> </img>
: index === 5 ? : index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
<div className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}> </img>
</div> <img className="regitemimgs22" src={pexjiazai}>
:
<div className="regitemimgs22" src={getImageUrl("images/" + item.image_url)}>
</img>
</div> </div>
: ""
) )
}) })
} }
@ -122,19 +137,42 @@ class PersonalCompetititem extends React.Component {
<div className=" " style={{ <div className=" " style={{
marginLeft: "37px", marginLeft: "37px",
}}> }}>
<p style={{ <div style={{marginTop: "23px",}}>
<span style={{
marginTop: "30px",
color: "#05101A", color: "#05101A",
fontSize: "16px", fontSize: "16px",
}}>邀请码yngh5</p> }}>邀请码</span>
<span
style={{
color: "#05101A",
fontSize: "16px",
}}>{data[0].invite_code === null || data[0].invite_code === undefined ? "" : data[0].invite_code}</span>
</div>
<input style={{
display: "none"
}} id="copy_invite_code"
value={data[0].invite_code === null || data[0].invite_code === undefined ? "" : data[0].invite_code}/>
</div> </div>
{data[0].invite_code === null || data[0].invite_code === undefined ?
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n" <i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{ style={{
marginLeft: "18px", marginLeft: "18px",
}} }}
> >
</i> </i>
:
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{
marginLeft: "18px",
}}
onClick={() => {
jsCopy()
}}
>
</i>
}
{ {
this.props.type === 5 ? this.props.type === 5 ?
<div className="regitemimgs4" <div className="regitemimgs4"
@ -142,25 +180,30 @@ class PersonalCompetititem extends React.Component {
marginLeft: "32px", marginLeft: "32px",
}} }}
> >
<div className="regitemimgs5"> <div className="regitemimgs5" onClick={() => this.props.Exittheteamshow(data[0].id, true)}>
<p>删除战队</p> <p onClick={() => this.props.Exittheteamshow(data[0].id, true)}>删除战队</p>
</div> </div>
<div className="regitemimgs6"> <div className="regitemimgs6" onClick={() => this.props.Createateamedit(data[0])}>
<p>编辑战队</p> <p onClick={() => this.props.Createateamedit(data[0])}>编辑战队</p>
</div> </div>
</div> </div>
: this.props.type === 2 ? : this.props.type === 2 ?
<div className="regitemimgs4" <div className="regitemimgs4 "
style={{ style={{
marginLeft: "32px", marginLeft: "32px",
}} }}
> >
<div className="regitemimgs5"> <div className="regitemimgs5">
<p>战队详情</p> <a href={`/newcompetitions/${"gcc-course-2019"}/competition_teams/${data[0].id}`} style={{
color: "#459be5",
width: "100%",
height: "100%",
lineHeight: "39px",
}}>战队详情</a>
</div> </div>
<div className="regitemimgs6"> <div className="regitemimgs6" onClick={() => this.props.Exittheteamshow(data[0].id, false)}>
<p>退出战队</p> <p onClick={() => this.props.Exittheteamshow(data[0].id, false)}>退出战队</p>
</div> </div>
</div> </div>
@ -172,8 +215,8 @@ class PersonalCompetititem extends React.Component {
}} }}
> >
<div className="regitemimgs6"> <div className="regitemimgs6" onClick={() => this.props.Exittheteamshow(data[0].id, false)}>
<p>退出战队</p> <p onClick={() => this.props.Exittheteamshow(data[0].id, false)}>退出战队</p>
</div> </div>
</div> </div>
@ -182,6 +225,7 @@ class PersonalCompetititem extends React.Component {
} }
</div> </div>
</div>
: "" : ""
} }
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Loading…
Cancel
Save