zj
2024-06-03 96140d8eb2531144828dffe2ad8c19d0d9431009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<template>
  <van-tabbar
    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: 'financialManagement',
      }"
    >
      <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>
</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: {},
    };
  },
  mounted() {
    this.home = {
      active: require(`../../assets/theme/${this.theme}/image/footer/home1.png`),
      inactive: require(`../../assets/theme/${this.theme}/image/footer/home2.png`),
    };
    this.qoutes = {
      active: require(`../../assets/theme/${this.theme}/image/footer/quotes1.png`),
      inactive: require(`../../assets/theme/${this.theme}/image/footer/quotes2.png`),
    };
    this.trade = {
      active: require(`../../assets/theme/${this.theme}/image/footer/trade1.png`),
      inactive: require(`../../assets/theme/${this.theme}/image/footer/trade2.png`),
    };
    this.contract = {
      active: require(`../../assets/theme/${this.theme}/image/footer/contract1.png`),
      inactive: require(`../../assets/theme/${this.theme}/image/footer/contract2.png`),
    };
    this.funds = {
      active: require(`../../assets/theme/${this.theme}/image/footer/funds1.png`),
      inactive: require(`../../assets/theme/${this.theme}/image/footer/funds2.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: 56px;
  width: 56px;
}
 
::v-deep .van-tabbar-item__icon {
  margin-bottom: 9px;
}
 
::v-deep .van-tabbar-item__text {
  text-align: center;
}
 
.bgFooter {
  ::v-deep .van-tabbar-item--active {
    @include themify() {
      background: themed("footer_background");
    }
  }
 
  ::v-deep .van-tabbar-item--active {
    @include themify() {
      color: themed("color_main") !important;
    }
  }
}
 
.bg-night {
  ::v-deep .van-tabbar-item--active {
    background: $night;
  }
}
</style>