聊天系统断网重连及客服离线识别 完成

This commit is contained in:
2025-06-17 11:27:44 +08:00
parent e74f5b8d75
commit 0dbb43233a
26 changed files with 862 additions and 627 deletions

View File

@@ -1,46 +1,7 @@
<!--
聊天小组件组件
=== 用户体验优化策略 v2.0 ===
遵循"静默可靠性"原则减少90%的用户提示噪音
已移除的不必要提示
- 自动重连进度通知后台静默处理
- 图片上传进度toast仅在失败时提示
- 连接成功确认提示成功是默认期望
- 网络断开自动提示避免打断用户
- 订阅失败技术细节简化为用户友好消息
- 心跳检测正常状态日志避免日志污染
- WebSocket技术性错误代码转换为友好消息
- 连接数上限等技术术语简化为通用连接异常
- 系统内部状态变更通知对用户无意义
- 自动恢复功能的成功提示静默恢复更专业
保留的必要提示
- 文件上传错误需要用户重新操作
- 消息发送失败需要用户重试
- 严重错误需要页面刷新需要用户行动
- 登录状态变更确认重要状态变化
- 需要用户手动干预的错误如页面刷新
优化效果
- 大幅减少用户界面干扰
- 系统显得更稳定可靠
- 只有真正需要用户关注的信息才会显示
- 技术细节完全对用户屏蔽
- 开发调试信息保留在控制台
错误消息简化策略
- 移除错误代码和技术术语
- 统一使用"连接异常"代替具体技术错误
- 提供明确的用户行动指导
- 避免让用户看到系统内部状态
-->
<template>
<div class="chat-widget">
<!-- 添加网络状态提示 -->
<div v-if="networkStatus === 'offline'" class="network-status">
<!-- 添加网络状态提示 -->
<div class="network-status" v-if="networkStatus === 'offline'">
<i class="el-icon-warning"></i>
<span>{{ $t("chat.networkError") || "网络连接已断开" }}</span>
</div>
@@ -246,10 +207,10 @@
/>
<!-- <span class="input-counter">{{ maxMessageLength - inputMessage.length }}</span> -->
</div>
<!-- :disabled="connectionStatus !== 'connected' || !inputMessage.trim()" -->
<button
class="chat-send"
@click="sendMessage"
:disabled="connectionStatus !== 'connected' || !inputMessage.trim()"
@click="sendMessage"
>
{{ $t("chat.send") || "发送" }}
</button>
@@ -339,6 +300,7 @@ export default {
lastErrorTime: 0, // 最后一次错误时间
lastConnectedEmail: null, // 最后连接的用户email用于防止重复连接
userViewHistory: false, // 是否在查看历史消息
customerIsOnline: true, // 保存客服在线状态
};
},
computed: {
@@ -522,6 +484,8 @@ export default {
if (userData) {
this.roomId = userData.id;
this.receivingEmail = userData.userEmail;
// === 保存客服在线状态 ===
this.customerIsOnline = userData.customerIsOnline;
// === 使用localStorage管理未读消息数 ===
this.updateUnreadMessages(userData.clientReadNum || 0);
@@ -665,7 +629,7 @@ export default {
if (!this.stompClient || !this.isWebSocketConnected) {
console.error("❌ STOMP客户端未连接无法订阅消息");
this.connectionStatus = "error";
this.connectionError = "连接状态异常,无法订阅消息";
this.connectionError =this.$t("chat.unableToSubscribe");//连接状态异常,无法订阅消息
this.isWebSocketConnected = false;
this.showRefreshButton = false; // 连接状态异常通常可以重试解决
this.$forceUpdate();
@@ -675,7 +639,7 @@ export default {
if (!this.stompClient.connected) {
console.error("❌ STOMP客户端已断开无法订阅消息");
this.connectionStatus = "error";
this.connectionError = "连接已断开,无法订阅消息";
this.connectionError = "chat.unableToSubscribe";//连接已断开,无法订阅消息
this.isWebSocketConnected = false;
this.showRefreshButton = false; // 连接断开通常可以重试解决
this.$forceUpdate();
@@ -745,7 +709,7 @@ export default {
// === 订阅异常立即设置错误状态 ===
this.connectionStatus = "error";
this.connectionError = "连接异常,可能是多窗口冲突,请关闭其他窗口重试";
this.connectionError = this.$t("chat.conflict"); //连接异常,可能是多窗口冲突,请关闭其他窗口重试
this.isWebSocketConnected = false;
this.isReconnecting = false;
this.showRefreshButton = false; // 多窗口冲突不需要刷新页面,重试即可
@@ -757,33 +721,58 @@ export default {
// 连接 WebSocket
async connectWebSocket(selfEmail) {
if (!selfEmail) selfEmail = this.userEmail;
console.log("selfEmail",this.userEmail);
// 健壮恢复userEmail
let email = selfEmail || this.userEmail;
// 1. 优先从 localStorage 查找
if (!email) {
try {
const emailData = localStorage.getItem("userEmail");
if (emailData) {
const emailObj = JSON.parse(emailData);
email = emailObj.email || emailObj.value || emailObj.userEmail || emailObj;
if (typeof email !== "string") email = "";
}
} catch (e) {
// 解析失败时忽略,继续后续逻辑
console.warn('[DEBUG] 解析localStorage userEmail失败:', e);
}
}
// 2. 再从 sessionStorage 查找游客邮箱
if (!email) {
const guestEmail = sessionStorage.getItem("chatGuestEmail");
if (guestEmail && guestEmail.startsWith("guest_")) {
email = guestEmail;
}
}
// 3. 兜底生成游客邮箱
if (!email) {
email = `guest_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
sessionStorage.setItem("chatGuestEmail", email);
console.warn("[DEBUG] 自动生成游客邮箱:", email);
}
this.userEmail = email;
selfEmail = email;
console.log('[DEBUG] connectWebSocket called', {
isWebSocketConnected: this.isWebSocketConnected,
isReconnecting: this.isReconnecting,
lastConnectedEmail: this.lastConnectedEmail,
selfEmail,
userEmail: this.userEmail,
connectionStatus: this.connectionStatus
});
if (!selfEmail) {
console.warn("🔴 connectWebSocket: 缺少用户邮箱参数,尝试重新获取用户身份");
// 返回一个rejected Promise而不是undefined避免调用者对undefined调用.catch()
return Promise.reject(new Error("缺少用户邮箱参数"));
console.warn('[DEBUG] connectWebSocket: 缺少用户邮箱参数');
return Promise.reject(new Error('缺少用户邮箱参数'));
}
// === 多连接优化后端支持最多10个连接每个窗口独立连接 ===
console.log("🌐 后端支持多连接,当前窗口独立建立连接");
// === 检查是否需要断开旧连接(仅在用户身份变化时) ===
if (this.isWebSocketConnected && this.lastConnectedEmail &&
this.lastConnectedEmail !== selfEmail) {
console.log(`🔄 用户身份变化 (${this.lastConnectedEmail} -> ${selfEmail}),断开旧连接`);
this.forceDisconnectAll();
} else if (this.isWebSocketConnected && this.lastConnectedEmail === selfEmail) {
console.log("✅ 相同用户已连接,复用现有连接");
return Promise.resolve("already_connected");
if (this.isWebSocketConnected && this.lastConnectedEmail === selfEmail) {
console.log('[DEBUG] connectWebSocket: 已连接,复用');
return Promise.resolve('already_connected');
}
if (this.isReconnecting) {
console.log("🔍 正在重连中,跳过重复连接");
return Promise.resolve("reconnecting");
console.log('[DEBUG] connectWebSocket: 正在重连中,跳过');
return Promise.resolve('reconnecting');
}
this.connectionStatus = "connecting";
this.isReconnecting = true;
this.connectionError = null;
@@ -808,8 +797,20 @@ export default {
// 将 https 替换为 wss
const baseUrl = process.env.VUE_APP_BASE_API.replace("https", "wss");
const wsUrl = `${baseUrl}chat/ws`;
// === 彻底释放旧的stompClient和WebSocket对象 ===
if (this.stompClient) {
try {
this.stompClient.disconnect();
console.log('[DEBUG] 旧stompClient已disconnect');
} catch (e) {
console.warn('[DEBUG] stompClient.disconnect异常', e);
}
this.stompClient = null;
}
// === 新建连接前详细日志 ===
console.log('[DEBUG] 即将新建stompClient:', wsUrl);
this.stompClient = Stomp.client(wsUrl);
this.stompClient.splitLargeFrames = true;
console.log('[DEBUG] stompClient对象已创建:', this.stompClient);
// === 新增设置WebSocket连接超时 ===
this.stompClient.webSocketFactory = () => {
@@ -857,7 +858,7 @@ export default {
}
// 其他错误可选处理
this.connectionError = errorMessage || "连接异常";
this.connectionError = errorMessage || this.$t("chat.abnormal");//连接异常
this.connectionStatus = "error";
this.isWebSocketConnected = false;
this.isReconnecting = false;
@@ -893,7 +894,7 @@ export default {
stompConnected: this.stompClient?.connected
});
this.connectionStatus = "error";
this.connectionError = "订阅失败,可能是多窗口冲突,请关闭其他窗口重试";
this.connectionError = this.$t("chat.conflict");//订阅失败,可能是多窗口冲突,请关闭其他窗口重试
this.isWebSocketConnected = false;
this.isReconnecting = false;
this.showRefreshButton = true;
@@ -926,11 +927,11 @@ export default {
// === 简化连接错误消息,避免技术细节 ===
if (error.headers.message.includes("503")) {
this.connectionError = "服务器暂时不可用,请稍后重试";
this.connectionError = this.$t("chat.server500");// "服务器暂时不可用,请稍后重试";
} else if (error.headers.message.includes("handshake")) {
this.connectionError = "网络连接异常,正在重试";
this.connectionError =this.$t("chat.networkAnomaly");//网络连接异常,正在重试
} else {
this.connectionError = "连接异常,正在重试";
this.connectionError = this.$t(`chat.abnormal`);//连接异常,正在重试
}
this.isReconnecting = false;
this.handleDisconnect();
@@ -944,7 +945,7 @@ export default {
} catch (error) {
console.error("初始化 WebSocket 失败:", error);
clearTimeout(connectionTimeout);
this.connectionError = "连接初始化失败,正在重试";
this.connectionError = this.$t("chat.initializationFailed");//初始化失败,请刷新页面重试
this.isReconnecting = false;
this.handleDisconnect();
return Promise.reject(error);
@@ -952,6 +953,12 @@ export default {
},
// 添加新重连最多重连5次
handleDisconnect() {
console.log('[DEBUG] handleDisconnect', {
isWebSocketConnected: this.isWebSocketConnected,
isReconnecting: this.isReconnecting,
reconnectAttempts: this.reconnectAttempts,
connectionStatus: this.connectionStatus
});
if (this.isReconnecting) return;
console.log("🔌 处理连接断开...");
@@ -1004,26 +1011,13 @@ export default {
// 只记录日志不显示toast提示
this.reconnectTimer = setTimeout(() => {
this.isReconnecting = false; // 兜底重置,确保重连能进入
if (!this.isWebSocketConnected) {
// === 修复传递用户邮箱参数并处理方法可能返回undefined的情况 ===
const connectionPromise = this.connectWebSocket(this.userEmail);
if (connectionPromise && typeof connectionPromise.catch === 'function') {
connectionPromise.catch((error) => {
console.error("🔴 自动重连失败:", error);
// === 如果聊天窗口打开,确保显示错误状态 ===
if (this.isChatOpen) {
this.connectionStatus = "error";
}
this.showRefreshButton = true;
console.error('[DEBUG] 自动重连失败:', error);
});
} else {
console.warn("🔴 connectWebSocket返回值无效可能缺少userEmail");
// 如果connectWebSocket返回undefined说明参数有问题显示错误状态
if (this.isChatOpen) {
this.connectionStatus = "error";
}
this.showRefreshButton = true;
}
}
}, this.reconnectInterval);
@@ -1040,15 +1034,25 @@ export default {
// 处理网络状态变化
handleNetworkChange() {
this.networkStatus = navigator.onLine ? "online" : "offline";
console.log('[DEBUG] handleNetworkChange', {
online: navigator.onLine,
isWebSocketConnected: this.isWebSocketConnected,
isReconnecting: this.isReconnecting,
connectionStatus: this.connectionStatus
});
if (navigator.onLine) {
// 网络恢复时,尝试重连
if (!this.isWebSocketConnected) {
this.handleDisconnect();
}
} else {
// === 移除网络断开提示:网络状态在界面上已有显示 ===
console.log("🌐 网络已断开,显示网络状态提示");
// === 强制重置状态,兜底 ===
location.reload(); // 重新加载当前页面
this.isChatOpen = false;
this.isMinimized = false;
this.isLoadingHistory = false;
this.isLoading = false;
this.isWebSocketConnected = false;
this.isReconnecting = false;
// if (!this.isWebSocketConnected) {
// console.log('[DEBUG] 网络恢复,触发 handleDisconnect');
// this.handleDisconnect();
// }
}
},
// 开始活动检测
@@ -1101,9 +1105,36 @@ export default {
},
// 发送消息
sendMessage() {
if (!this.inputMessage.trim()) return;
// 网络断开时阻止发送消息并提示
if (this.networkStatus !== 'online') {
this.$message({
message: this.$t("chat.networkError") || "网络连接已断开,无法发送消息",
type: "error",
showClose: true
});
return;
}
// === 游客且客服离线时提示 ===
if (this.userType === 0 && this.customerIsOnline === false) {
this.$message({
message:this.$t("chat.customerServiceOffline") || "客服离线,请登录账号发送留言消息",
type: "warning",
showClose: true
});
return;
}
if (!this.inputMessage.trim()){
this.$message({
message: this.$t("chat.sendMessageEmpty") || "发送消息不能为空",
type: "warning",
showClose: true
});
return;
}
if (this.inputMessage.length > this.maxMessageLength) {
this.$message.warning(`消息不能超过${this.maxMessageLength}个字符`);
this.$message.warning(this.$t("chat.contentMax") || "超出发送内容大小限制,请删除部分内容(300字以内)");//超出发送内容大小限制,请删除部分内容 300个字符
return;
}
@@ -1157,7 +1188,7 @@ export default {
} catch (error) {
console.error("发送消息失败:", error);
// === 优化发送失败提示:只在明确需要用户重试时提示 ===
this.$message.error("发送失败,请重试");
this.$message.error(this.$t("chat.failInSend") || "发送失败,请重试");
}
},
@@ -1355,7 +1386,7 @@ export default {
} catch (error) {
console.error("加载历史消息失败:", error);
// === 简化历史消息加载失败提示 ===
this.$message.error("加载历史消息失败");
this.$message.error(this.$t("chat.loadHistoryFailed") || "加载历史消息失败");
this.messages = [
{
type: "system",
@@ -1446,7 +1477,7 @@ export default {
} catch (error) {
this.$message.error("加载历史消息失败,请重试");
this.$message.error(this.$t("chat.loadHistoryFailed") || "加载历史消息失败,请重试");
} finally {
this.isLoadingHistory = false;
}
@@ -1652,18 +1683,25 @@ export default {
// 添加消息到聊天列表
this.addMessageToChat(messageData, isSentByMe);
// 如果是对方发送的消息且聊天窗口未打开,增加未读消息数
if (!isSentByMe && !this.isChatOpen) {
// 使用服务器返回的未读数如果没有则增加1
if (messageData.clientReadNum !== undefined) {
this.updateUnreadMessages(messageData.clientReadNum);
// === 新增未读数逻辑 ===
if (!isSentByMe) {
// 聊天框打开且在底部,自动已读
if (this.isChatOpen && this.isAtBottom()) {
this.updateUnreadMessages(0);
// 可选:自动标记已读
// this.markMessagesAsRead();
} else {
this.updateUnreadMessages(this.unreadMessages + 1);
// 聊天框未打开或不在底部,显示未读数
if (data.clientReadNum !== undefined) {
this.updateUnreadMessages(data.clientReadNum);
} else {
this.updateUnreadMessages(this.unreadMessages + 1);
}
// 显示消息通知
const messageObj = this.createMessageObject(data);
this.showNotification(messageObj);
}
// 显示消息通知
const messageObj = this.createMessageObject(messageData);
this.showNotification(messageObj);
}
}
},
/**
@@ -1805,7 +1843,7 @@ export default {
},
// 创建通知
createNotification(message) {
const notification = new Notification("新消息", {
const notification = new Notification(this.$t("chat.newMessage") || "新消息", {
body: message.isImage
? `[ ${this.$t("chat.pictureMessage")}]` || "[图片消息]"
: message.text,
@@ -1922,7 +1960,7 @@ export default {
} catch (error) {
console.error("初始化聊天失败:", error);
// === 简化初始化失败提示 ===
this.$message.error("连接失败,请重试");
// this.$message.error("连接失败,请重试");
}
} else {
// === 新增:关闭聊天时清除连接验证 ===
@@ -2290,7 +2328,7 @@ export default {
} catch (error) {
console.error("发送图片消息失败:", error);
// === 简化图片发送失败提示 ===
this.$message.error("图片发送失败,请重试");
// this.$message.error("图片发送失败,请重试");
}
},
@@ -2375,10 +2413,10 @@ export default {
error.message.includes("503") ||
error.message.includes("网络")
)) {
this.connectionError = "网络连接异常,请稍后重试";
this.connectionError = this.$t("chat.networkAnomaly") || "网络连接异常,请稍后重试";
this.showRefreshButton = false; // 网络问题不显示刷新按钮
} else {
this.connectionError = "连接异常,请重试";
this.connectionError =this.$t("chat.abnormal") || "连接异常,请重试";
this.showRefreshButton = error.message && error.message.includes("1020"); // 只有1020错误才显示刷新按钮
}
}
@@ -2566,7 +2604,7 @@ export default {
// === 立即设置错误状态 ===
this.connectionStatus = "error";
this.connectionError = "连接数已达上限超过10个窗口请关闭一些窗口后重试";
this.connectionError = this.$t("chat.connectionLimitError") || "连接数已达上限超过10个窗口请关闭一些窗口后重试";
this.isWebSocketConnected = false;
this.isReconnecting = false;
this.showRefreshButton = false; // 不显示刷新按钮,用户只需关闭多余窗口
@@ -2673,7 +2711,7 @@ export default {
case "1021": // MAX_LIMIT_CONNECT
console.log("🚫 处理1021错误服务器连接数上限");
this.connectionError = "服务器繁忙,请稍后刷新重试";
this.connectionError = this.$t("chat.serverBusy") || "服务器繁忙,请稍后刷新重试";
this.connectionStatus = "error";
this.isReconnecting = false;
this.showRefreshButton = true;
@@ -2682,7 +2720,7 @@ export default {
case "1022": // SET_PRINCIPAL_FAIL
console.log("🚫 处理1022错误身份设置失败");
this.connectionError = "身份验证失败,请刷新页面重试";
this.connectionError = this.$t("chat.identityError") || "身份验证失败,请刷新页面重试";
this.connectionStatus = "error";
this.isReconnecting = false;
this.showRefreshButton = true;
@@ -2691,7 +2729,7 @@ export default {
case "1023": // GET_PRINCIPAL_FAIL
console.log("🚫 处理1023错误用户信息获取失败");
this.connectionError = "用户信息获取失败,请刷新页面重试";
this.connectionError = this.$t("chat.emailError") || "用户信息获取失败,请刷新页面重试";
this.connectionStatus = "error";
this.isReconnecting = false;
this.showRefreshButton = true;
@@ -2883,7 +2921,7 @@ export default {
// 重置连接状态
this.isWebSocketConnected = false;
this.connectionStatus = "connecting"; // 改为connecting而不是error
this.connectionError = "正在重新连接...";
this.connectionError = this.$t("chat.reconnecting") || "正在重新连接...";
// 2秒后重新连接
setTimeout(() => {
@@ -2954,7 +2992,7 @@ export default {
this.forceDisconnectAll().then(() => {
// 设置connecting状态而不是error状态
this.connectionStatus = "connecting";
this.connectionError = "连接超时,正在重试...";
this.connectionError = this.$t("chat.connectionTimedOut") || "连接超时,稍后重试...";
// 2秒后重新连接
setTimeout(() => {
@@ -2969,12 +3007,12 @@ export default {
this.isChatOpen = true;
this.isMinimized = false;
this.connectionStatus = "error";
this.connectionError = "重连失败,请稍后重试";
this.connectionError = this.$t("chat.reconnectFailed") || "重连失败,请稍后重试";
// 如果已达最大重连次数,显示刷新按钮
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
this.showRefreshButton = true;
this.connectionError = "连接失败,请刷新页面重试";
this.connectionError = this.$t("chat.connectionFailed") || "连接失败,请刷新页面重试";
}
});
}, 2000);
@@ -2986,12 +3024,12 @@ export default {
this.isChatOpen = true;
this.isMinimized = false;
this.connectionStatus = "error";
this.connectionError = "连接处理失败,请稍后重试";
this.connectionError = this.$t("chat.connectionFailed") ||"连接处理失败,请稍后重试";
// 如果已达最大重连次数,显示刷新按钮
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
this.showRefreshButton = true;
this.connectionError = "连接失败,请刷新页面重试";
this.connectionError = this.$t("chat.connectionFailed") || "连接失败,请刷新页面重试";
}
});
},
@@ -3048,19 +3086,19 @@ export default {
// === 增强握手错误处理,针对不同错误码提供准确的错误信息 ===
if (error.message.includes("unexpected response code: 200")) {
this.connectionError = "服务配置异常,请稍后重试";
this.connectionError = this.$t("chat.serviceConfigurationError") || "服务配置异常,请稍后重试";
console.log("🔴 WebSocket握手失败服务器返回200而非101升级响应");
} else if (error.message.includes("unexpected response code: 404")) {
this.connectionError = "服务地址不可用,请稍后重试";
this.connectionError = this.$t("chat.serviceAddressUnavailable") || "服务地址不可用,请稍后重试";
console.log("🔴 WebSocket握手失败服务地址404");
} else if (error.message.includes("unexpected response code: 500")) {
this.connectionError = "服务器暂时不可用,请稍后重试";
this.connectionError = this.$t("chat.server500") || "服务器暂时不可用,请稍后重试";
console.log("🔴 WebSocket握手失败服务器500错误");
} else if (error.message.includes("connection refused")) {
this.connectionError = "无法连接到服务器,请稍后重试";
this.connectionError = this.$t("chat.connectionFailedService") || "无法连接到服务器,请稍后重试";
console.log("🔴 WebSocket握手失败连接被拒绝");
} else {
this.connectionError = "连接失败,请稍后重试";
this.connectionError = this.$t("chat.connectionFailed") || "连接失败,请稍后重试";
console.log("🔴 WebSocket握手失败", error.message);
}
@@ -3073,7 +3111,7 @@ export default {
console.log("❌ 握手错误重连次数已达上限,停止重连");
this.isHandlingError = false;
this.showRefreshButton = true;
this.connectionError = "连接失败,请刷新页面重试";
this.connectionError = this.$t("chat.connectionFailed") || "连接失败,请刷新页面重试";
return;
}
@@ -3089,7 +3127,7 @@ export default {
console.error("❌ 握手错误重连失败:", retryError);
this.isHandlingError = false;
this.connectionStatus = "error";
this.connectionError = "重连失败,请稍后重试";
this.connectionError = this.$t("chat.reconnectFailed") || "重连失败,请稍后重试";
});
}, 3000);
},
@@ -3110,7 +3148,7 @@ export default {
// === 关键修复:立即显示错误状态和重试按钮 ===
this.isWebSocketConnected = false;
this.connectionStatus = "error";
this.connectionError = "连接客服系统失败,请检查网络或稍后重试";
this.connectionError = this.$t("chat.connectionFailedCustomer") || "连接客服系统失败,请检查网络或稍后重试";
this.showRefreshButton = false;
// 1秒后可自动重连不影响UI
setTimeout(() => {
@@ -3129,7 +3167,7 @@ export default {
this.isWebSocketConnected = false;
// === 关键修复:立即显示错误状态和重试按钮 ===
this.connectionStatus = "error";
this.connectionError = "连接客服系统失败,请检查网络或稍后重试";
this.connectionError = this.$t("chat.connectionFailedCustomer") || "连接客服系统失败,请检查网络或稍后重试";
this.showRefreshButton = false;
// 延迟重连
setTimeout(() => {
@@ -3210,7 +3248,7 @@ export default {
);
} else {
console.error("登录处理最终失败,已达到最大重试次数");
this.$message.error("聊天功能初始化失败,请刷新页面");
// this.$message.error("聊天功能初始化失败,请刷新页面");
}
}
}
@@ -3825,7 +3863,7 @@ export default {
.network-status {
position: fixed;
top: 20px;
top: 80px;
right: 20px;
padding: 8px 16px;
border-radius: 4px;

View File

@@ -91,7 +91,23 @@ export const ChatWidget_zh = {
emailError:"用户信息获取失败,请刷新页面重试",
refreshPage:"刷新页面",
reconnectSuccess:"重新连接成功",
},
sendMessageEmpty:"发送消息不能为空",
unableToSubscribe:"连接状态异常,刷新页面重试",
conflict:"连接异常,可能是多窗口冲突,请关闭其他窗口重试",
abnormal:"连接异常",
networkAnomaly:"网络连接异常",
customerServiceOffline:"客服离线,请登录账号发送留言消息",
contentMax:"超出发送内容大小限制,请删除部分内容(300字以内)",
failInSend:"发送失败,请重试",
connectionLimitError:"连接数已达上限,请关闭一些窗口后刷新重试",
serverBusy:"服务器繁忙,请稍后刷新重试",
connectionTimedOut:"连接超时,稍后重试...",
reconnectFailed:"重连失败,请稍后重试",
serviceConfigurationError:"服务配置异常,请稍后重试",
serviceAddressUnavailable:"服务地址不可用,请稍后重试",
connectionFailedService:"无法连接到服务器,请稍后重试",
connectionFailedCustomer:"连接客服系统失败,请检查网络或稍后重试",
},
}
@@ -157,7 +173,7 @@ export const ChatWidget_en = {
None: "No messages",
sendPicture: "Send image",
inputMessage: "Type message, Enter to send, Ctrl+Enter for new line",
bottom: "Back to bottom",
bottom: "to bottom",
Preview: "Preview image",
chatRoom: "Chat room",
CLOSED: "Closed",
@@ -190,7 +206,30 @@ export const ChatWidget_en = {
emailError:"Failed to get user information, please refresh page",
refreshPage:"Refresh page",
reconnectSuccess:"Reconnect successfully",
}
sendMessageEmpty:"Message cannot be empty",
unableToSubscribe:"Connection status abnormal, please refresh the page",
conflict:"Connection exception, possibly due to multiple window conflicts, please close other windows and try again",
abnormal:"Connection exception",
networkAnomaly:"Network connection exception",
customerServiceOffline:"Customer service offline, please login to send message",
contentMax:"Content exceeds the size limit, please delete some content(300 characters or less)",
failInSend:"Failed to send, please try again",
connectionLimitError:"Connection limit reached, please close some windows and refresh to try again",
serverBusy:"Server busy, please refresh later",
connectionTimedOut:"Connection timed out, please try again later",
reconnectFailed:"Reconnect failed, please try again later",
serviceConfigurationError:"Service configuration exception, please try again later",
serviceAddressUnavailable:"Service address unavailable, please try again later",
connectionFailedService:"Failed to connect to the server, please try again later",
connectionFailedCustomer:"Failed to connect to the customer service system, please check the network or try again later",
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1407,13 +1407,13 @@ export default {
// 其他CSS样式可以根据需要添加
},
handelProfitCalculation() {
for (const key in this.CalculatorData) {
if (!this.CalculatorData[key]) {
// this.$message({
// message: this.$t(`home.acquisitionFailed`),
// type: "error",
// });
if (this.CalculatorData[key]!==0 && !this.CalculatorData[key]) {
this.$message({
message: this.$t(`home.acquisitionFailed`),
type: "error",
});
this.profit = 0
// var myDiv = document.getElementById('myDiv');
// this.disableElement(myDiv);

View File

@@ -680,6 +680,7 @@
:key="item.value"
:label="item.label"
:value="item.value"
v-show="item.value !== 'enx'"
>
<div style="display: flex; align-items: center">
<img :src="item.imgUrl" style="float: left; width: 20px" />