|
|
@ -1,15 +1,16 @@ |
|
|
|
import React from "react"; |
|
|
|
import React from "react"; |
|
|
|
import {Button, Col, Container, Image, Row} from "react-bootstrap"; |
|
|
|
import {Button, Col, Container, Image, Row} from "react-bootstrap"; |
|
|
|
import {ActivityStatus, LeaveWord, LeaveWordType} from "../entity"; |
|
|
|
import {ActivityStatus, LeaveWord, LeaveWordType, PageProps} from "../entity"; |
|
|
|
import {Tooltip} from "@material-ui/core"; |
|
|
|
import {Tooltip} from "@material-ui/core"; |
|
|
|
import {MyDialog} from "../ui/MyDialog"; |
|
|
|
import {MyDialog} from "../ui/MyDialog"; |
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
|
import {Activity} from "../ui/Activity"; |
|
|
|
import {Activity} from "../ui/Activity"; |
|
|
|
import {JSONResponse, Method, request} from "../interface"; |
|
|
|
import {JSONResponse, Method, request} from "../interface"; |
|
|
|
import {EmptyBodyTransform, LeaveWordRes, LeaveWordTransform, PageDataMessage, SimpleMessage} from "../result"; |
|
|
|
import {EmptyBodyTransform, LeaveWordRes, LeaveWordTransform, PageDataMessage, SimpleMessage} from "../result"; |
|
|
|
import {changeActivity} from "../public"; |
|
|
|
import {changeActivity, scrollBottom} from "../public"; |
|
|
|
import {Cookies} from "react-cookie"; |
|
|
|
import {Cookies} from "react-cookie"; |
|
|
|
import {Api, prefix} from "../api"; |
|
|
|
import {Api, prefix} from "../api"; |
|
|
|
|
|
|
|
import {SimpleSnackbar} from "../ui/toast"; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 我的留言 |
|
|
|
* 我的留言 |
|
|
@ -27,9 +28,11 @@ export class MyLeaveWord extends React.Component< |
|
|
|
//用户id
|
|
|
|
//用户id
|
|
|
|
userId?:string; |
|
|
|
userId?:string; |
|
|
|
//活动详情
|
|
|
|
//活动详情
|
|
|
|
activityId:number|null, |
|
|
|
activityId:number|null; |
|
|
|
//加载提示
|
|
|
|
//加载提示
|
|
|
|
result:JSX.Element|null |
|
|
|
result:JSX.Element|null; |
|
|
|
|
|
|
|
scrollTip:string|null, |
|
|
|
|
|
|
|
page?:PageProps |
|
|
|
}>{ |
|
|
|
}>{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -40,7 +43,8 @@ export class MyLeaveWord extends React.Component< |
|
|
|
result: null, |
|
|
|
result: null, |
|
|
|
activityId: null, |
|
|
|
activityId: null, |
|
|
|
data:[], |
|
|
|
data:[], |
|
|
|
openUserInfo:false |
|
|
|
openUserInfo:false, |
|
|
|
|
|
|
|
scrollTip:null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -48,6 +52,7 @@ export class MyLeaveWord extends React.Component< |
|
|
|
this.loadLeaveWord(1) |
|
|
|
this.loadLeaveWord(1) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 加载留言 |
|
|
|
* 加载留言 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -58,9 +63,13 @@ export class MyLeaveWord extends React.Component< |
|
|
|
request(Api.account.leaveWord,Method.GET,{currentPage:String(page)},new LeaveWordTransform(),function (res:LeaveWordRes) { |
|
|
|
request(Api.account.leaveWord,Method.GET,{currentPage:String(page)},new LeaveWordTransform(),function (res:LeaveWordRes) { |
|
|
|
switch (res.customResult) { |
|
|
|
switch (res.customResult) { |
|
|
|
case PageDataMessage.ok: |
|
|
|
case PageDataMessage.ok: |
|
|
|
that.setState({ |
|
|
|
that.setState({ |
|
|
|
data:res.dataList |
|
|
|
data: (that.state.data||[]).concat(res.dataList||[]), |
|
|
|
});break |
|
|
|
page: res.page, |
|
|
|
|
|
|
|
scrollTip: page > 1 ? '成功加载第' + page + '页数据' : null, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break |
|
|
|
case PageDataMessage.fail: |
|
|
|
case PageDataMessage.fail: |
|
|
|
that.setState({ |
|
|
|
that.setState({ |
|
|
|
result:<h3 className="text-danger text-center">留言列表加载失败</h3> |
|
|
|
result:<h3 className="text-danger text-center">留言列表加载失败</h3> |
|
|
@ -193,8 +202,11 @@ export class MyLeaveWord extends React.Component< |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
|
|
|
|
let that=this |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="overflow-auto my-leave-world-height"> |
|
|
|
<div className="overflow-auto my-leave-world-height" onScroll={e=>scrollBottom(e,that,function () { |
|
|
|
|
|
|
|
that.loadLeaveWord((that.state.page?.currentPage||1)+1) |
|
|
|
|
|
|
|
})}> |
|
|
|
{this.state.data?this.state.data.length===0?<h3 className="text-info text-center">没有留言记录</h3>:this.state.data.map((data,index) =>this.getData(data,index)):<h3 className="text-info text-center">留言加载中</h3>} |
|
|
|
{this.state.data?this.state.data.length===0?<h3 className="text-info text-center">没有留言记录</h3>:this.state.data.map((data,index) =>this.getData(data,index)):<h3 className="text-info text-center">留言加载中</h3>} |
|
|
|
<MyDialog titleId="view-user" menuName="用户信息" |
|
|
|
<MyDialog titleId="view-user" menuName="用户信息" |
|
|
|
content={<MyInfo isOwn={false} isAdd={false} userId={this.state.userId?this.state.userId:""}/>} |
|
|
|
content={<MyInfo isOwn={false} isAdd={false} userId={this.state.userId?this.state.userId:""}/>} |
|
|
@ -212,6 +224,10 @@ export class MyLeaveWord extends React.Component< |
|
|
|
<MyDialog content={this.state.result} open={this.state.result!==null} titleId="my_leave_word_dialog" menuName="提示" onClose={()=>this.setState({ |
|
|
|
<MyDialog content={this.state.result} open={this.state.result!==null} titleId="my_leave_word_dialog" menuName="提示" onClose={()=>this.setState({ |
|
|
|
result:null |
|
|
|
result:null |
|
|
|
})}/> |
|
|
|
})}/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.state.scrollTip!==null?<SimpleSnackbar message={this.state.scrollTip} onClose={()=>this.setState({scrollTip:null})} duration={1000}/>:null} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|