@pisell/pisellos 0.0.14 → 0.0.15
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.
- package/dist/modules/Cart/index.d.ts +6 -2
- package/dist/modules/Cart/index.js +39 -29
- package/dist/modules/Cart/types.d.ts +2 -2
- package/dist/modules/Cart/utils.d.ts +12 -0
- package/dist/modules/Cart/utils.js +49 -0
- package/dist/modules/Summary/utils.js +4 -5
- package/dist/solution/BookingByStep/index.d.ts +11 -3
- package/dist/solution/BookingByStep/index.js +40 -14
- package/lib/modules/Cart/index.d.ts +6 -2
- package/lib/modules/Cart/index.js +23 -13
- package/lib/modules/Cart/types.d.ts +2 -2
- package/lib/modules/Cart/utils.d.ts +12 -0
- package/lib/modules/Cart/utils.js +33 -0
- package/lib/modules/Summary/utils.js +4 -5
- package/lib/solution/BookingByStep/index.d.ts +11 -3
- package/lib/solution/BookingByStep/index.js +27 -16
- package/package.json +1 -1
|
@@ -36,6 +36,10 @@ export declare class CartModule extends BaseModule implements Module, CartModule
|
|
|
36
36
|
* 获取购物车商品
|
|
37
37
|
*/
|
|
38
38
|
getItems(): CartItem[];
|
|
39
|
+
/**
|
|
40
|
+
* 根据账户ID获取购物车
|
|
41
|
+
*/
|
|
42
|
+
getCartByAccount(account_id: string | number): CartItem[];
|
|
39
43
|
/**
|
|
40
44
|
* 移除购物车商品
|
|
41
45
|
*/
|
|
@@ -45,9 +49,9 @@ export declare class CartModule extends BaseModule implements Module, CartModule
|
|
|
45
49
|
*/
|
|
46
50
|
clearCartByAccount(account_id: string): void;
|
|
47
51
|
/**
|
|
48
|
-
*
|
|
52
|
+
* 清除购物车商品中的信息
|
|
49
53
|
*/
|
|
50
|
-
|
|
54
|
+
deleteCartItemInfo(types: "resource" | "time"): void;
|
|
51
55
|
/**
|
|
52
56
|
* 清除购物车
|
|
53
57
|
*/
|
|
@@ -22,8 +22,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
22
22
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
23
23
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
24
|
import { BaseModule } from "../BaseModule";
|
|
25
|
-
import {
|
|
26
|
-
import { createCartItemOrigin, formatAccountToCartItem, formatDiscountToCartItem, formatNoteToCartItem, formatProductToCartItem, formatResourceToCartItem, getUniqueId } from "./utils";
|
|
25
|
+
import { createCartItemOrigin, deleteResourceFromCartItem, deleteTimeFromCartItem, formatAccountToCartItem, formatDiscountToCartItem, formatNoteToCartItem, formatProductToCartItem, formatResourceToCartItem, getUniqueId } from "./utils";
|
|
27
26
|
import { cloneDeep } from "lodash-es";
|
|
28
27
|
export * from "./types";
|
|
29
28
|
|
|
@@ -75,9 +74,9 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
75
74
|
}
|
|
76
75
|
throw new Error("购物车模块需要 window 插件支持");
|
|
77
76
|
case 9:
|
|
78
|
-
this.store.temp = {};
|
|
77
|
+
// this.store.temp = {};
|
|
79
78
|
console.log("[CartModule] 初始化完成");
|
|
80
|
-
case
|
|
79
|
+
case 10:
|
|
81
80
|
case "end":
|
|
82
81
|
return _context.stop();
|
|
83
82
|
}
|
|
@@ -127,11 +126,8 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
127
126
|
|
|
128
127
|
// 触发事件
|
|
129
128
|
_context2.next = 8;
|
|
130
|
-
return this.core.effects.emit(
|
|
129
|
+
return this.core.effects.emit("".concat(this.name, ":onAddItem"), cartItem);
|
|
131
130
|
case 8:
|
|
132
|
-
_context2.next = 10;
|
|
133
|
-
return this.core.effects.emit("".concat(this.name, ":changed"), items);
|
|
134
|
-
case 10:
|
|
135
131
|
case "end":
|
|
136
132
|
return _context2.stop();
|
|
137
133
|
}
|
|
@@ -165,22 +161,19 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
165
161
|
this.store.list = _toConsumableArray(items);
|
|
166
162
|
// 触发事件
|
|
167
163
|
_context3.next = 6;
|
|
168
|
-
return this.core.effects.emit(
|
|
164
|
+
return this.core.effects.emit("".concat(this.name, ":onUpdateItem"), tempCartItem);
|
|
169
165
|
case 6:
|
|
170
|
-
_context3.next =
|
|
171
|
-
return this.core.effects.emit("".concat(this.name, ":changed"), items);
|
|
172
|
-
case 8:
|
|
173
|
-
_context3.next = 13;
|
|
166
|
+
_context3.next = 11;
|
|
174
167
|
break;
|
|
175
|
-
case
|
|
176
|
-
_context3.prev =
|
|
168
|
+
case 8:
|
|
169
|
+
_context3.prev = 8;
|
|
177
170
|
_context3.t0 = _context3["catch"](0);
|
|
178
171
|
console.error("[CartModule] 更新购物车商品失败", _context3.t0);
|
|
179
|
-
case
|
|
172
|
+
case 11:
|
|
180
173
|
case "end":
|
|
181
174
|
return _context3.stop();
|
|
182
175
|
}
|
|
183
|
-
}, _callee3, this, [[0,
|
|
176
|
+
}, _callee3, this, [[0, 8]]);
|
|
184
177
|
}));
|
|
185
178
|
function updateItem(_x4) {
|
|
186
179
|
return _updateItem.apply(this, arguments);
|
|
@@ -254,11 +247,8 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
254
247
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
255
248
|
while (1) switch (_context4.prev = _context4.next) {
|
|
256
249
|
case 0:
|
|
257
|
-
this.store.list = items || [];
|
|
258
|
-
|
|
259
|
-
_context4.next = 3;
|
|
260
|
-
return this.core.effects.emit("".concat(this.name, ":changed"), items);
|
|
261
|
-
case 3:
|
|
250
|
+
this.store.list = _toConsumableArray(items || []);
|
|
251
|
+
case 1:
|
|
262
252
|
case "end":
|
|
263
253
|
return _context4.stop();
|
|
264
254
|
}
|
|
@@ -279,6 +269,17 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
279
269
|
return this.store.list;
|
|
280
270
|
}
|
|
281
271
|
|
|
272
|
+
/**
|
|
273
|
+
* 根据账户ID获取购物车
|
|
274
|
+
*/
|
|
275
|
+
}, {
|
|
276
|
+
key: "getCartByAccount",
|
|
277
|
+
value: function getCartByAccount(account_id) {
|
|
278
|
+
return this.store.list.filter(function (item) {
|
|
279
|
+
return item.holder_id === account_id;
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
|
|
282
283
|
/**
|
|
283
284
|
* 移除购物车商品
|
|
284
285
|
*/
|
|
@@ -295,7 +296,7 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
295
296
|
});
|
|
296
297
|
this.store.list = items;
|
|
297
298
|
_context5.next = 4;
|
|
298
|
-
return this.core.effects.emit(
|
|
299
|
+
return this.core.effects.emit("".concat(this.name, ":onRemoveItem"), items);
|
|
299
300
|
case 4:
|
|
300
301
|
case "end":
|
|
301
302
|
return _context5.stop();
|
|
@@ -314,20 +315,29 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
314
315
|
}, {
|
|
315
316
|
key: "clearCartByAccount",
|
|
316
317
|
value: function clearCartByAccount(account_id) {
|
|
317
|
-
|
|
318
|
+
var items = this.store.list.filter(function (item) {
|
|
318
319
|
return item.holder_id !== account_id;
|
|
319
320
|
});
|
|
321
|
+
this.store.list = _toConsumableArray(items || []);
|
|
320
322
|
}
|
|
321
323
|
|
|
322
324
|
/**
|
|
323
|
-
*
|
|
325
|
+
* 清除购物车商品中的信息
|
|
324
326
|
*/
|
|
325
327
|
}, {
|
|
326
|
-
key: "
|
|
327
|
-
value: function
|
|
328
|
-
|
|
329
|
-
|
|
328
|
+
key: "deleteCartItemInfo",
|
|
329
|
+
value: function deleteCartItemInfo(types) {
|
|
330
|
+
var list = this.store.list.map(function (item) {
|
|
331
|
+
// 清除购物车商品中的资源信息
|
|
332
|
+
if (types === "resource") {
|
|
333
|
+
item = deleteResourceFromCartItem(item);
|
|
334
|
+
} else if (types === "time") {
|
|
335
|
+
// 清除购物车商品中的时间信息
|
|
336
|
+
item = deleteTimeFromCartItem(item);
|
|
337
|
+
}
|
|
338
|
+
return item;
|
|
330
339
|
});
|
|
340
|
+
this.store.list = _toConsumableArray(list);
|
|
331
341
|
}
|
|
332
342
|
|
|
333
343
|
/**
|
|
@@ -88,14 +88,14 @@ export interface CartItem {
|
|
|
88
88
|
_origin: any;
|
|
89
89
|
/** 商品原始数据 */
|
|
90
90
|
_productOrigin?: ProductData;
|
|
91
|
+
/** 资源原始数据 */
|
|
92
|
+
_resourceOrigin?: Resource[];
|
|
91
93
|
}
|
|
92
94
|
/**
|
|
93
95
|
* 购物车状态接口
|
|
94
96
|
*/
|
|
95
97
|
export interface CartState {
|
|
96
98
|
list: CartItem[];
|
|
97
|
-
total: number;
|
|
98
|
-
temp: Record<string, any>;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* 添加商品到购物车参数
|
|
@@ -90,6 +90,18 @@ export declare const formatResourceToCartItemOrigin: (params: {
|
|
|
90
90
|
cartItem: CartItem;
|
|
91
91
|
resources: Resource[];
|
|
92
92
|
}) => any;
|
|
93
|
+
/**
|
|
94
|
+
* 从购物车中删除资源相关信息
|
|
95
|
+
* @param cartItem 购物车
|
|
96
|
+
* @returns 删除后的购物车
|
|
97
|
+
*/
|
|
98
|
+
export declare const deleteResourceFromCartItem: (cartItem: CartItem) => CartItem;
|
|
99
|
+
/**
|
|
100
|
+
* 从购物车中删除时间
|
|
101
|
+
* @param cartItem 购物车
|
|
102
|
+
* @returns 删除后的购物车
|
|
103
|
+
*/
|
|
104
|
+
export declare const deleteTimeFromCartItem: (cartItem: CartItem) => CartItem;
|
|
93
105
|
/**
|
|
94
106
|
* 格式化备注到购物车
|
|
95
107
|
* @param params 参数
|
|
@@ -209,6 +209,7 @@ export var formatResourceToCartItem = function formatResourceToCartItem(params)
|
|
|
209
209
|
}
|
|
210
210
|
var oringin = formatResourceToCartItemOrigin(params);
|
|
211
211
|
cartItem._origin = oringin;
|
|
212
|
+
cartItem._resourceOrigin = resources;
|
|
212
213
|
return cartItem;
|
|
213
214
|
};
|
|
214
215
|
export var formatResourceToCartItemOrigin = function formatResourceToCartItemOrigin(params) {
|
|
@@ -244,6 +245,54 @@ export var formatResourceToCartItemOrigin = function formatResourceToCartItemOri
|
|
|
244
245
|
return origin;
|
|
245
246
|
};
|
|
246
247
|
|
|
248
|
+
/**
|
|
249
|
+
* 从购物车中删除资源相关信息
|
|
250
|
+
* @param cartItem 购物车
|
|
251
|
+
* @returns 删除后的购物车
|
|
252
|
+
*/
|
|
253
|
+
export var deleteResourceFromCartItem = function deleteResourceFromCartItem(cartItem) {
|
|
254
|
+
// 删除UI层的数据
|
|
255
|
+
cartItem.resource_id = undefined;
|
|
256
|
+
cartItem.relation_form_name = undefined;
|
|
257
|
+
cartItem.start_date = undefined;
|
|
258
|
+
cartItem.start_time = undefined;
|
|
259
|
+
cartItem.end_date = undefined;
|
|
260
|
+
cartItem.end_time = undefined;
|
|
261
|
+
|
|
262
|
+
// 删除资源原始数据
|
|
263
|
+
delete cartItem._resourceOrigin;
|
|
264
|
+
|
|
265
|
+
// 删除原始数据
|
|
266
|
+
cartItem._origin.resources = null;
|
|
267
|
+
cartItem._origin.select_date = null;
|
|
268
|
+
cartItem._origin.start_date = null;
|
|
269
|
+
cartItem._origin.start_time = null;
|
|
270
|
+
cartItem._origin.end_date = null;
|
|
271
|
+
cartItem._origin.end_time = null;
|
|
272
|
+
return cartItem;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* 从购物车中删除时间
|
|
277
|
+
* @param cartItem 购物车
|
|
278
|
+
* @returns 删除后的购物车
|
|
279
|
+
*/
|
|
280
|
+
export var deleteTimeFromCartItem = function deleteTimeFromCartItem(cartItem) {
|
|
281
|
+
// 删除UI层的数据
|
|
282
|
+
cartItem.start_date = undefined;
|
|
283
|
+
cartItem.start_time = undefined;
|
|
284
|
+
cartItem.end_date = undefined;
|
|
285
|
+
cartItem.end_time = undefined;
|
|
286
|
+
|
|
287
|
+
// 删除原始数据
|
|
288
|
+
cartItem._origin.select_date = null;
|
|
289
|
+
cartItem._origin.start_date = null;
|
|
290
|
+
cartItem._origin.start_time = null;
|
|
291
|
+
cartItem._origin.end_date = null;
|
|
292
|
+
cartItem._origin.end_time = null;
|
|
293
|
+
return cartItem;
|
|
294
|
+
};
|
|
295
|
+
|
|
247
296
|
/**
|
|
248
297
|
* 格式化备注到购物车
|
|
249
298
|
* @param params 参数
|
|
@@ -24,9 +24,8 @@ export var calculateSubtotal = function calculateSubtotal(items) {
|
|
|
24
24
|
return "0.00";
|
|
25
25
|
}
|
|
26
26
|
var subtotal = items.reduce(function (sum, item) {
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
return sum.plus(price.times(quantity));
|
|
27
|
+
var cartItemTotalPrice = new Decimal(item.total || 0);
|
|
28
|
+
return sum.plus(cartItemTotalPrice);
|
|
30
29
|
}, new Decimal(0));
|
|
31
30
|
return subtotal.toFixed(2);
|
|
32
31
|
};
|
|
@@ -47,9 +46,9 @@ export var calculateTaxFee = function calculateTaxFee(shopInfo, items) {
|
|
|
47
46
|
is_price_include_tax = _ref.is_price_include_tax,
|
|
48
47
|
tax_rate = _ref.tax_rate;
|
|
49
48
|
var totalTaxFee = items.reduce(function (sum, item) {
|
|
50
|
-
var
|
|
49
|
+
var cartItemTotalPrice = new Decimal(item.total || 0);
|
|
51
50
|
var taxRate = new Decimal(tax_rate || 0).div(100);
|
|
52
|
-
var productTaxRate =
|
|
51
|
+
var productTaxRate = cartItemTotalPrice.times(taxRate).times((item === null || item === void 0 ? void 0 : item.is_charge_tax) || 0).div(taxRate.times(is_price_include_tax || 0).plus(1));
|
|
53
52
|
return sum.plus(productTaxRate);
|
|
54
53
|
}, new Decimal(0));
|
|
55
54
|
return totalTaxFee;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Module, PisellCore } from "../../types";
|
|
2
2
|
import { BaseModule } from "../../modules/BaseModule";
|
|
3
3
|
import { BookingByStepState } from "./types";
|
|
4
|
-
import { IUpdateItemParams, ProductData } from "../../modules";
|
|
4
|
+
import { CartItem, IUpdateItemParams, ProductData } from "../../modules";
|
|
5
5
|
import { Account } from "../../modules/Account/types";
|
|
6
6
|
import { IStep } from "../../modules/Step/tyeps";
|
|
7
7
|
import { TimeSliceItem } from "./utils/resources";
|
|
@@ -39,7 +39,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
39
39
|
removeAccount(id: string): void;
|
|
40
40
|
setDateRange(dateRange: ITime[]): Promise<void>;
|
|
41
41
|
getRangeDate(): Promise<string>;
|
|
42
|
-
getCart(): Promise<
|
|
42
|
+
getCart(): Promise<CartItem[]>;
|
|
43
43
|
getAvailableDate(params?: {
|
|
44
44
|
products?: ProductData[];
|
|
45
45
|
startDate?: string;
|
|
@@ -66,9 +66,17 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
66
66
|
}): Promise<void>;
|
|
67
67
|
getOtherParams(): Promise<Record<string, any>>;
|
|
68
68
|
updateCart(params: IUpdateItemParams): void;
|
|
69
|
-
deleteCart(
|
|
69
|
+
deleteCart(cartItemId: string): void;
|
|
70
70
|
clearCart(): void;
|
|
71
71
|
clearCartByAccount(account_id: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* 批量更新购物车
|
|
74
|
+
*/
|
|
75
|
+
batchUpdateCart(paramsList: IUpdateItemParams[]): void;
|
|
76
|
+
/**
|
|
77
|
+
* 从购物车中按类别删除信息
|
|
78
|
+
*/
|
|
79
|
+
deleteCartItemInfo(types: "resource" | "time"): void;
|
|
72
80
|
destory(): void;
|
|
73
81
|
getResourcesList(): any[];
|
|
74
82
|
getResourceTimeSlot({ product, resources, currentResourceId, }: {
|
|
@@ -637,7 +637,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
637
637
|
// 删除购物车里某个商品
|
|
638
638
|
}, {
|
|
639
639
|
key: "deleteCart",
|
|
640
|
-
value: function deleteCart(
|
|
640
|
+
value: function deleteCart(cartItemId) {
|
|
641
|
+
this.store.cart.removeItem(cartItemId);
|
|
642
|
+
}
|
|
641
643
|
|
|
642
644
|
// 清空购物车
|
|
643
645
|
}, {
|
|
@@ -652,6 +654,30 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
652
654
|
value: function clearCartByAccount(account_id) {
|
|
653
655
|
this.store.cart.clearCartByAccount(account_id);
|
|
654
656
|
}
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* 批量更新购物车
|
|
660
|
+
*/
|
|
661
|
+
}, {
|
|
662
|
+
key: "batchUpdateCart",
|
|
663
|
+
value: function batchUpdateCart(paramsList) {
|
|
664
|
+
var _this5 = this;
|
|
665
|
+
var cartItems = [];
|
|
666
|
+
paramsList.forEach(function (params) {
|
|
667
|
+
var cartItem = _this5.store.cart.formatCartItem(params);
|
|
668
|
+
cartItems.push(cartItem);
|
|
669
|
+
});
|
|
670
|
+
this.store.cart.batchSetItems(cartItems);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* 从购物车中按类别删除信息
|
|
675
|
+
*/
|
|
676
|
+
}, {
|
|
677
|
+
key: "deleteCartItemInfo",
|
|
678
|
+
value: function deleteCartItemInfo(types) {
|
|
679
|
+
this.store.cart.deleteCartItemInfo(types);
|
|
680
|
+
}
|
|
655
681
|
}, {
|
|
656
682
|
key: "destory",
|
|
657
683
|
value: function destory() {
|
|
@@ -888,7 +914,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
888
914
|
}, {
|
|
889
915
|
key: "autoSelectAllProductResources",
|
|
890
916
|
value: function autoSelectAllProductResources(resources_code, timeSlots) {
|
|
891
|
-
var
|
|
917
|
+
var _this6 = this;
|
|
892
918
|
var dateRange = this.store.date.getDateRange();
|
|
893
919
|
var resources = [];
|
|
894
920
|
dateRange.forEach(function (n) {
|
|
@@ -898,27 +924,27 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
898
924
|
// 一个账号一个账号处理
|
|
899
925
|
var errorList = [];
|
|
900
926
|
this.store.accountList.getAccounts().forEach(function (account) {
|
|
901
|
-
var cartItems =
|
|
927
|
+
var cartItems = _this6.store.cart.getCartByAccount(account.getId());
|
|
902
928
|
// 这里必须每次循环重新读,避免前一次循环操作了购物车,导致数据变更
|
|
903
|
-
var allCartItems =
|
|
929
|
+
var allCartItems = _this6.store.cart.getItems();
|
|
904
930
|
cartItems.forEach(function (item) {
|
|
905
931
|
if (timeSlots) {
|
|
906
932
|
// 如果传递了 timeSlots,代表是第二种资源,则直接拿 timeSlots 去匹配
|
|
907
|
-
var res =
|
|
933
|
+
var res = _this6.autoSelectAccountResources({
|
|
908
934
|
holder_id: item.holder_id,
|
|
909
935
|
resources_code: resources_code,
|
|
910
936
|
timeSlots: timeSlots
|
|
911
937
|
});
|
|
912
938
|
if (res !== null && res !== void 0 && res.selectedResource) {
|
|
913
|
-
console.log(
|
|
914
|
-
|
|
939
|
+
console.log(_this6.store.cart.getItems());
|
|
940
|
+
_this6.store.cart.updateItem({
|
|
915
941
|
_id: item._id,
|
|
916
942
|
// 这里要做去重,避免出现同样类型的资源被塞进同一个商品
|
|
917
943
|
resources: [].concat(_toConsumableArray((item._origin.resources || []).filter(function (existingRes) {
|
|
918
|
-
return existingRes.
|
|
944
|
+
return existingRes.form_id !== res.selectedResource.form_id;
|
|
919
945
|
})), [res.selectedResource])
|
|
920
946
|
});
|
|
921
|
-
console.log(
|
|
947
|
+
console.log(_this6.store.cart.getItems());
|
|
922
948
|
} else {
|
|
923
949
|
// 如果没有可用的技师了,推到错误列表里让 UI 去提示
|
|
924
950
|
errorList.push(item._id);
|
|
@@ -932,7 +958,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
932
958
|
return n.code === resources_code;
|
|
933
959
|
})) === null || _productResources$fin === void 0 ? void 0 : _productResources$fin.renderList;
|
|
934
960
|
if (targetRenderList && targetRenderList.length > 0) {
|
|
935
|
-
|
|
961
|
+
_this6.store.cart.updateItem({
|
|
936
962
|
_id: item._id,
|
|
937
963
|
resources: [].concat(_toConsumableArray((item._origin.resources || []).filter(function (existingRes) {
|
|
938
964
|
return existingRes.resourceType !== targetRenderList[0].resourceType;
|
|
@@ -953,7 +979,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
953
979
|
}, {
|
|
954
980
|
key: "getTimeSlotByAllResources",
|
|
955
981
|
value: function getTimeSlotByAllResources(resources_code) {
|
|
956
|
-
var
|
|
982
|
+
var _this7 = this;
|
|
957
983
|
var dateRange = this.store.date.getDateRange();
|
|
958
984
|
// 取出购物车中所有一已选择的第一步资源
|
|
959
985
|
var resources = [];
|
|
@@ -975,7 +1001,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
975
1001
|
// duration = 不同账号的最长时间
|
|
976
1002
|
this.store.accountList.getAccounts().forEach(function (account) {
|
|
977
1003
|
var accountDuration = 0;
|
|
978
|
-
var cartItems =
|
|
1004
|
+
var cartItems = _this7.store.cart.getCartByAccount(account.getId());
|
|
979
1005
|
cartItems.forEach(function (item) {
|
|
980
1006
|
var _item$_productOrigin$, _item$_productOrigin3;
|
|
981
1007
|
accountDuration += (_item$_productOrigin$ = (_item$_productOrigin3 = item._productOrigin) === null || _item$_productOrigin3 === void 0 || (_item$_productOrigin3 = _item$_productOrigin3.duration) === null || _item$_productOrigin3 === void 0 ? void 0 : _item$_productOrigin3.value) !== null && _item$_productOrigin$ !== void 0 ? _item$_productOrigin$ : 0;
|
|
@@ -1023,7 +1049,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1023
1049
|
}, {
|
|
1024
1050
|
key: "submitTimeSlot",
|
|
1025
1051
|
value: function submitTimeSlot(timeSlots) {
|
|
1026
|
-
var
|
|
1052
|
+
var _this8 = this;
|
|
1027
1053
|
var cartItems = this.store.cart.getItems();
|
|
1028
1054
|
cartItems.forEach(function (item) {
|
|
1029
1055
|
var newResources = cloneDeep(item._origin.resources);
|
|
@@ -1033,7 +1059,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1033
1059
|
n.endTime = dayjs(n.startTime).add((_item$_productOrigin$2 = (_item$_productOrigin4 = item._productOrigin) === null || _item$_productOrigin4 === void 0 || (_item$_productOrigin4 = _item$_productOrigin4.duration) === null || _item$_productOrigin4 === void 0 ? void 0 : _item$_productOrigin4.value) !== null && _item$_productOrigin$2 !== void 0 ? _item$_productOrigin$2 : 0, (_ref8 = (_item$_productOrigin5 = item._productOrigin) === null || _item$_productOrigin5 === void 0 || (_item$_productOrigin5 = _item$_productOrigin5.duration) === null || _item$_productOrigin5 === void 0 ? void 0 : _item$_productOrigin5.type) !== null && _ref8 !== void 0 ? _ref8 : "minutes").format("YYYY-MM-DD HH:mm");
|
|
1034
1060
|
delete n.times;
|
|
1035
1061
|
});
|
|
1036
|
-
|
|
1062
|
+
_this8.store.cart.updateItem({
|
|
1037
1063
|
_id: item._id,
|
|
1038
1064
|
resources: newResources
|
|
1039
1065
|
});
|
|
@@ -36,6 +36,10 @@ export declare class CartModule extends BaseModule implements Module, CartModule
|
|
|
36
36
|
* 获取购物车商品
|
|
37
37
|
*/
|
|
38
38
|
getItems(): CartItem[];
|
|
39
|
+
/**
|
|
40
|
+
* 根据账户ID获取购物车
|
|
41
|
+
*/
|
|
42
|
+
getCartByAccount(account_id: string | number): CartItem[];
|
|
39
43
|
/**
|
|
40
44
|
* 移除购物车商品
|
|
41
45
|
*/
|
|
@@ -45,9 +49,9 @@ export declare class CartModule extends BaseModule implements Module, CartModule
|
|
|
45
49
|
*/
|
|
46
50
|
clearCartByAccount(account_id: string): void;
|
|
47
51
|
/**
|
|
48
|
-
*
|
|
52
|
+
* 清除购物车商品中的信息
|
|
49
53
|
*/
|
|
50
|
-
|
|
54
|
+
deleteCartItemInfo(types: "resource" | "time"): void;
|
|
51
55
|
/**
|
|
52
56
|
* 清除购物车
|
|
53
57
|
*/
|
|
@@ -24,7 +24,6 @@ __export(Cart_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(Cart_exports);
|
|
26
26
|
var import_BaseModule = require("../BaseModule");
|
|
27
|
-
var import_types = require("./types");
|
|
28
27
|
var import_utils = require("./utils");
|
|
29
28
|
var import_lodash_es = require("lodash-es");
|
|
30
29
|
__reExport(Cart_exports, require("./types"), module.exports);
|
|
@@ -50,7 +49,6 @@ var CartModule = class extends import_BaseModule.BaseModule {
|
|
|
50
49
|
if (!this.window) {
|
|
51
50
|
throw new Error("购物车模块需要 window 插件支持");
|
|
52
51
|
}
|
|
53
|
-
this.store.temp = {};
|
|
54
52
|
console.log("[CartModule] 初始化完成");
|
|
55
53
|
}
|
|
56
54
|
/**
|
|
@@ -71,8 +69,7 @@ var CartModule = class extends import_BaseModule.BaseModule {
|
|
|
71
69
|
}
|
|
72
70
|
const items = [...this.store.list, cartItem];
|
|
73
71
|
this.store.list = items;
|
|
74
|
-
await this.core.effects.emit(
|
|
75
|
-
await this.core.effects.emit(`${this.name}:changed`, items);
|
|
72
|
+
await this.core.effects.emit(`${this.name}:onAddItem`, cartItem);
|
|
76
73
|
}
|
|
77
74
|
/**
|
|
78
75
|
* 更新购物车信息
|
|
@@ -87,8 +84,7 @@ var CartModule = class extends import_BaseModule.BaseModule {
|
|
|
87
84
|
return item;
|
|
88
85
|
});
|
|
89
86
|
this.store.list = [...items];
|
|
90
|
-
await this.core.effects.emit(
|
|
91
|
-
await this.core.effects.emit(`${this.name}:changed`, items);
|
|
87
|
+
await this.core.effects.emit(`${this.name}:onUpdateItem`, tempCartItem);
|
|
92
88
|
} catch (error) {
|
|
93
89
|
console.error("[CartModule] 更新购物车商品失败", error);
|
|
94
90
|
}
|
|
@@ -127,8 +123,7 @@ var CartModule = class extends import_BaseModule.BaseModule {
|
|
|
127
123
|
* 批量设置购物车数据
|
|
128
124
|
*/
|
|
129
125
|
async batchSetItems(items) {
|
|
130
|
-
this.store.list = items || [];
|
|
131
|
-
await this.core.effects.emit(`${this.name}:changed`, items);
|
|
126
|
+
this.store.list = [...items || []];
|
|
132
127
|
}
|
|
133
128
|
/**
|
|
134
129
|
* 获取购物车商品
|
|
@@ -136,25 +131,40 @@ var CartModule = class extends import_BaseModule.BaseModule {
|
|
|
136
131
|
getItems() {
|
|
137
132
|
return this.store.list;
|
|
138
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* 根据账户ID获取购物车
|
|
136
|
+
*/
|
|
137
|
+
getCartByAccount(account_id) {
|
|
138
|
+
return this.store.list.filter((item) => item.holder_id === account_id);
|
|
139
|
+
}
|
|
139
140
|
/**
|
|
140
141
|
* 移除购物车商品
|
|
141
142
|
*/
|
|
142
143
|
async removeItem(id) {
|
|
143
144
|
const items = this.store.list.filter((i) => i._id !== id);
|
|
144
145
|
this.store.list = items;
|
|
145
|
-
await this.core.effects.emit(
|
|
146
|
+
await this.core.effects.emit(`${this.name}:onRemoveItem`, items);
|
|
146
147
|
}
|
|
147
148
|
/**
|
|
148
149
|
* 根据账户ID清除购物车
|
|
149
150
|
*/
|
|
150
151
|
clearCartByAccount(account_id) {
|
|
151
|
-
|
|
152
|
+
const items = this.store.list.filter((item) => item.holder_id !== account_id);
|
|
153
|
+
this.store.list = [...items || []];
|
|
152
154
|
}
|
|
153
155
|
/**
|
|
154
|
-
*
|
|
156
|
+
* 清除购物车商品中的信息
|
|
155
157
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
deleteCartItemInfo(types) {
|
|
159
|
+
const list = this.store.list.map((item) => {
|
|
160
|
+
if (types === "resource") {
|
|
161
|
+
item = (0, import_utils.deleteResourceFromCartItem)(item);
|
|
162
|
+
} else if (types === "time") {
|
|
163
|
+
item = (0, import_utils.deleteTimeFromCartItem)(item);
|
|
164
|
+
}
|
|
165
|
+
return item;
|
|
166
|
+
});
|
|
167
|
+
this.store.list = [...list];
|
|
158
168
|
}
|
|
159
169
|
/**
|
|
160
170
|
* 清除购物车
|
|
@@ -88,14 +88,14 @@ export interface CartItem {
|
|
|
88
88
|
_origin: any;
|
|
89
89
|
/** 商品原始数据 */
|
|
90
90
|
_productOrigin?: ProductData;
|
|
91
|
+
/** 资源原始数据 */
|
|
92
|
+
_resourceOrigin?: Resource[];
|
|
91
93
|
}
|
|
92
94
|
/**
|
|
93
95
|
* 购物车状态接口
|
|
94
96
|
*/
|
|
95
97
|
export interface CartState {
|
|
96
98
|
list: CartItem[];
|
|
97
|
-
total: number;
|
|
98
|
-
temp: Record<string, any>;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* 添加商品到购物车参数
|
|
@@ -90,6 +90,18 @@ export declare const formatResourceToCartItemOrigin: (params: {
|
|
|
90
90
|
cartItem: CartItem;
|
|
91
91
|
resources: Resource[];
|
|
92
92
|
}) => any;
|
|
93
|
+
/**
|
|
94
|
+
* 从购物车中删除资源相关信息
|
|
95
|
+
* @param cartItem 购物车
|
|
96
|
+
* @returns 删除后的购物车
|
|
97
|
+
*/
|
|
98
|
+
export declare const deleteResourceFromCartItem: (cartItem: CartItem) => CartItem;
|
|
99
|
+
/**
|
|
100
|
+
* 从购物车中删除时间
|
|
101
|
+
* @param cartItem 购物车
|
|
102
|
+
* @returns 删除后的购物车
|
|
103
|
+
*/
|
|
104
|
+
export declare const deleteTimeFromCartItem: (cartItem: CartItem) => CartItem;
|
|
93
105
|
/**
|
|
94
106
|
* 格式化备注到购物车
|
|
95
107
|
* @param params 参数
|
|
@@ -30,6 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var utils_exports = {};
|
|
31
31
|
__export(utils_exports, {
|
|
32
32
|
createCartItemOrigin: () => createCartItemOrigin,
|
|
33
|
+
deleteResourceFromCartItem: () => deleteResourceFromCartItem,
|
|
34
|
+
deleteTimeFromCartItem: () => deleteTimeFromCartItem,
|
|
33
35
|
formatAccountToCartItem: () => formatAccountToCartItem,
|
|
34
36
|
formatAccountToCartItemOrigin: () => formatAccountToCartItemOrigin,
|
|
35
37
|
formatBundle: () => formatBundle,
|
|
@@ -196,6 +198,7 @@ var formatResourceToCartItem = (params) => {
|
|
|
196
198
|
}
|
|
197
199
|
const oringin = formatResourceToCartItemOrigin(params);
|
|
198
200
|
cartItem._origin = oringin;
|
|
201
|
+
cartItem._resourceOrigin = resources;
|
|
199
202
|
return cartItem;
|
|
200
203
|
};
|
|
201
204
|
var formatResourceToCartItemOrigin = (params) => {
|
|
@@ -226,6 +229,34 @@ var formatResourceToCartItemOrigin = (params) => {
|
|
|
226
229
|
}
|
|
227
230
|
return origin;
|
|
228
231
|
};
|
|
232
|
+
var deleteResourceFromCartItem = (cartItem) => {
|
|
233
|
+
cartItem.resource_id = void 0;
|
|
234
|
+
cartItem.relation_form_name = void 0;
|
|
235
|
+
cartItem.start_date = void 0;
|
|
236
|
+
cartItem.start_time = void 0;
|
|
237
|
+
cartItem.end_date = void 0;
|
|
238
|
+
cartItem.end_time = void 0;
|
|
239
|
+
delete cartItem._resourceOrigin;
|
|
240
|
+
cartItem._origin.resources = null;
|
|
241
|
+
cartItem._origin.select_date = null;
|
|
242
|
+
cartItem._origin.start_date = null;
|
|
243
|
+
cartItem._origin.start_time = null;
|
|
244
|
+
cartItem._origin.end_date = null;
|
|
245
|
+
cartItem._origin.end_time = null;
|
|
246
|
+
return cartItem;
|
|
247
|
+
};
|
|
248
|
+
var deleteTimeFromCartItem = (cartItem) => {
|
|
249
|
+
cartItem.start_date = void 0;
|
|
250
|
+
cartItem.start_time = void 0;
|
|
251
|
+
cartItem.end_date = void 0;
|
|
252
|
+
cartItem.end_time = void 0;
|
|
253
|
+
cartItem._origin.select_date = null;
|
|
254
|
+
cartItem._origin.start_date = null;
|
|
255
|
+
cartItem._origin.start_time = null;
|
|
256
|
+
cartItem._origin.end_date = null;
|
|
257
|
+
cartItem._origin.end_time = null;
|
|
258
|
+
return cartItem;
|
|
259
|
+
};
|
|
229
260
|
var formatNoteToCartItem = (params) => {
|
|
230
261
|
const { cartItem, note } = params;
|
|
231
262
|
cartItem.note = note;
|
|
@@ -340,6 +371,8 @@ var getProductOriginTotalPrice = (params) => {
|
|
|
340
371
|
// Annotate the CommonJS export names for ESM import in node:
|
|
341
372
|
0 && (module.exports = {
|
|
342
373
|
createCartItemOrigin,
|
|
374
|
+
deleteResourceFromCartItem,
|
|
375
|
+
deleteTimeFromCartItem,
|
|
343
376
|
formatAccountToCartItem,
|
|
344
377
|
formatAccountToCartItemOrigin,
|
|
345
378
|
formatBundle,
|
|
@@ -52,9 +52,8 @@ var calculateSubtotal = (items) => {
|
|
|
52
52
|
return "0.00";
|
|
53
53
|
}
|
|
54
54
|
const subtotal = items.reduce((sum, item) => {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
return sum.plus(price.times(quantity));
|
|
55
|
+
const cartItemTotalPrice = new import_decimal.default(item.total || 0);
|
|
56
|
+
return sum.plus(cartItemTotalPrice);
|
|
58
57
|
}, new import_decimal.default(0));
|
|
59
58
|
return subtotal.toFixed(2);
|
|
60
59
|
};
|
|
@@ -64,9 +63,9 @@ var calculateTaxFee = (shopInfo, items) => {
|
|
|
64
63
|
}
|
|
65
64
|
const { is_price_include_tax, tax_rate } = shopInfo || {};
|
|
66
65
|
const totalTaxFee = items.reduce((sum, item) => {
|
|
67
|
-
const
|
|
66
|
+
const cartItemTotalPrice = new import_decimal.default(item.total || 0);
|
|
68
67
|
const taxRate = new import_decimal.default(tax_rate || 0).div(100);
|
|
69
|
-
const productTaxRate =
|
|
68
|
+
const productTaxRate = cartItemTotalPrice.times(taxRate).times((item == null ? void 0 : item.is_charge_tax) || 0).div(taxRate.times(is_price_include_tax || 0).plus(1));
|
|
70
69
|
return sum.plus(productTaxRate);
|
|
71
70
|
}, new import_decimal.default(0));
|
|
72
71
|
return totalTaxFee;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Module, PisellCore } from "../../types";
|
|
2
2
|
import { BaseModule } from "../../modules/BaseModule";
|
|
3
3
|
import { BookingByStepState } from "./types";
|
|
4
|
-
import { IUpdateItemParams, ProductData } from "../../modules";
|
|
4
|
+
import { CartItem, IUpdateItemParams, ProductData } from "../../modules";
|
|
5
5
|
import { Account } from "../../modules/Account/types";
|
|
6
6
|
import { IStep } from "../../modules/Step/tyeps";
|
|
7
7
|
import { TimeSliceItem } from "./utils/resources";
|
|
@@ -39,7 +39,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
39
39
|
removeAccount(id: string): void;
|
|
40
40
|
setDateRange(dateRange: ITime[]): Promise<void>;
|
|
41
41
|
getRangeDate(): Promise<string>;
|
|
42
|
-
getCart(): Promise<
|
|
42
|
+
getCart(): Promise<CartItem[]>;
|
|
43
43
|
getAvailableDate(params?: {
|
|
44
44
|
products?: ProductData[];
|
|
45
45
|
startDate?: string;
|
|
@@ -66,9 +66,17 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
66
66
|
}): Promise<void>;
|
|
67
67
|
getOtherParams(): Promise<Record<string, any>>;
|
|
68
68
|
updateCart(params: IUpdateItemParams): void;
|
|
69
|
-
deleteCart(
|
|
69
|
+
deleteCart(cartItemId: string): void;
|
|
70
70
|
clearCart(): void;
|
|
71
71
|
clearCartByAccount(account_id: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* 批量更新购物车
|
|
74
|
+
*/
|
|
75
|
+
batchUpdateCart(paramsList: IUpdateItemParams[]): void;
|
|
76
|
+
/**
|
|
77
|
+
* 从购物车中按类别删除信息
|
|
78
|
+
*/
|
|
79
|
+
deleteCartItemInfo(types: "resource" | "time"): void;
|
|
72
80
|
destory(): void;
|
|
73
81
|
getResourcesList(): any[];
|
|
74
82
|
getResourceTimeSlot({ product, resources, currentResourceId, }: {
|
|
@@ -272,7 +272,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
272
272
|
this.store.cart.updateItem(params);
|
|
273
273
|
}
|
|
274
274
|
// 删除购物车里某个商品
|
|
275
|
-
deleteCart(
|
|
275
|
+
deleteCart(cartItemId) {
|
|
276
|
+
this.store.cart.removeItem(cartItemId);
|
|
276
277
|
}
|
|
277
278
|
// 清空购物车
|
|
278
279
|
clearCart() {
|
|
@@ -282,6 +283,23 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
282
283
|
clearCartByAccount(account_id) {
|
|
283
284
|
this.store.cart.clearCartByAccount(account_id);
|
|
284
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* 批量更新购物车
|
|
288
|
+
*/
|
|
289
|
+
batchUpdateCart(paramsList) {
|
|
290
|
+
const cartItems = [];
|
|
291
|
+
paramsList.forEach((params) => {
|
|
292
|
+
const cartItem = this.store.cart.formatCartItem(params);
|
|
293
|
+
cartItems.push(cartItem);
|
|
294
|
+
});
|
|
295
|
+
this.store.cart.batchSetItems(cartItems);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* 从购物车中按类别删除信息
|
|
299
|
+
*/
|
|
300
|
+
deleteCartItemInfo(types) {
|
|
301
|
+
this.store.cart.deleteCartItemInfo(types);
|
|
302
|
+
}
|
|
285
303
|
destory() {
|
|
286
304
|
var _a, _b, _c, _d, _e, _f;
|
|
287
305
|
(_a = this.store.cart) == null ? void 0 : _a.destory();
|
|
@@ -305,11 +323,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
305
323
|
const cartItems = this.store.cart.getItems();
|
|
306
324
|
const arr = [];
|
|
307
325
|
cartItems.forEach((cartItem) => {
|
|
308
|
-
const productResources = (0, import_resources.getResourcesByProduct)(
|
|
309
|
-
resourcesMap,
|
|
310
|
-
cartItem,
|
|
311
|
-
cartItems
|
|
312
|
-
);
|
|
326
|
+
const productResources = (0, import_resources.getResourcesByProduct)(resourcesMap, cartItem, cartItems);
|
|
313
327
|
arr.push({
|
|
314
328
|
id: cartItem.id,
|
|
315
329
|
// 这里返回的是购物车 id ,后面提交的时候要用的,用这个 id 绑定资源和时间
|
|
@@ -484,7 +498,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
484
498
|
// 这里要做去重,避免出现同样类型的资源被塞进同一个商品
|
|
485
499
|
resources: [
|
|
486
500
|
...(item._origin.resources || []).filter(
|
|
487
|
-
(existingRes) => existingRes.
|
|
501
|
+
(existingRes) => existingRes.form_id !== res.selectedResource.form_id
|
|
488
502
|
),
|
|
489
503
|
res.selectedResource
|
|
490
504
|
]
|
|
@@ -494,14 +508,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
494
508
|
errorList.push(item._id);
|
|
495
509
|
}
|
|
496
510
|
} else {
|
|
497
|
-
const productResources = (0, import_resources.getResourcesByProduct)(
|
|
498
|
-
|
|
499
|
-
item,
|
|
500
|
-
allCartItems
|
|
501
|
-
);
|
|
502
|
-
const targetRenderList = (_a = productResources.find(
|
|
503
|
-
(n) => n.code === resources_code
|
|
504
|
-
)) == null ? void 0 : _a.renderList;
|
|
511
|
+
const productResources = (0, import_resources.getResourcesByProduct)(resourcesMap, item, allCartItems);
|
|
512
|
+
const targetRenderList = (_a = productResources.find((n) => n.code === resources_code)) == null ? void 0 : _a.renderList;
|
|
505
513
|
if (targetRenderList && targetRenderList.length > 0) {
|
|
506
514
|
this.store.cart.updateItem({
|
|
507
515
|
_id: item._id,
|
|
@@ -592,7 +600,10 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
592
600
|
newResources.forEach((n) => {
|
|
593
601
|
var _a, _b, _c, _d;
|
|
594
602
|
n.startTime = timeSlots.start_at.format("YYYY-MM-DD HH:mm");
|
|
595
|
-
n.endTime = (0, import_dayjs.default)(n.startTime).add(
|
|
603
|
+
n.endTime = (0, import_dayjs.default)(n.startTime).add(
|
|
604
|
+
((_b = (_a = item._productOrigin) == null ? void 0 : _a.duration) == null ? void 0 : _b.value) ?? 0,
|
|
605
|
+
((_d = (_c = item._productOrigin) == null ? void 0 : _c.duration) == null ? void 0 : _d.type) ?? "minutes"
|
|
606
|
+
).format("YYYY-MM-DD HH:mm");
|
|
596
607
|
delete n.times;
|
|
597
608
|
});
|
|
598
609
|
this.store.cart.updateItem({
|