|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<!-- 底部横条 -->
|
|
|
- <div class="nav-bar van-hairline--top">
|
|
|
+ <!-- <div class="nav-bar van-hairline--top">
|
|
|
<ul class="nav-list">
|
|
|
<router-link class="nav-list-item active" to="home">
|
|
|
<div class="nbicon">
|
|
@@ -31,11 +31,19 @@
|
|
|
<span>{{$t('navBar.personalCenter')}}</span>
|
|
|
</router-link>
|
|
|
</ul>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+ <!-- <div> -->
|
|
|
+ <van-tabbar v-model="active" active-color="#4d6add" inactive-color="#404d74">
|
|
|
+ <van-tabbar-item replace name="home" to="home" icon="home-o">{{ $t('navBar.homePage') }}</van-tabbar-item>
|
|
|
+ <van-tabbar-item replace name="device" to="device" icon="setting-o">{{ $t('navBar.deviceInformation') }}</van-tabbar-item>
|
|
|
+ <van-tabbar-item replace name="robotranking" to="robotranking" icon="bar-chart-o">{{ $t('navBar.machineRanking') }}</van-tabbar-item>
|
|
|
+ <van-tabbar-item replace name="user" to="user" icon="friends-o">{{ $t('navBar.personalCenter') }}</van-tabbar-item>
|
|
|
+ </van-tabbar>
|
|
|
+ <!-- </div> -->
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { onMounted, computed } from "vue";
|
|
|
+import { onMounted, computed, ref } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
import homeUrl from "@/assets/navbarLogo/home.png";
|
|
|
import homeActiveUrl from "@/assets/navbarLogo/homeActive.png";
|
|
@@ -45,10 +53,11 @@ import rankingUrl from "@/assets/navbarLogo/ranking.png";
|
|
|
import rankingActiveUrl from "@/assets/navbarLogo/rankingActive.png";
|
|
|
import userUrl from "@/assets/navbarLogo/user.png";
|
|
|
import userActiveUrl from "@/assets/navbarLogo/userActive.png";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
|
|
|
export default {
|
|
|
setup() {
|
|
|
- // const route = useRoute()
|
|
|
+ const router = useRouter()
|
|
|
const store = useStore();
|
|
|
onMounted(() => {
|
|
|
// const token = getLocal('token')
|
|
@@ -56,10 +65,15 @@ export default {
|
|
|
// if (token && !['/home', '/category'].includes(path)) {
|
|
|
// store.dispatch('updateCart')
|
|
|
// }
|
|
|
+
|
|
|
});
|
|
|
const count = computed(() => {
|
|
|
return store.state.cartCount;
|
|
|
});
|
|
|
+ const active = ref('home');
|
|
|
+ router.afterEach(()=>{
|
|
|
+ active.value = router.currentRoute.value.name;
|
|
|
+ })
|
|
|
|
|
|
return {
|
|
|
count,
|
|
@@ -70,7 +84,8 @@ export default {
|
|
|
rankingUrl,
|
|
|
rankingActiveUrl,
|
|
|
userUrl,
|
|
|
- userActiveUrl
|
|
|
+ userActiveUrl,
|
|
|
+ active,
|
|
|
};
|
|
|
},
|
|
|
};
|
|
@@ -78,47 +93,70 @@ export default {
|
|
|
|
|
|
<style lang="less" scoped >
|
|
|
@import "../common/style/mixin";
|
|
|
-.nav-bar {
|
|
|
- position: fixed;
|
|
|
- left: 0;
|
|
|
- bottom: 0;
|
|
|
- width: 100%;
|
|
|
- padding: 5px 0;
|
|
|
- z-index: 1000;
|
|
|
- background: #fff;
|
|
|
- transform: translateZ(0);
|
|
|
- -webkit-transform: translateZ(0);
|
|
|
- .nav-list {
|
|
|
- width: 100%;
|
|
|
- .fj();
|
|
|
- flex-direction: row;
|
|
|
- padding: 0;
|
|
|
- .navIconImage { width: 22px; height: 22px; }
|
|
|
- .dailyImage { display: inline-block; }
|
|
|
- .activeImage { display: none; }
|
|
|
- .nav-list-item {
|
|
|
- display: flex;
|
|
|
- flex: 1;
|
|
|
- flex-direction: column;
|
|
|
- text-align: center;
|
|
|
- color: #666;
|
|
|
- &.router-link-active {
|
|
|
- color: rgba(77,106,221,1);
|
|
|
- .dailyImage { display: none; }
|
|
|
- .activeImage { display: inline-block; }
|
|
|
- }
|
|
|
- i {
|
|
|
- text-align: center;
|
|
|
- font-size: 22px;
|
|
|
- }
|
|
|
- span {
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
- .van-icon-shopping-cart-o {
|
|
|
- margin: 0 auto;
|
|
|
- margin-bottom: 2px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
+// .nav-bar {
|
|
|
+// position: fixed;
|
|
|
+// left: 0;
|
|
|
+// bottom: 0;
|
|
|
+// width: 100%;
|
|
|
+// padding: 5px 0;
|
|
|
+// z-index: 1000;
|
|
|
+// background: #fff;
|
|
|
+// transform: translateZ(0);
|
|
|
+// -webkit-transform: translateZ(0);
|
|
|
+
|
|
|
+// .nav-list {
|
|
|
+// width: 100%;
|
|
|
+// .fj();
|
|
|
+// flex-direction: row;
|
|
|
+// padding: 0;
|
|
|
+
|
|
|
+// .navIconImage {
|
|
|
+// width: 22px;
|
|
|
+// height: 22px;
|
|
|
+// }
|
|
|
+
|
|
|
+// .dailyImage {
|
|
|
+// display: inline-block;
|
|
|
+// }
|
|
|
+
|
|
|
+// .activeImage {
|
|
|
+// display: none;
|
|
|
+// }
|
|
|
+
|
|
|
+// .nav-list-item {
|
|
|
+// display: flex;
|
|
|
+// flex: 1;
|
|
|
+// flex-direction: column;
|
|
|
+// text-align: center;
|
|
|
+// color: #666;
|
|
|
+
|
|
|
+// &.router-link-active {
|
|
|
+// color: rgba(77, 106, 221, 1);
|
|
|
+
|
|
|
+// .dailyImage {
|
|
|
+// display: none;
|
|
|
+// }
|
|
|
+
|
|
|
+// .activeImage {
|
|
|
+// display: inline-block;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// i {
|
|
|
+// text-align: center;
|
|
|
+// font-size: 22px;
|
|
|
+// }
|
|
|
+
|
|
|
+// span {
|
|
|
+// font-size: 12px;
|
|
|
+// }
|
|
|
+
|
|
|
+// .van-icon-shopping-cart-o {
|
|
|
+// margin: 0 auto;
|
|
|
+// margin-bottom: 2px;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
</style>
|