chatList.vue
2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<template>
<div class="takecontent">
<ul>
<li v-for="(item, index) in data" :key="index">
<div :class="['mb10', queryChat.fromId === item.fromId && 'ar']">
<span :class="['', queryChat.fromId === item.fromId && 'fr']" style="color: #4e5969">{{ item.name }}</span>
<span :style="{ color: item.action == 'send' ? '#86909C' : '#999', margin: '0 8px' }">
{{ item.msgTime }}
</span>
</div>
<div :class="['', queryChat.fromId === item.fromId && 'ar']">
<img
:class="['image', queryChat.fromId === item.fromId && 'fr']"
:src="item.avatar || require('@/assets/image/profile.jpg')" />
<ChatContent :queryChat="queryChat" :message="item"></ChatContent>
</div>
</li>
</ul>
</div>
</template>
<script>
import ChatContent from '@/components/ChatContent'
export default {
components: {
ChatContent,
},
props: {
data: {
type: Array,
defluat: () => [],
},
queryChat: {
type: Object,
default: () => ({}),
},
},
mounted() {},
data() {
return {}
},
methods: {},
}
</script>
<style lang="scss" scoped>
.image {
width: 40px;
height: 40px;
vertical-align: top;
box-shadow: 0px 6px 8px 0px rgba(78, 89, 105, 0.3);
border-radius: 8px 8px 8px 8px;
border: 1px solid #fff;
background: #fff;
}
.shabowbox {
position: fixed;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
left: 0;
top: 0;
z-index: 2000;
}
.shabowboxvidoe {
position: fixed;
width: 800px;
height: 475px;
left: 50%;
margin-left: -400px;
top: 50%;
margin-top: -235px;
z-index: 2001;
background: #fff;
}
.shabowboxaudio {
height: 125px;
padding: 12px;
}
.close {
position: fixed;
width: 50px;
height: 50px;
right: 10px;
z-index: 2012;
top: 10px;
text-align: center;
line-height: 50px;
font-size: 20px;
color: #fff;
cursor: pointer;
font-size: 43px;
}
.takecontent {
border-radius: 3px;
background-color: #eee;
position: relative;
text-align: left;
height: 100%;
width: 100%;
overflow-y: scroll;
::-webkit-scrollbar {
display: none;
}
ul li {
padding: 10px;
}
}
</style>