@pisell/private-materials 6.2.49 → 6.2.50

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 (168) 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 +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +27 -3
  12. package/es/components/appointmentBooking/components/Content/index.js +3 -3
  13. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  14. package/es/components/appointmentBooking/components/Voucher/index.js +6 -5
  15. package/es/components/appointmentBooking/hooks.js +10 -2
  16. package/es/components/appointmentBooking/index.js +10 -0
  17. package/es/components/booking/addons/model.d.ts +1 -10
  18. package/es/components/booking/components/footer/index.js +12 -1
  19. package/es/components/booking/editBookingModal/index.js +8 -2
  20. package/es/components/booking/forms/model.d.ts +1 -10
  21. package/es/components/booking/info/model.d.ts +1 -10
  22. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  23. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  24. package/es/components/booking/locales.d.ts +6 -0
  25. package/es/components/booking/locales.js +12 -0
  26. package/es/components/booking/model.d.ts +1 -9
  27. package/es/components/booking/notes/model.d.ts +1 -10
  28. package/es/components/booking/payments/model.d.ts +1 -10
  29. package/es/components/eftposPay/hooks.d.ts +1 -1
  30. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  31. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +25 -4
  32. package/es/components/eftposPay/store/index.d.ts +2 -2
  33. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +34 -8
  34. package/es/components/index.d.ts +3 -1
  35. package/es/components/index.js +3 -1
  36. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  37. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  38. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  39. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  40. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  41. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  42. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  43. package/es/components/pay/toC/model.d.ts +1 -9
  44. package/es/components/pay/toC/utils.js +1 -1
  45. package/es/components/pinModal/hooks.d.ts +7 -0
  46. package/es/components/pinModal/hooks.js +65 -0
  47. package/es/components/pinModal/index.d.ts +4 -0
  48. package/es/components/pinModal/index.js +98 -0
  49. package/es/components/pinModal/index.less +44 -0
  50. package/es/components/pinModal/locales.d.ts +27 -0
  51. package/es/components/pinModal/locales.js +26 -0
  52. package/es/components/pinModal/serve.d.ts +6 -0
  53. package/es/components/pinModal/serve.js +11 -0
  54. package/es/components/pinModal/types.d.ts +0 -0
  55. package/es/components/pinModal/types.js +0 -0
  56. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  57. package/es/components/pinVerifyModal/hooks.js +80 -0
  58. package/es/components/pinVerifyModal/index.d.ts +5 -0
  59. package/es/components/pinVerifyModal/index.js +218 -0
  60. package/es/components/pinVerifyModal/index.less +92 -0
  61. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  62. package/es/components/pinVerifyModal/locales.js +23 -0
  63. package/es/components/pinVerifyModal/types.d.ts +33 -0
  64. package/es/components/pinVerifyModal/types.js +1 -0
  65. package/es/components/schedules/model.d.ts +1 -9
  66. package/es/components/ticketBooking/components/ticketBooking/index.js +58 -10
  67. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  68. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  69. package/es/components/wallet/Detail/index.js +251 -63
  70. package/es/components/wallet/Detail/locales.d.ts +51 -0
  71. package/es/components/wallet/Detail/locales.js +57 -3
  72. package/es/components/wallet/Detail/model.d.ts +1 -13
  73. package/es/components/wallet/Detail/serve.js +5 -1
  74. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  75. package/es/components/wallet/PointCard/model.d.ts +1 -13
  76. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  77. package/es/components/wallet/Voucher/model.d.ts +1 -13
  78. package/es/components/wallet/components/UsageRules/index.d.ts +23 -0
  79. package/es/components/wallet/components/UsageRules/index.js +147 -0
  80. package/es/components/wallet/components/UsageRules/index.less +157 -0
  81. package/es/components/wallet/components/WalletCard.js +8 -3
  82. package/es/components/wallet/components/index.d.ts +1 -0
  83. package/es/components/wallet/components/index.js +2 -1
  84. package/es/components/wallet/model.d.ts +1 -9
  85. package/es/components/walletList/index.js +20 -2
  86. package/es/index.d.ts +2 -0
  87. package/es/index.js +3 -1
  88. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +22 -2
  89. package/lib/components/appointmentBooking/components/Content/index.js +2 -2
  90. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  91. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  92. package/lib/components/appointmentBooking/hooks.js +10 -2
  93. package/lib/components/appointmentBooking/index.js +6 -0
  94. package/lib/components/booking/addons/model.d.ts +1 -10
  95. package/lib/components/booking/components/footer/index.js +15 -2
  96. package/lib/components/booking/components/voucher/index.js +1 -3
  97. package/lib/components/booking/editBookingModal/index.js +6 -1
  98. package/lib/components/booking/forms/model.d.ts +1 -10
  99. package/lib/components/booking/info/model.d.ts +1 -10
  100. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  101. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  102. package/lib/components/booking/locales.d.ts +6 -0
  103. package/lib/components/booking/locales.js +6 -0
  104. package/lib/components/booking/model.d.ts +1 -9
  105. package/lib/components/booking/notes/model.d.ts +1 -10
  106. package/lib/components/booking/payments/model.d.ts +1 -10
  107. package/lib/components/eftposPay/hooks.d.ts +1 -1
  108. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  109. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +16 -4
  110. package/lib/components/eftposPay/store/index.d.ts +2 -2
  111. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +30 -8
  112. package/lib/components/index.d.ts +3 -1
  113. package/lib/components/index.js +6 -0
  114. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  115. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  116. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  117. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  118. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  119. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  120. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  121. package/lib/components/pay/toC/model.d.ts +1 -9
  122. package/lib/components/pay/toC/utils.js +1 -1
  123. package/lib/components/pinModal/hooks.d.ts +7 -0
  124. package/lib/components/pinModal/hooks.js +85 -0
  125. package/lib/components/pinModal/index.d.ts +4 -0
  126. package/lib/components/pinModal/index.js +88 -0
  127. package/lib/components/pinModal/index.less +44 -0
  128. package/lib/components/pinModal/locales.d.ts +27 -0
  129. package/lib/components/pinModal/locales.js +50 -0
  130. package/lib/components/pinModal/serve.d.ts +6 -0
  131. package/lib/components/pinModal/serve.js +37 -0
  132. package/lib/components/pinModal/types.d.ts +0 -0
  133. package/lib/components/pinModal/types.js +0 -0
  134. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  135. package/lib/components/pinVerifyModal/hooks.js +93 -0
  136. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  137. package/lib/components/pinVerifyModal/index.js +230 -0
  138. package/lib/components/pinVerifyModal/index.less +92 -0
  139. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  140. package/lib/components/pinVerifyModal/locales.js +47 -0
  141. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  142. package/lib/components/pinVerifyModal/types.js +17 -0
  143. package/lib/components/schedules/model.d.ts +1 -9
  144. package/lib/components/ticketBooking/components/ticketBooking/index.js +50 -6
  145. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  146. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  147. package/lib/components/wallet/Detail/index.js +140 -8
  148. package/lib/components/wallet/Detail/locales.d.ts +51 -0
  149. package/lib/components/wallet/Detail/locales.js +57 -3
  150. package/lib/components/wallet/Detail/model.d.ts +1 -13
  151. package/lib/components/wallet/Detail/serve.js +6 -1
  152. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  153. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  154. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  155. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  156. package/lib/components/wallet/components/UsageRules/index.d.ts +23 -0
  157. package/lib/components/wallet/components/UsageRules/index.js +113 -0
  158. package/lib/components/wallet/components/UsageRules/index.less +157 -0
  159. package/lib/components/wallet/components/WalletCard.js +3 -1
  160. package/lib/components/wallet/components/index.d.ts +1 -0
  161. package/lib/components/wallet/components/index.js +3 -0
  162. package/lib/components/wallet/model.d.ts +1 -9
  163. package/lib/components/walletList/index.js +19 -2
  164. package/lib/index.d.ts +2 -0
  165. package/lib/index.js +6 -0
  166. package/lowcode/pin-modal/meta.ts +37 -0
  167. package/lowcode/pin-verify-modal/meta.ts +80 -0
  168. package/package.json +4 -4
