Authored by 王水玲

店铺装修 搜索页入口修改

{{# shopEntry}}
<div class="shop-entry clearfix">
<a class="pull-left" href="{{home}}">
<img class="logo" src="{{logo}}">
</a>
<div class="shop-entry-area">
{{# shopEntry}}
<div class="shop-entry clearfix">
<a class="pull-left" href="{{home}}">
<img class="logo" src="{{logo}}">
</a>
<div class="name pull-left">
<a class="shop-name" href="{{home}}">{{shopName}}</a>
<p class="sorts">
{{#each sort}}
<a href="{{href}}">{{name}}</a>
<div class="name pull-left">
<a class="shop-name" href="{{home}}">{{shopName}}</a>
<p class="sorts">
{{#each sort}}
<a href="{{href}}">{{name}}</a>
{{#unless @last}}
/
{{/unless}}
{{/each}}
</p>
</div>
{{#unless @last}}
/
{{/unless}}
{{/each}}
</p>
</div>
<a class="entry-btn pull-right" href="{{home}}">
进入品牌店铺
<span class="iconfont">&#xe601;</span>
</a>
</div>
{{/ shopEntry}}
<a class="entry-btn pull-right" href="{{home}}">
进入品牌店铺
<span class="iconfont">&#xe601;</span>
</a>
</div>
{{/ shopEntry}}
</div>
\ No newline at end of file
... ...
... ... @@ -24,6 +24,31 @@ lazyLoad($('img.lazy'));
* @num 每列存放商品的个数
*/
exports.init = function(num) {
var $shopEntry = $('.shop-entry'),
$shopEntryArea = $('.shop-entry-area'),
shopEntryLen = $shopEntry.length;
if (shopEntryLen > 0) {
if(shopEntryLen % 3 === 1) {
$shopEntry.eq(shopEntryLen-1).css({
width: '100%'
});
} else if (shopEntryLen % 3 === 2) {
$shopEntry.eq(shopEntryLen-1).css({
width: '49%'
});
$shopEntry.eq(shopEntryLen-2).css({
width: '49%'
});
}
$('.shop-entry:nth-child(3n+1)').css({
marginLeft: 0
});
$shopEntryArea.show();
}
productList = null;
... ...
.shop-entry-area {
width: 100%;
height: auto;
overflow: hidden;
display: none;
.shop-entry:first-child {
margin-left: 0;
}
}
.shop-entry {
position: relative;
background: #f5f7f6;
border: 1px solid #eaeceb;
padding: 12px 15px;
margin-bottom: 10px;
width: 32%;
box-sizing: border-box;
float: left;
margin: 0 0 10px 2%;
.logo {
width: 80px;
... ...