221 lines
5.3 KiB
Vue
221 lines
5.3 KiB
Vue
<template>
|
||
<div class="live-call" v-loading="detailLoading">
|
||
<div class="header">
|
||
<div>
|
||
<span style="margin-right: 20px">{{ headData.username }}</span>
|
||
</div>
|
||
<div>
|
||
<span>电话号码:{{ headData.phone ||'--'}}</span>
|
||
</div>
|
||
<div><span>工单名称:{{ headData.orderName ||'--'}}</span></div>
|
||
</div>
|
||
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
||
<div class="chat-content" ref="innerRef">
|
||
<div v-for="(item,index) in recordArray" :key="index">
|
||
<div v-for="[key,value] of item.textVoList">
|
||
<div class="time-grap"><span>{{ key || '6月5日 12:05' }}</span></div>
|
||
<div v-for="(recordItem) in value">
|
||
<!-- 我的 -->
|
||
<div v-if="recordItem.speaker==0" class="word-my">
|
||
<div class="info">
|
||
<p class="name">{{ recordItem.speaker == 0 ? recordItem.name
|
||
: '运维助手' }} </p>
|
||
<div class="info-content">{{ recordItem.message }}</div>
|
||
</div>
|
||
<el-avatar>{{ recordItem.speaker==0?recordItem.name:'运维助手' }}</el-avatar>
|
||
</div>
|
||
<!-- 对方 -->
|
||
<div v-else class="word">
|
||
<el-avatar>{{ recordItem.speaker==0?recordItem.name:'运维助手' }}</el-avatar>
|
||
<div class="info">
|
||
<p class="name">{{ recordItem.speaker == 0 ? recordItem.name
|
||
: '运维助手' }} </p>
|
||
<div class="info-content">{{ recordItem.message }}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<el-divider border-style="dotted" v-if="item.textVoList&&item.textVoList.length>0">一轮通话结束~~</el-divider>
|
||
</div>
|
||
<!-- <el-empty description="暂无通话记录~" v-if="recordArray"/>-->
|
||
|
||
</div>
|
||
</el-scrollbar>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup>
|
||
import {defineProps} from "vue";
|
||
|
||
const scrollbarRef = ref()
|
||
const props = defineProps({
|
||
recordArray: {
|
||
type: Array,
|
||
default: []
|
||
},
|
||
headData: {
|
||
type: Object,
|
||
default: {}
|
||
},
|
||
detailLoading: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
})
|
||
const getScrollbarRef = () => {
|
||
return scrollbarRef.value
|
||
}
|
||
watch(() => props.detailLoading, (newVal) => {
|
||
props.detailLoading=newVal
|
||
})
|
||
defineExpose({
|
||
getScrollbarRef
|
||
})
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.live-call {
|
||
width: 50%;
|
||
height: 47vh;
|
||
margin-bottom: 20px;
|
||
overflow: hidden;
|
||
border: 1px solid #d5d4d4;
|
||
border-radius: 10px;
|
||
|
||
.header {
|
||
display: flex;
|
||
justify-content: space-around;
|
||
align-items: center;
|
||
height: 40px;
|
||
border-bottom: 1px solid #d5d4d4;
|
||
}
|
||
|
||
.scrollbar {
|
||
padding: 10px 10px 0 10px;
|
||
height: 42vh;
|
||
|
||
.el-scrollbar__wrap {
|
||
height: 100%;
|
||
overflow: scroll;
|
||
overflow-x: auto;
|
||
}
|
||
|
||
// 聊天内容样式
|
||
.chat-content {
|
||
width: 100%;
|
||
|
||
.time-grap {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
> span {
|
||
font-size: 13px;
|
||
padding: 5px 10px;
|
||
border: 1px solid #d7d9da;
|
||
border-radius: 25px;
|
||
}
|
||
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.word {
|
||
display: flex;
|
||
margin-bottom: 20px;
|
||
|
||
img {
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 50%;
|
||
}
|
||
|
||
.info {
|
||
margin-left: 10px;
|
||
|
||
.name {
|
||
font-size: 12px;
|
||
color: rgba(51, 51, 51, 0.8);
|
||
margin: 0;
|
||
height: 20px;
|
||
line-height: 20px;
|
||
margin-top: -5px;
|
||
}
|
||
|
||
.info-content {
|
||
padding: 10px;
|
||
font-size: 14px;
|
||
background: #f5f5f5;
|
||
position: relative;
|
||
margin-top: 8px;
|
||
border: 1px solid #f5f5f5;
|
||
}
|
||
|
||
//小三角形
|
||
.info-content::before {
|
||
position: absolute;
|
||
left: -8px;
|
||
top: 8px;
|
||
content: '';
|
||
border-right: 10px solid #f5f5f5;
|
||
border-top: 8px solid transparent;
|
||
border-bottom: 8px solid transparent;
|
||
}
|
||
}
|
||
}
|
||
|
||
.word-my {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
margin-bottom: 20px;
|
||
|
||
img {
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 50%;
|
||
}
|
||
|
||
.info {
|
||
width: 90%;
|
||
margin-left: 10px;
|
||
text-align: right;
|
||
|
||
.name {
|
||
font-size: 12px;
|
||
color: rgba(51, 51, 51, 0.8);
|
||
height: 20px;
|
||
line-height: 20px;
|
||
margin-top: -5px;
|
||
margin-right: 10px;
|
||
}
|
||
|
||
.info-content {
|
||
max-width: 70%;
|
||
padding: 10px;
|
||
font-size: 14px;
|
||
float: right;
|
||
margin-right: 10px;
|
||
position: relative;
|
||
margin-top: 8px;
|
||
background: #A3C3F6;
|
||
text-align: left;
|
||
}
|
||
|
||
//小三角形
|
||
.info-content::after {
|
||
position: absolute;
|
||
right: -8px;
|
||
top: 8px;
|
||
content: '';
|
||
border-left: 10px solid #A3C3F6;
|
||
border-top: 8px solid transparent;
|
||
border-bottom: 8px solid transparent;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
</style>
|