|
|
|
@ -11,15 +11,24 @@ class Wechat_session extends Component {
|
|
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
const {wechatStore} = this.context;
|
|
|
|
|
wechatStore.fetchWechatUserList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleUserClick(user) {
|
|
|
|
|
///weixin/wxwork/get_externalcontact_list?userid=misscarol&searchstr=
|
|
|
|
|
const {wechatStore} = this.context;
|
|
|
|
|
wechatStore.fetchContactList(user);
|
|
|
|
|
}
|
|
|
|
|
handleContactClick(contact) {
|
|
|
|
|
const {wechatStore} = this.context;
|
|
|
|
|
wechatStore.fetchChatMsgList(contact);
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
const {wechatStore} = this.context;
|
|
|
|
|
const userList = wechatStore.userList;
|
|
|
|
|
const contactList = wechatStore.contactList;
|
|
|
|
|
const chatMsgList = wechatStore.chatMsgList;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
@ -44,7 +53,7 @@ class Wechat_session extends Component {
|
|
|
|
|
itemLayout="horizontal"
|
|
|
|
|
dataSource={contactList}
|
|
|
|
|
renderItem={(contact) => (
|
|
|
|
|
<List.Item onClick={() => {console.info(contact)}}>
|
|
|
|
|
<List.Item onClick={() => {this.handleContactClick(contact)}}>
|
|
|
|
|
<List.Item.Meta
|
|
|
|
|
avatar={<Avatar src={contact.avatar} />}
|
|
|
|
|
title={contact.username}
|
|
|
|
@ -54,6 +63,21 @@ class Wechat_session extends Component {
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<List
|
|
|
|
|
itemLayout="horizontal"
|
|
|
|
|
dataSource={chatMsgList}
|
|
|
|
|
renderItem={(chatMsg) => (
|
|
|
|
|
<List.Item>
|
|
|
|
|
<List.Item.Meta
|
|
|
|
|
avatar={<Avatar src={chatMsg.from_avatar} />}
|
|
|
|
|
title={chatMsg.from_name}
|
|
|
|
|
description={chatMsg.content.text}
|
|
|
|
|
/>
|
|
|
|
|
</List.Item>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|