|
@@ -47,11 +47,14 @@ const getResources = (params) => { |
|
@@ -47,11 +47,14 @@ const getResources = (params) => { |
47
|
'operations/api/v5/resource/get',
|
47
|
'operations/api/v5/resource/get',
|
48
|
Object.assign(params)
|
48
|
Object.assign(params)
|
49
|
).then(result => {
|
49
|
).then(result => {
|
50
|
- let data = {};
|
50
|
+ let data = {
|
|
|
51
|
+ goods: {},
|
|
|
52
|
+ recommend_content_five: {}
|
|
|
53
|
+ };
|
51
|
let list = {};
|
54
|
let list = {};
|
52
|
|
55
|
|
53
|
if (result.code !== 200) {
|
56
|
if (result.code !== 200) {
|
54
|
- return data2;
|
57
|
+ return data;
|
55
|
}
|
58
|
}
|
56
|
|
59
|
|
57
|
_.forEach(result.data, (res, index) => {
|
60
|
_.forEach(result.data, (res, index) => {
|
|
@@ -74,7 +77,6 @@ const getResources = (params) => { |
|
@@ -74,7 +77,6 @@ const getResources = (params) => { |
74
|
data[res.template_name] = [];
|
77
|
data[res.template_name] = [];
|
75
|
}
|
78
|
}
|
76
|
|
79
|
|
77
|
-
|
|
|
78
|
list = {
|
80
|
list = {
|
79
|
title: res.data.title,
|
81
|
title: res.data.title,
|
80
|
moreUrl: res.data.more_url,
|
82
|
moreUrl: res.data.more_url,
|
|
@@ -91,17 +93,22 @@ const getResources = (params) => { |
|
@@ -91,17 +93,22 @@ const getResources = (params) => { |
91
|
more_name: res.data.more_name,
|
93
|
more_name: res.data.more_name,
|
92
|
data: res.data.image
|
94
|
data: res.data.image
|
93
|
};
|
95
|
};
|
94
|
- data[res.template_name].push(list);
|
96
|
+
|
|
|
97
|
+ if (res.data.title.name === '热门商品') {
|
|
|
98
|
+ data.goods.title = list;
|
|
|
99
|
+ } else if (res.data.title.name === '热门品类') {
|
|
|
100
|
+ data.recommend_content_five.title = list;
|
|
|
101
|
+ }
|
95
|
break;
|
102
|
break;
|
96
|
case 'recommend_content_five':
|
103
|
case 'recommend_content_five':
|
|
|
104
|
+ data[res.template_name].data = res.data;
|
97
|
break;
|
105
|
break;
|
98
|
case 'goods':
|
106
|
case 'goods':
|
|
|
107
|
+ data[res.template_name].data = res.data;
|
99
|
break;
|
108
|
break;
|
100
|
}
|
109
|
}
|
101
|
});
|
110
|
});
|
102
|
-
|
|
|
103
|
- // console.log(data, '=data===');
|
|
|
104
|
- return data2;
|
111
|
+ return data;
|
105
|
});
|
112
|
});
|
106
|
};
|
113
|
};
|
107
|
|
114
|
|