@pisell/private-materials 6.4.50 → 6.4.52

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.
Files changed (115) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +145 -153
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +3 -3
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  12. package/es/components/appointmentBooking/hooks.js +6 -0
  13. package/es/components/booking/components/footer/index.js +12 -1
  14. package/es/components/booking/editBookingModal/index.js +8 -2
  15. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  16. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  17. package/es/components/booking/locales.d.ts +6 -0
  18. package/es/components/booking/locales.js +12 -0
  19. package/es/components/checkout/PaymentModal.js +70 -62
  20. package/es/components/checkout/components/AmountSummary/index.js +4 -4
  21. package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  22. package/es/components/checkout/components/CashPaymentModule/index.js +14 -10
  23. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  24. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +60 -17
  25. package/es/components/eftposPay/payo/config.js +10 -10
  26. package/es/components/eftposPay/serve.js +1 -1
  27. package/es/components/index.d.ts +3 -1
  28. package/es/components/index.js +3 -1
  29. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  30. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  31. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  32. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  33. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  34. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  35. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  36. package/es/components/pay/toC/utils.js +1 -1
  37. package/es/components/pinModal/hooks.d.ts +7 -0
  38. package/es/components/pinModal/hooks.js +65 -0
  39. package/es/components/pinModal/index.d.ts +4 -0
  40. package/es/components/pinModal/index.js +98 -0
  41. package/es/components/pinModal/index.less +44 -0
  42. package/es/components/pinModal/locales.d.ts +27 -0
  43. package/es/components/pinModal/locales.js +26 -0
  44. package/es/components/pinModal/serve.d.ts +6 -0
  45. package/es/components/pinModal/serve.js +11 -0
  46. package/es/components/pinModal/types.d.ts +0 -0
  47. package/es/components/pinModal/types.js +0 -0
  48. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  49. package/es/components/pinVerifyModal/hooks.js +80 -0
  50. package/es/components/pinVerifyModal/index.d.ts +5 -0
  51. package/es/components/pinVerifyModal/index.js +218 -0
  52. package/es/components/pinVerifyModal/index.less +92 -0
  53. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  54. package/es/components/pinVerifyModal/locales.js +23 -0
  55. package/es/components/pinVerifyModal/types.d.ts +33 -0
  56. package/es/components/pinVerifyModal/types.js +1 -0
  57. package/es/components/ticketBooking/components/ticketBooking/index.js +56 -10
  58. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  59. package/es/components/walletList/index.js +20 -2
  60. package/es/index.d.ts +2 -0
  61. package/es/index.js +3 -1
  62. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  63. package/lib/components/appointmentBooking/hooks.js +6 -0
  64. package/lib/components/booking/components/footer/index.js +15 -2
  65. package/lib/components/booking/editBookingModal/index.js +6 -1
  66. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  67. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  68. package/lib/components/booking/locales.d.ts +6 -0
  69. package/lib/components/booking/locales.js +6 -0
  70. package/lib/components/checkout/PaymentModal.js +5 -4
  71. package/lib/components/checkout/components/AmountSummary/index.js +4 -4
  72. package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  73. package/lib/components/checkout/components/CashPaymentModule/index.js +6 -3
  74. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  75. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +59 -15
  76. package/lib/components/eftposPay/payo/config.js +9 -9
  77. package/lib/components/eftposPay/serve.js +1 -1
  78. package/lib/components/index.d.ts +3 -1
  79. package/lib/components/index.js +6 -0
  80. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  81. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  82. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  83. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  84. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  85. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  86. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  87. package/lib/components/pay/toC/utils.js +1 -1
  88. package/lib/components/pinModal/hooks.d.ts +7 -0
  89. package/lib/components/pinModal/hooks.js +85 -0
  90. package/lib/components/pinModal/index.d.ts +4 -0
  91. package/lib/components/pinModal/index.js +88 -0
  92. package/lib/components/pinModal/index.less +44 -0
  93. package/lib/components/pinModal/locales.d.ts +27 -0
  94. package/lib/components/pinModal/locales.js +50 -0
  95. package/lib/components/pinModal/serve.d.ts +6 -0
  96. package/lib/components/pinModal/serve.js +37 -0
  97. package/lib/components/pinModal/types.d.ts +0 -0
  98. package/lib/components/pinModal/types.js +0 -0
  99. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  100. package/lib/components/pinVerifyModal/hooks.js +93 -0
  101. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  102. package/lib/components/pinVerifyModal/index.js +230 -0
  103. package/lib/components/pinVerifyModal/index.less +92 -0
  104. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  105. package/lib/components/pinVerifyModal/locales.js +47 -0
  106. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  107. package/lib/components/pinVerifyModal/types.js +17 -0
  108. package/lib/components/ticketBooking/components/ticketBooking/index.js +52 -5
  109. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  110. package/lib/components/walletList/index.js +19 -2
  111. package/lib/index.d.ts +2 -0
  112. package/lib/index.js +6 -0
  113. package/lowcode/pin-modal/meta.ts +37 -0
  114. package/lowcode/pin-verify-modal/meta.ts +80 -0
  115. package/package.json +4 -4