@@ -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 {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,11 +68,4 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
73
- state: FormState;
74
- } & {
75
- dispatch: (params: {
76
- type: string;
77
- payload: any;
78
- }) => void;
79
- }>;
71
+ export declare const Provider: any, Context: any;
@@ -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 } from '@pisell/materials';
29
29
  import { getOrderInfoByCode, getBookingDetail, getEventBookingDetail, getBookingConfig, getServices, voidAppointment } from "../../serve";
@@ -48,6 +48,7 @@ import { getBookingType } from "../bookingDataPanel/bookingList/utils";
48
48
  import { useCustomer } from "../../hooks/pisellos";
49
49
  import useScanManager from "../../hooks/pisellos/useScanManager";
50
50
  import { useShopDiscount } from "../../../appointmentBooking/hooks";
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,
@@ -266,8 +267,56 @@ var TicketBooking = function TicketBooking() {
266
267
  closeScan();
267
268
  };
268
269
  }, []);
270
+ var _useDebounceFn = useDebounceFn(function (type, orderId) {
271
+ // 支付成功后清空状态
272
+ try {
273
+ var _store$getState;
274
+ _initFn(function () {});
275
+ setState({
276
+ createCount: state.createCount + 1
277
+ });
278
+ sendWarningLog({
279
+ title: '清空购物车',
280
+ content: [{
281
+ key: '店铺id',
282
+ 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
283
+ }, {
284
+ key: '订单id',
285
+ value: orderId
286
+ }, {
287
+ key: '类型',
288
+ value: type
289
+ }]
290
+ });
291
+ } catch (err) {
292
+ var _store$getState2;
293
+ sendWarningLog({
294
+ title: '清空购物车失败',
295
+ content: [{
296
+ key: '店铺id',
297
+ 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
298
+ }, {
299
+ key: '订单id',
300
+ value: orderId
301
+ }, {
302
+ key: '类型',
303
+ value: type
304
+ }, {
305
+ key: 'error',
306
+ value: err === null || err === void 0 ? void 0 : err.message
307
+ }]
308
+ });
309
+ }
310
+ }, {
311
+ wait: 500,
312
+ leading: true,
313
+ trailing: false
314
+ }),
315
+ clearAllCart = _useDebounceFn.run;
269
316
  useEffect(function () {
270
- var _store$getState, _interaction$utils, _interaction$utils2;
317
+ var _store$getState3, _interaction$utils, _interaction$utils2;
318
+ // bellaswonderland.mypisell.com localStorage可能满了
319
+ localStorage.removeItem('bookingResourceList');
271
320
  _persistentRef.current = storage.get("drawer-booking") === 'true' ? true : isTerminal();
272
321
  if (lowcodeRef) {
273
322
  lowcodeRef.onReady(_this);
@@ -293,7 +342,7 @@ var TicketBooking = function TicketBooking() {
293
342
  });
294
343
  });
