Commit 10e22d86 authored by yaya's avatar yaya

feat: 代码优化

parent 459926c2
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
messageContent: '', messageContent: '',
nextReqMessageID: '', // 历史消息下一页 nextReqMessageID: '', // 历史消息下一页
isCompleted: false, isCompleted: false,
envText: process.env.NODE_ENV === 'development' ? 'cjxc-applet-dev_' : 'cjxc-applet_', envText: 'cjxc-applet-dev_',
conversationList: [], // 会话列表 conversationList: [], // 会话列表
currentConversationItem: {}, // 当前聊天 currentConversationItem: {}, // 当前聊天
messageList: [], // 历史消息 messageList: [], // 历史消息
......
...@@ -51,8 +51,9 @@ ...@@ -51,8 +51,9 @@
<el-drawer <el-drawer
:visible.sync="showDetail" :visible.sync="showDetail"
:with-header="false" :with-header="false"
:before-close="handleClose"
size="40%"> size="40%">
<div> <div v-if="showDetail">
<MessageDetail :from-account="fromAccount" :to-account="toAccount" /> <MessageDetail :from-account="fromAccount" :to-account="toAccount" />
</div> </div>
...@@ -92,6 +93,9 @@ export default { ...@@ -92,6 +93,9 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
handleClose() {
this.showDetail = false
},
/** /**
* 获取客服列表 * 获取客服列表
**/ **/
......
<template>
<div class="component-history"/>
</template>
<script>
export default {
name: 'HistoryMessageList',
props: {
fromAccount: {
type: String,
required: true
},
toAccount: {
type: String,
required: true
}
}
}
</script>
<style lang="scss" scoped>
.component-history {
display: flex;
flex-direction: column;
}
</style>
<template> <template>
<div class="components-message"> <div class="components-message">
<!-- <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="0">会话记录</el-menu-item>
<el-menu-item index="1">
会话信息
</el-menu-item>
</el-menu>-->
<el-tabs v-model="activeIndex" @tab-click="handleSelect"> <el-tabs v-model="activeIndex" @tab-click="handleSelect">
<el-tab-pane label="会话记录" name="1">用户管理</el-tab-pane> <el-tab-pane label="会话记录" name="1">
<HistoryMessageList :from-account="fromAccount" :to-account="toAccount"/>
</el-tab-pane>
<el-tab-pane label="会话信息" name="2"> <el-tab-pane label="会话信息" name="2">
<ChatUserInfo :chat-user-info="chatUserInfo" /> <ChatUserInfo :chat-user-info="chatUserInfo" />
</el-tab-pane> </el-tab-pane>
...@@ -19,9 +15,10 @@ ...@@ -19,9 +15,10 @@
<script> <script>
import { findChatUserInfo } from '@/api/business/chat' import { findChatUserInfo } from '@/api/business/chat'
import ChatUserInfo from './chatUserInfo' import ChatUserInfo from './chatUserInfo'
import HistoryMessageList from './historyMessageList'
export default { export default {
name: 'MessageDetail', name: 'MessageDetail',
components: { ChatUserInfo }, components: { HistoryMessageList, ChatUserInfo },
props: { props: {
fromAccount: { fromAccount: {
type: String, type: String,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment