Authored by 毕凯

搜索结果店铺个数

@@ -1921,4 +1921,3 @@ class HelperSearch @@ -1921,4 +1921,3 @@ class HelperSearch
1921 return array(); 1921 return array();
1922 } 1922 }
1923 } 1923 }
1924 -  

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,40 +28,46 @@ exports.init = function(num) { @@ -28,40 +28,46 @@ exports.init = function(num) {
28 $shopEntryArea = $('.shop-entry-area'), 28 $shopEntryArea = $('.shop-entry-area'),
29 shopEntryLen = $shopEntry.length; 29 shopEntryLen = $shopEntry.length;
30 30
31 - if (shopEntryLen > 0) {  
32 - if (shopEntryLen % 3 === 1) {  
33 - $shopEntry.eq(shopEntryLen - 1).css({  
34 - width: '100%'  
35 - }); 31 + if (shopEntryLen > 1) {
36 32
37 - $shopEntry.eq(shopEntryLen - 1).find('.name').css({  
38 - width: '600px' 33 + if (shopEntryLen === 3) {
  34 + $shopEntry.css({
  35 + width: '32%'
39 }); 36 });
40 - } else if (shopEntryLen % 3 === 2) {  
41 - $shopEntry.eq(shopEntryLen - 1).css({  
42 - width: '49%' 37 + } else if (shopEntryLen % 2) {
  38 +
  39 + // 大于 2 ,并且是基数
  40 + $('.shop-entry:gt(' + (shopEntryLen - 4) + ')').css({
  41 + width: '32%'
43 }); 42 });
  43 + }
44 44
45 - $shopEntry.eq(shopEntryLen - 2).css({  
46 - width: '49%' 45 + $('.shop-entry:nth-child(2n+1)').css({
  46 + marginLeft: 0
47 }); 47 });
48 48
49 - $shopEntry.eq(shopEntryLen - 1).find('.name').css({  
50 - width: '230px' 49 + $shopEntry.last().css({
  50 + marginLeft: '2%'
51 }); 51 });
52 52
53 - $shopEntry.eq(shopEntryLen - 2).find('.name').css({  
54 - width: '230px' 53 + if (shopEntryLen % 2 === 0) {
  54 + $shopEntry.find('.name').css({
  55 + width: '50%'
  56 + });
  57 + } else if (shopEntryLen % 3 === 0) {
  58 + $shopEntry.find('.name').css({
  59 + width: '26%'
55 }); 60 });
56 } 61 }
57 62
58 - $('.shop-entry:nth-child(3n+1)').css({  
59 - marginLeft: 0 63 + } else {
  64 + $shopEntry.css({
  65 + width: '100%'
60 }); 66 });
61 -  
62 - $shopEntryArea.show();  
63 } 67 }
64 68
  69 + $shopEntryArea.slideDown();
  70 +
65 productList = null; 71 productList = null;
66 72
67 $goodItem.unbind(); 73 $goodItem.unbind();
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 background: #f5f7f6; 14 background: #f5f7f6;
15 border: 1px solid #eaeceb; 15 border: 1px solid #eaeceb;
16 padding: 12px 15px; 16 padding: 12px 15px;
17 - width: 32%; 17 + width: 49%;
18 box-sizing: border-box; 18 box-sizing: border-box;
19 float: left; 19 float: left;
20 margin: 0 0 10px 2%; 20 margin: 0 0 10px 2%;
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 26
27 .name { 27 .name {
28 margin-left: 10px; 28 margin-left: 10px;
29 - width: 75px; 29 + width: 70%;
30 } 30 }
31 31
32 .shop-name { 32 .shop-name {