diff --git a/web/src/mobile/views/SupportView.vue b/web/src/mobile/views/SupportView.vue index bfe399a..e59cbb0 100644 --- a/web/src/mobile/views/SupportView.vue +++ b/web/src/mobile/views/SupportView.vue @@ -38,22 +38,11 @@
会话内容已安全加密,请勿发送密码或验证码
-
- {{ connectionStatusText }} +
+ {{ chatError || connectionStatusText }}
-
- -

正在连接客服

-

首次连接会自动建立好友关系

-
-
- -

连接失败

-

{{ chatError }}

- -
-
+
以上是历史会话
-
[ {{ current?.name || '在线客服' }} ] 与您建立了会话
+
[ {{ current?.name || '在线客服' }} ] 客服会话已打开
{{ current?.name || '在线客服' }} · {{ messageDateTime(sessionStartedAt) }} -

【系统消息】尊敬的用户您好,我是{{ current?.name || '在线客服' }},当前已为您接通在线客服,请问有什么可以帮您?

+

【系统消息】您好,我是{{ current?.name || '在线客服' }}。您可以先输入要咨询的问题,正在为您连接客服。

@@ -113,12 +102,12 @@
- + - - + +
@@ -157,7 +146,6 @@ import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { useRoute } from 'vue-router'; import { - ChatbubbleEllipsesOutline, HappyOutline, HeadsetOutline, ImageOutline, @@ -184,7 +172,6 @@ services.value.find((item) => String(item.id) === String(route.params.id)) || services.value[0] ); - const chatLoading = ref(false); const chatError = ref(''); const connectionState = ref('offline'); const connectionStatusText = computed(() => { @@ -268,7 +255,6 @@ chat = null; messages.value = []; historyBoundarySeq.value = 0; - chatLoading.value = false; chatError.value = ''; connectionState.value = 'offline'; draft.value = ''; @@ -283,7 +269,9 @@ disconnectChat(); if (!serviceID) return; const version = connectionVersion; - chatLoading.value = true; + connectionState.value = 'connecting'; + chatError.value = ''; + sessionStartedAt.value = new Date().toISOString(); try { const session = await request({ url: `/v1/customer-services/${serviceID}/session`, @@ -321,8 +309,7 @@ chat?.disconnect(); chat = null; chatError.value = errorText(err); - } finally { - if (version === connectionVersion) chatLoading.value = false; + connectionState.value = 'offline'; } } async function sendMessage() {