@pisell/pisellos 2.2.20 → 2.2.21
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.
|
@@ -16,7 +16,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
16
16
|
* @return {*}
|
|
17
17
|
* @Author: xiangfeng.xue
|
|
18
18
|
*/
|
|
19
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00"
|
|
19
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
|
20
20
|
/**
|
|
21
21
|
* @title: 计算定金
|
|
22
22
|
* @param items - 购物车商品数组
|
|
@@ -270,14 +270,20 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
270
270
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
271
271
|
while (1) switch (_context4.prev = _context4.next) {
|
|
272
272
|
case 0:
|
|
273
|
+
if (!(this.isWalkIn() && this.isWalkIn(customer === null || customer === void 0 ? void 0 : customer.id))) {
|
|
274
|
+
_context4.next = 2;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
return _context4.abrupt("return");
|
|
278
|
+
case 2:
|
|
273
279
|
if (!(((_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 ? void 0 : _this$store$customer.id) !== customer.id)) {
|
|
274
|
-
_context4.next =
|
|
280
|
+
_context4.next = 6;
|
|
275
281
|
break;
|
|
276
282
|
}
|
|
277
283
|
this.store.customer = customer;
|
|
278
|
-
_context4.next =
|
|
284
|
+
_context4.next = 6;
|
|
279
285
|
return this.core.effects.emit("".concat(this.name, ":onCustomerChange"), customer);
|
|
280
|
-
case
|
|
286
|
+
case 6:
|
|
281
287
|
case "end":
|
|
282
288
|
return _context4.stop();
|
|
283
289
|
}
|
|
@@ -522,9 +528,9 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
522
528
|
// 是否是walkIn
|
|
523
529
|
}, {
|
|
524
530
|
key: "isWalkIn",
|
|
525
|
-
value: function isWalkIn() {
|
|
531
|
+
value: function isWalkIn(id) {
|
|
526
532
|
var _this$getCustomer;
|
|
527
|
-
return (((_this$getCustomer = this.getCustomer()) === null || _this$getCustomer === void 0 ? void 0 : _this$getCustomer.id) || 1) === 1;
|
|
533
|
+
return (id !== null && id !== void 0 ? id : ((_this$getCustomer = this.getCustomer()) === null || _this$getCustomer === void 0 ? void 0 : _this$getCustomer.id) || 1) === 1;
|
|
528
534
|
}
|
|
529
535
|
|
|
530
536
|
// 触发优惠列表变更事件
|
|
@@ -16,7 +16,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
16
16
|
* @return {*}
|
|
17
17
|
* @Author: xiangfeng.xue
|
|
18
18
|
*/
|
|
19
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00"
|
|
19
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
|
20
20
|
/**
|
|
21
21
|
* @title: 计算定金
|
|
22
22
|
* @param items - 购物车商品数组
|
|
@@ -185,6 +185,9 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
185
185
|
// 设置客户
|
|
186
186
|
async setCustomer(customer) {
|
|
187
187
|
var _a;
|
|
188
|
+
if (this.isWalkIn() && this.isWalkIn(customer == null ? void 0 : customer.id)) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
188
191
|
if (((_a = this.store.customer) == null ? void 0 : _a.id) !== customer.id) {
|
|
189
192
|
this.store.customer = customer;
|
|
190
193
|
await this.core.effects.emit(
|
|
@@ -348,9 +351,9 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
348
351
|
return this.store.customer;
|
|
349
352
|
}
|
|
350
353
|
// 是否是walkIn
|
|
351
|
-
isWalkIn() {
|
|
354
|
+
isWalkIn(id) {
|
|
352
355
|
var _a;
|
|
353
|
-
return (((_a = this.getCustomer()) == null ? void 0 : _a.id) || 1) === 1;
|
|
356
|
+
return (id ?? (((_a = this.getCustomer()) == null ? void 0 : _a.id) || 1)) === 1;
|
|
354
357
|
}
|
|
355
358
|
// 触发优惠列表变更事件
|
|
356
359
|
async emitDiscountListChange(discountList) {
|