@@ -0,0 +1,92 @@
1
+ .pin-verify-modal-content {
2
+ width: 100%;
3
+ height: 100%;
4
+ padding-bottom: 16px;
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ gap: 16px;
9
+
10
+ &-user {
11
+ min-width: 300px;
12
+ min-height: 60px;
13
+ padding: 8px;
14
+ display: flex;
15
+ align-items: center;
16
+ gap: 8px;
17
+ border-radius: 8px;
18
+ border: 1px solid #d0d5dd;
19
+
20
+ &-avatar {
21
+ width: 42px;
22
+ height: 42px;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ border-radius: 50%;
27
+ overflow: hidden;
28
+
29
+ &-img {
30
+ width: 100%;
31
+ }
32
+ }
33
+
34
+ &-right {
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 4px;
38
+
39
+ &-name {
40
+ font-size: 16px;
41
+ font-weight: 600;
42
+ color: #101828;
43
+ }
44
+
45
+ &-wallet {
46
+ color: #667085;
47
+ font-size: 14px;
48
+ font-weight: 400;
49
+ }
50
+ }
51
+ }
52
+
53
+ &-keyboard {
54
+ display: flex;
55
+ flex-direction: column;
56
+ align-items: center;
57
+ gap: 8px;
58
+
59
+ &-title {
60
+ text-align: center;
61
+ color: #101828;
62
+ font-size: 16px;
63
+ font-weight: 500;
64
+ }
65
+
66
+ &-desc {
67
+ color: #667085;
68
+ font-size: 16px;
69
+ font-weight: 400;
70
+ }
71
+ }
72
+
73
+ .virtual-keyboard-input-wrap {
74
+ height: 45px !important;
75
+ }
76
+
77
+ .virtual-keyboard-wrap .virtual-keyboard-content .virtual-keyboard-item {
78
+ padding-top: 50px !important;
79
+ }
80
+
81
+ .virtual-keyboard-wrap
82
+ .virtual-keyboard-content
83
+ .virtual-keyboard-item
84
+ .virtual-keyboard-item-button {
85
+ padding: 0 !important;
86
+ }
87
+
88
+ .virtual-keyboard-input-delete {
89
+ font-size: 30px;
90
+ color: #000;
91
+ }
92
+ }
@@ -0,0 +1,24 @@
1
+ declare const _default: {
2
+ en: {
3
+ 'pisell2.pin.verify.modal.title': string;
4
+ 'pisell2.pin.verify.modal.wallet': string;
5
+ 'pisell2.pin.verify.modal.keyboard.title': string;
6
+ 'pisell2.pin.verify.modal.keyboard.desc': string;
7
+ 'pisell2.pin.verify.modal.keyboard.verify': string;
8
+ };
9
+ 'zh-CN': {
10
+ 'pisell2.pin.verify.modal.title': string;
11
+ 'pisell2.pin.verify.modal.wallet': string;
12
+ 'pisell2.pin.verify.modal.keyboard.title': string;
13
+ 'pisell2.pin.verify.modal.keyboard.desc': string;
14
+ 'pisell2.pin.verify.modal.keyboard.verify': string;
15
+ };
16
+ 'zh-HK': {
17
+ 'pisell2.pin.verify.modal.title': string;
18
+ 'pisell2.pin.verify.modal.wallet': string;
19
+ 'pisell2.pin.verify.modal.keyboard.title': string;
20
+ 'pisell2.pin.verify.modal.keyboard.desc': string;
21
+ 'pisell2.pin.verify.modal.keyboard.verify': string;
22
+ };
23
+ };
24
+ export default _default;
@@ -0,0 +1,23 @@
1
+ export default {
2
+ en: {
3
+ 'pisell2.pin.verify.modal.title': 'Wallet Verification',
4
+ 'pisell2.pin.verify.modal.wallet': 'Wallet : ',
5
+ 'pisell2.pin.verify.modal.keyboard.title': 'Enter the 4-digit PIN to continue',
6
+ 'pisell2.pin.verify.modal.keyboard.desc': 'Remaining attempts : ',
7
+ 'pisell2.pin.verify.modal.keyboard.verify': 'Verify'
8
+ },
9
+ 'zh-CN': {
10
+ 'pisell2.pin.verify.modal.title': '钱包验证',
11
+ 'pisell2.pin.verify.modal.wallet': '钱包 : ',
12
+ 'pisell2.pin.verify.modal.keyboard.title': '请输入该钱包的4位PIN码以继续',
13
+ 'pisell2.pin.verify.modal.keyboard.desc': '剩余验证次数 : ',
14
+ 'pisell2.pin.verify.modal.keyboard.verify': '验证'
15
+ },
16
+ 'zh-HK': {
17
+ 'pisell2.pin.verify.modal.title': '錢包驗證',
18
+ 'pisell2.pin.verify.modal.wallet': '錢包 : ',
19
+ 'pisell2.pin.verify.modal.keyboard.title': '請輸入該錢包的4位PIN碼以繼續',
20
+ 'pisell2.pin.verify.modal.keyboard.desc': '剩餘驗證次數 : ',
21
+ 'pisell2.pin.verify.modal.keyboard.verify': '驗證'
22
+ }
23
+ };
@@ -0,0 +1,33 @@
1
+ export interface PinVerifyModalProps {
2
+ onOpen?: () => void;
3
+ onClose?: () => void;
4
+ onSuccess?: (params?: VerifyPinSuccessParams) => void;
5
+ }
6
+ export interface PinVerifyModalRef {
7
+ open: (params: ModalParams) => void;
8
+ close: () => void;
9
+ }
10
+ export interface ModalParams {
11
+ wallet_code: string;
12
+ wallet_detail_id: string | number;
13
+ failed_count?: number;
14
+ check_max_count?: number;
15
+ customer?: {
16
+ display_name?: string;
17
+ nickname?: string;
18
+ cover?: string;
19
+ };
20
+ }
21
+ export interface VerifyInfo {
22
+ remaining_count?: number;
23
+ failed_count?: number;
24
+ check_max_count?: number;
25
+ }
26
+ export declare type TVerifyPin = (data: {
27
+ wallet_detail_id: string | number;
28
+ pin: string;
29
+ }, onSuccess: (params: VerifyPinSuccessParams) => void) => void;
30
+ export interface VerifyPinSuccessParams {
31
+ customer_id: string | number;
32
+ customer_pin_key: string;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -23,7 +23,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
23
23
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
24
24
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
25
25
  import React, { useEffect, useMemo, useRef, useState } from 'react';
26
- import { locales } from '@pisell/utils';
26
+ import { locales, sendWarningLog } from '@pisell/utils';
27
27
  import { message } from 'antd';
28
28
  import { Iconfont, PisellModal, useToast } from '@pisell/materials';
29
29
  import { getOrderInfoByCode, getBookingDetail, getEventBookingDetail, getBookingConfig, getServices } from "../../serve";
@@ -48,6 +48,7 @@ import { getBookingType } from "../bookingDataPanel/bookingList/utils";
48
48
  import { useCustomer } from "../../hooks/pisellos";
49
49
  import { useMemoizedFn } from 'ahooks';
50
50
  import useScanManager from "../../hooks/pisellos/useScanManager";
51
+ import { useDebounceFn } from 'ahooks';
51
52
  export var _formatBookingDetail = function _formatBookingDetail(data, modalState) {
52
53
  var _bookings$list, _bookings$list2;
53
54
  var customer_id = data.customer_id,
@@ -311,8 +312,54 @@ var TicketBooking = function TicketBooking() {
311
312
  closeScan();
312
313
  };
313
314
  }, []);
