|
|
@ -2,8 +2,9 @@ import React from "react"; |
|
|
|
import {Button, Col, Container, Image, Row} from "react-bootstrap"; |
|
|
|
import {Button, Col, Container, Image, Row} from "react-bootstrap"; |
|
|
|
import {ActiveDetail, User} from "../entity"; |
|
|
|
import {ActiveDetail, User} from "../entity"; |
|
|
|
import {Tooltip} from "@material-ui/core"; |
|
|
|
import {Tooltip} from "@material-ui/core"; |
|
|
|
import {MyDialog} from "./MyDialog"; |
|
|
|
import {MyDialog} from "../ui/MyDialog"; |
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
|
|
|
|
|
import {Active} from "../ui/Active"; |
|
|
|
|
|
|
|
|
|
|
|
enum LeaveWordType { |
|
|
|
enum LeaveWordType { |
|
|
|
recommend, |
|
|
|
recommend, |
|
|
@ -27,17 +28,25 @@ interface Type2 { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 我的留言 |
|
|
|
* 我的留言 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export class MyLeaveWord extends React.Component<{ user:string }, { |
|
|
|
export class MyLeaveWord extends React.Component<{ user:string }, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
//留言信息
|
|
|
|
data:Array<Type1|Type2>; |
|
|
|
data:Array<Type1|Type2>; |
|
|
|
|
|
|
|
//打开用户信息弹框
|
|
|
|
openUserInfo:boolean; |
|
|
|
openUserInfo:boolean; |
|
|
|
|
|
|
|
//用户id
|
|
|
|
userId?:string; |
|
|
|
userId?:string; |
|
|
|
|
|
|
|
//打开活动信息弹框
|
|
|
|
|
|
|
|
openActive:boolean; |
|
|
|
|
|
|
|
//活动详情
|
|
|
|
|
|
|
|
active?:ActiveDetail; |
|
|
|
}>{ |
|
|
|
}>{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(props: Readonly<any>) { |
|
|
|
constructor(props: Readonly<any>) { |
|
|
|
super(props); |
|
|
|
super(props); |
|
|
|
|
|
|
|
|
|
|
|
this.state={data:[],openUserInfo:false} |
|
|
|
this.state={data:[],openUserInfo:false,openActive:false} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
componentDidMount() { |
|
|
@ -62,9 +71,12 @@ export class MyLeaveWord extends React.Component<{ user:string }, { |
|
|
|
info:"个人简介", |
|
|
|
info:"个人简介", |
|
|
|
}, |
|
|
|
}, |
|
|
|
active:{ |
|
|
|
active:{ |
|
|
|
|
|
|
|
activeId:1, |
|
|
|
title:"活动标题1", |
|
|
|
title:"活动标题1", |
|
|
|
content:"活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动", |
|
|
|
content:"活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动", |
|
|
|
activeImg:"logo512.png" |
|
|
|
activeImg:"logo512.png", |
|
|
|
|
|
|
|
activeStartTime:new Date().getTime(), |
|
|
|
|
|
|
|
activeEndTime:new Date().getTime() |
|
|
|
}, |
|
|
|
}, |
|
|
|
type:LeaveWordType.recommend |
|
|
|
type:LeaveWordType.recommend |
|
|
|
}, |
|
|
|
}, |
|
|
@ -80,9 +92,12 @@ export class MyLeaveWord extends React.Component<{ user:string }, { |
|
|
|
info:"个人简介", |
|
|
|
info:"个人简介", |
|
|
|
}, |
|
|
|
}, |
|
|
|
active:{ |
|
|
|
active:{ |
|
|
|
|
|
|
|
activeId:1, |
|
|
|
title:"活动标题1", |
|
|
|
title:"活动标题1", |
|
|
|
content:"活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动", |
|
|
|
content:"活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动活动内容活动内容活动", |
|
|
|
activeImg:"logo512.png" |
|
|
|
activeImg:"logo512.png", |
|
|
|
|
|
|
|
activeStartTime:new Date().getTime(), |
|
|
|
|
|
|
|
activeEndTime:new Date().getTime() |
|
|
|
}, |
|
|
|
}, |
|
|
|
type:LeaveWordType.apply |
|
|
|
type:LeaveWordType.apply |
|
|
|
}, |
|
|
|
}, |
|
|
@ -133,7 +148,7 @@ export class MyLeaveWord extends React.Component<{ user:string }, { |
|
|
|
<p className="text-ellipsis leave-word-height">{data.active.content}</p> |
|
|
|
<p className="text-ellipsis leave-word-height">{data.active.content}</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="text-center"> |
|
|
|
<div className="text-center"> |
|
|
|
<Button variant={"primary"}>查看活动详情</Button> |
|
|
|
<Button variant={"primary"} onClick={()=>this.setState({openActive:true,active:data.active})}>查看活动详情</Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
@ -184,6 +199,10 @@ export class MyLeaveWord extends React.Component<{ user:string }, { |
|
|
|
<MyDialog titleId="view-user" menuName="用户信息" |
|
|
|
<MyDialog titleId="view-user" menuName="用户信息" |
|
|
|
content={<MyInfo ownUserId={this.props.user} isOwn={false} isMyFriend={false} isAdd={false} userId={this.state.userId}/>} |
|
|
|
content={<MyInfo ownUserId={this.props.user} isOwn={false} isMyFriend={false} isAdd={false} userId={this.state.userId}/>} |
|
|
|
open={this.state.openUserInfo} onClose={()=>this.setState({openUserInfo:false})}/> |
|
|
|
open={this.state.openUserInfo} onClose={()=>this.setState({openUserInfo:false})}/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.state.active?<MyDialog content={<Active active={this.state.active} showButton={false} />} |
|
|
|
|
|
|
|
open={this.state.openActive} titleId="view-active" menuName="活动详情" |
|
|
|
|
|
|
|
onClose={()=>this.setState({active:undefined,openActive:false})}/>:null} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|