|
@@ -117,7 +117,7 @@ let goodObj = { |
|
@@ -117,7 +117,7 @@ let goodObj = { |
117
|
let self = this;
|
117
|
let self = this;
|
118
|
|
118
|
|
119
|
if (!$(e.currentTarget).hasClass('checked') && $(e.delegateTarget).find('.low-stocks').length > 0) {
|
119
|
if (!$(e.currentTarget).hasClass('checked') && $(e.delegateTarget).find('.low-stocks').length > 0) {
|
120
|
- tip.show('库存不足,无法购买');
|
120
|
+ tip.show('您勾选的商品库存不足');
|
121
|
return false;
|
121
|
return false;
|
122
|
}
|
122
|
}
|
123
|
self.selectGood($(e.currentTarget));
|
123
|
self.selectGood($(e.currentTarget));
|
|
@@ -160,16 +160,22 @@ let goodObj = { |
|
@@ -160,16 +160,22 @@ let goodObj = { |
160
|
let checked = $(e.currentTarget).find('.chk.select').hasClass('checked');
|
160
|
let checked = $(e.currentTarget).find('.chk.select').hasClass('checked');
|
161
|
|
161
|
|
162
|
if (checked) {
|
162
|
if (checked) {
|
163
|
- let promise = self.clearLowStock();
|
163
|
+ new Promise(resolve => {
|
|
|
164
|
+ let promise = self.clearLowStock();
|
164
|
|
165
|
|
165
|
- if (promise) {
|
|
|
166
|
- tip.show('您全选的商品中存在库存不足商品,已帮您自动取消勾选');
|
|
|
167
|
- promise.then(() => {
|
|
|
168
|
- self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true);
|
|
|
169
|
- });
|
|
|
170
|
- } else {
|
166
|
+ if (promise) {
|
|
|
167
|
+ promise.then(() => {
|
|
|
168
|
+ resolve();
|
|
|
169
|
+ });
|
|
|
170
|
+ } else {
|
|
|
171
|
+ resolve();
|
|
|
172
|
+ }
|
|
|
173
|
+ }).then(() => {
|
|
|
174
|
+ if ($('.good-item.low-stocks').length) {
|
|
|
175
|
+ tip.show('您全选的商品中存在库存不足商品,已帮您自动取消勾选');
|
|
|
176
|
+ }
|
171
|
self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true);
|
177
|
self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true);
|
172
|
- }
|
178
|
+ });
|
173
|
} else {
|
179
|
} else {
|
174
|
self.selectGood($('.good-item .chk.select'), false);
|
180
|
self.selectGood($('.good-item .chk.select'), false);
|
175
|
}
|
181
|
}
|