|
|
@ -1,6 +1,6 @@ |
|
|
|
import React from "react"; |
|
|
|
import React from "react"; |
|
|
|
import {Button, Col, Container, FormControl, Image, ListGroup, Row,} from "react-bootstrap"; |
|
|
|
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 {Tooltip} from "@material-ui/core"; |
|
|
|
import moment from "moment"; |
|
|
|
import moment from "moment"; |
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
|
import {MyInfo} from "./MyInfo"; |
|
|
@ -38,6 +38,7 @@ export class MyFriend extends React.Component< |
|
|
|
//操作反馈
|
|
|
|
//操作反馈
|
|
|
|
result:JSX.Element|null; |
|
|
|
result:JSX.Element|null; |
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
page?:PageProps; |
|
|
|
} |
|
|
|
} |
|
|
|
>{ |
|
|
|
>{ |
|
|
|
|
|
|
|
|
|
|
@ -63,7 +64,7 @@ export class MyFriend extends React.Component< |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
componentDidMount() { |
|
|
|
loadMyFriend('',this) |
|
|
|
loadMyFriend('',this,1) |
|
|
|
this.joinChat() |
|
|
|
this.joinChat() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -114,7 +115,7 @@ export class MyFriend extends React.Component< |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
|
|
|
|
|
|
|
|
let that = this |
|
|
|
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) { |
|
|
|
switch (res.customResult) { |
|
|
|
case PageDataMessage.ok: |
|
|
|
case PageDataMessage.ok: |
|
|
|
that.setState({ |
|
|
|
that.setState({ |
|
|
@ -141,14 +142,19 @@ export class MyFriend extends React.Component< |
|
|
|
<Container> |
|
|
|
<Container> |
|
|
|
<Row className="d-flex justify-content-center bg-light"> |
|
|
|
<Row className="d-flex justify-content-center bg-light"> |
|
|
|
<div> |
|
|
|
<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 variant="primary">我的好友</ListGroup.Item> |
|
|
|
<ListGroup.Item> |
|
|
|
<ListGroup.Item> |
|
|
|
<FormControl placeholder="查找好友" onChange={(e)=>{ |
|
|
|
<FormControl placeholder="查找好友" onChange={(e)=>{ |
|
|
|
this.setState({ |
|
|
|
this.setState({ |
|
|
|
queryFriend:e.target.value |
|
|
|
queryFriend:e.target.value |
|
|
|
}) |
|
|
|
}) |
|
|
|
loadMyFriend(e.target.value,this) |
|
|
|
loadMyFriend(e.target.value,this,1) |
|
|
|
}}/> |
|
|
|
}}/> |
|
|
|
</ListGroup.Item> |
|
|
|
</ListGroup.Item> |
|
|
|
{this.state.friendList?this.state.friendList.map((friend:User,index:number)=> |
|
|
|
{this.state.friendList?this.state.friendList.map((friend:User,index:number)=> |
|
|
|