chat.vue 14.3 KB
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1
<template>
DCloud_JSON's avatar
DCloud_JSON 已提交
2 3
	<view class="page">
		<view class="container">
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
4
			<view v-if="isWidescreen" class="header">uni-ai-chat</view>
DCloud_JSON's avatar
DCloud_JSON 已提交
5 6
			<text class="noData" v-if="msgList.length === 0">没有对话记录</text>
			<scroll-view :scroll-into-view="scrollIntoView" scroll-y="true" class="msg-list" :enable-flex="true">
DCloud_JSON's avatar
DCloud_JSON 已提交
7 8 9 10
				<view v-for="(msg,index) in msgList"  class="msg-item" :key="index">
					<view class="create_time-box">
						<uni-dateformat class="create_time" :date="msg.create_time" format="MM/dd hh:mm:ss"></uni-dateformat>
					</view>
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
11 12 13 14
					<view :class="{reverse:!msg.isAi}">
						<view class="userInfo">
							<image class="avatar" :src="msg.isAi?'../../static/uni-ai.png':'../../static/avatar.png'" mode="widthFix"></image>
						</view>
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
15 16
						<view class="content">
							<!-- <text class="copy" @click="copy">复制</text> -->
DCloud_JSON's avatar
DCloud_JSON 已提交
17
							<uni-ai-msg :md="msg.content" :show-cursor="index == msgList.length-1 && msg.isAi && sseIndex"></uni-ai-msg>
DCloud_JSON's avatar
DCloud_JSON 已提交
18
						</view>
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
19 20 21 22
						<uni-icons v-if="index == msgList.length-1 && !msg.isAi && msg.state != 100 && msgStateIcon(msg)"
							@click="msg.state == -100 ? retriesSendMsg() : ''" :color="msg.state===0?'#999':'#d22'"
							:type="msgStateIcon(msg)" class="msgStateIcon">
						</uni-icons>
DCloud_JSON's avatar
DCloud_JSON 已提交
23
					</view>
DCloud_JSON's avatar
DCloud_JSON 已提交
24 25 26 27 28 29
				</view>
				<view class="tip-ai-ing" v-if="msgList.length && msgList.length%2 !== 0">
					<text>uni-ai正在思考中...</text>
					<view v-if="NODE_ENV == 'development' && !stream">
						如需提速,请开通<uni-link class="uni-link" href="https://uniapp.dcloud.net.cn/uniCloud/uni-ai-chat.html" text="[流式响应]"></uni-link>
					</view>
DCloud_JSON's avatar
DCloud_JSON 已提交
30 31 32 33
				</view>
				<view id="last-msg-item"></view>
			</scroll-view>

DCloud_JSON's avatar
DCloud_JSON 已提交
34 35 36 37 38
			<view class="foot-box">
				<view class="menu" v-if="isWidescreen">
					<view class="trash menu-item">
						<image @click="clear" src="@/static/remove.png" mode="heightFix"></image>
					</view>
DCloud_JSON's avatar
DCloud_JSON 已提交
39
				</view>
DCloud_JSON's avatar
DCloud_JSON 已提交
40

DCloud_JSON's avatar
DCloud_JSON 已提交
41 42 43 44 45 46 47 48 49 50 51 52
				<view class="foot-box-content">
					<view v-if="!isWidescreen" class="trash">
						<uni-icons @click="clear" type="trash" size="24" color="#888"></uni-icons>
					</view>
					<view class="textarea-box">
						<textarea v-model="content" class="textarea" :auto-height="!isWidescreen" :disabled="inputBoxDisabled"
							:placeholder="placeholderText" :maxlength="-1" placeholder-class="input-placeholder"></textarea>
					</view>
					<view class="send-btn-box">
						<text v-if="isWidescreen" class="send-btn-tip">↵ 发送 / shift + ↵ 换行</text>
						<button @click="beforeSendMsg" :disabled="inputBoxDisabled || !content" class="send" type="primary">发送</button>
					</view>
DCloud_JSON's avatar
DCloud_JSON 已提交
53
				</view>
DCloud_JSON's avatar
DCloud_JSON 已提交
54
			</view>
DCloud_JSON's avatar
DCloud_JSON 已提交
55 56 57 58 59 60 61 62 63 64 65 66
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				scrollIntoView: "",
				msgList: [],
				content: "",
				sseIndex: 0,
