@pisell/private-materials 3.4.37 → 3.4.39

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 (163) 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 +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/businessModel/SalesModel/index.d.ts +1 -0
  12. package/es/components/Sales/Event/Detail.js +4 -3
  13. package/es/components/Sales/Summary/utils.d.ts +1 -1
  14. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  16. package/es/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
  17. package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
  18. package/es/components/appointmentBooking/index.d.ts +1 -0
  19. package/es/components/booking/components/footer/index.d.ts +1 -0
  20. package/es/components/booking/deposit/index.d.ts +1 -0
  21. package/es/components/booking/hooks/useQuotation.d.ts +1 -0
  22. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  23. package/es/components/booking/info/header/index.d.ts +1 -0
  24. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  25. package/es/components/booking/info/index.d.ts +1 -0
  26. package/es/components/booking/info/service/Lists.d.ts +1 -0
  27. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  28. package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  29. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  30. package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
  31. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  32. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  33. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  34. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  35. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  36. package/es/components/booking/notes/addNote/index.d.ts +1 -0
  37. package/es/components/booking/utils.d.ts +2 -2
  38. package/es/components/eftpos/surcharge/index.d.ts +1 -0
  39. package/es/components/eftposPay/amount.d.ts +1 -1
  40. package/es/components/eftposPay/app.d.ts +1 -0
  41. package/es/components/eftposPay/device.d.ts +2 -1
  42. package/es/components/eftposPay/hooks.d.ts +1 -1
  43. package/es/components/eftposPay/index.d.ts +1 -0
  44. package/es/components/eftposPay/linkly/index.d.ts +1 -0
  45. package/es/components/eftposPay/store/index.d.ts +2 -2
  46. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
  47. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
  48. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  49. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  50. package/es/components/eventBooking/index.d.ts +1 -0
  51. package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +68 -35
  52. package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +70 -42
  53. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
  54. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  55. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  56. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  57. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  58. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +72 -41
  59. package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.d.ts +15 -0
  60. package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +143 -0
  61. package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +34 -0
  62. package/es/components/pay/toC/PaymentMethods/hooks/index.d.ts +19 -0
  63. package/es/components/pay/toC/PaymentMethods/hooks/index.js +126 -0
  64. package/es/components/pay/toC/index.js +3 -2
  65. package/es/components/pay/toC/locales.d.ts +9 -0
  66. package/es/components/pay/toC/locales.js +12 -3
  67. package/es/components/pay/toC/model.d.ts +1 -0
  68. package/es/components/pay/toC/serve.d.ts +5 -0
  69. package/es/components/pay/toC/serve.js +9 -1
  70. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  71. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  72. package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
  73. package/es/components/productExtension/index.d.ts +1 -0
  74. package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
  75. package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
  76. package/es/components/ruleSetting/index.d.ts +1 -0
  77. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  78. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  79. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  80. package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  81. package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
  82. package/es/components/taxSelect/index.d.ts +1 -0
  83. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  84. package/es/components/ticketBooking/components/menuBar/index.d.ts +1 -0
  85. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  86. package/es/plus/saasCreateOrganization/index.d.ts +1 -0
  87. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  88. package/lib/components/Sales/Event/Detail.js +3 -2
  89. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  90. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  91. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  92. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
  93. package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
  94. package/lib/components/appointmentBooking/index.d.ts +1 -0
  95. package/lib/components/booking/components/footer/index.d.ts +1 -0
  96. package/lib/components/booking/deposit/index.d.ts +1 -0
  97. package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
  98. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  99. package/lib/components/booking/info/header/index.d.ts +1 -0
  100. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  101. package/lib/components/booking/info/index.d.ts +1 -0
  102. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  103. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  104. package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  105. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  106. package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
  107. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  108. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  109. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  110. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  111. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  112. package/lib/components/booking/notes/addNote/index.d.ts +1 -0
  113. package/lib/components/booking/utils.d.ts +2 -2
  114. package/lib/components/eftpos/surcharge/index.d.ts +1 -0
  115. package/lib/components/eftposPay/amount.d.ts +1 -1
  116. package/lib/components/eftposPay/app.d.ts +1 -0
  117. package/lib/components/eftposPay/device.d.ts +2 -1
  118. package/lib/components/eftposPay/hooks.d.ts +1 -1
  119. package/lib/components/eftposPay/index.d.ts +1 -0
  120. package/lib/components/eftposPay/linkly/index.d.ts +1 -0
  121. package/lib/components/eftposPay/store/index.d.ts +2 -2
  122. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
  123. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
  124. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  125. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  126. package/lib/components/eventBooking/index.d.ts +1 -0
  127. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +27 -7
  128. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +32 -8
  129. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
  130. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  131. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  132. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  133. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  134. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +30 -4
  135. package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.d.ts +15 -0
  136. package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +88 -0
  137. package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +34 -0
  138. package/lib/components/pay/toC/PaymentMethods/hooks/index.d.ts +19 -0
  139. package/lib/components/pay/toC/PaymentMethods/hooks/index.js +90 -0
  140. package/lib/components/pay/toC/index.js +2 -1
  141. package/lib/components/pay/toC/locales.d.ts +9 -0
  142. package/lib/components/pay/toC/locales.js +12 -3
  143. package/lib/components/pay/toC/model.d.ts +1 -0
  144. package/lib/components/pay/toC/serve.d.ts +5 -0
  145. package/lib/components/pay/toC/serve.js +3 -0
  146. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  147. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  148. package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
  149. package/lib/components/productExtension/index.d.ts +1 -0
  150. package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
  151. package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
  152. package/lib/components/ruleSetting/index.d.ts +1 -0
  153. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  154. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  155. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  156. package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  157. package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
  158. package/lib/components/taxSelect/index.d.ts +1 -0
  159. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  160. package/lib/components/ticketBooking/components/menuBar/index.d.ts +1 -0
  161. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  162. package/lib/plus/saasCreateOrganization/index.d.ts +1 -0
  163. package/package.json +4 -4
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const SalesModel: ({ children, hooks, config }: any) => JSX.Element;
2
3
  export * from './Sales';
