@pisell/pisellos 3.0.56 → 3.0.57
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/core/index.js +2 -1
- package/dist/effects/index.d.ts +4 -3
- package/dist/effects/index.js +15 -6
- package/dist/modules/AccountList/index.d.ts +7 -1
- package/dist/modules/AccountList/index.js +81 -14
- package/dist/modules/AccountList/types.d.ts +28 -0
- package/dist/modules/AccountList/types.js +8 -0
- package/dist/modules/Cart/index.js +1 -1
- package/dist/modules/Cart/utils/changePrice.d.ts +2 -2
- package/dist/modules/Cart/utils/changePrice.js +1 -1
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Customer/constants.js +12 -0
- package/dist/modules/Customer/index.d.ts +122 -0
- package/dist/modules/Customer/index.js +697 -0
- package/dist/modules/Customer/types.d.ts +146 -0
- package/dist/modules/Customer/types.js +41 -0
- package/dist/modules/Payment/cash.d.ts +11 -0
- package/dist/modules/Payment/cash.js +78 -0
- package/dist/modules/Payment/eftpos.d.ts +11 -0
- package/dist/modules/Payment/eftpos.js +80 -0
- package/dist/modules/Payment/index.d.ts +273 -9
- package/dist/modules/Payment/index.js +2525 -109
- package/dist/modules/Payment/types.d.ts +382 -30
- package/dist/modules/Payment/types.js +116 -14
- package/dist/modules/Payment/wallet.d.ts +11 -0
- package/dist/modules/Payment/wallet.js +78 -0
- package/dist/modules/Payment/walletpass.d.ts +0 -0
- package/dist/modules/Payment/walletpass.js +0 -0
- package/dist/modules/ProductList/index.d.ts +13 -3
- package/dist/modules/ProductList/index.js +52 -42
- package/dist/modules/ProductList/types.d.ts +0 -1
- package/dist/modules/Rules/index.js +27 -14
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/app-types/app/app.d.ts +83 -0
- package/dist/plugins/app-types/app/const.d.ts +4 -0
- package/dist/plugins/app-types/app/index.d.ts +14 -0
- package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/dist/plugins/app-types/config.d.ts +3 -0
- package/dist/plugins/app-types/cookie/index.d.ts +13 -0
- package/dist/plugins/app-types/data/index.d.ts +8 -0
- package/dist/plugins/app-types/history/config.d.ts +24 -0
- package/dist/plugins/app-types/history/index.d.ts +20 -0
- package/dist/plugins/app-types/history/type.d.ts +2 -0
- package/dist/plugins/app-types/hooks/index.d.ts +12 -0
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/dist/plugins/app-types/index.d.ts +6 -0
- package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
- package/dist/plugins/app-types/locales/en.d.ts +3 -0
- package/dist/plugins/app-types/locales/index.d.ts +37 -0
- package/dist/plugins/app-types/locales/original.d.ts +3 -0
- package/dist/plugins/app-types/locales/type.d.ts +19 -0
- package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
- package/dist/plugins/app-types/logger/index.d.ts +122 -0
- package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
- package/dist/plugins/app-types/models/global.d.ts +32 -0
- package/dist/plugins/app-types/models/index.d.ts +45 -0
- package/dist/plugins/app-types/models/type.d.ts +2 -0
- package/dist/plugins/app-types/package.json +15 -0
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
- package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
- package/dist/plugins/app-types/request/cache.d.ts +46 -0
- package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/dist/plugins/app-types/request/config.d.ts +3 -0
- package/dist/plugins/app-types/request/constants.d.ts +2 -0
- package/dist/plugins/app-types/request/index.d.ts +24 -0
- package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/dist/plugins/app-types/request/type.d.ts +41 -0
- package/dist/plugins/app-types/request/utils.d.ts +46 -0
- package/dist/plugins/app-types/routes/config.d.ts +7 -0
- package/dist/plugins/app-types/routes/index.d.ts +28 -0
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
- package/dist/plugins/app-types/socket/constants.d.ts +33 -0
- package/dist/plugins/app-types/socket/events.d.ts +31 -0
- package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/dist/plugins/app-types/socket/index.d.ts +61 -0
- package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
- package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/dist/plugins/app-types/socket/socket.d.ts +129 -0
- package/dist/plugins/app-types/socket/types.d.ts +85 -0
- package/dist/plugins/app-types/storage/index.d.ts +17 -0
- package/dist/plugins/app-types/tasks/index.d.ts +77 -0
- package/dist/plugins/app-types/tasks/type.d.ts +62 -0
- package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/dist/plugins/app-types/type.d.ts +2 -0
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/dist/plugins/app-types/variables/config.d.ts +3 -0
- package/dist/plugins/app-types/variables/index.d.ts +6 -0
- package/dist/plugins/app-types/variables/type.d.ts +2 -0
- package/dist/plugins/app-types/website/index.d.ts +6 -0
- package/dist/plugins/app.d.ts +8 -0
- package/dist/plugins/app.js +1 -0
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingByStep/index.js +59 -35
- package/dist/solution/BookingByStep/types.d.ts +3 -2
- package/dist/solution/BookingTicket/index.d.ts +172 -0
- package/dist/solution/BookingTicket/index.js +665 -0
- package/dist/solution/BookingTicket/types.d.ts +68 -0
- package/dist/solution/BookingTicket/types.js +43 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +16 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +174 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +285 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
- package/dist/solution/BuyTickets/index.d.ts +2 -2
- package/dist/solution/BuyTickets/index.js +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +181 -0
- package/dist/solution/Checkout/index.js +1596 -0
- package/dist/solution/Checkout/types.d.ts +550 -0
- package/dist/solution/Checkout/types.js +132 -0
- package/dist/solution/Checkout/utils/index.d.ts +73 -0
- package/dist/solution/Checkout/utils/index.js +371 -0
- package/dist/solution/ShopDiscount/index.js +4 -2
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/utils/task.d.ts +40 -0
- package/dist/utils/task.js +171 -0
- package/dist/utils/watch.d.ts +102 -0
- package/dist/utils/watch.js +294 -0
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +4 -3
- package/lib/effects/index.js +4 -1
- package/lib/modules/AccountList/index.d.ts +7 -1
- package/lib/modules/AccountList/index.js +27 -0
- package/lib/modules/AccountList/types.d.ts +28 -0
- package/lib/modules/Cart/index.js +1 -1
- package/lib/modules/Cart/utils/changePrice.d.ts +2 -2
- package/lib/modules/Cart/utils/changePrice.js +1 -1
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Customer/constants.js +39 -0
- package/lib/modules/Customer/index.d.ts +122 -0
- package/lib/modules/Customer/index.js +440 -0
- package/lib/modules/Customer/types.d.ts +146 -0
- package/lib/modules/Customer/types.js +37 -0
- package/lib/modules/Payment/cash.d.ts +11 -0
- package/lib/modules/Payment/cash.js +51 -0
- package/lib/modules/Payment/eftpos.d.ts +11 -0
- package/lib/modules/Payment/eftpos.js +51 -0
- package/lib/modules/Payment/index.d.ts +273 -9
- package/lib/modules/Payment/index.js +1285 -50
- package/lib/modules/Payment/types.d.ts +382 -30
- package/lib/modules/Payment/types.js +41 -6
- package/lib/modules/Payment/wallet.d.ts +11 -0
- package/lib/modules/Payment/wallet.js +51 -0
- package/lib/modules/Payment/walletpass.d.ts +0 -0
- package/lib/modules/Payment/walletpass.js +0 -0
- package/lib/modules/ProductList/index.d.ts +13 -3
- package/lib/modules/ProductList/index.js +37 -26
- package/lib/modules/ProductList/types.d.ts +0 -1
- package/lib/modules/Rules/index.js +20 -12
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -0
- package/lib/plugins/app-types/app/app.d.ts +83 -0
- package/lib/plugins/app-types/app/const.d.ts +4 -0
- package/lib/plugins/app-types/app/index.d.ts +14 -0
- package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/lib/plugins/app-types/config.d.ts +3 -0
- package/lib/plugins/app-types/cookie/index.d.ts +13 -0
- package/lib/plugins/app-types/data/index.d.ts +8 -0
- package/lib/plugins/app-types/history/config.d.ts +24 -0
- package/lib/plugins/app-types/history/index.d.ts +20 -0
- package/lib/plugins/app-types/history/type.d.ts +2 -0
- package/lib/plugins/app-types/hooks/index.d.ts +12 -0
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/lib/plugins/app-types/index.d.ts +6 -0
- package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
- package/lib/plugins/app-types/locales/en.d.ts +3 -0
- package/lib/plugins/app-types/locales/index.d.ts +37 -0
- package/lib/plugins/app-types/locales/original.d.ts +3 -0
- package/lib/plugins/app-types/locales/type.d.ts +19 -0
- package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
- package/lib/plugins/app-types/logger/index.d.ts +122 -0
- package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
- package/lib/plugins/app-types/models/global.d.ts +32 -0
- package/lib/plugins/app-types/models/index.d.ts +45 -0
- package/lib/plugins/app-types/models/type.d.ts +2 -0
- package/lib/plugins/app-types/package.json +15 -0
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
- package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
- package/lib/plugins/app-types/request/cache.d.ts +46 -0
- package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/lib/plugins/app-types/request/config.d.ts +3 -0
- package/lib/plugins/app-types/request/constants.d.ts +2 -0
- package/lib/plugins/app-types/request/index.d.ts +24 -0
- package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/lib/plugins/app-types/request/type.d.ts +41 -0
- package/lib/plugins/app-types/request/utils.d.ts +46 -0
- package/lib/plugins/app-types/routes/config.d.ts +7 -0
- package/lib/plugins/app-types/routes/index.d.ts +28 -0
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
- package/lib/plugins/app-types/socket/constants.d.ts +33 -0
- package/lib/plugins/app-types/socket/events.d.ts +31 -0
- package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/lib/plugins/app-types/socket/index.d.ts +61 -0
- package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
- package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/lib/plugins/app-types/socket/socket.d.ts +129 -0
- package/lib/plugins/app-types/socket/types.d.ts +85 -0
- package/lib/plugins/app-types/storage/index.d.ts +17 -0
- package/lib/plugins/app-types/tasks/index.d.ts +77 -0
- package/lib/plugins/app-types/tasks/type.d.ts +62 -0
- package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/lib/plugins/app-types/type.d.ts +2 -0
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/lib/plugins/app-types/variables/config.d.ts +3 -0
- package/lib/plugins/app-types/variables/index.d.ts +6 -0
- package/lib/plugins/app-types/variables/type.d.ts +2 -0
- package/lib/plugins/app-types/website/index.d.ts +6 -0
- package/lib/plugins/app.d.ts +8 -0
- package/lib/plugins/app.js +17 -0
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingByStep/index.js +40 -29
- package/lib/solution/BookingByStep/types.d.ts +3 -2
- package/lib/solution/BookingTicket/index.d.ts +172 -0
- package/lib/solution/BookingTicket/index.js +399 -0
- package/lib/solution/BookingTicket/types.d.ts +68 -0
- package/lib/solution/BookingTicket/types.js +72 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +16 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +125 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +210 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
- package/lib/solution/BuyTickets/index.d.ts +2 -2
- package/lib/solution/BuyTickets/index.js +1 -1
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +181 -0
- package/lib/solution/Checkout/index.js +864 -0
- package/lib/solution/Checkout/types.d.ts +550 -0
- package/lib/solution/Checkout/types.js +75 -0
- package/lib/solution/Checkout/utils/index.d.ts +73 -0
- package/lib/solution/Checkout/utils/index.js +266 -0
- package/lib/solution/ShopDiscount/index.js +2 -1
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/utils/task.d.ts +40 -0
- package/lib/utils/task.js +109 -0
- package/lib/utils/watch.d.ts +102 -0
- package/lib/utils/watch.js +217 -0
- package/package.json +4 -2
|
@@ -112,7 +112,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
112
112
|
this.otherData = ((_data$this$otherParam = data[this.otherParams.cacheId]) === null || _data$this$otherParam === void 0 || (_data$this$otherParam = _data$this$otherParam[this.name]) === null || _data$this$otherParam === void 0 ? void 0 : _data$this$otherParam['otherData']) || {};
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
moduleArr = ['accountList', 'cart', 'schedule', 'summary', 'step', 'products', 'date', 'order'
|
|
115
|
+
moduleArr = ['accountList', 'cart', 'schedule', 'summary', 'step', 'products', 'date', 'order'];
|
|
116
116
|
moduleArr.forEach(function (step) {
|
|
117
117
|
var targetModule = createModule(step, _this2.name);
|
|
118
118
|
if (targetModule) {
|
|
@@ -701,6 +701,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
701
701
|
_params$useCache,
|
|
702
702
|
useCache,
|
|
703
703
|
tempProducts,
|
|
704
|
+
_this$store$currentPr,
|
|
704
705
|
dateRange,
|
|
705
706
|
tempStartDate,
|
|
706
707
|
tempEndDate,
|
|
@@ -732,8 +733,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
732
733
|
}
|
|
733
734
|
// 如果当前打开了某个的商品详情弹窗,则应该默认用这个商品
|
|
734
735
|
if (this.store.currentProduct) {
|
|
735
|
-
tempProducts = [_objectSpread(_objectSpread({}, this.store.currentProduct
|
|
736
|
-
_schedule: this.store.
|
|
736
|
+
tempProducts = [_objectSpread(_objectSpread({}, this.store.currentProduct), {}, {
|
|
737
|
+
_schedule: (_this$store$currentPr = this.store.currentProductMeta) === null || _this$store$currentPr === void 0 ? void 0 : _this$store$currentPr['schedule']
|
|
737
738
|
})];
|
|
738
739
|
}
|
|
739
740
|
dateRange = this.store.date.getDateRange();
|
|
@@ -1212,6 +1213,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1212
1213
|
_this6.store.cart.removeItem(n._id);
|
|
1213
1214
|
});
|
|
1214
1215
|
}
|
|
1216
|
+
// // 如果 date.startTime 和 dateRange 里的 startTime 不一样,需要修正 dateRange
|
|
1217
|
+
// const dateRange = this.store.date.getDateRange()
|
|
1218
|
+
// if (dateRange?.[0] && !dayjs(dateRange[0].date).isSame(dayjs(date.startTime), 'day')) {
|
|
1219
|
+
// this.setDateRange([
|
|
1220
|
+
// { date: dayjs(date.startTime).format('YYYY-MM-DD'), status: 'available', week: '', weekNum: 0 },
|
|
1221
|
+
// { date: dayjs(date.endTime).format('YYYY-MM-DD'), status: 'available', week: '', weekNum: 0 },
|
|
1222
|
+
// ]);
|
|
1223
|
+
// }
|
|
1215
1224
|
}
|
|
1216
1225
|
}
|
|
1217
1226
|
}, {
|
|
@@ -2278,41 +2287,42 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2278
2287
|
key: "openProductDetail",
|
|
2279
2288
|
value: function () {
|
|
2280
2289
|
var _openProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(productId) {
|
|
2281
|
-
var
|
|
2290
|
+
var targetProductData, newScheduleArr, dateRange;
|
|
2282
2291
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
2283
2292
|
while (1) switch (_context25.prev = _context25.next) {
|
|
2284
2293
|
case 0:
|
|
2285
2294
|
_context25.next = 2;
|
|
2286
2295
|
return this.store.products.getProduct(productId);
|
|
2287
2296
|
case 2:
|
|
2288
|
-
|
|
2289
|
-
if (!
|
|
2290
|
-
_context25.next =
|
|
2297
|
+
targetProductData = _context25.sent;
|
|
2298
|
+
if (!targetProductData) {
|
|
2299
|
+
_context25.next = 17;
|
|
2291
2300
|
break;
|
|
2292
2301
|
}
|
|
2293
|
-
|
|
2294
|
-
this.store.
|
|
2302
|
+
this.store.currentProduct = targetProductData;
|
|
2303
|
+
this.store.currentProductMeta = {};
|
|
2295
2304
|
// 资源预加载,如果是 duration 类型的商品,且是先选日期的流程,在这里预拉取资源数据
|
|
2296
2305
|
if (!targetProductData['schedule.ids']) {
|
|
2297
|
-
_context25.next =
|
|
2306
|
+
_context25.next = 12;
|
|
2298
2307
|
break;
|
|
2299
2308
|
}
|
|
2300
2309
|
newScheduleArr = this.getScheduleDataByIds(targetProductData['schedule.ids']);
|
|
2301
|
-
|
|
2302
|
-
|
|
2310
|
+
if (!this.store.currentProductMeta) this.store.currentProductMeta = {};
|
|
2311
|
+
this.store.currentProductMeta.schedule = newScheduleArr;
|
|
2312
|
+
_context25.next = 17;
|
|
2303
2313
|
break;
|
|
2304
|
-
case
|
|
2314
|
+
case 12:
|
|
2305
2315
|
if (!targetProductData.duration) {
|
|
2306
|
-
_context25.next =
|
|
2316
|
+
_context25.next = 17;
|
|
2307
2317
|
break;
|
|
2308
2318
|
}
|
|
2309
2319
|
dateRange = this.store.date.getDateRange(); // 如果不是先选日期的流程 duration 商品就啥也不做
|
|
2310
2320
|
if (dateRange !== null && dateRange !== void 0 && dateRange.length) {
|
|
2311
|
-
_context25.next =
|
|
2321
|
+
_context25.next = 16;
|
|
2312
2322
|
break;
|
|
2313
2323
|
}
|
|
2314
2324
|
return _context25.abrupt("return");
|
|
2315
|
-
case
|
|
2325
|
+
case 16:
|
|
2316
2326
|
// this.store.date.getResourceDates({
|
|
2317
2327
|
// query: {
|
|
2318
2328
|
// start_date: dateRange[0].date,
|
|
@@ -2325,7 +2335,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2325
2335
|
endDate: dateRange[dateRange.length - 1].date,
|
|
2326
2336
|
products: [targetProductData]
|
|
2327
2337
|
});
|
|
2328
|
-
case
|
|
2338
|
+
case 17:
|
|
2329
2339
|
case "end":
|
|
2330
2340
|
return _context25.stop();
|
|
2331
2341
|
}
|
|
@@ -2339,8 +2349,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2339
2349
|
}, {
|
|
2340
2350
|
key: "closeProductDetail",
|
|
2341
2351
|
value: function closeProductDetail() {
|
|
2342
|
-
|
|
2343
|
-
|
|
2352
|
+
if (this.store.currentProductMeta) {
|
|
2353
|
+
this.store.currentProductMeta.schedule = [];
|
|
2354
|
+
}
|
|
2344
2355
|
this.store.currentProduct = undefined;
|
|
2345
2356
|
}
|
|
2346
2357
|
}, {
|
|
@@ -2353,7 +2364,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2353
2364
|
product = _ref10.product;
|
|
2354
2365
|
var targetProduct = this.store.currentProduct;
|
|
2355
2366
|
// 如果外面传递了product 优先用外面的
|
|
2356
|
-
var targetProductData = product ||
|
|
2367
|
+
var targetProductData = product || targetProduct;
|
|
2357
2368
|
var targetSchedules = [];
|
|
2358
2369
|
// 如果外面传递了 scheduleIds,优先取入参
|
|
2359
2370
|
if (scheduleIds !== null && scheduleIds !== void 0 && scheduleIds.length) {
|
|
@@ -2368,7 +2379,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2368
2379
|
var cartItems = cloneDeep(this.store.cart.getItems());
|
|
2369
2380
|
var resourcesMap = getResourcesMap((targetResourceDate === null || targetResourceDate === void 0 ? void 0 : targetResourceDate.resource) || []);
|
|
2370
2381
|
var selectedResources = getOthersSelectedResources(cartItems, '', resourcesMap);
|
|
2371
|
-
var productResources = getResourcesByProduct(resourcesMap, resources || ((_this$store$currentPr2 = this.store.currentProduct) === null || _this$store$currentPr2 === void 0 || (_this$store$currentPr2 = _this$store$currentPr2.
|
|
2382
|
+
var productResources = getResourcesByProduct(resourcesMap, resources || ((_this$store$currentPr2 = this.store.currentProduct) === null || _this$store$currentPr2 === void 0 || (_this$store$currentPr2 = _this$store$currentPr2.product_resource) === null || _this$store$currentPr2 === void 0 ? void 0 : _this$store$currentPr2.resources) || [], selectedResources, 1);
|
|
2372
2383
|
var minTimeMaxTime = calcMinTimeMaxTimeBySchedules(targetSchedules, {}, date);
|
|
2373
2384
|
var scheduleTimeSlots = getAllSortedDateRanges(minTimeMaxTime);
|
|
2374
2385
|
// 当前所有待选择资源的集合,先提出来,提升性能
|
|
@@ -2488,22 +2499,34 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2488
2499
|
key: "getProductTypeById",
|
|
2489
2500
|
value: function () {
|
|
2490
2501
|
var _getProductTypeById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(id) {
|
|
2491
|
-
var
|
|
2502
|
+
var productData, _productData$schedule;
|
|
2492
2503
|
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2493
2504
|
while (1) switch (_context26.prev = _context26.next) {
|
|
2494
2505
|
case 0:
|
|
2495
2506
|
_context26.next = 2;
|
|
2496
2507
|
return this.store.products.getProduct(id);
|
|
2497
2508
|
case 2:
|
|
2498
|
-
|
|
2499
|
-
if (!
|
|
2500
|
-
_context26.next =
|
|
2509
|
+
productData = _context26.sent;
|
|
2510
|
+
if (!productData) {
|
|
2511
|
+
_context26.next = 9;
|
|
2501
2512
|
break;
|
|
2502
2513
|
}
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2514
|
+
if (!productData.duration) {
|
|
2515
|
+
_context26.next = 6;
|
|
2516
|
+
break;
|
|
2517
|
+
}
|
|
2518
|
+
return _context26.abrupt("return", 'duration');
|
|
2506
2519
|
case 6:
|
|
2520
|
+
if (!((_productData$schedule = productData['schedule.ids']) !== null && _productData$schedule !== void 0 && _productData$schedule.length)) {
|
|
2521
|
+
_context26.next = 8;
|
|
2522
|
+
break;
|
|
2523
|
+
}
|
|
2524
|
+
return _context26.abrupt("return", 'session');
|
|
2525
|
+
case 8:
|
|
2526
|
+
return _context26.abrupt("return", 'normal');
|
|
2527
|
+
case 9:
|
|
2528
|
+
return _context26.abrupt("return", 'normal');
|
|
2529
|
+
case 10:
|
|
2507
2530
|
case "end":
|
|
2508
2531
|
return _context26.stop();
|
|
2509
2532
|
}
|
|
@@ -2675,7 +2698,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2675
2698
|
key: "getAvailableDateForSessionOptimize",
|
|
2676
2699
|
value: function () {
|
|
2677
2700
|
var _getAvailableDateForSessionOptimize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
|
|
2678
|
-
var _this$store$currentPr3, _this$store$currentPr4,
|
|
2701
|
+
var _this$store$currentPr3, _this$store$currentPr4, _tempProducts;
|
|
2679
2702
|
var params,
|
|
2680
2703
|
startDate,
|
|
2681
2704
|
endDate,
|
|
@@ -2721,7 +2744,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2721
2744
|
endDate = tempEndDate;
|
|
2722
2745
|
|
|
2723
2746
|
// 先去读缓存结果,因为正常 UI 调用的是 7 天,而下面我会直接计算 30 天(最少也是 14 天),所以先去读缓存结果,如果缓存结果存在,则直接返回
|
|
2724
|
-
cache = (_this$store$currentPr3 = this.store.
|
|
2747
|
+
cache = (_this$store$currentPr3 = this.store.currentProductMeta) === null || _this$store$currentPr3 === void 0 ? void 0 : _this$store$currentPr3['timeSlotBySchedule'];
|
|
2725
2748
|
if (!cache) {
|
|
2726
2749
|
_context29.next = 13;
|
|
2727
2750
|
break;
|
|
@@ -2737,8 +2760,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2737
2760
|
});
|
|
2738
2761
|
case 13:
|
|
2739
2762
|
// 如果当前打开了某个的商品详情弹窗,则应该默认用这个商品
|
|
2740
|
-
tempProducts =
|
|
2741
|
-
schedule = (_this$store$
|
|
2763
|
+
tempProducts = this.store.currentProduct;
|
|
2764
|
+
schedule = (_this$store$currentPr4 = this.store.currentProductMeta) === null || _this$store$currentPr4 === void 0 ? void 0 : _this$store$currentPr4['schedule'];
|
|
2742
2765
|
filteredSchedule = filterScheduleByDateRange(schedule, startDate || '', endDate || ''); // 1.后端返回的数据,确定资源在每一天的可用和使用情况
|
|
2743
2766
|
tempResourceIds = getResourcesIdsByProduct(tempProducts);
|
|
2744
2767
|
_context29.next = 19;
|
|
@@ -2898,17 +2921,18 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2898
2921
|
this.store.date.setDateList(dates);
|
|
2899
2922
|
|
|
2900
2923
|
// 缓存这次结果,以防后面他小幅度范围内去修改天数
|
|
2901
|
-
(
|
|
2924
|
+
if (!this.store.currentProductMeta) this.store.currentProductMeta = {};
|
|
2925
|
+
this.store.currentProductMeta.timeSlotBySchedule = {
|
|
2902
2926
|
dateList: dates,
|
|
2903
2927
|
firstAvailableDate: firstAvailableDate,
|
|
2904
2928
|
startDate: startDate,
|
|
2905
2929
|
endDate: dayjs(currentDate).format('YYYY-MM-DD')
|
|
2906
|
-
}
|
|
2930
|
+
};
|
|
2907
2931
|
return _context29.abrupt("return", {
|
|
2908
2932
|
dateList: dates,
|
|
2909
2933
|
firstAvailableDate: firstAvailableDate
|
|
2910
2934
|
});
|
|
2911
|
-
case
|
|
2935
|
+
case 39:
|
|
2912
2936
|
case "end":
|
|
2913
2937
|
return _context29.stop();
|
|
2914
2938
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductList, CartModule,
|
|
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;
|
|
@@ -11,7 +11,8 @@ export interface BookingByStepState {
|
|
|
11
11
|
accountList: AccountListModule;
|
|
12
12
|
order: OrderModule;
|
|
13
13
|
payment: PaymentModule;
|
|
14
|
-
currentProduct?:
|
|
14
|
+
currentProduct?: ProductData;
|
|
15
|
+
currentProductMeta?: Record<string, any>;
|
|
15
16
|
schedule: ScheduleModule;
|
|
16
17
|
}
|
|
17
18
|
export declare function createModule<T extends keyof BookingByStepState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingByStepState[T];
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Module, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
+
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
4
|
+
import { IGetCustomerListParams, ICustomer, ILoadProductsParams, IScanResult } from './types';
|
|
5
|
+
import { ProductData } from '../../modules';
|
|
6
|
+
export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
7
|
+
protected defaultName: string;
|
|
8
|
+
protected defaultVersion: string;
|
|
9
|
+
isSolution: boolean;
|
|
10
|
+
request: RequestPlugin;
|
|
11
|
+
window: WindowPlugin;
|
|
12
|
+
private shopStore;
|
|
13
|
+
private store;
|
|
14
|
+
private otherParams;
|
|
15
|
+
private cacheId;
|
|
16
|
+
private platform;
|
|
17
|
+
private scan;
|
|
18
|
+
initialize(core: PisellCore, options: any): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* 获取商品列表
|
|
21
|
+
* @param params 包含 schedule_date 的参数
|
|
22
|
+
* @returns 商品列表
|
|
23
|
+
*/
|
|
24
|
+
loadProducts(params?: ILoadProductsParams): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* 获取商品列表(不加载到模块中)
|
|
27
|
+
* @returns 商品列表
|
|
28
|
+
*/
|
|
29
|
+
getProducts(): Promise<ProductData[]>;
|
|
30
|
+
/**
|
|
31
|
+
* 获取客户列表
|
|
32
|
+
* @param params 查询参数
|
|
33
|
+
* @returns 客户列表响应
|
|
34
|
+
*/
|
|
35
|
+
getCustomerList(params?: IGetCustomerListParams): Promise<import("../../modules").ICustomerListResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* 设置活跃客户
|
|
38
|
+
* @param customer 客户信息
|
|
39
|
+
*/
|
|
40
|
+
setActiveCustomer(customer: ICustomer): void;
|
|
41
|
+
/**
|
|
42
|
+
* 获取当前活跃客户
|
|
43
|
+
* @returns 当前活跃客户
|
|
44
|
+
*/
|
|
45
|
+
getActiveCustomer(): ICustomer | null;
|
|
46
|
+
/**
|
|
47
|
+
* 根据ID设置选中的客户
|
|
48
|
+
* @param customerId 客户ID
|
|
49
|
+
*/
|
|
50
|
+
setSelectedCustomerById(customerId: string | number): void;
|
|
51
|
+
/**
|
|
52
|
+
* 获取所有客户
|
|
53
|
+
* @returns 客户列表
|
|
54
|
+
*/
|
|
55
|
+
getCustomers(): ICustomer[];
|
|
56
|
+
/**
|
|
57
|
+
* 根据ID获取客户
|
|
58
|
+
* @param customerId 客户ID
|
|
59
|
+
* @returns 客户信息
|
|
60
|
+
*/
|
|
61
|
+
getCustomerById(customerId: string | number): ICustomer | null;
|
|
62
|
+
/**
|
|
63
|
+
* 清空客户列表
|
|
64
|
+
*/
|
|
65
|
+
clearCustomers(): void;
|
|
66
|
+
/**
|
|
67
|
+
* 添加客户到列表第一位
|
|
68
|
+
* @param customer 要添加的客户信息
|
|
69
|
+
*/
|
|
70
|
+
addCustomerToFirst(customer: ICustomer): void;
|
|
71
|
+
/**
|
|
72
|
+
* 获取客户分页信息
|
|
73
|
+
* @returns 分页信息
|
|
74
|
+
*/
|
|
75
|
+
getCustomerPaginationInfo(): import("../../modules").IPaginationInfo;
|
|
76
|
+
/**
|
|
77
|
+
* 获取客户列表总数
|
|
78
|
+
* @returns 总数
|
|
79
|
+
*/
|
|
80
|
+
getCustomerTotal(): number;
|
|
81
|
+
/**
|
|
82
|
+
* 设置客户分页信息
|
|
83
|
+
* @param page 页码
|
|
84
|
+
* @param pageSize 每页数量
|
|
85
|
+
*/
|
|
86
|
+
setCustomerPaginationInfo(page: number, pageSize: number): void;
|
|
87
|
+
/**
|
|
88
|
+
* 便捷方法:切换客户分页并自动获取数据
|
|
89
|
+
* @param page 页码
|
|
90
|
+
* @param pageSize 每页数量(可选)
|
|
91
|
+
* @returns 客户列表响应
|
|
92
|
+
*/
|
|
93
|
+
changeCustomerPage(page: number, pageSize?: number): Promise<import("../../modules").ICustomerListResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* 滚动加载更多客户数据 - 数据会追加到现有列表中
|
|
96
|
+
* @returns 客户列表响应
|
|
97
|
+
*/
|
|
98
|
+
loadMoreCustomers(): Promise<import("../../modules").ICustomerListResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* 重置并重新开始滚动加载客户数据
|
|
101
|
+
* @param params 查询参数
|
|
102
|
+
* @returns 客户列表响应
|
|
103
|
+
*/
|
|
104
|
+
resetAndLoadCustomers(params?: IGetCustomerListParams): Promise<import("../../modules").ICustomerListResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* 检查是否还有更多客户数据可以加载
|
|
107
|
+
* @returns 是否还有更多数据
|
|
108
|
+
*/
|
|
109
|
+
hasMoreCustomers(): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* 获取当前的客户搜索条件
|
|
112
|
+
* @returns 当前搜索条件
|
|
113
|
+
*/
|
|
114
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
115
|
+
/**
|
|
116
|
+
* 获取客户列表状态(包含滚动加载相关状态)
|
|
117
|
+
* @returns 客户状态
|
|
118
|
+
*/
|
|
119
|
+
getCustomerState(): import("../../modules").CustomerState;
|
|
120
|
+
/**
|
|
121
|
+
* 全局扫描监听
|
|
122
|
+
* @param callback 回调
|
|
123
|
+
*/
|
|
124
|
+
scanGlobalListener(callback: (data: IScanResult) => void): {
|
|
125
|
+
remove: () => void;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* 客户扫描监听
|
|
129
|
+
* @param callback 回调
|
|
130
|
+
*/
|
|
131
|
+
scanCustomerListener(callback: (data: IScanResult) => void): {
|
|
132
|
+
remove: () => void;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* 调用摄像头
|
|
136
|
+
* @param data 用户自定义数据
|
|
137
|
+
*/
|
|
138
|
+
activateCamera(data?: {
|
|
139
|
+
[key: string]: any;
|
|
140
|
+
}): void;
|
|
141
|
+
/**
|
|
142
|
+
* 禁用所有扫描监听
|
|
143
|
+
*/
|
|
144
|
+
disableAllScanListeners(): void;
|
|
145
|
+
/**
|
|
146
|
+
* 启用所有扫描监听
|
|
147
|
+
*/
|
|
148
|
+
enableAllScanListeners(): void;
|
|
149
|
+
/**
|
|
150
|
+
* 清空所有扫描监听对应的任务执行队列
|
|
151
|
+
*/
|
|
152
|
+
clearAllScanListenersTaskQueue(): void;
|
|
153
|
+
/**
|
|
154
|
+
* 设置其他参数
|
|
155
|
+
* @param params 参数
|
|
156
|
+
* @param options 选项
|
|
157
|
+
*/
|
|
158
|
+
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
159
|
+
cover?: boolean;
|
|
160
|
+
}): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* 获取其他参数
|
|
163
|
+
* @returns 其他参数
|
|
164
|
+
*/
|
|
165
|
+
getOtherParams(): Promise<Record<string, any>>;
|
|
166
|
+
/**
|
|
167
|
+
* 销毁模块
|
|
168
|
+
*/
|
|
169
|
+
destroy(): void;
|
|
170
|
+
}
|
|
171
|
+
export * from './types';
|
|
172
|
+
export { BookingTicketImpl as BookingTicket };
|