From 50cad268d380aafd043a432c336740a2c5696f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= Date: Sat, 13 Jun 2026 00:29:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=BB=98=E8=AE=A4=E8=B7=B3=E8=BD=AC=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增全局搜索弹窗组件及相关事件常量 2. 修复首页默认跳转路径,改回首页而非动态页 3. 注释无用的单例运行代码 4. 添加背景模糊样式类 5. 更新搜索API类型定义 6. 底部导航栏搜索按钮触发全局搜索弹窗 --- .trae/rules/git-commit-message.md | 8 + src/App.ku.vue | 15 ++ src/api/halo-base/common.ts | 4 +- .../uh-global-search/uh-global-search.vue | 166 ++++++++++++++++++ src/constants/events.ts | 2 + src/pages/home/home.vue | 2 +- src/pages/index/index.vue | 4 +- src/style/uh-styles.css | 16 ++ src/tabbar/index.vue | 7 +- 9 files changed, 218 insertions(+), 6 deletions(-) create mode 100644 .trae/rules/git-commit-message.md create mode 100644 src/components/uh-global-search/uh-global-search.vue create mode 100644 src/constants/events.ts diff --git a/.trae/rules/git-commit-message.md b/.trae/rules/git-commit-message.md new file mode 100644 index 0000000..c09a6e3 --- /dev/null +++ b/.trae/rules/git-commit-message.md @@ -0,0 +1,8 @@ +--- +alwaysApply: true +scene: git_message +--- + +在此处编写规则,自定义 AI 生成提交信息的风格。 + +使用中文编写提交信息 diff --git a/src/App.ku.vue b/src/App.ku.vue index 5bf77d6..2c8d923 100644 --- a/src/App.ku.vue +++ b/src/App.ku.vue @@ -1,5 +1,6 @@ + + diff --git a/src/constants/events.ts b/src/constants/events.ts new file mode 100644 index 0000000..12be8af --- /dev/null +++ b/src/constants/events.ts @@ -0,0 +1,2 @@ +/** 全局搜索弹窗时间名称 */ +export const GLOBAL_SEARCH_EVENT_NAME = 'uh-show-global-search' diff --git a/src/pages/home/home.vue b/src/pages/home/home.vue index 94af889..7a07430 100644 --- a/src/pages/home/home.vue +++ b/src/pages/home/home.vue @@ -115,7 +115,7 @@ const { list: postList, refresh } = useListData({ onLoad(() => { console.log('home onLoad') refresh() - runSingle({ name: '019eb1ca-e37c-7729-97af-e0b658aeef0f' }) + // runSingle({ name: '019eb1ca-e37c-7729-97af-e0b658aeef0f' }) }) onPageScroll(() => { }) diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index a4ac73d..ca5ee6a 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -14,8 +14,8 @@ definePage({ onLoad(() => { console.log('index onLoad') // 默认跳转首页 - // uni.switchTab({ url: '/pages/home/home' }) - uni.switchTab({ url: '/pages/moments/moments' }) + uni.switchTab({ url: '/pages/home/home' }) + // uni.switchTab({ url: '/pages/moments/moments' }) }) diff --git a/src/style/uh-styles.css b/src/style/uh-styles.css index 1aeb7fb..25df3f9 100644 --- a/src/style/uh-styles.css +++ b/src/style/uh-styles.css @@ -9,3 +9,19 @@ .uh-shadow-card { box-shadow: 0 16rpx 60rpx rgba(0, 0, 0, 0.04); } + +.uh-backdrop-blur { + backdrop-filter: blur(4rpx); +} + +.uh-backdrop-blur-xs { + backdrop-filter: blur(8rpx); +} + +.uh-backdrop-blur-sm { + backdrop-filter: blur(12rpx); +} + +.uh-backdrop-blur-md { + backdrop-filter: blur(24rpx); +} diff --git a/src/tabbar/index.vue b/src/tabbar/index.vue index dd3c4d1..fb4c9fe 100644 --- a/src/tabbar/index.vue +++ b/src/tabbar/index.vue @@ -5,6 +5,7 @@ import { setTabbarItem } from './i18n' import { tabbarList, tabbarStore } from './store' import { sleep } from '@/utils/common' import { debounce } from '@/utils/base/debounce' +import { GLOBAL_SEARCH_EVENT_NAME } from '@/constants/events' import TabbarItem from './TabbarItem.vue' // #ifdef MP-WEIXIN @@ -132,6 +133,10 @@ function handleScrollToTop() { duration: 300, }) } + +function handleShowGlobalSearch() { + uni.$emit(GLOBAL_SEARCH_EVENT_NAME) +}