@pisell/private-materials 6.4.50 → 6.4.51

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 (147) 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 +7 -7
  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 +3 -3
  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/addons/model.d.ts +1 -10
  14. package/es/components/booking/components/footer/index.js +12 -1
  15. package/es/components/booking/editBookingModal/index.js +8 -2
  16. package/es/components/booking/forms/model.d.ts +1 -10
  17. package/es/components/booking/info/model.d.ts +1 -10
  18. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  19. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  20. package/es/components/booking/locales.d.ts +6 -0
  21. package/es/components/booking/locales.js +12 -0
  22. package/es/components/booking/model.d.ts +1 -9
  23. package/es/components/booking/notes/model.d.ts +1 -10
  24. package/es/components/booking/payments/model.d.ts +1 -10
  25. package/es/components/checkout/PaymentModal.js +70 -62
  26. package/es/components/checkout/components/AmountSummary/index.js +4 -4
  27. package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  28. package/es/components/checkout/components/CashPaymentModule/index.js +14 -10
  29. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  30. package/es/components/eftposPay/hooks.d.ts +1 -1
  31. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  32. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +25 -4
  33. package/es/components/eftposPay/serve.js +1 -1
  34. package/es/components/eftposPay/store/index.d.ts +2 -2
  35. package/es/components/index.d.ts +3 -1
  36. package/es/components/index.js +3 -1
  37. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  38. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  39. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  40. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  41. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  42. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  43. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  44. package/es/components/pay/toC/model.d.ts +1 -9
  45. package/es/components/pay/toC/utils.js +1 -1
  46. package/es/components/pinModal/hooks.d.ts +7 -0
  47. package/es/components/pinModal/hooks.js +65 -0
  48. package/es/components/pinModal/index.d.ts +4 -0
  49. package/es/components/pinModal/index.js +98 -0
  50. package/es/components/pinModal/index.less +44 -0
  51. package/es/components/pinModal/locales.d.ts +27 -0
  52. package/es/components/pinModal/locales.js +26 -0
  53. package/es/components/pinModal/serve.d.ts +6 -0
  54. package/es/components/pinModal/serve.js +11 -0
  55. package/es/components/pinModal/types.d.ts +0 -0
  56. package/es/components/pinModal/types.js +0 -0
  57. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  58. package/es/components/pinVerifyModal/hooks.js +80 -0
  59. package/es/components/pinVerifyModal/index.d.ts +5 -0
  60. package/es/components/pinVerifyModal/index.js +218 -0
  61. package/es/components/pinVerifyModal/index.less +92 -0
  62. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  63. package/es/components/pinVerifyModal/locales.js +23 -0
  64. package/es/components/pinVerifyModal/types.d.ts +33 -0
  65. package/es/components/pinVerifyModal/types.js +1 -0
  66. package/es/components/schedules/model.d.ts +1 -9
  67. package/es/components/ticketBooking/components/ticketBooking/index.js +56 -10
  68. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  69. package/es/components/wallet/Detail/model.d.ts +1 -13
  70. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  71. package/es/components/wallet/PointCard/model.d.ts +1 -13
  72. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  73. package/es/components/wallet/Voucher/model.d.ts +1 -13
  74. package/es/components/wallet/model.d.ts +1 -9
  75. package/es/components/walletList/index.js +20 -2
  76. package/es/index.d.ts +2 -0
  77. package/es/index.js +3 -1
  78. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  79. package/lib/components/appointmentBooking/hooks.js +6 -0
  80. package/lib/components/booking/addons/model.d.ts +1 -10
  81. package/lib/components/booking/components/footer/index.js +15 -2
  82. package/lib/components/booking/editBookingModal/index.js +6 -1
  83. package/lib/components/booking/forms/model.d.ts +1 -10
  84. package/lib/components/booking/info/model.d.ts +1 -10
  85. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  86. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  87. package/lib/components/booking/locales.d.ts +6 -0
  88. package/lib/components/booking/locales.js +6 -0
  89. package/lib/components/booking/model.d.ts +1 -9
  90. package/lib/components/booking/notes/model.d.ts +1 -10
  91. package/lib/components/booking/payments/model.d.ts +1 -10
  92. package/lib/components/checkout/PaymentModal.js +5 -4
  93. package/lib/components/checkout/components/AmountSummary/index.js +4 -4
  94. package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  95. package/lib/components/checkout/components/CashPaymentModule/index.js +6 -3
  96. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  97. package/lib/components/eftposPay/hooks.d.ts +1 -1
  98. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  99. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +16 -4
  100. package/lib/components/eftposPay/serve.js +1 -1
  101. package/lib/components/eftposPay/store/index.d.ts +2 -2
  102. package/lib/components/index.d.ts +3 -1
  103. package/lib/components/index.js +6 -0
  104. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  105. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  106. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  107. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  108. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  109. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  110. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  111. package/lib/components/pay/toC/model.d.ts +1 -9
  112. package/lib/components/pay/toC/utils.js +1 -1
  113. package/lib/components/pinModal/hooks.d.ts +7 -0
  114. package/lib/components/pinModal/hooks.js +85 -0
  115. package/lib/components/pinModal/index.d.ts +4 -0
  116. package/lib/components/pinModal/index.js +88 -0
  117. package/lib/components/pinModal/index.less +44 -0
  118. package/lib/components/pinModal/locales.d.ts +27 -0
  119. package/lib/components/pinModal/locales.js +50 -0
  120. package/lib/components/pinModal/serve.d.ts +6 -0
  121. package/lib/components/pinModal/serve.js +37 -0
  122. package/lib/components/pinModal/types.d.ts +0 -0
  123. package/lib/components/pinModal/types.js +0 -0
  124. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  125. package/lib/components/pinVerifyModal/hooks.js +93 -0
  126. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  127. package/lib/components/pinVerifyModal/index.js +230 -0
  128. package/lib/components/pinVerifyModal/index.less +92 -0
  129. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  130. package/lib/components/pinVerifyModal/locales.js +47 -0
  131. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  132. package/lib/components/pinVerifyModal/types.js +17 -0
  133. package/lib/components/schedules/model.d.ts +1 -9
  134. package/lib/components/ticketBooking/components/ticketBooking/index.js +52 -5
  135. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  136. package/lib/components/wallet/Detail/model.d.ts +1 -13
  137. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  138. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  139. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  140. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  141. package/lib/components/wallet/model.d.ts +1 -9
  142. package/lib/components/walletList/index.js +19 -2
  143. package/lib/index.d.ts +2 -0
  144. package/lib/index.js +6 -0
  145. package/lowcode/pin-modal/meta.ts +37 -0
  146. package/lowcode/pin-verify-modal/meta.ts +80 -0
  147. package/package.json +12 -12
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,14 +1,5 @@
1
- /// <reference types="react" />
2
- import { FormState } from '../model';
3
1
  export declare const walkInData: {
4
2
  id: number;
5
3
  nickname: string;
6
4
  };
