|
@@ -265,7 +265,7 @@
|
|
|
<!-- 客服会话超时 -->
|
|
<!-- 客服会话超时 -->
|
|
|
<div class="promptBox" v-if="willOverTime">
|
|
<div class="promptBox" v-if="willOverTime">
|
|
|
<div class="prompt help">
|
|
<div class="prompt help">
|
|
|
- <span>您好,未能收到您的回复,稍后将自动结束本次会话</span>
|
|
|
|
|
|
|
+ <span>{{overTimeMsg}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -300,14 +300,14 @@
|
|
|
|
|
|
|
|
<div class="row center allAlignment chattingBox">
|
|
<div class="row center allAlignment chattingBox">
|
|
|
<div style="height:44px;width:300px;">
|
|
<div style="height:44px;width:300px;">
|
|
|
- <textarea name=""
|
|
|
|
|
|
|
+ <textarea name=""
|
|
|
id="information"
|
|
id="information"
|
|
|
v-model.trim="information"
|
|
v-model.trim="information"
|
|
|
cols="30"
|
|
cols="30"
|
|
|
rows="1"
|
|
rows="1"
|
|
|
|
|
+ autofocus
|
|
|
placeholder="请输入你的问题:"
|
|
placeholder="请输入你的问题:"
|
|
|
- @keyup.enter.exact="listenEnter($event)"
|
|
|
|
|
- @keyup.ctrl.enter="lineFeed()"
|
|
|
|
|
|
|
+ @keyup.enter="listenEnter($event)"
|
|
|
>
|
|
>
|
|
|
</textarea>
|
|
</textarea>
|
|
|
</div>
|
|
</div>
|
|
@@ -496,6 +496,7 @@
|
|
|
closeByServer: false, //客服关闭会话
|
|
closeByServer: false, //客服关闭会话
|
|
|
serverNotOnlin: false, //客服掉线
|
|
serverNotOnlin: false, //客服掉线
|
|
|
willOverTime: false, //超时关闭会话
|
|
willOverTime: false, //超时关闭会话
|
|
|
|
|
+ overTimeMsg:'', // 超时提示内容
|
|
|
allLoading: true, //整个页面加载中
|
|
allLoading: true, //整个页面加载中
|
|
|
webTime: '',//网络时间
|
|
webTime: '',//网络时间
|
|
|
changeKeFu:false, //客服转接
|
|
changeKeFu:false, //客服转接
|
|
@@ -515,23 +516,19 @@
|
|
|
methods: {
|
|
methods: {
|
|
|
// 回车提交
|
|
// 回车提交
|
|
|
listenEnter(event){
|
|
listenEnter(event){
|
|
|
- console.log(event);
|
|
|
|
|
- if (event.keyCode === 13) {
|
|
|
|
|
- // 判断如果是内容是空 清空内容
|
|
|
|
|
|
|
+ let text = document.getElementById('information');
|
|
|
|
|
+ if(event.keyCode == 13 && event.ctrlKey == true){
|
|
|
|
|
+ text.value = text.value + '\n'
|
|
|
|
|
+ }else if(event.keyCode == 13){
|
|
|
if(this.information == ""){
|
|
if(this.information == ""){
|
|
|
- document.getElementById('information').value = '';
|
|
|
|
|
|
|
+ text.value = '';
|
|
|
return false
|
|
return false
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.sendInfo();
|
|
|
|
|
+ event.preventDefault()
|
|
|
}
|
|
}
|
|
|
- this.sendInfo();
|
|
|
|
|
- // 阻止浏览器默认换行操作
|
|
|
|
|
- event.preventDefault()
|
|
|
|
|
- return false
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // ctrl+center 换行
|
|
|
|
|
- lineFeed(){
|
|
|
|
|
- this.information = this.information + '\n'
|
|
|
|
|
- },
|
|
|
|
|
// 切换留言板返回
|
|
// 切换留言板返回
|
|
|
back(){
|
|
back(){
|
|
|
this.$emit('value',100)
|
|
this.$emit('value',100)
|
|
@@ -1016,6 +1013,7 @@
|
|
|
this.willOverTime = true;
|
|
this.willOverTime = true;
|
|
|
this.automaticRolling();
|
|
this.automaticRolling();
|
|
|
// this.goBack();
|
|
// this.goBack();
|
|
|
|
|
+ this.overTimeMsg = redata.data.content;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1068,12 +1066,14 @@
|
|
|
|
|
|
|
|
/******************消息发送数据处理********************/
|
|
/******************消息发送数据处理********************/
|
|
|
sendMessage() {
|
|
sendMessage() {
|
|
|
|
|
+ let str = this.information;
|
|
|
|
|
+ let formatStr = str.replace(/\n/g,'<br/>');
|
|
|
// 给机器人发送文本消息
|
|
// 给机器人发送文本消息
|
|
|
if (this.machineAndAtl == 10) {
|
|
if (this.machineAndAtl == 10) {
|
|
|
//给机器人发送文本消息-本地储存
|
|
//给机器人发送文本消息-本地储存
|
|
|
let datas = {
|
|
let datas = {
|
|
|
time: '',
|
|
time: '',
|
|
|
- chat: this.turnFace(this.shieldingKeyword(this.information)),
|
|
|
|
|
|
|
+ chat: this.turnFace(this.shieldingKeyword(formatStr)),
|
|
|
imgUrl: this.img,
|
|
imgUrl: this.img,
|
|
|
type: 'user'
|
|
type: 'user'
|
|
|
}
|
|
}
|
|
@@ -1083,7 +1083,7 @@
|
|
|
type: 'toRobot',
|
|
type: 'toRobot',
|
|
|
data: {
|
|
data: {
|
|
|
groups_id: '1',
|
|
groups_id: '1',
|
|
|
- robot_name: this.shieldingKeyword(this.information),
|
|
|
|
|
|
|
+ robot_name: this.shieldingKeyword(formatStr),
|
|
|
webTime: this.webTime,
|
|
webTime: this.webTime,
|
|
|
robotgroups_id: '1',
|
|
robotgroups_id: '1',
|
|
|
}
|
|
}
|
|
@@ -1094,7 +1094,7 @@
|
|
|
//发送给客服消息-本地储存
|
|
//发送给客服消息-本地储存
|
|
|
this.customerSviceChat.push({
|
|
this.customerSviceChat.push({
|
|
|
time: '',
|
|
time: '',
|
|
|
- content: this.turnFace(this.shieldingKeyword(this.information)),
|
|
|
|
|
|
|
+ content: this.turnFace(this.shieldingKeyword(formatStr)),
|
|
|
imgUrl: this.img,
|
|
imgUrl: this.img,
|
|
|
type: 'user',
|
|
type: 'user',
|
|
|
});
|
|
});
|
|
@@ -1107,7 +1107,7 @@
|
|
|
from_avatar: this.user_info.avatar,
|
|
from_avatar: this.user_info.avatar,
|
|
|
from_id: this.user_info.id,
|
|
from_id: this.user_info.id,
|
|
|
content: JSON.stringify({
|
|
content: JSON.stringify({
|
|
|
- text: this.information,
|
|
|
|
|
|
|
+ text: formatStr,
|
|
|
img: this.img,
|
|
img: this.img,
|
|
|
type: 'user'
|
|
type: 'user'
|
|
|
}),
|
|
}),
|
|
@@ -1567,7 +1567,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.help {
|
|
.help {
|
|
|
- width: 300px;
|
|
|
|
|
|
|
+ width: 80%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.help .prompt {
|
|
.help .prompt {
|