|
|
|
@ -16,6 +16,15 @@ import {Address} from "../ui/Address"; |
|
|
|
|
import {Cookies} from "react-cookie"; |
|
|
|
|
import {user_type_cookie} from "../account/PropCookie"; |
|
|
|
|
import {Api, prefix} from "../api"; |
|
|
|
|
import {UploadImg} from "../ui/UploadImg"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 图片尺寸限制 |
|
|
|
|
*/ |
|
|
|
|
const maxImageSize={ |
|
|
|
|
width:100, |
|
|
|
|
height:100 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 个人信息 |
|
|
|
@ -31,7 +40,12 @@ export class MyInfo extends React.Component< |
|
|
|
|
//是否添加好友
|
|
|
|
|
isAdd:boolean; |
|
|
|
|
cookies?:Cookies; |
|
|
|
|
}, { userEdit:UserEdit,userInfo?:User,result:JSX.Element|null }>{ |
|
|
|
|
}, { |
|
|
|
|
userEdit:UserEdit, |
|
|
|
|
userInfo?:User, |
|
|
|
|
result:JSX.Element|null, |
|
|
|
|
activityImgFile?:any; |
|
|
|
|
}>{ |
|
|
|
|
|
|
|
|
|
private ages:Array<number> |
|
|
|
|
|
|
|
|
@ -167,11 +181,8 @@ export class MyInfo extends React.Component< |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
let that=this |
|
|
|
|
// let isUpdateUserType=this.state.userEdit.userType!==this.state.userEdit.oldUserType
|
|
|
|
|
// if(isUpdateUserType&&this.props.cookies){
|
|
|
|
|
// this.props.cookies.set(user_type_cookie,this.state.userEdit.userType)
|
|
|
|
|
// }
|
|
|
|
|
request(Api.account.update,Method.POST, { |
|
|
|
|
|
|
|
|
|
request(Api.account.update,Method.PUT, { |
|
|
|
|
headImg:this.state.userEdit.headImg||"", |
|
|
|
|
name:this.state.userEdit.name||"", |
|
|
|
|
age:this.state.userEdit.age+""||"", |
|
|
|
@ -180,7 +191,8 @@ export class MyInfo extends React.Component< |
|
|
|
|
serviceAddress:this.state.userEdit.serviceAddress||"", |
|
|
|
|
info:this.state.userEdit.info||"", |
|
|
|
|
userType:this.state.userEdit.userType||"", |
|
|
|
|
sex:this.state.userEdit.sex||"" |
|
|
|
|
sex:this.state.userEdit.sex||"", |
|
|
|
|
activityImgFile:this.state.activityImgFile?this.state.activityImgFile:null |
|
|
|
|
},new EmptyBodyTransform(),function (res:JSONResponse<SimpleMessage>) { |
|
|
|
|
switch (res.customResult) { |
|
|
|
|
case SimpleMessage.fail: |
|
|
|
@ -236,7 +248,10 @@ export class MyInfo extends React.Component< |
|
|
|
|
<Container className="overflow-auto"> |
|
|
|
|
<Row> |
|
|
|
|
<Col className="p-3 text-center"> |
|
|
|
|
<Image className="chat-headImg" src={this.state.userInfo?.headImg?prefix.image+this.state.userInfo.headImg:""}/> |
|
|
|
|
{this.state.userEdit.contentEditable? |
|
|
|
|
<UploadImg tip={"点击更新头像"} maxImageSize={maxImageSize} onChange={(value:string)=>this.setState({activityImgFile:value})} /> |
|
|
|
|
: |
|
|
|
|
<Image className="chat-headImg" src={this.state.userInfo?.headImg?prefix.image+this.state.userInfo.headImg:""}/>} |
|
|
|
|
</Col> |
|
|
|
|
</Row> |
|
|
|
|
{/*TODO 表单校验*/} |
|
|
|
|