315
+ var _useDebounceFn = useDebounceFn(function (type, orderId) {
316
+ // 支付成功后清空状态
317
+ try {
318
+ var _store$getState;
319
+ _initFn(function () {});
320
+ setState({
321
+ createCount: state.createCount + 1
322
+ });
323
+ sendWarningLog({
324
+ title: '清空购物车',
325
+ content: [{
326
+ key: '店铺id',
327
+ value: store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.globalConfig) === null || _store$getState === void 0 ? void 0 : _store$getState.id
328
+ }, {
329
+ key: '订单id',
330
+ value: orderId
331
+ }, {
332
+ key: '类型',
333
+ value: type
334
+ }]
335
+ });
336
+ } catch (err) {
337
+ var _store$getState2;
338
+ sendWarningLog({
339
+ title: '清空购物车失败',
340
+ content: [{
341
+ key: '店铺id',
342
+ value: store === null || store === void 0 || (_store$getState2 = store.getState) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.call(store)) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.global) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.globalConfig) === null || _store$getState2 === void 0 ? void 0 : _store$getState2.id
343
+ }, {
344
+ key: '订单id',
345
+ value: orderId
346
+ }, {
347
+ key: '类型',
348
+ value: type
349
+ }, {
350
+ key: 'error',
351
+ value: err === null || err === void 0 ? void 0 : err.message
352
+ }]
353
+ });
354
+ }
355
+ }, {
356
+ wait: 500,
357
+ leading: true,
358
+ trailing: false
359
+ }),
360
+ clearAllCart = _useDebounceFn.run;
314
361
  useEffect(function () {
315
- var _store$getState, _interaction$utils, _interaction$utils2;
362
+ var _store$getState3, _interaction$utils, _interaction$utils2;
316
363
  // bellaswonderland.mypisell.com localStorage可能满了
317
364
  localStorage.removeItem('bookingResourceList');
318
365
  _persistentRef.current = storage.get("drawer-booking") === 'true' ? true : isTerminal();
@@ -373,7 +420,7 @@ var TicketBooking = function TicketBooking() {
373
420
  };
374
421
  } catch (error) {}
375
422
  setState({
376
- amountSymbol: (getData === null || getData === void 0 ? void 0 : getData('shop_symbol')) || (store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 ? void 0 : _store$getState.symbol) || '$'
423
+ amountSymbol: (getData === null || getData === void 0 ? void 0 : getData('shop_symbol')) || (store === null || store === void 0 || (_store$getState3 = store.getState) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.call(store)) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.global) === null || _store$getState3 === void 0 ? void 0 : _store$getState3.symbol) || '$'
377
424
  }, function () {
378
425
  _initStateRef.current = JSON.parse(JSON.stringify(state));
379
426
  _getBoardConfig();
@@ -387,6 +434,7 @@ var TicketBooking = function TicketBooking() {
387
434
  console.log('bookingTicket.clearAllCart');
388
435
  // 支付成功后清空状态
389
436
  _initFn(function () {});
437
+ _setIntervalTime(true);
390
438
  selectCustomer(null);
391
439
  enableAllScanListeners();
392
440
  setState({
@@ -633,8 +681,8 @@ var TicketBooking = function TicketBooking() {
633
681
  }, 100);
634
682
  };
635
683
  var _setShopOpeningHours = function _setShopOpeningHours() {
636
- var _getData, _store$getState2;
637
- var time = (getData === null || getData === void 0 || (_getData = getData('operating_day_boundary')) === null || _getData === void 0 ? void 0 : _getData.time) || (store === null || store === void 0 || (_store$getState2 = store.getState) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.call(store)) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.global) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.shopDetail) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.operating_day_boundary) === null || _store$getState2 === void 0 ? void 0 : _store$getState2.time);
684
+ var _getData, _store$getState4;
685
+ var time = (getData === null || getData === void 0 || (_getData = getData('operating_day_boundary')) === null || _getData === void 0 ? void 0 : _getData.time) || (store === null || store === void 0 || (_store$getState4 = store.getState) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.call(store)) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.global) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.shopDetail) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.operating_day_boundary) === null || _store$getState4 === void 0 ? void 0 : _store$getState4.time);
638
686
  if (time) {
639
687
  localStorage.setItem('shopOpeningHours', time);
640
688
  }
