|
|
|
@ -9,11 +9,17 @@ class Wechat_session extends Component {
|
|
|
|
|
static contextType = stores_Context;
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.stores = this.props.stores;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleUserClick(user) {
|
|
|
|
|
///weixin/wxwork/get_externalcontact_list?userid=misscarol&searchstr=
|
|
|
|
|
const {wechatStore} = this.context;
|
|
|
|
|
wechatStore.fetchContactList(user);
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
const {wechatStore} = this.stores;
|
|
|
|
|
const {wechatStore} = this.context;
|
|
|
|
|
const userList = wechatStore.userList;
|
|
|
|
|
const contactList = wechatStore.contactList;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
@ -23,7 +29,7 @@ class Wechat_session extends Component {
|
|
|
|
|
itemLayout="horizontal"
|
|
|
|
|
dataSource={userList}
|
|
|
|
|
renderItem={(user) => (
|
|
|
|
|
<List.Item>
|
|
|
|
|
<List.Item onClick={() => {this.handleUserClick(user)}}>
|
|
|
|
|
<List.Item.Meta
|
|
|
|
|
avatar={<Avatar src={user.avatar} />}
|
|
|
|
|
title={user.username}
|
|
|
|
@ -33,6 +39,21 @@ class Wechat_session extends Component {
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<List
|
|
|
|
|
itemLayout="horizontal"
|
|
|
|
|
dataSource={contactList}
|
|
|
|
|
renderItem={(contact) => (
|
|
|
|
|
<List.Item onClick={() => {console.info(contact)}}>
|
|
|
|
|
<List.Item.Meta
|
|
|
|
|
avatar={<Avatar src={contact.avatar} />}
|
|
|
|
|
title={contact.username}
|
|
|
|
|
description=""
|
|
|
|
|
/>
|
|
|
|
|
</List.Item>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|