wjt
2024-06-21 07401392be0115d291e64471325fcc4c17ba2be9
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
<template>
    <view class="padding-bottom">
        <policyIndexVue v-if="activeNumber == 0" :isJudge="isJudge" :userType="userInfo.userType" :userAuth="userAuth"></policyIndexVue>
        <minePage v-if="activeNumber == 1" :userInfo="userInfo" :roleGroup="roleGroup"></minePage>
        <tabsCom :activeNumber.sync="activeNumber"></tabsCom>
    </view>
</template>
 
<script>
    import {  getInfo } from '@/api/auth.js'
    import tabsCom from '@/policy/components/tabs.vue'
    import policyIndexVue from '@/policy/components/index.vue'
    import minePage from '@/policy/components/mine.vue'
    export default {
        components: {
            tabsCom,
            policyIndexVue,
            minePage
        },
        data() {
            return {
                isJudge: false,
                activeNumber: 0,
                userInfo: {},
                roleGroup: '',
                userAuth: false
            }
        },
        onShow() {
            this.getInfo()
        },
        methods: {
            getInfo() {
                getInfo().then(val =>{
                    
                    this.userInfo = val.data
                    
                    if(val.data.roles) {
                        this.isJudge = val.data.roles.some(item => item.includes('check_enforce'))
                        const value = val.data.roles.filter(item => !item.includes('check_enforce'))
                        if(value.length) {
                            this.userAuth = true
                        } else {
                            this.userAuth = false
                        }
                    }
                })
            },
            applyPulicy() {
                uni.navigateTo({
                    url: '/policy/policyApply/policyApply'
                })
            }
        }
    }
</script>
<style>
    page{
        background-color: #F7F7F7;
    }
</style>
<style scoped lang="scss">
@import "./policyIndex.scss";
</style>