|
|
|
@ -109,7 +109,8 @@ class AccountBasic extends Component {
|
|
|
|
|
let url=`/users/accounts/${basicInfo.id}.json`
|
|
|
|
|
axios.put((url),{
|
|
|
|
|
nickname:values.nickname,
|
|
|
|
|
name:values.name,
|
|
|
|
|
// 认证中的不能修改
|
|
|
|
|
name: basicInfo.authentication == 'uncertified' ? values.name : basicInfo.name,
|
|
|
|
|
show_realname:this.state.showRealName,
|
|
|
|
|
gender:parseInt(values.sex),
|
|
|
|
|
location:values.city[0],
|
|
|
|
@ -146,16 +147,21 @@ class AccountBasic extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 将名字隐藏起来
|
|
|
|
|
hideRealName=(name)=>{
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
name = name.substr(0,1)+str;
|
|
|
|
|
// 将名字隐藏起来
|
|
|
|
|
hideRealName=(name)=>{
|
|
|
|
|
const newName = this.getHiddenName(name)
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
name
|
|
|
|
|
name: newName
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -365,19 +371,28 @@ class AccountBasic extends Component {
|
|
|
|
|
label="姓名"
|
|
|
|
|
className="formItemInline"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('name', {
|
|
|
|
|
rules: [{
|
|
|
|
|
// initialValue: this.state.cityDefaultValue,
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入您的姓名',
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<Input placeholder="请输入您的姓名" suffix={
|
|
|
|
|
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"} onClick={()=>this.showOrHide(showRealName,basicInfo.name)}></i>
|
|
|
|
|
}></Input>
|
|
|
|
|
)}
|
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
{ basicInfo.authentication == 'uncertified' ? <React.Fragment>{getFieldDecorator('name', {
|
|
|
|
|
rules: [{
|
|
|
|
|
// initialValue: this.state.cityDefaultValue,
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入您的姓名',
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<Input placeholder="请输入您的姓名" suffix={
|
|
|
|
|
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
|
|
|
|
|
onClick={()=>this.showOrHide(showRealName,basicInfo.name)}></i>
|
|
|
|
|
}></Input>
|
|
|
|
|
)}
|
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
|
</React.Fragment> :
|
|
|
|
|
<div className="df" style={{ 'justify-content': 'center' }}>
|
|
|
|
|
<span className="mr8" >{showRealName ? this.props.basicInfo.name : this.getHiddenName(this.props.basicInfo.name)}</span>
|
|
|
|
|
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
|
|
|
|
|
onClick={()=>this.showOrHide(showRealName,basicInfo.name)}></i>
|
|
|
|
|
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="性别"
|
|
|
|
|