Authored by 梁志锋

Merge branch 'develop/wap' of http://git.dev.yoho.cn/web/yohobuy into develop/wap

@@ -14,7 +14,8 @@ var $ = require('jquery'), @@ -14,7 +14,8 @@ var $ = require('jquery'),
14 recommendSwiper, 14 recommendSwiper,
15 hotBrandsSwiper, 15 hotBrandsSwiper,
16 trendTopicSwiper, 16 trendTopicSwiper,
17 - goodsSwiper; 17 + goodsSwiper,
  18 + freshSwiper;
18 19
19 var start = 0, 20 var start = 0,
20 swiperClass, 21 swiperClass,
@@ -145,6 +146,17 @@ if ($('.trend-topic-swiper').find('li').size() > 1) { @@ -145,6 +146,17 @@ if ($('.trend-topic-swiper').find('li').size() > 1) {
145 }); 146 });
146 } 147 }
147 148
  149 +// 新人专享轮播
  150 +if ($('.fresh-list-swiper').find('li').size() > 1) {
  151 + freshSwiper = new Swiper('.fresh-list-swiper', {
  152 + lazyLoading: true,
  153 + lazyLoadingInPrevNext: true,
  154 + grabCursor: true,
  155 + slidesPerView: 'auto',
  156 + slideElement: 'li'
  157 + });
  158 +}
  159 +
148 // 潮流上装/经典裤装等轮播 160 // 潮流上装/经典裤装等轮播
149 $('.category-swiper').each(function(i, index) { 161 $('.category-swiper').each(function(i, index) {
150 swiperClass = 'category-swiper' + i; 162 swiperClass = 'category-swiper' + i;
1 @import "header-download", "banner-top","banner-center","banner-bottom", "side-nav", "floor-header", "hot-brands", "fine-brands", "creative-life", "plus-star", "maybe-like", 1 @import "header-download", "banner-top","banner-center","banner-bottom", "side-nav", "floor-header", "hot-brands", "fine-brands", "creative-life", "plus-star", "maybe-like",
2 "icons-enter","trendsetter-collocation", 2 "icons-enter","trendsetter-collocation",
3 -"trend-topics","goods-category","hot-brands", "hot-category", "home-header", "thumb-row"; 3 +"trend-topics","goods-category","hot-brands", "hot-category", "home-header", "thumb-row", "fresh-only";
4 4
5 .mobile-container{ 5 .mobile-container{
6 width: 100%; 6 width: 100%;
  1 +.fresh-swiper {
  2 + position: relative;
  3 + height: 200px;
  4 + overflow: hidden;
  5 + ul {
  6 + li {
  7 + float: left;
  8 + width: 100%;
  9 + a, img {
  10 + display: block;
  11 + width: 100%;
  12 + height: 100%;
  13 + }
  14 + }
  15 + }
  16 + .swiper-pagination {
  17 + position: absolute;
  18 + left: 0;
  19 + right: 0;
  20 + bottom: 20px;
  21 + text-align: center;
  22 + .pagination-inner {
  23 + display: inline-block;
  24 + span {
  25 + display: inline-block;
  26 + width: 14px;
  27 + height: 14px;
  28 + background: #fff;
  29 + opacity: 0.5;
  30 + margin: 0 9px;
  31 + border-radius: 50%;
  32 + }
  33 + span.swiper-active-switch {
  34 + opacity: 1;
  35 + }
  36 + }
  37 + }
  38 +}
  39 +
  40 +.fresh-list-swiper {
  41 + overflow: hidden;
  42 +
  43 + ul {
  44 + box-sizing: border-box;
  45 + }
  46 +
  47 + li {
  48 + float:left;
  49 + width:240px;
  50 + margin: 20px 10px 0 10px;
  51 +
  52 + &:first-child {
  53 + margin-left: 20px;
  54 + }
  55 +
  56 + &:last-child {
  57 + margin-right: 20px;
  58 + }
  59 +
  60 + .img-box {
  61 + height: 100%;
  62 + height:320px;
  63 + text-align: center;
  64 + position: relative;
  65 + img {
  66 + width: 100%;
  67 + height: 100%;
  68 + vertical-align: middle;
  69 + }
  70 + }
  71 +
  72 + .fresh-info {
  73 + .fresh-name a{
  74 + display:block;
  75 + overflow: hidden;
  76 + text-overflow: ellipsis;
  77 + width: 100%;
  78 + white-space: nowrap;
  79 + color: #444;
  80 + line-height: 48px;
  81 + font-size: 22px;
  82 +
  83 + }
  84 +
  85 + .cur-price {
  86 + color: #d62927;
  87 + font-size: 22px;
  88 + }
  89 +
  90 + .old-price {
  91 + margin: 0 0 0 10px;
  92 + color: #b0b0b0;
  93 + text-decoration: line-through;
  94 + font-size: 22px;
  95 + }
  96 +
  97 + .fresh-icon {
  98 + background: #d62927;
  99 + width: 100px;
  100 + height: 33px;
  101 + display: block;
  102 + margin: 8px auto 0 auto;
  103 + color: #fff;
  104 + text-align: center;
  105 + border-radius: 40px;
  106 + line-height: 37px;
  107 + font-size:12px;
  108 + }
  109 + }
  110 + }
  111 +}
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 @import "hot-category"; 17 @import "hot-category";
18 @import "home-header"; 18 @import "home-header";
19 @import "thumb-row"; 19 @import "thumb-row";
  20 +@import "fresh-only";
20 21
21 .mobile-container{ 22 .mobile-container{
22 width: 100%; 23 width: 100%;
@@ -39,6 +39,10 @@ @@ -39,6 +39,10 @@
39 {{# goodsCategory}} 39 {{# goodsCategory}}
40 {{> home/goods_category}} 40 {{> home/goods_category}}
41 {{/ goodsCategory}} 41 {{/ goodsCategory}}
  42 + {{! 新人专享}}
  43 + {{# freshOnly}}
  44 + {{> home/fresh_only}}
  45 + {{/ freshOnly}}
42 {{! 新入住品牌/品味生活/创意生活}} 46 {{! 新入住品牌/品味生活/创意生活}}
43 {{# creativeLife}} 47 {{# creativeLife}}
44 {{> home/creative_life}} 48 {{> home/creative_life}}
  1 +{{> home/floor_header_more}}
  2 +<div class="fresh-only">
  3 + {{# big_image}}
  4 + <div class="fresh-swiper">
  5 + <a href="{{url}}">
  6 + <img class="lazy" data-original="{{img}}" alt="{{title}}">
  7 + </a>
  8 + </div>
  9 + {{/ big_image}}
  10 + <div class="fresh-list-swiper">
  11 + <ul class="clearfix swiper-wrapper">
  12 + {{# list}}
  13 + <li class="swiper-slide">
  14 + <div class="img-box">
  15 + <a href="{{url}}">
  16 + <img class="swiper-lazy" data-src="{{img}}" alt="">
  17 + </a>
  18 + <div class="swiper-lazy-preloader"></div>
  19 + </div>
  20 + <div class="fresh-info">
  21 + <p class="fresh-name"><a href="{{url}}">{{title}}</a></p>
  22 + <p class="price"><span class="cur-price">{{curPrice}}</span><span class="old-price">{{oldPrice}}<span></p>
  23 + <span class="fresh-icon">新人价</span>
  24 + </div>
  25 + </li>
  26 + {{/ list}}
  27 + </ul>
  28 + </div>
  29 +</div>