295
344
  setState({
296
- amountSymbol: (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) || '$'
345
+ amountSymbol: (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) || '$'
297
346
  }, function () {
298
347
  _initStateRef.current = JSON.parse(JSON.stringify(state));
299
348
  _getBoardConfig();
@@ -305,6 +354,7 @@ var TicketBooking = function TicketBooking() {
305
354
  console.log('bookingTicket.clearAllCart');
306
355
  // 支付成功后清空状态
307
356
  _initFn(function () {});
357
+ _setIntervalTime(true);
308
358
  selectCustomer(null);
309
359
  enableAllScanListeners();
310
360
  shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$clear = shopDiscount.clear) === null || _shopDiscount$clear === void 0 || _shopDiscount$clear.call(shopDiscount);
@@ -511,8 +561,8 @@ var TicketBooking = function TicketBooking() {
511
561
  }, 100);
512
562
  };
513
563
  var _setShopOpeningHours = function _setShopOpeningHours() {
514
- var _store$getState2;
515
- var 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;
564
+ var _store$getState4;
565
+ var 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;
516
566
  if (time) {
517
567
  localStorage.setItem('shopOpeningHours', time);
518
568
  }
@@ -531,11 +581,10 @@ var TicketBooking = function TicketBooking() {
531
581
  });
532
582
  case 2:
533
583
  data = _context.sent;
534
- console.log('wwww', data);
535
584
  setState({
536
585
  addTimeProducts: (data === null || data === void 0 ? void 0 : data.list) || []
537
586
  });
538
- case 5:
587
+ case 4:
539
588
  case "end":
540
589
  return _context.stop();
541
590
  }