7
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
- state: FormState;
9
- } & {
10
- dispatch: (params: {
11
- type: string;
12
- payload: any;
13
- }) => void;
14
- }>;
5
+ export declare const Provider: any, Context: any;
@@ -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": "複製到剪切板",
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -106,11 +105,4 @@ export declare const walkInData: {
106
105
  id: number;
107
106
  nickname: string;
108
107
  };
109
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
110
- state: FormState;
111
- } & {
112
- dispatch: (params: {
113
- type: string;
114
- payload: any;
115
- }) => void;
116
- }>;
108
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -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();
@@ -13,10 +13,12 @@ export interface CashPaymentModuleProps {
13
13
  roundingDifference: number;
14
14
  }>;
15
15
  balanceDueAmount?: string;
16
+ balanceDueTotalAmount?: string;
16
17
  syncingLock?: boolean;
17
18
  }
18
19
  export declare function CashPaymentModule({ amountSymbol, orderInfo, onPaymentComplete, customAmount, amountButtons, // 按钮列表,默认5个推荐金额
19
20
  disabled, // 禁用状态
20
- roundingFunction, balanceDueAmount, // 剩余支付金额
21
+ roundingFunction, balanceDueAmount, // 当前阶段剩余支付金额(定金或普通支付)
22
+ balanceDueTotalAmount, // 完整订单剩余待付金额
21
23
  syncingLock, }: CashPaymentModuleProps): JSX.Element;
