Authored by 郝肖肖

资源位

... ... @@ -47,11 +47,14 @@ const getResources = (params) => {
'operations/api/v5/resource/get',
Object.assign(params)
).then(result => {
let data = {};
let data = {
goods: {},
recommend_content_five: {}
};
let list = {};
if (result.code !== 200) {
return data2;
return data;
}
_.forEach(result.data, (res, index) => {
... ... @@ -74,7 +77,6 @@ const getResources = (params) => {
data[res.template_name] = [];
}
list = {
title: res.data.title,
moreUrl: res.data.more_url,
... ... @@ -91,17 +93,22 @@ const getResources = (params) => {
more_name: res.data.more_name,
data: res.data.image
};
data[res.template_name].push(list);
if (res.data.title.name === '热门商品') {
data.goods.title = list;
} else if (res.data.title.name === '热门品类') {
data.recommend_content_five.title = list;
}
break;
case 'recommend_content_five':
data[res.template_name].data = res.data;
break;
case 'goods':
data[res.template_name].data = res.data;
break;
}
});
// console.log(data, '=data===');
return data2;
return data;
});
};
... ...
... ... @@ -14,7 +14,9 @@
<div class="resources">
<!--banner-->
{{> resources/banner-top}}
{{#each result.focus1.data}}
{{> resources/banner-top}}
{{/each}}
<div class="header-title">
新品抢先看
... ...