wip: 临时提交

This commit is contained in:
ray
2025-06-01 17:25:56 +08:00
parent f56ab639b1
commit 07e9ce725c
17 changed files with 422 additions and 827 deletions

View File

@@ -23,7 +23,7 @@ interface TabbarItem {
// 根据 pages.json 配置的 tabbar 项目
const tabbarItems = ref<TabbarItem[]>([
{ name: "index", value: null, active: true, title: "首页123", icon: "home" },
{ name: "index", value: null, active: true, title: "首页", icon: "home" },
{ name: "mine", value: null, active: false, title: "我的", icon: "user" },
]);
@@ -83,15 +83,19 @@ const updateTabbarByRoute = () => {
function handleTabbarChange({ value }: { value: string }) {
console.log(`用户点击 tabbar: ${value}`);
setTabbarItemActive(value);
// 根据 tabbar 项目导航到对应页面
// 立即设置激活状态
tabbarItems.value.forEach((item) => {
item.active = item.name === value;
});
// 导航到对应页面
if (value === "index") {
uni.switchTab({
uni.reLaunch({
url: "/pages/index/index",
});
} else if (value === "mine") {
uni.switchTab({
uni.reLaunch({
url: "/pages/mine/index",
});
}