@@ -653,11 +701,10 @@ var TicketBooking = function TicketBooking() {
653
701
  });
654
702
  case 2:
655
703
  data = _context.sent;
656
- console.log('wwww', data);
657
704
  setState({
658
705
  addTimeProducts: (data === null || data === void 0 ? void 0 : data.list) || []
659
706
  });
660
- case 5:
707
+ case 4:
661
708
  case "end":
662
709
  return _context.stop();
663
710
  }
@@ -822,9 +869,9 @@ var TicketBooking = function TicketBooking() {
822
869
  // 储存参数, 添加服务商品时使用
823
870
  sessionStorage.setItem('pisell2.booking.serviceParams', JSON.stringify(data));
824
871
  } else {
825
- var _store$getState3;
872
+ var _store$getState5;
826
873
  // 当前时区的时间
827
- var timezone = store === null || store === void 0 || (_store$getState3 = store.getState) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.call(store)) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.global) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.globalConfig) === null || _store$getState3 === void 0 ? void 0 : _store$getState3.timezone;
874
+ var timezone = store === null || store === void 0 || (_store$getState5 = store.getState) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.call(store)) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.global) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.globalConfig) === null || _store$getState5 === void 0 ? void 0 : _store$getState5.timezone;
828
875
  initState.modalState.date.value = dayjs.tz(new Date(), timezone);
