@pisell/pisellos 2.2.313 → 2.2.315
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 +2 -0
- package/dist/index.js +3 -1
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +74 -7
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +13 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +40 -1
- package/dist/model/strategy/adapter/itemRule/type.js +10 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +7 -0
- package/dist/modules/BookingContext/utils/productExtend.js +62 -18
- package/dist/modules/BookingContext/utils/resources.js +1 -1
- package/dist/modules/BusinessAvailability/index.d.ts +30 -0
- package/dist/modules/BusinessAvailability/index.js +204 -0
- package/dist/modules/Cart/index.js +4 -3
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.d.ts +3 -1
- package/dist/modules/Cart/utils/cartProduct.js +59 -32
- package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
- package/dist/modules/FulfillmentTiming/index.js +407 -0
- package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
- package/dist/modules/FulfillmentTiming/types.js +1 -0
- package/dist/modules/OpenData/types.d.ts +14 -0
- package/dist/modules/Order/index.d.ts +14 -2
- package/dist/modules/Order/index.js +856 -486
- package/dist/modules/Order/localEftposState.d.ts +13 -0
- package/dist/modules/Order/localEftposState.js +39 -0
- package/dist/modules/Order/pickupTiming.d.ts +46 -0
- package/dist/modules/Order/pickupTiming.js +53 -0
- package/dist/modules/Order/types.d.ts +30 -2
- package/dist/modules/Order/utils.js +25 -7
- package/dist/modules/Payment/index.js +9 -10
- package/dist/modules/Product/types.d.ts +11 -0
- package/dist/modules/ProductList/index.js +1 -1
- package/dist/modules/ResourcePlanner/planner.d.ts +2 -0
- package/dist/modules/ResourcePlanner/planner.js +332 -23
- package/dist/modules/ResourcePlanner/types.d.ts +29 -0
- package/dist/modules/Schedule/index.d.ts +8 -0
- package/dist/modules/Schedule/index.js +141 -39
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/request.d.ts +7 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1536 -1309
- package/dist/server/modules/form/index.d.ts +19 -0
- package/dist/server/modules/form/index.js +205 -0
- package/dist/server/modules/form/types.d.ts +13 -0
- package/dist/server/modules/form/types.js +3 -0
- package/dist/server/modules/index.d.ts +3 -0
- package/dist/server/modules/index.js +4 -0
- package/dist/server/modules/order/index.d.ts +15 -0
- package/dist/server/modules/order/index.js +920 -688
- package/dist/server/modules/order/types.d.ts +1 -0
- package/dist/server/test.json +1 -1
- package/dist/server/utils/small-ticket.d.ts +1 -85
- package/dist/server/utils/small-ticket.js +2 -2542
- package/dist/shared/payment/loadPaymentMethods.d.ts +9 -0
- package/dist/shared/payment/loadPaymentMethods.js +66 -0
- package/dist/shared/receipt/customerInvoiceLanguages.d.ts +8 -0
- package/dist/shared/receipt/customerInvoiceLanguages.js +60 -0
- package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts +27 -0
- package/dist/shared/receipt/loadCustomerInvoiceLayout.js +184 -0
- package/dist/shared/receipt/small-ticket.d.ts +96 -0
- package/dist/shared/receipt/small-ticket.js +2751 -0
- package/dist/shared/receipt/templateVisibility.d.ts +23 -0
- package/dist/shared/receipt/templateVisibility.js +64 -0
- package/dist/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
- package/dist/shared/sales/loadSalesOrderSnapshot.js +21 -0
- package/dist/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
- package/dist/solution/BaseSales/fulfillmentItemRules.js +750 -0
- package/dist/solution/BaseSales/index.d.ts +39 -16
- package/dist/solution/BaseSales/index.js +1754 -1154
- package/dist/solution/BaseSales/pickupTiming.d.ts +47 -0
- package/dist/solution/BaseSales/pickupTiming.js +616 -0
- package/dist/solution/BaseSales/types.d.ts +11 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +3 -0
- package/dist/solution/BookingByStep/index.d.ts +4 -2
- package/dist/solution/BookingByStep/index.js +8 -3
- package/dist/solution/BookingTicket/index.d.ts +8 -2
- package/dist/solution/BookingTicket/index.js +513 -436
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +1 -1
- package/dist/solution/BookingTicket/utils/cartView.js +3 -1
- package/dist/solution/OrderInvoicePreview/index.d.ts +66 -0
- package/dist/solution/OrderInvoicePreview/index.js +340 -0
- package/dist/solution/RegisterAndLogin/config.js +54 -11
- package/dist/solution/RegisterAndLogin/index.d.ts +2 -0
- package/dist/solution/RegisterAndLogin/index.js +1 -1
- package/dist/solution/RegisterAndLogin/utils.d.ts +12 -4
- package/dist/solution/RegisterAndLogin/utils.js +36 -16
- package/dist/solution/Sales/index.js +1 -1
- package/dist/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
- package/dist/solution/UnifiedBookingSales/businessAvailability.js +292 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +36 -4
- package/dist/solution/UnifiedBookingSales/index.js +1714 -905
- package/dist/solution/UnifiedBookingSales/types.d.ts +16 -2
- package/dist/solution/VenueBooking/index.d.ts +15 -2
- package/dist/solution/VenueBooking/index.js +1062 -785
- package/dist/solution/VenueBooking/types.d.ts +2 -1
- package/dist/solution/VenueBooking/types.js +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +7 -4
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
- package/dist/solution/VenueBooking/utils/smartPricing.js +273 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +6 -3
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +21 -1
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +54 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +9 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +40 -1
- package/lib/model/strategy/adapter/itemRule/type.js +10 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +7 -0
- package/lib/modules/BookingContext/utils/productExtend.js +45 -2
- package/lib/modules/BookingContext/utils/resources.js +1 -1
- package/lib/modules/BusinessAvailability/index.d.ts +30 -0
- package/lib/modules/BusinessAvailability/index.js +146 -0
- package/lib/modules/Cart/index.js +4 -2
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.d.ts +3 -1
- package/lib/modules/Cart/utils/cartProduct.js +39 -20
- package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
- package/lib/modules/FulfillmentTiming/index.js +359 -0
- package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
- package/lib/modules/FulfillmentTiming/types.js +5 -0
- package/lib/modules/OpenData/types.d.ts +14 -0
- package/lib/modules/Order/index.d.ts +14 -2
- package/lib/modules/Order/index.js +240 -38
- package/lib/modules/Order/localEftposState.d.ts +13 -0
- package/lib/modules/Order/localEftposState.js +44 -0
- package/lib/modules/Order/pickupTiming.d.ts +46 -0
- package/lib/modules/Order/pickupTiming.js +61 -0
- package/lib/modules/Order/types.d.ts +30 -2
- package/lib/modules/Order/utils.js +21 -5
- package/lib/modules/Payment/index.js +3 -4
- package/lib/modules/Product/types.d.ts +11 -0
- package/lib/modules/ProductList/index.js +1 -1
- package/lib/modules/ResourcePlanner/planner.d.ts +2 -0
- package/lib/modules/ResourcePlanner/planner.js +252 -8
- package/lib/modules/ResourcePlanner/types.d.ts +29 -0
- package/lib/modules/Schedule/index.d.ts +8 -0
- package/lib/modules/Schedule/index.js +68 -12
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +11 -0
- package/lib/plugins/request.d.ts +7 -0
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +158 -37
- package/lib/server/modules/form/index.d.ts +19 -0
- package/lib/server/modules/form/index.js +73 -0
- package/lib/server/modules/form/types.d.ts +13 -0
- package/lib/server/modules/form/types.js +9 -0
- package/lib/server/modules/index.d.ts +3 -0
- package/lib/server/modules/index.js +15 -1
- package/lib/server/modules/order/index.d.ts +15 -0
- package/lib/server/modules/order/index.js +114 -3
- package/lib/server/modules/order/types.d.ts +1 -0
- package/lib/server/test.json +1 -1
- package/lib/server/utils/small-ticket.d.ts +1 -85
- package/lib/server/utils/small-ticket.js +9 -2305
- package/lib/shared/payment/loadPaymentMethods.d.ts +9 -0
- package/lib/shared/payment/loadPaymentMethods.js +40 -0
- package/lib/shared/receipt/customerInvoiceLanguages.d.ts +8 -0
- package/lib/shared/receipt/customerInvoiceLanguages.js +58 -0
- package/lib/shared/receipt/loadCustomerInvoiceLayout.d.ts +27 -0
- package/lib/shared/receipt/loadCustomerInvoiceLayout.js +124 -0
- package/lib/shared/receipt/small-ticket.d.ts +96 -0
- package/lib/shared/receipt/small-ticket.js +2546 -0
- package/lib/shared/receipt/templateVisibility.d.ts +23 -0
- package/lib/shared/receipt/templateVisibility.js +63 -0
- package/lib/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
- package/lib/shared/sales/loadSalesOrderSnapshot.js +22 -0
- package/lib/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
- package/lib/solution/BaseSales/fulfillmentItemRules.js +259 -0
- package/lib/solution/BaseSales/index.d.ts +39 -16
- package/lib/solution/BaseSales/index.js +333 -31
- package/lib/solution/BaseSales/pickupTiming.d.ts +47 -0
- package/lib/solution/BaseSales/pickupTiming.js +290 -0
- package/lib/solution/BaseSales/types.d.ts +11 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +3 -0
- package/lib/solution/BookingByStep/index.d.ts +4 -2
- package/lib/solution/BookingByStep/index.js +7 -3
- package/lib/solution/BookingTicket/index.d.ts +8 -2
- package/lib/solution/BookingTicket/index.js +65 -6
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +1 -1
- package/lib/solution/BookingTicket/utils/cartView.js +3 -1
- package/lib/solution/OrderInvoicePreview/index.d.ts +66 -0
- package/lib/solution/OrderInvoicePreview/index.js +246 -0
- package/lib/solution/RegisterAndLogin/config.js +57 -11
- package/lib/solution/RegisterAndLogin/index.d.ts +2 -0
- package/lib/solution/RegisterAndLogin/index.js +9 -1
- package/lib/solution/RegisterAndLogin/utils.d.ts +12 -4
- package/lib/solution/RegisterAndLogin/utils.js +24 -17
- package/lib/solution/Sales/index.js +1 -1
- package/lib/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
- package/lib/solution/UnifiedBookingSales/businessAvailability.js +138 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +36 -4
- package/lib/solution/UnifiedBookingSales/index.js +561 -74
- package/lib/solution/UnifiedBookingSales/types.d.ts +16 -2
- package/lib/solution/VenueBooking/index.d.ts +15 -2
- package/lib/solution/VenueBooking/index.js +243 -96
- package/lib/solution/VenueBooking/types.d.ts +2 -1
- package/lib/solution/VenueBooking/types.js +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +7 -4
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
- package/lib/solution/VenueBooking/utils/smartPricing.js +224 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +5 -2
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +11 -0
- package/package.json +1 -1
|
@@ -10,6 +10,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
10
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
11
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
14
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
13
15
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
16
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -45,49 +47,52 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
45
47
|
_defineProperty(_assertThisInitialized(_this), "openCache", false);
|
|
46
48
|
_defineProperty(_assertThisInitialized(_this), "fatherModule", void 0);
|
|
47
49
|
_defineProperty(_assertThisInitialized(_this), "hasLoadedScheduleList", false);
|
|
50
|
+
_defineProperty(_assertThisInitialized(_this), "scheduleListPromise", null);
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "scheduleListRequestVersion", 0);
|
|
52
|
+
_defineProperty(_assertThisInitialized(_this), "scheduleCatalogScope", '');
|
|
53
|
+
_defineProperty(_assertThisInitialized(_this), "otherParams", {});
|
|
48
54
|
return _this;
|
|
49
55
|
}
|
|
50
56
|
_createClass(ScheduleModule, [{
|
|
51
57
|
key: "initialize",
|
|
52
58
|
value: function () {
|
|
53
59
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
54
|
-
var _options$
|
|
60
|
+
var _options$initialState;
|
|
61
|
+
var initialScheduleList, hasInitialScheduleList;
|
|
55
62
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
56
63
|
while (1) switch (_context.prev = _context.next) {
|
|
57
64
|
case 0:
|
|
65
|
+
// The store proxies initialState, so capture its input before resets write through it.
|
|
66
|
+
initialScheduleList = (_options$initialState = options.initialState) === null || _options$initialState === void 0 ? void 0 : _options$initialState.scheduleList;
|
|
67
|
+
hasInitialScheduleList = Array.isArray(initialScheduleList);
|
|
68
|
+
this.resetScheduleCatalog();
|
|
58
69
|
this.core = core;
|
|
59
70
|
|
|
60
71
|
// 获取依赖的插件
|
|
61
72
|
this.request = core.getPlugin('request');
|
|
62
73
|
if (this.request) {
|
|
63
|
-
_context.next =
|
|
74
|
+
_context.next = 7;
|
|
64
75
|
break;
|
|
65
76
|
}
|
|
66
77
|
throw new Error('ScheduleModule 需要 request 插件支持');
|
|
67
|
-
case
|
|
78
|
+
case 7:
|
|
68
79
|
// if (options?.initialState) {
|
|
69
80
|
// this.state = { ...this.state, ...options.initialState }
|
|
70
81
|
// }
|
|
71
82
|
this.store = options === null || options === void 0 ? void 0 : options.store;
|
|
83
|
+
this.updateOtherParams(options.otherParams || {});
|
|
72
84
|
if (options.initialState) {
|
|
73
|
-
this.store.scheduleList =
|
|
85
|
+
this.store.scheduleList = hasInitialScheduleList ? initialScheduleList : [];
|
|
74
86
|
this.syncScheduleMap();
|
|
75
87
|
this.store.availabilityDateList = options.initialState.availabilityDateList;
|
|
76
|
-
this.hasLoadedScheduleList =
|
|
88
|
+
this.hasLoadedScheduleList = hasInitialScheduleList;
|
|
77
89
|
} else {
|
|
78
90
|
this.store.scheduleList = [];
|
|
79
91
|
this.store.map = new Map();
|
|
80
92
|
this.store.availabilityDateList = [];
|
|
81
93
|
this.hasLoadedScheduleList = false;
|
|
82
94
|
}
|
|
83
|
-
|
|
84
|
-
this.openCache = options.otherParams.openCache;
|
|
85
|
-
this.cacheId = options.otherParams.cacheId;
|
|
86
|
-
}
|
|
87
|
-
if ((_options$otherParams2 = options.otherParams) !== null && _options$otherParams2 !== void 0 && _options$otherParams2.fatherModule) {
|
|
88
|
-
this.fatherModule = options.otherParams.fatherModule;
|
|
89
|
-
}
|
|
90
|
-
case 8:
|
|
95
|
+
case 10:
|
|
91
96
|
case "end":
|
|
92
97
|
return _context.stop();
|
|
93
98
|
}
|
|
@@ -109,9 +114,41 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
109
114
|
value: function updateOtherParams(params) {
|
|
110
115
|
var _otherParams$openCach;
|
|
111
116
|
var otherParams = params || {};
|
|
117
|
+
this.otherParams = _objectSpread({}, otherParams);
|
|
112
118
|
this.openCache = (_otherParams$openCach = otherParams.openCache) !== null && _otherParams$openCach !== void 0 ? _otherParams$openCach : false;
|
|
113
119
|
this.cacheId = otherParams.cacheId;
|
|
114
120
|
this.fatherModule = otherParams.fatherModule;
|
|
121
|
+
this.syncScheduleCatalogScope();
|
|
122
|
+
}
|
|
123
|
+
}, {
|
|
124
|
+
key: "syncScheduleCatalogScope",
|
|
125
|
+
value: function syncScheduleCatalogScope() {
|
|
126
|
+
var _this$core, _params$businessCode;
|
|
127
|
+
var context = (_this$core = this.core) === null || _this$core === void 0 ? void 0 : _this$core.context;
|
|
128
|
+
var shopId = typeof (context === null || context === void 0 ? void 0 : context.getData) === 'function' ? context.getData('shop_id') : context === null || context === void 0 ? void 0 : context.shop_id;
|
|
129
|
+
var params = this.otherParams;
|
|
130
|
+
var scope = JSON.stringify([this.cacheId, this.fatherModule, (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : params.business_code, params.channel, params.platform, params.businessTimezone, shopId].map(function (value) {
|
|
131
|
+
return String(value !== null && value !== void 0 ? value : '').trim();
|
|
132
|
+
}));
|
|
133
|
+
if (scope !== this.scheduleCatalogScope) {
|
|
134
|
+
this.resetScheduleCatalog();
|
|
135
|
+
this.scheduleCatalogScope = scope;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}, {
|
|
139
|
+
key: "resetScheduleCatalog",
|
|
140
|
+
value: function resetScheduleCatalog() {
|
|
141
|
+
this.scheduleListRequestVersion += 1;
|
|
142
|
+
this.scheduleListPromise = null;
|
|
143
|
+
this.hasLoadedScheduleList = false;
|
|
144
|
+
this.store.scheduleList = [];
|
|
145
|
+
this.store.map = new Map();
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "destroy",
|
|
149
|
+
value: function destroy() {
|
|
150
|
+
this.resetScheduleCatalog();
|
|
151
|
+
_get(_getPrototypeOf(ScheduleModule.prototype), "destroy", this).call(this);
|
|
115
152
|
}
|
|
116
153
|
|
|
117
154
|
/**
|
|
@@ -123,37 +160,99 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
123
160
|
key: "loadAllSchedule",
|
|
124
161
|
value: (function () {
|
|
125
162
|
var _loadAllSchedule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
126
|
-
var _options$useCache
|
|
163
|
+
var _options$useCache;
|
|
127
164
|
var options,
|
|
128
|
-
|
|
165
|
+
useCache,
|
|
166
|
+
requestVersion,
|
|
167
|
+
promise,
|
|
129
168
|
_args2 = arguments;
|
|
130
169
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
131
170
|
while (1) switch (_context2.prev = _context2.next) {
|
|
132
171
|
case 0:
|
|
133
172
|
options = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
173
|
+
this.syncScheduleCatalogScope();
|
|
174
|
+
useCache = (_options$useCache = options.useCache) !== null && _options$useCache !== void 0 ? _options$useCache : true;
|
|
175
|
+
if (!useCache) {
|
|
176
|
+
_context2.next = 8;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
if (!this.scheduleListPromise) {
|
|
180
|
+
_context2.next = 6;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
return _context2.abrupt("return", this.scheduleListPromise);
|
|
184
|
+
case 6:
|
|
185
|
+
if (!this.hasLoadedScheduleList) {
|
|
186
|
+
_context2.next = 8;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
return _context2.abrupt("return");
|
|
190
|
+
case 8:
|
|
191
|
+
requestVersion = ++this.scheduleListRequestVersion;
|
|
192
|
+
promise = this.loadScheduleCatalog(useCache, requestVersion);
|
|
193
|
+
this.scheduleListPromise = promise;
|
|
194
|
+
_context2.prev = 11;
|
|
195
|
+
_context2.next = 14;
|
|
196
|
+
return promise;
|
|
197
|
+
case 14:
|
|
198
|
+
_context2.prev = 14;
|
|
199
|
+
if (this.scheduleListPromise === promise) {
|
|
200
|
+
this.scheduleListPromise = null;
|
|
201
|
+
}
|
|
202
|
+
return _context2.finish(14);
|
|
203
|
+
case 17:
|
|
144
204
|
case "end":
|
|
145
205
|
return _context2.stop();
|
|
146
206
|
}
|
|
147
|
-
}, _callee2, this);
|
|
207
|
+
}, _callee2, this, [[11,, 14, 17]]);
|
|
148
208
|
}));
|
|
149
209
|
function loadAllSchedule() {
|
|
150
210
|
return _loadAllSchedule.apply(this, arguments);
|
|
151
211
|
}
|
|
152
212
|
return loadAllSchedule;
|
|
153
213
|
}())
|
|
214
|
+
}, {
|
|
215
|
+
key: "loadScheduleCatalog",
|
|
216
|
+
value: function () {
|
|
217
|
+
var _loadScheduleCatalog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(useCache, requestVersion) {
|
|
218
|
+
var response, _response$data;
|
|
219
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
220
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
221
|
+
case 0:
|
|
222
|
+
_context3.next = 2;
|
|
223
|
+
return this.request.get("/schedule", {
|
|
224
|
+
num: 999
|
|
225
|
+
}, {
|
|
226
|
+
useCache: useCache
|
|
227
|
+
});
|
|
228
|
+
case 2:
|
|
229
|
+
response = _context3.sent;
|
|
230
|
+
if (!(response.code !== undefined && Number(response.code) !== 200 || response.status === false || typeof response.status === 'number' && response.status >= 400 || response.success === false)) {
|
|
231
|
+
_context3.next = 5;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
throw new Error(response.message || 'Schedule catalog request failed');
|
|
235
|
+
case 5:
|
|
236
|
+
this.syncScheduleCatalogScope();
|
|
237
|
+
// A refresh or a different runtime may have superseded this request.
|
|
238
|
+
if (requestVersion === this.scheduleListRequestVersion) {
|
|
239
|
+
this.setScheduleList(((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.list) || []);
|
|
240
|
+
}
|
|
241
|
+
case 7:
|
|
242
|
+
case "end":
|
|
243
|
+
return _context3.stop();
|
|
244
|
+
}
|
|
245
|
+
}, _callee3, this);
|
|
246
|
+
}));
|
|
247
|
+
function loadScheduleCatalog(_x3, _x4) {
|
|
248
|
+
return _loadScheduleCatalog.apply(this, arguments);
|
|
249
|
+
}
|
|
250
|
+
return loadScheduleCatalog;
|
|
251
|
+
}()
|
|
154
252
|
}, {
|
|
155
253
|
key: "setScheduleList",
|
|
156
254
|
value: function setScheduleList(list) {
|
|
255
|
+
this.syncScheduleCatalogScope();
|
|
157
256
|
this.store.scheduleList = list;
|
|
158
257
|
this.syncScheduleMap();
|
|
159
258
|
this.hasLoadedScheduleList = true;
|
|
@@ -168,20 +267,22 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
168
267
|
}, {
|
|
169
268
|
key: "getScheduleList",
|
|
170
269
|
value: function getScheduleList() {
|
|
270
|
+
this.syncScheduleCatalogScope();
|
|
171
271
|
return this.store.scheduleList || [];
|
|
172
272
|
}
|
|
173
273
|
}, {
|
|
174
274
|
key: "isScheduleListLoaded",
|
|
175
275
|
value: function isScheduleListLoaded() {
|
|
276
|
+
this.syncScheduleCatalogScope();
|
|
176
277
|
return this.hasLoadedScheduleList;
|
|
177
278
|
}
|
|
178
279
|
}, {
|
|
179
280
|
key: "loadScheduleAvailableDate",
|
|
180
281
|
value: function () {
|
|
181
|
-
var _loadScheduleAvailableDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
282
|
+
var _loadScheduleAvailableDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref) {
|
|
182
283
|
var startDate, endDate, custom_page_id, channel, dates, res, responseData, dateList, otherProductIds;
|
|
183
|
-
return _regeneratorRuntime().wrap(function
|
|
184
|
-
while (1) switch (
|
|
284
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
285
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
185
286
|
case 0:
|
|
186
287
|
startDate = _ref.startDate, endDate = _ref.endDate, custom_page_id = _ref.custom_page_id, channel = _ref.channel;
|
|
187
288
|
// 前端传递的 startDate,可能是今天之前的,如果 startDate 小于今天,需要把 startDate 置为今天
|
|
@@ -193,12 +294,12 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
193
294
|
dates = disableAllDates(dates);
|
|
194
295
|
// 如果 endDate 在今天之前,则不用查接口,直接返回 dates
|
|
195
296
|
if (!dayjs(endDate).isBefore(dayjs(), 'day')) {
|
|
196
|
-
|
|
297
|
+
_context4.next = 6;
|
|
197
298
|
break;
|
|
198
299
|
}
|
|
199
|
-
return
|
|
300
|
+
return _context4.abrupt("return", dates);
|
|
200
301
|
case 6:
|
|
201
|
-
|
|
302
|
+
_context4.next = 8;
|
|
202
303
|
return this.request.get("/schedule/product/availability/v2", {
|
|
203
304
|
start_date: startDate,
|
|
204
305
|
end_date: endDate,
|
|
@@ -206,7 +307,7 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
206
307
|
channel: channel
|
|
207
308
|
});
|
|
208
309
|
case 8:
|
|
209
|
-
res =
|
|
310
|
+
res = _context4.sent;
|
|
210
311
|
responseData = res.data || {};
|
|
211
312
|
dateList = Array.isArray(responseData.date_list) ? responseData.date_list : [];
|
|
212
313
|
otherProductIds = Array.isArray(responseData.other_product_ids) ? responseData.other_product_ids : [];
|
|
@@ -214,10 +315,10 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
214
315
|
this.setOtherProductsIds(otherProductIds);
|
|
215
316
|
// 如果没有schedule或者结束日期在今天之前,则所有日期均不可用
|
|
216
317
|
if (!(!dateList.length && !otherProductIds.length || dayjs(endDate).isBefore(dayjs(), 'day'))) {
|
|
217
|
-
|
|
318
|
+
_context4.next = 16;
|
|
218
319
|
break;
|
|
219
320
|
}
|
|
220
|
-
return
|
|
321
|
+
return _context4.abrupt("return", dates);
|
|
221
322
|
case 16:
|
|
222
323
|
if (otherProductIds.length) {
|
|
223
324
|
// 如果后端有返回 other_product_ids ,意味着有 duration 商品,则今天以及今天以后的日期均可用
|
|
@@ -235,14 +336,14 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
235
336
|
});
|
|
236
337
|
}
|
|
237
338
|
dates = disableDatesBeforeOneDay(dates);
|
|
238
|
-
return
|
|
339
|
+
return _context4.abrupt("return", dates);
|
|
239
340
|
case 19:
|
|
240
341
|
case "end":
|
|
241
|
-
return
|
|
342
|
+
return _context4.stop();
|
|
242
343
|
}
|
|
243
|
-
},
|
|
344
|
+
}, _callee4, this);
|
|
244
345
|
}));
|
|
245
|
-
function loadScheduleAvailableDate(
|
|
346
|
+
function loadScheduleAvailableDate(_x5) {
|
|
246
347
|
return _loadScheduleAvailableDate.apply(this, arguments);
|
|
247
348
|
}
|
|
248
349
|
return loadScheduleAvailableDate;
|
|
@@ -252,6 +353,7 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
252
353
|
value: function getScheduleListByIds(ids) {
|
|
253
354
|
var _this2 = this,
|
|
254
355
|
_this$store$scheduleL;
|
|
356
|
+
this.syncScheduleCatalogScope();
|
|
255
357
|
var idSet = new Set(ids.map(function (id) {
|
|
256
358
|
return String(id);
|
|
257
359
|
}));
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from './Schedule';
|
|
|
17
17
|
export * from './Quotation';
|
|
18
18
|
export * from './ScanOrderLogger';
|
|
19
19
|
export * from './OpenData';
|
|
20
|
+
export * from './FulfillmentTiming';
|
|
20
21
|
export * from './BookingContext';
|
|
21
22
|
export * from './Holder';
|
|
22
23
|
export * from './ResourcePlanner';
|
package/dist/modules/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./Schedule";
|
|
|
17
17
|
export * from "./Quotation";
|
|
18
18
|
export * from "./ScanOrderLogger";
|
|
19
19
|
export * from "./OpenData";
|
|
20
|
+
export * from "./FulfillmentTiming";
|
|
20
21
|
export * from "./BookingContext";
|
|
21
22
|
export * from "./Holder";
|
|
22
23
|
export * from "./ResourcePlanner";
|
|
@@ -56,6 +56,13 @@ export interface CacheProps {
|
|
|
56
56
|
* 请求配置
|
|
57
57
|
*/
|
|
58
58
|
export interface RequestOptions {
|
|
59
|
+
/** Customer-only, credential-free GET /open/document/{id} on picoding. */
|
|
60
|
+
publicInvoiceDocument?: boolean;
|
|
61
|
+
/** Route through the host's configured picoding environment. */
|
|
62
|
+
pisell2?: boolean;
|
|
63
|
+
/** Let the caller handle read-only preview failures without host navigation/toasts. */
|
|
64
|
+
manualErrorHandling?: boolean;
|
|
65
|
+
skipErrorHandler?: boolean;
|
|
59
66
|
url?: string;
|
|
60
67
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
61
68
|
headers?: Record<string, string>;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -499,6 +499,7 @@ declare class Server {
|
|
|
499
499
|
private buildLocalPaymentSurchargeUpdate;
|
|
500
500
|
private handleGetLocalPayment;
|
|
501
501
|
private handleUpdateLocalPayment;
|
|
502
|
+
private handleFinalizeLocalEftposPayment;
|
|
502
503
|
private runLocalPaymentUpdateInQueue;
|
|
503
504
|
private processLocalPaymentUpdate;
|
|
504
505
|
private processSuccessfulLocalPayment;
|