添加页面
This commit is contained in:
@ -1,21 +1,20 @@
|
||||
|
||||
<template>
|
||||
<view>
|
||||
currentTab--{{ currentTab }}
|
||||
<wd-tabbar v-model="tabbar" active-color="#4C9F44" fixed safeAreaInsetBottom @change="Tabbar.handleChange">
|
||||
<wd-tabbar-item title="收益明细" icon="home">
|
||||
<wd-tabbar v-model="tabbar" active-color="#4C9F44" inactive-color="#707070" fixed safeAreaInsetBottom @change="Tabbar.handleChange">
|
||||
<wd-tabbar-item title="收益明细" name="bill">
|
||||
<template #icon>
|
||||
<wd-img height="40rpx" width="40rpx" :src="currentTab === 0 ? `${OSS}images/parten/parten_bill_s.png` : `${OSS}images/parten/parten_bill.png`"></wd-img>
|
||||
<wd-img height="40rpx" width="40rpx" :src="tab === 'bill' ? `${OSS}images/parten/parten_bill_s.png` : `${OSS}images/parten/parten_bill.png`"></wd-img>
|
||||
</template>
|
||||
</wd-tabbar-item>
|
||||
<wd-tabbar-item title="下级用户" icon="cart">
|
||||
<wd-tabbar-item title="下级用户" name="sub">
|
||||
<template #icon>
|
||||
<wd-img height="40rpx" width="40rpx" :src="currentTab === 1 ? `${OSS}images/parten/parten_sub_s.png` : `${OSS}images/parten/parten_sub.png`"></wd-img>
|
||||
<wd-img height="40rpx" width="40rpx" :src="tab === 'sub' ? `${OSS}images/parten/parten_sub_s.png` : `${OSS}images/parten/parten_sub.png`"></wd-img>
|
||||
</template>
|
||||
</wd-tabbar-item>
|
||||
<wd-tabbar-item title="我的" icon="user">
|
||||
<wd-tabbar-item title="我的" name="my">
|
||||
<template #icon>
|
||||
<wd-img height="40rpx" width="40rpx" :src="currentTab === 2 ? `${OSS}images/parten/parten_my_s.png` : `${OSS}images/parten/parten_my.png`"></wd-img>
|
||||
<wd-img height="40rpx" width="40rpx" :src="tab === 'my' ? `${OSS}images/parten/parten_my_s.png` : `${OSS}images/parten/parten_my.png`"></wd-img>
|
||||
</template>
|
||||
</wd-tabbar-item>
|
||||
</wd-tabbar>
|
||||
@ -23,24 +22,33 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="Tabbar">
|
||||
const tabbar = ref(0)
|
||||
const currentTab = ref<number>(0)
|
||||
const OSS = inject('OSS')
|
||||
|
||||
const props = defineProps({
|
||||
tab: {
|
||||
type: String,
|
||||
default: 'bill'
|
||||
}
|
||||
})
|
||||
|
||||
const tabbar = ref<string>(props.tab)
|
||||
|
||||
|
||||
const Tabbar = {
|
||||
handleChange: ({ value }: { value: string }) => {
|
||||
const index = Number(value)
|
||||
currentTab.value = index
|
||||
// console.log("🚀 ~ value:", value)
|
||||
// tabbar.value = value
|
||||
// console.log("🚀 ~ value:", tabbar.value)
|
||||
|
||||
if (index === 0) {
|
||||
if (value === 'bill') {
|
||||
uni.redirectTo({
|
||||
url: '/bundle/parten/pages/bill/bill'
|
||||
})
|
||||
} else if (index === 1) {
|
||||
} else if (value === 'sub') {
|
||||
uni.redirectTo({
|
||||
url: '/bundle/parten/pages/sub/sub'
|
||||
})
|
||||
} else if (index === 2) {
|
||||
} else if (value === 'my') {
|
||||
uni.redirectTo({
|
||||
url: '/bundle/parten/pages/my/my'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user