DCloud_JSON's avatar
DCloud_JSON 已提交
67
				stream:true,
DCloud_JSON's avatar
DCloud_JSON 已提交
68
				isWidescreen:false
DCloud_JSON's avatar
DCloud_JSON 已提交
69 70 71 72 73 74 75
			}
		},
		computed: {
			inputBoxDisabled() {
				if (this.sseIndex !== 0) {
					return true
				}
DCloud_JSON's avatar
DCloud_JSON 已提交
76
				return !!(this.msgList.length && this.msgList.length%2 !== 0)
DCloud_JSON's avatar
DCloud_JSON 已提交
77 78 79 80 81 82 83 84 85 86
			},
			placeholderText() {
				if (this.inputBoxDisabled) {
					return 'uni-ai正在回复中'
				} else {
					// #ifdef H5
					return window.innerWidth > 960 ? '请输入内容,ctrl + enter 发送' : '请输入要发给uni-ai的内容'
					// #endif
					return '请输入要发给uni-ai的内容'
				}
DCloud_JSON's avatar
DCloud_JSON 已提交
87 88 89
			},
			NODE_ENV(){
				return process.env.NODE_ENV
DCloud_JSON's avatar
DCloud_JSON 已提交
90 91
			}
		},
92 93 94 95 96 97
		watch: {
			msgList:{
				handler(msgList) {
					uni.setStorageSync('uni-ai-msg', msgList)
				},
				deep:true
DCloud_JSON's avatar
DCloud_JSON 已提交
98 99
			}
		},