829
876
  // 兜底, 没有传递则清空下
830
877
  sessionStorage.removeItem('pisell2.booking.serviceParams');
@@ -1023,7 +1070,6 @@ var TicketBooking = function TicketBooking() {
1023
1070
  isShowDeposit: state.isShowDeposit,
1024
1071
  disableEventBookingEdit: state.disableEventBookingEdit,
1025
1072
  list: state.list,
1026
- intervalSetTime: state.intervalSetTime,
1027
1073
  createCount: state.createCount,
1028
1074
  bookingFunctions: state.bookingFunctions,
1029
1075
  isParallelResourcesBooking: state.isParallelResourcesBooking
@@ -9,6 +9,7 @@ import { LeftOutlined, RightOutlined } from '@ant-design/icons';
9
9
  import { DatePicker, SelectTime } from '@pisell/materials';
10
10
  import { useMemoizedFn } from 'ahooks';
11
11
  import { Button } from 'antd';
12
+ import dayjs from 'dayjs';
12
13
  import classNames from 'classnames';
13
14
  import { locales } from '@pisell/utils';
14
15
  import "./index.less";
@@ -54,7 +55,7 @@ var TimeBar = function TimeBar(props) {
54
55
  setGlobalState({
55
56
  isTimeChange: true
56
57
  });
57
- (_props$setIntervalTim5 = props.setIntervalTime) === null || _props$setIntervalTim5 === void 0 || _props$setIntervalTim5.call(props, false);
58
+ (_props$setIntervalTim5 = props.setIntervalTime) === null || _props$setIntervalTim5 === void 0 || _props$setIntervalTim5.call(props, timeString === dayjs().format('HH:mm'));
58
59
  });
59
60
  return useMemo(function () {
60
61
  var _state$modalState4, _state$modalState5;
@@ -30,6 +30,7 @@ import "./index.less";
30
30
  import classNames from 'classnames';
31
31
  // 导入所有类型
32
32
  import { DEFAULT_CARD_CONFIG } from "./types";
33
+ import PinModal from "../pinModal";
33
34
 
34
35
  // 添加 localStorage 相关的操作函数
35
36
  var STORAGE_KEY = 'pisell_wallet_list_data';
@@ -174,6 +175,9 @@ var WalletList = Provider(function (props) {
174
175
  var requestIdRef = useRef('');
175
176
  var pubsub = utils === null || utils === void 0 ? void 0 : utils.pubsub;
176
177
 
178
+ // pinModal的ref
179
+ var pinModalRef = useRef(null);
180
+
177
181
  //获取登录状态
178
182
  var isUserLoggedIn = useMemo(function () {
179
183
  var _utils$token, _utils$token$get;
@@ -584,6 +588,14 @@ var WalletList = Provider(function (props) {
584
588
  return _ref3.apply(this, arguments);
585
589
  };
586
590
  }();
591
+ var _onViewPinClick = function onViewPinClick(card) {
592
+ if (card !== null && card !== void 0 && card.id) {
593
+ var _pinModalRef$current;
594
+ (_pinModalRef$current = pinModalRef.current) === null || _pinModalRef$current === void 0 || _pinModalRef$current.open(card === null || card === void 0 ? void 0 : card.id);
595
+ } else {
596
+ console.error('onViewPinClick方法需要传入wallet_detail_id');
597
+ }
598
+ };
587
599
  var renderWalletCard = function renderWalletCard(item) {
588
600
  var _dvaStore$core;
589
601
  var code = item.code,
@@ -650,7 +662,11 @@ var WalletList = Provider(function (props) {
650
662
  });
651
663
  return /*#__PURE__*/React.createElement(WalletCard, _extends({
652
664
  key: id
653
- }, cardProps));
665
+ }, cardProps, {
666
+ onViewPinClick: function onViewPinClick() {
667
+ return _onViewPinClick(item);
668
+ }
669
+ }));
654
670
  };
655
671
  var carouselProps = {
656
672
  className: classNames('pisell-lowcode__walletList'),
@@ -809,7 +825,9 @@ var WalletList = Provider(function (props) {
809
825
  fontSize: '24px',
810
826
  color: currentIndex === list.length - 1 ? '#D0D5DD' : '#101828'
811
827
  }
812
- }))));
828
+ }))), /*#__PURE__*/React.createElement(PinModal, {
829
+ ref: pinModalRef
830
+ }));
813
831
  };
814
832
 
815
833
  // 最终返回组件内容
