为您优选数据不加载时隐藏外层容器 --code reviewed by bikai
Showing
3 changed files
with
20 additions
and
13 deletions
@@ -14,15 +14,19 @@ var recommendSwiper, | @@ -14,15 +14,19 @@ var recommendSwiper, | ||
14 | 14 | ||
15 | if (preferenceUrl) { | 15 | if (preferenceUrl) { |
16 | $.get(preferenceUrl).then(function(html) { | 16 | $.get(preferenceUrl).then(function(html) { |
17 | - $recommendForYou.html(html).show(); | ||
18 | - if ($('#swiper-recommend').length) { | ||
19 | - recommendSwiper = new Swiper('#swiper-recommend', { | ||
20 | - slidesPerView: 'auto', | ||
21 | - grabCursor: true, | ||
22 | - slideElement: 'a', | ||
23 | - lazyLoading: true, | ||
24 | - watchSlidesVisibility: true | ||
25 | - }); | 17 | + if (html.length < 5) { |
18 | + $recommendForYou.css('display', 'none'); | ||
19 | + } else { | ||
20 | + $recommendForYou.html(html).show(); | ||
21 | + if ($('#swiper-recommend').length) { | ||
22 | + recommendSwiper = new Swiper('#swiper-recommend', { | ||
23 | + slidesPerView: 'auto', | ||
24 | + grabCursor: true, | ||
25 | + slideElement: 'a', | ||
26 | + lazyLoading: true, | ||
27 | + watchSlidesVisibility: true | ||
28 | + }); | ||
29 | + } | ||
26 | } | 30 | } |
27 | 31 | ||
28 | window.rePosFooter(); | 32 | window.rePosFooter(); |
@@ -402,6 +402,7 @@ $basicBtnC:#eb0313; | @@ -402,6 +402,7 @@ $basicBtnC:#eb0313; | ||
402 | z-index: 2; | 402 | z-index: 2; |
403 | padding: pxToRem(20px) pxToRem(28px); | 403 | padding: pxToRem(20px) pxToRem(28px); |
404 | text-align: center; | 404 | text-align: center; |
405 | + border-top: 1px solid $borderC; | ||
405 | a { | 406 | a { |
406 | display: inline-block; | 407 | display: inline-block; |
407 | &.num-incart { | 408 | &.num-incart { |
@@ -447,9 +448,9 @@ $basicBtnC:#eb0313; | @@ -447,9 +448,9 @@ $basicBtnC:#eb0313; | ||
447 | } | 448 | } |
448 | } | 449 | } |
449 | } | 450 | } |
450 | - // .recommend-for-you { | ||
451 | - // margin-bottom: pxToRem(30px); | ||
452 | - // } | 451 | + .recommend-for-you{ |
452 | + border-bottom: none; | ||
453 | + } | ||
453 | .yoho-tip{ | 454 | .yoho-tip{ |
454 | top:40%; | 455 | top:40%; |
455 | } | 456 | } |
-
Please register or login to post a comment