Authored by 郭成尧

shop-group-ok

... ... @@ -42,7 +42,13 @@ const _getShopGroup = (shopRawData) => {
shop_ids: shopRawData.defaultShopIds,
order: 'pools_id_asc' // pools_id_desc
}).then(result => {
shopRawData.renderData = _.get(result, 'data', []);
let renderData = _.get(result, 'data', []);
_.forEach(renderData, shop => {
shop.href = `//m.yohobuy.com/product/shop?domain=${shop.shop_domain}&openby:yohobuy={"action":"go.shop","params":{"shop_id":${shop.shops_id},"shop_template_type":${shop.shop_template_type},"is_red_shop":${shop.is_red_shop}}}`; // eslint-disable-line
});
shopRawData.renderData = renderData;
});
};
... ...
... ... @@ -87,25 +87,8 @@
{{/isEqualOr}}
{{#isEqualOr type 'shopGroup'}}
<div class="shop-container{{#isEqualOr displayStyle 0}} shop-two{{^}} shop-three{{/isEqualOr}}">
{{#renderData}}
{{#isEqualOr ../displayStyle 0}}
<div class="pull-left shop-box">
<div class="shop-img"><img src="{{image2 pic_popular w=187 h=275 q=95}}" alt=""></div>
<div class="shop-bottom-bar" style="background-image: url({{image2 shop_logo w=290 h=60 q=95}})">
<span class="shop-name">{{shop_name}}</span>
</div>
</div>
{{^}}
<div class="pull-left shop-box">
<div class="shop-img"><img src="{{image2 pic_popular w=187 h=275 q=95}}" alt=""></div>
<div class="shop-bottom-bar" style="background-image: url({{image2 shop_logo w=290 h=60 q=95}});">
<span class="shop-name">{{shop_name}}</span>
</div>
</div>
{{/isEqualOr}}
{{/renderData}}
</div>
{{!-- 店铺组 --}}
{{> feature/shop-group}}
{{/isEqualOr}}
{{#isEqualOr type 'productGroup'}}
... ...
<div class="shop-container{{#isEqualOr numOfOneRow '2'}} shop-two{{^}} shop-three{{/isEqualOr}}">
{{#renderData}}
{{#isEqualOr ../numOfOneRow '2'}}
<div class="pull-left shop-box">
<div class="shop-img">
<img class="left-icon" src="{{image2 ../lefTopImg q=95}}" alt="">
<img src="{{image2 pic_popular w=187 h=275 q=95}}" alt="">
</div>
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}} class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=95}})">
<span class="shop-name">{{shop_name}}</span>
</a>
</div>
{{^}}
<div class="pull-left shop-box">
<div class="shop-img">
<img class="left-icon" src="{{image2 ../lefTopImg q=95}}" alt="">
<img src="{{image2 pic_popular w=187 h=275 q=95}}" alt="">
</div>
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}} class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=95}});">
<span class="shop-name">{{shop_name}}</span>
</a>
</div>
{{/isEqualOr}}
{{/renderData}}
</div>
\ No newline at end of file
... ...
$two-margin-left: 20px;
$three-margin-left: 19.75px;
$margin-top: 42px;
$margin-left-2: 20px;
$margin-left-3: 19.75px;
$floor-height-2: 432px;
$floor-height-3: 335px;
$shop-width-2: 285px;
$shop-width-3: 187px;
.shop-container {
width: 100%;
... ... @@ -8,31 +13,60 @@ $three-margin-left: 19.75px;
float: left;
}
.shop-box > a {
display: block;
}
.shop-img {
position: relative;
> .left-icon {
width: 33.33%;
height: auto;
position: absolute;
left: 0;
top: 0;
}
}
&.shop-two {
padding-left: $two-margin-left;
padding-left: $margin-left-2;
height: $floor-height-2;
margin-top: $margin-top;
.shop-box {
width: 290px;
height: 600px;
margin-right: $two-margin-left;
width: $shop-width-2;
height: $floor-height-2;
margin-right: $margin-left-2;
.shop-img {
width: $shop-width-2;
height: 372px;
}
.shop-bottom-bar {
width: 290px;
width: $shop-width-2;
height: 60px;
line-height: 60px;
color: #fff;
background-size: 100% 100%;
background-repeat: no-repeat;
}
}
}
&.shop-three {
padding-left: $three-margin-left;
padding-left: $margin-left-3;
height: $floor-height-3;
margin-top: $margin-top;
.shop-box {
width: 187px;
height: 335px;
margin-right: $three-margin-left;
width: $shop-width-3;
height: $floor-height-3;
margin-right: $margin-left-3;
.shop-img {
width: 187px;
width: $shop-width-3;
height: 275px;
}
... ...