|
|
@@ -100,8 +100,8 @@
|
|
|
<div v-for="(item,index) in historyList" :key="index">
|
|
|
<!-- 客服消息 -->
|
|
|
<div style="padding:0 10px;margin-top:20px;" class="rightAlignment" v-if="item.from_id.startsWith('KF')" >
|
|
|
- <div style="height:37px;font-size:12px;color:#bbb;"
|
|
|
- class="row item-center rightAlignment">{{item.time_line | formatDate}}
|
|
|
+ <div style="height:37px;font-size:12px;color:#bbb;" class="row item-center rightAlignment">
|
|
|
+ {{item.time_line | formatDate}}
|
|
|
</div>
|
|
|
<div class="row item-center rightAlignment">
|
|
|
<p v-if="item.content.text != ''" class="chatMsg message_box" v-html="item.content.text"></p>
|
|
|
@@ -416,7 +416,8 @@
|
|
|
terminal_IP: {},//访客设备信息
|
|
|
|
|
|
showHistoryList: false,
|
|
|
- historyList: []
|
|
|
+ historyList: [],
|
|
|
+ historyTime:'',
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
|
@@ -454,24 +455,6 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- /******************文字信息转表情******************/
|
|
|
- turnFace(data) {
|
|
|
- let str = data.match(/\#\[.*?\]\//g);
|
|
|
- let arr = Array.from(new Set(str));
|
|
|
- arr.forEach(e => {
|
|
|
- let imgsrc = '';
|
|
|
- for (let i = 0; i < this.frceArr.length; i++) {
|
|
|
- let expText = e.slice(1, e.length - 1);
|
|
|
- if (expText == this.frceArr[i]) {
|
|
|
- imgsrc = '<img class="hover" src="' + require(`@/assets/img/${i}.gif`) + '"/>'
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- data = data.replace(new RegExp(`\\#\\[${e.substring(2, e.length - 2)}\\]\\/`, 'g'), imgsrc);
|
|
|
- })
|
|
|
- return data;
|
|
|
- },
|
|
|
-
|
|
|
/****************************/
|
|
|
validation_user_info(type) {
|
|
|
if (type == 1 && this.session_user_info.account_phone) {
|
|
|
@@ -528,7 +511,7 @@
|
|
|
|
|
|
/******************消息数据接收********************/
|
|
|
chatMessage(redata) {
|
|
|
- //console.log(this.sessionList,'sessionList');
|
|
|
+ console.log(this.historyList,'historyList');
|
|
|
//console.log(this.data,'data');
|
|
|
|
|
|
//用户离线后会话窗口切换
|
|
|
@@ -570,11 +553,14 @@
|
|
|
//接收会话时间
|
|
|
if (redata.message_type == "webTime") {
|
|
|
let data = this.data;
|
|
|
- let hisdata = this.historydata;
|
|
|
- console.log(data, '接收会话时间');
|
|
|
+ // console.log(data, '接收会话时间');
|
|
|
data[data.length - 1].time = redata.data.webTime
|
|
|
- historydata[historydata.length - 1].time = redata.data.webTime
|
|
|
this.$store.dispatch("SET_CURRENT", data);
|
|
|
+ if(this.historyList.length > 0){
|
|
|
+ let historyTime = this.historyTime;
|
|
|
+
|
|
|
+ this.$set(this.historyList[this.historyTime], 'time', redata.data.webTime);
|
|
|
+ }
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
@@ -601,19 +587,18 @@
|
|
|
}
|
|
|
// 转接历史信息
|
|
|
if (redata.message_type == "connect") {
|
|
|
- console.log(redata, '转接历史消息');
|
|
|
if (redata.data.history.length > 0) {
|
|
|
+ console.log(redata, '转接历史消息');
|
|
|
this.showHistoryList = true;
|
|
|
redata.data.history.forEach(res => {
|
|
|
let content = JSON.parse(res.content)
|
|
|
res.content = content;
|
|
|
if (content.text) {
|
|
|
- content.text = this.turnFace(content.text)
|
|
|
+ content.text = this.$public.turnFace(content.text,this.$frce)
|
|
|
res.content = content
|
|
|
}
|
|
|
this.historyList.push(res)
|
|
|
})
|
|
|
- console.log(this.historyList,'123123')
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -853,6 +838,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ this.historyTime = this.historyList.length - 1;
|
|
|
//检测发送信息是否含有敏感词
|
|
|
let sensitive_data = this.$public.shieldingKeyword(this.$public.turnFace(this.inputValue, this.$frce), this.sensitive);
|
|
|
//组合发送数据
|
|
|
@@ -900,6 +886,7 @@
|
|
|
this.sensitiveNumber = this.sensitiveNumber + sensitive_data.num;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/******************开启或关闭表情包******************/
|