From 222b3eaa4c74020fbc78c188a0e5b030dce9e4da Mon Sep 17 00:00:00 2001 From: ChenZhaoYu <790348264@qq.com> Date: Fri, 10 Mar 2023 00:46:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E4=B8=8B?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=94=B6=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/chat/index.vue | 65 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue index c9b01f6..1eeefd2 100644 --- a/src/views/chat/index.vue +++ b/src/views/chat/index.vue @@ -34,6 +34,7 @@ const conversationList = computed(() => dataSources.value.filter(item => (!item. const prompt = ref('') const loading = ref(false) const usingContext = ref(true) +const actionVisible = ref(true) function handleSubmit() { onConversation() @@ -367,20 +368,20 @@ function handleStop() { function toggleUsingContext() { usingContext.value = !usingContext.value - if (usingContext.value) { - dialog.info({ - title: t('chat.usingContext'), - content: t('chat.turnOnContext'), - positiveText: t('common.yes'), - }) - } - else { - dialog.info({ - title: t('chat.usingContext'), - content: t('chat.turnOffContext'), - positiveText: t('common.yes'), - }) - } + if (usingContext.value) + ms.success(t('chat.turnOnContext')) + else + ms.warning(t('chat.turnOffContext')) +} + +function onInputFocus() { + if (isMobile.value) + actionVisible.value = false +} + +function onInputBlur() { + if (isMobile.value) + actionVisible.value = true } const placeholder = computed(() => { @@ -402,7 +403,7 @@ const wrapClass = computed(() => { const footerClass = computed(() => { let classes = ['p-4'] if (isMobile.value) - classes = ['sticky', 'left-0', 'bottom-0', 'right-0', 'p-2', 'pr-4', 'overflow-hidden'] + classes = ['sticky', 'left-0', 'bottom-0', 'right-0', 'p-2', 'overflow-hidden'] return classes }) @@ -464,26 +465,30 @@ onUnmounted(() => {