Showing
3 changed files
with
21 additions
and
5 deletions
@@ -278,8 +278,14 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | @@ -278,8 +278,14 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | ||
278 | } | 278 | } |
279 | 279 | ||
280 | //TODO:库存数验证 | 280 | //TODO:库存数验证 |
281 | + if (num > leftNum) { | ||
282 | + $num.val(leftNum); | ||
283 | + return; | ||
284 | + } | ||
281 | $num.val(num + 1); | 285 | $num.val(num + 1); |
282 | -}).on('touchstart', '#chose-btn-sure', function() { | 286 | +}); |
287 | + | ||
288 | +$yohoPage.on('touchstart', '#chose-btn-sure', function() { | ||
283 | 289 | ||
284 | var productSku, | 290 | var productSku, |
285 | buyNumber = $('#good-num').val() - 0, | 291 | buyNumber = $('#good-num').val() - 0, |
@@ -293,6 +299,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | @@ -293,6 +299,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | ||
293 | if (!checkColorSizeNum()) { | 299 | if (!checkColorSizeNum()) { |
294 | return; | 300 | return; |
295 | } | 301 | } |
302 | + if (isNaN(num)) { | ||
303 | + tip.show('您选择的数量不是一个数字~'); | ||
304 | + return; | ||
305 | + }; | ||
296 | 306 | ||
297 | //TODO status change | 307 | //TODO status change |
298 | if ($('#chose-btn-sure').html() === '已售罄') { | 308 | if ($('#chose-btn-sure').html() === '已售罄') { |
@@ -73,7 +73,10 @@ | @@ -73,7 +73,10 @@ | ||
73 | position: relative; | 73 | position: relative; |
74 | font-size: 28rem / $pxConvertRem; | 74 | font-size: 28rem / $pxConvertRem; |
75 | padding-left: 80rem / $pxConvertRem; | 75 | padding-left: 80rem / $pxConvertRem; |
76 | - | 76 | + input.disabled{ |
77 | + background-color:#fff; | ||
78 | + color: #000; | ||
79 | + } | ||
77 | > span { | 80 | > span { |
78 | position: absolute; | 81 | position: absolute; |
79 | left: 0; | 82 | left: 0; |
@@ -84,6 +87,9 @@ | @@ -84,6 +87,9 @@ | ||
84 | left: pxToRem(380px); | 87 | left: pxToRem(380px); |
85 | top: 20rem / $pxConvertRem; | 88 | top: 20rem / $pxConvertRem; |
86 | } | 89 | } |
90 | + span.disabled{ | ||
91 | + color: #e6e6e6; | ||
92 | + } | ||
87 | } | 93 | } |
88 | 94 | ||
89 | .size-list li.hide { | 95 | .size-list li.hide { |
@@ -50,11 +50,11 @@ | @@ -50,11 +50,11 @@ | ||
50 | <span>数量</span> | 50 | <span>数量</span> |
51 | <div class="clearfix"> | 51 | <div class="clearfix"> |
52 | <a class="btn btn-minus" href="javascript:void(0);"> | 52 | <a class="btn btn-minus" href="javascript:void(0);"> |
53 | - <span class="iconfont"></span> | 53 | + <span class="iconfont {{#if promotionId}}disabled{{/if}}"></span> |
54 | </a> | 54 | </a> |
55 | - <input id="good-num" class="good-num" type="text" value="1"> | 55 | + <input id="good-num" class="good-num {{#if promotionId}}disabled{{/if}}" type="text" value="1" {{#if promotionId}}disabled="true"{{/if}}> |
56 | <a class="btn btn-plus" href="javascript:void(0);"> | 56 | <a class="btn btn-plus" href="javascript:void(0);"> |
57 | - <span class="iconfont"></span> | 57 | + <span class="iconfont {{#if promotionId}}disabled{{/if}}"></span> |
58 | </a> | 58 | </a> |
59 | </div> | 59 | </div> |
60 | <span class="left-num"></span> | 60 | <span class="left-num"></span> |
-
Please register or login to post a comment