liangjin
2021-04-01 006010711477c17f05de52f074a284e0184923b5
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
<!--
 * @Author: 小明丶
 * @Date: 2019-08-13 18:10:18
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-11-16 15:58:08
 * @Description:
 -->
<template>
    <div class="box home-tabbar ">
        <router-view></router-view>
        <van-tabbar route :active-color='$store.state.backColor' inactive-color='#CCCCCC'>
            <van-tabbar-item :to="item.path" v-for="(item, index) in footerNav" :key="index" :info="item.powerId ===100003 ? count : ''" @click="resetCount(item.powerId)">
                <span class="msgInfo" v-if="item.powerId ===300000 && msgCount.sum "></span>
                <template :active="index" class="van-tabbar-item__icon flex-center-g" v-slot:icon>
                    <svg class="icon" aria-hidden="true"  style="width:24px;height:24px;" :style="{fill:$store.state.backColor}">
                        <use v-if="active === item.powerId" :xlink:href="'#' + item.icon"></use>
                        <!--<use v-else xlink:href="#iconchanpin"></use>-->
                        <use v-else :xlink:href="'#' + item.Aicon"></use>
                    </svg>
                </template>
                {{item.label}}
            </van-tabbar-item>
        </van-tabbar>
    </div>
</template>
 
<script>
    import {
        mapState, mapGetters, mapActions
    } from 'vuex';
    export default {
        data() {
            return {
                count: '',
                active:this.$route.meta.powerId || ''
            }
        },
        computed: {
            ...mapState(['footerNav','msgCount']),
            ...mapGetters(['orgType']),
            
        },
        created() {
            this.init()
            this.getCount()
        },
        methods: {
            ...mapActions(['getCount']),
            resetCount(id){
                this.active = id;
                // if(id===100003){
                //     this.count = '';
                // }
            },
            
            init() {
                // 代理和渠道角色才会调用
                if(this.orgType===1 || this.orgType ===2){
                    this.$api.getUnAuditNb().then((res) => {
                        this.count = res.body.unAuditNb || '';
                    }).catch((err) => {
 
                    });
                }
            },
        },
 
    }
</script>
 
<style lang="less" scoped>
    .box {
        background-color: @c-f5;
        min-height: 100vh;
        //padding-bottom: 44px;
    }
    .msgInfo{
        width:7px;
        height:7px;
        background:rgba(255,102,102,1);
        color: #fff;
        border-radius:50%;
        position: absolute;
        right: 34%;
        top: 3px;
    }
 
 
 
</style>