|
|
@ -10,6 +10,14 @@ const RadioGroup = Radio.Group;
|
|
|
|
const Option = Select.Option;
|
|
|
|
const Option = Select.Option;
|
|
|
|
|
|
|
|
|
|
|
|
const map = identityMap // {"teacher":"教师", "student":"学生", "professional":"专业人士"}
|
|
|
|
const map = identityMap // {"teacher":"教师", "student":"学生", "professional":"专业人士"}
|
|
|
|
|
|
|
|
export function getHiddenName(name) {
|
|
|
|
|
|
|
|
if (!name) return ''
|
|
|
|
|
|
|
|
let len=parseInt(name.length)-1;
|
|
|
|
|
|
|
|
let str="";
|
|
|
|
|
|
|
|
for(var i = 0; i < len; i++){ str += "*"; }
|
|
|
|
|
|
|
|
const newName = name.substr(0,1)+str;
|
|
|
|
|
|
|
|
return newName
|
|
|
|
|
|
|
|
}
|
|
|
|
class AccountBasic extends Component {
|
|
|
|
class AccountBasic extends Component {
|
|
|
|
constructor(props){
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
@ -154,19 +162,10 @@ class AccountBasic extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getHiddenName(name) {
|
|
|
|
|
|
|
|
if (!name) return ''
|
|
|
|
|
|
|
|
let len=parseInt(name.length)-1;
|
|
|
|
|
|
|
|
let str="";
|
|
|
|
|
|
|
|
for(var i = 0; i < len; i++){ str += "*"; }
|
|
|
|
|
|
|
|
const newName = name.substr(0,1)+str;
|
|
|
|
|
|
|
|
return newName
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 将名字隐藏起来
|
|
|
|
// 将名字隐藏起来
|
|
|
|
hideRealName=(name)=>{
|
|
|
|
hideRealName=(name)=>{
|
|
|
|
this.setState({ realName: name })
|
|
|
|
this.setState({ realName: name })
|
|
|
|
const newName = this.getHiddenName(name)
|
|
|
|
const newName = getHiddenName(name)
|
|
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
name: newName
|
|
|
|
name: newName
|
|
|
@ -406,7 +405,7 @@ class AccountBasic extends Component {
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
</React.Fragment> :
|
|
|
|
</React.Fragment> :
|
|
|
|
<div className="df" style={{ 'justify-content': 'center' }}>
|
|
|
|
<div className="df" style={{ 'justify-content': 'center' }}>
|
|
|
|
<span className="mr8" >{showRealName ? this.props.basicInfo.name : this.getHiddenName(this.props.basicInfo.name)}</span>
|
|
|
|
<span className="mr8" >{showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}</span>
|
|
|
|
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
|
|
|
|
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
|
|
|
|
onClick={()=>this.showOrHide(showRealName)}></i>
|
|
|
|
onClick={()=>this.showOrHide(showRealName)}></i>
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|