竞赛调整

dev_auth
杨树明 5 years ago
parent aa63b997dd
commit d615be0346

@ -11,7 +11,7 @@ class CompetitionContentspdf extends Component{
constructor(props) {
super(props)
this.state={
Tabskey:"1"
}
}
@ -20,6 +20,12 @@ class CompetitionContentspdf extends Component{
}
Competitioncallback=(key)=>{
this.setState({
Tabskey:key
})
}
render() {
@ -27,11 +33,12 @@ class CompetitionContentspdf extends Component{
<div className={"fr"}>
<div className={"mb100 "}>
<Tabs defaultActiveKey="1">
<TabPane tab="获奖证书下载" key="1">
<Tabs defaultActiveKey="1" onChange={(e) => this.Competitioncallback(e)} activeKey={this.state.Tabskey}>
<TabPane tab="获奖证书下载" key="1" >
<CompetitionContentspdfdownload
{...this.props}
{...this.state}
Competitioncallback={(e)=>this.Competitioncallback(e)}
/>
</TabPane>
<TabPane tab="完善个人信息" key="2">

@ -9,4 +9,14 @@
.pdfpicture{
font-size:16px;
color:rgba(0,0,0,1);
}
.pdfdownloadfont4CACFF{
color: #4CACFF;
}
.pdfdownloadfont00CC5F{
color:#00CC5F;
}
.pdfdownloadfontFF6602{
color:#FF6602;
}

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {Button,Layout,Row, Col,Divider} from 'antd';
import {Button,Layout,Row, Col,Divider,Table} from 'antd';
import axios from 'axios';
import {getImageUrl} from 'educoder';
import './CompetitionContentspdfdownload.css';
@ -16,15 +16,12 @@ class CompetitionContentspdfdownload extends Component{
componentDidMount(){
window.document.title = '竞赛';
console.log(this.props.match.params.identifier)
let url=`/competitions/${this.props.match.params.identifier}/prize.json`;
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
data:response.data,
})
console.log(response.data)
}
}).catch((error) => {
console.log(error)
@ -32,8 +29,100 @@ class CompetitionContentspdfdownload extends Component{
}
render() {
console.log(this.props)
// email_binded: true
// name: "伍逸凡"
// phone_binded: true
// professional_auth: "authed"
// real_name_auth: "authed"
// role: "队长"
let {data}=this.state;
let bank_account=[];
{data&&data.teams.map((item,key)=>{
bank_account.push(item.bank_account)
})
}
const columns = [
{
title: '角色',
dataIndex: 'type',
key: 'type',
render: (text, record) => (
<span>
{record.role}
</span>
),
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
render: (text, record) => (
<span>
{record.name}
</span>
),
},
{
title: '实名认证',
dataIndex: 'namecertify',
key: 'namecertify',
render: (text, record) => (
<span>
{record.real_name_auth==="authed"?<span className={"pdfdownloadfont00CC5F"}>已认证</span>:record.real_name_auth==="authing"?<span className={"pdfdownloadfontFF6602"}></span>:record.real_name_auth==="not_authed"?<span className={"color-red"}></span>:""}
</span>
),
},
{
title: '职业认证',
key: 'certify',
dataIndex: 'certify',
render: (text, record) => (
<span>
{record.professional_auth==="authed"?<span className={"pdfdownloadfont00CC5F"}>已认证</span>:record.real_name_auth==="authing"?<span className={"pdfdownloadfontFF6602"}></span>:record.real_name_auth==="not_authed"?<span className={"color-red"}></span>:""}
</span>
),
},
{
title: '手机绑定',
key: 'mobile',
dataIndex: 'mobile',
render: (text, record) => (
<span>
{record.phone_binded===true?<span className={"pdfdownloadfont00CC5F"}>已绑定</span>:<span className={"color-red"}></span>}
</span>
),
},
{
title: '邮箱绑定',
key: 'mail',
dataIndex: 'mail',
render: (text, record) => (
<span>
{record.email_binded===true?<span className={"pdfdownloadfont00CC5F"}>已绑定</span>:<span className={"color-red"}></span>}
</span>
),
},
{
title: '开户行及银行卡号信息(队长填写)',
key: 'idcard',
dataIndex: 'idcard',
render: (value, row, index,record) => {
console.log(row)
console.log(record)
console.log(value)
const obj = {
children: bank_account[index],
props: {},
};
obj.props.rowSpan = 0;
return obj
},
},
];
return (
<React.Fragment>
<Row>
@ -45,19 +134,39 @@ class CompetitionContentspdfdownload extends Component{
</Row>
<Row className={"mt30"}>
{data&&data.personal_certifications.length===0?<Col>个人证书:暂未生成 <span>原因:<span>还未认证个人信息</span><a></a></span></Col>:""}
{data&&data.personal_certifications.length===0?<Col>个人证书<span className={"pdfpicture font-14"}>暂未生成</span> <span className={"ml20"}><span className={"pdfpicture font-14"}></span><a className={"pdfdownloadfont4CACFF"} onClick={()=>this.props.Competitioncallback("2")}></a></span></Col>:""}
</Row>
<Row className={"mt30"}>
<Col>团队证书: 暂未生成
<span className={"ml20"}><i className="iconfont icon-pdf"></i><a></a></span>
<Col>团队证书
{data&&data.team_certifications.length===0?<span className={"pdfpicture font-14"}>暂未生成</span>
:<span className={"ml20"}><i className="iconfont icon-pdf"></i><a></a></span>}
</Col>
</Row>
<Divider />
<style>
{
`
.pdfdownloadTable .ant-table-column-title{
color:#000;
}
.pdfdownloadTable .ant-table-tbody > tr > td{
color:#666666;
// border-bottom: 1px solid transparent;
}
`
}
</style>
{data&&data.teams.map((item,key)=>{
return(
<Row className={"mt30"} key={key}>
<Col className={"pdfpicture mb20"}>{item.name}战队信息填报概况</Col>
<Row className={"mt30"}>
<Col className={"pdfpicture"}>XXXXXX战队信息填报概况</Col>
</Row>
<Table columns={columns} dataSource={item.team_members} className={"pdfdownloadTable"} pagination={false}/>
</Row>
)
})
}
</React.Fragment>

Loading…
Cancel
Save