22
24
  export default CashPaymentModule;
@@ -52,7 +52,9 @@ function CashPaymentModule({
52
52
  // 禁用状态
53
53
  roundingFunction,
54
54
  balanceDueAmount = "0",
55
- // 剩余支付金额
55
+ // 当前阶段剩余支付金额(定金或普通支付)
56
+ balanceDueTotalAmount = "0",
57
+ // 完整订单剩余待付金额
56
58
  syncingLock = false
57
59
  // 是否锁定
58
60
  }) {
@@ -71,7 +73,7 @@ function CashPaymentModule({
71
73
  };
72
74
  (0, import_react.useEffect)(() => {
73
75
  handleKeyboardConfirm(customAmount || "");
74
- }, [customAmount, balanceDueAmount]);
76
+ }, [customAmount, balanceDueAmount, orderInfo == null ? void 0 : orderInfo.isDeposit]);
75
77
  const isAmountButtonsDisabled = disabled || Number(customAmount || 0) === 0;
76
78
  const isInputDisabled = disabled || Number(customAmount || 0) === 0;
77
79
  const handleCashPayInternal = () => {
@@ -120,7 +122,8 @@ function CashPaymentModule({
120
122
  } else {
121
123
  const cleanValue = finalValue.replace(/[$\s]/g, "");
122
124
  const numValue = parseFloat(cleanValue);
123
- const balanceDue = parseFloat(balanceDueAmount);
125
+ debugger;
126
+ const balanceDue = parseFloat((orderInfo == null ? void 0 : orderInfo.isDeposit) ? balanceDueTotalAmount || "0" : balanceDueAmount);
124
127
  const shouldApplyRounding = Math.abs(numValue - balanceDue) < 0.01;
125
128
  let finalAmount = numValue;
126
129
  let roundingDiff = 0;
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
17
17
  cardData: any;
18
18
  handleSelectWallet: (value: number[]) => void;
19
19
  selectedWalletIds: any[];
20
- expiredWalletIds: any;
20
+ expiredWalletIds: any[];
21
21
  expiredWalletData: any;
22
22
  disabledWalletData: any[];
23
23
  clearAllSelectedWallet: () => void;
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -63,18 +63,18 @@ var useLinklyPayOrRefund = (handleCheck) => {
63
63
  content: [{ key: "response", value: JSON.stringify(res) }]
64
64
  });
65
65
  const status = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.status;
66
- if (status === 0) {
66
+ if (status == 0) {
67
67
  numRef.current = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.session_id;
68
68
  dispatch((0, import_store.updateState)({ number: numRef.current }));
69
69
  dispatch((0, import_store.updateCustom)({ actionStatus: import_const2.LinklyActionStatus.Cancel }));
70
70
  setTimeout(() => {
71
71
  var _a2;
72
72
  (_a2 = resultQueryRef.current) == null ? void 0 : _a2.call(resultQueryRef);
73
- });
73
+ }, 300);
74
74
  return;
75
75
  }
76
76
  dispatch((0, import_store.updateCustom)({ actionStatus: import_const2.LinklyActionStatus.Empty }));
77
- if (status === 1) {
77
+ if (status == 1) {
78
78
  (_c = handleLinklySuccessRef.current) == null ? void 0 : _c.call(handleLinklySuccessRef, res);
79
79
  return;
80
80
  }
@@ -83,13 +83,17 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
83
83
  _log("Success" /* Success */, result);
84
84
  isQueryFinishedRef.current = true;
85
85
  const data = (result == null ? void 0 : result.data) || {};
86
- if (data.status === 1) {
86
+ if (data.status == 1) {
87
87
  console.log("交易成功,终止查询");
88
+ (0, import_utils.sendWarningLog)({
89
+ title: `Linkly-${isPay ? "Pay" : "Refund"}-交易成功`,
90
+ content: [{ key: "response", value: JSON.stringify(result) }]
91
+ });
88
92
  reset();
89
93
  handleLinklySuccess(result);
90
94
  return;
91
95
  }
92
- if (data.status !== void 0 && (data == null ? void 0 : data.status) === 0) {
96
+ if ((data == null ? void 0 : data.status) == 0 && (data == null ? void 0 : data.signature_flag) != 1) {
93
97
  console.log("交易状态为0需要继续查询");
94
98
  isQueryFinishedRef.current = false;
95
99
  _resultQuery();
@@ -97,13 +101,21 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
97
101
  }
98
102
  if (data.status < 0) {
99
103
  console.log("交易失败,终止查询");
104
+ (0, import_utils.sendWarningLog)({
105
+ title: `Linkly-${isPay ? "Pay" : "Refund"}-交易失败`,
106
+ content: [{ key: "response", value: JSON.stringify(result) }]
107
+ });
100
108
  reset();
101
109
  result.code = import_const.PayStatus.Unknown;
102
110
  (_a2 = failRef.current) == null ? void 0 : _a2.call(failRef, result, false);
103
111
  return;
104
112
  }
105
- if (data.signature_flag === 1) {
113
+ if (data.signature_flag == 1) {
106
114
  console.log("交易需要签名,终止查询");
115
+ (0, import_utils.sendWarningLog)({
116
+ title: `Linkly-${isPay ? "Pay" : "Refund"}-交易需要签名`,
117
+ content: [{ key: "response", value: JSON.stringify(result) }]
118
+ });
107
119
  reset();
108
120
  gotoSignature();
109
121
  return;
@@ -194,7 +206,7 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
194
206
  content.push({ key: "error", value: JSON.stringify(res) });
195
207
  }
196
208
  (0, import_utils.sendWarningLog)({
197
- title: `Linkly-${isPay ? "Pay" : "Refund"}-结果查询--${type}`,
209
+ title: `Linkly-${isPay ? "Pay" : "Refund"}-交易结果轮询`,
198
210
  content
199
211
  });
200
212
  };
@@ -52,7 +52,7 @@ var payData = async (params, config) => import_utils.request.getRequest().post("
52
52
  var refundData = async (params, config) => import_utils.request.getRequest().post("/shop/pay/card-reader/refund", params, config);
53
53
  var addTransaction = async (params, config) => import_utils.request.getRequest().post("/shop/pay/card-reader/transaction", params, config);
54
54
  var editTransaction = async (id, params, config) => import_utils.request.getRequest().put(`/shop/pay/card-reader/transaction/${id}`, params, config);
55
- var linklyPayQuery = async (params, config) => import_utils.request.getRequest().get("/shop/shop/linkly/pay/query", params, config);
55
+ var linklyPayQuery = async (params, config) => import_utils.request.getRequest().get("/shop/linkly/pay/query", params, config);
56
56
  var linklyRefundQuery = async (params, config) => import_utils.request.getRequest().get("/shop/linkly/refund/query", params, config);
57
57
  // Annotate the CommonJS export names for ESM import in node:
58
58
  0 && (module.exports = {
@@ -297,8 +297,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  amount?: string | number | undefined;
298
298
  mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
301
- action?: "pay" | "amount" | "deviceList" | undefined;
300
+ eftpos?: "tyro" | "windcave" | "stripe" | "payo" | "linkly" | undefined;
301
+ action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
@@ -17,4 +17,6 @@ import PisellSelectCustomerModal from './pisellSelectCustomerModal';
17
17
  import SubTotal from './subTotal';
18
18
  import EditBookingModal from './booking/editBookingModal';
19
19
  import StepController from './stepController';
20
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController };
20
+ import PinModal from './pinModal';
21
+ import PinVerifyModal from './pinVerifyModal';
22
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, };
@@ -36,6 +36,8 @@ __export(components_exports, {
36
36
  BookingNotes: () => import_notes.default,
37
37
  EditBookingModal: () => import_editBookingModal.default,
38
38
  Login: () => import_login.default,
39
+ PinModal: () => import_pinModal.default,
40
+ PinVerifyModal: () => import_pinVerifyModal.default,
39
41
  PisellSelectCustomerModal: () => import_pisellSelectCustomerModal.default,
40
42
  ProductExtension: () => import_productExtension.default,
41
43
  RuleSetting: () => import_ruleSetting.default,
@@ -69,6 +71,8 @@ var import_pisellSelectCustomerModal = __toESM(require("./pisellSelectCustomerMo
69
71
  var import_subTotal = __toESM(require("./subTotal"));
70
72
  var import_editBookingModal = __toESM(require("./booking/editBookingModal"));
71
73
  var import_stepController = __toESM(require("./stepController"));
74
+ var import_pinModal = __toESM(require("./pinModal"));
75
+ var import_pinVerifyModal = __toESM(require("./pinVerifyModal"));
72
76
  // Annotate the CommonJS export names for ESM import in node:
73
77
  0 && (module.exports = {
74
78
  Booking,
@@ -78,6 +82,8 @@ var import_stepController = __toESM(require("./stepController"));
78
82
  BookingNotes,
79
83
  EditBookingModal,
80
84
  Login,
85
+ PinModal,
86
+ PinVerifyModal,
81
87
  PisellSelectCustomerModal,
82
88
  ProductExtension,
83
89
  RuleSetting,
@@ -171,6 +171,7 @@ var createThreeDSMethodIframe = async (threeDSMethodData, callback) => {
171
171
  return defaultReturnParams;
172
172
  }
173
173
  const displayBox = document.getElementById("threeds-container");
174
+ displayBox.innerHTML = "";
174
175
  let iframe = document.createElement("iframe");
175
176
  iframe.classList.add("hidden_TDS_From");
176
177
  iframe.name = "threeDSMethodIframe";
@@ -286,6 +287,7 @@ var checkTDSAuth = async (step2, step3, callback) => {
286
287
  };
287
288
  var createChallengeIframe = (challengeData, callback) => {
288
289
  const displayBox = document.getElementById("threeds-container");
290
+ displayBox.innerHTML = "";
289
291
  let iframe = document.createElement("iframe");
290
292
  iframe.classList.add("tdsv2challengeIframe");
291
293
  iframe.name = "challengeIframe";
@@ -11,6 +11,8 @@ export interface WalletPassListProps {
11
11
  name: string;
12
12
  };
13
13
  onChangeDebounce?: boolean;
14
+ loading?: boolean;
15
+ onLoadingChange?: (loading: boolean) => void;
14
16
  }
15
17
  export declare type WalletPassListRef = {
16
18
  init: (params: MachineCodeListParams, formatList?: (val: WalletPassDataType[]) => WalletPassDataType[]) => void;
@@ -37,16 +37,20 @@ var import_materials = require("@pisell/materials");
37
37
  var import_utils = require("@pisell/utils");
38
38
  var import_ahooks = require("ahooks");
39
39
  var import_icons = require("@ant-design/icons");
40
+ var import_pinVerifyModal = __toESM(require("../../../../pinVerifyModal"));
40
41
  var import_MultiModeSearch = __toESM(require("./MultiModeSearch"));
41
42
  var import_List = __toESM(require("./List"));
42
43
  var import_serve = require("./serve");
43
44
  var import_utils2 = require("./utils");
44
45
  var import_utils3 = require("../../utils");
45
46
  var import_index = require("./index.less");
47
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
46
48
  var { Amount } = import_materials.PisellText;
47
49
  var WalletPass = (0, import_react.forwardRef)((props, ref) => {
48
- var _a;
50
+ var _a, _b, _c, _d, _e;
49
51
  const { onWalletPassChange, walletPass, walletSetting } = props;
52
+ const context = (0, import_useEngineContext.default)();
53
+ const isWalletCode = (_d = (_c = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.businessUtils) == null ? void 0 : _c.getAppByModal) == null ? void 0 : _d.call(_c, "wallet");
50
54
  const [currentWalletPass, setCurrentWalletPass] = (0, import_react.useState)(walletPass);
51
55
  const [loading, setLoading] = (0, import_react.useState)(false);
52
56
  const [open, setOpen] = (0, import_react.useState)(false);
@@ -60,7 +64,8 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
60
64
  });
61
65
  const isAutoSelect = (0, import_react.useRef)(false);
62
66
  const listRef = (0, import_react.useRef)(null);
63
- const searchValRef = (0, import_react.useRef)("");
67
+ const searchValRef = (0, import_react.useRef)(null);
68
+ const pinVerifyModalRef = (0, import_react.useRef)(null);
64
69
  const { cards: walletPassSelectCards, amount } = currentWalletPass || {};
65
70
  const [currentCustomerWalletPass, otherCustomerWalletPass] = (0, import_react.useMemo)(() => {
66
71
  const current = [];
@@ -98,9 +103,9 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
98
103
  return codes;
99
104
  }, [addList, selectValue]);
100
105
  const refreshList = (0, import_ahooks.useMemoizedFn)(() => {
101
- var _a2, _b;
106
+ var _a2, _b2;
102
107
  if ((order == null ? void 0 : order.order_id) && (order == null ? void 0 : order.customer_id)) {
103
- (_b = listRef.current) == null ? void 0 : _b.init(
108
+ (_b2 = listRef.current) == null ? void 0 : _b2.init(
104
109
  {
105
110
  order_id: order.order_id,
106
111
  available: 2,
@@ -146,52 +151,86 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
146
151
  refreshList();
147
152
  });
148
153
  };
149
- const searchList = async (val, isSelectChange) => {
154
+ const searchList = async ({ code, customer_pin_key }, isSelectChange) => {
150
155
  var _a2;
151
156
  if (!(order == null ? void 0 : order.order_id)) return;
152
- const result = await (0, import_serve.searchMachineCodeList)({
153
- order_id: order.order_id,
154
- code: val,
155
- prepare_payments,
156
- filter_prepare_wallet_pass: 1,
157
- sale_channel: ((_a2 = order._order) == null ? void 0 : _a2.sale_channel) || "online-store"
158
- });
159
- if (!result) {
160
- if (!isSelectChange) {
161
- (0, import_materials.PisellToast)({
162
- content: import_utils.locales.getText("tocPay.text.walletSearchEmpty")
163
- });
157
+ setLoading(true);
158
+ try {
159
+ const result = await (0, import_serve.searchMachineCodeList)({
160
+ order_id: order.order_id,
161
+ code,
162
+ prepare_payments,
163
+ // filter_prepare_wallet_pass: 1,
164
+ sale_channel: ((_a2 = order._order) == null ? void 0 : _a2.sale_channel) || "online-store",
165
+ customer_pin_key
166
+ });
167
+ if (!result) {
168
+ if (!isSelectChange) {
169
+ (0, import_materials.PisellToast)({
170
+ content: import_utils.locales.getText("tocPay.text.walletSearchEmpty")
171
+ });
172
+ }
173
+ return;
174
+ }
175
+ if (isSelectChange && !searchValRef.current) {
176
+ return;
164
177
  }
165
- return;
178
+ setSearchData(
179
+ (0, import_utils2.formatMachineCodeServer2CardList)(
180
+ [...searchSelectData.details, ...result],
181
+ searchSelectData.ids
182
+ )
183
+ );
184
+ if (result.length) {
185
+ if (result.length === 1 && result[0].unified_available_status && isAutoSelect.current) {
186
+ setSearchSelectData({
187
+ ids: [result[0].id],
188
+ details: result
189
+ });
190
+ }
191
+ setSearchOpen(true);
192
+ searchValRef.current = { code, customer_pin_key };
193
+ }
194
+ } finally {
195
+ setLoading(false);
166
196
  }
167
- setSearchData(
168
- (0, import_utils2.formatMachineCodeServer2CardList)(
169
- [...searchSelectData.details, ...result],
170
- searchSelectData.ids
171
- )
172
- );
173
- if (result.length) {
174
- if (result.length === 1 && result[0].unified_available_status && isAutoSelect.current) {
175
- setSearchSelectData({
176
- ids: [result[0].id],
177
- details: result
178
- });
197
+ };
198
+ const searchWalletCodeFn = async (val) => {
199
+ var _a2;
200
+ setLoading(true);
201
+ try {
202
+ const result = await (0, import_serve.searchWalletCode)({ code: val, with_customer: 1 });
203
+ console.log(result, "result");
204
+ if (!result) {
205
+ searchList({ code: val });
206
+ return;
179
207
  }
180
- setSearchOpen(true);
181
- searchValRef.current = val;
208
+ (_a2 = pinVerifyModalRef.current) == null ? void 0 : _a2.open({
209
+ wallet_code: result.code,
210
+ wallet_detail_id: result.id,
211
+ failed_count: result.failed_count,
212
+ check_max_count: result.check_max_count,
213
+ customer: result.customer
214
+ });
215
+ } finally {
216
+ setLoading(false);
182
217
  }
183
218
  };
184
219
  const handleSearch = (0, import_ahooks.useMemoizedFn)((val) => {
185
220
  if (!val || searchOpen) return;
186
221
  isAutoSelect.current = true;
187
- searchList(val);
222
+ if ((0, import_utils2.getIsWalletCode)(val) && isWalletCode) {
223
+ searchWalletCodeFn(val);
224
+ } else {
225
+ searchList({ code: val });
226
+ }
188
227
  });
189
228
  (0, import_react.useImperativeHandle)(ref, () => ({
190
229
  init
191
230
  }));
192
231
  const handleSearchModalClose = () => {
193
232
  setSearchOpen(false);
194
- searchValRef.current = "";
233
+ searchValRef.current = null;
195
234
  setSearchSelectData({
196
235
  ids: [],
197
236
  details: []
@@ -309,7 +348,7 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
309
348
  okText: import_utils.locales.getText("tocPay.text.select"),
310
349
  onOk: handleSelectOk,
311
350
  okButtonProps: {
312
- disabled: ((_a = searchSelectData.ids) == null ? void 0 : _a.length) === 0
351
+ disabled: ((_e = searchSelectData.ids) == null ? void 0 : _e.length) === 0
313
352
  }
314
353
  },
315
354
  /* @__PURE__ */ import_react.default.createElement("div", { className: "", style: { marginTop: 24 } }, /* @__PURE__ */ import_react.default.createElement(
@@ -318,9 +357,18 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
318
357
  walletSetting,
319
358
  data: searchData,
320
359
  value: searchSelectData.ids,
321
- onChange: handleAddChange
360
+ onChange: handleAddChange,
361
+ loading
322
362
  }
323
363
  ))
364
+ ), /* @__PURE__ */ import_react.default.createElement(
365
+ import_pinVerifyModal.default,
366
+ {
367
+ ref: pinVerifyModalRef,
368
+ onSuccess: (params) => {
369
+ searchList({ customer_pin_key: params == null ? void 0 : params.customer_pin_key });
370
+ }
371
+ }
324
372
  ));
325
373
  });
326
374
  var WalletPass_default = (0, import_react.memo)(WalletPass);