From 9cd3916ab2460c89bef3c816cd4d0db1276ebbbe Mon Sep 17 00:00:00 2001 From: zoujing Date: Mon, 11 May 2026 15:54:28 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=20=E5=85=BC=E5=AE=B9=E5=9C=A8app?= =?UTF-8?q?=E4=B8=8A=E9=A1=B5=E9=9D=A2=E6=BB=9A=E5=8A=A8=E4=B8=8E=E9=94=AE?= =?UTF-8?q?=E7=9B=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- src/pages.json | 19 +++-- src/pages/ChatMain/ChatInputArea/index.vue | 17 +++-- src/pages/ChatMain/ChatMainList/index.vue | 84 ++++++++++++++++++++-- src/pages/Discovery/index.vue | 25 ++++++- src/pages/index/index.vue | 38 +++++----- 6 files changed, 149 insertions(+), 36 deletions(-) diff --git a/index.html b/index.html index c3ff205..fb81ddc 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,6 @@
- + diff --git a/src/pages.json b/src/pages.json index 6647230..359998d 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1,11 +1,16 @@ { "pages": [ - { - "path": "pages/index/index", - "style": { - "navigationStyle": "custom" - } - }, + { + "path": "pages/index/index", + "style": { + "navigationStyle": "custom", + "disableScroll": true, + "app-plus": { + "bounce": "none", + "scrollIndicator": "none" + } + } + }, { "path": "pages/login/index", "style": { @@ -122,4 +127,4 @@ "backgroundColor": "#F8F8F8" }, "uniIdRouter": {} -} \ No newline at end of file +} diff --git a/src/pages/ChatMain/ChatInputArea/index.vue b/src/pages/ChatMain/ChatInputArea/index.vue index 286775f..a1434b0 100644 --- a/src/pages/ChatMain/ChatInputArea/index.vue +++ b/src/pages/ChatMain/ChatInputArea/index.vue @@ -33,6 +33,7 @@ confirm-type="send" v-model="inputMessage" auto-height + :focus="isFocused" :confirm-hold="true" :placeholder="placeholder" :show-confirm-bar="false" @@ -322,20 +323,28 @@ const handleTouchEnd = () => { // 手动聚焦输入框 const focusInput = () => { - if (textareaRef.value) { - textareaRef.value.focus(); - } + isFocused.value = true; + nextTick(() => { + if (textareaRef.value) { + textareaRef.value.focus(); + } + }); }; // 手动失焦输入框 const blurInput = () => { + isFocused.value = false; if (textareaRef.value) { textareaRef.value.blur(); } + + nextTick(() => { + uni.hideKeyboard(); + }); }; // 暴露方法给父组件 -defineExpose({ focusInput }); +defineExpose({ focusInput, blurInput }); + diff --git a/src/pages/Discovery/index.vue b/src/pages/Discovery/index.vue index 3803d3c..fbd3f96 100644 --- a/src/pages/Discovery/index.vue +++ b/src/pages/Discovery/index.vue @@ -9,7 +9,14 @@ /> - + @@ -42,6 +49,15 @@ const activeIndex = ref(0); const discoveryTabs = ref([]); const discoveryCards = ref([]); const discoveryQuickQuestions = ref([]); +const emit = defineEmits(["scroll-touch-start", "scroll-touch"]); + +const emitScrollTouchStart = () => { + emit("scroll-touch-start"); +}; + +const emitScrollTouch = () => { + emit("scroll-touch"); +}; /// tabs 切换事件 const handleTabChange = ({ tab, idx }) => { @@ -188,5 +204,10 @@ onMounted(() => { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 3661618..ad45290 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,22 +1,22 @@