3
4
  export default SalesModel;
@@ -237,8 +237,9 @@ export var EventDetailProvider = function EventDetailProvider(_ref) {
237
237
  return v.value === id;
238
238
  })) === null || _bookingOptions$filte === void 0 ? void 0 : _bookingOptions$filte[0];
239
239
  var setSelectedData = function setSelectedData(data) {
240
+ var _detailRef$current4;
240
241
  _setDetail({
241
- introduction: _objectSpread(_objectSpread({}, introduction), {}, {
242
+ introduction: _objectSpread(_objectSpread({}, (detailRef === null || detailRef === void 0 || (_detailRef$current4 = detailRef.current) === null || _detailRef$current4 === void 0 ? void 0 : _detailRef$current4.introduction) || {}), {}, {
242
243
  price: data === null || data === void 0 ? void 0 : data.price,
243
244
  origin_price: data === null || data === void 0 ? void 0 : data.original_price
244
245
  }),
@@ -249,10 +250,10 @@ export var EventDetailProvider = function EventDetailProvider(_ref) {
249
250
 
250
251
  // 普通商品需要单独查询商品详情
251
252
  if ((option === null || option === void 0 || (_option$_originData = option._originData) === null || _option$_originData === void 0 ? void 0 : _option$_originData.is_eject) === 0) {
252
- var _introduction$_origin;
253
+ var _eventRef$current;
253
254
  getProductDetailRequest.runAsync(id, {
254
255
  open_deposit: 1,
255
- front_end_cache_id: (introduction === null || introduction === void 0 || (_introduction$_origin = introduction._originData) === null || _introduction$_origin === void 0 ? void 0 : _introduction$_origin.id) + '_' + id
256
+ front_end_cache_id: (eventRef === null || eventRef === void 0 || (_eventRef$current = eventRef.current) === null || _eventRef$current === void 0 ? void 0 : _eventRef$current.id) + '_' + id
256
257
  }).then(function (res) {
257
258
  var _res$data2;
258
259
  // 定金相关信息
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
30
30
  * @return {*}
31
31
  * @Author: xiangfeng.xue
32
32
  */
33
- export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
33
+ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
34
34
  /**
35
35
  * 计算所有价格明细
36
36
  * @param items - 购物车商品数组
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Layout: () => JSX.Element;
3
4
  export default Layout;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Header: () => JSX.Element;
3
4
  export default Header;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../../../booking/components/voucher/index.less';
2
3
  import './index.less';
3
4
  declare const VoucherCard: (props: any) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Deposit: (props: any) => JSX.Element;
3
4
  export default Deposit;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const AppointmentBooking: () => JSX.Element;
3
4
  export default AppointmentBooking;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  /**
3
4
  * @title: 底部
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Deposit: (props: any) => JSX.Element;
2
3
  export default Deposit;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const calculateTotalPrice: (data: any) => number;
2
3
  declare const useQuotation: (state: any, dispatch: any) => {
3
4
  dom: JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface AddServiceVariantProps {
2
3
  globalState: any;
3
4
  setGlobalState: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const header: ({ state, dispatch }: any) => JSX.Element;
3
4
  export default header;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { EditServiceRef } from "../service/editService";
2
3
  declare const useInfoHolder: (state: any, dispatch: any) => {
3
4
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { InfoProps } from './main';
2
3
  declare const APP: (props: InfoProps) => JSX.Element;
3
4
  export default APP;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
2
3
  export default Lists;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellDrawerProps } from '../../../components/drawer';
2
3
  import './index.less';
3
4
  interface AddServiceProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const AddTimeModal: () => JSX.Element;
3
4
  export default AddTimeModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const BookingList: ({ items }: {
2
3
  items: any[];
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, resourceItem, errorMessage, handleDeleteService, }: any) => JSX.Element;
3
4
  export default ServiceItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceList: ({ onEdit }: {
3
4
  onEdit: any;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
2
3
  export default Lists;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../../../info/service/addTimeModal/index.less';
2
3
  declare const AddTimeModal: () => JSX.Element;
3
4
  export default AddTimeModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, errorMessage, handleDeleteService, }: any) => JSX.Element;
3
4
  export default ServiceItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceList: ({ onEdit }: {
3
4
  onEdit: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const AddNote: ({ value, onChange, wait, title, placeholder }: any) => JSX.Element;
3
4
  export default AddNote;
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
165
165
  export declare const getDuration: (duration: number | {
166
166
  type: string;
167
167
  value: number;
168
- }) => number | "flexible" | {
168
+ }) => number | {
169
169
  type: string;
170
170
  value: number;
171
- };
171
+ } | "flexible";
172
172
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
173
173
  export declare const getIsEdit: (state: any) => boolean;
174
174
  export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.css';
2
3
  /**
3
4
  * @title: 自定义组件设置
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PosProps, RouteType } from './const';
2
3
  declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
3
4
  action: RouteType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PayProps, PosProps } from './const';
2
3
  import './device.less';
3
4
  /**
@@ -10,7 +11,7 @@ import './device.less';
10
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
11
12
  api: PayProps['api'];
12
13
  className?: string | undefined;
13
- onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
14
15
  [keys: string]: unknown;
15
16
  } | undefined, other?: any) => void) | undefined;
16
17
  onClose: () => void;
@@ -15,7 +15,7 @@ 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<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "warn" | "success" | "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>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PosProps } from './const';
2
3
  import './index.less';
3
4
  declare const _default: (props: PosProps) => JSX.Element | null;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Linkly: ({ api, onChange }: any) => JSX.Element;
2
3
  export default Linkly;
@@ -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: "loading" | "success" | "warn" | "fail" | "question";
177
+ status: "loading" | "warn" | "success" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
310
310
  form?: string | undefined;
311
- status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "loading" | "warn" | "success" | "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
  import './index.less';
2
3
  declare const ContinueButton: () => JSX.Element;
3
4
  export default ContinueButton;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Total: ({ className, isFooter }: any) => JSX.Element;
3
4
  export default Total;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare type CallToBookProps = {
2
3
  show: boolean;
3
4
  type: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem } from '../../type';
2
3
  declare type CalendarItemProps = {
3
4
  month: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const EventBooking: () => JSX.Element;
3
4
  export default EventBooking;
@@ -11,11 +11,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { useState, useImperativeHandle, forwardRef, useContext } from 'react';
12
12
  import { PisellModal } from '@pisell/materials';
13
13
  import ThreedsLoading from "../MWCreditCard/TDSPay/ThreedsLoading";
14
+ import PaymentReturnContent from "../components/PaymentReturnContent";
14
15
  import { Context } from "../../model";
15
16
  import { locales } from '@pisell/utils';
16
17
  import { getPayGroupParamsFromStorage } from "../../payGroup";
17
18
  import useEngineContext from "../../../../../hooks/useEngineContext";
18
19
  import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
20
+ import { usePaymentRedirect } from "../hooks";
19
21
  import "./index.less";
20
22
  import { formatFranchiseeRoute } from "../../utils";
21
23
  /**
@@ -28,7 +30,7 @@ import { formatFranchiseeRoute } from "../../utils";
28
30
  * @Date: 2024-08-16 10:58
29
31
  */
30
32
  var ApplePay = function ApplePay(props, ref) {
31
- var _context$appHelper, _state$payGroup;
33
+ var _context$appHelper, _state$payGroup, _state$payGroup2, _state$payGroup4;
32
34
  var _useContext = useContext(Context),
33
35
  state = _useContext.state;
34
36
  var _useState = useState(false),
@@ -45,6 +47,15 @@ var ApplePay = function ApplePay(props, ref) {
45
47
  step: '2'
46
48
  });
47
49
 
50
+ // 使用支付跳转 hooks
51
+ var _usePaymentRedirect = usePaymentRedirect({
52
+ orderId: (_state$payGroup2 = state.payGroup) === null || _state$payGroup2 === void 0 ? void 0 : _state$payGroup2.order_id,
53
+ paymentType: 'applePay'
54
+ }),
55
+ isReturned = _usePaymentRedirect.isReturned,
56
+ handleRedirect = _usePaymentRedirect.handleRedirect,
57
+ resetState = _usePaymentRedirect.resetState;
58
+
48
59
  /**
49
60
  * @title: 初始化
50
61
  * @description:
@@ -56,7 +67,7 @@ var ApplePay = function ApplePay(props, ref) {
56
67
  var init = /*#__PURE__*/function () {
57
68
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
58
69
  var _utils$getStore;
59
- var payGroup, utils, dvaStore, values, _dvaStore$core, _dvaStore$core2, _state$payGroup2, locale, shopId, currentURL, linkElement, shop_domain, _href;
70
+ var payGroup, utils, dvaStore, values, _dvaStore$core, _dvaStore$core2, _state$payGroup3, locale, shopId, currentURL, linkElement, shop_domain, _href;
60
71
  return _regeneratorRuntime().wrap(function _callee$(_context) {
61
72
  while (1) switch (_context.prev = _context.next) {
62
73
  case 0:
@@ -95,43 +106,50 @@ var ApplePay = function ApplePay(props, ref) {
95
106
  key: 'ApplePay获取支付参数成功',
96
107
  value: ""
97
108
  });
98
- try {
99
- // 语言
100
- locale = ((_dvaStore$core = dvaStore.core) === null || _dvaStore$core === void 0 ? void 0 : _dvaStore$core.translateLocale) || 'en'; // 店铺id
101
- shopId = (_dvaStore$core2 = dvaStore.core) === null || _dvaStore$core2 === void 0 || (_dvaStore$core2 = _dvaStore$core2.core) === null || _dvaStore$core2 === void 0 || (_dvaStore$core2 = _dvaStore$core2.shop) === null || _dvaStore$core2 === void 0 ? void 0 : _dvaStore$core2.id; // 当前url
102
- currentURL = window.location.href; // 创建一个a元素,用于解析URL
103
- linkElement = document.createElement('a');
104
- linkElement.href = currentURL;
109
+ _context.prev = 12;
110
+ // 语言
111
+ locale = ((_dvaStore$core = dvaStore.core) === null || _dvaStore$core === void 0 ? void 0 : _dvaStore$core.translateLocale) || 'en'; // 店铺id
112
+ shopId = (_dvaStore$core2 = dvaStore.core) === null || _dvaStore$core2 === void 0 || (_dvaStore$core2 = _dvaStore$core2.core) === null || _dvaStore$core2 === void 0 || (_dvaStore$core2 = _dvaStore$core2.shop) === null || _dvaStore$core2 === void 0 ? void 0 : _dvaStore$core2.id; // 当前url
113
+ currentURL = window.location.href; // 创建一个a元素,用于解析URL
114
+ linkElement = document.createElement('a');
115
+ linkElement.href = currentURL;
116
+
117
+ // 提取域名
118
+ shop_domain = linkElement.hostname;
119
+ _href = "".concat(config.pay).concat(formatFranchiseeRoute("/apple-pay?order_id=".concat((_state$payGroup3 = state.payGroup) === null || _state$payGroup3 === void 0 ? void 0 : _state$payGroup3.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id, "&front_order_uuid=").concat(state.front_order_uuid), state.history)); // 记录即将跳转到ApplePay
120
+ paymentLogger.addLog({
121
+ key: 'ApplePay准备跳转',
122
+ value: ""
123
+ });
124
+ paymentLogger.sendLogs('ApplePay跳转成功');
105
125
 
106
- // 提取域名
107
- shop_domain = linkElement.hostname;
108
- _href = "".concat(config.pay).concat(formatFranchiseeRoute("/apple-pay?order_id=".concat((_state$payGroup2 = state.payGroup) === null || _state$payGroup2 === void 0 ? void 0 : _state$payGroup2.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id), state.history)); // 记录即将跳转到ApplePay
109
- paymentLogger.addLog({
110
- key: 'ApplePay准备跳转',
111
- value: ""
112
- });
113
- paymentLogger.sendLogs('ApplePay跳转成功');
114
- window.location.href = _href;
115
- } catch (err) {
116
- // 记录ApplePay处理错误
117
- paymentLogger.addLog({
118
- key: 'ApplePay处理错误',
119
- value: {
120
- title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " ApplePay\u5904\u7406\u5931\u8D25: ").concat((err === null || err === void 0 ? void 0 : err.message) || '未知错误'),
121
- data: {
122
- payGroup: payGroup,
123
- values: values
124
- }
126
+ // 使用 hooks 提供的跳转方法
127
+ _context.next = 24;
128
+ return handleRedirect(_href);
129
+ case 24:
130
+ _context.next = 31;
131
+ break;
132
+ case 26:
133
+ _context.prev = 26;
134
+ _context.t0 = _context["catch"](12);
135
+ // 记录ApplePay处理错误
136
+ paymentLogger.addLog({
137
+ key: 'ApplePay处理错误',
138
+ value: {
139
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " ApplePay\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
140
+ data: {
141
+ payGroup: payGroup,
142
+ values: values
125
143
  }
126
- });
127
- paymentLogger.sendLogs('ApplePay处理失败', err);
128
- setOpen(false);
129
- }
130
- case 13:
144
+ }
145
+ });
146
+ paymentLogger.sendLogs('ApplePay处理失败', _context.t0);
147
+ setOpen(false);
148
+ case 31:
131
149
  case "end":
132
150
  return _context.stop();
133
151
  }
134
- }, _callee);
152
+ }, _callee, null, [[12, 26]]);
135
153
  }));
136
154
  return function init(_x) {
137
155
  return _ref3.apply(this, arguments);
@@ -142,6 +160,10 @@ var ApplePay = function ApplePay(props, ref) {
142
160
  init: init
143
161
  };
144
162
  });
163
+ var handleReturn = function handleReturn() {
164
+ setOpen(false);
165
+ resetState();
166
+ };
145
167
  return /*#__PURE__*/React.createElement(PisellModal, {
146
168
  platform: 'h5',
147
169
  open: open,
@@ -153,8 +175,19 @@ var ApplePay = function ApplePay(props, ref) {
153
175
  }
154
176
  }, /*#__PURE__*/React.createElement("div", {
155
177
  className: ""
156
- }, /*#__PURE__*/React.createElement(ThreedsLoading, {
178
+ }, !isReturned &&
179
+ /*#__PURE__*/
180
+ // 跳转前展示 Loading
181
+ React.createElement(ThreedsLoading, {
157
182
  title: locales.getText('tocPay.text.connectingApplePay')
183
+ }), isReturned &&
184
+ /*#__PURE__*/
185
+ // 跳转后返回时展示新组件内容
186
+ React.createElement(PaymentReturnContent, {
187
+ handleReturn: handleReturn,
188
+ state: state,
189
+ orderId: (_state$payGroup4 = state.payGroup) === null || _state$payGroup4 === void 0 ? void 0 : _state$payGroup4.order_id,
190
+ unique_payment_number: state === null || state === void 0 ? void 0 : state.front_order_uuid
158
191
  })));
159
192
  };
160
193
  export default /*#__PURE__*/forwardRef(ApplePay);