增加聊天记录时间

pull/30/head
taoshihan1991 5 years ago
parent 52cbd7e937
commit b4fc75b01f

@ -61,6 +61,7 @@
.onlineUsers{padding: 5px;height: 40px;line-height: 40px;font-size: 14px;border-bottom: solid 1px #e6e6e6;} .onlineUsers{padding: 5px;height: 40px;line-height: 40px;font-size: 14px;border-bottom: solid 1px #e6e6e6;}
.onlineUsers:hover,.onlineUsers.cur{background-color: #f0f9eb;color: #67C23A;} .onlineUsers:hover,.onlineUsers.cur{background-color: #f0f9eb;color: #67C23A;}
.imgGray {-webkit-filter: grayscale(100%);-ms-filter: grayscale(100%);filter: grayscale(100%);filter: gray;color:#888;} .imgGray {-webkit-filter: grayscale(100%);-ms-filter: grayscale(100%);filter: grayscale(100%);filter: gray;color:#888;}
.chatTime{text-align: center;color: #bbb;margin: 5px 0;font-size: 12px;}
</style> </style>
</head> </head>
<body> <body>
@ -113,6 +114,7 @@
</el-alert> </el-alert>
<div class="chatBox"> <div class="chatBox">
<el-row :gutter="2" v-for="v in msgList" v-bind:class="{'chatBoxMe': v.is_kefu==true}"> <el-row :gutter="2" v-for="v in msgList" v-bind:class="{'chatBoxMe': v.is_kefu==true}">
<div class="chatTime"><{v.time}></div>
<el-col :span="3"><el-avatar :size="60" :src="v.avator"></el-avatar></el-col> <el-col :span="3"><el-avatar :size="60" :src="v.avator"></el-avatar></el-col>
<el-col :span="21"> <el-col :span="21">
<div class="chatUser"><{v.name}></div> <div class="chatUser"><{v.name}></div>
@ -366,6 +368,7 @@
content.name = visitorMes["visitor_name"]; content.name = visitorMes["visitor_name"];
} }
content.content = visitorMes["content"]; content.content = visitorMes["content"];
content.time = visitorMes["time"];
_this.msgList.push(content); _this.msgList.push(content);
_this.scrollBottom(); _this.scrollBottom();
} }

@ -75,6 +75,7 @@
.chatBoxSendBtn{position: absolute;bottom: 1px;right: 2px;} .chatBoxSendBtn{position: absolute;bottom: 1px;right: 2px;}
.chatTime{text-align: center;color: #bbb;margin: 5px 0;font-size: 12px;} .chatTime{text-align: center;color: #bbb;margin: 5px 0;font-size: 12px;}
.chatTimeHide{display: none;} .chatTimeHide{display: none;}
.clear{clear:both;}
</style> </style>
</head> </head>
@ -96,12 +97,13 @@
type="success"> type="success">
</el-alert> </el-alert>
<el-row :gutter="2" v-for="v in msgList" v-bind:class="{'chatBoxMe': v.is_kefu==true}"> <el-row :gutter="2" v-for="v in msgList" v-bind:class="{'chatBoxMe': v.is_kefu==true}">
<div class="chatTime" v-bind:class="{'chatTimeHide': v.show_time==false}"><{v.time}></div>
<el-col :span="3"><el-avatar :size="60" :src="v.avator"></el-avatar></el-col> <el-col :span="3"><el-avatar :size="60" :src="v.avator"></el-avatar></el-col>
<el-col :span="21"> <el-col :span="21">
<div class="chatUser"><{v.name}></div> <div class="chatUser"><{v.name}></div>
<div class="chatContent"><{v.content}></div> <div class="chatContent"><{v.content}></div>
</el-col> </el-col>
<div class="clear"></div>
<div class="chatTime" v-bind:class="{'chatTimeHide': v.show_time==false}"><{v.time}></div>
</el-row> </el-row>
</div> </div>
<div class="chatBoxSend"> <div class="chatBoxSend">

Loading…
Cancel
Save