<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>
|