|
|
|
@ -55,47 +55,45 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
console.log("RealNameCertificationModal");
|
|
|
|
|
console.log(this.props.basicInfo);
|
|
|
|
|
if(this.props.basicInfo){
|
|
|
|
|
// 弹框出现(visible==true)时给formitem赋值
|
|
|
|
|
setVisible = (visible) => {
|
|
|
|
|
this.refs.modalWrapper.setVisible(visible);
|
|
|
|
|
if(visible && this.props.basicInfo){
|
|
|
|
|
this.setValue(this.props.basicInfo);
|
|
|
|
|
this.getSchoolList(this.props.basicInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setValue=(basicInfo)=>{
|
|
|
|
|
// debugger;
|
|
|
|
|
if(basicInfo){
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
nickname:basicInfo.nickname,
|
|
|
|
|
name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name,
|
|
|
|
|
sex:String(basicInfo.gender),
|
|
|
|
|
job:basicInfo.identity,
|
|
|
|
|
org:basicInfo.school_name,
|
|
|
|
|
|
|
|
|
|
// city:[basicInfo.location,basicInfo.location_city]
|
|
|
|
|
org:basicInfo.school_name
|
|
|
|
|
})
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
// 等显示后再set
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
job:basicInfo.identity,
|
|
|
|
|
sex:String(basicInfo.gender),
|
|
|
|
|
student_No:basicInfo.student_id,
|
|
|
|
|
org2:basicInfo.department_name,
|
|
|
|
|
job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授",
|
|
|
|
|
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
|
|
|
|
|
})
|
|
|
|
|
}, 100)
|
|
|
|
|
//if(basicInfo.nickname){
|
|
|
|
|
this.setState({
|
|
|
|
|
forDisable: true,
|
|
|
|
|
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
|
|
|
|
|
showRealName:basicInfo.show_realname,
|
|
|
|
|
realName: basicInfo.name,
|
|
|
|
|
identity:basicInfo.identity,
|
|
|
|
|
school_id:basicInfo.school_id,
|
|
|
|
|
department_id:basicInfo.department_id
|
|
|
|
|
})
|
|
|
|
|
//}
|
|
|
|
|
this.setState({
|
|
|
|
|
forDisable: true,
|
|
|
|
|
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
|
|
|
|
|
showRealName:basicInfo.show_realname,
|
|
|
|
|
realName: basicInfo.name,
|
|
|
|
|
identity:basicInfo.identity,
|
|
|
|
|
school_id:basicInfo.school_id,
|
|
|
|
|
department_id:basicInfo.department_id
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -256,10 +254,6 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setVisible = (visible) => {
|
|
|
|
|
this.refs.modalWrapper.setVisible(visible)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onSendOk = () => {
|
|
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
|
|
console.log(values);
|
|
|
|
@ -273,7 +267,7 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
// 实名认证
|
|
|
|
|
let url = `/users/accounts/${current_user && current_user.login}/authentication_apply.json`
|
|
|
|
|
axios.post((url),{
|
|
|
|
|
name:values.name,
|
|
|
|
|
name:values.name || basicInfo.name,
|
|
|
|
|
gender:parseInt(values.sex),
|
|
|
|
|
id_number:values.credentials
|
|
|
|
|
}).then((result)=>{
|
|
|
|
@ -289,8 +283,6 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.setVisible(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
console.log(error);
|
|
|
|
|