@pisell/pisellos 1.0.74 → 1.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -320,7 +320,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
320
320
|
key: "scanCode",
|
|
321
321
|
value: function () {
|
|
322
322
|
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code, customerId) {
|
|
323
|
-
var _this$store$discount3, resultDiscountList, rulesModule, withScanList, _ref2, newProductList, newDiscountList, isAvailable, _this$options$otherPa6;
|
|
323
|
+
var _this$store$discount3, resultDiscountList, rulesModule, withScanList, currentSelectedDiscountList, _ref2, newProductList, newDiscountList, isAvailable, _this$options$otherPa6;
|
|
324
324
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
325
325
|
while (1) switch (_context5.prev = _context5.next) {
|
|
326
326
|
case 0:
|
|
@@ -363,7 +363,25 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
363
363
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
364
364
|
isScan: true
|
|
365
365
|
});
|
|
366
|
+
}); // 如果扫回来的券当前有选中的,则不进行计算
|
|
367
|
+
currentSelectedDiscountList = this.getDiscountList().filter(function (n) {
|
|
368
|
+
return n.isSelected;
|
|
366
369
|
});
|
|
370
|
+
if (!(currentSelectedDiscountList.length && currentSelectedDiscountList.some(function (n) {
|
|
371
|
+
return withScanList.some(function (m) {
|
|
372
|
+
return m.id === n.id;
|
|
373
|
+
});
|
|
374
|
+
}))) {
|
|
375
|
+
_context5.next = 16;
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
return _context5.abrupt("return", {
|
|
379
|
+
type: "clientCalc",
|
|
380
|
+
isAvailable: true,
|
|
381
|
+
productList: this.store.productList || [],
|
|
382
|
+
discountList: this.getDiscountList()
|
|
383
|
+
});
|
|
384
|
+
case 16:
|
|
367
385
|
_ref2 = rulesModule.isDiscountListAvailable({
|
|
368
386
|
productList: this.store.productList || [],
|
|
369
387
|
oldDiscountList: this.getDiscountList(),
|
|
@@ -374,27 +392,27 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
374
392
|
discountList: this.getDiscountList()
|
|
375
393
|
}, newProductList = _ref2.productList, newDiscountList = _ref2.discountList, isAvailable = _ref2.isAvailable;
|
|
376
394
|
if (!isAvailable) {
|
|
377
|
-
_context5.next =
|
|
395
|
+
_context5.next = 24;
|
|
378
396
|
break;
|
|
379
397
|
}
|
|
380
398
|
this.setDiscountList(newDiscountList || []);
|
|
381
399
|
this.store.originalDiscountList = newDiscountList || [];
|
|
382
400
|
this.setProductList(newProductList || []);
|
|
383
401
|
if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop')) {
|
|
384
|
-
_context5.next =
|
|
402
|
+
_context5.next = 24;
|
|
385
403
|
break;
|
|
386
404
|
}
|
|
387
|
-
_context5.next =
|
|
405
|
+
_context5.next = 24;
|
|
388
406
|
return this.getCustomerWallet(resultDiscountList[0].customer_id);
|
|
389
|
-
case
|
|
407
|
+
case 24:
|
|
390
408
|
return _context5.abrupt("return", {
|
|
391
409
|
type: "clientCalc",
|
|
392
410
|
isAvailable: isAvailable || false,
|
|
393
411
|
productList: newProductList || this.store.productList || [],
|
|
394
412
|
discountList: newDiscountList || this.getDiscountList()
|
|
395
413
|
});
|
|
396
|
-
case
|
|
397
|
-
_context5.prev =
|
|
414
|
+
case 27:
|
|
415
|
+
_context5.prev = 27;
|
|
398
416
|
_context5.t1 = _context5["catch"](0);
|
|
399
417
|
console.error('[ShopDiscount] 扫码出错:', _context5.t1);
|
|
400
418
|
return _context5.abrupt("return", {
|
|
@@ -403,11 +421,11 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
403
421
|
productList: this.store.productList || [],
|
|
404
422
|
discountList: this.getDiscountList()
|
|
405
423
|
});
|
|
406
|
-
case
|
|
424
|
+
case 31:
|
|
407
425
|
case "end":
|
|
408
426
|
return _context5.stop();
|
|
409
427
|
}
|
|
410
|
-
}, _callee5, this, [[0,
|
|
428
|
+
}, _callee5, this, [[0, 27]]);
|
|
411
429
|
}));
|
|
412
430
|
function scanCode(_x4, _x5) {
|
|
413
431
|
return _scanCode.apply(this, arguments);
|
|
@@ -233,6 +233,15 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
233
233
|
isScan: true
|
|
234
234
|
};
|
|
235
235
|
});
|
|
236
|
+
const currentSelectedDiscountList = this.getDiscountList().filter((n) => n.isSelected);
|
|
237
|
+
if (currentSelectedDiscountList.length && currentSelectedDiscountList.some((n) => withScanList.some((m) => m.id === n.id))) {
|
|
238
|
+
return {
|
|
239
|
+
type: "clientCalc",
|
|
240
|
+
isAvailable: true,
|
|
241
|
+
productList: this.store.productList || [],
|
|
242
|
+
discountList: this.getDiscountList()
|
|
243
|
+
};
|
|
244
|
+
}
|
|
236
245
|
const {
|
|
237
246
|
productList: newProductList,
|
|
238
247
|
discountList: newDiscountList,
|