|
|
@@ -183,6 +183,16 @@ export default {
|
|
|
console.error("未找到类型为 'h5-chat' 的元素");
|
|
|
return;
|
|
|
}
|
|
|
+ //2025-8-14 新增需求是否为立即结束聊天的选择
|
|
|
+ if(!!option.endChatOption){
|
|
|
+ await this.delay(1000);
|
|
|
+ let endMsg = {
|
|
|
+ id:-1,
|
|
|
+ text:!!option.endChatMsg?option.endChatMsg:"默认结束聊天了"
|
|
|
+ }
|
|
|
+ h5ChatItem.messages.push(endMsg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 如果有答案就直接用户消息和客服消息
|
|
|
let nextMsg = h5ChatItem.agentMsg.shift();
|
|
|
message.click = true;
|
|
|
@@ -267,10 +277,8 @@ export default {
|
|
|
|
|
|
// 先输出所有的欢迎信息,欢迎信息为没有options的数据,以及后面一条数据
|
|
|
let isOutputWelcome = 0;
|
|
|
-
|
|
|
while (h5ChatItem.agentMsg.length > 0) {
|
|
|
let msg = h5ChatItem.agentMsg.shift()
|
|
|
-
|
|
|
if (!msg.options || msg.options.length === 0) {
|
|
|
isOutputWelcome = 1
|
|
|
await this.delay(1000)
|
|
|
@@ -295,7 +303,6 @@ export default {
|
|
|
options: []
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
startCountdown(item) {
|
|
|
if (!item.active) {
|