Authored by ccbikai

首页问题修改

... ... @@ -53,7 +53,8 @@ exports.index = (req, res, next) => {
title: 'Yoho!Buy 有货',
searchUrl: helpers.urlFormat('/', null, 'search'),
pageFooter: true,
channelList: result[0],
channelList: result[0].channelList,
yohood: result[0].yohood,
background: result[1]
});
}).catch(next);
... ...
... ... @@ -174,18 +174,20 @@ const getChannelList = () => {
if (result && result.code === 200) {
const list = {};
list.channelList = [];
list.yohood = {};
result.data.list = camelCase(result.data.list || []);
_.forEach(result.data.list, function(item) {
const channel = channelList[item.channelId];
const channel = channelList[item.yhChannel];
if (channel) {
list[item.channelId] = channelList[item.channelId];
list.channelList.push(channelList[item.yhChannel]);
}
if (_.toNumber(item.channelId) === 5) {
list.showYohood = true;
list.yohoodHref = 'http://yohood.cn';
if (_.toNumber(item.yhChannel) !== 5) {
list.yohood.showYohood = true;
list.yohood.yohoodHref = 'http://yohood.cn';
}
});
return Object.keys(list).length ? list : channelList;
... ...
... ... @@ -24,9 +24,11 @@
<span class="iconfont right-icon">&#xe614;</span>
</a>
{{/each}}
{{#showYohood}}
<a href="{{yohoodHref}}" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a>
{{/showYohood}}
{{#yohood}}
{{#if showYohood}}
<a href="{{yohoodHref}}" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a>
{{/if}}
{{/yohood}}
</div>
</div>
</div>
... ...