...
|
...
|
@@ -25,9 +25,8 @@ export default { |
|
|
}
|
|
|
return result;
|
|
|
},
|
|
|
async fetchArticleProductFavs({ commit }, { articles }) {
|
|
|
const products = [],
|
|
|
ufoProducts = [];
|
|
|
async fetchArticleProductFavs({commit}, {articles}) {
|
|
|
const products = [], ufoProducts = [];
|
|
|
|
|
|
articles.forEach(article => {
|
|
|
get(article, 'productList', []).forEach(product => {
|
...
|
...
|
@@ -49,30 +48,24 @@ export default { |
|
|
if (!result.data) {
|
|
|
result.data = [];
|
|
|
}
|
|
|
commit(Types.FETCH_ARTICLE_PRODUCT_SUCCESS, {
|
|
|
articles,
|
|
|
favs: result.data,
|
|
|
articleProductType: 1
|
|
|
});
|
|
|
commit(Types.FETCH_ARTICLE_PRODUCT_SUCCESS, {articles, favs: result.data, articleProductType: 1});
|
|
|
}
|
|
|
}
|
|
|
if (ufoProducts.length) {
|
|
|
const result = await this.$api.get('/api/ufo/user/isFavoriteBatch', {
|
|
|
productIds: ufoProducts.join(',')
|
|
|
productIds: ufoProducts.join(','),
|
|
|
});
|
|
|
|
|
|
commit(Types.FETCH_ARTICLE_PRODUCT_SUCCESS, {
|
|
|
articles,
|
|
|
favs: result.data,
|
|
|
articleProductType: 2
|
|
|
});
|
|
|
if (result.code === 200) {
|
|
|
if (!result.data) {
|
|
|
result.data = [];
|
|
|
}
|
|
|
commit(Types.FETCH_ARTICLE_PRODUCT_SUCCESS, {articles, favs: result.data, articleProductType: 2});
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
async fetchArticleListByTopic(
|
|
|
{ commit, state },
|
|
|
{ labelId, limit = 5, page = 1 }
|
|
|
) {
|
|
|
commit(Types.FETCH_ARTICLE_TOPIC_REQUEST, { page });
|
|
|
async fetchArticleListByTopic({commit, state}, {labelId, limit = 5, page = 1}) {
|
|
|
commit(Types.FETCH_ARTICLE_TOPIC_REQUEST, {page});
|
|
|
const result = await this.$api.get('/api/grass/labelRealtedArticleDetail', {
|
|
|
labelId,
|
|
|
limit,
|
...
|
...
|
@@ -101,7 +94,7 @@ export default { |
|
|
getRecommendProducts: [],
|
|
|
footer: {},
|
|
|
zanBar: {},
|
|
|
tagBar: []
|
|
|
tagBar: [],
|
|
|
};
|
|
|
|
|
|
const data = await this.$api.get('/api/guang/article/detail', {
|
...
|
...
|
|