@pisell/pisellos 2.1.170 → 2.1.172
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/index.d.ts +1 -1
- package/dist/index.js +1 -3
- package/dist/model/strategy/adapter/index.d.ts +0 -4
- package/dist/model/strategy/adapter/index.js +1 -5
- package/dist/model/strategy/adapter/promotion/evaluator.js +99 -26
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +61 -8
- package/dist/model/strategy/adapter/walletPass/locales.js +12 -3
- package/dist/model/strategy/engine.d.ts +18 -5
- package/dist/model/strategy/engine.js +145 -45
- package/dist/model/strategy/type.d.ts +17 -0
- package/dist/model/strategy/type.js +4 -0
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +56 -25
- package/dist/modules/Cart/utils/changePrice.js +9 -16
- package/dist/modules/Discount/index.d.ts +4 -13
- package/dist/modules/Discount/index.js +12 -124
- package/dist/modules/Discount/types.d.ts +18 -13
- package/dist/modules/Order/index.d.ts +1 -67
- package/dist/modules/Order/index.js +30 -918
- package/dist/modules/Order/types.d.ts +12 -176
- package/dist/modules/Order/types.js +0 -2
- package/dist/modules/Order/utils.d.ts +0 -118
- package/dist/modules/Order/utils.js +2 -586
- package/dist/modules/Payment/index.d.ts +2 -1
- package/dist/modules/Payment/index.js +10 -7
- package/dist/modules/Payment/utils.js +3 -0
- package/dist/modules/Payment/walletpass.d.ts +23 -0
- package/dist/modules/Payment/walletpass.js +191 -95
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +2 -4
- package/dist/modules/ProductList/index.js +12 -24
- package/dist/modules/Rules/index.d.ts +9 -5
- package/dist/modules/Rules/index.js +669 -173
- package/dist/modules/Rules/types.d.ts +2 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +18 -16
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/modules/Summary/types.d.ts +2 -0
- package/dist/modules/Summary/utils.d.ts +9 -3
- package/dist/modules/Summary/utils.js +57 -67
- package/dist/modules/index.d.ts +0 -4
- package/dist/modules/index.js +1 -5
- package/dist/plugins/window.d.ts +2 -0
- package/dist/solution/BookingByStep/index.d.ts +3 -2
- package/dist/solution/BookingByStep/index.js +43 -46
- package/dist/solution/BookingByStep/types.d.ts +1 -3
- package/dist/solution/BookingByStep/types.js +1 -5
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/Checkout/index.js +2 -0
- package/dist/solution/ShopDiscount/index.d.ts +2 -3
- package/dist/solution/ShopDiscount/index.js +60 -62
- package/dist/solution/ShopDiscount/types.d.ts +1 -1
- package/dist/solution/ShopDiscount/types.js +2 -1
- package/dist/solution/ShopDiscount/utils.js +26 -12
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -4
- package/lib/model/strategy/adapter/index.d.ts +0 -4
- package/lib/model/strategy/adapter/index.js +2 -13
- package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +34 -3
- package/lib/model/strategy/adapter/walletPass/locales.js +12 -3
- package/lib/model/strategy/engine.d.ts +18 -5
- package/lib/model/strategy/engine.js +85 -21
- package/lib/model/strategy/type.d.ts +17 -0
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +39 -12
- package/lib/modules/Cart/utils/changePrice.js +9 -13
- package/lib/modules/Discount/index.d.ts +4 -13
- package/lib/modules/Discount/index.js +5 -76
- package/lib/modules/Discount/types.d.ts +18 -13
- package/lib/modules/Order/index.d.ts +1 -67
- package/lib/modules/Order/index.js +1 -525
- package/lib/modules/Order/types.d.ts +12 -176
- package/lib/modules/Order/utils.d.ts +0 -118
- package/lib/modules/Order/utils.js +2 -483
- package/lib/modules/Payment/index.d.ts +2 -1
- package/lib/modules/Payment/index.js +1 -0
- package/lib/modules/Payment/utils.js +3 -0
- package/lib/modules/Payment/walletpass.d.ts +23 -0
- package/lib/modules/Payment/walletpass.js +94 -17
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +2 -4
- package/lib/modules/ProductList/index.js +39 -46
- package/lib/modules/Rules/index.d.ts +9 -5
- package/lib/modules/Rules/index.js +776 -292
- package/lib/modules/Rules/types.d.ts +2 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +11 -13
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/modules/Summary/types.d.ts +2 -0
- package/lib/modules/Summary/utils.d.ts +9 -3
- package/lib/modules/Summary/utils.js +34 -45
- package/lib/modules/index.d.ts +0 -4
- package/lib/modules/index.js +1 -9
- package/lib/plugins/window.d.ts +2 -0
- package/lib/solution/BookingByStep/index.d.ts +3 -2
- package/lib/solution/BookingByStep/index.js +4 -6
- package/lib/solution/BookingByStep/types.d.ts +1 -3
- package/lib/solution/BookingByStep/types.js +0 -10
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/Checkout/index.js +2 -0
- package/lib/solution/ShopDiscount/index.d.ts +2 -3
- package/lib/solution/ShopDiscount/index.js +27 -22
- package/lib/solution/ShopDiscount/types.d.ts +1 -1
- package/lib/solution/ShopDiscount/utils.js +10 -6
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/package.json +2 -2
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +0 -1
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -867
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -149
- package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
- package/dist/modules/OpenData/index.d.ts +0 -24
- package/dist/modules/OpenData/index.js +0 -173
- package/dist/modules/OpenData/types.d.ts +0 -73
- package/dist/modules/OpenData/types.js +0 -1
- package/dist/modules/OpenData/utils.d.ts +0 -2
- package/dist/modules/OpenData/utils.js +0 -75
- package/dist/modules/Quotation/index.d.ts +0 -48
- package/dist/modules/Quotation/index.js +0 -248
- package/dist/modules/Quotation/types.d.ts +0 -42
- package/dist/modules/Quotation/types.js +0 -1
- package/dist/modules/SalesSummary/index.d.ts +0 -63
- package/dist/modules/SalesSummary/index.js +0 -174
- package/dist/modules/SalesSummary/types.d.ts +0 -60
- package/dist/modules/SalesSummary/types.js +0 -1
- package/dist/modules/SalesSummary/utils.d.ts +0 -30
- package/dist/modules/SalesSummary/utils.js +0 -480
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -23
- package/dist/modules/ScanOrderLogger/index.js +0 -174
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +0 -221
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/grafana.js +0 -50
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
- package/dist/modules/ScanOrderLogger/types.js +0 -1
- package/dist/solution/ScanOrder/index.d.ts +0 -158
- package/dist/solution/ScanOrder/index.js +0 -3474
- package/dist/solution/ScanOrder/types.d.ts +0 -306
- package/dist/solution/ScanOrder/types.js +0 -35
- package/dist/solution/ScanOrder/utils.d.ts +0 -172
- package/dist/solution/ScanOrder/utils.js +0 -796
- package/dist/solution/VenueBooking/index.d.ts +0 -252
- package/dist/solution/VenueBooking/index.js +0 -3769
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/dist/solution/VenueBooking/types.d.ts +0 -156
- package/dist/solution/VenueBooking/types.js +0 -22
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/dist/solution/VenueBooking/utils/dateSummary.js +0 -91
- package/dist/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/dist/solution/VenueBooking/utils/resource.js +0 -131
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -32
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -233
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -302
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
- package/dist/solution/VenueBooking/utils/timeSlot.js +0 -458
- package/dist/solution/VenueBooking/utils.d.ts +0 -1
- package/dist/solution/VenueBooking/utils.js +0 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -666
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -149
- package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
- package/lib/modules/OpenData/index.d.ts +0 -24
- package/lib/modules/OpenData/index.js +0 -119
- package/lib/modules/OpenData/types.d.ts +0 -73
- package/lib/modules/OpenData/types.js +0 -17
- package/lib/modules/OpenData/utils.d.ts +0 -2
- package/lib/modules/OpenData/utils.js +0 -111
- package/lib/modules/Quotation/index.d.ts +0 -48
- package/lib/modules/Quotation/index.js +0 -152
- package/lib/modules/Quotation/types.d.ts +0 -42
- package/lib/modules/Quotation/types.js +0 -17
- package/lib/modules/SalesSummary/index.d.ts +0 -63
- package/lib/modules/SalesSummary/index.js +0 -105
- package/lib/modules/SalesSummary/types.d.ts +0 -60
- package/lib/modules/SalesSummary/types.js +0 -17
- package/lib/modules/SalesSummary/utils.d.ts +0 -30
- package/lib/modules/SalesSummary/utils.js +0 -420
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -23
- package/lib/modules/ScanOrderLogger/index.js +0 -147
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/feishu.js +0 -157
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/grafana.js +0 -52
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
- package/lib/modules/ScanOrderLogger/types.js +0 -17
- package/lib/solution/ScanOrder/index.d.ts +0 -158
- package/lib/solution/ScanOrder/index.js +0 -2135
- package/lib/solution/ScanOrder/types.d.ts +0 -306
- package/lib/solution/ScanOrder/types.js +0 -36
- package/lib/solution/ScanOrder/utils.d.ts +0 -172
- package/lib/solution/ScanOrder/utils.js +0 -658
- package/lib/solution/VenueBooking/index.d.ts +0 -252
- package/lib/solution/VenueBooking/index.js +0 -2204
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/lib/solution/VenueBooking/types.d.ts +0 -156
- package/lib/solution/VenueBooking/types.js +0 -45
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/lib/solution/VenueBooking/utils/dateSummary.js +0 -105
- package/lib/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/lib/solution/VenueBooking/utils/resource.js +0 -92
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -32
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -236
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -225
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
- package/lib/solution/VenueBooking/utils/timeSlot.js +0 -343
- package/lib/solution/VenueBooking/utils.d.ts +0 -1
- package/lib/solution/VenueBooking/utils.js +0 -69
|
@@ -2008,7 +2008,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2008
2008
|
return n.code === resources_code;
|
|
2009
2009
|
})) === null || _productResources$fin === void 0 ? void 0 : _productResources$fin.renderList;
|
|
2010
2010
|
if (targetRenderList && targetRenderList.length > 0) {
|
|
2011
|
-
var _item$_origin$resourc2
|
|
2011
|
+
var _item$_origin$resourc2;
|
|
2012
2012
|
// 如果购物车里已经有同类型的 form_id 的资源了,则不处理
|
|
2013
2013
|
if ((_item$_origin$resourc2 = item._origin.resources) !== null && _item$_origin$resourc2 !== void 0 && _item$_origin$resourc2.some(function (n) {
|
|
2014
2014
|
return n.form_id === targetRenderList[0].form_id;
|
|
@@ -2018,9 +2018,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2018
2018
|
var fastestResource = findFastestAvailableResource({
|
|
2019
2019
|
resources: targetRenderList,
|
|
2020
2020
|
currentCapacity: currentCapacity,
|
|
2021
|
-
countMap: selectResourcesMap
|
|
2022
|
-
targetDate: dateRange === null || dateRange === void 0 || (_dateRange$5 = dateRange[0]) === null || _dateRange$5 === void 0 ? void 0 : _dateRange$5.date,
|
|
2023
|
-
durationMinutes: (item === null || item === void 0 || (_item$duration2 = item.duration) === null || _item$duration2 === void 0 ? void 0 : _item$duration2.value) || (item === null || item === void 0 || (_item$_productOrigin6 = item._productOrigin) === null || _item$_productOrigin6 === void 0 || (_item$_productOrigin6 = _item$_productOrigin6.duration) === null || _item$_productOrigin6 === void 0 ? void 0 : _item$_productOrigin6.value) || 10
|
|
2021
|
+
countMap: selectResourcesMap
|
|
2024
2022
|
});
|
|
2025
2023
|
var targetResource = fastestResource || targetRenderList[0];
|
|
2026
2024
|
targetResource.capacity = currentCapacity;
|
|
@@ -2071,7 +2069,6 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2071
2069
|
_cartItems$,
|
|
2072
2070
|
_cartItems$2,
|
|
2073
2071
|
_this$shopStore$get;
|
|
2074
|
-
var split = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
2075
2072
|
var dateRange = this.store.date.getDateRange();
|
|
2076
2073
|
// 取出购物车中所有一已选择的第一步资源
|
|
2077
2074
|
var resources = [];
|
|
@@ -2087,8 +2084,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2087
2084
|
var maxCutOffTime = undefined;
|
|
2088
2085
|
var maxCutOffTimeValue = dayjs();
|
|
2089
2086
|
cartItems.forEach(function (item) {
|
|
2090
|
-
var _item$
|
|
2091
|
-
(_item$
|
|
2087
|
+
var _item$_productOrigin6, _item$_productOrigin7, _item$_productOrigin8, _item$_productOrigin9;
|
|
2088
|
+
(_item$_productOrigin6 = item._productOrigin) === null || _item$_productOrigin6 === void 0 || (_item$_productOrigin6 = _item$_productOrigin6.product_resource) === null || _item$_productOrigin6 === void 0 || (_item$_productOrigin6 = _item$_productOrigin6.resources) === null || _item$_productOrigin6 === void 0 || _item$_productOrigin6.forEach(function (n) {
|
|
2092
2089
|
// TODO: 少了个 status 的判断
|
|
2093
2090
|
if (n.code === resources_code) {
|
|
2094
2091
|
resources.push.apply(resources, _toConsumableArray(n.renderList || []));
|
|
@@ -2101,10 +2098,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2101
2098
|
if (item.resource_id && !resourceIds.includes(item.resource_id)) {
|
|
2102
2099
|
resourceIds.push(item.resource_id);
|
|
2103
2100
|
}
|
|
2104
|
-
resourcesTypeId = item === null || item === void 0 || (_item$
|
|
2101
|
+
resourcesTypeId = item === null || item === void 0 || (_item$_productOrigin7 = item._productOrigin) === null || _item$_productOrigin7 === void 0 || (_item$_productOrigin7 = _item$_productOrigin7.product_resource) === null || _item$_productOrigin7 === void 0 || (_item$_productOrigin7 = _item$_productOrigin7.resources) === null || _item$_productOrigin7 === void 0 || (_item$_productOrigin7 = _item$_productOrigin7.find(function (n) {
|
|
2105
2102
|
return n.code === resources_code;
|
|
2106
|
-
})) === null || _item$
|
|
2107
|
-
if ((_item$
|
|
2103
|
+
})) === null || _item$_productOrigin7 === void 0 ? void 0 : _item$_productOrigin7.id;
|
|
2104
|
+
if ((_item$_productOrigin8 = item._productOrigin) !== null && _item$_productOrigin8 !== void 0 && _item$_productOrigin8.cut_off_time && ((_item$_productOrigin9 = item._productOrigin) === null || _item$_productOrigin9 === void 0 ? void 0 : _item$_productOrigin9.cut_off_time.type) === 'advance') {
|
|
2108
2105
|
var currentCutOffTime = dayjs().add(item._productOrigin.cut_off_time.unit, item._productOrigin.cut_off_time.unit_type);
|
|
2109
2106
|
if (currentCutOffTime.isAfter(maxCutOffTimeValue, 'minute')) {
|
|
2110
2107
|
maxCutOffTimeValue = currentCutOffTime;
|
|
@@ -2154,13 +2151,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2154
2151
|
cartItems.forEach(function (item) {
|
|
2155
2152
|
// 单个预约累加账号 多个预约取最大值
|
|
2156
2153
|
if (isSingleResource) {
|
|
2157
|
-
var _item$
|
|
2158
|
-
accountDuration += ((_item$
|
|
2154
|
+
var _item$_productOrigin10;
|
|
2155
|
+
accountDuration += ((_item$_productOrigin10 = item._productOrigin) === null || _item$_productOrigin10 === void 0 || (_item$_productOrigin10 = _item$_productOrigin10.duration) === null || _item$_productOrigin10 === void 0 ? void 0 : _item$_productOrigin10.value) || 10;
|
|
2159
2156
|
} else {
|
|
2160
|
-
var _item$
|
|
2161
|
-
if (accountDuration < (((_item$
|
|
2162
|
-
var _item$
|
|
2163
|
-
accountDuration = ((_item$
|
|
2157
|
+
var _item$_productOrigin11;
|
|
2158
|
+
if (accountDuration < (((_item$_productOrigin11 = item._productOrigin) === null || _item$_productOrigin11 === void 0 || (_item$_productOrigin11 = _item$_productOrigin11.duration) === null || _item$_productOrigin11 === void 0 ? void 0 : _item$_productOrigin11.value) || 10)) {
|
|
2159
|
+
var _item$_productOrigin12;
|
|
2160
|
+
accountDuration = ((_item$_productOrigin12 = item._productOrigin) === null || _item$_productOrigin12 === void 0 || (_item$_productOrigin12 = _item$_productOrigin12.duration) === null || _item$_productOrigin12 === void 0 ? void 0 : _item$_productOrigin12.value) || 10;
|
|
2164
2161
|
}
|
|
2165
2162
|
}
|
|
2166
2163
|
});
|
|
@@ -2197,8 +2194,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2197
2194
|
}
|
|
2198
2195
|
var resourcesUseableMap = {};
|
|
2199
2196
|
var hasFlexibleDuration = cartItems.some(function (item) {
|
|
2200
|
-
var _item$
|
|
2201
|
-
return ((_item$
|
|
2197
|
+
var _item$_productOrigin13;
|
|
2198
|
+
return ((_item$_productOrigin13 = item._productOrigin) === null || _item$_productOrigin13 === void 0 || (_item$_productOrigin13 = _item$_productOrigin13.duration) === null || _item$_productOrigin13 === void 0 ? void 0 : _item$_productOrigin13.type) === 'flexible';
|
|
2202
2199
|
});
|
|
2203
2200
|
var operating_day_boundary = (_this$shopStore$get = this.shopStore.get('core')) === null || _this$shopStore$get === void 0 || (_this$shopStore$get = _this$shopStore$get.core) === null || _this$shopStore$get === void 0 ? void 0 : _this$shopStore$get.operating_day_boundary;
|
|
2204
2201
|
|
|
@@ -2206,11 +2203,11 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2206
2203
|
var maxBlockThreshold = 0;
|
|
2207
2204
|
if (hasFlexibleDuration) {
|
|
2208
2205
|
maxBlockThreshold = cartItems.reduce(function (max, item) {
|
|
2209
|
-
var _item$
|
|
2206
|
+
var _item$_productOrigin14;
|
|
2210
2207
|
// 如果开启了灵活时长商品配置,则取 block_threshold 的值
|
|
2211
|
-
if ((_item$
|
|
2212
|
-
var _item$
|
|
2213
|
-
return Math.max(max, ((_item$
|
|
2208
|
+
if ((_item$_productOrigin14 = item._productOrigin) !== null && _item$_productOrigin14 !== void 0 && (_item$_productOrigin14 = _item$_productOrigin14.duration) !== null && _item$_productOrigin14 !== void 0 && (_item$_productOrigin14 = _item$_productOrigin14.flexible_config) !== null && _item$_productOrigin14 !== void 0 && _item$_productOrigin14.is_enable_minimum_duration) {
|
|
2209
|
+
var _item$_productOrigin15;
|
|
2210
|
+
return Math.max(max, ((_item$_productOrigin15 = item._productOrigin) === null || _item$_productOrigin15 === void 0 || (_item$_productOrigin15 = _item$_productOrigin15.duration) === null || _item$_productOrigin15 === void 0 || (_item$_productOrigin15 = _item$_productOrigin15.flexible_config) === null || _item$_productOrigin15 === void 0 ? void 0 : _item$_productOrigin15.block_threshold) || 0);
|
|
2214
2211
|
}
|
|
2215
2212
|
return 0;
|
|
2216
2213
|
}, 0);
|
|
@@ -2255,7 +2252,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2255
2252
|
resourcesMap: resourcesMap,
|
|
2256
2253
|
duration: duration,
|
|
2257
2254
|
currentDate: dateRange[0].date,
|
|
2258
|
-
split:
|
|
2255
|
+
split: 10,
|
|
2259
2256
|
resourcesUseableMap: resourcesUseableMap,
|
|
2260
2257
|
capacity: maxCapacity,
|
|
2261
2258
|
cut_off_time: maxCutOffTime,
|
|
@@ -2302,8 +2299,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2302
2299
|
maxCutOffTime = undefined;
|
|
2303
2300
|
maxCutOffTimeValue = dayjs();
|
|
2304
2301
|
cartItems.forEach(function (item) {
|
|
2305
|
-
var _item$
|
|
2306
|
-
(_item$
|
|
2302
|
+
var _item$_productOrigin16, _item$_productOrigin17, _item$_productOrigin18, _item$_productOrigin19;
|
|
2303
|
+
(_item$_productOrigin16 = item._productOrigin) === null || _item$_productOrigin16 === void 0 || (_item$_productOrigin16 = _item$_productOrigin16.product_resource) === null || _item$_productOrigin16 === void 0 || (_item$_productOrigin16 = _item$_productOrigin16.resources) === null || _item$_productOrigin16 === void 0 || _item$_productOrigin16.forEach(function (n) {
|
|
2307
2304
|
// TODO: 少了个 status 的判断
|
|
2308
2305
|
if (n.code === resources_code) {
|
|
2309
2306
|
resources.push.apply(resources, _toConsumableArray(n.renderList || []));
|
|
@@ -2316,10 +2313,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2316
2313
|
if (item.resource_id && !resourceIds.includes(item.resource_id)) {
|
|
2317
2314
|
resourceIds.push(item.resource_id);
|
|
2318
2315
|
}
|
|
2319
|
-
resourcesTypeId = item === null || item === void 0 || (_item$
|
|
2316
|
+
resourcesTypeId = item === null || item === void 0 || (_item$_productOrigin17 = item._productOrigin) === null || _item$_productOrigin17 === void 0 || (_item$_productOrigin17 = _item$_productOrigin17.product_resource) === null || _item$_productOrigin17 === void 0 || (_item$_productOrigin17 = _item$_productOrigin17.resources) === null || _item$_productOrigin17 === void 0 || (_item$_productOrigin17 = _item$_productOrigin17.find(function (n) {
|
|
2320
2317
|
return n.code === resources_code;
|
|
2321
|
-
})) === null || _item$
|
|
2322
|
-
if ((_item$
|
|
2318
|
+
})) === null || _item$_productOrigin17 === void 0 ? void 0 : _item$_productOrigin17.id;
|
|
2319
|
+
if ((_item$_productOrigin18 = item._productOrigin) !== null && _item$_productOrigin18 !== void 0 && _item$_productOrigin18.cut_off_time && ((_item$_productOrigin19 = item._productOrigin) === null || _item$_productOrigin19 === void 0 ? void 0 : _item$_productOrigin19.cut_off_time.type) === 'advance') {
|
|
2323
2320
|
var currentCutOffTime = dayjs().add(item._productOrigin.cut_off_time.unit, item._productOrigin.cut_off_time.unit_type);
|
|
2324
2321
|
if (currentCutOffTime.isAfter(maxCutOffTimeValue, 'minute')) {
|
|
2325
2322
|
maxCutOffTimeValue = currentCutOffTime;
|
|
@@ -2342,13 +2339,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2342
2339
|
cartItems.forEach(function (item) {
|
|
2343
2340
|
// 单个预约累加账号 多个预约取最大值
|
|
2344
2341
|
if (isSingleResource) {
|
|
2345
|
-
var _item$
|
|
2346
|
-
accountDuration += ((_item$
|
|
2342
|
+
var _item$_productOrigin20;
|
|
2343
|
+
accountDuration += ((_item$_productOrigin20 = item._productOrigin) === null || _item$_productOrigin20 === void 0 || (_item$_productOrigin20 = _item$_productOrigin20.duration) === null || _item$_productOrigin20 === void 0 ? void 0 : _item$_productOrigin20.value) || 10;
|
|
2347
2344
|
} else {
|
|
2348
|
-
var _item$
|
|
2349
|
-
if (accountDuration < (((_item$
|
|
2350
|
-
var _item$
|
|
2351
|
-
accountDuration = ((_item$
|
|
2345
|
+
var _item$_productOrigin21;
|
|
2346
|
+
if (accountDuration < (((_item$_productOrigin21 = item._productOrigin) === null || _item$_productOrigin21 === void 0 || (_item$_productOrigin21 = _item$_productOrigin21.duration) === null || _item$_productOrigin21 === void 0 ? void 0 : _item$_productOrigin21.value) || 10)) {
|
|
2347
|
+
var _item$_productOrigin22;
|
|
2348
|
+
accountDuration = ((_item$_productOrigin22 = item._productOrigin) === null || _item$_productOrigin22 === void 0 || (_item$_productOrigin22 = _item$_productOrigin22.duration) === null || _item$_productOrigin22 === void 0 ? void 0 : _item$_productOrigin22.value) || 10;
|
|
2352
2349
|
}
|
|
2353
2350
|
}
|
|
2354
2351
|
});
|
|
@@ -2374,18 +2371,18 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2374
2371
|
case 20:
|
|
2375
2372
|
resourcesUseableMap = {};
|
|
2376
2373
|
hasFlexibleDuration = cartItems.some(function (item) {
|
|
2377
|
-
var _item$
|
|
2378
|
-
return ((_item$
|
|
2374
|
+
var _item$_productOrigin23;
|
|
2375
|
+
return ((_item$_productOrigin23 = item._productOrigin) === null || _item$_productOrigin23 === void 0 || (_item$_productOrigin23 = _item$_productOrigin23.duration) === null || _item$_productOrigin23 === void 0 ? void 0 : _item$_productOrigin23.type) === 'flexible';
|
|
2379
2376
|
});
|
|
2380
2377
|
operating_day_boundary = (_this$shopStore$get2 = this.shopStore.get('core')) === null || _this$shopStore$get2 === void 0 || (_this$shopStore$get2 = _this$shopStore$get2.core) === null || _this$shopStore$get2 === void 0 ? void 0 : _this$shopStore$get2.operating_day_boundary; // 如果有 hasFlexibleDuration,需要把动态时长商品(可能是多个,取最长的那个最低禁止购买时长)的最低禁止购买时长作为 split 的值
|
|
2381
2378
|
maxBlockThreshold = 0;
|
|
2382
2379
|
if (hasFlexibleDuration) {
|
|
2383
2380
|
maxBlockThreshold = cartItems.reduce(function (max, item) {
|
|
2384
|
-
var _item$
|
|
2381
|
+
var _item$_productOrigin24;
|
|
2385
2382
|
// 如果开启了灵活时长商品配置,则取 block_threshold 的值
|
|
2386
|
-
if ((_item$
|
|
2387
|
-
var _item$
|
|
2388
|
-
return Math.max(max, ((_item$
|
|
2383
|
+
if ((_item$_productOrigin24 = item._productOrigin) !== null && _item$_productOrigin24 !== void 0 && (_item$_productOrigin24 = _item$_productOrigin24.duration) !== null && _item$_productOrigin24 !== void 0 && (_item$_productOrigin24 = _item$_productOrigin24.flexible_config) !== null && _item$_productOrigin24 !== void 0 && _item$_productOrigin24.is_enable_minimum_duration) {
|
|
2384
|
+
var _item$_productOrigin25;
|
|
2385
|
+
return Math.max(max, ((_item$_productOrigin25 = item._productOrigin) === null || _item$_productOrigin25 === void 0 || (_item$_productOrigin25 = _item$_productOrigin25.duration) === null || _item$_productOrigin25 === void 0 || (_item$_productOrigin25 = _item$_productOrigin25.flexible_config) === null || _item$_productOrigin25 === void 0 ? void 0 : _item$_productOrigin25.block_threshold) || 0);
|
|
2389
2386
|
}
|
|
2390
2387
|
return 0;
|
|
2391
2388
|
}, 0);
|
|
@@ -2546,10 +2543,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2546
2543
|
var osWarnTips = [];
|
|
2547
2544
|
var newResources = cloneDeep(item._origin.resources);
|
|
2548
2545
|
newResources.forEach(function (resource) {
|
|
2549
|
-
var _item$
|
|
2546
|
+
var _item$_productOrigin26;
|
|
2550
2547
|
// 如果商品配置的是灵活时长,开始时间设置为提交的时间,结束时间从资源的可用最晚时间和店铺营业结束时间里取一个最早的
|
|
2551
|
-
if (((_item$
|
|
2552
|
-
var _allResources$find, _item$
|
|
2548
|
+
if (((_item$_productOrigin26 = item._productOrigin) === null || _item$_productOrigin26 === void 0 || (_item$_productOrigin26 = _item$_productOrigin26.duration) === null || _item$_productOrigin26 === void 0 ? void 0 : _item$_productOrigin26.type) === 'flexible') {
|
|
2549
|
+
var _allResources$find, _item$_productOrigin27, _item$_productOrigin28;
|
|
2553
2550
|
item.duration = {
|
|
2554
2551
|
type: 'minutes',
|
|
2555
2552
|
value: 10
|
|
@@ -2632,15 +2629,15 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2632
2629
|
resource.endTime = formattedEndTime.format('YYYY-MM-DD HH:mm');
|
|
2633
2630
|
// 如果是动态时长商品,并且当前选择的时间的结束时间小于了最低提示时长(warningThreshold),则追加一个提示
|
|
2634
2631
|
// 如果currentStartTime + warningThreshold 大于 currentEndTime,且 osWarnTips 没有pisell2.product.card.closing-soon.warning 这一项,则加入这一项
|
|
2635
|
-
if ((_item$
|
|
2632
|
+
if ((_item$_productOrigin27 = item._productOrigin) !== null && _item$_productOrigin27 !== void 0 && (_item$_productOrigin27 = _item$_productOrigin27.duration) !== null && _item$_productOrigin27 !== void 0 && (_item$_productOrigin27 = _item$_productOrigin27.flexible_config) !== null && _item$_productOrigin27 !== void 0 && _item$_productOrigin27.is_enable_minimum_duration && dayjs(currentStartTime).add(((_item$_productOrigin28 = item._productOrigin) === null || _item$_productOrigin28 === void 0 || (_item$_productOrigin28 = _item$_productOrigin28.duration) === null || _item$_productOrigin28 === void 0 || (_item$_productOrigin28 = _item$_productOrigin28.flexible_config) === null || _item$_productOrigin28 === void 0 ? void 0 : _item$_productOrigin28.warning_threshold) || 0, 'minutes').isAfter(dayjs(formattedEndTime))) {
|
|
2636
2633
|
if (!osWarnTips.includes('pisell2.product.card.closing-soon.warning')) {
|
|
2637
2634
|
osWarnTips.push('pisell2.product.card.closing-soon.warning');
|
|
2638
2635
|
}
|
|
2639
2636
|
}
|
|
2640
2637
|
} else {
|
|
2641
|
-
var _item$
|
|
2638
|
+
var _item$_productOrigin29;
|
|
2642
2639
|
resource.startTime = currentStartTime;
|
|
2643
|
-
resource.endTime = dayjs(currentStartTime).add(((_item$
|
|
2640
|
+
resource.endTime = dayjs(currentStartTime).add(((_item$_productOrigin29 = item._productOrigin) === null || _item$_productOrigin29 === void 0 || (_item$_productOrigin29 = _item$_productOrigin29.duration) === null || _item$_productOrigin29 === void 0 ? void 0 : _item$_productOrigin29.value) || 10, 'minutes').format('YYYY-MM-DD HH:mm');
|
|
2644
2641
|
}
|
|
2645
2642
|
// delete resource.times;
|
|
2646
2643
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule,
|
|
1
|
+
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, ScheduleModule } from '../../modules';
|
|
2
2
|
export interface BookingByStepState {
|
|
3
3
|
cart: CartModule;
|
|
4
4
|
summary: SummaryModule;
|
|
@@ -14,8 +14,6 @@ export interface BookingByStepState {
|
|
|
14
14
|
currentProduct?: ProductData;
|
|
15
15
|
currentProductMeta?: Record<string, any>;
|
|
16
16
|
schedule: ScheduleModule;
|
|
17
|
-
salesSummary?: SalesSummaryModule;
|
|
18
|
-
scanOrderLogger?: ScanOrderLoggerModule;
|
|
19
17
|
}
|
|
20
18
|
export declare function createModule<T extends keyof BookingByStepState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingByStepState[T];
|
|
21
19
|
export declare enum BookingByStepHooks {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule,
|
|
1
|
+
import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, ScheduleModule } from "../../modules";
|
|
2
2
|
export function createModule(moduleName, solutionName, name, version) {
|
|
3
3
|
switch (moduleName) {
|
|
4
4
|
case 'cart':
|
|
5
5
|
return new CartModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
6
6
|
case 'summary':
|
|
7
7
|
return new SummaryModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
8
|
-
case 'salesSummary':
|
|
9
|
-
return new SalesSummaryModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
10
8
|
case 'step':
|
|
11
9
|
return new StepModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
12
10
|
case 'products':
|
|
@@ -21,8 +19,6 @@ export function createModule(moduleName, solutionName, name, version) {
|
|
|
21
19
|
return new PaymentModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
22
20
|
case 'schedule':
|
|
23
21
|
return new ScheduleModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
24
|
-
case 'scanOrderLogger':
|
|
25
|
-
return new ScanOrderLoggerModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
26
22
|
default:
|
|
27
23
|
throw new Error("Unknown module type: ".concat(moduleName));
|
|
28
24
|
}
|
|
@@ -19,12 +19,10 @@ export declare function calculateResourceAvailableTime({ resource, timeSlots, cu
|
|
|
19
19
|
* @param countMap 已预约数量映射
|
|
20
20
|
* @returns 最快可用的资源
|
|
21
21
|
*/
|
|
22
|
-
export declare function findFastestAvailableResource({ resources, currentCapacity, countMap,
|
|
22
|
+
export declare function findFastestAvailableResource({ resources, currentCapacity, countMap, }: {
|
|
23
23
|
resources: ResourceItem[];
|
|
24
24
|
currentCapacity?: number;
|
|
25
25
|
countMap?: Record<number, number>;
|
|
26
|
-
targetDate?: string | Dayjs;
|
|
27
|
-
durationMinutes?: number;
|
|
28
26
|
}): ResourceItem | null;
|
|
29
27
|
/**
|
|
30
28
|
* 给定一个时间列表,通过开始和结束时间过滤出符合条件的时间段
|
|
@@ -91,14 +91,8 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
91
91
|
_ref2$currentCapacity = _ref2.currentCapacity,
|
|
92
92
|
currentCapacity = _ref2$currentCapacity === void 0 ? 1 : _ref2$currentCapacity,
|
|
93
93
|
_ref2$countMap = _ref2.countMap,
|
|
94
|
-
countMap = _ref2$countMap === void 0 ? {} : _ref2$countMap
|
|
95
|
-
targetDate = _ref2.targetDate,
|
|
96
|
-
_ref2$durationMinutes = _ref2.durationMinutes,
|
|
97
|
-
durationMinutes = _ref2$durationMinutes === void 0 ? 30 : _ref2$durationMinutes;
|
|
94
|
+
countMap = _ref2$countMap === void 0 ? {} : _ref2$countMap;
|
|
98
95
|
var currentTime = dayjs();
|
|
99
|
-
var resolvedDuration = durationMinutes > 0 ? durationMinutes : 30;
|
|
100
|
-
var targetDay = targetDate ? dayjs(targetDate) : currentTime;
|
|
101
|
-
var isTargetDayToday = targetDay.isSame(currentTime, 'day');
|
|
102
96
|
var fastestTime = null;
|
|
103
97
|
var fastestResources = [];
|
|
104
98
|
console.log('[TimeslotUtils] 查找最快可用资源:', {
|
|
@@ -114,18 +108,17 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
114
108
|
try {
|
|
115
109
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
116
110
|
var _resource = _step2.value;
|
|
117
|
-
//
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return dayjs(time.end_at).isAfter(currentTime);
|
|
111
|
+
// 获取资源当天且还在工作时间内的时间段
|
|
112
|
+
var todayTimes = _resource.times.filter(function (time) {
|
|
113
|
+
var isToday = dayjs(time.start_at).isSame(currentTime, 'day');
|
|
114
|
+
var isStillWorking = dayjs(time.end_at).isAfter(currentTime);
|
|
115
|
+
return isToday && isStillWorking;
|
|
123
116
|
});
|
|
124
|
-
if (
|
|
117
|
+
if (todayTimes.length === 0) {
|
|
125
118
|
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, ") \u4ECA\u65E5\u65E0\u53EF\u7528\u65F6\u95F4\u6BB5"));
|
|
126
119
|
continue;
|
|
127
120
|
}
|
|
128
|
-
var _iterator4 = _createForOfIteratorHelper(
|
|
121
|
+
var _iterator4 = _createForOfIteratorHelper(todayTimes),
|
|
129
122
|
_step4;
|
|
130
123
|
try {
|
|
131
124
|
var _loop = function _loop() {
|
|
@@ -135,7 +128,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
135
128
|
var workEndTime = dayjs(time.end_at);
|
|
136
129
|
|
|
137
130
|
// 确定检查的起始时间(当前时间 vs 工作开始时间)
|
|
138
|
-
var nextAvailableTime =
|
|
131
|
+
var nextAvailableTime = currentTime.isBefore(workStartTime) ? workStartTime : currentTime;
|
|
139
132
|
console.log("[TimeslotUtils] \u68C0\u67E5\u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, "):"), {
|
|
140
133
|
workTime: "".concat(workStartTime.format('HH:mm'), "-").concat(workEndTime.format('HH:mm')),
|
|
141
134
|
checkStartTime: nextAvailableTime.format('HH:mm:ss'),
|
|
@@ -172,7 +165,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
172
165
|
// 检查资源类型和容量
|
|
173
166
|
if (_resource.resourceType === 'single' || (_resource.capacity || 1) === 1) {
|
|
174
167
|
// 单人预约资源:检查时间冲突
|
|
175
|
-
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(
|
|
168
|
+
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(30, 'minute'))) {
|
|
176
169
|
// 有冲突,使用事件结束时间
|
|
177
170
|
finalAvailableTime = _eventEnd;
|
|
178
171
|
console.log("[TimeslotUtils] \u53D1\u73B0\u65F6\u95F4\u51B2\u7A81\uFF0C\u8C03\u6574\u5230: ".concat(finalAvailableTime.format('HH:mm:ss')));
|
|
@@ -184,7 +177,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
184
177
|
var eventUsedCapacity = _event.pax || 1;
|
|
185
178
|
|
|
186
179
|
// 如果在事件时间范围内,检查容量是否足够
|
|
187
|
-
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(
|
|
180
|
+
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(30, 'minute'))) {
|
|
188
181
|
var totalRequiredCapacity = currentUsedCapacity + currentCapacity + eventUsedCapacity;
|
|
189
182
|
if (totalRequiredCapacity > totalCapacity) {
|
|
190
183
|
// 容量不足,使用事件结束时间
|
|
@@ -201,7 +194,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
201
194
|
} finally {
|
|
202
195
|
_iterator5.f();
|
|
203
196
|
}
|
|
204
|
-
if (finalAvailableTime.
|
|
197
|
+
if (finalAvailableTime.isAfter(workEndTime)) {
|
|
205
198
|
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, " \u53EF\u7528\u65F6\u95F4\u8D85\u51FA\u5DE5\u4F5C\u65F6\u95F4\uFF0C\u8DF3\u8FC7"));
|
|
206
199
|
return 0; // continue
|
|
207
200
|
}
|
|
@@ -403,6 +403,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
403
403
|
product_id: item.product_id,
|
|
404
404
|
product_variant_id: item.product_variant_id,
|
|
405
405
|
quantity: item.num,
|
|
406
|
+
is_price_include_tax: item.is_price_include_tax,
|
|
406
407
|
// 商品是否含税:1;0
|
|
407
408
|
is_charge_tax: (_item$is_charge_tax = item.is_charge_tax) !== null && _item$is_charge_tax !== void 0 ? _item$is_charge_tax : 0,
|
|
408
409
|
// 若商品不含税,计算得到的税费,单位(元)
|
|
@@ -427,6 +428,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
427
428
|
},
|
|
428
429
|
product_bundle: (item.product_bundle || []).map(function (bundle) {
|
|
429
430
|
return {
|
|
431
|
+
is_price_include_tax: item.is_price_include_tax,
|
|
430
432
|
bundle_id: bundle.bundle_id,
|
|
431
433
|
bundle_product_id: bundle.bundle_product_id,
|
|
432
434
|
bundle_variant_id: bundle.bundle_variant_id,
|
|
@@ -22,6 +22,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
22
22
|
getCurrentBookingTime(): string | null;
|
|
23
23
|
private filterDiscountListByBookingTime;
|
|
24
24
|
setCustomer(customer: Customer): Promise<void>;
|
|
25
|
+
setOriginTotalAmount(amount: number): void;
|
|
25
26
|
setHolders(holders: {
|
|
26
27
|
form_record_id: number;
|
|
27
28
|
}[]): void;
|
|
@@ -29,7 +30,6 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
29
30
|
type?: 'form' | 'customer';
|
|
30
31
|
[key: string]: any;
|
|
31
32
|
}): void;
|
|
32
|
-
setOrderId(id?: number): void;
|
|
33
33
|
calcDiscount(productList: Record<string, any>[], options?: SetDiscountSelectedParams): {
|
|
34
34
|
productList: Record<string, any>[];
|
|
35
35
|
discountList: Discount[];
|
|
@@ -46,7 +46,6 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
46
46
|
discountList: Discount[];
|
|
47
47
|
type: "server" | "clientCalc";
|
|
48
48
|
unavailableReason?: UnavailableReason;
|
|
49
|
-
unavailableReasonKey?: string | null;
|
|
50
49
|
}>;
|
|
51
50
|
calcDiscountApplicableProductTotalPrice(discount: Discount): number | undefined;
|
|
52
51
|
private getCustomer;
|
|
@@ -58,7 +57,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
58
57
|
private bestDiscount;
|
|
59
58
|
loadPrepareConfig(params: {
|
|
60
59
|
customerId: number;
|
|
61
|
-
action?: 'create' | '
|
|
60
|
+
action?: 'create' | 'update';
|
|
62
61
|
with_good_pass?: 0 | 1;
|
|
63
62
|
with_discount_card?: 0 | 1;
|
|
64
63
|
}): Promise<void>;
|