items.blade.php
7.1 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>聊天</title>
<style>
* {
margin: 0;padding: 0;
box-sizing: border-box;
font-family: 'Open Sans' ,sans-serif;
}
body {
/*display: flex;*/
/*justify-content: flex-start;*/
/*align-items: center;*/
/*min-height: 100vh;*/
/*background: linear-gradient(#009688 0%,#009688 130px,#d9dbd5 130px,#d9dbd5 100%)*/
background-color: #f5f5f5;
height: 100%;
}
.container {
position: relative;
/*width: 1396px;*/
max-width: 100%;
/*height: 100%;*/
/*height: calc( 100vh - 40px);*/
background:#fff;
/*box-shadow: 0 1px 1px 0 rgba(0,0,0,0.06),0 2px 5px 0 rgba(0,0,0,0.06);*/
display: flex;
}
.container .rightside {
position: relative;
flex: 70%;
background:#f5f5f5;
}
.container .rightside::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
/*background:url(img6-bg.jpg) ;*/
opacity: 0.06;
}
.nav_icons li {
display: flex;
list-style: none;
cursor: pointer;
color: #51585c;
font-size: 1.5em;
margin-left: 22px;
}
.chatlist {
position: relative;
height: calc(100%-110px);
overflow-y: auto;
padding: 20px 50px;
}
.chatlist .block {
position: relative;
width: 100%;
display: flex;
align-items: center;
padding: 15px;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.chatlist .block.active{
background: #ebebeb;
}
.chatlist .block:hover
{
background:#f5f5f5;
}
.chatlist .block .imgbx {
position: relative;
min-width: 45px;
height: 45px;
overflow: hidden;
border-radius: 50%;
margin-right: 10px;
}
.chatlist .block .details {
position: relative;
width: 100%;
}
.chatlist .block .details .listHead {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
}
.chatlist .block .details .listHead h4 {
font-size: 1.1em;
font-weight: 600;
color: #111;
}
.chatlist .block .details .listHead .time {
font-size: 0.75em;
color: #aaa;
}
.chatlist .block .details .listHead .time
{
color: #111;
}
.message {
position: relative;
display: flex;
width: 100%;
margin: 10px 0;
}
.message p {
position: relative;
right: 0;
text-align: right;
max-width: 65%;
padding: 12px;
background: #89d961;
border-radius: 10px;
font-size: 0.9em;
}
.message p::before {
content: '';
position: absolute;
top: 0;
right: -12px;
width: 20px;
height: 20px;
background: linear-gradient(135deg,#89d961 0%,#89d961 50%,transparent 50%,transparent);
}
.message p span {
display: block;
margin-top: 5px;
font-size: 0.85em;
opacity: 0.5;
}
.message img {
height: 50px;
width: 50px;
border-radius: 5px;
}
.my_message {
justify-content: flex-end;
text-align: left;
}
.my_message img{
margin-left: 10px;
}
.my_message p {
text-align: left;
}
.frnd_message {
justify-content: flex-start;
}
.frnd_message img{
margin-right: 10px;
}
.frnd_message p {
background: #fff;
text-align: left;
}
.message.frnd_message p::before {
content: '';
position: absolute;
top: 0;
left: -12px;
width: 20px;
height: 20px;
background: linear-gradient(225deg,#fff 0%,#fff 50%,transparent 50%,transparent);
}
</style>
</head>
<body>
<div class="container">
<div class="rightside">
<div class="chatlist">
@if(!$list && $list->isEmpty())
<div class="message my_message">
<svg t="1562312016538" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2076" width="128" height="128" style="fill: #e9e9e9;">
<path d="M512.8 198.5c12.2 0 22-9.8 22-22v-90c0-12.2-9.8-22-22-22s-22 9.8-22 22v90c0 12.2 9.9 22 22 22zM307 247.8c8.6 8.6 22.5 8.6 31.1 0 8.6-8.6 8.6-22.5 0-31.1L274.5 153c-8.6-8.6-22.5-8.6-31.1 0-8.6 8.6-8.6 22.5 0 31.1l63.6 63.7zM683.9 247.8c8.6 8.6 22.5 8.6 31.1 0l63.6-63.6c8.6-8.6 8.6-22.5 0-31.1-8.6-8.6-22.5-8.6-31.1 0l-63.6 63.6c-8.6 8.6-8.6 22.5 0 31.1zM927 679.9l-53.9-234.2c-2.8-9.9-4.9-20-6.9-30.1-3.7-18.2-19.9-31.9-39.2-31.9H197c-19.9 0-36.4 14.5-39.5 33.5-1 6.3-2.2 12.5-3.9 18.7L97 679.9v239.6c0 22.1 17.9 40 40 40h750c22.1 0 40-17.9 40-40V679.9z m-315-40c0 55.2-44.8 100-100 100s-100-44.8-100-100H149.6l42.5-193.3c2.4-8.5 3.8-16.7 4.8-22.9h630c2.2 11 4.5 21.8 7.6 32.7l39.8 183.5H612z" p-id="2077"></path>
</svg>
</div>
@else
<!-- 聊天记录 begin -->
@foreach($list as $key => $item)
<div class="message @if($item->user_type == 2) frnd_message @else my_message @endif">
<!-- AI begin -->
@if($item->user_type == 2)
<img src="/img/ai.png">
@endif
<!-- AI end -->
<!-- 聊天内容 begin -->
<p>
<!-- 如果是第一个提问需要带上起始语句 -->
{{-- @if($key === 0 && $model->start_statement){{ $model->start_statement }}@endif--}}
{!! nl2br($item->body) !!} <br><span>{{$item->created_at}}</span>
</p>
<!-- 聊天内容 end -->
<!-- 用户 begin -->
@if($item->user_type == 1)
<img src="{{optional($item->user)->avatar}}" onerror="javascript:this.src='/img/user.png';">
@endif
<!-- 用户 end -->
</div>
@endforeach
<!-- 聊天记录 end -->
@endif
</div>
</div>
</div>
</body>
</html>