|
|
@@ -0,0 +1,167 @@
|
|
|
+<template>
|
|
|
+ <div class="chat-body-components" v-if="!isChat">
|
|
|
+ <div class="empty-data">
|
|
|
+ <img src="https://lf-govern-cdn-tos.bytedcdn.com/obj/life-governance-cdn/life-im-pc/static/image/empty.efbaf24f.png" />
|
|
|
+ 请从左侧列表选择一个用户开始聊天
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="chat-body-components" v-else>
|
|
|
+ <div class="custom-info">
|
|
|
+ <div class="name">与xxx对话中</div>
|
|
|
+ </div>
|
|
|
+ <div class="chat-content">
|
|
|
+ <div class="chat-content-body">
|
|
|
+ <div class="chat-loading-sk" v-for="(item,indx) in 20" v-if="userLoading">
|
|
|
+ <el-skeleton :animated="true">
|
|
|
+ <template #template>
|
|
|
+ <div class="chat-sk-flex">
|
|
|
+ <el-skeleton-item variant="image" style="width: 40px; height: 40px" />
|
|
|
+ <div class="sk-right">
|
|
|
+ <el-skeleton-item variant="h3" style="width: 50%" />
|
|
|
+ <div style="margin-top: 5px;">
|
|
|
+ <el-skeleton-item variant="text" style="width: 30%;" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="time">
|
|
|
+ <el-skeleton-item variant="text" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-skeleton>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="chat-send">
|
|
|
+ <div class="quick-group">
|
|
|
+ <div class="emoji-item">
|
|
|
+ <el-popover placement="top" :width="400" trigger="click">
|
|
|
+ <template #reference>
|
|
|
+ <div class="item-btn">
|
|
|
+ <el-image style="width:25px;height:25px;" src="https://jymini.oss-cn-guangzhou.aliyuncs.com/pc/face.svg"></el-image>
|
|
|
+ <div class="name">表情</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ <div class="emoji-item">
|
|
|
+ <el-popover placement="top" :width="174">
|
|
|
+ <template #reference>
|
|
|
+ <div class="item-btn">
|
|
|
+ <el-image style="width:25px;height:25px;" src="https://jymini.oss-cn-guangzhou.aliyuncs.com/pc/more.svg"></el-image>
|
|
|
+ <div class="name">图片</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <sc-upload v-model="uploadImg" :on-success="uploadSuccess"></sc-upload>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ <div class="emoji-item" @click="showQuick">
|
|
|
+ <el-popover placement="top" :width="400" trigger="click" @show="getQuick">
|
|
|
+ <template #reference>
|
|
|
+ <div class="item-btn">
|
|
|
+ <el-image style="width:25px;height:25px;" src="https://jymini.oss-cn-guangzhou.aliyuncs.com/pc/quick.svg"></el-image>
|
|
|
+ <div class="name">快捷回复</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="send-body">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="5"
|
|
|
+ maxlength="200"
|
|
|
+ v-model="inputMessage"
|
|
|
+ placeholder="请输入消息..."
|
|
|
+ @keyup.enter.native="handleKeyCode"
|
|
|
+ @keydown.native="handleKeyCode"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
+ <div class="send-btn-group">
|
|
|
+ <el-button type="primary" @click="sendMessage">发送</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ userLoading:true,
|
|
|
+ inputMessage:"",
|
|
|
+ isChat:false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ userInfo: { type: Object, default: () => {} }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.empty-data{
|
|
|
+ display: flex;width: 100%;text-align: center;justify-content: center;font-size: 14px;background-color: #f8f8f8;align-items: center;height: 100%;
|
|
|
+ color: #95989d;
|
|
|
+ flex-direction: column;
|
|
|
+ img {
|
|
|
+ width: 170px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.chat-body-components{
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ position: fixed;
|
|
|
+ z-index: 1;
|
|
|
+ top: 0;
|
|
|
+ left: 300px;
|
|
|
+ bottom: 0;
|
|
|
+ right: 400px;
|
|
|
+ .chat-content{
|
|
|
+ flex: 1;
|
|
|
+ overflow: auto;
|
|
|
+ .chat-content-body {
|
|
|
+ width: 98%;
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .custom-info{
|
|
|
+ background-color: #fff;
|
|
|
+ height: 60px;
|
|
|
+ line-height: 60px;
|
|
|
+ padding: 0 10px;
|
|
|
+ border-bottom: 1px solid var(--el-border-color-light);
|
|
|
+ .name {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .chat-send{
|
|
|
+ width: 98%;
|
|
|
+ margin: 0 auto;
|
|
|
+ border: 1px solid var(--el-border-color-light);
|
|
|
+ border-radius: 10px;
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 10px 20px;
|
|
|
+ .quick-group{
|
|
|
+ display: flex;align-items: center;gap: 10px;
|
|
|
+ .item-btn{
|
|
|
+ padding: 5px;border-radius: 3px;display: flex;align-items: center;gap: 5px;cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .send-body{
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .send-btn-group{
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|