@@ -700,9 +749,9 @@ var TicketBooking = function TicketBooking() {
700
749
  // 储存参数, 添加服务商品时使用
701
750
  sessionStorage.setItem('pisell2.booking.serviceParams', JSON.stringify(data));
702
751
  } else {
703
- var _store$getState3;
752
+ var _store$getState5;
704
753
  // 当前时区的时间
705
- 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;
754
+ 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;
706
755
  initState.modalState.date.value = dayjs.tz(new Date(), timezone);
707
756
  // 兜底, 没有传递则清空下
708
757
  sessionStorage.removeItem('pisell2.booking.serviceParams');
@@ -901,7 +950,6 @@ var TicketBooking = function TicketBooking() {
901
950
  isShowDeposit: state.isShowDeposit,
902
951
  disableEventBookingEdit: state.disableEventBookingEdit,
903
952
  list: state.list,
904
- intervalSetTime: state.intervalSetTime,
905
953
  createCount: state.createCount,
906
954
  bookingFunctions: state.bookingFunctions,
907
955
  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;
@@ -41,7 +41,7 @@ declare type ScanData = {
41
41
  };
42
42
  };
43
43
  export declare const formatScanCustomer: (data: ScanData) => {
44
- searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
44
+ searchType: "wallet" | "walletPass" | "product" | "local_product" | "customer";
45
45
  data: any;
46
46
  scanCode: string;
47
47
  } | null;
@@ -21,7 +21,7 @@ import useEngineContext from "./../../../hooks/useEngineContext";
21
21
  import localeTexts from "./locales";
22
22
  import { getAssetList, getDetailApi } from "./serve";
23
23
  import { request } from "./../../../utils";
24
- import { WalletBar, FooterButtons } from "../components";
24
+ import { WalletBar, FooterButtons, UsageRules } from "../components";
25
25
  import "./index.less";
26
26
  var Text = Typography.Text;
27
27
 
@@ -57,72 +57,218 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
57
57
  product = _detail$product === void 0 ? {} : _detail$product;
58
58
  var _ref = product || {},
59
59
  _ref$description = _ref.description,
60
- description = _ref$description === void 0 ? '' : _ref$description;
60
+ description = _ref$description === void 0 ? '' : _ref$description,
61
+ _ref$extension_data = _ref.extension_data,
62
+ extension_data = _ref$extension_data === void 0 ? [] : _ref$extension_data,
63
+ _ref$customer_order_b = _ref.customer_order_behavior_count,
64
+ customer_order_behavior_count = _ref$customer_order_b === void 0 ? 0 : _ref$customer_order_b;
61
65
  var context = useEngineContext();
62
- var utils = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
63
- var dvaStore = utils === null || utils === void 0 || (_utils$getStore = utils.getStore) === null || _utils$getStore === void 0 || (_utils$getStore = _utils$getStore.call(utils)) === null || _utils$getStore === void 0 ? void 0 : _utils$getStore.getState();
66
+
67
+ // 单独存储从详情接口获取的字段
64
68
  var _useState = useState([]),
65
69
  _useState2 = _slicedToArray(_useState, 2),
66
- TimeLineData = _useState2[0],
67
- setTimeLineData = _useState2[1];
68
- var _useState3 = useState(false),
70
+ extensionData = _useState2[0],
71
+ setExtensionData = _useState2[1];
72
+ var _useState3 = useState(0),
69
73
  _useState4 = _slicedToArray(_useState3, 2),
70
- isShowtimeLineDetail = _useState4[0],
71
- setIsShowtimeLineDetail = _useState4[1];
72
- var _useState5 = useState(true),
74
+ customerOrderBehaviorCount = _useState4[0],
75
+ setCustomerOrderBehaviorCount = _useState4[1];
76
+ var _useState5 = useState(0),
73
77
  _useState6 = _slicedToArray(_useState5, 2),
74
- isSpending = _useState6[0],
75
- setIsSpending = _useState6[1];
76
- var _useState7 = useState({}),
78
+ totalOrderBehaviorCount = _useState6[0],
79
+ setTotalOrderBehaviorCount = _useState6[1];
80
+ var _useState7 = useState(0),
77
81
  _useState8 = _slicedToArray(_useState7, 2),
78
- timeLineDetail = _useState8[0],
79
- setTimeLineDetail = _useState8[1];
80
- var _useState9 = useState(false),
82
+ todayOrderBehaviorCount = _useState8[0],
83
+ setTodayOrderBehaviorCount = _useState8[1];
84
+ var _useState9 = useState(0),
81
85
  _useState10 = _slicedToArray(_useState9, 2),
82
- wechatModalOpen = _useState10[0],
83
- setWechatModalOpen = _useState10[1];
84
- var _useState11 = useState(''),
86
+ weekOrderBehaviorCount = _useState10[0],
87
+ setWeekOrderBehaviorCount = _useState10[1];
88
+ var _useState11 = useState(0),
85
89
  _useState12 = _slicedToArray(_useState11, 2),
86
- copyUrl = _useState12[0],
87
- setCopyUrl = _useState12[1];
88
- var _useState13 = useState(false),
90
+ monthOrderBehaviorCount = _useState12[0],
91
+ setMonthOrderBehaviorCount = _useState12[1];
92
+
93
+ // 存储使用规则相关的状态
94
+ var _useState13 = useState(null),
89
95
  _useState14 = _slicedToArray(_useState13, 2),
90
- isLoading = _useState14[0],
91
- setIsLoading = _useState14[1];
92
- var _useState15 = useState(''),
96
+ usageCreditsData = _useState14[0],
97
+ setUsageCreditsData = _useState14[1];
98
+ var _useState15 = useState(false),
93
99
  _useState16 = _slicedToArray(_useState15, 2),
94
- apple_wallet_url = _useState16[0],
95
- setAppleWalletUrl = _useState16[1];
96
- var _useState17 = useState(''),
97
- _useState18 = _slicedToArray(_useState17, 2),
98
- google_wallet_url = _useState18[0],
99
- setGoogleWalletUrl = _useState18[1];
100
- var stateTimeUnix = 1723255863; //2024.8.10 时间戳
100
+ shouldShowUsageRules = _useState16[0],
101
+ setShouldShowUsageRules = _useState16[1];
101
102
 
102
- var _useState19 = useState([]),
103
+ // Generate usage rules from real data
104
+ var generateUsageRules = function generateUsageRules(creditsData) {
105
+ if (!creditsData) return [];
106
+ var rules = [];
107
+
108
+ // Add daily limit if exists
109
+ if (creditsData.max_per_day > 0) {
110
+ rules.push({
111
+ type: 'daily',
112
+ limit: creditsData.max_per_day,
113
+ description: '',
114
+ // Will be filled by localized text
115
+ resetTime: '' // Will be filled by localized text
116
+ });
117
+ }
118
+
119
+ // Add weekly limit if exists
120
+ if (creditsData.max_per_week > 0) {
121
+ rules.push({
122
+ type: 'weekly',
123
+ limit: creditsData.max_per_week,
124
+ description: '',
125
+ // Will be filled by localized text
126
+ resetTime: '' // Will be filled by localized text
127
+ });
128
+ }
129
+
130
+ // Add monthly limit if exists
131
+ if (creditsData.max_per_month > 0) {
132
+ rules.push({
133
+ type: 'monthly',
134
+ limit: creditsData.max_per_month,
135
+ description: '',
136
+ // Will be filled by localized text
137
+ resetTime: '' // Will be filled by localized text
138
+ });
139
+ }
140
+ return rules;
141
+ };
142
+
143
+ // Generate personal limit data
144
+ var generatePersonalLimit = function generatePersonalLimit(creditsData) {
145
+ var usedCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
146
+ totalOrderBehaviorCount: 0,
147
+ customerOrderBehaviorCount: 0
148
+ };
149
+ if (!creditsData) return undefined;
150
+ var totalCredits = creditsData.total_credits || 0;
151
+ var perUserLimit = creditsData.per_user_limit || 0;
152
+
153
+ // 使用 total_credits 和 per_user_limit 中的较小值且非 0 的值作为总数
154
+ // 如果 totalCredits 是 0,则使用 perUserLimit
155
+ var total = 0;
156
+ if (totalCredits > 0 && perUserLimit > 0) {
157
+ total = Math.min(totalCredits, perUserLimit);
158
+ } else {
159
+ total = Math.max(totalCredits, perUserLimit);
160
+ }
161
+ // const total = Math.min(totalCredits, perUserLimit);
162
+ // const remaining = Math.max(0, total - usedCount.totalOrderBehaviorCount); // Ensure remaining is not negative
163
+ // 单张卡剩余多少
164
+ var total_remaining = 0;
165
+ if (totalCredits > 0) {
166
+ total_remaining = totalCredits - usedCount.totalOrderBehaviorCount;
167
+ }
168
+ // 个人剩余多少
169
+ var perUser_remaining = 0;
170
+ if (perUserLimit > 0) {
171
+ perUser_remaining = perUserLimit - usedCount.customerOrderBehaviorCount;
172
+ }
173
+ var remaining = 0;
174
+ if (total_remaining > 0 && perUser_remaining > 0) {
175
+ remaining = Math.min(total_remaining, perUser_remaining);
176
+ } else {
177
+ // 如果有一个是 0,还需要看是否是因为配置是 0 才导致的 0
178
+ // 先看总次数是不是剩余 0,是因为什么剩余 0
179
+ if (total_remaining === 0) {
180
+ if (totalCredits === 0) {
181
+ // 代表不限制总使用次数
182
+ remaining = perUser_remaining;
183
+ } else {
184
+ // 代表限制总使用次数,但是总使用次数为 0,则 remaining 为 0
185
+ remaining = 0;
186
+ }
187
+ } else {
188
+ // 如果剩余总使用次数大于 0,个人使用次数为 0,则 remaining 为 0
189
+ if (perUser_remaining === 0) {
190
+ remaining = 0;
191
+ }
192
+ }
193
+ }
194
+ return {
195
+ total: total,
196
+ remaining: remaining,
197
+ note: '' // Will be filled by localized text
198
+ };
199
+ };
200
+
201
+ // 简化:直接计算
202
+ var usageRules = generateUsageRules(usageCreditsData);
203
+ // 取出所有最大的非 0 的数
204
+ var personalLimit = generatePersonalLimit(usageCreditsData, {
205
+ totalOrderBehaviorCount: totalOrderBehaviorCount,
206
+ customerOrderBehaviorCount: customerOrderBehaviorCount
207
+ });
208
+ var utils = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
209
+ var dvaStore = utils === null || utils === void 0 || (_utils$getStore = utils.getStore) === null || _utils$getStore === void 0 || (_utils$getStore = _utils$getStore.call(utils)) === null || _utils$getStore === void 0 ? void 0 : _utils$getStore.getState();
210
+ var _useState17 = useState([]),
211
+ _useState18 = _slicedToArray(_useState17, 2),
212
+ TimeLineData = _useState18[0],
213
+ setTimeLineData = _useState18[1];
214
+ var _useState19 = useState(false),
103
215
  _useState20 = _slicedToArray(_useState19, 2),
