|
@@ -46,7 +46,6 @@
|
|
|
|
|
|
|
|
<!-------------------机器人聊天板块 ----------------------->
|
|
<!-------------------机器人聊天板块 ----------------------->
|
|
|
<div v-if="machineAndAtl == 10">
|
|
<div v-if="machineAndAtl == 10">
|
|
|
-
|
|
|
|
|
<!--··············· 欢迎语 ············-->
|
|
<!--··············· 欢迎语 ············-->
|
|
|
<div class="conversationBox">
|
|
<div class="conversationBox">
|
|
|
<div class="row" v-for="(item,index) in machine" :key="index">
|
|
<div class="row" v-for="(item,index) in machine" :key="index">
|
|
@@ -386,7 +385,7 @@
|
|
|
<div class="infor">
|
|
<div class="infor">
|
|
|
<div>
|
|
<div>
|
|
|
<span>姓名:</span>
|
|
<span>姓名:</span>
|
|
|
- <span v-if="service">{{ service.serverInfo.name ? service.serverInfo.name : '001客服' }}</span>
|
|
|
|
|
|
|
+ <span v-if="service.serverInfo">{{ service.serverInfo.name ? service.serverInfo.name : '001客服' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
<div>
|
|
@@ -426,7 +425,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 评价框 -->
|
|
<!-- 评价框 -->
|
|
|
<el-card class="box-card" v-if="evlShow">
|
|
<el-card class="box-card" v-if="evlShow">
|
|
|
- <div class="close"><i @click="closeEvl()"></i></div>
|
|
|
|
|
|
|
+ <div class="close"><i @click="closeEvl()"></i></div>
|
|
|
<div class="tit">
|
|
<div class="tit">
|
|
|
<span>感谢您的咨询,请对我们的服务做出评价</span>
|
|
<span>感谢您的咨询,请对我们的服务做出评价</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -456,7 +455,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import '../css/index.css';
|
|
import '../css/index.css';
|
|
|
import frce from '../assets/frce.js';
|
|
import frce from '../assets/frce.js';
|
|
|
-
|
|
|
|
|
|
|
+ import fk from '../assets/st-img/kf.png'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -516,6 +515,7 @@
|
|
|
timerVote: '', //存储上一次时间
|
|
timerVote: '', //存储上一次时间
|
|
|
curtTimer: '',//当前时间
|
|
curtTimer: '',//当前时间
|
|
|
returnTimer: '',//返回当前时间
|
|
returnTimer: '',//返回当前时间
|
|
|
|
|
+
|
|
|
// isConnection:true,//人工分组列表开关
|
|
// isConnection:true,//人工分组列表开关
|
|
|
chatNum: '', // 会话数量
|
|
chatNum: '', // 会话数量
|
|
|
comtSuccess: false, // 评论发送成功显示
|
|
comtSuccess: false, // 评论发送成功显示
|
|
@@ -526,7 +526,7 @@
|
|
|
sensitiveNumber: 0,//敏感词次数
|
|
sensitiveNumber: 0,//敏感词次数
|
|
|
doubSensitive: [],//重复的敏感词
|
|
doubSensitive: [],//重复的敏感词
|
|
|
senInfo: '', //敏感词数据
|
|
senInfo: '', //敏感词数据
|
|
|
- // sensitiveWordsNumber:0,
|
|
|
|
|
|
|
+
|
|
|
hourse: '', //返回时间,小时
|
|
hourse: '', //返回时间,小时
|
|
|
closeByServer: false, //客服关闭会话
|
|
closeByServer: false, //客服关闭会话
|
|
|
serverNotOnlin: false, //客服掉线
|
|
serverNotOnlin: false, //客服掉线
|
|
@@ -550,6 +550,7 @@
|
|
|
waitingText: "", // 等待内容
|
|
waitingText: "", // 等待内容
|
|
|
|
|
|
|
|
service_on:true, // 现在状态
|
|
service_on:true, // 现在状态
|
|
|
|
|
+ avatarImg: fk
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -956,16 +957,34 @@
|
|
|
}
|
|
}
|
|
|
// 链接客服信息
|
|
// 链接客服信息
|
|
|
if (redata.message_type == 'connect') {
|
|
if (redata.message_type == 'connect') {
|
|
|
|
|
+ let serverInfo = {};
|
|
|
|
|
+ if (redata.data) {
|
|
|
|
|
+ serverInfo = redata.data
|
|
|
|
|
+ } else {
|
|
|
|
|
+ serverInfo = {
|
|
|
|
|
+ avatar: this.avatarImg,
|
|
|
|
|
+ client_id:"",
|
|
|
|
|
+ group:"",
|
|
|
|
|
+ id: "",
|
|
|
|
|
+ intime:"",
|
|
|
|
|
+ job_name: "",
|
|
|
|
|
+ name: "tank",
|
|
|
|
|
+ signature: "",
|
|
|
|
|
+ status: 0,
|
|
|
|
|
+ task: 0,
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
this.artAndLeave = 10;
|
|
this.artAndLeave = 10;
|
|
|
this.machineAndAtl = 100;
|
|
this.machineAndAtl = 100;
|
|
|
- this.service = redata.data;
|
|
|
|
|
- // console.log(this.service, '============客服信息')
|
|
|
|
|
|
|
+ this.service = serverInfo;
|
|
|
|
|
+ console.log(this.service, '============客服信息')
|
|
|
this.serviceImg = redata.data.serverInfo.avatar;
|
|
this.serviceImg = redata.data.serverInfo.avatar;
|
|
|
this.consult = false;
|
|
this.consult = false;
|
|
|
this.evlShow = false;
|
|
this.evlShow = false;
|
|
|
this.comtSuccess = false;
|
|
this.comtSuccess = false;
|
|
|
this.showleaveIcon = false;
|
|
this.showleaveIcon = false;
|
|
|
this.waitingMsg = false;
|
|
this.waitingMsg = false;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
// 暂无客服
|
|
// 暂无客服
|
|
|
if (redata.message_type == 'wait') {
|
|
if (redata.message_type == 'wait') {
|
|
@@ -1104,7 +1123,7 @@
|
|
|
|
|
|
|
|
/************关闭会话*******************/
|
|
/************关闭会话*******************/
|
|
|
websocketclose(e) {
|
|
websocketclose(e) {
|
|
|
- console.log('websocket 断开: ' + e.code + ' ' + e.reason + ' ', e)
|
|
|
|
|
|
|
+ console.log('websocket 关闭会话: ' + e.code, e)
|
|
|
this.goBack();
|
|
this.goBack();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -1124,7 +1143,7 @@
|
|
|
this.reconnectData && clearTimeout(this.reconnectData);
|
|
this.reconnectData && clearTimeout(this.reconnectData);
|
|
|
this.reconnectData = setTimeout(() => {
|
|
this.reconnectData = setTimeout(() => {
|
|
|
this.initWebSocket();
|
|
this.initWebSocket();
|
|
|
- console.log('-----lail-----');
|
|
|
|
|
|
|
+ console.log('-----socket重连-----');
|
|
|
this.lockReconnect = false;
|
|
this.lockReconnect = false;
|
|
|
}, 5000)
|
|
}, 5000)
|
|
|
},
|
|
},
|
|
@@ -1138,7 +1157,7 @@
|
|
|
// console.log('发送', {type: 'ping'});
|
|
// console.log('发送', {type: 'ping'});
|
|
|
this.websocketsend(JSON.stringify({type: 'ping'})) //根据后台要求发送
|
|
this.websocketsend(JSON.stringify({type: 'ping'})) //根据后台要求发送
|
|
|
this.serverTimeoutObj = setTimeout(() => {
|
|
this.serverTimeoutObj = setTimeout(() => {
|
|
|
- console.log('------close-------')
|
|
|
|
|
|
|
+ // console.log('------心跳检测close-------')
|
|
|
this.websock.close(); //如果 5秒之后我们没有收到 后台返回的心跳检测数据 断开socket,断开后会启动重连机制
|
|
this.websock.close(); //如果 5秒之后我们没有收到 后台返回的心跳检测数据 断开socket,断开后会启动重连机制
|
|
|
|
|
|
|
|
}, 5000);
|
|
}, 5000);
|
|
@@ -1201,7 +1220,7 @@
|
|
|
}
|
|
}
|
|
|
}))
|
|
}))
|
|
|
this.tokNum++;
|
|
this.tokNum++;
|
|
|
- console.log(this.tokNum,"我发的消息");
|
|
|
|
|
|
|
+ // console.log(this.tokNum,"我发的消息");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
// 发送之后清空发送数据
|
|
// 发送之后清空发送数据
|
|
@@ -1252,11 +1271,20 @@
|
|
|
/**************匿名注册**************** */
|
|
/**************匿名注册**************** */
|
|
|
registered() {
|
|
registered() {
|
|
|
let token = localStorage.getItem('token');
|
|
let token = localStorage.getItem('token');
|
|
|
|
|
+ let appuid = this.$public.getQueryString('appuid');
|
|
|
|
|
+ // 有会员账号
|
|
|
|
|
+ // if (appuid) {
|
|
|
|
|
+ // token = localStorage.setItem('xx');
|
|
|
|
|
+ //
|
|
|
|
|
+ // }else {
|
|
|
|
|
+ // 无会员账号
|
|
|
|
|
+ // token = localStorage.setItem('xx');
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
let data = {
|
|
let data = {
|
|
|
- token: token != null ? token : '',//
|
|
|
|
|
- appid: this.$public.getQueryString('appid'),//
|
|
|
|
|
- appuid: this.$public.getQueryString('appuid'),//
|
|
|
|
|
|
|
+ token: token != null ? token : '',
|
|
|
|
|
+ appid: this.$public.getQueryString('appid'),
|
|
|
|
|
+ appuid: this.$public.getQueryString('appuid'),
|
|
|
}
|
|
}
|
|
|
let obj = {
|
|
let obj = {
|
|
|
headers: {
|
|
headers: {
|
|
@@ -1266,6 +1294,8 @@
|
|
|
this.$axios.post('/api/index/register/autoReg', data, obj).then(res => {
|
|
this.$axios.post('/api/index/register/autoReg', data, obj).then(res => {
|
|
|
if (res.data.code == 1) {
|
|
if (res.data.code == 1) {
|
|
|
this.user_info = res.data.data;
|
|
this.user_info = res.data.data;
|
|
|
|
|
+ console.log(this.user_info,"用户信息")
|
|
|
|
|
+ // 游客 token
|
|
|
localStorage.setItem("token", res.data.data.token);
|
|
localStorage.setItem("token", res.data.data.token);
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
//关闭加载条
|
|
//关闭加载条
|