Authored by whb

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

@@ -29,6 +29,7 @@ var $chosePanel = $('#chose-panel'), @@ -29,6 +29,7 @@ var $chosePanel = $('#chose-panel'),
29 cbFn, 29 cbFn,
30 $allChoseItems, 30 $allChoseItems,
31 queryString, 31 queryString,
  32 + $soonSoldOut = $('.soonSoldOut-tag'),
32 $yohoPage = $('.yoho-page'); 33 $yohoPage = $('.yoho-page');
33 34
34 //初始化购物车面板显示 35 //初始化购物车面板显示
@@ -210,7 +211,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -210,7 +211,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
210 211
211 //如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式 212 //如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式
212 if (curGoodNum > 0) { 213 if (curGoodNum > 0) {
  214 + if ($soonSoldOut.length > 0) {
  215 + $allChoseItems.find('.num .left-num').html('即将售罄');
  216 + } else {
213 $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); 217 $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
  218 + }
  219 +
214 $leftNum.val(curGoodNum); 220 $leftNum.val(curGoodNum);
215 } else { 221 } else {
216 $allChoseItems.find('.num .left-num').html(''); 222 $allChoseItems.find('.num .left-num').html('');
@@ -263,7 +269,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() { @@ -263,7 +269,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
263 269
264 // 如果当前有尺码被选中,且数量等于0, 否则显示剩余件数 270 // 如果当前有尺码被选中,且数量等于0, 否则显示剩余件数
265 if (curGoodNum > 0 && hasChooseColor) { 271 if (curGoodNum > 0 && hasChooseColor) {
  272 + if ($soonSoldOut.length > 0) {
  273 + $allChoseItems.find('.num .left-num').html('即将售罄');
  274 + } else {
266 $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); 275 $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
  276 + }
267 $('#left-num').val(curGoodNum); 277 $('#left-num').val(curGoodNum);
268 } else { 278 } else {
269 $allChoseItems.find('.num .left-num').html(''); 279 $allChoseItems.find('.num .left-num').html('');
1 -<div class="slide-container"> 1 +<div class="slide-container {{#if pagination}}slide-thumb-container{{/if}}">
2 <div class="slide-wrapper"> 2 <div class="slide-wrapper">
3 <ul> 3 <ul>
4 {{# list}} 4 {{# list}}
5 - <li> 5 + <li style="backgroundColor:{{bgColor}}">
6 <a href="{{href}}" target= "_blank"> 6 <a href="{{href}}" target= "_blank">
7 <img class="lazy" data-original="{{img}}" alt=""> 7 <img class="lazy" data-original="{{img}}" alt="">
8 </a> 8 </a>
@@ -38,3 +38,4 @@ @@ -38,3 +38,4 @@
38 </div> 38 </div>
39 {{/if}} 39 {{/if}}
40 </div> 40 </div>
  41 +<div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div>
@@ -6,12 +6,29 @@ @@ -6,12 +6,29 @@
6 // overflow: hidden; 6 // overflow: hidden;
7 /*大banner*/ 7 /*大banner*/
8 .slide-container { 8 .slide-container {
9 - position: relative; 9 + position: absolute;
  10 + left: 0;
  11 + right: 0;
  12 + height: 387px;
  13 +
  14 + &.slide-thumb-container {
  15 + height: 440px;
  16 + }
  17 +
10 img { 18 img {
11 display: block; 19 display: block;
12 } 20 }
13 } 21 }
14 22
  23 + .slide-container-placeholder {
  24 + height: 387px;
  25 + width: 100%;
  26 +
  27 + &.slide-thumb-container-placeholder {
  28 + height: 440px;
  29 + }
  30 + }
  31 +
15 /*大banner大图*/ 32 /*大banner大图*/
16 .slide-wrapper { 33 .slide-wrapper {
17 position: relative; 34 position: relative;
@@ -37,6 +54,13 @@ @@ -37,6 +54,13 @@
37 width: 100%; 54 width: 100%;
38 height: 100%; 55 height: 100%;
39 56
  57 + a {
  58 + display: block;
  59 + height: 100%;
  60 + width: 990px;
  61 + margin: 0 auto;
  62 + }
  63 +
40 &:first-child { 64 &:first-child {
41 display: block; 65 display: block;
42 } 66 }
@@ -50,7 +74,7 @@ @@ -50,7 +74,7 @@
50 74
51 /*大图上的左右切换按钮*/ 75 /*大图上的左右切换按钮*/
52 .slide-switch { 76 .slide-switch {
53 - display: none; 77 + display: block;
54 /* @include opacity(0); 78 /* @include opacity(0);
55 @include transition-property(opacity); 79 @include transition-property(opacity);
56 @include transition-duration(.2s); 80 @include transition-duration(.2s);
@@ -68,11 +92,13 @@ @@ -68,11 +92,13 @@
68 @include opacity(0.55); 92 @include opacity(0.55);
69 93
70 &.prev { 94 &.prev {
71 - left: 0; 95 + left: 50%;
  96 + margin-left: -495px;
72 } 97 }
73 98
74 &.next { 99 &.next {
75 - right: 0; 100 + right: 50%;
  101 + margin-right: -495px;
76 } 102 }
77 103
78 &:hover{ 104 &:hover{
@@ -88,7 +114,8 @@ @@ -88,7 +114,8 @@
88 114
89 /*大banner缩略图*/ 115 /*大banner缩略图*/
90 .thumb-pagination { 116 .thumb-pagination {
91 - margin: 7px 0 0; 117 + width: 990px;
  118 + margin: 7px auto 0;
92 119
93 li { 120 li {
94 position: relative; 121 position: relative;
@@ -223,6 +250,17 @@ @@ -223,6 +250,17 @@
223 height: 100%; 250 height: 100%;
224 } 251 }
225 252
  253 + .slide-switch {
  254 + a.prev {
  255 + left: 0;
  256 + margin-left: 0;
  257 + }
  258 + a.next {
  259 + right: 0;
  260 + margin-right: 0;
  261 + }
  262 + }
  263 +
226 img { 264 img {
227 max-width: 100%; 265 max-width: 100%;
228 max-height: 100%; 266 max-height: 100%;
@@ -3,12 +3,50 @@ @@ -3,12 +3,50 @@
3 .home-page { 3 .home-page {
4 width: 1150px; 4 width: 1150px;
5 5
  6 + .slide-container{
  7 + height: 450px;
  8 +
  9 + &.slide-thumb-container {
  10 + height: 510px;
  11 + }
  12 + }
  13 +
  14 +
6 .slide-wrapper { 15 .slide-wrapper {
7 height: 450px; 16 height: 450px;
  17 +
  18 + li {
  19 + a {
  20 + width: 1150px;
  21 + }
  22 + }
  23 + }
  24 +
  25 + .slide-container-placeholder {
  26 + height: 450px;
  27 +
  28 + &.slide-thumb-container-placeholder {
  29 + height: 510px;
  30 + }
  31 + }
  32 +
  33 +
  34 +
  35 + .slide-switch {
  36 + a {
  37 + &.prev {
  38 + margin-left: -575px;
  39 + }
  40 +
  41 + &.next {
  42 + margin-right: -575px;
  43 + }
  44 + }
8 } 45 }
9 46
10 .thumb-pagination { 47 .thumb-pagination {
11 - margin: 6px 0 0; 48 + width: 1148px;
  49 + margin: 6px auto 0;
12 padding: 0 0 0 2px; 50 padding: 0 0 0 2px;
13 51
14 li { 52 li {