Files
kangyuan-mobile/pages/increment/components/increment/card_tabBar.vue
T
2026-05-26 15:52:30 +08:00

63 lines
1.3 KiB
Vue

<template>
<view class="tabBar bg16 h_100 flex-center ju-around">
<view class="" v-for="(v, i) in nav" :key="i" @click="go(v)">
<view class="flex-center">
<image
class="w_50 h_50"
:src="`/static/increment/${v.icon == props.index ? v.icon1 : v.icon}.svg`"
mode="scaleToFill"
/>
</view>
<view class="size24 name" :class="{ c32: v.icon == props.index }">{{ v.name }}</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, getCurrentInstance } from 'vue';
const { proxy } = getCurrentInstance() as any;
let props = defineProps({
index: {
type: Number,
default: 1,
},
});
let nav = ref([
{
name: '拼分',
icon: '1',
icon1: '1_1',
path: '/pages/increment/index',
},
// {
// name: '报单',
// icon: '2',
// icon1: '2_1',
// path: '/pages/increment/index'
// },
{
name: '我的',
icon: '3',
icon1: '3_1',
path: '/pages/increment/user',
},
]);
const go = (v) => {
if (v.icon == props.index) return;
uni.redirectTo({ url: v.path });
};
</script>
<style scoped lang="scss">
.tabBar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 10;
width: 100vw;
}
.name {
color: #979797;
}
</style>