...
|
...
|
@@ -44,7 +44,8 @@ export function getGlobalHomeResource(reload=false) { |
|
|
dispatch(getGlobalHomeResourceRequest(reload));
|
|
|
return new HomeService(app.serviceHost).getGlobalHomeResource()
|
|
|
.then(json => {
|
|
|
dispatch(getGlobalHomeResourceSuccess(json));
|
|
|
let data = parseProductList(json)
|
|
|
dispatch(getGlobalHomeResourceSuccess(data));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(getGlobalHomeResourceFailure(error));
|
...
|
...
|
@@ -52,6 +53,32 @@ export function getGlobalHomeResource(reload=false) { |
|
|
};
|
|
|
}
|
|
|
|
|
|
function parseProductList(json) {
|
|
|
|
|
|
let groupInfo = {};
|
|
|
let list = [];
|
|
|
let page = json.page;
|
|
|
let content_code = json.content_code;
|
|
|
let total = json.total;
|
|
|
let total_page = json.total_page;
|
|
|
|
|
|
let list_0 = json.list;
|
|
|
for (var i = 0; i < list_0.length; i++) {
|
|
|
list.push(list_0[i]);
|
|
|
if (list_0[i].template_name == 'paramsGroup') {
|
|
|
groupInfo = list_0[i];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
list,
|
|
|
page,
|
|
|
total,
|
|
|
total_page,
|
|
|
content_code,
|
|
|
groupInfo,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getGlobalProductListRequest() {
|
|
|
return {
|
...
|
...
|
|