|
@@ -2,7 +2,7 @@
|
|
|
<div id="chat">
|
|
|
<el-row class="chat">
|
|
|
<div class="chatList">
|
|
|
- <ul>
|
|
|
+ <ul id="chatSell">
|
|
|
<li v-for="(i, index) in list" :key="index">
|
|
|
<p>
|
|
|
<span>[{{ i.send_time | getTime }}]</span><span style="font-weight: bold;">{{ i.sender_name }}:</span>
|
|
@@ -15,7 +15,7 @@
|
|
|
<el-input v-model="text" size="mini"></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="5">
|
|
|
- <el-button @click="send" size="mini" round style="background: #ff8500;color: #fff;">发送</el-button>
|
|
|
+ <el-button @click="send" size="mini" round style="background: #2c69fe;color: #fff;">发送</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -72,13 +72,15 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
onMessage(message) {
|
|
|
- console.log('lasjdas');
|
|
|
// console.log('receive a message: ', message.body);
|
|
|
let body = _.get(message, 'body');
|
|
|
if (body) {
|
|
|
body = JSON.parse(body);
|
|
|
this.list.push(body);
|
|
|
this.text = '';
|
|
|
+ this.$nextTick(() => {
|
|
|
+ document.getElementById('chatSell').scrollTop = document.getElementById('chatSell').scrollHeight + 275;
|
|
|
+ });
|
|
|
}
|
|
|
// const { content, contenttype, sendid, sendname, icon, groupid, sendtime, type } = message.headers;
|
|
|
// let object = { content, contenttype, sendid, sendname, icon, groupid, sendtime, type };
|
|
@@ -123,7 +125,7 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 340px;
|
|
|
border-radius: 5px;
|
|
|
- box-shadow: 0 0 5px #c20808;
|
|
|
+ box-shadow: 0 0 5px #2c69fe;
|
|
|
padding: 0 10px 0px 10px;
|
|
|
margin: 4px 0px 0 3px;
|
|
|
}
|