Authored by liangxs

领券中心

@@ -2,11 +2,14 @@ @@ -2,11 +2,14 @@
2 * Created by Administrator on 2016/4/13. 2 * Created by Administrator on 2016/4/13.
3 */ 3 */
4 var $ = require('jquery'), 4 var $ = require('jquery'),
  5 + Swiper = require('yoho.iswiper'),
5 $receive = $('.main-right-receive'), 6 $receive = $('.main-right-receive'),
6 $mask = $('.floor-mask'), 7 $mask = $('.floor-mask'),
7 $message = $('.floor-message'), 8 $message = $('.floor-message'),
8 $tooltip = $('.floor-tooltip'); 9 $tooltip = $('.floor-tooltip');
9 10
  11 +var bannerSwiper;
  12 +
10 $receive.on('click', function() { 13 $receive.on('click', function() {
11 var $curDom = $(this); 14 var $curDom = $(this);
12 15
@@ -47,4 +50,17 @@ $('.coupon-floor a').on('click', function() { @@ -47,4 +50,17 @@ $('.coupon-floor a').on('click', function() {
47 if ($(this).attr('href').length <= 0) { 50 if ($(this).attr('href').length <= 0) {
48 return false; 51 return false;
49 } 52 }
50 -});  
  53 +});
  54 +
  55 +if ($('.banner-swiper').find('li').size() > 1) {
  56 + bannerSwiper = new Swiper('.banner-swiper', {
  57 + lazyLoading: true,
  58 + lazyLoadingInPrevNext: true,
  59 + loop: true,
  60 + autoplay: 3000,
  61 + autoplayDisableOnInteraction: false,
  62 + paginationClickable: true,
  63 + slideElement: 'li',
  64 + pagination: '.banner-top .pagination-inner'
  65 + });
  66 +}
  1 +.coupon-area .banner-top {
  2 + float: left;
  3 +}
1 .just-img{ 4 .just-img{
2 - width:100%;  
3 - height: 96rem / $pxConvertRem; 5 + width: 100%;
4 float: left; 6 float: left;
5 - margin:0; 7 + margin: 20rem / $pxConvertRem 0;
6 } 8 }
7 .coupon-floor { 9 .coupon-floor {
8 float: left; 10 float: left;
9 - width:100%; 11 + width: 100%;
10 .floor-title { 12 .floor-title {
11 background-color: #fff; 13 background-color: #fff;
12 text-align: center; 14 text-align: center;
1 {{>layout/header}} 1 {{>layout/header}}
  2 +<div class="coupon-area">
2 {{# content}} 3 {{# content}}
3 -{{#if isCarouselBanner}}  
4 -<div class="banner-top">  
5 - <div class="banner-swiper swiper-container">  
6 - <ul class="swiper-wrapper">  
7 - {{#each list}}  
8 - {{#if @first}}  
9 - <li class="swiper-slide">  
10 - <a href="{{url}}">  
11 - <img src="{{img}}">  
12 - </a>  
13 - </li>  
14 - {{^}}  
15 - <li class="swiper-slide">  
16 - <a href="{{url}}">  
17 - <img class="swiper-lazy" src="{{img}}">  
18 - </a>  
19 - <div class="swiper-lazy-preloader"></div>  
20 - </li>  
21 - {{/if}}  
22 - {{/each}}  
23 - </ul>  
24 - </div>  
25 - <div class="swiper-pagination">  
26 - <div class="pagination-inner">  
27 - </div>  
28 - </div>  
29 -</div>  
30 -{{/if}} 4 +
31 {{#if isSingleImage}} 5 {{#if isSingleImage}}
32 -<img class="just-img" src="{{src}}" /> 6 + <a href="{{url}}"><img src="{{src}}" class="just-img" /></a>
  7 +{{/if}}
  8 +{{#if isCarouselBanner}}
  9 + {{> home/banner_top}}
33 {{/if}} 10 {{/if}}
34 {{#if isCoupon}} 11 {{#if isCoupon}}
35 <div class="coupon-floor"> 12 <div class="coupon-floor">
@@ -62,6 +39,7 @@ @@ -62,6 +39,7 @@
62 </div> 39 </div>
63 {{/if}} 40 {{/if}}
64 {{/ content}} 41 {{/ content}}
  42 +</div>
65 <div class="floor-mask"></div> 43 <div class="floor-mask"></div>
66 <div class="floor-message"> 44 <div class="floor-message">
67 <div class="coupon-message-content"></div> 45 <div class="coupon-message-content"></div>