dcc
2024-06-13 3616db170333df7d668c97323344335b52c4153c
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
<template>
    <div class="newShareSrecord">
        <header class="newShareSrecord-header">
            <div class="newShareSrecord-header-title" >
                <img v-if="uuid" src="@/assets/images/newShares/leftArrow.png" class="newShareSrecord-header-title-img" @click="goBack">
                <p class="fs-24 font-bold text-white">{{ t(`message.user.${navTitle}`) }}</p>
            </div>
            <div class="newShareSrecord-header-info">
                <button class="fs-14 text-white" @click="toPath(navSubtitle.path)" v-if="navSubtitle.title">{{ t(`message.user.${navSubtitle.title}`) }}</button>
            </div>
        </header>
        <div class="newShareSrecord-box">
            <router-view></router-view>
        </div>
    </div>
</template>
 
<script setup>
    import { useRoute , useRouter } from 'vue-router'
    import { useI18n } from "vue-i18n";
 
    const { t } = useI18n();
    const route = useRoute ();
    const router = useRouter()
    const navTitle = ref('chouqian')
    const navSubtitle = ref({
        title:'',
        path:'',
        type:1
    })
    const uuid = ref('')
    watch(route,(newVal)=>{
        const { title } = newVal.meta;
        const { id } = newVal.query;
        
        if(title){
            navTitle.value = title
        }
 
        if(id){
            uuid.value = id;
        }else{
            uuid.value = '';
        }
        
        switch (route.name) {
            // 抽签
            case 'draw':
                navSubtitle.value.title = 'chouqianjilu';
                navSubtitle.value.path = '/newShareSrecord/drawRecord';
                navSubtitle.value.type = 1;
                break;
            // 认缴
            case 'pay':
                navSubtitle.value.title = 'renjiaojilu';
                navSubtitle.value.path = '/newShareSrecord/payRecord';
                navSubtitle.value.type = 2;
                break;
            default:
                navSubtitle.value.title = '';
                navSubtitle.value.path = '';
                break;
        }
    },{immediate:true})
    
    const goBack = ()=>{
        router.go(-1)
    }
 
    const toPath = (path)=>{
        router.push({
            path,
            query:{
                id:uuid.value,
                // type:navSubtitle.value.type
            }
        })
    }
    
</script>
 
<style lang="scss" scoped>
    .newShareSrecord{
        width: 100%;
        .newShareSrecord-header{
            height:80px;
            background: #282A3A;
            padding: 0 360px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            .newShareSrecord-header-title{
                display: flex;
                align-items: center;
                .newShareSrecord-header-title-img{
                    width: 14px;
                    height: 24px;
                    margin-right: 18px;
                    cursor: pointer;
                }
            }
            .newShareSrecord-header-info{
                cursor: pointer;
            }
        }
        .newShareSrecord-box{
            min-height: 100vh;
            padding: 30px 360px;
            background: #191B28;
        }
    }
</style>