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(() => {