DCloud_JSON's avatar
DCloud_JSON 已提交
100
		async mounted() {
DCloud_JSON's avatar
DCloud_JSON 已提交
101 102 103 104 105 106 107 108 109 110
			// for (let i = 0; i < 15; i++) {
			// 	this.msgList.push({
			// 		isAi: i % 2 == true,
			// 		content: "1-" + i
			// 	})
			// }

			this.msgList = uni.getStorageSync('uni-ai-msg') || []

			// this.msgList.pop()
111
			// console.log('this.msgList', this.msgList);
DCloud_JSON's avatar
DCloud_JSON 已提交
112 113 114 115 116 117 118 119 120 121 122 123 124 125
			this.showLastMsg()
			
			// #ifdef H5
			//获得消息输入框对象
			let adjunctKeydown = false
			const textareaDom = document.querySelector('.textarea-box textarea');
			if (textareaDom) {
				//键盘按下时
				textareaDom.onkeydown = e => {
					// console.log('onkeydown', e.keyCode)
					if ([16, 17, 18, 93].includes(e.keyCode)) {
						//按下了shift ctrl alt windows键
						adjunctKeydown = true;
					}
DCloud_JSON's avatar
DCloud_JSON 已提交
126
					if (e.keyCode == 13 && !adjunctKeydown) {
DCloud_JSON's avatar
DCloud_JSON 已提交
127 128 129 130 131 132 133 134 135 136
						this.beforeSendMsg();
					}
				};
				textareaDom.onkeyup = e => {
					//松开adjunct键
					if ([16, 17, 18, 93].includes(e.keyCode)) {
						adjunctKeydown = false;
					}
				};
			}
DCloud_JSON's avatar
DCloud_JSON 已提交
137 138
			// #endif
			
DCloud_JSON's avatar
DCloud_JSON 已提交
139
			// 添加惰性函数,检查是否开通uni-push;决定是否启用stream
DCloud_JSON's avatar
DCloud_JSON 已提交
140
			
141
			// #ifdef H5
DCloud_JSON's avatar
DCloud_JSON 已提交
142 143 144 145 146
			uni.createMediaQueryObserver(this).observe({
				minWidth: 650,
			}, matches => {
				this.isWidescreen = matches;
			})
147
			// #endif
DCloud_JSON's avatar
DCloud_JSON 已提交
148 149
		},
		methods: {
DCloud_JSON's avatar
DCloud_JSON 已提交
150 151 152 153 154 155 156 157 158
			//检查是否开通uni-push;决定是否启用stream
			async checkIsOpenPush(){
				try{
					await uni.getPushClientId()
					this.checkIsOpenPush = ()=>{}
				}catch(err){
					this.stream = false
				}
			},
159 160 161
			// updateLastMsg(){
				
			// },
DCloud_JSON's avatar
DCloud_JSON 已提交
162 163 164
			async retriesSendMsg() {
				// 检查是否开通uni-push;决定是否启用stream
				await this.checkIsOpenPush()
DCloud_JSON's avatar
DCloud_JSON 已提交
165 166
				this.send()
			},
DCloud_JSON's avatar
DCloud_JSON 已提交
167 168 169 170
			async beforeSendMsg() {
				// 检查是否开通uni-push;决定是否启用stream
				await this.checkIsOpenPush()
				
DCloud_JSON's avatar
DCloud_JSON 已提交
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
				if(!this.content){
					return uni.showToast({
						title: '内容不能为空',
						icon: 'none'
					});
				}
				
				this.msgList.push({
					isAi: false,
					content: this.content,
					state: 0,
					create_time: Date.now()
				})
				this.showLastMsg()
				// 清空文本内容
				this.$nextTick(() => {
					this.content = ''
				})
				this.send()
			},
			async send() {
				let messages = []
				// 复制一份,消息列表数据
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
194
				let msgs = JSON.parse(JSON.stringify(this.msgList))
DCloud_JSON's avatar
DCloud_JSON 已提交
195 196
				// 带总结的消息 index
				let findIndex = [...msgs].reverse().findIndex(item => item.summarize)
197
				// console.log('findIndex', findIndex)
DCloud_JSON's avatar
DCloud_JSON 已提交
198 199
				if (findIndex != -1) {
					let aiSummaryIndex = msgs.length - findIndex - 1
200
					// console.log('aiSummaryIndex', aiSummaryIndex)
DCloud_JSON's avatar
DCloud_JSON 已提交
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
					msgs[aiSummaryIndex].content = msgs[aiSummaryIndex].summarize
					// 拿最后一条带直接的消息作为与ai对话的msg body
					msgs = msgs.splice(aiSummaryIndex, msgs.length - 1)
				} else {
					// 如果未总结过就直接从末尾拿10条
					msgs = msgs.splice(-10)
				}

				messages = msgs.map(item => {
					let role = "user"
					if (item.isAi) {
						role = item.summarize ? 'system' : 'assistant'
					}
					return {
						content: item.content,
						role
					}
				})

				console.log('send to ai messages:', messages);
				
				
				let SSEChannel = false;
				if(this.stream){
					SSEChannel = new uniCloud.SSEChannel() // 创建消息通道
226
					// console.log('SSEChannel',SSEChannel);
DCloud_JSON's avatar
DCloud_JSON 已提交
227
					SSEChannel.on('message', (message) => { // 监听message事件
228
						// console.log('on message', message);
DCloud_JSON's avatar
DCloud_JSON 已提交
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
						if (this.sseIndex === 0) {
							this.msgList.push({
								isAi: true,
								content: message,
								create_time: Date.now()
							})
							this.showLastMsg()
						} else {
							let length = this.msgList.length,
								lastMsg = this.msgList[length - 1]
							lastMsg.content +=  "\n" + message
							this.msgList.splice(length - 1, 1, lastMsg)
							this.showLastMsg()
						}
						this.sseIndex++
					})
					SSEChannel.on('end', (e) => { // 监听end事件,如果云端执行end时传了message,会在客户端end事件内收到传递的消息
246
						// console.log('on end', e);
DCloud_JSON's avatar
DCloud_JSON 已提交
247
						if(e && e.summarize){
DCloud_JSON's avatar
DCloud_JSON 已提交
248 249 250 251 252 253 254 255 256 257 258
							let length = this.msgList.length,
								lastMsg = this.msgList[length - 1]
							lastMsg.summarize = e.summarize
							this.msgList.splice(length - 1, 1, lastMsg)
						}
						this.sseIndex = 0
						this.showLastMsg()
					})
					await SSEChannel.open() // 等待通道开启
				}
				
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
259 260 261 262

				const uniAiChat = uniCloud.importObject("uni-ai-chat",{
					customUI:true
				})
DCloud_JSON's avatar
DCloud_JSON 已提交
263
				uniAiChat.send({
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
264 265
					messages,
					SSEChannel
DCloud_JSON's avatar
DCloud_JSON 已提交
266 267 268 269 270 271
				})
				.then(res => {
					let index = this.msgList.length - 1
					let lastItem = this.msgList[index]
					lastItem.state = 100
					this.msgList.splice(index, 1, lastItem)
DCloud_JSON's avatar
DCloud_JSON 已提交
272

DCloud_JSON's avatar
DCloud_JSON 已提交
273
					if (!SSEChannel) {
274
						// console.log(res, res.reply);
DCloud_JSON's avatar
DCloud_JSON 已提交
275 276
						this.msgList.push({
							isAi: true,
DCloud_JSON's avatar
DCloud_JSON 已提交
277 278
							content: res.data.reply,
							summarize: res.data.summarize,
DCloud_JSON's avatar
DCloud_JSON 已提交
279 280 281 282 283 284 285 286 287 288 289
							create_time: Date.now()
						})
						this.showLastMsg()
					}
				})
				.catch(e => {
					console.log(e);
					let index = this.msgList.length - 1
					let lastItem = this.msgList[index]
					lastItem.state = -100
					this.msgList.splice(index, 1, lastItem)
DCloud_JSON's avatar
DCloud_JSON 已提交
290

DCloud_JSON's avatar
DCloud_JSON 已提交
291 292 293 294 295
					uni.showModal({
						content: JSON.stringify(e.message),
						showCancel: false
					});
				})
DCloud_JSON's avatar
DCloud_JSON 已提交
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
			},
			showLastMsg() {
				this.$nextTick(() => {
					this.scrollIntoView = "last-msg-item"
					this.$nextTick(() => {
						this.scrollIntoView = ""
					})
				})
			},
			msgStateIcon(msg) {
				switch (msg.state) {
					case 0:
						//	发送中
						return 'spinner-cycle'
						break;
					case -100:
						//	发送失败
						return 'refresh-filled'
						break;
					case -200:
						//	禁止发送(内容不合法)
						return 'info-filled'
						break;
					default:
						return false
						break;
				}
			},
			clear() {
				uni.showModal({
					title: "确认要清空聊天记录?",
					content: '本操作不可撤销',
					complete: (e) => {
						if (e.confirm) {
							this.msgList = []
						}
					}
				});
DCloud_JSON's avatar
DCloud_JSON 已提交
334
			}
DCloud_JSON's avatar
DCloud_JSON 已提交
335 336 337 338 339 340 341 342
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	view,
	textarea,
DCloud_JSON's avatar
DCloud_JSON 已提交
343
	button,
DCloud_JSON's avatar
DCloud_JSON 已提交
344
	.page
DCloud_JSON's avatar
DCloud_JSON 已提交
345
	{
DCloud_JSON's avatar
DCloud_JSON 已提交
346
		display: flex;
DCloud_JSON's avatar
DCloud_JSON 已提交
347
		box-sizing: border-box;
DCloud_JSON's avatar
DCloud_JSON 已提交
348
	}
DCloud_JSON's avatar
DCloud_JSON 已提交
349 350
	/* #endif */
	
DCloud_JSON's avatar
DCloud_JSON 已提交
351 352 353 354 355 356

	/* #ifndef APP-NVUE */
	page,
	/* #endif */
	.page,
	.container {
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
357 358
		background-color: #efefef;
		
359
		/* #ifdef APP-NVUE */
DCloud_JSON's avatar
DCloud_JSON 已提交
360
		flex: 1;
361 362
		/* #endif */
		
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
363 364 365 366
		/* #ifndef APP-NVUE */
		height: 100vh;
		/* #endif */
		
DCloud_JSON's avatar
DCloud_JSON 已提交
367 368 369
		/* #ifdef H5 */
		height: calc(100vh - 44px);
		/* #endif */
370
		
DCloud_JSON's avatar
DCloud_JSON 已提交
371
		flex-direction: column;
DCloud_JSON's avatar
DCloud_JSON 已提交
372 373 374
		align-items: center;
		justify-content: center;
	}
DCloud_JSON's avatar
DCloud_JSON 已提交
375 376 377

	/* #ifndef APP-NVUE */
	.container {
DCloud_JSON's avatar
DCloud_JSON 已提交
378
		background-color: #FAFAFA;
DCloud_JSON's avatar
DCloud_JSON 已提交
379 380 381 382 383 384
	}
	/* #endif */

	.foot-box {
		width: 750rpx;
		display: flex;
DCloud_JSON's avatar
DCloud_JSON 已提交
385
		flex-direction: column;
DCloud_JSON's avatar
DCloud_JSON 已提交
386 387
		padding: 10px 0px;
		background-color: #FFF;
DCloud_JSON's avatar
DCloud_JSON 已提交
388 389 390
	}
	.foot-box-content{
		justify-content: space-around;
DCloud_JSON's avatar
DCloud_JSON 已提交
391 392
	}

DCloud_JSON's avatar
DCloud_JSON 已提交
393
	.textarea-box {
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
394
		padding: 8px 10px;
DCloud_JSON's avatar
DCloud_JSON 已提交
395 396 397 398 399 400 401 402 403
		background-color: #f9f9f9;
		border-radius: 5px;
	}

	.textarea-box .textarea {
		max-height: 100px;
		font-size: 14px;
		/* #ifndef APP-NVUE */
		overflow: auto;
DCloud_JSON's avatar
DCloud_JSON 已提交
404 405
		/* #endif */
		width: 450rpx;
DCloud_JSON's avatar
DCloud_JSON 已提交
406 407
	}

408
	/* #ifdef H5 */
DCloud_JSON's avatar
DCloud_JSON 已提交
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424
	/*隐藏滚动条*/
	.textarea-box .textarea::-webkit-scrollbar {
		width: 0;
	}
	/* #endif */

	.input-placeholder {
		color: #bbb;
	}

	.trash,
	.send {
		width: 50px;
		height: 30px;
		justify-content: center;
		align-items: center;
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
425
		flex-shrink: 0;
DCloud_JSON's avatar
DCloud_JSON 已提交
426 427 428
	}

	.trash {
DCloud_JSON's avatar
DCloud_JSON 已提交
429 430
		width: 30rpx;
		margin-left: 10rpx;
DCloud_JSON's avatar
DCloud_JSON 已提交
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
	}

	.send {
		color: #FFF;
		border-radius: 4px;
		display: flex;
		margin: 0;
		padding: 0;
		font-size: 14px;
		margin-right: 20rpx;
	}

	/* #ifndef APP-NVUE */
	.send::after {
		display: none;
	}
	/* #endif */


	.msg-list {
		flex: 1;
		height: 1px;
		width: 750rpx;
	}

	.userInfo {
		flex-direction: column;
	}

	.msg-item {
		position: relative;
		width: 750rpx;
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
463
		flex-direction: column;
DCloud_JSON's avatar
DCloud_JSON 已提交
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
		padding: 0 15px;
		padding-bottom: 15px;
	}

	.msgStateIcon {
		position: relative;
		top: 5px;
		right: 5px;
		align-self: center;
	}

	.avatar {
		width: 40px;
		border-radius: 2px;
	}

	.create_time {
		font-size: 12px;
DCloud_JSON's avatar
DCloud_JSON 已提交
482
		padding: 5px 0;
DCloud_JSON's avatar
DCloud_JSON 已提交
483 484
		padding-top: 0;
		color: #aaa;
DCloud_JSON's avatar
DCloud_JSON 已提交
485
		text-align: center;
DCloud_JSON's avatar
DCloud_JSON 已提交
486 487 488 489
		width:750rpx;
		/* #ifdef MP */
		display: flex;
		/* #endif */
DCloud_JSON's avatar
DCloud_JSON 已提交
490 491 492
	}

	.content {
DCloud_JSON's avatar
DCloud_JSON 已提交
493 494 495
		/* #ifndef APP-NVUE */
		max-width: 550rpx;
		/* #endif */
DCloud_JSON's avatar
DCloud_JSON 已提交
496 497 498 499 500 501 502 503
		background-color: #FFF;
		border-radius: 5px;
		padding: 12px 10px;
		margin-left: 10px;
		/* #ifndef APP-NVUE */
		word-break: break-all;
		user-select: text;
		cursor: text;
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522
		/* #endif */
	}
	
	/* #ifndef APP-NVUE */
	.content {
		display: inline;
	}
	
	.content ::v-deep rich-text{
		max-width: 550rpx;
		overflow: auto;
	}
	/* #endif */
	
	/* #ifdef H5 */
	.content * {
		display: inline;
	}
	/* #endif */
DCloud_JSON's avatar
DCloud_JSON 已提交
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545

	.reverse {
		flex-direction: row-reverse;
	}

	.reverse .content {
		margin-left: 0;
		margin-right: 10px;
	}

	.reverse-align {
		align-items: flex-end;
	}

	.noData {
		margin-top: 15px;
		text-align: center;
		width: 750rpx;
		color: #aaa;
		font-size: 12px;
		justify-content: center;
	}
	
DCloud_JSON's avatar
DCloud_JSON 已提交
546
	.tip-ai-ing {
DCloud_JSON's avatar
DCloud_JSON 已提交
547
		align-items: center;
DCloud_JSON's avatar
DCloud_JSON 已提交
548 549 550 551
		flex-direction: column;
		font-size: 14px;
		color: #919396;
		padding: 15px 0;
DCloud_JSON's avatar
DCloud_JSON 已提交
552
	}
DCloud_JSON's avatar
DCloud_JSON 已提交
553 554 555 556
	
	.uni-link {
		margin-left: 5px;
		line-height: 20px;
DCloud_JSON's avatar
DCloud_JSON 已提交
557 558
	}
	
DCloud_JSON's avatar
DCloud_JSON 已提交
559
	/* #ifdef H5 */
DCloud_JSON's avatar
DCloud_JSON 已提交
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
	@media screen and (min-width:650px){
		.foot-box{
			border-top: solid 1px #dde0e2;
		}
		.page{
			width: 100vw;
			flex-direction: row;
		}
		.page * {
			max-width: 950px;
		}
		
		.container, {
			box-shadow: 0 0 5px #e0e1e7;
			margin-top: 44px;
			border-radius: 10px;
			overflow: hidden;
		}
		
		.container .header{
			height: 44px;
			line-height: 44px;
			border-bottom: 1px solid #F0F0F0;
			width: 100vw;
			justify-content: center;
			font-weight: 500;
		}
		
		.content {
			background-color: #f9f9f9;
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
590
			position: relative;
DCloud_JSON's avatar
DCloud_JSON 已提交
591
		}
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
592 593 594 595 596 597 598 599 600 601 602
		// .copy {
		// 	color: #888888;
		// 	position: absolute;
		// 	right: 8px;
		// 	top: 8px;
		// 	font-size: 12px;
		// 	cursor:pointer;
		// }
		// .copy :hover{
		// 	color: #4b9e5f;
		// }
DCloud_JSON's avatar
DCloud_JSON 已提交
603 604 605 606 607 608 609 610 611 612 613
		
		.foot-box,
		.foot-box-content,
		.msg-list,
		.msg-item,
		// .create_time,
		.noData,
		.textarea-box,
		.textarea,
		textarea-box {
			width: 100% !important;
DCloud_JSON's avatar
DCloud_JSON 已提交
614
		}
DCloud_JSON's avatar
DCloud_JSON 已提交
615 616 617
		
		.create_time-box {
			margin-top: 15px;
DCloud_JSON's avatar
DCloud_JSON 已提交
618 619
			justify-content: center;
		}
DCloud_JSON's avatar
DCloud_JSON 已提交
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662
		
		.textarea-box,
		.textarea,
		textarea,
		textarea-box {
			height: 120px;
		}
		
		.container,
		.foot-box,
		.textarea-box {
			background-color: #FFF;
		}
		
		.foot-box-content{
			flex-direction: column;
			justify-content: center;
			align-items: flex-end;
			padding-bottom: 0;
		}
		
		.menu {
			padding:0 10px;
		}
		.menu-item{
			height:20px;
			justify-content: center;
			align-items: center;
			align-content: center;
			display: flex;
			margin-right: 10px;
			cursor: pointer;
		}
		.trash {
			opacity: 0.8;
		}
		.trash image{
			height: 15px;
		}
		
		
		.textarea-box,.textarea-box *{
			// border: 1px solid #000;
DCloud_JSON's avatar
DCloud_JSON 已提交
663
		}
DCloud_JSON's avatar
DCloud_JSON 已提交
664 665 666 667 668 669
		
		.send-btn-box .send-btn-tip{
			color: #919396;
			margin-right: 8px;
			font-size: 12px;
			line-height: 28px;
DCloud_JSON's avatar
DCloud_JSON 已提交
670 671 672
		}
	}
	/* #endif */
DCloud_JSON's avatar
1.0.0  
DCloud_JSON 已提交
673
	
DCloud_JSON's avatar
DCloud_JSON 已提交
674
</style>