@pisell/pisellos 2.1.100 → 2.1.101
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/effects/index.d.ts +2 -2
- package/dist/modules/Customer/types.d.ts +1 -1
- package/dist/modules/Payment/types.d.ts +7 -7
- package/dist/modules/Rules/types.d.ts +1 -1
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts +1 -1
- package/dist/modules/Schedule/type.d.ts +7 -7
- package/dist/modules/Schedule/types.d.ts +9 -9
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/utils/resources.d.ts +1 -1
- package/dist/solution/ShopDiscount/types.d.ts +1 -1
- package/dist/solution/ShopDiscount/utils.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/task.d.ts +2 -2
- package/dist/utils/watch.d.ts +2 -2
- package/lib/core/index.js +28 -27
- package/lib/effects/index.d.ts +2 -2
- package/lib/effects/index.js +7 -3
- package/lib/modules/Account/index.js +10 -9
- package/lib/modules/AccountList/index.js +11 -14
- package/lib/modules/BaseModule.js +3 -6
- package/lib/modules/Cart/index.js +9 -14
- package/lib/modules/Cart/utils/cartProduct.js +6 -3
- package/lib/modules/Customer/constants.js +1 -1
- package/lib/modules/Customer/index.js +15 -18
- package/lib/modules/Customer/types.d.ts +1 -1
- package/lib/modules/Date/index.js +6 -10
- package/lib/modules/Date/types.js +0 -1
- package/lib/modules/Discount/index.js +6 -11
- package/lib/modules/Guests/index.js +15 -10
- package/lib/modules/Order/index.js +7 -10
- package/lib/modules/Payment/cash.js +1 -1
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +1 -1
- package/lib/modules/Payment/eftpos.js +1 -1
- package/lib/modules/Payment/index.js +73 -84
- package/lib/modules/Payment/types.d.ts +7 -7
- package/lib/modules/Payment/utils.js +6 -3
- package/lib/modules/Payment/walletpass.js +31 -31
- package/lib/modules/Product/index.js +5 -6
- package/lib/modules/ProductList/index.js +3 -5
- package/lib/modules/Resource/index.js +12 -8
- package/lib/modules/Rules/index.js +35 -21
- package/lib/modules/Rules/types.d.ts +1 -1
- package/lib/modules/Schedule/getDateIsInSchedule.d.ts +1 -1
- package/lib/modules/Schedule/index.js +5 -8
- package/lib/modules/Schedule/type.d.ts +7 -7
- package/lib/modules/Schedule/types.d.ts +9 -9
- package/lib/modules/Schedule/utils.js +4 -2
- package/lib/modules/Step/index.js +4 -7
- package/lib/modules/Summary/index.js +4 -9
- package/lib/modules/Summary/utils.js +16 -8
- package/lib/plugins/request.js +33 -34
- package/lib/plugins/window.js +113 -101
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +177 -110
- package/lib/solution/BookingByStep/utils/capacity.js +16 -11
- package/lib/solution/BookingByStep/utils/resources.d.ts +1 -1
- package/lib/solution/BookingByStep/utils/resources.js +8 -4
- package/lib/solution/BookingByStep/utils/stock.js +6 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +27 -24
- package/lib/solution/BookingTicket/index.js +14 -19
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +3 -3
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +6 -6
- package/lib/solution/BookingTicket/utils/scan/index.js +1 -3
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +9 -10
- package/lib/solution/BuyTickets/index.js +15 -15
- package/lib/solution/Checkout/index.js +211 -216
- package/lib/solution/Checkout/utils/index.js +22 -18
- package/lib/solution/RegisterAndLogin/config.js +2 -2
- package/lib/solution/RegisterAndLogin/index.js +110 -114
- package/lib/solution/RegisterAndLogin/utils.js +9 -9
- package/lib/solution/ShopDiscount/index.js +13 -16
- package/lib/solution/ShopDiscount/types.d.ts +1 -1
- package/lib/solution/ShopDiscount/utils.d.ts +2 -2
- package/lib/solution/ShopDiscount/utils.js +2 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/utils/task.d.ts +2 -2
- package/lib/utils/task.js +3 -3
- package/lib/utils/watch.d.ts +2 -2
- package/lib/utils/watch.js +7 -5
- package/package.json +17 -16
|
@@ -24,14 +24,11 @@ __export(Step_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(Step_exports);
|
|
25
25
|
var import_BaseModule = require("../BaseModule");
|
|
26
26
|
var StepModule = class extends import_BaseModule.BaseModule {
|
|
27
|
-
defaultName = "step";
|
|
28
|
-
defaultVersion = "1.0.0";
|
|
29
|
-
store;
|
|
30
|
-
cacheId;
|
|
31
|
-
openCache = false;
|
|
32
|
-
fatherModule;
|
|
33
27
|
constructor(name, version) {
|
|
34
28
|
super(name, version);
|
|
29
|
+
this.defaultName = "step";
|
|
30
|
+
this.defaultVersion = "1.0.0";
|
|
31
|
+
this.openCache = false;
|
|
35
32
|
}
|
|
36
33
|
async initialize(core, options) {
|
|
37
34
|
var _a, _b;
|
|
@@ -116,7 +113,7 @@ var StepModule = class extends import_BaseModule.BaseModule {
|
|
|
116
113
|
let stepList = this.store.stepList;
|
|
117
114
|
const index = stepList.findIndex((n) => n.key === step.key);
|
|
118
115
|
if (index !== -1) {
|
|
119
|
-
console.log("[StepModule]
|
|
116
|
+
console.log("[StepModule] 步骤已存在,添加失败");
|
|
120
117
|
return;
|
|
121
118
|
}
|
|
122
119
|
if (key) {
|
|
@@ -37,16 +37,11 @@ var import_BaseModule = require("../BaseModule");
|
|
|
37
37
|
var import_Schedule = require("../Schedule");
|
|
38
38
|
var import_utils = require("./utils");
|
|
39
39
|
var SummaryModule = class extends import_BaseModule.BaseModule {
|
|
40
|
-
defaultName = "summary";
|
|
41
|
-
defaultVersion = "1.0.0";
|
|
42
|
-
shopStore;
|
|
43
|
-
store;
|
|
44
|
-
request;
|
|
45
|
-
cacheId;
|
|
46
|
-
openCache = false;
|
|
47
|
-
fatherModule;
|
|
48
40
|
constructor(name, version) {
|
|
49
41
|
super(name, version);
|
|
42
|
+
this.defaultName = "summary";
|
|
43
|
+
this.defaultVersion = "1.0.0";
|
|
44
|
+
this.openCache = false;
|
|
50
45
|
}
|
|
51
46
|
async initialize(core, options) {
|
|
52
47
|
var _a, _b;
|
|
@@ -65,7 +60,7 @@ var SummaryModule = class extends import_BaseModule.BaseModule {
|
|
|
65
60
|
this.fatherModule = options.otherParams.fatherModule;
|
|
66
61
|
}
|
|
67
62
|
if (!this.shopStore) {
|
|
68
|
-
throw new Error("SummaryModule
|
|
63
|
+
throw new Error("SummaryModule 需要 shopStore 插件支持");
|
|
69
64
|
}
|
|
70
65
|
this.getSurchargeList();
|
|
71
66
|
}
|
|
@@ -134,9 +134,11 @@ var getTax = ({ service, addons, bookingDetail, bookingId }, options) => {
|
|
|
134
134
|
};
|
|
135
135
|
function getDiscountedTaxableBase(input) {
|
|
136
136
|
const { basePrice, discount, surchargeFee } = input;
|
|
137
|
-
if (surchargeFee.lte(0) && basePrice.lte(0))
|
|
137
|
+
if (surchargeFee.lte(0) && basePrice.lte(0))
|
|
138
|
+
return new import_decimal.default(0);
|
|
138
139
|
const discountedBase = basePrice.minus(discount);
|
|
139
|
-
if (discountedBase.lte(0))
|
|
140
|
+
if (discountedBase.lte(0))
|
|
141
|
+
return surchargeFee;
|
|
140
142
|
return discountedBase.plus(surchargeFee);
|
|
141
143
|
}
|
|
142
144
|
var processItemsTax = (items, { bookingDetail, bookingId }, options) => {
|
|
@@ -403,7 +405,8 @@ var getSurchargeAmount = ({ bookingDetail, bookingId }, surcharge, options) => {
|
|
|
403
405
|
return Number(bookingDetail.surcharge_fee);
|
|
404
406
|
}
|
|
405
407
|
}
|
|
406
|
-
if (!Array.isArray(surcharge))
|
|
408
|
+
if (!Array.isArray(surcharge))
|
|
409
|
+
return 0;
|
|
407
410
|
return surcharge.reduce((total, item) => {
|
|
408
411
|
return total + (item.value || 0);
|
|
409
412
|
}, 0);
|
|
@@ -543,7 +546,8 @@ var getSurcharge = ({ service, addons, bookingDetail, bookingId }, options) => {
|
|
|
543
546
|
return [];
|
|
544
547
|
}
|
|
545
548
|
resetItemsSurchargeSideEffects({ service, addons });
|
|
546
|
-
if (!Array.isArray(surcharge_list) || !(surcharge_list == null ? void 0 : surcharge_list.length))
|
|
549
|
+
if (!Array.isArray(surcharge_list) || !(surcharge_list == null ? void 0 : surcharge_list.length))
|
|
550
|
+
return [];
|
|
547
551
|
const surchargeWithAmount = [];
|
|
548
552
|
for (let i = 0; i < surcharge_list.length; i++) {
|
|
549
553
|
const surchargeConfig = surcharge_list[i];
|
|
@@ -756,7 +760,8 @@ var getSurcharge = ({ service, addons, bookingDetail, bookingId }, options) => {
|
|
|
756
760
|
};
|
|
757
761
|
function resetItemsSurchargeSideEffects({ service, addons }) {
|
|
758
762
|
const resetItem = (item) => {
|
|
759
|
-
if (!item)
|
|
763
|
+
if (!item)
|
|
764
|
+
return;
|
|
760
765
|
item.surcharge_fee = 0;
|
|
761
766
|
item.surcharge_rounding_remainder = 0;
|
|
762
767
|
item.relation_surcharge_ids = [];
|
|
@@ -765,12 +770,15 @@ function resetItemsSurchargeSideEffects({ service, addons }) {
|
|
|
765
770
|
for (let item of service) {
|
|
766
771
|
resetItem(item);
|
|
767
772
|
const arr = (item == null ? void 0 : item.bundle) || (item == null ? void 0 : item.bundles) || [];
|
|
768
|
-
for (let bundleItem of arr)
|
|
769
|
-
|
|
773
|
+
for (let bundleItem of arr)
|
|
774
|
+
resetItem(bundleItem);
|
|
775
|
+
for (let relationDetail of (item == null ? void 0 : item.relation_details) || [])
|
|
776
|
+
resetItem(relationDetail);
|
|
770
777
|
}
|
|
771
778
|
}
|
|
772
779
|
if (Array.isArray(addons == null ? void 0 : addons.value)) {
|
|
773
|
-
for (let item of addons.value)
|
|
780
|
+
for (let item of addons.value)
|
|
781
|
+
resetItem(item);
|
|
774
782
|
}
|
|
775
783
|
}
|
|
776
784
|
// Annotate the CommonJS export names for ESM import in node:
|
package/lib/plugins/request.js
CHANGED
|
@@ -24,9 +24,6 @@ __export(request_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(request_exports);
|
|
26
26
|
var RequestError = class extends Error {
|
|
27
|
-
response;
|
|
28
|
-
request;
|
|
29
|
-
config;
|
|
30
27
|
constructor(message, config, request, response) {
|
|
31
28
|
super(message);
|
|
32
29
|
this.name = "RequestError";
|
|
@@ -36,36 +33,38 @@ var RequestError = class extends Error {
|
|
|
36
33
|
}
|
|
37
34
|
};
|
|
38
35
|
var RequestPluginImpl = class {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
36
|
+
constructor() {
|
|
37
|
+
this.name = "request";
|
|
38
|
+
this.version = "1.0.0";
|
|
39
|
+
this.core = null;
|
|
40
|
+
/**
|
|
41
|
+
* 默认请求选项
|
|
42
|
+
*/
|
|
43
|
+
this.defaultOptions = {
|
|
44
|
+
method: "GET",
|
|
45
|
+
headers: {
|
|
46
|
+
"Content-Type": "application/json"
|
|
47
|
+
},
|
|
48
|
+
timeout: 3e4,
|
|
49
|
+
responseType: "json"
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* 全局拦截器
|
|
53
|
+
*/
|
|
54
|
+
this.interceptors = {
|
|
55
|
+
request: [],
|
|
56
|
+
response: [],
|
|
57
|
+
error: []
|
|
58
|
+
};
|
|
59
|
+
}
|
|
61
60
|
// 初始化方法
|
|
62
61
|
initialize() {
|
|
63
62
|
this.core = globalThis.pisellOS;
|
|
64
|
-
console.log("[RequestPlugin]
|
|
63
|
+
console.log("[RequestPlugin] 初始化完成");
|
|
65
64
|
}
|
|
66
65
|
// 销毁方法
|
|
67
66
|
destroy() {
|
|
68
|
-
console.log("[RequestPlugin]
|
|
67
|
+
console.log("[RequestPlugin] 已销毁");
|
|
69
68
|
}
|
|
70
69
|
/**
|
|
71
70
|
* 添加请求拦截器
|
|
@@ -150,7 +149,7 @@ var RequestPluginImpl = class {
|
|
|
150
149
|
config = await Promise.resolve(interceptor(config));
|
|
151
150
|
} catch (error) {
|
|
152
151
|
const requestError = error instanceof RequestError ? error : new RequestError(
|
|
153
|
-
error instanceof Error ? error.message : "
|
|
152
|
+
error instanceof Error ? error.message : "请求拦截器错误",
|
|
154
153
|
config
|
|
155
154
|
);
|
|
156
155
|
let processedError = requestError;
|
|
@@ -175,7 +174,7 @@ var RequestPluginImpl = class {
|
|
|
175
174
|
);
|
|
176
175
|
} catch (error) {
|
|
177
176
|
const requestError = error instanceof RequestError ? error : new RequestError(
|
|
178
|
-
error instanceof Error ? error.message : "
|
|
177
|
+
error instanceof Error ? error.message : "响应拦截器错误",
|
|
179
178
|
config,
|
|
180
179
|
null,
|
|
181
180
|
response
|
|
@@ -195,7 +194,7 @@ var RequestPluginImpl = class {
|
|
|
195
194
|
return processedResponse.data;
|
|
196
195
|
} catch (error) {
|
|
197
196
|
const requestError = error instanceof RequestError ? error : new RequestError(
|
|
198
|
-
error instanceof Error ? error.message : "
|
|
197
|
+
error instanceof Error ? error.message : "请求错误",
|
|
199
198
|
config
|
|
200
199
|
);
|
|
201
200
|
let processedError = requestError;
|
|
@@ -226,7 +225,7 @@ var RequestPluginImpl = class {
|
|
|
226
225
|
withCredentials
|
|
227
226
|
} = config;
|
|
228
227
|
if (!url) {
|
|
229
|
-
throw new RequestError("URL
|
|
228
|
+
throw new RequestError("URL不能为空", config);
|
|
230
229
|
}
|
|
231
230
|
let fullUrl = url;
|
|
232
231
|
if (params && Object.keys(params).length > 0) {
|
|
@@ -256,13 +255,13 @@ var RequestPluginImpl = class {
|
|
|
256
255
|
const timeoutPromise = new Promise((_, reject) => {
|
|
257
256
|
if (timeout) {
|
|
258
257
|
timeoutId = setTimeout(() => {
|
|
259
|
-
reject(new RequestError(
|
|
258
|
+
reject(new RequestError(`请求超时: ${timeout}ms`, config));
|
|
260
259
|
}, timeout);
|
|
261
260
|
}
|
|
262
261
|
});
|
|
263
262
|
try {
|
|
264
263
|
const fetchPromise = typeof fetch !== "undefined" ? fetch(fullUrl, fetchOptions) : Promise.reject(
|
|
265
|
-
new RequestError("
|
|
264
|
+
new RequestError("当前环境不支持 fetch API", config)
|
|
266
265
|
);
|
|
267
266
|
const response = await Promise.race([fetchPromise, timeoutPromise]);
|
|
268
267
|
const responseHeaders = {};
|
|
@@ -298,7 +297,7 @@ var RequestPluginImpl = class {
|
|
|
298
297
|
};
|
|
299
298
|
if (!response.ok) {
|
|
300
299
|
throw new RequestError(
|
|
301
|
-
|
|
300
|
+
`请求失败,状态码: ${response.status}`,
|
|
302
301
|
config,
|
|
303
302
|
fetchOptions,
|
|
304
303
|
result
|
package/lib/plugins/window.js
CHANGED
|
@@ -23,7 +23,9 @@ __export(window_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(window_exports);
|
|
25
25
|
var SimpleStorage = class {
|
|
26
|
-
|
|
26
|
+
constructor() {
|
|
27
|
+
this.items = {};
|
|
28
|
+
}
|
|
27
29
|
get length() {
|
|
28
30
|
return Object.keys(this.items).length;
|
|
29
31
|
}
|
|
@@ -45,16 +47,18 @@ var SimpleStorage = class {
|
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
var SimpleLocation = class {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
constructor() {
|
|
51
|
+
this.hash = "";
|
|
52
|
+
this.host = "localhost";
|
|
53
|
+
this.hostname = "localhost";
|
|
54
|
+
this.href = "https://localhost";
|
|
55
|
+
this.origin = "https://localhost";
|
|
56
|
+
this.pathname = "/";
|
|
57
|
+
this.port = "";
|
|
58
|
+
this.protocol = "https:";
|
|
59
|
+
this.search = "";
|
|
60
|
+
this.ancestorOrigins = {};
|
|
61
|
+
}
|
|
58
62
|
assign(url) {
|
|
59
63
|
}
|
|
60
64
|
reload() {
|
|
@@ -66,25 +70,29 @@ var SimpleLocation = class {
|
|
|
66
70
|
}
|
|
67
71
|
};
|
|
68
72
|
var SimpleNavigator = class {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
constructor() {
|
|
74
|
+
this.userAgent = "PisellOS/1.0";
|
|
75
|
+
this.language = "zh-CN";
|
|
76
|
+
this.languages = ["zh-CN", "en-US"];
|
|
77
|
+
this.onLine = true;
|
|
78
|
+
this.cookieEnabled = true;
|
|
79
|
+
// 以下属性只提供必要实现
|
|
80
|
+
this.appCodeName = "PisellOS";
|
|
81
|
+
this.appName = "PisellOS";
|
|
82
|
+
this.appVersion = "1.0";
|
|
83
|
+
this.platform = "PisellOS";
|
|
84
|
+
this.product = "PisellOS";
|
|
85
|
+
}
|
|
80
86
|
javaEnabled() {
|
|
81
87
|
return false;
|
|
82
88
|
}
|
|
83
89
|
};
|
|
84
90
|
var SimpleHistory = class {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
constructor() {
|
|
92
|
+
this.length = 0;
|
|
93
|
+
this.scrollRestoration = "auto";
|
|
94
|
+
this.state = null;
|
|
95
|
+
}
|
|
88
96
|
back() {
|
|
89
97
|
}
|
|
90
98
|
forward() {
|
|
@@ -97,8 +105,17 @@ var SimpleHistory = class {
|
|
|
97
105
|
}
|
|
98
106
|
};
|
|
99
107
|
var SimpleDocument = class {
|
|
100
|
-
|
|
101
|
-
|
|
108
|
+
constructor() {
|
|
109
|
+
// 仅实现基本功能
|
|
110
|
+
this.elements = {};
|
|
111
|
+
// Document 接口的必要属性
|
|
112
|
+
this.URL = "https://localhost";
|
|
113
|
+
this.documentURI = "https://localhost";
|
|
114
|
+
this.origin = "https://localhost";
|
|
115
|
+
this.characterSet = "UTF-8";
|
|
116
|
+
this.contentType = "text/html";
|
|
117
|
+
this.compatMode = "CSS1Compat";
|
|
118
|
+
}
|
|
102
119
|
createElement(tagName) {
|
|
103
120
|
const element = {
|
|
104
121
|
tagName: tagName.toUpperCase(),
|
|
@@ -138,13 +155,6 @@ var SimpleDocument = class {
|
|
|
138
155
|
getElementById(id) {
|
|
139
156
|
return this.elements[id] || null;
|
|
140
157
|
}
|
|
141
|
-
// Document 接口的必要属性
|
|
142
|
-
URL = "https://localhost";
|
|
143
|
-
documentURI = "https://localhost";
|
|
144
|
-
origin = "https://localhost";
|
|
145
|
-
characterSet = "UTF-8";
|
|
146
|
-
contentType = "text/html";
|
|
147
|
-
compatMode = "CSS1Compat";
|
|
148
158
|
querySelector() {
|
|
149
159
|
return null;
|
|
150
160
|
}
|
|
@@ -159,82 +169,84 @@ var SimpleDocument = class {
|
|
|
159
169
|
}
|
|
160
170
|
};
|
|
161
171
|
var WindowPluginImpl = class {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
172
|
+
constructor() {
|
|
173
|
+
this.name = "window";
|
|
174
|
+
this.version = "1.0.0";
|
|
175
|
+
// 定时器相关
|
|
176
|
+
this.setTimeout = Object.assign(
|
|
177
|
+
function(handler, timeout, ...args) {
|
|
178
|
+
if (typeof globalThis !== "undefined" && globalThis.setTimeout) {
|
|
179
|
+
return globalThis.setTimeout(handler, timeout, ...args);
|
|
180
|
+
}
|
|
181
|
+
const timeoutId = Date.now();
|
|
182
|
+
Promise.resolve().then(() => {
|
|
183
|
+
setTimeout(() => {
|
|
184
|
+
if (typeof handler === "function") {
|
|
185
|
+
handler(...args);
|
|
186
|
+
} else {
|
|
187
|
+
eval(handler);
|
|
188
|
+
}
|
|
189
|
+
}, timeout || 0);
|
|
190
|
+
});
|
|
191
|
+
return timeoutId;
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
__promisify__: function(delay, value) {
|
|
195
|
+
return new Promise((resolve) => setTimeout(resolve, delay, value));
|
|
196
|
+
}
|
|
169
197
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
handler(...args);
|
|
175
|
-
} else {
|
|
176
|
-
eval(handler);
|
|
177
|
-
}
|
|
178
|
-
}, timeout || 0);
|
|
179
|
-
});
|
|
180
|
-
return timeoutId;
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
__promisify__: function(delay, value) {
|
|
184
|
-
return new Promise((resolve) => setTimeout(resolve, delay, value));
|
|
198
|
+
);
|
|
199
|
+
this.clearTimeout = function(timeout2) {
|
|
200
|
+
if (typeof globalThis !== "undefined" && globalThis.clearTimeout) {
|
|
201
|
+
globalThis.clearTimeout(timeout2);
|
|
185
202
|
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
203
|
+
};
|
|
204
|
+
this.setInterval = Object.assign(
|
|
205
|
+
function(handler, timeout, ...args) {
|
|
206
|
+
if (typeof globalThis !== "undefined" && globalThis.setInterval) {
|
|
207
|
+
return globalThis.setInterval(handler, timeout, ...args);
|
|
208
|
+
}
|
|
209
|
+
const intervalId = Date.now();
|
|
210
|
+
const recursiveTimeout = () => {
|
|
211
|
+
this.setTimeout(() => {
|
|
212
|
+
if (typeof handler === "function") {
|
|
213
|
+
handler(...args);
|
|
214
|
+
} else {
|
|
215
|
+
eval(handler);
|
|
216
|
+
}
|
|
217
|
+
recursiveTimeout();
|
|
218
|
+
}, timeout || 0);
|
|
219
|
+
};
|
|
220
|
+
recursiveTimeout();
|
|
221
|
+
return intervalId;
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
__promisify__: function(delay, value) {
|
|
225
|
+
return new Promise((resolve) => setInterval(resolve, delay, value));
|
|
226
|
+
}
|
|
197
227
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
handler(...args);
|
|
203
|
-
} else {
|
|
204
|
-
eval(handler);
|
|
205
|
-
}
|
|
206
|
-
recursiveTimeout();
|
|
207
|
-
}, timeout || 0);
|
|
208
|
-
};
|
|
209
|
-
recursiveTimeout();
|
|
210
|
-
return intervalId;
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
__promisify__: function(delay, value) {
|
|
214
|
-
return new Promise((resolve) => setInterval(resolve, delay, value));
|
|
228
|
+
);
|
|
229
|
+
this.clearInterval = function(timeout2) {
|
|
230
|
+
if (typeof globalThis !== "undefined" && globalThis.clearInterval) {
|
|
231
|
+
globalThis.clearInterval(timeout2);
|
|
215
232
|
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
// 浏览器环境对象
|
|
227
|
-
location = new SimpleLocation();
|
|
228
|
-
navigator = new SimpleNavigator();
|
|
229
|
-
document = new SimpleDocument();
|
|
230
|
-
history = new SimpleHistory();
|
|
233
|
+
};
|
|
234
|
+
// 存储相关
|
|
235
|
+
this.localStorage = new SimpleStorage();
|
|
236
|
+
this.sessionStorage = new SimpleStorage();
|
|
237
|
+
// 浏览器环境对象
|
|
238
|
+
this.location = new SimpleLocation();
|
|
239
|
+
this.navigator = new SimpleNavigator();
|
|
240
|
+
this.document = new SimpleDocument();
|
|
241
|
+
this.history = new SimpleHistory();
|
|
242
|
+
}
|
|
231
243
|
// 初始化方法
|
|
232
244
|
initialize() {
|
|
233
|
-
console.log("[WindowPlugin]
|
|
245
|
+
console.log("[WindowPlugin] 初始化完成");
|
|
234
246
|
}
|
|
235
247
|
// 销毁方法
|
|
236
248
|
destroy() {
|
|
237
|
-
console.log("[WindowPlugin]
|
|
249
|
+
console.log("[WindowPlugin] 已销毁");
|
|
238
250
|
}
|
|
239
251
|
};
|
|
240
252
|
var window_default = new WindowPluginImpl();
|
|
@@ -310,7 +310,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
310
310
|
date: string;
|
|
311
311
|
status: string;
|
|
312
312
|
week: string;
|
|
313
|
-
weekNum: 0 |
|
|
313
|
+
weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
314
314
|
}[]>;
|
|
315
315
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
316
316
|
private getScheduleDataByIds;
|