@pisell/pisellos 3.0.78 → 3.0.80
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 +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +21 -1
- package/dist/modules/Cart/utils/changePrice.js +6 -0
- package/dist/modules/Date/index.d.ts +1 -1
- package/dist/modules/Date/index.js +16 -8
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +2 -1
- package/dist/modules/Rules/index.js +14 -14
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +747 -0
- package/dist/modules/Schedule/index.d.ts +9 -0
- package/dist/modules/Schedule/index.js +78 -0
- package/dist/modules/Summary/index.d.ts +3 -0
- package/dist/modules/Summary/index.js +134 -15
- package/dist/modules/Summary/types.d.ts +7 -0
- package/dist/modules/Summary/utils.d.ts +104 -1
- package/dist/modules/Summary/utils.js +1131 -13
- package/dist/solution/BookingByStep/index.d.ts +4 -7
- package/dist/solution/BookingByStep/index.js +234 -119
- package/dist/solution/ShopDiscount/index.js +2 -1
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +16 -1
- package/lib/modules/Cart/utils/changePrice.js +5 -0
- package/lib/modules/Date/index.d.ts +1 -1
- package/lib/modules/Date/index.js +7 -1
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +2 -1
- package/lib/modules/Rules/index.js +3 -3
- package/lib/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +451 -0
- package/lib/modules/Schedule/index.d.ts +9 -0
- package/lib/modules/Schedule/index.js +62 -0
- package/lib/modules/Summary/index.d.ts +3 -0
- package/lib/modules/Summary/index.js +61 -2
- package/lib/modules/Summary/types.d.ts +7 -0
- package/lib/modules/Summary/utils.d.ts +104 -1
- package/lib/modules/Summary/utils.js +673 -8
- package/lib/solution/BookingByStep/index.d.ts +4 -7
- package/lib/solution/BookingByStep/index.js +185 -90
- package/lib/solution/ShopDiscount/index.js +2 -1
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
13
13
|
import Decimal from 'decimal.js';
|
|
14
14
|
import { isNormalProduct } from "../../Product/utils";
|
|
15
15
|
import { getDiscountAmount } from "../../../solution/ShopDiscount/utils";
|
|
16
|
+
import { calcDiscountListDifference } from "../../Summary/utils";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* @title 处理组合商品
|
|
@@ -69,6 +70,11 @@ export var formatProductToCartItem = function formatProductToCartItem(params) {
|
|
|
69
70
|
num: num,
|
|
70
71
|
discounts: discounts
|
|
71
72
|
});
|
|
73
|
+
cartItem.totalDifference = getTotalDifference({
|
|
74
|
+
product: product,
|
|
75
|
+
bundle: bundle,
|
|
76
|
+
discounts: discounts
|
|
77
|
+
});
|
|
72
78
|
cartItem.summaryTotal = cartItem.total * (num || 1);
|
|
73
79
|
cartItem.origin_total = getProductOriginTotalPrice({
|
|
74
80
|
product: product,
|
|
@@ -218,6 +224,19 @@ export var getProductTotalPrice = function getProductTotalPrice(params) {
|
|
|
218
224
|
}
|
|
219
225
|
return Math.max(0, price);
|
|
220
226
|
};
|
|
227
|
+
var getTotalDifference = function getTotalDifference(params) {
|
|
228
|
+
var bundle = params.bundle,
|
|
229
|
+
discounts = params.discounts;
|
|
230
|
+
var bundleDiscountList = [];
|
|
231
|
+
if (bundle !== null && bundle !== void 0 && bundle.length) {
|
|
232
|
+
bundle.forEach(function (currentValue) {
|
|
233
|
+
bundleDiscountList.push.apply(bundleDiscountList, _toConsumableArray((currentValue === null || currentValue === void 0 ? void 0 : currentValue.discount_list) || []));
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
var allDiscounts = [].concat(_toConsumableArray(discounts || []), bundleDiscountList);
|
|
237
|
+
var productDiscountProductDiscountDifference = calcDiscountListDifference(allDiscounts);
|
|
238
|
+
return productDiscountProductDiscountDifference || 0;
|
|
239
|
+
};
|
|
221
240
|
|
|
222
241
|
/**
|
|
223
242
|
* 获取商品原始总价
|
|
@@ -304,7 +323,8 @@ export var formatBundle = function formatBundle(bundle) {
|
|
|
304
323
|
options: formatOptions(item === null || item === void 0 ? void 0 : item.option),
|
|
305
324
|
_bundle_product_id: item._bundle_product_id,
|
|
306
325
|
discount_list: item.discount_list,
|
|
307
|
-
originBundleItem: item.originBundleItem || item
|
|
326
|
+
originBundleItem: item.originBundleItem || item,
|
|
327
|
+
is_charge_tax: item === null || item === void 0 ? void 0 : item.is_charge_tax
|
|
308
328
|
};
|
|
309
329
|
});
|
|
310
330
|
};
|
|
@@ -57,6 +57,12 @@ function _updateAllCartItemPrice() {
|
|
|
57
57
|
if (targetBundleItem.price_type === 'markdown') {
|
|
58
58
|
targetBundleItem.price = new Decimal(targetBundleItem.price || 0).mul(-1).toNumber();
|
|
59
59
|
}
|
|
60
|
+
// 如果有选择 option,还需要加上 option 的价格
|
|
61
|
+
if (n.option) {
|
|
62
|
+
targetBundleItem.price = new Decimal(targetBundleItem.price || 0).add(n.option.reduce(function (pre, cur) {
|
|
63
|
+
return pre + new Decimal(cur.price || 0).mul(cur.num || 1).toNumber();
|
|
64
|
+
}, 0)).toNumber();
|
|
65
|
+
}
|
|
60
66
|
if (targetBundleItem) {
|
|
61
67
|
return _objectSpread(_objectSpread({}, n), {}, {
|
|
62
68
|
price: targetBundleItem.price,
|
|
@@ -37,5 +37,5 @@ export declare class DateModule extends BaseModule implements Module, DateModule
|
|
|
37
37
|
getResourceAvailableTimeList(params: IGetAvailableTimeListParams): Promise<ITime[]>;
|
|
38
38
|
clearDateRange(): void;
|
|
39
39
|
storeChange(): void;
|
|
40
|
-
getResourcesListByDate(date: string): any[]
|
|
40
|
+
getResourcesListByDate(date: string): any[];
|
|
41
41
|
}
|
|
@@ -85,6 +85,14 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
85
85
|
}, {
|
|
86
86
|
key: "setDateRange",
|
|
87
87
|
value: function setDateRange(dateRange) {
|
|
88
|
+
var _this2 = this;
|
|
89
|
+
// 如果 dateRange 传入的日期里没有 resource,但是本地有的,要尝试补充下
|
|
90
|
+
dateRange.forEach(function (item) {
|
|
91
|
+
var _item$resource;
|
|
92
|
+
if (!((_item$resource = item.resource) !== null && _item$resource !== void 0 && _item$resource.length)) {
|
|
93
|
+
item.resource = _this2.getResourcesListByDate(item.date);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
88
96
|
this.store.dateRange = dateRange;
|
|
89
97
|
}
|
|
90
98
|
}, {
|
|
@@ -157,10 +165,10 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
157
165
|
return n.date === item.date;
|
|
158
166
|
});
|
|
159
167
|
if (currentItemIndex !== -1) {
|
|
160
|
-
var _item$
|
|
168
|
+
var _item$resource2, _currentItem$resource3;
|
|
161
169
|
var currentItem = currentDateList[currentItemIndex];
|
|
162
170
|
// 看那一天的数据有没有相同的,把不同的资源合并进去即可
|
|
163
|
-
var newResource = (_item$
|
|
171
|
+
var newResource = (_item$resource2 = item.resource) === null || _item$resource2 === void 0 ? void 0 : _item$resource2.filter(function (n) {
|
|
164
172
|
var _currentItem$resource2;
|
|
165
173
|
return !((_currentItem$resource2 = currentItem.resource) !== null && _currentItem$resource2 !== void 0 && _currentItem$resource2.some(function (m) {
|
|
166
174
|
return m.id === n.id;
|
|
@@ -168,8 +176,8 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
168
176
|
});
|
|
169
177
|
// 如果有相同的资源,则使用 item 中的新的resource.times,而不是 currentItem 中的
|
|
170
178
|
(_currentItem$resource3 = currentItem.resource) === null || _currentItem$resource3 === void 0 || _currentItem$resource3.forEach(function (n) {
|
|
171
|
-
var _item$
|
|
172
|
-
var newResource = (_item$
|
|
179
|
+
var _item$resource3;
|
|
180
|
+
var newResource = (_item$resource3 = item.resource) === null || _item$resource3 === void 0 ? void 0 : _item$resource3.find(function (m) {
|
|
173
181
|
return m.id === n.id;
|
|
174
182
|
});
|
|
175
183
|
if (newResource) {
|
|
@@ -261,7 +269,7 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
261
269
|
}, {
|
|
262
270
|
key: "correctResourceTimeSlots",
|
|
263
271
|
value: function correctResourceTimeSlots(resourcesData) {
|
|
264
|
-
var
|
|
272
|
+
var _this3 = this;
|
|
265
273
|
return resourcesData.map(function (resource) {
|
|
266
274
|
// 检查资源是否有 times 数组和 start_time
|
|
267
275
|
if (!resource.times || !Array.isArray(resource.times) || !resource.start_time) {
|
|
@@ -284,7 +292,7 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
284
292
|
// 如果 start_at 早于资源的 start_time,需要修正
|
|
285
293
|
if (startAt.isBefore(resourceStartTime)) {
|
|
286
294
|
// 将 start_time 向上取整到下一个10分钟整数
|
|
287
|
-
var roundedStartTime =
|
|
295
|
+
var roundedStartTime = _this3.roundUpToNext10Minutes(resourceStartTime);
|
|
288
296
|
var roundedStartTimeDayjs = dayjs(roundedStartTime);
|
|
289
297
|
console.log("[DateModule] \u4FEE\u6B63\u65F6\u95F4\u6BB5\u5F00\u59CB\u65F6\u95F4: ".concat(timeSlot.start_at, " -> ").concat(roundedStartTime, " (\u8D44\u6E90ID: ").concat(resource.id, ", \u539F\u59CBstart_time: ").concat(resource.start_time, ")"));
|
|
290
298
|
|
|
@@ -393,9 +401,9 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
393
401
|
value: function getResourcesListByDate(date) {
|
|
394
402
|
var _dateList$find;
|
|
395
403
|
var dateList = this.store.dateList;
|
|
396
|
-
var resourcesList = (_dateList$find = dateList.find(function (item) {
|
|
404
|
+
var resourcesList = (dateList === null || dateList === void 0 || (_dateList$find = dateList.find(function (item) {
|
|
397
405
|
return item.date === date;
|
|
398
|
-
})) === null || _dateList$find === void 0 ? void 0 : _dateList$find.resource;
|
|
406
|
+
})) === null || _dateList$find === void 0 ? void 0 : _dateList$find.resource) || [];
|
|
399
407
|
return resourcesList;
|
|
400
408
|
}
|
|
401
409
|
}]);
|
|
@@ -22,6 +22,7 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
22
22
|
with_discount_card: 0 | 1;
|
|
23
23
|
customer_id: number;
|
|
24
24
|
with_wallet_pass_holder: 0 | 1;
|
|
25
|
+
request_timezone: string;
|
|
25
26
|
}): Promise<Discount[]>;
|
|
26
27
|
batchSearch(code: string, customerId?: number): Promise<Discount[]>;
|
|
27
28
|
filterEnabledDiscountList(discountList: Discount[]): Discount[];
|
|
@@ -190,7 +190,8 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
190
190
|
relation_product: 1,
|
|
191
191
|
with: ['extensionData', 'customScheduleSnapshot', 'holder.detail'],
|
|
192
192
|
order_behavior_count: 1,
|
|
193
|
-
order_behavior_count_customer_id: customerId || 1
|
|
193
|
+
order_behavior_count_customer_id: customerId || 1,
|
|
194
|
+
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
194
195
|
});
|
|
195
196
|
case 2:
|
|
196
197
|
result = _context5.sent;
|
|
@@ -691,7 +691,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
691
691
|
// 收集该折扣卡适用的商品(排除被其他专属折扣卡占用的商品)
|
|
692
692
|
var applicableProducts = [];
|
|
693
693
|
sortedFlattenedList.forEach(function (flatItem) {
|
|
694
|
-
var _flatItem$parentProdu2, _product$price, _ref5, _flatItem$original_pr;
|
|
694
|
+
var _flatItem$parentProdu2, _flatItem$parentProdu3, _product$price, _ref5, _flatItem$original_pr;
|
|
695
695
|
// 🔥 检查该商品是否被其他专属折扣卡占用
|
|
696
696
|
var occupyingDiscountId = occupiedItems.get(flatItem._id);
|
|
697
697
|
if (occupyingDiscountId !== undefined && occupyingDiscountId !== discount.id) {
|
|
@@ -715,7 +715,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
715
715
|
}
|
|
716
716
|
|
|
717
717
|
// 对于 bundle 子商品,quantity 需要乘以主商品的购买数量
|
|
718
|
-
var quantity = flatItem.type === 'main' ? product.quantity || 1 : (product.num || 1) * (((_flatItem$parentProdu2 = flatItem.parentProduct) === null || _flatItem$parentProdu2 === void 0 ? void 0 : _flatItem$parentProdu2.quantity) || 1);
|
|
718
|
+
var quantity = flatItem.type === 'main' ? product.num || product.quantity || 1 : (product.num || product.quantity || 1) * (((_flatItem$parentProdu2 = flatItem.parentProduct) === null || _flatItem$parentProdu2 === void 0 ? void 0 : _flatItem$parentProdu2.num) || ((_flatItem$parentProdu3 = flatItem.parentProduct) === null || _flatItem$parentProdu3 === void 0 ? void 0 : _flatItem$parentProdu3.quantity) || 1);
|
|
719
719
|
|
|
720
720
|
// 对于主商品:使用 price
|
|
721
721
|
// 对于子商品:优先使用 flatItem.original_price,否则使用 flatItem.price
|
|
@@ -730,8 +730,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
730
730
|
|
|
731
731
|
// 子商品需要传递主商品数量
|
|
732
732
|
if (flatItem.type === 'bundle') {
|
|
733
|
-
var _flatItem$
|
|
734
|
-
productData.parentQuantity = ((_flatItem$
|
|
733
|
+
var _flatItem$parentProdu4;
|
|
734
|
+
productData.parentQuantity = ((_flatItem$parentProdu4 = flatItem.parentProduct) === null || _flatItem$parentProdu4 === void 0 ? void 0 : _flatItem$parentProdu4.quantity) || 1;
|
|
735
735
|
}
|
|
736
736
|
applicableProducts.push(productData);
|
|
737
737
|
});
|
|
@@ -758,7 +758,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
758
758
|
product = flatItem.product;
|
|
759
759
|
originProduct = flatItem.originProduct;
|
|
760
760
|
} else {
|
|
761
|
-
var _flatItem$
|
|
761
|
+
var _flatItem$parentProdu5;
|
|
762
762
|
// bundle子商品:构造虚拟商品对象
|
|
763
763
|
product = {
|
|
764
764
|
_id: flatItem._id,
|
|
@@ -770,7 +770,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
770
770
|
origin_total: flatItem.origin_total,
|
|
771
771
|
booking_id: flatItem.booking_id,
|
|
772
772
|
discount_list: flatItem.discount_list || [],
|
|
773
|
-
startDate: (_flatItem$
|
|
773
|
+
startDate: (_flatItem$parentProdu5 = flatItem.parentProduct) === null || _flatItem$parentProdu5 === void 0 ? void 0 : _flatItem$parentProdu5.startDate
|
|
774
774
|
};
|
|
775
775
|
originProduct = flatItem.originProduct;
|
|
776
776
|
}
|
|
@@ -849,7 +849,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
849
849
|
product = flatItem.product;
|
|
850
850
|
originProduct = flatItem.originProduct;
|
|
851
851
|
} else {
|
|
852
|
-
var _flatItem$bundleItem5, _flatItem$bundleItem6, _flatItem$bundleItem7, _flatItem$
|
|
852
|
+
var _flatItem$bundleItem5, _flatItem$bundleItem6, _flatItem$bundleItem7, _flatItem$parentProdu6;
|
|
853
853
|
// bundle子商品
|
|
854
854
|
product = {
|
|
855
855
|
_id: flatItem._id,
|
|
@@ -862,7 +862,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
862
862
|
origin_total: flatItem === null || flatItem === void 0 || (_flatItem$bundleItem6 = flatItem.bundleItem) === null || _flatItem$bundleItem6 === void 0 ? void 0 : _flatItem$bundleItem6.original_price,
|
|
863
863
|
booking_id: flatItem.booking_id,
|
|
864
864
|
discount_list: (flatItem === null || flatItem === void 0 || (_flatItem$bundleItem7 = flatItem.bundleItem) === null || _flatItem$bundleItem7 === void 0 ? void 0 : _flatItem$bundleItem7.discount_list) || [],
|
|
865
|
-
startDate: (_flatItem$
|
|
865
|
+
startDate: (_flatItem$parentProdu6 = flatItem.parentProduct) === null || _flatItem$parentProdu6 === void 0 ? void 0 : _flatItem$parentProdu6.startDate
|
|
866
866
|
};
|
|
867
867
|
originProduct = flatItem.originProduct;
|
|
868
868
|
}
|
|
@@ -974,11 +974,11 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
974
974
|
}
|
|
975
975
|
// bundle子商品:检查自己的 discount_list 或父主商品的 discount_list
|
|
976
976
|
if (flatItem.type === 'bundle') {
|
|
977
|
-
var _product$discount_lis7, _flatItem$
|
|
977
|
+
var _product$discount_lis7, _flatItem$parentProdu7;
|
|
978
978
|
if ((_product$discount_lis7 = product.discount_list) !== null && _product$discount_lis7 !== void 0 && _product$discount_lis7.some(function (item) {
|
|
979
979
|
var _item$discount2;
|
|
980
980
|
return ((_item$discount2 = item.discount) === null || _item$discount2 === void 0 ? void 0 : _item$discount2.resource_id) === options.discountId;
|
|
981
|
-
}) || (_flatItem$
|
|
981
|
+
}) || (_flatItem$parentProdu7 = flatItem.parentProduct) !== null && _flatItem$parentProdu7 !== void 0 && (_flatItem$parentProdu7 = _flatItem$parentProdu7.discount_list) !== null && _flatItem$parentProdu7 !== void 0 && _flatItem$parentProdu7.some(function (item) {
|
|
982
982
|
var _item$discount3;
|
|
983
983
|
return ((_item$discount3 = item.discount) === null || _item$discount3 === void 0 ? void 0 : _item$discount3.resource_id) === options.discountId;
|
|
984
984
|
})) {
|
|
@@ -1000,14 +1000,14 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
// bundle子商品:检查自己的 discount_list 或父主商品的 discount_list
|
|
1002
1002
|
if (flatItem.type === 'bundle') {
|
|
1003
|
-
var _product$discount_lis9, _flatItem$
|
|
1003
|
+
var _product$discount_lis9, _flatItem$parentProdu8;
|
|
1004
1004
|
if ((_product$discount_lis9 = product.discount_list) !== null && _product$discount_lis9 !== void 0 && _product$discount_lis9.some(function (item) {
|
|
1005
1005
|
var _options$selectedList2;
|
|
1006
1006
|
return options === null || options === void 0 || (_options$selectedList2 = options.selectedList) === null || _options$selectedList2 === void 0 ? void 0 : _options$selectedList2.some(function (n) {
|
|
1007
1007
|
var _item$discount5;
|
|
1008
1008
|
return n.discountId === ((_item$discount5 = item.discount) === null || _item$discount5 === void 0 ? void 0 : _item$discount5.resource_id);
|
|
1009
1009
|
});
|
|
1010
|
-
}) || (_flatItem$
|
|
1010
|
+
}) || (_flatItem$parentProdu8 = flatItem.parentProduct) !== null && _flatItem$parentProdu8 !== void 0 && (_flatItem$parentProdu8 = _flatItem$parentProdu8.discount_list) !== null && _flatItem$parentProdu8 !== void 0 && _flatItem$parentProdu8.some(function (item) {
|
|
1011
1011
|
var _options$selectedList3;
|
|
1012
1012
|
return options === null || options === void 0 || (_options$selectedList3 = options.selectedList) === null || _options$selectedList3 === void 0 ? void 0 : _options$selectedList3.some(function (n) {
|
|
1013
1013
|
var _item$discount6;
|
|
@@ -1260,7 +1260,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1260
1260
|
}));
|
|
1261
1261
|
}
|
|
1262
1262
|
} else {
|
|
1263
|
-
var _selectedDiscount3$me, _selectedDiscount3$me2, _flatItem$
|
|
1263
|
+
var _selectedDiscount3$me, _selectedDiscount3$me2, _flatItem$parentProdu9;
|
|
1264
1264
|
// 折扣卡:不拆分数量,直接应用
|
|
1265
1265
|
var _selectedDiscount3 = selectedDiscountCard || applicableDiscounts[0];
|
|
1266
1266
|
usedDiscounts.set(_selectedDiscount3.id, true);
|
|
@@ -1306,7 +1306,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1306
1306
|
}, _productDiscountDifference !== undefined && {
|
|
1307
1307
|
product_discount_difference: _productDiscountDifference
|
|
1308
1308
|
}),
|
|
1309
|
-
_num: (product.num || 1) * ((flatItem === null || flatItem === void 0 || (_flatItem$
|
|
1309
|
+
_num: (product.num || 1) * ((flatItem === null || flatItem === void 0 || (_flatItem$parentProdu9 = flatItem.parentProduct) === null || _flatItem$parentProdu9 === void 0 ? void 0 : _flatItem$parentProdu9.num) || 1)
|
|
1310
1310
|
};
|
|
1311
1311
|
|
|
1312
1312
|
// 记录实际应用的折扣
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import { ScheduleItem } from "./types";
|
|
3
|
+
export declare const getDateIsInSchedule: (dateTime: string, scheduleList: ScheduleItem[]) => boolean;
|
|
4
|
+
export type ScheduleTimeSlot = {
|
|
5
|
+
/** 开始时间 HH:mm */
|
|
6
|
+
start_time: string;
|
|
7
|
+
/** 结束时间 HH:mm */
|
|
8
|
+
end_time: string;
|
|
9
|
+
/** 开始日期时间 YYYY-MM-DD HH:mm:ss */
|
|
10
|
+
start_at: dayjs.Dayjs;
|
|
11
|
+
/** 结束日期时间 YYYY-MM-DD HH:mm:ss */
|
|
12
|
+
end_at: dayjs.Dayjs;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 获取当前日期日程时间点
|
|
16
|
+
* @param date 日期 YYYY-MM-DD
|
|
17
|
+
* @param scheduleList 日程列表
|
|
18
|
+
* @returns 当前日期日程时间点 结构,数组 [{
|
|
19
|
+
*
|
|
20
|
+
* // HH:mm
|
|
21
|
+
* end_time: string,
|
|
22
|
+
* // HH:mm
|
|
23
|
+
* start_time: string,
|
|
24
|
+
* // 日期时间
|
|
25
|
+
* // YYYY-MM-DD HH:mm:ss
|
|
26
|
+
* end_at: Dayjs,
|
|
27
|
+
* // YYYY-MM-DD HH:mm:ss
|
|
28
|
+
* start_at: Dayjs,
|
|
29
|
+
*
|
|
30
|
+
* }]
|
|
31
|
+
*/
|
|
32
|
+
export declare const getScheduleStartEndTimePoints: (date: string, scheduleList: ScheduleItem[]) => ScheduleTimeSlot[];
|