|
@@ -5,7 +5,14 @@ import Vue from 'vue'; |
|
@@ -5,7 +5,14 @@ import Vue from 'vue'; |
5
|
export default {
|
5
|
export default {
|
6
|
async fetchProductInfo({commit}, {productId}) {
|
6
|
async fetchProductInfo({commit}, {productId}) {
|
7
|
const queryTasks = ['', '/resource', '/activity', '/recommend'].map(path => {
|
7
|
const queryTasks = ['', '/resource', '/activity', '/recommend'].map(path => {
|
8
|
- return this.$api.get(`/api/ufo/product${path}`, {product_id: productId}).then(result => {
|
8
|
+ let params = {product_id: productId};
|
|
|
9
|
+
|
|
|
10
|
+ if (path === '/resource') {
|
|
|
11
|
+ params = {
|
|
|
12
|
+ content_code: '05e4f5782dfc3a5e10d39b8f04a7dcb9',
|
|
|
13
|
+ };
|
|
|
14
|
+ }
|
|
|
15
|
+ return this.$api.get(`/api/ufo/product${path}`, params).then(result => {
|
9
|
if (result.code === 200) {
|
16
|
if (result.code === 200) {
|
10
|
return result.data;
|
17
|
return result.data;
|
11
|
} else {
|
18
|
} else {
|
|
@@ -14,10 +21,12 @@ export default { |
|
@@ -14,10 +21,12 @@ export default { |
14
|
});
|
21
|
});
|
15
|
});
|
22
|
});
|
16
|
|
23
|
|
17
|
- const [detail, resource, activity, recommend] = await Promise.all(queryTasks);
|
24
|
+ let [detail, resource, activity, recommend] = await Promise.all(queryTasks);
|
|
|
25
|
+
|
|
|
26
|
+ resource = get(resource, '[0].data[0]', null);
|
18
|
|
27
|
|
19
|
commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(detail.product_info, {
|
28
|
commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(detail.product_info, {
|
20
|
- resource: get(resource, '[0].data[0]', null),
|
29
|
+ resource,
|
21
|
activity: activity || [],
|
30
|
activity: activity || [],
|
22
|
recommend: recommend && recommend.product_list || [],
|
31
|
recommend: recommend && recommend.product_list || [],
|
23
|
}));
|
32
|
}));
|