...
|
...
|
@@ -277,6 +277,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
if (num === 1 || 0 === leftNum - 0) {
|
|
|
return;
|
|
|
}
|
|
|
if (num < 1) {
|
|
|
$num.val(1);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$num.val(num - 1);
|
|
|
}).on('touchstart', '.btn-plus', function() {
|
...
|
...
|
@@ -294,7 +298,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
}
|
|
|
|
|
|
//TODO:库存数验证
|
|
|
if (num > leftNum) {
|
|
|
if (num > leftNum - 1) {
|
|
|
$num.val(leftNum);
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -318,6 +322,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
//TODO status change
|
|
|
if ($('#chose-btn-sure').html() === '已售罄') {
|
|
|
return;
|
...
|
...
|
@@ -329,7 +334,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
tip.show('您选择的数量超过了最大库存量~');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (num < 0) {
|
|
|
tip.show('您选择的数量小于一件~');
|
|
|
return;
|
|
|
}
|
|
|
$chosed = $('.block-list>ul>li.chosed');
|
|
|
|
|
|
if (2 === $chosed.length && 0 === $chosed.closest('.zero-stock').length) {
|
...
|
...
|
|