package/es/index.d.ts CHANGED
@@ -59,3 +59,5 @@ export { default as ProSkuDetailModal } from './pro/skuDetailModal';
59
59
  export { default as SaasLogin } from './plus/saasLogin';
60
60
  export { default as SaasRegister } from './plus/saasRegister';
61
61
  export { default as SaasCreateOrganization } from './plus/saasCreateOrganization';
62
+ export { default as PinModal } from './components/pinModal';
63
+ export { default as PinVerifyModal } from './components/pinVerifyModal';
package/es/index.js CHANGED
@@ -62,4 +62,6 @@ export { default as ProPriceRadio } from "./pro/pisellPriceRadio";
62
62
  export { default as ProSkuDetailModal } from "./pro/skuDetailModal";
63
63
  export { default as SaasLogin } from "./plus/saasLogin";
64
64
  export { default as SaasRegister } from "./plus/saasRegister";
65
- export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
65
+ export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
66
+ export { default as PinModal } from "./components/pinModal";
67
+ export { default as PinVerifyModal } from "./components/pinVerifyModal";
@@ -95,20 +95,27 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
95
95
  delete product.option;
96
96
  if (isRetailTemplate) {
97
97
  if (data == null ? void 0 : data.isCancel) return;
98
- appointmentBooking.storeProduct(product);
98
+ const res = appointmentBooking.storeProduct(product);
99
+ if (!res.success && res.errorCode === "not_enough_stock") {
100
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
101
+ }
99
102
  return;
100
103
  }
101
104
  const session = data == null ? void 0 : data.session;
