1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-07-27 04:20:43 +08:00

feat: 新增全局搜索功能,优化页面默认跳转逻辑

1. 新增全局搜索弹窗组件及相关事件常量
2. 修复首页默认跳转路径,改回首页而非动态页
3. 注释无用的单例运行代码
4. 添加背景模糊样式类
5. 更新搜索API类型定义
6. 底部导航栏搜索按钮触发全局搜索弹窗
This commit is contained in:
小莫唐尼
2026-06-13 00:29:49 +08:00
parent 8510b71ff6
commit 50cad268d3
9 changed files with 218 additions and 6 deletions
+6 -1
View File
@@ -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)
}
</script>
<template>
@@ -159,7 +164,7 @@ function handleScrollToTop() {
class="uh-shadow-sm uh-backdrop-blur box-border h-54px w-54px flex items-center justify-center border border-white rounded-full border-solid bg-white/95 text-2xl"
>
<wd-icon v-if="backTopActive.show" name="arrow-up" :size="22" @click="handleScrollToTop" />
<wd-icon v-else name="search-line" :size="22" />
<wd-icon v-else name="search-line" :size="22" @click="handleShowGlobalSearch()" />
</view>
<view v-if="!tabBarConfig.useFloat" class="pb-safe" />