zj
2024-06-03 89d48809779ae41f8712539584798d5900b64b78
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
116
117
<template>
    <div>
        <div class="noticecontainer">
            <div class="notice_every">
                <div class="everylist" v-for="(item, index) in gonggaoList" :key="index">
                    <p>{{ item.title }}</p>
                    <p>{{ item.addTime | formatTime(that) }}</p>
                </div>
            </div>
            <div class="notice_every">
                <div class="everylist" v-for="(item, index) in noticeList" :key="index">
                    <p>{{ item.artTitle }}</p>
                    <p>{{ item.addTime | formatTime(that) }}</p>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import * as api from "@/axios/api";
export default {
    data() {
        return {
            pageNum: 1,
            pageSize: 20,
            gonggaoList: [],
            that: this,
            noticeList: []
        }
    },
    filters: {
        formatTime(value, that) {
            if (value) {
                return that.dayjs(value).format('YYYY-MM-DD HH:mm:ss')
            } else {
                return '--'
            }
        }
    },
    created() {
        this.getinit();
    },
    methods: {
        getinit() {
            this.getzixun();
            this.getnotice();
        },
        async getzixun() {
            var opt = {
                // stocktype: 'IN',
                pageNum: this.pageNum,
                pageSize: this.pageSize,
            };
            var data = await api.getNewsList(opt);
            this.gonggaoList = data.data.list;
        },
        async getnotice() {
            var opt = {
                pageNum: this.pageNum,
                pageSize: this.pageSize,
            };
            var data = await api.getArtList(opt);
            this.noticeList = data.data.list;
            this.$parent.getcloseLoading();
        }
    }
}
</script>
<style lang="less" scoped>
.noticecontainer {
    display: flex;
    align-items: center;
    justify-content: space-between;
 
    .notice_every {
        width: 50%;
        overflow-y: scroll;
        height: 208px;
        // margin: 20px;
 
        &::-webkit-scrollbar {
            width: 8px;
            height: 8px;
            background-color: rgb(37, 38, 42);
        }
 
        &::-webkit-scrollbar-track {
            background-color: rgb(37, 38, 42);
        }
 
        &::-webkit-scrollbar-thumb {
            background-color: rgb(37, 38, 42);
        }
 
        &::-webkit-scrollbar-corner {
            width: 8px;
            height: 8px;
            display: none;
        }
 
        .everylist {
            display: flex;
            justify-content: space-between;
            padding: 10px 20px;
            color: #c9c9c9;
            line-height: 1.5;
            cursor: pointer;
 
            p {
                &:first-child {
                    width: calc(100% - 140px);
                }
            }
        }
    }
}
</style>