104
- listData = _useState20[0],
105
- setListData = _useState20[1];
106
- var modalContentRef = useRef(null);
107
- var tabsRef = useRef();
108
- var _useState21 = useState('detail'),
216
+ isShowtimeLineDetail = _useState20[0],
217
+ setIsShowtimeLineDetail = _useState20[1];
218
+ var _useState21 = useState(true),
109
219
  _useState22 = _slicedToArray(_useState21, 2),
110
- activeTab = _useState22[0],
111
- setActiveTab = _useState22[1];
112
- var _useState23 = useState(false),
220
+ isSpending = _useState22[0],
221
+ setIsSpending = _useState22[1];
222
+ var _useState23 = useState({}),
113
223
  _useState24 = _slicedToArray(_useState23, 2),
114
- isScrolling = _useState24[0],
115
- setIsScrolling = _useState24[1];
116
- var isUserClickRef = useRef(false);
117
- var scrollTimeoutRef = useRef(null);
224
+ timeLineDetail = _useState24[0],
225
+ setTimeLineDetail = _useState24[1];
118
226
  var _useState25 = useState(false),
119
227
  _useState26 = _slicedToArray(_useState25, 2),
120
- addWalletLoading = _useState26[0],
121
- setAddWalletLoading = _useState26[1];
122
- var _useState27 = useState(false),
228
+ wechatModalOpen = _useState26[0],
229
+ setWechatModalOpen = _useState26[1];
230
+ var _useState27 = useState(''),
123
231
  _useState28 = _slicedToArray(_useState27, 2),
