|
|
|
@ -53,6 +53,7 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
schoolList:undefined,
|
|
|
|
|
departments:undefined,
|
|
|
|
|
showRealName:true,
|
|
|
|
|
realName:undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -137,16 +138,7 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 将名字隐藏起来
|
|
|
|
|
hideRealName=(name)=>{
|
|
|
|
|
this.setState({ realName: name })
|
|
|
|
|
const newName = getHiddenName(name)
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
name: newName
|
|
|
|
|
})
|
|
|
|
|
return newName
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDepartments=(e,flag)=>{
|
|
|
|
|
let arr=this.state.schoolList.filter(function(item){
|
|
|
|
@ -257,10 +249,11 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
|
|
|
|
|
onSendOk = () => {
|
|
|
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
|
|
|
// console.log(values);
|
|
|
|
|
// console.log(this.state.realName);
|
|
|
|
|
console.log(values);
|
|
|
|
|
console.log(this.state.showRealName ? values.name : this.state.realName);
|
|
|
|
|
// return;
|
|
|
|
|
if(!err){
|
|
|
|
|
let{imageUrl2,showRealName}=this.state;
|
|
|
|
|
let{ imageUrl2 , showRealName , realName }=this.state;
|
|
|
|
|
let{ current_user , basicInfo }=this.props;
|
|
|
|
|
if(imageUrl2){
|
|
|
|
|
let { certification } = this.props;
|
|
|
|
@ -275,7 +268,7 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.post((url),{
|
|
|
|
|
name:this.state.realName || basicInfo.name,
|
|
|
|
|
name:this.state.showRealName ? values.name : realName,
|
|
|
|
|
gender:parseInt(values.sex),
|
|
|
|
|
id_number:values.credentials,
|
|
|
|
|
show_realname:showRealName,
|
|
|
|
@ -422,6 +415,16 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
name: this.state.realName
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 将名字隐藏起来
|
|
|
|
|
hideRealName=(name)=>{
|
|
|
|
|
this.setState({ realName: name })
|
|
|
|
|
const newName = getHiddenName(name)
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
name: newName
|
|
|
|
|
})
|
|
|
|
|
return newName
|
|
|
|
|
}
|
|
|
|
|
// 选择部门、学院
|
|
|
|
|
changeDepartment=(e)=>{
|
|
|
|
@ -463,7 +466,7 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
// /api/users/accounts/${this.props.current_user.login}/auth_attachment.json
|
|
|
|
|
|
|
|
|
|
// 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable)
|
|
|
|
|
const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ;
|
|
|
|
|
// const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ;
|
|
|
|
|
|
|
|
|
|
let{ basicInfo }=this.props
|
|
|
|
|
let common={
|
|
|
|
@ -645,7 +648,7 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
label="姓名"
|
|
|
|
|
className="formItemInline"
|
|
|
|
|
>
|
|
|
|
|
{basicInfo && basicInfo.authentication == 'uncertified' ? <React.Fragment>{getFieldDecorator('name', {
|
|
|
|
|
<React.Fragment>{getFieldDecorator('name', {
|
|
|
|
|
rules: [{
|
|
|
|
|
// initialValue: this.state.cityDefaultValue,
|
|
|
|
|
required: true,
|
|
|
|
@ -659,16 +662,16 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
}></Input>
|
|
|
|
|
)}
|
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
|
</React.Fragment> :
|
|
|
|
|
<div className="df" style={{}}>
|
|
|
|
|
<Tooltip title="已完成实名认证,不能修改">
|
|
|
|
|
<span className="mr8" >{showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}</span>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
|
|
|
|
|
onClick={()=>this.showOrHide(showRealName)}></i>
|
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
{/* // <div className="df" style={{}}>
|
|
|
|
|
// <Tooltip title="已完成实名认证,不能修改">
|
|
|
|
|
// <span className="mr8" >{showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}</span>
|
|
|
|
|
// </Tooltip>
|
|
|
|
|
// <i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
|
|
|
|
|
// onClick={()=>this.showOrHide(showRealName)}></i>
|
|
|
|
|
// <span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
|
// </div> */}
|
|
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Form.Item
|
|
|
|
@ -682,10 +685,8 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<RadioGroup>
|
|
|
|
|
<ConditionToolTip title="已完成实名认证,不能修改" condition={basicInfo.authentication != 'uncertified'} >
|
|
|
|
|
<Radio value="0" disabled={basicInfo.authentication != 'uncertified'}>男</Radio>
|
|
|
|
|
<Radio value="1" disabled={basicInfo.authentication != 'uncertified'}>女</Radio>
|
|
|
|
|
</ConditionToolTip>
|
|
|
|
|
<Radio value="0">男</Radio>
|
|
|
|
|
<Radio value="1">女</Radio>
|
|
|
|
|
</RadioGroup>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
@ -708,7 +709,7 @@ class RealNameCertificationModal extends Component{
|
|
|
|
|
<AccountBasicEditItem
|
|
|
|
|
identity={identity}
|
|
|
|
|
getFieldDecorator={getFieldDecorator}
|
|
|
|
|
professionalFlag={professionalFlag}
|
|
|
|
|
professionalFlag={false}
|
|
|
|
|
basicInfo={basicInfo}
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|