diff --git a/src/charts/Wechat_session.js b/src/charts/Wechat_session.js index 8ea4e7f..6e9cf13 100644 --- a/src/charts/Wechat_session.js +++ b/src/charts/Wechat_session.js @@ -29,6 +29,32 @@ class Wechat_session extends Component { const {wechatStore} = this.context; wechatStore.fetchChatMsgList(wechatStore.selectedContact, page, pageSize); } + + renderMsgItem(chatMsg) { + if (chatMsg.msgtype === 'image') { + return ( + + } + title={chatMsg.from_name} + description={chatMsg.msgtime} + /> + {chatMsg.msgid} + + )} else { + return ( + + } + title={chatMsg.from_name} + description={chatMsg.msgtime} + /> + {chatMsg.content.text} + + ) + } + } + render() { const {wechatStore} = this.context; const userList = wechatStore.userList; @@ -71,6 +97,7 @@ class Wechat_session extends Component { )} /> + ( - - } - title={chatMsg.from_name} - description={chatMsg.msgtime} - /> - {chatMsg.content.text} - - )} + renderItem={(chatMsg) => this.renderMsgItem(chatMsg)} />