124
- isAddingToWallet = _useState28[0],
125
- setIsAddingToWallet = _useState28[1];
232
+ copyUrl = _useState28[0],
233
+ setCopyUrl = _useState28[1];
234
+ var _useState29 = useState(false),
235
+ _useState30 = _slicedToArray(_useState29, 2),
236
+ isLoading = _useState30[0],
237
+ setIsLoading = _useState30[1];
238
+ var _useState31 = useState(''),
239
+ _useState32 = _slicedToArray(_useState31, 2),
240
+ apple_wallet_url = _useState32[0],
241
+ setAppleWalletUrl = _useState32[1];
242
+ var _useState33 = useState(''),
243
+ _useState34 = _slicedToArray(_useState33, 2),
244
+ google_wallet_url = _useState34[0],
245
+ setGoogleWalletUrl = _useState34[1];
246
+ var stateTimeUnix = 1723255863; //2024.8.10 时间戳
247
+
248
+ var _useState35 = useState([]),
249
+ _useState36 = _slicedToArray(_useState35, 2),
250
+ listData = _useState36[0],
251
+ setListData = _useState36[1];
252
+ var modalContentRef = useRef(null);
253
+ var tabsRef = useRef();
254
+ var _useState37 = useState('detail'),
255
+ _useState38 = _slicedToArray(_useState37, 2),
256
+ activeTab = _useState38[0],
257
+ setActiveTab = _useState38[1];
258
+ var _useState39 = useState(false),
259
+ _useState40 = _slicedToArray(_useState39, 2),
260
+ isScrolling = _useState40[0],
261
+ setIsScrolling = _useState40[1];
262
+ var isUserClickRef = useRef(false);
263
+ var scrollTimeoutRef = useRef(null);
264
+ var _useState41 = useState(false),
265
+ _useState42 = _slicedToArray(_useState41, 2),
266
+ addWalletLoading = _useState42[0],
267
+ setAddWalletLoading = _useState42[1];
268
+ var _useState43 = useState(false),
269
+ _useState44 = _slicedToArray(_useState43, 2),
270
+ isAddingToWallet = _useState44[0],
271
+ setIsAddingToWallet = _useState44[1];
126
272
  var anchorOptions = useMemo(function () {
127
273
  // 始终包含detail选项
128
274
  var options = [{
@@ -166,9 +312,11 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
166
312
  }];
167
313
  //折扣卡显示折扣字段 其他显示余额字段
168
314
  if (tag === 'product_discount_card') {
315
+ var _detail$metadata;
316
+ var isFixedAmount = ((_detail$metadata = detail.metadata) === null || _detail$metadata === void 0 ? void 0 : _detail$metadata.discount_card_type) === 'fixed_amount';
169
317
  data.splice(2, 0, {
170
318
  label: locales.getText('page.wallet.discount'),
171
- value: balance ? "".concat(Number(balance), "%") : ''
319
+ value: balance ? isFixedAmount ? "".concat(symbol).concat(Number(balance)) : "".concat(Number(balance), "%") : ''
172
320
  });
173
321
  } else if (tag === 'point_card') {
174
322
  data.splice(2, 0, {
@@ -231,7 +379,7 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
231
379
  };
232
380
  var getDetail = /*#__PURE__*/function () {
233
381
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
234
- var _yield$getDetailApi, _yield$getDetailApi$a, apple_wallet_url, _yield$getDetailApi$g, google_wallet_url;
382
+ var _yield$getDetailApi, _yield$getDetailApi$a, apple_wallet_url, _yield$getDetailApi$g, google_wallet_url, _yield$getDetailApi$e, extension_data, _yield$getDetailApi$c, customer_order_behavior_count, _yield$getDetailApi$t, total_order_behavior_count, _yield$getDetailApi$t2, today_order_behavior_count, _yield$getDetailApi$w, week_order_behavior_count, _yield$getDetailApi$m, month_order_behavior_count, usageCreditsItem;
235
383
  return _regeneratorRuntime().wrap(function _callee$(_context) {
236
384
  while (1) switch (_context.prev = _context.next) {
237
385
  case 0:
@@ -245,9 +393,46 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
245
393
  apple_wallet_url = _yield$getDetailApi$a === void 0 ? '' : _yield$getDetailApi$a;
246
394
  _yield$getDetailApi$g = _yield$getDetailApi.google_wallet_url;
247
395
  google_wallet_url = _yield$getDetailApi$g === void 0 ? '' : _yield$getDetailApi$g;
396
+ _yield$getDetailApi$e = _yield$getDetailApi.extension_data;
397
+ extension_data = _yield$getDetailApi$e === void 0 ? [] : _yield$getDetailApi$e;
398
+ _yield$getDetailApi$c = _yield$getDetailApi.customer_order_behavior_count;
399
+ customer_order_behavior_count = _yield$getDetailApi$c === void 0 ? 0 : _yield$getDetailApi$c;
400
+ _yield$getDetailApi$t = _yield$getDetailApi.total_order_behavior_count;
401
+ total_order_behavior_count = _yield$getDetailApi$t === void 0 ? 0 : _yield$getDetailApi$t;
402
+ _yield$getDetailApi$t2 = _yield$getDetailApi.today_order_behavior_count;
403
+ today_order_behavior_count = _yield$getDetailApi$t2 === void 0 ? 0 : _yield$getDetailApi$t2;
404
+ _yield$getDetailApi$w = _yield$getDetailApi.week_order_behavior_count;
405
+ week_order_behavior_count = _yield$getDetailApi$w === void 0 ? 0 : _yield$getDetailApi$w;
406
+ _yield$getDetailApi$m = _yield$getDetailApi.month_order_behavior_count;
407
+ month_order_behavior_count = _yield$getDetailApi$m === void 0 ? 0 : _yield$getDetailApi$m;
248
408
  setAppleWalletUrl(apple_wallet_url);
249
409
  setGoogleWalletUrl(google_wallet_url);
250
- case 9:
410
+
411
+ // 存储从详情接口获取的字段
412
+ setExtensionData(extension_data);
413
+ setCustomerOrderBehaviorCount(customer_order_behavior_count);
414
+ setTotalOrderBehaviorCount(total_order_behavior_count);
415
+ setTodayOrderBehaviorCount(today_order_behavior_count);
416
+ setWeekOrderBehaviorCount(week_order_behavior_count);
417
+ setMonthOrderBehaviorCount(month_order_behavior_count);
418
+
419
+ // 处理使用规则数据
420
+ if (Array.isArray(extension_data) && extension_data.length > 0) {
421
+ usageCreditsItem = extension_data.find(function (item) {
422
+ return item.field_key === 'usage_credits';
423
+ });
424
+ if (usageCreditsItem !== null && usageCreditsItem !== void 0 && usageCreditsItem.value) {
425
+ setUsageCreditsData(usageCreditsItem.value);
426
+ setShouldShowUsageRules(true);
427
+ } else {
428
+ setUsageCreditsData(null);
429
+ setShouldShowUsageRules(false);
430
+ }
431
+ } else {
432
+ setUsageCreditsData(null);
433
+ setShouldShowUsageRules(false);
434
+ }
435
+ case 28:
251
436
  case "end":
252
437
  return _context.stop();
253
438
  }
@@ -257,6 +442,8 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
257
442
  return _ref3.apply(this, arguments);
258
443
  };
259
444
  }();
445
+
446
+ // 当切换商品卡时,获取新的详情数据
260
447
  useEffect(function () {
261
448
  if (detail.id) {
262
449
  getDetail();
@@ -718,10 +905,10 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
718
905
 
719
906
  // 添加ref用于获取容器元素
720
907
  var detailWrapperRef = useRef(null);
721
- var _useState29 = useState(undefined),
722
- _useState30 = _slicedToArray(_useState29, 2),
723
- contentHeight = _useState30[0],
724
- setContentHeight = _useState30[1];
908
+ var _useState45 = useState(undefined),
909
+ _useState46 = _slicedToArray(_useState45, 2),
910
+ contentHeight = _useState46[0],
911
+ setContentHeight = _useState46[1];
725
912
 
726
913
  // 添加锚点导航ref
727
914
  var anchorWrapperRef = useRef(null);
@@ -860,16 +1047,17 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
860
1047
  valueColor: "#101828",
861
1048
  backgroundColors: ['#fff'],
862
1049
  isHasBorder: false
863
- }), /*#__PURE__*/React.createElement("div", {
1050
+ }), description && /*#__PURE__*/React.createElement("div", {
864
1051
  className: "wallet-detail-card-content-tip"
865
- }, description ?
866
- /*#__PURE__*/
867
- // @ts-ignore 忽略TypeScript错误,React类型定义问题
868
- React.createElement("div", {
1052
+ }, /*#__PURE__*/React.createElement("div", {
869
1053
  dangerouslySetInnerHTML: {
870
1054
  __html: description
871
1055
  }
872
- }) : null)), /*#__PURE__*/React.createElement("section", {
1056
+ })), shouldShowUsageRules && /*#__PURE__*/React.createElement(UsageRules, {
1057
+ locales: locales,
1058
+ rules: usageRules,
1059
+ personalLimit: personalLimit
1060
+ })), /*#__PURE__*/React.createElement("section", {
873
1061
  className: "wallet-detail-card-content-section wallet-detail-card-content-section-timeline",
874
1062
  "data-section": "activityLog"
875
1063
  }, tag !== 'product_discount_card' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {