Showing
6 changed files
with
61 additions
and
7 deletions
@@ -8539,7 +8539,10 @@ var $listNav = $('#list-nav'), | @@ -8539,7 +8539,10 @@ var $listNav = $('#list-nav'), | ||
8539 | $pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中项 | 8539 | $pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中项 |
8540 | searching; | 8540 | searching; |
8541 | 8541 | ||
8542 | -var viewType = 1;// 1-首页,2-上新,3-人气 | 8542 | +var viewType = 1,// 1-首页,2-上新,3-人气 |
8543 | + listCount = $('.category-list li').length, | ||
8544 | + listModValue = 4 - listCount % 4, | ||
8545 | + listIndex; | ||
8543 | 8546 | ||
8544 | lazyLoad($('img.lazy')); | 8547 | lazyLoad($('img.lazy')); |
8545 | 8548 | ||
@@ -8569,6 +8572,23 @@ if ($('.multi-browse').find('li').size() > 1) { | @@ -8569,6 +8572,23 @@ if ($('.multi-browse').find('li').size() > 1) { | ||
8569 | }); | 8572 | }); |
8570 | } | 8573 | } |
8571 | 8574 | ||
8575 | +//根据热门品类的个数来改变样式展示 | ||
8576 | +// | ||
8577 | +if ($('.category-list li').length % 4 !== 0) { | ||
8578 | + $('.category-list li:last-child').addClass('category-list-last-li'); | ||
8579 | +} | ||
8580 | + | ||
8581 | +if ($('.category-list li').length < 4) { | ||
8582 | + $('.category-list').addClass('category-list-top-board'); | ||
8583 | + $('.category-list').find('.buriedpoint').addClass('category-list-only-one-row'); | ||
8584 | +} | ||
8585 | + | ||
8586 | +if ($('.category-list li').length >= 5) { | ||
8587 | + for (listIndex = listModValue; listIndex >= 0; listIndex--) { | ||
8588 | + $('.category-list li').eq(listCount - 4 + listIndex - 1).addClass('category-list-last-full-row'); | ||
8589 | + } | ||
8590 | +} | ||
8591 | + | ||
8572 | function getPageGoods(info) { | 8592 | function getPageGoods(info) { |
8573 | var nav,navType; | 8593 | var nav,navType; |
8574 | 8594 | ||
@@ -9308,7 +9328,6 @@ $('#collect').on('touchstart', function(e) { | @@ -9308,7 +9328,6 @@ $('#collect').on('touchstart', function(e) { | ||
9308 | } | 9328 | } |
9309 | }); | 9329 | }); |
9310 | 9330 | ||
9311 | - | ||
9312 | 9331 | ||
9313 | }); | 9332 | }); |
9314 | define("js/me/entry", ["jquery","hammer","lazyload","handlebars","source-map","swiper","mlellipsis","index"], function(require, exports, module){ | 9333 | define("js/me/entry", ["jquery","hammer","lazyload","handlebars","source-map","swiper","mlellipsis","index"], function(require, exports, module){ |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
@@ -80,7 +80,10 @@ var $listNav = $('#list-nav'), | @@ -80,7 +80,10 @@ var $listNav = $('#list-nav'), | ||
80 | $pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中项 | 80 | $pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中项 |
81 | searching; | 81 | searching; |
82 | 82 | ||
83 | -var viewType = 1;// 1-首页,2-上新,3-人气 | 83 | +var viewType = 1,// 1-首页,2-上新,3-人气 |
84 | + listCount = $('.category-list li').length, | ||
85 | + listModValue = 4 - listCount % 4, | ||
86 | + listIndex; | ||
84 | 87 | ||
85 | lazyLoad($('img.lazy')); | 88 | lazyLoad($('img.lazy')); |
86 | 89 | ||
@@ -110,6 +113,23 @@ if ($('.multi-browse').find('li').size() > 1) { | @@ -110,6 +113,23 @@ if ($('.multi-browse').find('li').size() > 1) { | ||
110 | }); | 113 | }); |
111 | } | 114 | } |
112 | 115 | ||
116 | +//根据热门品类的个数来改变样式展示 | ||
117 | +// | ||
118 | +if ($('.category-list li').length % 4 !== 0) { | ||
119 | + $('.category-list li:last-child').addClass('category-list-last-li'); | ||
120 | +} | ||
121 | + | ||
122 | +if ($('.category-list li').length < 4) { | ||
123 | + $('.category-list').addClass('category-list-top-board'); | ||
124 | + $('.category-list').find('.buriedpoint').addClass('category-list-only-one-row'); | ||
125 | +} | ||
126 | + | ||
127 | +if ($('.category-list li').length >= 5) { | ||
128 | + for (listIndex = listModValue; listIndex >= 0; listIndex--) { | ||
129 | + $('.category-list li').eq(listCount - 4 + listIndex - 1).addClass('category-list-last-full-row'); | ||
130 | + } | ||
131 | +} | ||
132 | + | ||
113 | function getPageGoods(info) { | 133 | function getPageGoods(info) { |
114 | var nav,navType; | 134 | var nav,navType; |
115 | 135 | ||
@@ -849,4 +869,3 @@ $('#collect').on('touchstart', function(e) { | @@ -849,4 +869,3 @@ $('#collect').on('touchstart', function(e) { | ||
849 | } | 869 | } |
850 | }); | 870 | }); |
851 | 871 | ||
852 | - |
@@ -15,10 +15,10 @@ | @@ -15,10 +15,10 @@ | ||
15 | 15 | ||
16 | li { | 16 | li { |
17 | float: left; | 17 | float: left; |
18 | - width: 160px; | 18 | + width: 158px; |
19 | height: 174px; | 19 | height: 174px; |
20 | - box-sizing: border-box; | ||
21 | - border: 1px solid #e0e0e0; | 20 | + border-top: 1px solid #e0e0e0; |
21 | + border-left: 1px solid #e0e0e0; | ||
22 | overflow: hidden; | 22 | overflow: hidden; |
23 | 23 | ||
24 | .img-box { | 24 | .img-box { |
@@ -505,4 +505,20 @@ | @@ -505,4 +505,20 @@ | ||
505 | transform: rotate(-180deg); | 505 | transform: rotate(-180deg); |
506 | } | 506 | } |
507 | } | 507 | } |
508 | + | ||
509 | + .category-list-top-board { | ||
510 | + border-top: 1px solid #e0e0e0; | ||
511 | + } | ||
512 | + | ||
513 | + .category-list-last-li { | ||
514 | + border-right: 1px solid #e0e0e0; | ||
515 | + } | ||
516 | + | ||
517 | + .category-list-only-one-row { | ||
518 | + border-top: none!important; | ||
519 | + } | ||
520 | + | ||
521 | + .category-list-last-full-row { | ||
522 | + border-bottom: 1px solid #e0e0e0; | ||
523 | + } | ||
508 | } | 524 | } |
-
Please register or login to post a comment