102
105
  if (session) {
103
106
  const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
104
107
  const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
105
- appointmentBooking.addProductToCart({
108
+ const res = appointmentBooking.addProductToCart({
106
109
  product: { ...product },
107
110
  date: {
108
111
  startTime: `${startDate} ${session == null ? void 0 : session.start_time}`,
109
112
  endTime: `${endDate} ${session == null ? void 0 : session.end_time}`
110
113
  }
111
114
  });
115
+ if (!res.success && res.errorCode === "not_enough_stock") {
116
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
117
+ }
118
+ appointmentBooking.closeProductDetail();
112
119
  await appointmentBooking.getAvailableDate({
113
120
  startDate,
114
121
  endDate
@@ -121,7 +128,10 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
121
128
  import_utils.locales.getText("pisell2.appointment.no.available.service")
122
129
  );
123
130
  }
124
- appointmentBooking.storeProduct(product);
131
+ const res = appointmentBooking.storeProduct(product);
132
+ if (!res.success && res.errorCode === "not_enough_stock") {
133
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
134
+ }
125
135
  if (type === "duration") {
126
136
  await appointmentBooking.getAvailableDate();
127
137
  }
@@ -189,6 +189,12 @@ var useAppointmentBookingStep = () => {
189
189
  if (!result) {
190
190
  return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.date"));
191
191
  }
192
+ const capacityResult = appointmentBooking.checkMaxDurationCapacity();
193
+ if (!capacityResult.success) {
194
+ const getMessage = import_utils.locales.getText("pisell2.appointment.unuse.capacity");
195
+ const message = typeof getMessage === "function" ? getMessage(capacityResult.minAvailableCount) : getMessage;
196
+ return (0, import_utils2.Toast)(message);
197
+ }
192
198
  }
193
199
  if (!isRetailTemplate && (currentKey == null ? void 0 : currentKey.startsWith("select-resource"))) {
194
200
  const { hasError, updatedCartList } = (0, import_utils2.checkAndMarkCartRenderError)(currentSelectedResources, appointmentBooking, utils);
@@ -593,7 +593,7 @@ var Footer = (props) => {
593
593
  messageShow = true,
594
594
  noSubmit = false
595
595
  }) => {
596
- var _a2;
596
+ var _a2, _b2, _c2, _d2, _e2;
597
597
  (0, import_PaymentResultToast.closeAllPaymentResultToasts)();
598
598
  if ((0, import_utils2.isDayBooking)(state)) {
599
599
  const isHasDayProducts = handleDaySubmit();
@@ -652,7 +652,20 @@ var Footer = (props) => {
652
652
  title: "saveBooking",
653
653
  content: [
654
654
  { key: "下单前数据", value: JSON.stringify(values) },
655
- { key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") }
655
+ { key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") },
656
+ {
657
+ key: "店铺id",
658
+ value: (_e2 = (_d2 = (_c2 = (_b2 = store == null ? void 0 : store.getState) == null ? void 0 : _b2.call(store)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id
659
+ },
660
+ {
661
+ key: "shopApi",
662
+ value: JSON.stringify(window == null ? void 0 : window.shopApi, (key, value) => {
663
+ if (typeof value === "function") {
664
+ return "function";
665
+ }
666
+ return value;
667
+ })
668
+ }
656
669
  ]
657
670
  });
658
671
  if (addonsEdit) {
@@ -113,7 +113,12 @@ var EditBookingModal = (props, ref) => {
113
113
  _cloned[_idx] = _targetResource;
114
114
  }
115
115
  } else {
116
- _cloned.push(_targetResource);
116
+ const _targetIdx = _cloned.findIndex((rs) => {
117
+ return rs.relation_id == (_targetResource == null ? void 0 : _targetResource.relation_id);
118
+ });
119
+ if (_targetIdx === -1) {
120
+ _cloned.push(_targetResource);
121
+ }
117
122
  }
118
123
  _initResourceVal = {
119
124
  ..._initResourceVal,
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: string;
9
+ locale: any;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: string;
10
+ locale: any;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -156,6 +156,8 @@ declare const _default: {
156
156
  'pisell2.text.deposit-delete-message': string;
157
157
  'pisell2.text.deposit-paid': string;
158
158
  "pisell2.text.stock": string;
159
+ 'pisell2.appointment.unuse.stock': string;
160
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
159
161
  'pisell2.text.payment-link': string;
160
162
  'pisell2.text.send-mail': string;
161
163
  'pisell2.text.copy-to-clipboard': string;
@@ -458,6 +460,8 @@ declare const _default: {
458
460
  'pisell2.text.deposit-delete-message': string;
459
461
  'pisell2.text.deposit-paid': string;
460
462
  "pisell2.text.stock": string;
463
+ 'pisell2.appointment.unuse.stock': string;
464
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
461
465
  'pisell2.text.payment-link': string;
462
466
  'pisell2.text.send-mail': string;
463
467
  'pisell2.text.copy-to-clipboard': string;
@@ -760,6 +764,8 @@ declare const _default: {
760
764
  'pisell2.text.deposit-delete-message': string;
761
765
  'pisell2.text.deposit-paid': string;
762
766
  "pisell2.text.stock": string;
767
+ 'pisell2.appointment.unuse.stock': string;
768
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
763
769
  'pisell2.text.payment-link': string;
764
770
  'pisell2.text.send-mail': string;
765
771
  'pisell2.text.copy-to-clipboard': string;
@@ -200,6 +200,8 @@ var locales_default = {
200
200
  "pisell2.text.deposit-delete-message": "It cannot be restored after deletion. Please confirm the operation.",
201
201
  "pisell2.text.deposit-paid": "Deposit paid",
202
202
  "pisell2.text.stock": "Stock",
203
+ "pisell2.appointment.unuse.stock": "Not enough stock",
204
+ "pisell2.appointment.unuse.capacity": (count) => `Only ${count} spots available. Please reduce quantity.`,
203
205
  "pisell2.text.payment-link": "Payment link",
204
206
  "pisell2.text.send-mail": "Send email",
205
207
  "pisell2.text.copy-to-clipboard": "Copy to clipboard",
@@ -540,6 +542,8 @@ var locales_default = {
540
542
  "pisell2.text.deposit-delete-message": "删除后不可恢复,请确认操作",
541
543
  "pisell2.text.deposit-paid": "已付定金",
542
544
  "pisell2.text.stock": "库存",
545
+ "pisell2.appointment.unuse.stock": "库存不足",
546
+ "pisell2.appointment.unuse.capacity": (count) => `仅可预约 ${count} 个,请减少数量`,
543
547
  "pisell2.text.payment-link": "付款链接",
544
548
  "pisell2.text.send-mail": "发送邮件",
545
549
  "pisell2.text.copy-to-clipboard": "复制到剪切板",
@@ -880,6 +884,8 @@ var locales_default = {
880
884
  "pisell2.text.deposit-delete-message": "刪除後不可恢復,請確認操作",
881
885
  "pisell2.text.deposit-paid": "已付定金",
882
886
  "pisell2.text.stock": "庫存",
887
+ "pisell2.appointment.unuse.stock": "庫存不足",
888
+ "pisell2.appointment.unuse.capacity": (count) => `僅可預約 ${count} 個,請減少數量`,
883
889
  "pisell2.text.payment-link": "付款鏈接",
884
890
  "pisell2.text.send-mail": "發送郵件",
885
891
  "pisell2.text.copy-to-clipboard": "複製到剪切板",
@@ -108,6 +108,7 @@ var PaymentContent = (0, import_react.forwardRef)(
108
108
  const savePayLaterHandlerRef = (0, import_react.useRef)(null);
109
109
  const [customAmount, setCustomAmount] = (0, import_react.useState)("");
110
110
  const [balanceDueAmount, setBalanceDueAmount] = (0, import_react.useState)("");
111
+ const [balanceDueTotalAmount, setBalanceDueTotalAmount] = (0, import_react.useState)("");
111
112
  const [recommendAmounts, setRecommendAmounts] = (0, import_react.useState)([]);
112
113
  const paymentMethodsRef = (0, import_react.useRef)(null);
113
114
  const [paymentMethods, setPaymentMethods] = (0, import_react.useState)([]);
@@ -319,6 +320,7 @@ var PaymentContent = (0, import_react.forwardRef)(
319
320
  if (currentAmount) {
320
321
  setCustomAmount(currentAmount);
321
322
  setBalanceDueAmount(currentAmount);
323
+ setBalanceDueTotalAmount(orderInfo.totalAmount || "0");
322
324
  const currentNote = checkoutModule.getOrderNote();
323
325
  if (currentNote) {
324
326
  setOrderNote(currentNote);
@@ -407,6 +409,7 @@ var PaymentContent = (0, import_react.forwardRef)(
407
409
  CheckoutHooks.OnBalanceDueAmountChanged,
408
410
  (data) => {
409
411
  setBalanceDueAmount(data.newAmount);
412
+ setBalanceDueTotalAmount(data.totalAmount || "0");
410
413
  }
411
414
  );
412
415
  const orderSubmitStartUnsubscribe = core.effects.on(
@@ -458,9 +461,6 @@ var PaymentContent = (0, import_react.forwardRef)(
458
461
  const chargePercentage = new import_decimal.default(((_b3 = item.service_charge) == null ? void 0 : _b3.percentage) || 0);
459
462
  const itemAmount = new import_decimal.default(item.amount || 0);
460
463
  let itemServiceCharge = chargeAmount.add(chargePercentage.mul(itemAmount));
461
- if (Number(item.rounding_amount) > 0) {
462
- itemServiceCharge = itemServiceCharge.sub(new import_decimal.default(item.rounding_amount));
463
- }
464
464
  console.log(itemServiceCharge);
465
465
  return acc.add(itemServiceCharge);
466
466
  }, new import_decimal.default(0));
@@ -939,7 +939,8 @@ var PaymentContent = (0, import_react.forwardRef)(
939
939
  amountButtons: recommendAmounts,
940
940
  customAmount,
941
941
  roundingFunction,
942
- balanceDueAmount
942
+ balanceDueAmount,
943
+ balanceDueTotalAmount
943
944
  }
944
945
  )
945
946
  ),
@@ -365,8 +365,8 @@ function AmountSummary({
365
365
  let balanceAmountValue = parseFormattedAmount(getBalanceDueAmount());
366
366
  let balanceDecimal = new import_decimal.default(balanceAmountValue);
367
367
  const syncedVoucherAmount = paymentItems == null ? void 0 : paymentItems.reduce((acc, item) => {
368
- if (item.voucher_id && item.isSynced && (paymentType === "regular" && item.order_payment_type !== "deposit" || paymentType === "deposit" && item.order_payment_type === "deposit")) {
369
- return acc.plus(item.amount).plus(item.rounding_amount);
368
+ if (item.isSynced && (paymentType === "regular" && item.order_payment_type !== "deposit" || paymentType === "deposit" && item.order_payment_type === "deposit")) {
369
+ return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
370
370
  }
371
371
  return acc;
372
372
  }, new import_decimal.default(0)).toNumber();
@@ -447,7 +447,7 @@ function AmountSummary({
447
447
  if (paymentType === "regular") {
448
448
  const depositPaidAmount = paymentItems == null ? void 0 : paymentItems.reduce((acc, item) => {
449
449
  if (item.order_payment_type === "deposit") {
450
- return acc.plus(item.amount).plus(Math.abs(item.rounding_amount));
450
+ return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
451
451
  }
452
452
  return acc;
453
453
  }, new import_decimal.default(0)).toNumber();
@@ -456,7 +456,7 @@ function AmountSummary({
456
456
  } else {
457
457
  const depositPaidAmount = paymentItems == null ? void 0 : paymentItems.reduce((acc, item) => {
458
458
  if (item.order_payment_type === "deposit") {
459
- return acc.plus(item.amount);
459
+ return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
460
460
  }
461
461
  return acc;
462
462
  }, new import_decimal.default(0)).toNumber();