Authored by biao

Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-blk into release/1.0

... ... @@ -247,6 +247,16 @@ const helpers = {
}
sorts = sorts[0].sub;
} else if (sorts && sorts.length > 1) {
_.forEach(sorts, s => {
_.forEach(s.sub, ss => {
if (q.misort && q.misort === ss.categoryId) {
ss.checked = true;
s.checked = true;
}
});
});
}
let matchPrice = false;
... ...
... ... @@ -12,6 +12,7 @@ const co = Promise.coroutine;
const camelCase = global.yoho.camelCase;
const BrandService = require('./brand-service');
const ShopApi = require('./shop-api');
const Search = require('../models/search');
const _ = require('lodash');
/**
... ... @@ -90,19 +91,27 @@ const ShopService = {
* 获取店铺二级分类
* @param shopId
*/
getShopSecondSorts(shopId) {
getShopSecondSorts(brandId, shopId) {
return co(function*() {
let data = yield ShopApi.getShopSorts(shopId);
if (data && data.code === 200) {
let sorts = camelCase(data.data);
let data = yield Search.queryAllSort({
brand: brandId,
shop: shopId,
small_sort: 0
});
let sortArray = [];
if (data && data.data) {
let sorts = camelCase(data.data.sort);
sorts.forEach(s => {
sortArray = sortArray.concat(s.sub);
});
return sorts.sort((a, b) => {
return a.sub.length >= b.sub.length;
sortArray = sortArray.sort((s1, s2) => {
return s2.count - s1.count;
});
} else {
return [];
}
return sortArray;
})();
},
... ... @@ -130,7 +139,7 @@ const ShopService = {
info.isFavorite = shopIntro.isFavorite === 'Y';
let shopData = yield Promise.all([ShopService.getShopDecorator(shopId),
ShopService.getShopSecondSorts(shopId)]);
ShopService.getShopSecondSorts(domainInfo.id, shopId)]);
let shopList = shopData[0];
let sorts = shopData[1];
let resources = resourceDataHandle(shopList.list);
... ...
... ... @@ -36,7 +36,7 @@
<div class="floor-header clearfix">
<h2 class="floor-title en-size">NEW ARRIVALS</h2>
<p class="floor-title zh-size">最新上架</p>
<a class="floor-more" href="{{@root.mores.new.href}}">MORE</a>
<a class="floor-more" href="{{@root.mores.new.url}}">MORE</a>
</div>
<div class="goods-wrap">
... ... @@ -60,7 +60,7 @@
<div class="floor-header clearfix">
<h2 class="floor-title en-size">HOT</h2>
<p class="floor-title zh-size">人气单品</p>
<a class="floor-more" href="{{@root.mores.hot.href}}">MORE</a>
<a class="floor-more" href="{{@root.mores.hot.url}}">MORE</a>
</div>
<div class="goods-wrap">
... ... @@ -69,6 +69,7 @@
<a href="/product/pro_{{productId}}_{{goodsId}}/{{cnAlphabet}}.html" target="_blank">
<img class="lazy thumb" data-original="{{src}}" style="display: block;">
</a>
<div class="desc-cover"></div>
<div class="desc">
<a class="name" href="" target="_blank">{{productName}}</a>
<p class="price">¥{{round salesPrice 2}}</p>
... ...
<div class="shop-sort">
<div class="all">所有商品</div>
<div class="sort-list">
<div><a href="{{@root.mores.all.href}}?gender=2,3">女装</a></div>
<div><a href="{{@root.mores.all.href}}?gender=1,3">男装</a></div>
<div><a href="{{@root.mores.all.url}}?gender=2,3">女装</a></div>
<div><a href="{{@root.mores.all.url}}?gender=1,3">男装</a></div>
{{# each banner.sorts}}
<div><a href="{{@root.mores.all.href}}?sort={{relationParameter.sort}}">{{categoryName}}</a></div>
<div><a href="{{@root.mores.all.url}}?misort={{sortId}}">{{sortName}}</a></div>
{{/ each}}
</div>
<div class="more"><a href="{{@root.mores.all.href}}">MORE</a></div>
<div class="more"><a href="{{@root.mores.all.url}}">MORE</a></div>
</div>
... ...
... ... @@ -131,17 +131,30 @@
display: inline-block;
width: 369px;
height: 495px;
margin: 0 9px;
margin: 10px 9px;
border-width: 1px;
.desc {
img {
height: 495px;
}
.desc-cover {
position: absolute;
bottom: 0;
width: 100%;
background-color: #000;
opacity: 0.6;
padding: 20px 0;
opacity: 0.2;
height: 100px;
z-index: 1;
}
.desc {
position: absolute;
bottom: 0;
width: 100%;
padding: 17px 0;
color: #fff;
z-index: 2;
}
}
... ...