@pisell/private-materials 3.4.55 → 3.4.56

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 (134) 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 +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
  12. package/es/components/booking/addons/index.js +20 -17
  13. package/es/components/booking/components/footer/utils.d.ts +6 -0
  14. package/es/components/booking/components/footer/utils.js +117 -53
  15. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  16. package/es/components/booking/components/voucher/index.js +27 -12
  17. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  18. package/es/components/booking/info/service/like/index.d.ts +1 -0
  19. package/es/components/booking/info/service2/utils.d.ts +1 -1
  20. package/es/components/booking/info/service2/utils.js +1 -0
  21. package/es/components/booking/info2/service/addService/index.js +3 -3
  22. package/es/components/booking/utils.d.ts +3 -2
  23. package/es/components/booking/utils.js +16 -2
  24. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  25. package/es/components/eftpos/form/index.d.ts +1 -0
  26. package/es/components/eftpos/group/index.d.ts +1 -0
  27. package/es/components/eftpos/hooks.d.ts +1 -0
  28. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  29. package/es/components/eftpos/icon/device.d.ts +1 -0
  30. package/es/components/eftpos/receipt/index.d.ts +1 -0
  31. package/es/components/eftposPay/amount.d.ts +1 -1
  32. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  33. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  34. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  35. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  36. package/es/components/eftposPay/device.d.ts +1 -1
  37. package/es/components/eftposPay/hooks.d.ts +2 -2
  38. package/es/components/eftposPay/store/index.d.ts +6 -6
  39. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  40. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  41. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  42. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  43. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  44. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  45. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  46. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  47. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  48. package/es/components/systemSettings/registry/components/SectionList.js +5 -1
  49. package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
  50. package/es/components/ticketBooking/utils/index.js +23 -8
  51. package/es/components/wallet/Detail/index.js +34 -2
  52. package/es/components/wallet/Detail/index.less +11 -0
  53. package/es/components/wallet/Detail/locales.d.ts +6 -0
  54. package/es/components/wallet/Detail/locales.js +14 -2
  55. package/es/components/wallet/Voucher/index.js +11 -10
  56. package/es/components/wallet/components/WalletCard.js +5 -1
  57. package/es/components/wallet/index.js +4 -2
  58. package/es/components/wallet/serve.d.ts +7 -0
  59. package/es/components/wallet/utils.d.ts +48 -0
  60. package/es/components/wallet/utils.js +342 -0
  61. package/es/index.d.ts +1 -0
  62. package/es/index.js +1 -0
  63. package/es/plus/clientName/index.d.ts +1 -0
  64. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  65. package/es/plus/walletPassGallery/components/passDetail/index.js +79 -30
  66. package/es/plus/walletPassGallery/index.js +4 -2
  67. package/es/plus/walletPassGallery/serve.d.ts +3 -0
  68. package/es/plus/walletPassGallery/serve.js +4 -2
  69. package/es/pro/Login2.0/AuthModal.js +12 -4
  70. package/es/pro/Login2.0/index.less +7 -7
  71. package/es/pro/pisellPaymentList/example.d.ts +1 -0
  72. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  73. package/lib/components/booking/addons/index.js +10 -7
  74. package/lib/components/booking/components/footer/utils.d.ts +6 -0
  75. package/lib/components/booking/components/footer/utils.js +86 -36
  76. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  77. package/lib/components/booking/components/voucher/index.js +23 -7
  78. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  79. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  80. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  81. package/lib/components/booking/info/service2/utils.js +1 -0
  82. package/lib/components/booking/info2/service/addService/index.js +2 -2
  83. package/lib/components/booking/utils.d.ts +3 -2
  84. package/lib/components/booking/utils.js +12 -0
  85. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  86. package/lib/components/eftpos/form/index.d.ts +1 -0
  87. package/lib/components/eftpos/group/index.d.ts +1 -0
  88. package/lib/components/eftpos/hooks.d.ts +1 -0
  89. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  90. package/lib/components/eftpos/icon/device.d.ts +1 -0
  91. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  92. package/lib/components/eftposPay/amount.d.ts +1 -1
  93. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  94. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  95. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  96. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  97. package/lib/components/eftposPay/device.d.ts +1 -1
  98. package/lib/components/eftposPay/hooks.d.ts +2 -2
  99. package/lib/components/eftposPay/store/index.d.ts +6 -6
  100. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  101. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  102. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  103. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  104. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  105. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  106. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  107. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
  108. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  109. package/lib/components/systemSettings/registry/components/SectionList.js +4 -1
  110. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  111. package/lib/components/ticketBooking/utils/index.js +9 -4
  112. package/lib/components/wallet/Detail/index.js +31 -3
  113. package/lib/components/wallet/Detail/index.less +11 -0
  114. package/lib/components/wallet/Detail/locales.d.ts +6 -0
  115. package/lib/components/wallet/Detail/locales.js +14 -2
  116. package/lib/components/wallet/Voucher/index.js +8 -8
  117. package/lib/components/wallet/components/WalletCard.js +4 -0
  118. package/lib/components/wallet/index.js +2 -2
  119. package/lib/components/wallet/serve.d.ts +7 -0
  120. package/lib/components/wallet/utils.d.ts +48 -0
  121. package/lib/components/wallet/utils.js +287 -0
  122. package/lib/index.d.ts +1 -0
  123. package/lib/index.js +3 -0
  124. package/lib/plus/clientName/index.d.ts +1 -0
  125. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
  126. package/lib/plus/walletPassGallery/components/passDetail/index.js +50 -14
  127. package/lib/plus/walletPassGallery/index.js +4 -2
  128. package/lib/plus/walletPassGallery/serve.d.ts +3 -0
  129. package/lib/plus/walletPassGallery/serve.js +3 -2
  130. package/lib/pro/Login2.0/AuthModal.js +15 -7
  131. package/lib/pro/Login2.0/index.less +7 -7
  132. package/lib/pro/pisellPaymentList/example.d.ts +1 -0
  133. package/lowcode/wallet-pass-detail/meta.ts +89 -0
  134. package/package.json +3 -3
