Authored by 王水玲

sale

... ... @@ -48,6 +48,28 @@ const processSpecial = (list) => {
};
/**
* 断码区分类数据处理
*/
const processBreakingSort = (list) => {
const formatData = {};
const sortName = [];
const sub = [];
list = list || [];
list = camelCase(list);
_.forEach(list, (data) => {
sortName.push(data.sortName);
sub.push(data.sub);
});
formatData.sortName = sortName;
formatData.sub = sub;
return formatData;
}
/**
* 商品搜索数据处理
*/
const processSearch = () => {
... ... @@ -130,7 +152,7 @@ const getBreakingSort = (yhChannel) => {
yh_channel: yhChannel || '1'
})).then((result) => {
if (result && result.code === 200) {
return result.data;
return processBreakingSort(result.data);
} else {
logger.error('断码区分类接口返回 code 不是 200');
return {};
... ...
... ... @@ -6,7 +6,33 @@
{{/if}}
{{/content}}
<ul id="list-nav" class="list-nav clearfix">
{{# nav}}
<ul id="list-nav" class="list-nav clearfix">
{{# sortName}}
<li {{#if @first}} class="active" {{/if}}>
<a href="javascript:void(0);">
<span class="span-test">{{.}}</span>
</a>
</li>
{{/ sortName}}
<li class="filter">
<a href="javascript:void(0);">
<span class="span-test">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
<div class="swiper-container" id="size-swiper">
<ul class="swiper-wrapper">
{{# sub}}
{{log this}}
<li class="swiper-slide" data-id="{{sizeId}}">{{sizeName}}</li>
{{/ sub}}
</ul>
</div>
{{/ nav}}
{{!-- <ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
<span class="span-test">上装</span>
... ... @@ -27,14 +53,9 @@
<span class="span-test">其他</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
<span class="span-test">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
<div class="swiper-container" id="size-swiper">
</ul> --}}
{{!-- <div class="swiper-container" id="size-swiper">
<ul class="swiper-wrapper">
<li class="swiper-slide on">XS码</li>
<li class="swiper-slide">S码</li>
... ... @@ -48,7 +69,7 @@
<li class="swiper-slide">XL码</li>
<li class="swiper-slide">XXL码</li>
</ul>
</div>
</div> --}}
<div id="goods-container" class="goods-container">
... ...