|
|
@ -16,6 +16,15 @@ import {Address} from "../ui/Address"; |
|
|
|
import {Cookies} from "react-cookie"; |
|
|
|
import {Cookies} from "react-cookie"; |
|
|
|
import {user_type_cookie} from "../account/PropCookie"; |
|
|
|
import {user_type_cookie} from "../account/PropCookie"; |
|
|
|
import {Api, prefix} from "../api"; |
|
|
|
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; |
|
|
|
isAdd:boolean; |
|
|
|
cookies?:Cookies; |
|
|
|
cookies?:Cookies; |
|
|
|
}, { userEdit:UserEdit,userInfo?:User,result:JSX.Element|null }>{ |
|
|
|
}, { |
|
|
|
|
|
|
|
userEdit:UserEdit, |
|
|
|
|
|
|
|
userInfo?:User, |
|
|
|
|
|
|
|
result:JSX.Element|null, |
|
|
|
|
|
|
|
activityImgFile?:any; |
|
|
|
|
|
|
|
}>{ |
|
|
|
|
|
|
|
|
|
|
|
private ages:Array<number> |
|
|
|
private ages:Array<number> |
|
|
|
|
|
|
|
|
|
|
@ -167,11 +181,8 @@ export class MyInfo extends React.Component< |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
let that=this |
|
|
|
let that=this |
|
|
|
// let isUpdateUserType=this.state.userEdit.userType!==this.state.userEdit.oldUserType
|
|
|
|
|
|
|
|
// if(isUpdateUserType&&this.props.cookies){
|
|
|
|
request(Api.account.update,Method.PUT, { |
|
|
|
// this.props.cookies.set(user_type_cookie,this.state.userEdit.userType)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
request(Api.account.update,Method.POST, { |
|
|
|
|
|
|
|
headImg:this.state.userEdit.headImg||"", |
|
|
|
headImg:this.state.userEdit.headImg||"", |
|
|
|
name:this.state.userEdit.name||"", |
|
|
|
name:this.state.userEdit.name||"", |
|
|
|
age:this.state.userEdit.age+""||"", |
|
|
|
age:this.state.userEdit.age+""||"", |
|
|
@ -180,7 +191,8 @@ export class MyInfo extends React.Component< |
|
|
|
serviceAddress:this.state.userEdit.serviceAddress||"", |
|
|
|
serviceAddress:this.state.userEdit.serviceAddress||"", |
|
|
|
info:this.state.userEdit.info||"", |
|
|
|
info:this.state.userEdit.info||"", |
|
|
|
userType:this.state.userEdit.userType||"", |
|
|
|
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>) { |
|
|
|
},new EmptyBodyTransform(),function (res:JSONResponse<SimpleMessage>) { |
|
|
|
switch (res.customResult) { |
|
|
|
switch (res.customResult) { |
|
|
|
case SimpleMessage.fail: |
|
|
|
case SimpleMessage.fail: |
|
|
@ -236,7 +248,10 @@ export class MyInfo extends React.Component< |
|
|
|
<Container className="overflow-auto"> |
|
|
|
<Container className="overflow-auto"> |
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col className="p-3 text-center"> |
|
|
|
<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> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
{/*TODO 表单校验*/} |
|
|
|
{/*TODO 表单校验*/} |
|
|
|