...
|
...
|
@@ -117,7 +117,7 @@ let goodObj = { |
|
|
let self = this;
|
|
|
|
|
|
if (!$(e.currentTarget).hasClass('checked') && $(e.delegateTarget).find('.low-stocks').length > 0) {
|
|
|
tip.show('库存不足,无法购买');
|
|
|
tip.show('您勾选的商品库存不足');
|
|
|
return false;
|
|
|
}
|
|
|
self.selectGood($(e.currentTarget));
|
...
|
...
|
@@ -160,16 +160,22 @@ let goodObj = { |
|
|
let checked = $(e.currentTarget).find('.chk.select').hasClass('checked');
|
|
|
|
|
|
if (checked) {
|
|
|
new Promise(resolve => {
|
|
|
let promise = self.clearLowStock();
|
|
|
|
|
|
if (promise) {
|
|
|
tip.show('您全选的商品中存在库存不足商品,已帮您自动取消勾选');
|
|
|
promise.then(() => {
|
|
|
self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true);
|
|
|
resolve();
|
|
|
});
|
|
|
} else {
|
|
|
self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true);
|
|
|
resolve();
|
|
|
}
|
|
|
}).then(() => {
|
|
|
if ($('.good-item.low-stocks').length) {
|
|
|
tip.show('您全选的商品中存在库存不足商品,已帮您自动取消勾选');
|
|
|
}
|
|
|
self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true);
|
|
|
});
|
|
|
} else {
|
|
|
self.selectGood($('.good-item .chk.select'), false);
|
|
|
}
|
...
|
...
|
|