<template>
|
<van-tabbar style="background: #F5F5F5" route v-model="active" active-color="#1D91FF" fixed inactive-color="#868D9A" safe-area-inset-bottom
|
class="bgFooter">
|
<van-tabbar-item name="home" to="/home">
|
<span>{{ $t('首页') }}</span>
|
<template #icon="props">
|
<img :src="props.active ? home.active : home.inactive" alt="home"/>
|
</template>
|
</van-tabbar-item>
|
<van-tabbar-item name="quotes" :to="{ name: 'Quotes', query: { active: 2 } }">
|
<span>{{ $t('市场') }}</span>
|
<template #icon="props">
|
<img :src="props.active ? qoutes.active : qoutes.inactive" alt="Quotes"/>
|
</template>
|
</van-tabbar-item>
|
<van-tabbar-item name="/trade/btc" :to="{ name: 'Trade', params: { symbol: getStorage('tradeSymbol') || 'btc' } }">
|
<span>{{ $t('交易') }}</span>
|
<template #icon="props">
|
<img :src="props.active ? trade.active : trade.inactive" alt="trade"/>
|
</template>
|
</van-tabbar-item>
|
<van-tabbar-item name="perpetualContract/btc"
|
:to="{ name: 'perpetualContract', params: { symbol: getStorage('symbol') || 'btc' } }">
|
<span>{{ $t('合约') }}</span>
|
<template #icon="props">
|
<img :src="props.active ? contract.active : contract.inactive" alt="perpetualContract"/>
|
</template>
|
</van-tabbar-item>
|
<van-tabbar-item name="funds" to="/funds">
|
<span>{{ $t('资金') }}</span>
|
<template #icon="props">
|
<img :src="props.active ? funds.active : funds.inactive" alt="funds"/>
|
</template>
|
</van-tabbar-item>
|
<van-tabbar-item name="userCenter" to="/userCenter">
|
<span>{{ $t('个人中心') }}</span>
|
<template #icon="props">
|
<img :src="props.active ? user.active : user.inactive" alt="userCenter"/>
|
</template>
|
</van-tabbar-item>
|
</van-tabbar>
|
</template>
|
|
<script>
|
import {mapGetters} from 'vuex';
|
import {getStorage} from '@/utils/utis'
|
|
export default {
|
props: {
|
isActive: {
|
type: Boolean,
|
default: true
|
},
|
},
|
components: {},
|
computed: {
|
...mapGetters({
|
theme: 'home/theme'
|
}),
|
},
|
data() {
|
return {
|
getStorage,
|
active: 'home',
|
home: {},
|
qoutes: {},
|
trade: {},
|
contract: {},
|
funds: {},
|
user: {}
|
}
|
},
|
mounted() {
|
this.home = {
|
active: require(`../../assets/theme/${this.theme}/image/footer/img_1.png`),
|
inactive: require(`../../assets/theme/${this.theme}/image/footer/img.png`),
|
}
|
this.qoutes = {
|
active: require(`../../assets/theme/${this.theme}/image/footer/img_2.png`),
|
inactive: require(`../../assets/theme/${this.theme}/image/footer/img_3.png`),
|
}
|
this.trade = {
|
active: require(`../../assets/theme/${this.theme}/image/footer/img_4.png`),
|
inactive: require(`../../assets/theme/${this.theme}/image/footer/img_5.png`),
|
}
|
this.contract = {
|
active: require(`../../assets/theme/${this.theme}/image/footer/img_6.png`),
|
inactive: require(`../../assets/theme/${this.theme}/image/footer/img_7.png`),
|
}
|
this.funds = {
|
active: require(`../../assets/theme/${this.theme}/image/footer/img_8.png`),
|
inactive: require(`../../assets/theme/${this.theme}/image/footer/img_9.png`),
|
}
|
this.user = {
|
active: require(`../../assets/theme/${this.theme}/image/footer/img_11.png`),
|
inactive: require(`../../assets/theme/${this.theme}/image/footer/img_10.png`),
|
}
|
},
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import "../../assets/init.scss";
|
|
.van-tabbar--fixed {
|
z-index: 10;
|
padding-bottom: constant(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
}
|
|
.van-tabbar {
|
height: 108px;
|
font-size: 22px;
|
}
|
|
.van-tabbar-item__icon img {
|
height: 50px;
|
width: 50px;
|
}
|
|
::v-deep .van-tabbar-item__icon {
|
margin-bottom: 9px;
|
}
|
|
::v-deep .van-tabbar-item__text {
|
text-align: center;
|
font-size: 23px;
|
}
|
|
.bgFooter {
|
::v-deep .van-tabbar-item--active {
|
@include themify() {
|
background: themed("footer_background");
|
}
|
}
|
|
::v-deep .van-tabbar-item--active {
|
@include themify() {
|
color: rgb(196, 149, 2) !important;
|
}
|
}
|
}
|
|
.bg-night {
|
::v-deep .van-tabbar-item--active {
|
background: $night;
|
}
|
}
|
</style>
|