...
|
...
|
@@ -11,6 +11,7 @@ export default function() { |
|
|
page: 0,
|
|
|
limit: 10,
|
|
|
totalPage: 0,
|
|
|
isMoreData: true,
|
|
|
},
|
|
|
newsDeatilList: {
|
|
|
list: [],
|
...
|
...
|
@@ -18,6 +19,7 @@ export default function() { |
|
|
page: 0,
|
|
|
limit: 10,
|
|
|
totalPage: 0,
|
|
|
isMoreData: true,
|
|
|
}
|
|
|
},
|
|
|
mutations: {
|
...
|
...
|
@@ -25,12 +27,14 @@ export default function() { |
|
|
state.newsList.list = state.newsList.list.concat(list.list);
|
|
|
state.newsList.page = list.page;
|
|
|
state.newsList.totalPage = list.totalPage;
|
|
|
list.page < list.totalPage ? state.newsList.isMoreData = true : state.newsList.isMoreData = false;
|
|
|
},
|
|
|
|
|
|
[Types.FETCH_NEWSDETAIL_LIST](state, { list }) {
|
|
|
state.newsDeatilList.list = list.page > 1 ? state.newsDeatilList.list.concat(list.list) : list.list;
|
|
|
state.newsDeatilList.page = list.page;
|
|
|
state.newsDeatilList.totalPage = list.totalPage;
|
|
|
list.page < list.totalPage ? state.newsDeatilList.isMoreData = true : state.newsDeatilList.isMoreData = false;
|
|
|
},
|
|
|
|
|
|
[Types.FETCH_NEWS_TAB_LIST](state, { list }) {
|
...
|
...
|
@@ -39,7 +43,6 @@ export default function() { |
|
|
},
|
|
|
actions: {
|
|
|
async fetchNewsList({ commit, state }, obj) {
|
|
|
console.log(obj);
|
|
|
let page = state.newsList.page + 1;
|
|
|
let limit = state.newsList.limit;
|
|
|
let totalPage = state.newsList.totalPage;
|
...
|
...
|
@@ -49,7 +52,7 @@ export default function() { |
|
|
// 页面跳转重置page页码
|
|
|
isPage ? page = 1 : state.newsList.page + 1;
|
|
|
const result = await this.$api.post('/api/ufo/home/newsList', {
|
|
|
page, type, limit, uid: 500031928
|
|
|
page, type: type || '', limit, uid: 500031928
|
|
|
});
|
|
|
|
|
|
if (result.code === 200) {
|
...
|
...
|
|