3
tj
2025-05-22 14764dd7679369a650ad1d60be62aacc863755a1
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
<template>
    <view class="footer flex customer-footer flex-wrap-normal" style="">
        <view v-for="(item, index) in tabBar" :key="index" class="footer-item">
            <!-- <view class="item" :class="flg == index ? 'cur' : ''" @click="go(index, item)"> -->
            <view class="item" :class="currentIndex === index ? 'cur' : ''" @click="go(index, item)">
 
            <!-- <view v-if="index==0">
                    <image src="../../static/images/customer/footer/footer-home-1.png" class="footer-icon"
                        v-if="flg==0"></image>
                    <image src="../../static/images/customer/footer/footer-home-0.png" class="footer-icon"
                        v-if="flg!=0"></image>
                </view>
                <view v-if="index==1">
                    <image src="../../static/images/customer/footer/footer-trade-1.png" class="footer-icon"
                        v-if="flg==1"></image>
                    <image src="../../static/images/customer/footer/footer-trade-0.png" class="footer-icon"
                        v-if="flg!=1"></image>
                </view>
                <view v-if="index==2">
                    <image src="../../static/images/customer/footer/footer-shopping-1.png" class="footer-icon"
                        v-if="flg==2">
                    </image>
                    <image src="../../static/images/customer/footer/footer-shopping-0.png" class="footer-icon"
                        v-if="flg!=2">
                    </image>
                </view>
                <view v-if="index==3">
                    <image src="../../static/images/customer/footer/footer-self-1.png" class="footer-icon"
                        v-if="flg==3"></image>
                    <image src="../../static/images/customer/footer/footer-self-0.png" class="footer-icon"
                        v-if="flg!=3"></image>
                </view> -->
 
            <view>
                {{ item.text }}
            </view>
 
        </view>
    </view>
 
 
    </view>
</template>
<script>
export default {
    data() {
        return {
            tabBar: [{
 
                "text": "首页",
                "pagePath": '/pages/home/home'
            },
            {
 
                "text": "影视地图",
                "pagePath": '/sub-pages/film-map/index'
            },
            {
 
                "text": "我的种草",
                "pagePath": '/sub-pages/customer/shopping/shopping'
            },
            {
                "text": "社区",
                "pagePath": '/sub-pages/community/index'
            },
            {
                "text": "我的",
                "pagePath": '/sub-pages/mine/index'
            }
            ]
        }
    },
    props: {
        flg: {
            type: String,
        },
        bussincess: {
            type: Boolean,
            default() {
                return false
            }
        }
    },
    created() { },
    computed: {
        currentPath() {
            const pages = getCurrentPages();
            const currentPage = pages[pages.length - 1];
            return '/' + currentPage.route;
        },
        currentIndex() {
            return this.tabBar.findIndex(item => this.normalizePath(item.pagePath) === this.normalizePath(this.currentPath));
        }
    },
    methods: {
        normalizePath(path) {
            return path.replace(/^\/+/, '/');
        },
        go(index, item) {
 
            // uni.navigateTo({
            //         url: item.pagePath
            //     })
            uni.reLaunch({
                url: item.pagePath
            })
 
        },
    }
}
</script>
<style lang="scss">
@import "./main.scss";
</style>