@@ -153,6 +153,7 @@ export declare const getIsOnlySession: (item: any) => boolean;
153
153
  * @Date: 2024-01-26 14:09
154
154
  */
155
155
  export declare const getServerItemExtend: (state: any, cacheItem: any, timeObj: any) => any;
156
+ export declare const getMainPrice: (item: any, price?: number) => number;
156
157
  export declare const getProductTotalPrice: (item: any) => number;
157
158
  /**
158
159
  * @title: 判断 duration
@@ -165,10 +166,10 @@ export declare const getProductTotalPrice: (item: any) => number;
165
166
  export declare const getDuration: (duration: number | {
166
167
  type: string;
167
168
  value: number;
168
- }) => number | {
169
+ }) => number | "flexible" | {
169
170
  type: string;
170
171
  value: number;
171
- } | "flexible";
172
+ };
172
173
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
173
174
  export declare const getIsEdit: (state: any) => boolean;
174
175
  export {};
@@ -18,6 +18,7 @@ import { locales } from '@pisell/utils';
18
18
  import { isDayBooking, formatDayDate } from "./info/service2/utils";
19
19
  import { intersectionBy } from 'lodash';
20
20
  import { getAppointmentTimingPreference } from "./info2/utilsByBooking";
21
+ import Decimal from "decimal.js";
21
22
  var Request = /*#__PURE__*/function () {
22
23
  function Request() {
23
24
  _classCallCheck(this, Request);
@@ -754,11 +755,24 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
754
755
  return _extend;
755
756
  };
756
757
 
758
+ // 获取主商品价格 包含组合规格
759
+ export var getMainPrice = function getMainPrice(item, price) {
760
+ var _item$_extend;
761
+ var newPrice = new Decimal(price || item._extend.price || 0);
762
+ var other = (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.other;
763
+
764
+ // 多规格
765
+ if (other !== null && other !== void 0 && other.product_variant_id) {
766
+ newPrice = new Decimal((other === null || other === void 0 ? void 0 : other.price) || 0);
767
+ }
768
+ return newPrice.toNumber();
769
+ };
770
+
757
771
  // 商品价格: (商品价格 + (套餐价格 + 单规格价格 * 单规格数量) * 套餐数量 + 单规格价格 * 单规格数量) * 商品数量
758
772
  export var getProductTotalPrice = function getProductTotalPrice(item) {
759
- var _item$_extend;
773
+ var _item$_extend2;
760
774
  var price = Number(item._extend.price);
761
- var other = (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.other;
775
+ var other = (_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.other;
762
776
 
763
777
  // 多规格
764
778
  if (other !== null && other !== void 0 && other.product_variant_id) {
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ input, ...formItemProps }: any) => JSX.Element;
2
3
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 递归循环表单数据
3
4
  * @Author: hongbing.wang
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { RadioGroupProps } from 'antd';
2
3
  export declare const CheckboxGroup: ({ direction, options, ...props }: any) => JSX.Element;
3
4
  export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Eftpos } from './const';
2
3
  /**
3
4
  * @title: tyro 设备连接
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ color }: {
2
3
  color?: string | undefined;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ color }: {
2
3
  color?: string | undefined;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 自定义组件设置
3
4
  * @description: 自定义组件设置
@@ -8,7 +8,7 @@ import { PosProps } from './const';
8
8
  */
9
9
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
10
10
  className?: string | undefined;
11
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
11
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
12
  [keys: string]: unknown;
13
13
  } | undefined, other?: any) => void) | undefined;
