|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
import React from "react"; |
|
|
|
|
import {Button, Col, Container, FormControl, Image, ListGroup, Row,} from "react-bootstrap"; |
|
|
|
|
import {Chat, User} from "../entity"; |
|
|
|
|
import {Chat, PageProps, User} from "../entity"; |
|
|
|
|
import {Tooltip} from "@material-ui/core"; |
|
|
|
|
import moment from "moment"; |
|
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
|
@ -38,6 +38,7 @@ export class MyFriend extends React.Component< |
|
|
|
|
//操作反馈
|
|
|
|
|
result:JSX.Element|null; |
|
|
|
|
//
|
|
|
|
|
page?:PageProps; |
|
|
|
|
} |
|
|
|
|
>{ |
|
|
|
|
|
|
|
|
@ -63,7 +64,7 @@ export class MyFriend extends React.Component< |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
|
loadMyFriend('',this) |
|
|
|
|
loadMyFriend('',this,1) |
|
|
|
|
this.joinChat() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -114,7 +115,7 @@ export class MyFriend extends React.Component< |
|
|
|
|
}else { |
|
|
|
|
|
|
|
|
|
let that = this |
|
|
|
|
request(Api.account.findUser + "?name=" + name, Method.GET, {}, new UserTransform(), function (res: UserRes) { |
|
|
|
|
request(Api.account.findUser, Method.GET, {name:name}, new UserTransform(), function (res: UserRes) { |
|
|
|
|
switch (res.customResult) { |
|
|
|
|
case PageDataMessage.ok: |
|
|
|
|
that.setState({ |
|
|
|
@ -141,14 +142,19 @@ export class MyFriend extends React.Component< |
|
|
|
|
<Container> |
|
|
|
|
<Row className="d-flex justify-content-center bg-light"> |
|
|
|
|
<div> |
|
|
|
|
<ListGroup className="overflow-auto bg-light friend-list"> |
|
|
|
|
<ListGroup className="overflow-auto bg-light friend-list" onScroll={(e:any)=> { |
|
|
|
|
if (e.target.scrollHeight - e.target.scrollTop === e.target.clientHeight) { |
|
|
|
|
console.log('到达底部') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}> |
|
|
|
|
<ListGroup.Item variant="primary">我的好友</ListGroup.Item> |
|
|
|
|
<ListGroup.Item> |
|
|
|
|
<FormControl placeholder="查找好友" onChange={(e)=>{ |
|
|
|
|
this.setState({ |
|
|
|
|
queryFriend:e.target.value |
|
|
|
|
}) |
|
|
|
|
loadMyFriend(e.target.value,this) |
|
|
|
|
loadMyFriend(e.target.value,this,1) |
|
|
|
|
}}/> |
|
|
|
|
</ListGroup.Item> |
|
|
|
|
{this.state.friendList?this.state.friendList.map((friend:User,index:number)=> |
|
|
|
|