@pisell/private-materials 6.6.59 → 6.6.60
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/utils.js +10 -3
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/booking/dashboard/index.d.ts +0 -5
- package/es/components/booking/dashboard/index.js +6 -9
- package/es/components/booking/info/service2/Group/utils.js +1 -30
- package/es/components/booking/info2/service/editService/index.js +49 -6
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +16 -0
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +15 -23
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
- package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -2
- package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +2 -5
- package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -2
- package/es/components/ticketBooking/components/bookingDataPanel/index.js +2 -5
- package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +1 -2
- package/es/components/ticketBooking/components/ticketBooking/index.js +37 -156
- package/es/components/ticketBooking/index.js +1 -7
- package/es/pro/Login2.0/components/phoneValidation.js +58 -65
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +12 -5
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/booking/dashboard/index.d.ts +0 -5
- package/lib/components/booking/dashboard/index.js +5 -6
- package/lib/components/booking/info/service2/Group/utils.js +3 -42
- package/lib/components/booking/info2/service/editService/index.js +39 -5
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +16 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +16 -23
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -2
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +2 -3
- package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -2
- package/lib/components/ticketBooking/components/bookingDataPanel/index.js +3 -10
- package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +1 -10
- package/lib/components/ticketBooking/components/ticketBooking/index.js +14 -114
- package/lib/components/ticketBooking/index.js +1 -11
- package/lib/pro/Login2.0/components/phoneValidation.js +2 -4
- package/package.json +4 -4
|
@@ -63,24 +63,6 @@ var import_ahooks2 = require("ahooks");
|
|
|
63
63
|
var import_context = require("../../context");
|
|
64
64
|
var import_IsActiveContext = require("../../context/IsActiveContext");
|
|
65
65
|
var import_useShopDiscountModule = require("../../hooks/pisellos/useShopDiscountModule");
|
|
66
|
-
var MEM_STATS_KEY = "__pisellTicketBookingMemStats";
|
|
67
|
-
var getMemStats = () => {
|
|
68
|
-
const g = globalThis;
|
|
69
|
-
if (!g[MEM_STATS_KEY]) {
|
|
70
|
-
g[MEM_STATS_KEY] = {
|
|
71
|
-
mountedAt: Date.now(),
|
|
72
|
-
storeCreateCount: 0,
|
|
73
|
-
intervalDateSetCount: 0,
|
|
74
|
-
intervalDateTickCount: 0,
|
|
75
|
-
postCartUpdateCount: 0,
|
|
76
|
-
postCartUpdateBytes: 0,
|
|
77
|
-
lastHeartbeatHeapMB: 0,
|
|
78
|
-
crossedThresholdsMB: []
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
return g[MEM_STATS_KEY];
|
|
82
|
-
};
|
|
83
|
-
var HEAP_CROSS_THRESHOLDS_MB = [800, 1200, 1500, 2e3, 2500];
|
|
84
66
|
var _formatBookingDetail = (data, modalState) => {
|
|
85
67
|
var _a, _b, _c, _d;
|
|
86
68
|
let {
|
|
@@ -281,8 +263,6 @@ var TicketBooking = (props) => {
|
|
|
281
263
|
const Toast = (0, import_materials.useToast)();
|
|
282
264
|
const _persistentRef = (0, import_react.useRef)(false);
|
|
283
265
|
const _initStateRef = (0, import_react.useRef)({});
|
|
284
|
-
const _memStateRef = (0, import_react.useRef)(null);
|
|
285
|
-
_memStateRef.current = state;
|
|
286
266
|
const _listTimerRef = (0, import_react.useRef)();
|
|
287
267
|
const _timerRef = (0, import_react.useRef)();
|
|
288
268
|
const _callbackFnRef = (0, import_react.useRef)();
|
|
@@ -464,79 +444,6 @@ var TicketBooking = (props) => {
|
|
|
464
444
|
if (_listTimerRef.current) clearInterval(_listTimerRef.current);
|
|
465
445
|
};
|
|
466
446
|
}, []);
|
|
467
|
-
(0, import_react.useEffect)(() => {
|
|
468
|
-
const stats = getMemStats();
|
|
469
|
-
if (!stats.mountedAt || Date.now() - stats.mountedAt > 24 * 60 * 60 * 1e3) {
|
|
470
|
-
stats.mountedAt = Date.now();
|
|
471
|
-
stats.crossedThresholdsMB = [];
|
|
472
|
-
}
|
|
473
|
-
const buildPayload = (extra) => {
|
|
474
|
-
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i;
|
|
475
|
-
const s = _memStateRef.current || {};
|
|
476
|
-
const perfMem = performance.memory || {};
|
|
477
|
-
const shopId = ((_d2 = (_c2 = (_b2 = (_a2 = store == null ? void 0 : store.getState) == null ? void 0 : _a2.call(store)) == null ? void 0 : _b2.global) == null ? void 0 : _c2.globalConfig) == null ? void 0 : _d2.id) ?? "";
|
|
478
|
-
const jsHeapUsedMB = perfMem.usedJSHeapSize ? +(perfMem.usedJSHeapSize / 1024 / 1024).toFixed(2) : -1;
|
|
479
|
-
const jsHeapTotalMB = perfMem.totalJSHeapSize ? +(perfMem.totalJSHeapSize / 1024 / 1024).toFixed(2) : -1;
|
|
480
|
-
const jsHeapLimitMB = perfMem.jsHeapSizeLimit ? +(perfMem.jsHeapSizeLimit / 1024 / 1024).toFixed(2) : -1;
|
|
481
|
-
const payload = {
|
|
482
|
-
page_alive_sec: Math.round((Date.now() - stats.mountedAt) / 1e3),
|
|
483
|
-
shop_id: shopId,
|
|
484
|
-
url: typeof location !== "undefined" ? location.href.slice(0, 200) : "",
|
|
485
|
-
js_heap_used_mb: jsHeapUsedMB,
|
|
486
|
-
js_heap_total_mb: jsHeapTotalMB,
|
|
487
|
-
js_heap_limit_mb: jsHeapLimitMB,
|
|
488
|
-
dom_nodes_count: typeof document !== "undefined" ? document.getElementsByTagName("*").length : -1,
|
|
489
|
-
cart_items_count: ((_g = (_f = (_e2 = s == null ? void 0 : s.modalState) == null ? void 0 : _e2.service) == null ? void 0 : _f.value) == null ? void 0 : _g.length) ?? 0,
|
|
490
|
-
booking_list_count: ((_i = (_h = s == null ? void 0 : s.list) == null ? void 0 : _h.bookingList) == null ? void 0 : _i.length) ?? 0,
|
|
491
|
-
modal_open: !!(s == null ? void 0 : s.open),
|
|
492
|
-
booking_id: (s == null ? void 0 : s.bookingId) ?? 0,
|
|
493
|
-
board_config_loaded: !!(s == null ? void 0 : s.bookingConfig),
|
|
494
|
-
store_create_count: stats.storeCreateCount,
|
|
495
|
-
interval_date_set_count: stats.intervalDateSetCount,
|
|
496
|
-
interval_date_tick_count: stats.intervalDateTickCount,
|
|
497
|
-
post_cart_update_count: stats.postCartUpdateCount,
|
|
498
|
-
post_cart_update_mb: +(stats.postCartUpdateBytes / 1024 / 1024).toFixed(2),
|
|
499
|
-
ua: typeof navigator !== "undefined" ? navigator.userAgent.slice(0, 120) : ""
|
|
500
|
-
};
|
|
501
|
-
if (extra) Object.assign(payload, extra);
|
|
502
|
-
return payload;
|
|
503
|
-
};
|
|
504
|
-
const doSend = (title, extra) => {
|
|
505
|
-
try {
|
|
506
|
-
const payload = buildPayload(extra);
|
|
507
|
-
(0, import_utils.sendWarningLog)({
|
|
508
|
-
title,
|
|
509
|
-
content: Object.entries(payload).map(([key, value]) => ({
|
|
510
|
-
key,
|
|
511
|
-
value: String(value ?? "")
|
|
512
|
-
}))
|
|
513
|
-
});
|
|
514
|
-
} catch (e) {
|
|
515
|
-
}
|
|
516
|
-
};
|
|
517
|
-
doSend("TicketBookingMemHeartbeat", { reason: "mounted" });
|
|
518
|
-
const heartbeatTimer = setInterval(() => {
|
|
519
|
-
const perfMem = performance.memory || {};
|
|
520
|
-
const heapMB = perfMem.usedJSHeapSize ? perfMem.usedJSHeapSize / 1024 / 1024 : -1;
|
|
521
|
-
stats.lastHeartbeatHeapMB = heapMB;
|
|
522
|
-
doSend("TicketBookingMemHeartbeat", { reason: "heartbeat" });
|
|
523
|
-
if (heapMB > 0) {
|
|
524
|
-
for (const th of HEAP_CROSS_THRESHOLDS_MB) {
|
|
525
|
-
if (heapMB >= th && !stats.crossedThresholdsMB.includes(th)) {
|
|
526
|
-
stats.crossedThresholdsMB.push(th);
|
|
527
|
-
doSend("TicketBookingMemHeapCross", {
|
|
528
|
-
reason: "heap_cross",
|
|
529
|
-
threshold_mb: th,
|
|
530
|
-
current_heap_mb: +heapMB.toFixed(2)
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
}, 5 * 60 * 1e3);
|
|
536
|
-
return () => {
|
|
537
|
-
clearInterval(heartbeatTimer);
|
|
538
|
-
};
|
|
539
|
-
}, []);
|
|
540
447
|
const _onDateChange = (date, dateString) => {
|
|
541
448
|
_setIntervalTime(false);
|
|
542
449
|
setState({
|
|
@@ -547,11 +454,6 @@ var TicketBooking = (props) => {
|
|
|
547
454
|
const _setIntervalTime = (isInterval) => {
|
|
548
455
|
clearInterval(_timerRef.current);
|
|
549
456
|
if (isInterval) {
|
|
550
|
-
try {
|
|
551
|
-
const _s = getMemStats();
|
|
552
|
-
_s.intervalDateSetCount = (_s.intervalDateSetCount || 0) + 1;
|
|
553
|
-
} catch (e) {
|
|
554
|
-
}
|
|
555
457
|
setState({
|
|
556
458
|
isTimeChange: false,
|
|
557
459
|
isDateChange: false
|
|
@@ -561,11 +463,6 @@ var TicketBooking = (props) => {
|
|
|
561
463
|
}
|
|
562
464
|
_setDataChange((0, import_dayjs.default)());
|
|
563
465
|
_timerRef.current = setInterval(() => {
|
|
564
|
-
try {
|
|
565
|
-
const _s = getMemStats();
|
|
566
|
-
_s.intervalDateTickCount = (_s.intervalDateTickCount || 0) + 1;
|
|
567
|
-
} catch (e) {
|
|
568
|
-
}
|
|
569
466
|
_setDataChange((0, import_dayjs.default)());
|
|
570
467
|
}, 1e3 * 60);
|
|
571
468
|
}
|
|
@@ -634,6 +531,7 @@ var TicketBooking = (props) => {
|
|
|
634
531
|
} catch (error) {
|
|
635
532
|
console.error(error);
|
|
636
533
|
}
|
|
534
|
+
console.log("formatedProducts", total, formatedProducts);
|
|
637
535
|
let fees = [];
|
|
638
536
|
let products = [];
|
|
639
537
|
for (const item of formatedProducts) {
|
|
@@ -687,37 +585,37 @@ var TicketBooking = (props) => {
|
|
|
687
585
|
)
|
|
688
586
|
});
|
|
689
587
|
}
|
|
690
|
-
(
|
|
588
|
+
console.log("start post message, config:", {
|
|
691
589
|
module: "cds",
|
|
692
590
|
key: "cartUpdate",
|
|
693
591
|
data: {
|
|
694
592
|
currency_symbol: getSymbolic(),
|
|
695
|
-
total: total.
|
|
593
|
+
total: total.productAmount,
|
|
696
594
|
// 小计
|
|
697
595
|
products,
|
|
698
596
|
fees
|
|
699
597
|
}
|
|
700
598
|
});
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
599
|
+
(_j = (_i = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _i.postMessageToApp) == null ? void 0 : _j.call(_i, {
|
|
600
|
+
module: "cds",
|
|
601
|
+
key: "cartUpdate",
|
|
602
|
+
data: {
|
|
705
603
|
currency_symbol: getSymbolic(),
|
|
706
604
|
total: total.expectAmount,
|
|
605
|
+
// 小计
|
|
707
606
|
products,
|
|
708
607
|
fees
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
} catch (e) {
|
|
712
|
-
}
|
|
608
|
+
}
|
|
609
|
+
});
|
|
713
610
|
}, [(_c = (_b = state == null ? void 0 : state.modalState) == null ? void 0 : _b.service) == null ? void 0 : _c.value]);
|
|
714
611
|
const _setModalState = (props2) => {
|
|
715
|
-
var _a2;
|
|
612
|
+
var _a2, _b2;
|
|
716
613
|
console.log("同步state到外层", props2);
|
|
717
614
|
let newVal = { ...props2 };
|
|
718
615
|
if (newVal.service) {
|
|
719
616
|
newVal.service.value = ((_a2 = newVal == null ? void 0 : newVal.service) == null ? void 0 : _a2.value) || [];
|
|
720
617
|
}
|
|
618
|
+
console.log((_b2 = newVal == null ? void 0 : newVal.service) == null ? void 0 : _b2.value, "newVal.service.value");
|
|
721
619
|
setState({
|
|
722
620
|
modalState: {
|
|
723
621
|
...state.modalState,
|
|
@@ -925,6 +823,7 @@ var TicketBooking = (props) => {
|
|
|
925
823
|
if (data == null ? void 0 : data.eventBookingServiceParams) {
|
|
926
824
|
}
|
|
927
825
|
}
|
|
826
|
+
console.log(initState, "initState");
|
|
928
827
|
setState({
|
|
929
828
|
...initState,
|
|
930
829
|
[state.renderType === "eventBooking" ? "eventOpen" : "open"]: true,
|
|
@@ -958,6 +857,7 @@ var TicketBooking = (props) => {
|
|
|
958
857
|
}
|
|
959
858
|
};
|
|
960
859
|
}
|
|
860
|
+
console.log("getBookingDetail", data);
|
|
961
861
|
_initBookingData("edit", data);
|
|
962
862
|
if (openRebook) {
|
|
963
863
|
setTimeout(() => {
|
|
@@ -243,23 +243,13 @@ var ticketBooking_default = (props) => {
|
|
|
243
243
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
244
244
|
}, []);
|
|
245
245
|
(0, import_react.useMemo)(() => {
|
|
246
|
-
try {
|
|
247
|
-
const g = globalThis;
|
|
248
|
-
if (g.__pisellTicketBookingMemStats) {
|
|
249
|
-
g.__pisellTicketBookingMemStats.storeCreateCount = (g.__pisellTicketBookingMemStats.storeCreateCount || 0) + 1;
|
|
250
|
-
}
|
|
251
|
-
} catch (e) {
|
|
252
|
-
}
|
|
253
246
|
const store = (0, import_miniRedux.createStore)({
|
|
254
247
|
...(0, import_lodash.cloneDeep)(initialState),
|
|
255
248
|
bookingConfigParams,
|
|
256
249
|
productExtensionType
|
|
257
250
|
});
|
|
258
251
|
storeRef.current = store;
|
|
259
|
-
}, [
|
|
260
|
-
JSON.stringify(bookingConfigParams),
|
|
261
|
-
JSON.stringify(productExtensionType)
|
|
262
|
-
]);
|
|
252
|
+
}, [bookingConfigParams, productExtensionType]);
|
|
263
253
|
(0, import_react.useMemo)(() => {
|
|
264
254
|
var _a2;
|
|
265
255
|
if (BookingTicket) {
|
|
@@ -68,8 +68,7 @@ var validatePhoneNumber = async (value, getText) => {
|
|
|
68
68
|
}
|
|
69
69
|
break;
|
|
70
70
|
case "1":
|
|
71
|
-
|
|
72
|
-
if (!usCanadaReg.test(phone)) {
|
|
71
|
+
if (!/^\d{10}$/.test(phone)) {
|
|
73
72
|
throw new Error(getText("pisell-phone-validation-us-canada"));
|
|
74
73
|
}
|
|
75
74
|
break;
|
|
@@ -79,8 +78,7 @@ var validatePhoneNumber = async (value, getText) => {
|
|
|
79
78
|
}
|
|
80
79
|
break;
|
|
81
80
|
case "61":
|
|
82
|
-
|
|
83
|
-
if (!auReg.test(phone)) {
|
|
81
|
+
if (!/^(\+?0)?4\d{8}$/.test(phone)) {
|
|
84
82
|
throw new Error(getText("pisell-phone-validation-australia"));
|
|
85
83
|
}
|
|
86
84
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.60",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@react-spring/web": "^9.6.1",
|
|
63
63
|
"@use-gesture/react": "^10.3.1",
|
|
64
64
|
"@pisell/utils": "3.0.2",
|
|
65
|
-
"@pisell/materials": "6.6.
|
|
66
|
-
"@pisell/
|
|
67
|
-
"@pisell/
|
|
65
|
+
"@pisell/materials": "6.6.15",
|
|
66
|
+
"@pisell/icon": "0.0.11",
|
|
67
|
+
"@pisell/date-picker": "3.0.7"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "^18.0.0",
|