@pisell/private-materials 3.4.21 → 3.4.23

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 (173) 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 +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/businessModel/SalesModel/index.d.ts +0 -1
  12. package/es/components/Sales/Summary/utils.d.ts +1 -1
  13. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +27 -3
  14. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
  15. package/es/components/appointmentBooking/components/Content/index.js +3 -3
  16. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  17. package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  18. package/es/components/appointmentBooking/components/Voucher/index.js +6 -5
  19. package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
  20. package/es/components/appointmentBooking/hooks.js +4 -2
  21. package/es/components/appointmentBooking/index.d.ts +0 -1
  22. package/es/components/appointmentBooking/index.js +10 -0
  23. package/es/components/booking/addons/model.d.ts +10 -1
  24. package/es/components/booking/components/voucher/index.js +8 -5
  25. package/es/components/booking/deposit/index.d.ts +0 -1
  26. package/es/components/booking/forms/model.d.ts +10 -1
  27. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  28. package/es/components/booking/info/header/index.d.ts +0 -1
  29. package/es/components/booking/info/index.d.ts +0 -1
  30. package/es/components/booking/info/model.d.ts +10 -1
  31. package/es/components/booking/info/service/addService/index.d.ts +0 -1
  32. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  33. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  34. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  35. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  36. package/es/components/booking/info2/index.js +1 -1
  37. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  38. package/es/components/booking/model.d.ts +9 -1
  39. package/es/components/booking/notes/model.d.ts +10 -1
  40. package/es/components/booking/payments/model.d.ts +10 -1
  41. package/es/components/booking/utils.d.ts +2 -2
  42. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  43. package/es/components/eftposPay/amount.d.ts +1 -1
  44. package/es/components/eftposPay/app.d.ts +0 -1
  45. package/es/components/eftposPay/device.d.ts +1 -2
  46. package/es/components/eftposPay/hooks.d.ts +1 -1
  47. package/es/components/eftposPay/index.d.ts +0 -1
  48. package/es/components/eftposPay/linkly/index.d.ts +0 -1
  49. package/es/components/eftposPay/store/index.d.ts +2 -2
  50. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -1
  51. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +34 -8
  52. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  53. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  54. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  55. package/es/components/eventBooking/index.d.ts +0 -1
  56. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
  57. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  58. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  59. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  60. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  61. package/es/components/pay/toC/model.d.ts +9 -1
  62. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  63. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  64. package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
  65. package/es/components/productExtension/index.d.ts +0 -1
  66. package/es/components/ruleSetting/index.d.ts +0 -1
  67. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  68. package/es/components/schedules/model.d.ts +9 -1
  69. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
  70. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
  71. package/es/components/taxSelect/index.d.ts +0 -1
  72. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  73. package/es/components/ticketBooking/components/menuBar/index.d.ts +0 -1
  74. package/es/components/ticketBooking/components/ticketBooking/index.js +2 -0
  75. package/es/components/wallet/Detail/index.js +248 -62
  76. package/es/components/wallet/Detail/locales.d.ts +51 -0
  77. package/es/components/wallet/Detail/locales.js +57 -3
  78. package/es/components/wallet/Detail/model.d.ts +13 -1
  79. package/es/components/wallet/Detail/serve.js +5 -1
  80. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  81. package/es/components/wallet/PointCard/model.d.ts +13 -1
  82. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  83. package/es/components/wallet/Voucher/model.d.ts +13 -1
  84. package/es/components/wallet/components/UsageRules/index.d.ts +23 -0
  85. package/es/components/wallet/components/UsageRules/index.js +147 -0
  86. package/es/components/wallet/components/UsageRules/index.less +157 -0
  87. package/es/components/wallet/components/index.d.ts +1 -0
  88. package/es/components/wallet/components/index.js +2 -1
  89. package/es/components/wallet/model.d.ts +9 -1
  90. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  91. package/es/plus/saasCreateOrganization/index.d.ts +0 -1
  92. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  93. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  94. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +22 -2
  95. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
  96. package/lib/components/appointmentBooking/components/Content/index.js +2 -2
  97. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  98. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  99. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  100. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
  101. package/lib/components/appointmentBooking/hooks.js +4 -2
  102. package/lib/components/appointmentBooking/index.d.ts +0 -1
  103. package/lib/components/appointmentBooking/index.js +6 -0
  104. package/lib/components/booking/addons/model.d.ts +10 -1
  105. package/lib/components/booking/components/voucher/index.js +3 -1
  106. package/lib/components/booking/deposit/index.d.ts +0 -1
  107. package/lib/components/booking/forms/model.d.ts +10 -1
  108. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  109. package/lib/components/booking/info/header/index.d.ts +0 -1
  110. package/lib/components/booking/info/index.d.ts +0 -1
  111. package/lib/components/booking/info/model.d.ts +10 -1
  112. package/lib/components/booking/info/service/addService/index.d.ts +0 -1
  113. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  114. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  115. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  116. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  117. package/lib/components/booking/info2/index.js +0 -1
  118. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  119. package/lib/components/booking/model.d.ts +9 -1
  120. package/lib/components/booking/notes/model.d.ts +10 -1
  121. package/lib/components/booking/payments/model.d.ts +10 -1
  122. package/lib/components/booking/utils.d.ts +2 -2
  123. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  124. package/lib/components/eftposPay/amount.d.ts +1 -1
  125. package/lib/components/eftposPay/app.d.ts +0 -1
  126. package/lib/components/eftposPay/device.d.ts +1 -2
  127. package/lib/components/eftposPay/hooks.d.ts +1 -1
  128. package/lib/components/eftposPay/index.d.ts +0 -1
  129. package/lib/components/eftposPay/linkly/index.d.ts +0 -1
  130. package/lib/components/eftposPay/store/index.d.ts +2 -2
  131. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -1
  132. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +30 -8
  133. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  134. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  135. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  136. package/lib/components/eventBooking/index.d.ts +0 -1
  137. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
  138. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  139. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  140. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  141. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  142. package/lib/components/pay/toC/model.d.ts +9 -1
  143. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  144. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  145. package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
  146. package/lib/components/productExtension/index.d.ts +0 -1
  147. package/lib/components/ruleSetting/index.d.ts +0 -1
  148. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  149. package/lib/components/schedules/model.d.ts +9 -1
  150. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
  151. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
  152. package/lib/components/taxSelect/index.d.ts +0 -1
  153. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  154. package/lib/components/ticketBooking/components/menuBar/index.d.ts +0 -1
  155. package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -0
  156. package/lib/components/wallet/Detail/index.js +125 -6
  157. package/lib/components/wallet/Detail/locales.d.ts +51 -0
  158. package/lib/components/wallet/Detail/locales.js +57 -3
  159. package/lib/components/wallet/Detail/model.d.ts +13 -1
  160. package/lib/components/wallet/Detail/serve.js +6 -1
  161. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  162. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  163. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  164. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  165. package/lib/components/wallet/components/UsageRules/index.d.ts +23 -0
  166. package/lib/components/wallet/components/UsageRules/index.js +113 -0
  167. package/lib/components/wallet/components/UsageRules/index.less +157 -0
  168. package/lib/components/wallet/components/index.d.ts +1 -0
  169. package/lib/components/wallet/components/index.js +3 -0
  170. package/lib/components/wallet/model.d.ts +9 -1
  171. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  172. package/lib/plus/saasCreateOrganization/index.d.ts +0 -1
  173. package/package.json +2 -2
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem } from '../../type';
3
2
  declare type CalendarItemProps = {
4
3
  month: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const EventBooking: () => JSX.Element;
4
3
  export default EventBooking;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ThreedsLoading: ({ title, showSuccessBackButton, onSuccessBack }: any) => JSX.Element;
4
3
  export default ThreedsLoading;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const StripePayment: () => JSX.Element;
3
2
  export default StripePayment;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const StripeSDK: ({ public_key, client_secret, children, lang, }: {
3
2
  public_key: string;
4
3
  client_secret?: string | undefined;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const PageLoading: () => JSX.Element;
3
2
  export default PageLoading;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const PaymentRequestForm: () => JSX.Element | null;
3
2
  export default PaymentRequestForm;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  platform: 'pc' | 'h5' | '' | undefined;
3
4
  order: any;
@@ -28,4 +29,11 @@ export interface PayGroup {
28
29
  pay_number?: string;
29
30
  _order: any;
30
31
  }
31
- export declare const Provider: any, Context: any;
32
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
33
+ state: FormState;
34
+ } & {
35
+ dispatch: (params: {
36
+ type: string;
37
+ payload: any;
38
+ }) => void;
39
+ }>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const PhoneField: ({ value, onChange }: any) => JSX.Element;
3
2
  export default PhoneField;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  interface RightPanelProps {
4
3
  value: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PopoverProps } from 'antd';
3
2
  import { CustomerCardProps } from './CustomerCard';
4
3
  import './index.less';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  interface ProductExtensionProps {
4
3
  onDataChange: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  interface RuleSettingProps {
4
3
  value: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  import { ScheduleItem } from '../../../type';
4
3
  declare type Item = any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,4 +69,11 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: any, Context: any;
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
+ }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const AddSchedules: ({ value, onChange, drawerContainer, isSelf }: any) => JSX.Element;
4
3
  export default AddSchedules;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare type Value = number[];
4
3
  declare const SchedulesModule: ({ value, onChange, drawerContainer, ruleFn, tabKey, previewItemChange, isSelf, isTitle, }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SelectProps } from "antd";
3
2
  import "./index.less";
4
3
  interface TaxSelectProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface AddServiceVariantProps {
3
2
  globalState: any;
4
3
  setGlobalState: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const index: () => JSX.Element;
4
3
  export default index;
@@ -188,6 +188,8 @@ var TicketBooking = function TicketBooking() {
188
188
  var _callbackFnRef = useRef();
189
189
  useEffect(function () {
190
190
  var _interaction$utils, _store$getState, _interaction$utils2, _interaction$utils3;
191
+ // bellaswonderland.mypisell.com localStorage可能满了
192
+ localStorage.removeItem('bookingResourceList');
191
193
  _persistentRef.current = storage.get("drawer-booking") === 'true' ? true : isTerminal();
192
194
  if (lowcodeRef) {
193
195
  lowcodeRef.onReady(_this);
@@ -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 = [{
@@ -231,7 +377,7 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
231
377
  };
232
378
  var getDetail = /*#__PURE__*/function () {
233
379
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
234
- var _yield$getDetailApi, _yield$getDetailApi$a, apple_wallet_url, _yield$getDetailApi$g, google_wallet_url;
380
+ 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
381
  return _regeneratorRuntime().wrap(function _callee$(_context) {
236
382
  while (1) switch (_context.prev = _context.next) {
237
383
  case 0:
@@ -245,9 +391,46 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
245
391
  apple_wallet_url = _yield$getDetailApi$a === void 0 ? '' : _yield$getDetailApi$a;
246
392
  _yield$getDetailApi$g = _yield$getDetailApi.google_wallet_url;
247
393
  google_wallet_url = _yield$getDetailApi$g === void 0 ? '' : _yield$getDetailApi$g;
394
+ _yield$getDetailApi$e = _yield$getDetailApi.extension_data;
395
+ extension_data = _yield$getDetailApi$e === void 0 ? [] : _yield$getDetailApi$e;
396
+ _yield$getDetailApi$c = _yield$getDetailApi.customer_order_behavior_count;
397
+ customer_order_behavior_count = _yield$getDetailApi$c === void 0 ? 0 : _yield$getDetailApi$c;
398
+ _yield$getDetailApi$t = _yield$getDetailApi.total_order_behavior_count;
399
+ total_order_behavior_count = _yield$getDetailApi$t === void 0 ? 0 : _yield$getDetailApi$t;
400
+ _yield$getDetailApi$t2 = _yield$getDetailApi.today_order_behavior_count;
401
+ today_order_behavior_count = _yield$getDetailApi$t2 === void 0 ? 0 : _yield$getDetailApi$t2;
402
+ _yield$getDetailApi$w = _yield$getDetailApi.week_order_behavior_count;
403
+ week_order_behavior_count = _yield$getDetailApi$w === void 0 ? 0 : _yield$getDetailApi$w;
404
+ _yield$getDetailApi$m = _yield$getDetailApi.month_order_behavior_count;
405
+ month_order_behavior_count = _yield$getDetailApi$m === void 0 ? 0 : _yield$getDetailApi$m;
248
406
  setAppleWalletUrl(apple_wallet_url);
249
407
  setGoogleWalletUrl(google_wallet_url);
250
- case 9:
408
+
409
+ // 存储从详情接口获取的字段
410
+ setExtensionData(extension_data);
411
+ setCustomerOrderBehaviorCount(customer_order_behavior_count);
412
+ setTotalOrderBehaviorCount(total_order_behavior_count);
413
+ setTodayOrderBehaviorCount(today_order_behavior_count);
414
+ setWeekOrderBehaviorCount(week_order_behavior_count);
415
+ setMonthOrderBehaviorCount(month_order_behavior_count);
416
+
417
+ // 处理使用规则数据
418
+ if (Array.isArray(extension_data) && extension_data.length > 0) {
419
+ usageCreditsItem = extension_data.find(function (item) {
420
+ return item.field_key === 'usage_credits';
421
+ });
422
+ if (usageCreditsItem !== null && usageCreditsItem !== void 0 && usageCreditsItem.value) {
423
+ setUsageCreditsData(usageCreditsItem.value);
424
+ setShouldShowUsageRules(true);
425
+ } else {
426
+ setUsageCreditsData(null);
427
+ setShouldShowUsageRules(false);
428
+ }
429
+ } else {
430
+ setUsageCreditsData(null);
431
+ setShouldShowUsageRules(false);
432
+ }
433
+ case 28:
251
434
  case "end":
252
435
  return _context.stop();
253
436
  }
@@ -257,6 +440,8 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
257
440
  return _ref3.apply(this, arguments);
258
441
  };
259
442
  }();
443
+
444
+ // 当切换商品卡时,获取新的详情数据
260
445
  useEffect(function () {
261
446
  if (detail.id) {
262
447
  getDetail();
@@ -718,10 +903,10 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
718
903
 
719
904
  // 添加ref用于获取容器元素
720
905
  var detailWrapperRef = useRef(null);
721
- var _useState29 = useState(undefined),
722
- _useState30 = _slicedToArray(_useState29, 2),
723
- contentHeight = _useState30[0],
724
- setContentHeight = _useState30[1];
906
+ var _useState45 = useState(undefined),
907
+ _useState46 = _slicedToArray(_useState45, 2),
908
+ contentHeight = _useState46[0],
909
+ setContentHeight = _useState46[1];
725
910
 
726
911
  // 添加锚点导航ref
727
912
  var anchorWrapperRef = useRef(null);
@@ -860,16 +1045,17 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
860
1045
  valueColor: "#101828",
861
1046
  backgroundColors: ['#fff'],
862
1047
  isHasBorder: false
863
- }), /*#__PURE__*/React.createElement("div", {
1048
+ }), description && /*#__PURE__*/React.createElement("div", {
864
1049
  className: "wallet-detail-card-content-tip"
865
- }, description ?
866
- /*#__PURE__*/
867
- // @ts-ignore 忽略TypeScript错误,React类型定义问题
868
- React.createElement("div", {
1050
+ }, /*#__PURE__*/React.createElement("div", {
869
1051
  dangerouslySetInnerHTML: {
870
1052
  __html: description
871
1053
  }
872
- }) : null)), /*#__PURE__*/React.createElement("section", {
1054
+ })), shouldShowUsageRules && /*#__PURE__*/React.createElement(UsageRules, {
1055
+ locales: locales,
1056
+ rules: usageRules,
1057
+ personalLimit: personalLimit
1058
+ })), /*#__PURE__*/React.createElement("section", {
873
1059
  className: "wallet-detail-card-content-section wallet-detail-card-content-section-timeline",
874
1060
  "data-section": "activityLog"
875
1061
  }, tag !== 'product_discount_card' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
@@ -29,6 +29,23 @@ declare const _default: {
29
29
  'page.wallet.openedInBrowser': string;
30
30
  'page.wallet.openFailed': string;
31
31
  'page.wallet.loading': string;
32
+ 'page.wallet.usageRules': string;
33
+ 'page.wallet.usageRulesSubtitle': string;
34
+ 'page.wallet.timeUsageLimits': string;
35
+ 'page.wallet.totalQuantityControl': string;
36
+ 'page.wallet.dailyLimit': string;
37
+ 'page.wallet.weeklyLimit': string;
38
+ 'page.wallet.monthlyLimit': string;
39
+ 'page.wallet.personalLimit': string;
40
+ 'page.wallet.dailyLimitDesc': string;
41
+ 'page.wallet.weeklyLimitDesc': string;
42
+ 'page.wallet.monthlyLimitDesc': string;
43
+ 'page.wallet.monthlyLimitUnlimited': string;
44
+ 'page.wallet.personalLimitDesc': string;
45
+ 'page.wallet.dailyReset': string;
46
+ 'page.wallet.weeklyReset': string;
47
+ 'page.wallet.monthlyReset': string;
48
+ 'page.wallet.voucherExpireNote': string;
32
49
  };
33
50
  'zh-CN': {
34
51
  'page.wallet.copyTitle': string;
@@ -60,6 +77,23 @@ declare const _default: {
60
77
  'page.wallet.openedInBrowser': string;
61
78
  'page.wallet.openFailed': string;
62
79
  'page.wallet.loading': string;
80
+ 'page.wallet.usageRules': string;
81
+ 'page.wallet.usageRulesSubtitle': string;
82
+ 'page.wallet.timeUsageLimits': string;
83
+ 'page.wallet.totalQuantityControl': string;
84
+ 'page.wallet.dailyLimit': string;
85
+ 'page.wallet.weeklyLimit': string;
86
+ 'page.wallet.monthlyLimit': string;
87
+ 'page.wallet.personalLimit': string;
88
+ 'page.wallet.dailyLimitDesc': string;
89
+ 'page.wallet.weeklyLimitDesc': string;
90
+ 'page.wallet.monthlyLimitDesc': string;
91
+ 'page.wallet.monthlyLimitUnlimited': string;
92
+ 'page.wallet.personalLimitDesc': string;
93
+ 'page.wallet.dailyReset': string;
94
+ 'page.wallet.weeklyReset': string;
95
+ 'page.wallet.monthlyReset': string;
96
+ 'page.wallet.voucherExpireNote': string;
63
97
  };
64
98
  'zh-HK': {
65
99
  'page.wallet.copyTitle': string;
@@ -91,6 +125,23 @@ declare const _default: {
91
125
  'page.wallet.openedInBrowser': string;
92
126
  'page.wallet.openFailed': string;
93
127
  'page.wallet.loading': string;
128
+ 'page.wallet.usageRules': string;
129
+ 'page.wallet.usageRulesSubtitle': string;
130
+ 'page.wallet.timeUsageLimits': string;
131
+ 'page.wallet.totalQuantityControl': string;
132
+ 'page.wallet.dailyLimit': string;
133
+ 'page.wallet.weeklyLimit': string;
134
+ 'page.wallet.monthlyLimit': string;
135
+ 'page.wallet.personalLimit': string;
136
+ 'page.wallet.dailyLimitDesc': string;
137
+ 'page.wallet.weeklyLimitDesc': string;
138
+ 'page.wallet.monthlyLimitDesc': string;
139
+ 'page.wallet.monthlyLimitUnlimited': string;
140
+ 'page.wallet.personalLimitDesc': string;
141
+ 'page.wallet.dailyReset': string;
142
+ 'page.wallet.weeklyReset': string;
143
+ 'page.wallet.monthlyReset': string;
144
+ 'page.wallet.voucherExpireNote': string;
94
145
  };
95
146
  };
96
147
  export default _default;