|
@@ -1,6 +1,16 @@
|
|
<template>
|
|
<template>
|
|
<div id="newsList">
|
|
<div id="newsList">
|
|
- <list-detail :menuList="menu" :info="site" :backColor="backColor" :Color="Color" :newsList="newsList" :sideMenu="sideMenu" :title="title"></list-detail>
|
|
|
|
|
|
+ <list-detail
|
|
|
|
+ :menuList="menu"
|
|
|
|
+ :info="site"
|
|
|
|
+ :backColor="backColor"
|
|
|
|
+ :Color="Color"
|
|
|
|
+ :newsList="newsList"
|
|
|
|
+ :sideMenu="sideMenu"
|
|
|
|
+ :title="title"
|
|
|
|
+ @search="toGetNews"
|
|
|
|
+ :total="total"
|
|
|
|
+ ></list-detail>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -34,6 +44,7 @@ export default {
|
|
backColor: '#0457c7',
|
|
backColor: '#0457c7',
|
|
Color: '#0457c7',
|
|
Color: '#0457c7',
|
|
newsList: [],
|
|
newsList: [],
|
|
|
|
+ total: 0,
|
|
menu: [],
|
|
menu: [],
|
|
sideMenu: [],
|
|
sideMenu: [],
|
|
site: {},
|
|
site: {},
|
|
@@ -145,13 +156,14 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//请求数据
|
|
//请求数据
|
|
- async toGetNews() {
|
|
|
|
- let result = await this.getNews({ type: 'list', data: { parent_id: this.id } });
|
|
|
|
|
|
+ async toGetNews({ skip = 0, limit = 8 } = {}) {
|
|
|
|
+ let result = await this.getNews({ type: 'list', data: { parent_id: this.id, skip: skip, limit: limit } });
|
|
if (result.errcode === 0) {
|
|
if (result.errcode === 0) {
|
|
let data = result.data;
|
|
let data = result.data;
|
|
for (const item of data) {
|
|
for (const item of data) {
|
|
let info = await this.getNews({ type: 'fetch', data: { id: item.id } });
|
|
let info = await this.getNews({ type: 'fetch', data: { id: item.id } });
|
|
if (info.errcode === 0) item.content = info.data.content;
|
|
if (info.errcode === 0) item.content = info.data.content;
|
|
|
|
+ this.$set(this, `total`, result.total);
|
|
}
|
|
}
|
|
this.$set(this, `newsList`, result.data);
|
|
this.$set(this, `newsList`, result.data);
|
|
}
|
|
}
|