feat: 喂养计划

This commit is contained in:
ilhamtahir committed 2025-01-01 22:50:38 +08:00
1 parent 6dfcc0076a
commit bde886d9e6
21 files changed
+107 -669

No files matched your search

+20 -1
View File
@@ -35,10 +35,29 @@ function getCurrentPageUrl() {
const selectedIndex = computed(() => {
return tabList.value.findIndex(item => item.url === getCurrentPageUrl())
})
const height = ref<number>(0)
const instance = getCurrentInstance()
if (instance) {
const query = uni.createSelectorQuery().in(instance.proxy)
query.select('#tabBar').boundingClientRect((data) => {
if (data && !(Array.isArray(data))) {
height.value = data.height as number
}
}).exec()
}
</script>
<template>
<view class="w-full p-1 fixed bottom-0 left-0 safe-area border-t-[0.5px] border-[#E7E7E7] bg-[#fff]">
<view
class="w-full"
:style="{
height: `${height}px`,
}" t
/>
<view id="tabBar" class="w-full p-1 fixed bottom-0 left-0 safe-area border-t-[0.5px] border-[#E7E7E7] bg-[#fff]">
<view class="w-full flex gap-2">
<view v-for="(item, index) in tabList" :key="index" class="flex flex-col items-center justify-center w-1/4" @tap="handleTap(item)">
<image :src="selectedIndex === index ? item.iconSelect : item.icon" class="w-8 h-8" />