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
| <template>
| <div class="bottom-nav">
| <div
| v-for="item in navItems"
| :key="item.path"
| class="nav-item"
| :class="{ active: $route.path === item.path }"
| @click="$router.push(item.path)"
| >
| <div class="nav-icon">
| <Icon :icon="item.icon" />
| </div>
| <span class="nav-label">{{ item.label }}</span>
| </div>
| </div>
| </template>
|
| <script setup lang="ts">
| import { useRoute } from 'vue-router'
| import { Icon } from '@iconify/vue'
|
| const route = useRoute()
|
| const navItems = [
| {
| path: '/',
| label: '首页',
| icon: 'solar:home-bold'
| },
| {
| path: '/market',
| label: '行情',
| icon: 'solar:graph-up-bold'
| },
| {
| path: '/trade',
| label: '交易',
| icon: 'solar:transfer-horizontal-bold'
| },
| {
| path: '/discover',
| label: '发现',
| icon: 'solar:compass-bold'
| },
| {
| path: '/wallet',
| label: '钱包',
| icon: 'solar:wallet-bold'
| }
| ]
| </script>
|
| <style lang="scss" scoped>
| @import '@/styles/variables.scss';
|
| .bottom-nav {
| position: fixed;
| bottom: 0;
| left: 0;
| right: 0;
| min-height: 70px;
| padding: 8px 0;
| background: #ffffff;
| border-top: 1px solid $border-light;
| display: flex;
| justify-content: space-around;
| align-items: center;
| z-index: 1000;
| padding-bottom: calc(8px + env(safe-area-inset-bottom));
| }
|
| .nav-item {
| display: flex;
| flex-direction: column;
| align-items: center;
| justify-content: center;
| flex: 1;
| cursor: pointer;
|
| &.active {
| .nav-label {
| color: $text-primary;
| font-weight: 600;
| }
| }
| }
|
| .nav-icon {
| width: 32px;
| height: 32px;
| margin-bottom: 4px;
| display: flex;
| align-items: center;
| justify-content: center;
| color: $text-tertiary;
|
| :deep(svg) {
| width: 32px;
| height: 32px;
| color: inherit;
| }
| }
|
| .nav-item.active .nav-icon {
| color: $primary;
| }
|
| .nav-label {
| font-size: $font-sm;
| color: $text-tertiary;
| }
| </style>
|
|