...
|
...
|
@@ -8,7 +8,7 @@ export default { |
|
|
return state.products[productId];
|
|
|
},
|
|
|
async fetchProductInfo({ commit, state }, { productId }) {
|
|
|
const queryTasks = ['', '/resource', '/activity', '/recommend'].map(path => {
|
|
|
const queryTasks = ['', '/resource', '/activity', '/recommend', '/limit/info'].map(path => {
|
|
|
let params = { product_id: productId };
|
|
|
|
|
|
if (path === '/resource') {
|
...
|
...
|
@@ -25,14 +25,16 @@ export default { |
|
|
});
|
|
|
});
|
|
|
|
|
|
let [detail, resource, activity, recommend] = await Promise.all(queryTasks);
|
|
|
let [detail, resource, activity, recommend, limitInfo] = await Promise.all(queryTasks);
|
|
|
|
|
|
resource = get(resource, '[0].data[0]', {});
|
|
|
|
|
|
commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(detail.product_info, {
|
|
|
|
|
|
const {product_info = {}} = detail || {};
|
|
|
commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(product_info, {
|
|
|
resource,
|
|
|
activity: activity || [],
|
|
|
recommend: recommend && recommend.product_list || [],
|
|
|
limitInfo: limitInfo || {}
|
|
|
}));
|
|
|
},
|
|
|
async fetchRecommendProduct({ commit }, { productId }) {
|
...
|
...
|
|