From ecba7403b8a5ecb4561ec11f0080c6e11d15f819 Mon Sep 17 00:00:00 2001 From: ronger Date: Tue, 23 Feb 2021 16:34:22 +0800 Subject: [PATCH] =?UTF-8?q?:bugs:=20=E4=BF=AE=E5=A4=8D=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E7=95=8C=E9=9D=A2,=E5=88=87=E6=8D=A2=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E4=B8=8D=E8=AF=B7=E6=B1=82=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- store/article.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/store/article.js b/store/article.js index 76c9218..fdad900 100644 --- a/store/article.js +++ b/store/article.js @@ -19,7 +19,8 @@ export const state = () => { detail: { fetching: false, data: {} - } + }, + topicUri: '' } } @@ -45,7 +46,6 @@ export const mutations = { clearDetailData(state, action) { state.detail.data = {} }, - // 更新文章阅读全文状态 updateDetailRenderedState(state, action) { Vue.set( @@ -59,6 +59,9 @@ export const mutations = { }, updateArticleSponsorCount(state, action) { state.detail.data.articleSponsorCount += action.sponsorNumber + }, + updateTopicUri(state, action) { + state.topicUri = action } } @@ -68,9 +71,12 @@ export const actions = { commit('updateListFetching', true) // 当前页判断 let currentData = JSON.parse(JSON.stringify(state)).list.data + let topicUri = JSON.parse(JSON.stringify(state)).topicUri if (Number(params.page) === currentData.pagination.currentPage) { - commit('updateListFetching', false) - return + if (topicUri && topicUri === params.topic_uri) { + commit('updateListFetching', false) + return + } } // 清空已有数据 commit('updateListData', getDefaultListData()) @@ -85,6 +91,7 @@ export const actions = { .then(response => { commit('updateListFetching', false); commit('updateListData', response); + commit('updateTopicUri', params.topic_uri || ''); }) .catch(error => { console.log(error);