zhaoxiaoqiang
2022-11-10 afd7bc9b1512074c5e09927852ae91b6a609827c
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
<!--
 * @Author: 小明丶
 * @Date: 2020-05-08 09:28:54
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-05-21 15:38:20
 * @Description: 
 -->
<template>
  <div class="home-page">
    <router-view></router-view>
    <van-tabbar v-model="active" active-color="#5194FE" inactive-color="#666666" route @change="onChange">
      <van-tabbar-item v-for="(item,index) in footerNav" :key="index" :to="item.to">
        <template #icon="props">
          <svg class="icon" aria-hidden="true" style="width:26px;height:26px;">
            <use v-if="props.active" :xlink:href="'#' + item.icon_h" />
            <use v-else :xlink:href="'#' + item.icon" />
          </svg>
        </template>
        <span>{{item.title}}</span>
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
import Vue from "vue";
import { Tabbar, TabbarItem } from "vant";
import { mapState } from "vuex";
Vue.use(Tabbar);
Vue.use(TabbarItem);
export default {
  data() {
    return {
      active: 0
    };
  },
  computed: {
    ...mapState(['footerNav']),
  },
  created() {
    if (window.location.search) {
      // 微信授权登录后返回此页面含有code及state值,将code值发到后端,以获取用户unionId关联电话
    }
  },
  methods: {
    onChange(){
      console.log(this.active)
    }
  }
};
</script>
<style lang="less" scoped>
</style>