;优化,添加组件库

This commit is contained in:
yzy committed 2026-01-08 11:07:35 +08:00
1 parent 1facf7d6c8
commit 85c436551f
534 files changed
+54404 -39

No files matched your search

+46 -12
View File
@@ -3,24 +3,45 @@
<view class="custom-tab-bar">
<!-- 首页 -->
<view class="tab-bar-item" @click="switchTab(homeTab.pagePath)">
<image class="icon" :src="currentPath === homeTab.pagePath ? homeTab.selectedIconPath : homeTab.iconPath"></image>
<image class="icon" :src="currentPath === homeTab.pagePath ? homeTab.selectedIconPath : homeTab.iconPath">
</image>
<text class="text" :style="{color: currentPath === homeTab.pagePath ? selectedColor : color}">
{{ homeTab.text }}
</text>
</view>
<!-- 回忆 -->
<view class="tab-bar-item" @click="switchTab(memoryTab.pagePath)">
<image class="icon" :src="currentPath === memoryTab.pagePath ? memoryTab.selectedIconPath : memoryTab.iconPath">
</image>
<text class="text" :style="{color: currentPath === memoryTab.pagePath ? selectedColor : color}">
{{ memoryTab.text }}
</text>
</view>
<!-- 发现页 -->
<view class="tab-bar-item relative" @click="switchTab(findTab.pagePath)">
<image class="absolute top-[-10px] w-[36px] h-[36px]" :src="currentPath === findTab.pagePath ? findTab.selectedIconPath : findTab.iconPath"></image>
<image class="absolute top-[-10px] w-[40px] h-[40px]"
:src="currentPath === findTab.pagePath ? findTab.selectedIconPath : findTab.iconPath"></image>
<!-- <text class="text" :style="{color: currentPath === findTab.pagePath ? selectedColor : color}">
{{ findTab.text }}
</text> -->
</view>
<!-- MBIT -->
<view class="tab-bar-item" @click="switchTab(mbitTab.pagePath)">
<image class="icon" :src="currentPath === mbitTab.pagePath ? mbitTab.selectedIconPath : mbitTab.iconPath">
</image>
<text class="text" :style="{color: currentPath === mbitTab.pagePath ? selectedColor : color}">
{{ mbitTab.text }}
</text>
</view>
<!-- 个人页面 -->
<view class="tab-bar-item" @click="switchTab(mineTab.pagePath)">
<image class="icon" :src="currentPath === mineTab.pagePath ? mineTab.selectedIconPath : mineTab.iconPath"></image>
<image class="icon" :src="currentPath === mineTab.pagePath ? mineTab.selectedIconPath : mineTab.iconPath">
</image>
<text class="text" :style="{color: currentPath === mineTab.pagePath ? selectedColor : color}">
{{ mineTab.text }}
</text>
@@ -37,16 +58,22 @@
onLoad
} from '@dcloudio/uni-app'
// ========== 配置数据 ==========
// 从你原来的配置迁移过来的数据
const color = '#999999'
const selectedColor = '#000'
const color = '#cdcdcd'
const selectedColor = '#2c2c2c'
//首页配置
const homeTab = {
pagePath: "pages/index/index",
iconPath: "/static/tabbar/home.png",
selectedIconPath: "/static/tabbar/active-home.png",
text: "首页"
text: "home"
}
//记忆
const memoryTab = {
pagePath: "pages/memory/index",
iconPath: "/static/tabbar/love.png",
selectedIconPath: "/static/tabbar/active-love.png",
text: "memory"
}
//发现页
@@ -54,8 +81,15 @@
pagePath: "pages/order/index",
iconPath: "/static/tabbar/find.png",
selectedIconPath: "/static/tabbar/active-find.png",
text: "发现"
text: "find"
}
//mbit
const mbitTab = {
pagePath: "pages/mbti/index",
iconPath: "/static/tabbar/head.png",
selectedIconPath: "/static/tabbar/active-head.png",
text: "MBIT"
}
//个人页
const mineTab = {
pagePath: "pages/mine/index",
@@ -100,7 +134,7 @@
height: 50px;
/* 根据需要调整高度 */
background-color: #ffffff;
/* 对应 borderStyle: black */
z-index: 999;
}