|
|
@ -1,6 +1,6 @@ |
|
|
|
import React from "react"; |
|
|
|
import React from "react"; |
|
|
|
import {Button, ButtonGroup, Col, Container, Image, ListGroup, Row} from "react-bootstrap"; |
|
|
|
import {Button, ButtonGroup, Col, Container, Image, ListGroup, Row} from "react-bootstrap"; |
|
|
|
import {ActivityStatus, SeekHelpState, User} from "../entity"; |
|
|
|
import {ActivityStatus, PageProps, SeekHelpState, User} from "../entity"; |
|
|
|
import moment from "moment"; |
|
|
|
import moment from "moment"; |
|
|
|
import Dialog from "@material-ui/core/Dialog"; |
|
|
|
import Dialog from "@material-ui/core/Dialog"; |
|
|
|
import {CloseDialog} from "../ui/CloseDialog"; |
|
|
|
import {CloseDialog} from "../ui/CloseDialog"; |
|
|
@ -9,9 +9,17 @@ import Draggable from "react-draggable"; |
|
|
|
import {MyDialog} from "../ui/MyDialog"; |
|
|
|
import {MyDialog} from "../ui/MyDialog"; |
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
|
import {Method, request} from "../interface"; |
|
|
|
import {Method, request} from "../interface"; |
|
|
|
import {SeekHelpInfoRes, SeekHelpInfoTransform, SeekHelpUser, SeekHelpUserTransform, SimpleMessage} from "../result"; |
|
|
|
import { |
|
|
|
import {getStatus} from "../public"; |
|
|
|
PageDataMessage, |
|
|
|
|
|
|
|
SeekHelpInfoRes, |
|
|
|
|
|
|
|
SeekHelpInfoTransform, |
|
|
|
|
|
|
|
SeekHelpUser, |
|
|
|
|
|
|
|
SeekHelpUserTransform, |
|
|
|
|
|
|
|
SimpleMessage |
|
|
|
|
|
|
|
} from "../result"; |
|
|
|
|
|
|
|
import {getStatus, scrollBottom} from "../public"; |
|
|
|
import {Api, prefix} from "../api"; |
|
|
|
import {Api, prefix} from "../api"; |
|
|
|
|
|
|
|
import {SimpleSnackbar} from "../ui/toast"; |
|
|
|
|
|
|
|
|
|
|
|
const titleId="seek-help-dialog" |
|
|
|
const titleId="seek-help-dialog" |
|
|
|
|
|
|
|
|
|
|
@ -34,6 +42,9 @@ export class SeekHelp extends React.Component<{ user:string }, |
|
|
|
userId?:string; |
|
|
|
userId?:string; |
|
|
|
//操作反馈弹窗
|
|
|
|
//操作反馈弹窗
|
|
|
|
result:JSX.Element|null; |
|
|
|
result:JSX.Element|null; |
|
|
|
|
|
|
|
//分页信息
|
|
|
|
|
|
|
|
page?:PageProps; |
|
|
|
|
|
|
|
scrollTip:string|null |
|
|
|
}>{ |
|
|
|
}>{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -44,30 +55,35 @@ export class SeekHelp extends React.Component<{ user:string }, |
|
|
|
data:[], |
|
|
|
data:[], |
|
|
|
open:false, |
|
|
|
open:false, |
|
|
|
openUserInfo:false, |
|
|
|
openUserInfo:false, |
|
|
|
result:null |
|
|
|
result:null, |
|
|
|
|
|
|
|
scrollTip:null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
componentDidMount() { |
|
|
|
this.loadHelp() |
|
|
|
this.loadHelp(1) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 加载我的求助信息 |
|
|
|
* 加载我的求助信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
loadHelp(){ |
|
|
|
loadHelp(page:number){ |
|
|
|
let that=this |
|
|
|
let that=this |
|
|
|
request(Api.main.activity.seekHelp,Method.GET, {},new SeekHelpInfoTransform(),function (res:SeekHelpInfoRes) { |
|
|
|
request(Api.main.activity.seekHelp,Method.GET, { |
|
|
|
|
|
|
|
currentPage:String(page) |
|
|
|
|
|
|
|
},new SeekHelpInfoTransform(),function (res:SeekHelpInfoRes) { |
|
|
|
switch (res.customResult) { |
|
|
|
switch (res.customResult) { |
|
|
|
case SimpleMessage.fail: |
|
|
|
case PageDataMessage.ok: |
|
|
|
that.setState({ |
|
|
|
that.setState({ |
|
|
|
result:<h3 className="text-danger text-center">获取求助信息失败,请联系管理员</h3> |
|
|
|
data: (that.state.data||[]).concat(res.dataList||[]), |
|
|
|
}); |
|
|
|
page: res.page, |
|
|
|
|
|
|
|
scrollTip: page > 1 ? '成功加载第' + page + '页数据' : null, |
|
|
|
|
|
|
|
}) |
|
|
|
break |
|
|
|
break |
|
|
|
case SimpleMessage.ok: |
|
|
|
case PageDataMessage.fail: |
|
|
|
that.setState({ |
|
|
|
that.setState({ |
|
|
|
data:res.dataList |
|
|
|
result:<h3 className="text-danger text-center">获取求助信息失败,请联系管理员</h3> |
|
|
|
}) |
|
|
|
}); |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
@ -102,8 +118,11 @@ export class SeekHelp extends React.Component<{ user:string }, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
|
|
|
|
let that=this |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="overflow-auto seek-help-height w-100"> |
|
|
|
<div className="overflow-auto seek-help-height w-100" onScroll={event => scrollBottom(event,this,function () { |
|
|
|
|
|
|
|
that.loadHelp((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((help:SeekHelpState, index:number)=> |
|
|
|
{this.state.data?this.state.data.length===0?<h3 className="text-info text-center">没有找到求助记录</h3>:this.state.data.map((help:SeekHelpState, index:number)=> |
|
|
|
<div key={"list"+index} className="mt-3 mb-3 border-info border"> |
|
|
|
<div key={"list"+index} className="mt-3 mb-3 border-info border"> |
|
|
|
<Container> |
|
|
|
<Container> |
|
|
@ -158,6 +177,8 @@ export class SeekHelp extends React.Component<{ user:string }, |
|
|
|
|
|
|
|
|
|
|
|
<MyDialog content={this.state.result} open={this.state.result!==null} titleId="seek-help-dialog" |
|
|
|
<MyDialog content={this.state.result} open={this.state.result!==null} titleId="seek-help-dialog" |
|
|
|
menuName="求助信息提示" onClose={()=>this.setState({result:null})} /> |
|
|
|
menuName="求助信息提示" onClose={()=>this.setState({result:null})} /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.state.scrollTip!==null?<SimpleSnackbar message={this.state.scrollTip} onClose={()=>this.setState({scrollTip:null})} duration={1000}/>:null} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|