|
@@ -1,5 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<div id="index">
|
|
<div id="index">
|
|
|
|
+ <el-input v-model="customer_id" placeholder=""></el-input>
|
|
|
|
+ <el-input v-model="customer_name" placeholder=""></el-input>
|
|
|
|
+ <el-button type="primary" @click="toChannel()">连接</el-button>
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="4" class="left">
|
|
<el-col :span="4" class="left">
|
|
@@ -107,20 +110,22 @@ export default {
|
|
// 用户头像
|
|
// 用户头像
|
|
rightIcon: require('@a/leftIcon.png'),
|
|
rightIcon: require('@a/leftIcon.png'),
|
|
// 用户列表
|
|
// 用户列表
|
|
|
|
+ activeIndex: '',
|
|
userList: [],
|
|
userList: [],
|
|
// 聊天列表
|
|
// 聊天列表
|
|
chatUserInfo: {},
|
|
chatUserInfo: {},
|
|
chatList: [],
|
|
chatList: [],
|
|
content: '',
|
|
content: '',
|
|
- activeIndex: '',
|
|
|
|
|
|
+ customer_id: '5f6ad08fbe2d3b407b41a693',
|
|
|
|
+ customer_name: '客服1',
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.toOnline();
|
|
|
|
|
|
+ // this.toOnline();
|
|
this.getClientList();
|
|
this.getClientList();
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.channel();
|
|
|
|
|
|
+ // this.channel();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...customer(['online', 'record', 'createChat', 'chatRecord']),
|
|
...customer(['online', 'record', 'createChat', 'chatRecord']),
|
|
@@ -161,7 +166,7 @@ export default {
|
|
console.log('in function:');
|
|
console.log('in function:');
|
|
const time = 5000; //1min 600000
|
|
const time = 5000; //1min 600000
|
|
setInterval(() => {
|
|
setInterval(() => {
|
|
- this.online({ _tenant: this._tenant, customer_id: this.user.id, customer_name: this.user.name });
|
|
|
|
|
|
+ this.online({ _tenant: this._tenant, customer_id: this.customer_id, customer_name: this.customer_name });
|
|
}, time);
|
|
}, time);
|
|
},
|
|
},
|
|
getTime(item) {
|
|
getTime(item) {
|
|
@@ -215,6 +220,12 @@ export default {
|
|
container.scrollTop = container.scrollHeight;
|
|
container.scrollTop = container.scrollHeight;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ toChannel() {
|
|
|
|
+ this.toOnline();
|
|
|
|
+ this.$stomp({
|
|
|
|
+ [`/exchange/${this._tenant}/customer.${this.customer_id}`]: this.onMessage,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user', '_tenant']),
|
|
...mapState(['user', '_tenant']),
|