|
|
|
@ -25,7 +25,8 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
bank_account_editable: false,
|
|
|
|
|
leader: false,
|
|
|
|
|
bank_account: undefined,
|
|
|
|
|
certification: 1
|
|
|
|
|
certification: 1,
|
|
|
|
|
userdata:undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -33,8 +34,36 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
window.document.title = '竞赛';
|
|
|
|
|
console.log("获取用户信息");
|
|
|
|
|
console.log(this.props);
|
|
|
|
|
this.getdata();
|
|
|
|
|
|
|
|
|
|
this.GetawardinformationAPI();
|
|
|
|
|
let query=this.props.location&&this.props.location.search;
|
|
|
|
|
const types = query.split('user_id=')
|
|
|
|
|
let userid;
|
|
|
|
|
if(types[1]===undefined){
|
|
|
|
|
userid=this.props.user&&this.props.user.user_id;
|
|
|
|
|
}else{
|
|
|
|
|
userid=types[1];
|
|
|
|
|
}
|
|
|
|
|
this.getdata(userid);
|
|
|
|
|
this.GetuseridApi(userid);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetuseridApi=(id)=>{
|
|
|
|
|
//个人信息API 获取个人信息
|
|
|
|
|
let url = `/users/accounts/${id}.json`;
|
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
console.log("GetuseridApi");
|
|
|
|
|
console.log(result.data);
|
|
|
|
|
this.setState({
|
|
|
|
|
userdata:result.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetawardinformationAPI = () => {
|
|
|
|
@ -65,37 +94,20 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getdata = () => {
|
|
|
|
|
getdata = (id) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
certification: 3
|
|
|
|
|
})
|
|
|
|
|
let url = `/users/accounts/${this.props.current_user.login}.json`;
|
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
if (result.data && result.data.base_info_completed == false) {
|
|
|
|
|
this.props.history.push(`/account/profile/edit`);
|
|
|
|
|
}
|
|
|
|
|
// "authentication": "uncertified", // "uncertified" | "applying" | "certified"
|
|
|
|
|
this.setState({
|
|
|
|
|
basicInfo: Object.assign({}, {...result.data}, {
|
|
|
|
|
avatar_url: `${result.data.avatar_url}`,
|
|
|
|
|
gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender
|
|
|
|
|
}),
|
|
|
|
|
certification: 3
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
this.GetuseridApi(id);
|
|
|
|
|
};
|
|
|
|
|
// 绑定手机
|
|
|
|
|
onPhoneSubmit = () => {
|
|
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
|
|
if (!err) {
|
|
|
|
|
let {login} = this.props.current_user;
|
|
|
|
|
let {id} =this.state.userdata;
|
|
|
|
|
let reg = /^1\d{10}$/;
|
|
|
|
|
if (reg.test(values.phone)) {
|
|
|
|
|
let url = `/users/accounts/${login}/phone_bind.json`
|
|
|
|
|
let url = `/users/accounts/${id}/phone_bind.json`
|
|
|
|
|
axios.post((url), {
|
|
|
|
|
phone: values.phone,
|
|
|
|
|
code: values.phoneValidateCode
|
|
|
|
@ -105,7 +117,7 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
this.setState({
|
|
|
|
|
phonebool: false
|
|
|
|
|
})
|
|
|
|
|
this.getdata();
|
|
|
|
|
this.getdata(this.state.userdata.id);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
@ -120,10 +132,10 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
onEmailSubmit = () => {
|
|
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
|
|
if (!err) {
|
|
|
|
|
let {login} = this.props.current_user;
|
|
|
|
|
let {id} =this.state.userdata;
|
|
|
|
|
let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
|
|
|
|
if (reg.test(values.email)) {
|
|
|
|
|
let url = `/users/accounts/${login}/email_bind.json`
|
|
|
|
|
let url = `/users/accounts/${id}/email_bind.json`
|
|
|
|
|
axios.post((url), {
|
|
|
|
|
email: values.email,
|
|
|
|
|
code: values.emailValidateCode
|
|
|
|
@ -133,7 +145,7 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
this.setState({
|
|
|
|
|
emailbool: false
|
|
|
|
|
})
|
|
|
|
|
this.getdata();
|
|
|
|
|
this.getdata(this.state.userdata.id);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
@ -241,7 +253,7 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
|
|
|
|
|
//立即认证
|
|
|
|
|
checkBasicInfo = (index) => {
|
|
|
|
|
if (this.state.basicInfo.base_info_completed == true) {
|
|
|
|
|
if (this.state.userdata.base_info_completed == true) {
|
|
|
|
|
this.showRealNameCertificationModal(index)
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
@ -285,7 +297,7 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
if (result.data.status == 0) {
|
|
|
|
|
// console.log(JSON.stringify(result));
|
|
|
|
|
this.props.showNotification(`提交成功成功`);
|
|
|
|
|
this.getdata();
|
|
|
|
|
this.getdata(this.state.userdata.id);
|
|
|
|
|
this.GetawardinformationAPI();
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
@ -302,7 +314,7 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
|
|
|
|
|
//取消认证弹框
|
|
|
|
|
onCancel = () => {
|
|
|
|
|
this.getdata();
|
|
|
|
|
this.getdata(this.state.userdata.id);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -324,7 +336,7 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
} else if (index === 2) {
|
|
|
|
|
this.props.showNotification('撤销职业认证成功')
|
|
|
|
|
}
|
|
|
|
|
this.getdata();
|
|
|
|
|
this.getdata(this.state.userdata.id);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
@ -344,32 +356,36 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
if(admins===undefined||admins===null) {
|
|
|
|
|
admins === false;
|
|
|
|
|
}
|
|
|
|
|
const {updating, seconds, secondsFlag, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state
|
|
|
|
|
const {updating, seconds, secondsFlag,userdata, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state
|
|
|
|
|
return (
|
|
|
|
|
<div className="flexdidirectionss mt17">
|
|
|
|
|
{this.state.certification === 1 ?
|
|
|
|
|
<RealNameCertificationModal {...this.props} {...this.state} basicInfo={this.state.basicInfo}
|
|
|
|
|
{this.state.certification === 1 &&userdata?
|
|
|
|
|
|
|
|
|
|
<RealNameCertificationModal {...this.props} {...this.state} basicInfo={userdata}
|
|
|
|
|
wrappedComponentRef={(form) => this.realNameCertificationModal1 = form}
|
|
|
|
|
certification={certification}
|
|
|
|
|
Getdata={() => this.getdata()}
|
|
|
|
|
Getdata={(id) => this.getdata(id)}
|
|
|
|
|
onCancel={() => this.onCancel()}
|
|
|
|
|
></RealNameCertificationModal> : ""}
|
|
|
|
|
></RealNameCertificationModal>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: ""}
|
|
|
|
|
|
|
|
|
|
{this.state.certification === 2 ?
|
|
|
|
|
<RealNameCertificationModal {...this.props} {...this.state} basicInfo={this.state.basicInfo}
|
|
|
|
|
{this.state.certification === 2 &&userdata ?
|
|
|
|
|
<RealNameCertificationModal {...this.props} {...this.state} basicInfo={userdata}
|
|
|
|
|
wrappedComponentRef={(form) => this.realNameCertificationModal2 = form}
|
|
|
|
|
certification={certification}
|
|
|
|
|
Getdata={() => this.getdata()}
|
|
|
|
|
Getdata={(id) => this.getdata(id)}
|
|
|
|
|
onCancel={() => this.onCancel()}
|
|
|
|
|
|
|
|
|
|
></RealNameCertificationModal> : ""}
|
|
|
|
|
<div className="flexdirections ">
|
|
|
|
|
<p className="fontcolorsyslhei font-16 w98"><span className="fontcolorsysl font-16">*</span><span>实名信息</span>
|
|
|
|
|
</p>
|
|
|
|
|
{basicInfo && basicInfo.authentication == "uncertified" ?
|
|
|
|
|
{userdata && userdata.authentication == "uncertified" ?
|
|
|
|
|
<p className="fontcolorsyslhui font-14 w200">通过实名认证后才能获得证书</p> : ""
|
|
|
|
|
}
|
|
|
|
|
{basicInfo && basicInfo.authentication == "uncertified" ?
|
|
|
|
|
{userdata && userdata.authentication == "uncertified" ?
|
|
|
|
|
<p className="fontcolorsysllan font-14 ml3 mycompitcursor"
|
|
|
|
|
onClick={() => this.checkBasicInfo(1)}>立即认证</p> : ""
|
|
|
|
|
}
|
|
|
|
@ -377,11 +393,11 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flexdirections ml38 mt23">
|
|
|
|
|
<p className="fontcolorsyslhui1">姓名:</p>
|
|
|
|
|
<p className="fontcolorsyslhei flexdirections">{basicInfo && basicInfo.name}
|
|
|
|
|
<p className="fontcolorsyslhei flexdirections">{userdata && userdata.name}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
basicInfo && basicInfo.authentication == "uncertified" ? "" :
|
|
|
|
|
basicInfo && basicInfo.authentication == "applying" ?
|
|
|
|
|
userdata && userdata.authentication == "uncertified" ? "" :
|
|
|
|
|
userdata && userdata.authentication == "applying" ?
|
|
|
|
|
<p className="flexdirections"><p className="iconfont icon-tishi colorgreenorg font-14 ml20"></p><p
|
|
|
|
|
className="colorgreenorg font-14 ml6">待审核!</p><p
|
|
|
|
|
className="fontcolorsysllan borcolors font-12 w64 mycompitcursor"
|
|
|
|
@ -397,19 +413,19 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
|
|
|
|
|
<div className="flexdirections ml38 mt19">
|
|
|
|
|
<p className="fontcolorsyslhui1">性别:</p>
|
|
|
|
|
<p className="fontcolorsyslhei"> {basicInfo && basicInfo.gender == 0 ? "男" : "女"}</p>
|
|
|
|
|
<p className="fontcolorsyslhei"> {userdata && userdata.gender == 0 ? "男" : "女"}</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flexdirections mt36 ">
|
|
|
|
|
<p className="fontcolorsyslhei font-16 w98"><span className="fontcolorsysl font-16">*</span><span>职业信息</span>
|
|
|
|
|
</p>
|
|
|
|
|
{
|
|
|
|
|
basicInfo && basicInfo.professional_certification == "uncertified" ?
|
|
|
|
|
userdata && userdata.professional_certification == "uncertified" ?
|
|
|
|
|
<p className="fontcolorsyslhui font-14 w200">通过职业认证后才能获得证书</p>
|
|
|
|
|
|
|
|
|
|
: ""}
|
|
|
|
|
{
|
|
|
|
|
basicInfo && basicInfo.professional_certification == "uncertified" ?
|
|
|
|
|
userdata && userdata.professional_certification == "uncertified" ?
|
|
|
|
|
<p className="fontcolorsysllan font-14 ml3 mycompitcursor" onClick={() => this.checkBasicInfo(2)}>立即认证</p>
|
|
|
|
|
|
|
|
|
|
: ""}
|
|
|
|
@ -418,11 +434,11 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
<div className="flexdirections ml38 mt23">
|
|
|
|
|
<p className="fontcolorsyslhui1">职业:</p>
|
|
|
|
|
<p
|
|
|
|
|
className="fontcolorsyslhei flexdirections">{basicInfo && basicInfo.identity && identityMap[basicInfo.identity]}
|
|
|
|
|
className="fontcolorsyslhei flexdirections">{userdata && userdata.identity && identityMap[userdata.identity]}
|
|
|
|
|
{
|
|
|
|
|
basicInfo && basicInfo.professional_certification == "uncertified" ?
|
|
|
|
|
userdata && userdata.professional_certification == "uncertified" ?
|
|
|
|
|
"" :
|
|
|
|
|
basicInfo && basicInfo.professional_certification == "applying" ?
|
|
|
|
|
userdata && userdata.professional_certification == "applying" ?
|
|
|
|
|
<p className="flexdirections">
|
|
|
|
|
<p className="iconfont icon-tishi colorgreenorg font-14 ml20"></p><p
|
|
|
|
|
className="colorgreenorg font-14 ml6">待审核!</p><p
|
|
|
|
@ -442,16 +458,16 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flexdirections ml38 mt19">
|
|
|
|
|
<p
|
|
|
|
|
className="fontcolorsyslhui1">{basicInfo && basicInfo.technical_title ? "职称:" : ""}{basicInfo && basicInfo.student_id ? "学号:" : ""}</p>
|
|
|
|
|
<p className="fontcolorsyslhei">{basicInfo && (basicInfo.technical_title || basicInfo.student_id)}</p>
|
|
|
|
|
className="fontcolorsyslhui1">{userdata && userdata.technical_title ? "职称:" : ""}{userdata && userdata.student_id ? "学号:" : ""}</p>
|
|
|
|
|
<p className="fontcolorsyslhei">{userdata && (userdata.technical_title || userdata.student_id)}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flexdirections ml38 mt19">
|
|
|
|
|
<p className="fontcolorsyslhui1">学校:</p>
|
|
|
|
|
<p className="fontcolorsyslhei">{basicInfo && basicInfo.school_name}</p>
|
|
|
|
|
<p className="fontcolorsyslhei">{userdata && userdata.school_name}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flexdirections ml38 mt19">
|
|
|
|
|
<p className="fontcolorsyslhui1">院系:</p>
|
|
|
|
|
<p className="fontcolorsyslhei"> {basicInfo && basicInfo.department_name}</p>
|
|
|
|
|
<p className="fontcolorsyslhei"> {userdata && userdata.department_name}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flexdirections mt36 ">
|
|
|
|
|
<p className="fontcolorsyslhei font-16 w98"><span className="fontcolorsysl font-16">*</span><span>联系方式</span>
|
|
|
|
@ -460,44 +476,48 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
<div className="flexdirections ml38 mt23">
|
|
|
|
|
<p className="fontcolorsyslhui1 w60 ">手机号:</p>
|
|
|
|
|
{
|
|
|
|
|
basicInfo && basicInfo.phone ?
|
|
|
|
|
<p className="fontcolorsyslhei w200 ">{basicInfo && basicInfo.phone}</p>
|
|
|
|
|
userdata && userdata.phone ?
|
|
|
|
|
<p className="fontcolorsyslhei w200 ">{userdata && userdata.phone}</p>
|
|
|
|
|
:
|
|
|
|
|
<p className="fontcolorsysljin w200 ">未绑定</p>
|
|
|
|
|
}
|
|
|
|
|
<p className="fontcolorsysllan mycompitcursor"
|
|
|
|
|
onClick={() => this.phonebools()}>{basicInfo && basicInfo.phone ? (phonebool === false ? "更换" : "") : (phonebool === false ? "立即绑定" : "")}</p>
|
|
|
|
|
onClick={() => this.phonebools()}>{userdata && userdata.phone ? (phonebool === false ? "更换" : "") : (phonebool === false ? "立即绑定" : "")}</p>
|
|
|
|
|
</div>
|
|
|
|
|
{/*手机号绑定*/}
|
|
|
|
|
{
|
|
|
|
|
phonebool === true ?
|
|
|
|
|
<Phonenumberverifications {...this.props} {...this.state} basicInfo={this.state.basicInfo}
|
|
|
|
|
phonebool === true &&userdata ?
|
|
|
|
|
<Phonenumberverifications {...this.props} {...this.state} basicInfo={userdata}
|
|
|
|
|
hideUpdating={(i) => this.hideUpdating(i)}
|
|
|
|
|
getdata={() => this.getdata()}></Phonenumberverifications>
|
|
|
|
|
getdata={(id) => this.getdata(id)}></Phonenumberverifications>
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flexdirections ml38 mt19">
|
|
|
|
|
<p className="fontcolorsyslhui1 w60">Email:</p>
|
|
|
|
|
<p className="fontcolorsyslhei w200">{basicInfo && basicInfo.mail}</p>
|
|
|
|
|
<p className="fontcolorsyslhei w200">{userdata && userdata.mail}</p>
|
|
|
|
|
<p className="fontcolorsysllan mycompitcursor"
|
|
|
|
|
onClick={() => this.emailbools()}>{basicInfo && basicInfo.mail ? (emailbool === false ? "更换" : "") : (emailbool === false ? "立即绑定" : "")}</p>
|
|
|
|
|
onClick={() => this.emailbools()}>{userdata && userdata.mail ? (emailbool === false ? "更换" : "") : (emailbool === false ? "立即绑定" : "")}</p>
|
|
|
|
|
</div>
|
|
|
|
|
{
|
|
|
|
|
emailbool === false ? "" :
|
|
|
|
|
<Mailboxvalidations {...this.props} {...this.state} basicInfo={this.state.basicInfo}
|
|
|
|
|
hideUpdating={(i) => this.hideUpdating(i)}
|
|
|
|
|
getdata={() => this.getdata()}></Mailboxvalidations>
|
|
|
|
|
(
|
|
|
|
|
userdata?
|
|
|
|
|
<Mailboxvalidations {...this.props} {...this.state} basicInfo={userdata}
|
|
|
|
|
hideUpdating={(i) => this.hideUpdating(i)}
|
|
|
|
|
getdata={(id) => this.getdata(id)}></Mailboxvalidations>
|
|
|
|
|
:""
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
leader === true ?
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
bank_account_editable === true ?
|
|
|
|
|
<Bankcardnumberverifications {...this.props} {...this.state} basicInfo={this.state.basicInfo}
|
|
|
|
|
<Bankcardnumberverifications {...this.props} {...this.state} basicInfo={userdata}
|
|
|
|
|
hideUpdating={(i) => this.hideUpdating(i)}
|
|
|
|
|
getdata={() => this.getdata()}
|
|
|
|
|
getdata={(id) => this.getdata(id)}
|
|
|
|
|
GetawardinformationAPI={() => this.GetawardinformationAPI()}
|
|
|
|
|
bank_account={this.state.bank_account}
|
|
|
|
|
></Bankcardnumberverifications>
|
|
|
|
@ -536,9 +556,9 @@ class CompetitionContentspdfpeopledata extends Component {
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
admins===true?
|
|
|
|
|
<Bankcardnumberverifications {...this.props} {...this.state} basicInfo={this.state.basicInfo}
|
|
|
|
|
<Bankcardnumberverifications {...this.props} {...this.state} basicInfo={userdata}
|
|
|
|
|
hideUpdating={(i) => this.hideUpdating(i)}
|
|
|
|
|
getdata={() => this.getdata()}
|
|
|
|
|
getdata={(id) => this.getdata(id)}
|
|
|
|
|
GetawardinformationAPI={() => this.GetawardinformationAPI()}
|
|
|
|
|
bank_account={this.state.bank_account}
|
|
|
|
|
></Bankcardnumberverifications>
|
|
|
|
|