14
14
  onClose: () => void;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: () => JSX.Element;
2
3
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './titlebar.less';
2
3
  declare enum EPopupTitleBarVariantType {
3
4
  BackTitleClose = "back-title-cancel",
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { StatusType } from '../../const';
2
3
  declare const _default: (props: {
3
4
  status: StatusType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: (props: {
2
3
  status: string;
3
4
  pedding?: string;
@@ -10,7 +10,7 @@ import './device.less';
10
10
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
11
11
  api: PayProps['api'];
12
12
  className?: string | undefined;
13
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
13
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
14
  [keys: string]: unknown;
15
15
  } | undefined, other?: any) => void) | undefined;
16
16
  onClose: () => void;
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
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<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
174
174
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
175
175
  type: EActionTypes;
176
176
  payload: {
177
- status: "success" | "warn" | "loading" | "fail" | "question";
177
+ status: "loading" | "success" | "warn" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -295,20 +295,20 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
298
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
301
- action?: "amount" | "deviceList" | "pay" | undefined;
300
+ eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
301
+ action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
305
305
  subTitle?: string | undefined;
306
- type?: "step" | "unset" | undefined;
306
+ type?: "unset" | "step" | undefined;
307
307
  render?: boolean | undefined;
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
310
310
  form?: string | undefined;
311
- status?: "success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
312
312
  warn?: string | undefined;
313
313
  steps?: {
314
314
  /** 用于重置当前步骤 */
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 获取 Tyro 资源
3
4
  * @description:
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Deposit: () => JSX.Element;
2
3
  export default Deposit;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const DayItem: (props: any) => JSX.Element;
3
4
  export default DayItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  import { CalendarItemProps } from '../../../../../type';
3
4
  declare const Item: (props: CalendarItemProps) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const StripeSDK: ({ public_key, client_secret, children, lang, }: {
2
3
  public_key: string;
3
4
  client_secret?: string | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.module.less';
2
3
  declare const StripePayment: () => JSX.Element;
3
4
  export default StripePayment;
@@ -50,6 +50,12 @@ export declare type WalletPassDataType = {
50
50
  shop: Shop;
51
51
  wallet_pass_usage?: any;
52
52
  balance_par_value: string;
53
+ custom_schedule_snapshot?: {
54
+ data: any[];
55
+ };
56
+ metadata?: {
57
+ validity_type: string;
58
+ };
53
59
  };
54
60
  declare type Shop = {
55
61
  id: number;
@@ -11,7 +11,7 @@ var voucherTime = function voucherTime(data) {
11
11
  export var formatMachineCodeServer2CardList = function formatMachineCodeServer2CardList(data) {
12
12
  var selectId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
13
13
  return (data || []).map(function (item) {
14
- var _item$shop, _item$unified_message, _item$product;
14
+ var _item$shop, _item$unified_message, _item$product, _item$custom_schedule, _item$metadata;
15
15
  return {
16
16
  id: item.id,
17
17
  name: item.product_name,
@@ -30,7 +30,9 @@ export var formatMachineCodeServer2CardList = function formatMachineCodeServer2C
30
30
  cover: (_item$product = item.product) === null || _item$product === void 0 ? void 0 : _item$product.cover,
31
31
  qrCode: item.code,
32
32
  validDate: voucherTime(item),
33
- originData: item
33
+ originData: item,
34
+ scheduleList: ((_item$custom_schedule = item.custom_schedule_snapshot) === null || _item$custom_schedule === void 0 ? void 0 : _item$custom_schedule.data) || [],
35
+ validDateBySchedule: ((_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.validity_type) === 'custom_schedule_validity'
34
36
  };
35
37
  });
36
38
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const RelationProduct: ({ value, onChange, }: {
3
4
  value?: any;
@@ -3,6 +3,8 @@ import { Card, Empty, Spin } from 'antd';
3
3
  import { ShoppingCartOutlined, CreditCardOutlined, SafetyCertificateOutlined, SettingOutlined } from '@ant-design/icons';
4
4
  import { ShoppingCart01 } from '@pisell/icon';
5
5
  import { locales } from '@pisell/utils';
6
+ import useEngineContext from "../../../../hooks/useEngineContext";
7
+
6
8
  // 获取多语言文本的工具函数
7
9
  var getLocalizedText = function getLocalizedText(text) {
8
10
  var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zh-CN';
@@ -38,6 +40,7 @@ var renderSectionIcon = function renderSectionIcon(iconName, code) {
38
40
  return sectionIcons.default;
39
41
  };
40
42
  var SectionList = function SectionList(_ref) {
43
+ var _context$engine;
41
44
  var sections = _ref.sections,
42
45
  selectedSectionId = _ref.selectedSectionId,
43
46
  onSectionSelect = _ref.onSectionSelect,
@@ -48,9 +51,10 @@ var SectionList = function SectionList(_ref) {
48
51
  onLoadMore = _ref.onLoadMore;
49
52
  var scrollContainerRef = useRef(null);
50
53
  var loadingRef = useRef(null);
54
+ var context = useEngineContext();
51
55
 
52
56
  // 获取当前语言
53
- var currentLocale = localStorage.getItem('umi_locale') || 'zh-CN';
57
+ var currentLocale = (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || localStorage.getItem('umi_locale') || 'en';
54
58
 
55
59
  // 滚动加载更多的处理函数
56
60
  var handleScroll = useCallback(function () {
@@ -21,7 +21,7 @@ import { getUniqueId, locales, sendWarningLog } from '@pisell/utils';
21
21
  import React, { useEffect, useMemo, useRef, useState } from 'react';
22
22
  import { useMemoizedFn } from 'ahooks';
23
23
  import useEngineContext from "../../../../hooks/useEngineContext";
24
- import { isSessionProduct, request, getProductTotalPrice, getIsEject, getIsOnlySession } from "../../../booking/utils";
24
+ import { isSessionProduct, request, getProductTotalPrice, getIsEject, getIsOnlySession, getMainPrice } from "../../../booking/utils";
25
25
  import { getProductExtend } from "../../../booking/info2/service/addService/utils";
26
26
  import { holderId, isDaysBooking, isNormalProductByDurationSchedule } from "../../../booking/info/service2/utils";
27
27
  import { getIsBundleOrCombination, isBooking4Shop } from "../../../booking/info/utils";
@@ -378,12 +378,12 @@ var AddSerivce = function AddSerivce(props) {
378
378
  _extend: {
379
379
  start_date: state.date.value,
380
380
  quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
381
- price: _detail.price,
382
381
  product_name: item.title,
383
382
  other: other
384
383
  },
385
384
  new: 1
386
385
  });
386
+ cacheItem._extend.price = getMainPrice(_detail, _detail.price);
387
387
  _total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
388
388
  cacheItem._extend.total = _total;
389
389
  // 用于储存原价
@@ -475,7 +475,7 @@ var AddSerivce = function AddSerivce(props) {
475
475
  });
476
476
  onEdit === null || onEdit === void 0 || onEdit(cacheItem);
477
477
  }
478
- case 24:
478
+ case 25:
479
479
  case "end":
480
480
  return _context3.stop();
481
481
  }
@@ -1,5 +1,11 @@
1
1
  var _excluded = ["detail"];
2
2
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
3
9
  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; }
4
10
  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; }
5
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -126,20 +132,29 @@ export var addService = function addService(list, addItem, state) {
126
132
  // 是否设置过 只追加到第一个中
127
133
  var isSetCount = false;
128
134
  value = list.map(function (item) {
135
+ var _item$_extend;
129
136
  // 是否商品券折扣的商品
130
137
  var isGoodPassDiscountProduct = (item.discount_list || []).some(function (item) {
131
138
  return item.type === 'good_pass';
132
139
  });
133
- if (isSameProduct(item, addItem) && !isSetCount && !isGoodPassDiscountProduct) {
134
- var _item$_extend, _addItem$_extend, _item$_extend2;
140
+ // 子商品是否有商品券折扣的商品
141
+ var bundleDiscountList = [];
142
+ ((item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 || (_item$_extend = _item$_extend.other) === null || _item$_extend === void 0 ? void 0 : _item$_extend.bundle) || []).forEach(function (item) {
143
+ bundleDiscountList.push.apply(bundleDiscountList, _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
144
+ });
145
+ var isGoodPassBundleProduct = bundleDiscountList.some(function (item) {
146
+ return item.type === 'good_pass';
147
+ });
148
+ if (isSameProduct(item, addItem) && !isSetCount && !isGoodPassDiscountProduct && !isGoodPassBundleProduct) {
149
+ var _item$_extend2, _addItem$_extend, _item$_extend3;
135
150
  isNotSame = false;
136
- var quantity = ((item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.quantity) || 1) + ((addItem === null || addItem === void 0 || (_addItem$_extend = addItem._extend) === null || _addItem$_extend === void 0 ? void 0 : _addItem$_extend.quantity) || 1);
151
+ var quantity = ((item === null || item === void 0 || (_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.quantity) || 1) + ((addItem === null || addItem === void 0 || (_addItem$_extend = addItem._extend) === null || _addItem$_extend === void 0 ? void 0 : _addItem$_extend.quantity) || 1);
137
152
  count = quantity;
138
153
  isSetCount = true;
139
154
  return _objectSpread(_objectSpread({}, item), {}, {
140
155
  _extend: _objectSpread(_objectSpread({}, item._extend), {}, {
141
156
  quantity: quantity,
142
- other: _objectSpread(_objectSpread({}, ((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.other) || {}), {}, {
157
+ other: _objectSpread(_objectSpread({}, ((_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.other) || {}), {}, {
143
158
  quantity: quantity
144
159
  })
145
160
  })
@@ -206,11 +221,11 @@ export var getIsShowNumber = function getIsShowNumber(item, state) {
206
221
 
207
222
  // 生成服务key
208
223
  export var genServiceKey = function genServiceKey(item) {
209
- var _item$_extend3, _item$_extend4, _item$_extend5;
224
+ var _item$_extend4, _item$_extend5, _item$_extend6;
210
225
  var product_id = item.product_id;
211
- var durationKey = (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.duration;
212
- var start_time = (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.start_time;
213
- var total = (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.total;
226
+ var durationKey = (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.duration;
227
+ var start_time = (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.start_time;
228
+ var total = (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.total;
214
229
  var resourceKey = '';
215
230
  Object.values(item._extend.resource).forEach(function (resources) {
216
231
  resources.forEach(function (resource) {
@@ -22,6 +22,7 @@ import localeTexts from "./locales";
22
22
  import { getAssetList, getDetailApi } from "./serve";
23
23
  import { request } from "./../../../utils";
24
24
  import { WalletBar, FooterButtons, UsageRules } from "../components";
25
+ import { formatScheduleText } from "../utils";
25
26
  import "./index.less";
26
27
  var Text = Typography.Text;
27
28
 
@@ -54,7 +55,9 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
54
55
  _detail$expire_date = detail.expire_date,
55
56
  expire_date = _detail$expire_date === void 0 ? '' : _detail$expire_date,
56
57
  _detail$product = detail.product,
57
- product = _detail$product === void 0 ? {} : _detail$product;
58
+ product = _detail$product === void 0 ? {} : _detail$product,
59
+ custom_schedule_snapshot = detail.custom_schedule_snapshot;
60
+ console.log(detail, 'detail22');
58
61
  var _ref = product || {},
59
62
  _ref$description = _ref.description,
60
63
  description = _ref$description === void 0 ? '' : _ref$description,
@@ -298,7 +301,36 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
298
301
  onGoogleClick();
299
302
  }
300
303
  };
304
+ var scheduleList = useMemo(function () {
305
+ return (custom_schedule_snapshot === null || custom_schedule_snapshot === void 0 ? void 0 : custom_schedule_snapshot.data) || [];
306
+ }, [custom_schedule_snapshot]);
301
307
  useEffect(function () {
308
+ var detail = formatScheduleText(scheduleList, 'zh-CN');
309
+ var expireText = expire_date ? expire_date : locales.getText('page.wallet.expireDate');
310
+ if (scheduleList.length > 0) {
311
+ // 换行展示
312
+ var validityTexts = "";
313
+ var excludedText = "";
314
+ var includedText = "";
315
+ detail.forEach(function (item) {
316
+ if (item.validityTexts.length > 0) {
317
+ validityTexts = "".concat(validityTexts).concat(item.validityTexts.join('\n'), "\n");
318
+ }
319
+ if (item.excluded_date.length > 0) {
320
+ excludedText = "".concat(excludedText).concat(item.excluded_date.join('\n'), "\n");
321
+ }
322
+ if (item.included_date.length > 0) {
323
+ includedText = "".concat(includedText).concat(item.included_date.join('\n'), "\n");
324
+ }
325
+ });
326
+ expireText = /*#__PURE__*/React.createElement("span", {
327
+ className: "wallet-detail-expire-text"
328
+ }, validityTexts, excludedText && /*#__PURE__*/React.createElement("div", {
329
+ className: "wallet-detail-expire-text-title"
330
+ }, locales.getText('page.wallet.notValidDate')), excludedText, includedText && /*#__PURE__*/React.createElement("div", {
331
+ className: "wallet-detail-expire-text-title"
332
+ }, locales.getText('page.wallet.includedDate')), includedText);
333
+ }
302
334
  var data = [{
303
335
  label: locales.getText('page.wallet.cardName'),
304
336
  value: product_title
@@ -308,7 +340,7 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
308
340
  isLink: false
309
341
  }, {
310
342
  label: locales.getText('page.wallet.validDate'),
311
- value: expire_date ? expire_date : locales.getText('page.wallet.expireDate')
343
+ value: expireText
312
344
  }];
313
345
  //折扣卡显示折扣字段 其他显示余额字段
314
346
  if (tag === 'product_discount_card') {
@@ -373,3 +373,14 @@
373
373
  font-weight: 500;
374
374
  line-height: 24px;
375
375
  }
376
+
377
+ .wallet-detail-expire-text {
378
+ white-space: pre-wrap;
379
+ }
380
+
381
+ .wallet-detail-expire-text-title {
382
+ font-size: 14px;
383
+ font-weight: 500;
384
+ line-height: 20px;
385
+ color: #667085;
386
+ }
@@ -21,6 +21,8 @@ declare const _default: {
21
21
  'page.wallet.addGoogle': string;
22
22
  'page.wallet.viewDetails': string;
23
23
  'page.wallet.expireDate': string;
24
+ 'page.wallet.notValidDate': string;
25
+ 'page.wallet.includedDate': string;
24
26
  'page.wallet.urlEmpty': string;
25
27
  'page.wallet.notIOS': string;
26
28
  'page.wallet.addSuccess': string;
@@ -69,6 +71,8 @@ declare const _default: {
69
71
  'page.wallet.addGoogle': string;
70
72
  'page.wallet.viewDetails': string;
71
73
  'page.wallet.expireDate': string;
74
+ 'page.wallet.notValidDate': string;
75
+ 'page.wallet.includedDate': string;
72
76
  'page.wallet.urlEmpty': string;
73
77
  'page.wallet.notIOS': string;
74
78
  'page.wallet.addSuccess': string;
@@ -117,6 +121,8 @@ declare const _default: {
117
121
  'page.wallet.addGoogle': string;
118
122
  'page.wallet.viewDetails': string;
119
123
  'page.wallet.expireDate': string;
124
+ 'page.wallet.notValidDate': string;
125
+ 'page.wallet.includedDate': string;
120
126
  'page.wallet.urlEmpty': string;
121
127
  'page.wallet.notIOS': string;
122
128
  'page.wallet.addSuccess': string;
@@ -24,6 +24,10 @@ export default {
24
24
  'page.wallet.addGoogle': 'Add to Google Wallet',
25
25
  'page.wallet.viewDetails': 'See details',
26
26
  'page.wallet.expireDate': 'Long term',
27
+ 'page.wallet.notValidDate': 'Not valid on',
28
+ // 不可用日期
29
+ 'page.wallet.includedDate': 'Included dates',
30
+ // 包含日期
27
31
  'page.wallet.urlEmpty': 'Wallet link is empty',
28
32
  'page.wallet.notIOS': 'Apple Wallet is not supported on non-iOS devices',
29
33
  'page.wallet.addSuccess': 'Successfully added to wallet',
@@ -76,6 +80,10 @@ export default {
76
80
  'page.wallet.addGoogle': '添加到谷歌钱包',
77
81
  'page.wallet.viewDetails': '查看详情',
78
82
  'page.wallet.expireDate': '长期',
83
+ 'page.wallet.notValidDate': '不可用日期',
84
+ // 不可用日期
85
+ 'page.wallet.includedDate': '包含日期',
86
+ // 包含日期
79
87
  'page.wallet.urlEmpty': '钱包链接为空',
80
88
  'page.wallet.notIOS': '非iOS设备不支持Apple Wallet',
81
89
  'page.wallet.addSuccess': '已成功添加到钱包',
@@ -87,7 +95,7 @@ export default {
87
95
  // Usage Rules
88
96
  'page.wallet.usageRules': '使用规则',
89
97
  'page.wallet.usageRulesSubtitle': '请仔细阅读以下使用条件',
90
- 'page.wallet.timeUsageLimits': '时间使用限制',
98
+ 'page.wallet.timeUsageLimits': '使用频次限制',
91
99
  'page.wallet.totalQuantityControl': '总量控制',
92
100
  'page.wallet.dailyLimit': '每日限制:',
93
101
  'page.wallet.weeklyLimit': '每周限制:',
@@ -128,6 +136,10 @@ export default {
128
136
  'page.wallet.addGoogle': '添加到谷歌錢包',
129
137
  'page.wallet.viewDetails': '查看詳情',
130
138
  'page.wallet.expireDate': '長期',
139
+ 'page.wallet.notValidDate': '不可用日期',
140
+ // 不可用日期
141
+ 'page.wallet.includedDate': '包含日期',
142
+ // 包含日期
131
143
  'page.wallet.urlEmpty': '錢包連結為空',
132
144
  'page.wallet.notIOS': '非iOS設備不支持Apple Wallet',
133
145
  'page.wallet.addSuccess': '已成功添加到錢包',
@@ -139,7 +151,7 @@ export default {
139
151
  // Usage Rules
140
152
  'page.wallet.usageRules': '使用規則',
141
153
  'page.wallet.usageRulesSubtitle': '請仔細閱讀以下使用條件',
142
- 'page.wallet.timeUsageLimits': '時間使用限制',
154
+ 'page.wallet.timeUsageLimits': '使用頻次限制',
143
155
  'page.wallet.totalQuantityControl': '總量控制',
144
156
  'page.wallet.dailyLimit': '每日限制:',
145
157
  'page.wallet.weeklyLimit': '每週限制:',
@@ -48,6 +48,17 @@ var Voucher = Provider(function (props) {
48
48
  }
49
49
  }, [globalState.setup]);
50
50
 
51
+ // 添加处理后退按钮的方法
52
+ var handleBack = useCallback(function () {
53
+ if (recordViewRef.current) {
54
+ recordViewRef.current.closeDetailModal();
55
+ }
56
+ // 更新状态
57
+ setGlobalState({
58
+ setup: 'list'
59
+ });
60
+ }, [recordViewRef, setGlobalState]);
61
+
51
62
  // 渲染卡片项
52
63
  var renderItem = function renderItem(item) {
53
64
  return /*#__PURE__*/React.createElement(WalletCard, {
@@ -67,16 +78,6 @@ var Voucher = Provider(function (props) {
67
78
  if (isEmpty) {
68
79
  return /*#__PURE__*/React.createElement(PisellEmpty, null);
69
80
  }
70
- // 添加处理后退按钮的方法
71
- var handleBack = useCallback(function () {
72
- if (recordViewRef.current) {
73
- recordViewRef.current.closeDetailModal();
74
- }
75
- // 更新状态
76
- setGlobalState({
77
- setup: 'list'
78
- });
79
- }, [recordViewRef, setGlobalState]);
80
81
  return /*#__PURE__*/React.createElement(React.Fragment, null, platform !== 'pc' && /*#__PURE__*/React.createElement(Title, {
81
82
  className: "wallet-voucher-title"
82
83
  }, locales.getText('page.wallet.voucher')), /*#__PURE__*/React.createElement(CardMetricItem, {
@@ -1,4 +1,4 @@
1
- var _excluded = ["id", "tag", "product_title", "balance", "code", "encoded", "expire_date", "shop", "limit_status", "product_cover", "par_value", "unified_messages"];
1
+ var _excluded = ["id", "tag", "product_title", "balance", "code", "encoded", "expire_date", "shop", "limit_status", "product_cover", "par_value", "unified_messages", "custom_schedule_snapshot", "metadata"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  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; }
4
4
  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; }
@@ -40,6 +40,8 @@ var WalletCard = function WalletCard(_ref) {
40
40
  par_value = _item$par_value === void 0 ? '' : _item$par_value,
41
41
  _item$unified_message = item.unified_messages,
42
42
  unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message,
43
+ custom_schedule_snapshot = item.custom_schedule_snapshot,
44
+ metadata = item.metadata,
43
45
  rest = _objectWithoutProperties(item, _excluded);
44
46
 
45
47
  // 获取平台
@@ -58,6 +60,8 @@ var WalletCard = function WalletCard(_ref) {
58
60
  // 是否禁用
59
61
  var isDisabled = limit_status !== 'enable';
60
62
  return /*#__PURE__*/React.createElement(PisellWalletPassCard, _extends({}, rest, {
63
+ scheduleList: (custom_schedule_snapshot === null || custom_schedule_snapshot === void 0 ? void 0 : custom_schedule_snapshot.data) || [],
64
+ validDateBySchedule: (metadata === null || metadata === void 0 ? void 0 : metadata.validity_type) === 'custom_schedule_validity',
61
65
  balanceTitle: balanceTitle,
62
66
  showDetail: false,
63
67
  showRedeem: false,