@pisell/pisellos 3.0.38 → 3.0.40
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/types.d.ts +3 -1
- package/dist/modules/Cart/utils/cartProduct.js +3 -2
- package/dist/modules/Date/index.d.ts +1 -0
- package/dist/modules/Date/index.js +10 -0
- package/dist/modules/Summary/utils.js +2 -2
- package/dist/solution/BookingByStep/index.d.ts +2 -1
- package/dist/solution/BookingByStep/index.js +163 -104
- package/dist/solution/BookingByStep/utils/resources.d.ts +12 -2
- package/dist/solution/BookingByStep/utils/resources.js +15 -4
- package/lib/modules/Cart/types.d.ts +3 -1
- package/lib/modules/Cart/utils/cartProduct.js +2 -2
- package/lib/modules/Date/index.d.ts +1 -0
- package/lib/modules/Date/index.js +6 -0
- package/lib/modules/Summary/utils.js +2 -2
- package/lib/solution/BookingByStep/index.d.ts +2 -1
- package/lib/solution/BookingByStep/index.js +92 -45
- package/lib/solution/BookingByStep/utils/resources.d.ts +12 -2
- package/lib/solution/BookingByStep/utils/resources.js +13 -4
- package/package.json +1 -1
|
@@ -69,8 +69,10 @@ export interface CartItem {
|
|
|
69
69
|
name?: string;
|
|
70
70
|
/** 商品价格 */
|
|
71
71
|
price?: number | string;
|
|
72
|
-
/**
|
|
72
|
+
/** 单个商品包括商品本身价格+套餐价格+规格等价格得出来的 */
|
|
73
73
|
total?: number | string;
|
|
74
|
+
/** 基于 total 乘以 商品数量的价格 */
|
|
75
|
+
summaryTotal?: number | string;
|
|
74
76
|
/** 商品原价总价,排除原始价格为0的场景 */
|
|
75
77
|
origin_total?: number | string;
|
|
76
78
|
/** 商品数量 */
|
|
@@ -61,6 +61,7 @@ export var formatProductToCartItem = function formatProductToCartItem(params) {
|
|
|
61
61
|
options: options,
|
|
62
62
|
num: num
|
|
63
63
|
});
|
|
64
|
+
cartItem.summaryTotal = cartItem.total * (num || 1);
|
|
64
65
|
cartItem.origin_total = getProductOriginTotalPrice({
|
|
65
66
|
product: product,
|
|
66
67
|
bundle: bundle,
|
|
@@ -161,7 +162,7 @@ export var getProductTotalPrice = function getProductTotalPrice(params) {
|
|
|
161
162
|
var product = params.product,
|
|
162
163
|
bundle = params.bundle,
|
|
163
164
|
options = params.options;
|
|
164
|
-
|
|
165
|
+
// const num = params.num || 1;
|
|
165
166
|
var price = Number(product.price);
|
|
166
167
|
if (bundle !== null && bundle !== void 0 && bundle.length) {
|
|
167
168
|
price = bundle.reduce(function (accumulator, currentValue) {
|
|
@@ -175,7 +176,7 @@ export var getProductTotalPrice = function getProductTotalPrice(params) {
|
|
|
175
176
|
return accumulator + Number(currentValue.price) * Number(currentValue.num);
|
|
176
177
|
}, price);
|
|
177
178
|
}
|
|
178
|
-
return price
|
|
179
|
+
return price;
|
|
179
180
|
};
|
|
180
181
|
|
|
181
182
|
/**
|
|
@@ -20,4 +20,5 @@ export declare class DateModule extends BaseModule implements Module, DateModule
|
|
|
20
20
|
getResourceAvailableTimeList(params: IGetAvailableTimeListParams): Promise<ITime[]>;
|
|
21
21
|
clearDateRange(): void;
|
|
22
22
|
storeChange(): void;
|
|
23
|
+
getResourcesListByDate(date: string): any[] | undefined;
|
|
23
24
|
}
|
|
@@ -232,6 +232,16 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
+
}, {
|
|
236
|
+
key: "getResourcesListByDate",
|
|
237
|
+
value: function getResourcesListByDate(date) {
|
|
238
|
+
var _dateList$find;
|
|
239
|
+
var dateList = this.store.dateList;
|
|
240
|
+
var resourcesList = (_dateList$find = dateList.find(function (item) {
|
|
241
|
+
return item.date === date;
|
|
242
|
+
})) === null || _dateList$find === void 0 ? void 0 : _dateList$find.resource;
|
|
243
|
+
return resourcesList;
|
|
244
|
+
}
|
|
235
245
|
}]);
|
|
236
246
|
return DateModule;
|
|
237
247
|
}(BaseModule);
|
|
@@ -28,7 +28,7 @@ export var calculateSubtotal = function calculateSubtotal(items) {
|
|
|
28
28
|
return '0.00';
|
|
29
29
|
}
|
|
30
30
|
var subtotal = items.reduce(function (sum, item) {
|
|
31
|
-
var cartItemTotalPrice = new Decimal(item.
|
|
31
|
+
var cartItemTotalPrice = new Decimal(item.summaryTotal || 0);
|
|
32
32
|
return sum.plus(cartItemTotalPrice);
|
|
33
33
|
}, new Decimal(0));
|
|
34
34
|
return subtotal.toFixed(2);
|
|
@@ -50,7 +50,7 @@ export var calculateTaxFee = function calculateTaxFee(shopInfo, items) {
|
|
|
50
50
|
is_price_include_tax = _ref.is_price_include_tax,
|
|
51
51
|
tax_rate = _ref.tax_rate;
|
|
52
52
|
var totalTaxFee = items.reduce(function (sum, item) {
|
|
53
|
-
var cartItemTotalPrice = new Decimal(item.
|
|
53
|
+
var cartItemTotalPrice = new Decimal(item.summaryTotal || 0);
|
|
54
54
|
var taxRate = new Decimal(tax_rate || 0).div(100);
|
|
55
55
|
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));
|
|
56
56
|
return sum.plus(productTaxRate);
|
|
@@ -42,10 +42,11 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
42
42
|
* 更新step
|
|
43
43
|
*/
|
|
44
44
|
updateStep(key: string, step: IStep): void;
|
|
45
|
-
loadProducts({ category_ids, product_ids, collection, }: {
|
|
45
|
+
loadProducts({ category_ids, product_ids, collection, schedule_date, }: {
|
|
46
46
|
category_ids?: number[];
|
|
47
47
|
product_ids?: number[];
|
|
48
48
|
collection?: number | string[];
|
|
49
|
+
schedule_date?: string;
|
|
49
50
|
}): Promise<any>;
|
|
50
51
|
loadProductByScheduleDate({ date, product_ids, category_ids, }: {
|
|
51
52
|
date: string;
|