import React, {Component} from 'react'; import {Row, Col, List, Avatar} from 'antd'; import {stores_Context} from '../config' import {observer} from 'mobx-react'; import { toJS } from "mobx"; class Wechat_session extends Component { static contextType = stores_Context; constructor(props) { super(props); } componentDidMount() { const {wechatStore} = this.context; wechatStore.fetchWechatUserList(); } handleUserClick(user) { 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 (
( {this.handleUserClick(user)}}> } title={user.username} description="" /> )} /> ( {this.handleContactClick(contact)}}> } title={contact.username} description="" /> )} /> ( } title={chatMsg.from_name} description={chatMsg.content.text} /> )} />
); } } export default observer(Wechat_session);