Commit 6c2a7ef0 by qiyeqing

客户聊天列表

1 parent f9baa0dc
<template>
<div class="list" v-loading="loading">
<div v-if="personList.length>=1">
<ul>
<li v-for="(item,index) in personList" :key="index" @click="liClick(item)">
<el-row style="padding:10px">
<el-col :span="3"><img :src="item.receiveWeUser.avatarMediaid" ></el-col>
<el-col :span="21">
<p>{{item.receiveWeUser.name}} <span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p>
<p class="gray padt10" v-if="item.finalChatContext.text">{{item.finalChatContext.text.content}}</p>
</el-col>
</el-row>
</li>
</ul>
</div>
<div v-else></div>
</div>
</template>
<script>
import {parseTime} from '@/utils/common.js'
export default {
props: {
personList: {
type: Array,
defluat: () => []
},
loading: {
type: Boolean,
defluat: false
},
},
data() {
return{
loadings:true
}
},
methods:{
liClick(e){
this.$emit('chatFn',e)
}
}
}
</script>
<style lang="scss" scoped>
*{ padding: 0;
margin: 0;}
.list {
overflow-y:scroll;
height: 708px;
::-webkit-scrollbar {
display: none;
}
/deep/ .el-loading-spinner{margin-top: 20px;}
.fr{float:right;}
.gray{color: #999;}
.padt10{padding-top: 10px;}
ul li {
padding: 10px;
overflow: hidden;
border-bottom: 1px solid #efefef;
cursor: pointer;
p{white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;}
:hover{ background: #efefef;}
img {
width: 40px;
height: 40px;
float: left
}
}
}
</style>
\ No newline at end of file
......@@ -32,24 +32,21 @@
<el-input placeholder="搜索聊天记录" prefix-icon="el-icon-search" v-model="employName">
</el-input>
</div>
</div>
</div>
<div class="hd_tabs">
<el-tabs v-model="activeName">
<el-tabs v-model="activeName" @tab-click="getChatList()">
<el-tab-pane label="单聊" name="0">
<div class="hd_tabs_content">
<!-- <list v-if="activeName==0" :personList="personList" :loading="loading" >
</list> -->
<list v-if="activeName==0" :personList="personList" :loading="loading" >
</list>
</div>
</el-tab-pane>
<el-tab-pane label="群聊" name="2">
<list v-if="activeName==2" :personList="personList" :loading="loading" @chatFn="chatFn">
</list>
<grouplist v-if="activeName==2" :personList="personList" :loading="loading">
</grouplist>
</el-tab-pane>
</el-tabs>
</div>
</div>
</el-col>
<el-col :span="12">
<div class="hd_box">
......@@ -163,8 +160,10 @@
</div>
</template>
<script>
import list from '../component/curList.vue'
import list from '../component/customerList.vue'
import chat from '../component/chat.vue'
import grouplist from '../component/groupList.vue'
import {
content
} from '@/api/content.js'
......@@ -173,7 +172,7 @@ import {
} from '@/utils/common.js'
export default {
components:{
list,chat
list,chat,grouplist
},
data() {
return {
......@@ -227,17 +226,17 @@ import {
if (flag) {
this.loading = true
}
this.personList=[]
content.getTree({
fromId: this.employId,
searchType: this.activeName
}).then(({
rows
}) => {
console.log(rows)
this.loading = false
this.personList = rows
this.personList = rows
}).catch(err => {
this.loading = false
this.loading = false
})
},
activeNameThreeClick(page){
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!