Authored by 毕凯

搜索结果店铺个数

... ... @@ -109,7 +109,7 @@ class HelperSearch
/**
* 将接口返回的数据($data)组合成模板需要的格式
*
*
* @param array $data array(
* 'product' => array (接口得到的商品数据)
* 'sort' => array (接口返回的分类数据)
... ... @@ -131,11 +131,11 @@ class HelperSearch
self::$options = $options;
$result = array();
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
//当前页
$result['page'] = isset($data['product']['page']) ? $data['product']['page'] : '';
self::$page = $result['page'];
//产品列表
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options) : array();
//总页数
... ... @@ -184,7 +184,7 @@ class HelperSearch
if (empty($shopSort)) {
continue;
}
$result['shopEntry'][] = $shopSort;
$result['shopEntry'][] = $shopSort;
}
}
//分页
... ... @@ -314,7 +314,7 @@ class HelperSearch
$isNew = false;
$isSale = false;
}
if (isset($options['isNew']) && $options['isNew']) {
$isNew = true;
}
... ... @@ -1449,7 +1449,7 @@ class HelperSearch
if (self::$total == 0) {
return $shopEntry;
}
if (empty($shopSort)) {
$shopSort = array();
}
... ... @@ -1921,4 +1921,3 @@ class HelperSearch
return array();
}
}
... ...

48.3 KB | W: | H:

48.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

8.64 KB | W: | H:

8.64 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -28,39 +28,45 @@ exports.init = function(num) {
$shopEntryArea = $('.shop-entry-area'),
shopEntryLen = $shopEntry.length;
if (shopEntryLen > 0) {
if (shopEntryLen % 3 === 1) {
$shopEntry.eq(shopEntryLen - 1).css({
width: '100%'
});
$shopEntry.eq(shopEntryLen - 1).find('.name').css({
width: '600px'
});
} else if (shopEntryLen % 3 === 2) {
$shopEntry.eq(shopEntryLen - 1).css({
width: '49%'
});
$shopEntry.eq(shopEntryLen - 2).css({
width: '49%'
});
$shopEntry.eq(shopEntryLen - 1).find('.name').css({
width: '230px'
});
$shopEntry.eq(shopEntryLen - 2).find('.name').css({
width: '230px'
});
}
$('.shop-entry:nth-child(3n+1)').css({
marginLeft: 0
});
$shopEntryArea.show();
}
if (shopEntryLen > 1) {
if (shopEntryLen === 3) {
$shopEntry.css({
width: '32%'
});
} else if (shopEntryLen % 2) {
// 大于 2 ,并且是基数
$('.shop-entry:gt(' + (shopEntryLen - 4) + ')').css({
width: '32%'
});
}
$('.shop-entry:nth-child(2n+1)').css({
marginLeft: 0
});
$shopEntry.last().css({
marginLeft: '2%'
});
if (shopEntryLen % 2 === 0) {
$shopEntry.find('.name').css({
width: '50%'
});
} else if (shopEntryLen % 3 === 0) {
$shopEntry.find('.name').css({
width: '26%'
});
}
} else {
$shopEntry.css({
width: '100%'
});
}
$shopEntryArea.slideDown();
productList = null;
... ... @@ -266,4 +272,4 @@ $productListNav.find('h3').click(function(event) {
}
});
}
}());
\ No newline at end of file
}());
... ...
... ... @@ -14,7 +14,7 @@
background: #f5f7f6;
border: 1px solid #eaeceb;
padding: 12px 15px;
width: 32%;
width: 49%;
box-sizing: border-box;
float: left;
margin: 0 0 10px 2%;
... ... @@ -26,7 +26,7 @@
.name {
margin-left: 10px;
width: 75px;
width: 70%;
}
.shop-name {
... ...