@pisell/private-materials 3.3.98 → 3.3.99

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 (207) 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 +11 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/Sales/Cart/index.d.ts +53 -0
  12. package/es/components/Sales/Cart/index.js +1 -5
  13. package/es/components/Sales/Cart/utils.d.ts +23 -0
  14. package/es/components/Sales/Cart/utils.js +0 -167
  15. package/es/components/Sales/Checkout/index.d.ts +33 -0
  16. package/es/components/Sales/Checkout/index.js +8 -52
  17. package/es/components/Sales/Checkout/serve.d.ts +2 -0
  18. package/es/components/Sales/Checkout/serve.js +2 -16
  19. package/es/components/Sales/Checkout/utils.d.ts +35 -0
  20. package/es/components/Sales/Checkout/utils.js +1 -7
  21. package/es/components/Sales/Summary/index.d.ts +25 -0
  22. package/es/components/Sales/Summary/index.js +2 -17
  23. package/es/components/Sales/Summary/serve.d.ts +0 -0
  24. package/es/components/Sales/Summary/serve.js +0 -6
  25. package/es/components/Sales/Summary/utils.d.ts +36 -0
  26. package/es/components/Sales/Summary/utils.js +1 -43
  27. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  28. package/es/components/appointmentBooking/components/Content/index.d.ts +3 -0
  29. package/es/components/appointmentBooking/components/Content/index.js +1 -15
  30. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  31. package/es/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
  32. package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
  33. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  34. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  35. package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
  36. package/es/components/appointmentBooking/components/Services/index.js +27 -23
  37. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  38. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
  39. package/es/components/appointmentBooking/deposit/index.d.ts +3 -0
  40. package/es/components/appointmentBooking/deposit/index.js +2 -4
  41. package/es/components/appointmentBooking/index.d.ts +3 -0
  42. package/es/components/appointmentBooking/index.js +0 -14
  43. package/es/components/appointmentBooking/index.less +1 -1
  44. package/es/components/booking/components/voucher/index.d.ts +3 -0
  45. package/es/components/booking/components/voucher/index.js +2 -2
  46. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  47. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  48. package/es/components/booking/info/index.d.ts +1 -0
  49. package/es/components/booking/info/service/Lists.d.ts +0 -1
  50. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  51. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  52. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  53. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  54. package/es/components/booking/utils.d.ts +2 -2
  55. package/es/components/eftposPay/amount.d.ts +1 -1
  56. package/es/components/eftposPay/app.d.ts +0 -1
  57. package/es/components/eftposPay/const.d.ts +181 -0
  58. package/es/components/eftposPay/const.js +1 -3
  59. package/es/components/eftposPay/device.d.ts +1 -1
  60. package/es/components/eftposPay/hooks.d.ts +35 -0
  61. package/es/components/eftposPay/hooks.js +1 -3
  62. package/es/components/eftposPay/index.d.ts +4 -0
  63. package/es/components/eftposPay/index.js +1 -1
  64. package/es/components/eftposPay/manufacturer.d.ts +6 -0
  65. package/es/components/eftposPay/manufacturer.js +0 -4
  66. package/es/components/eftposPay/pay.d.ts +20 -0
  67. package/es/components/eftposPay/pay.js +2 -6
  68. package/es/components/eftposPay/store/index.d.ts +355 -0
  69. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  70. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +3 -0
  71. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -29
  72. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +3 -0
  73. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
  74. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
  75. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
  76. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  77. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  78. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  79. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  80. package/es/components/eventBooking/components/bookingDetailModal/index.d.ts +7 -0
  81. package/es/components/eventBooking/components/bookingDetailModal/index.js +1 -3
  82. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  83. package/es/components/eventBooking/locales.d.ts +222 -0
  84. package/es/components/eventBooking/locales.js +3 -27
  85. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  86. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  87. package/es/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  88. package/es/components/pay/toC/PaymentMethods/index.js +4 -5
  89. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  90. package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  91. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  92. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  93. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +4 -0
  94. package/es/components/ticketBooking/components/ticketBooking/index.js +1 -120
  95. package/es/components/ticketBooking/locales.d.ts +153 -0
  96. package/es/components/ticketBooking/locales.js +147 -195
  97. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  98. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  99. package/es/utils/index.d.ts +23 -0
  100. package/lib/components/Sales/Cart/index.d.ts +53 -0
  101. package/lib/components/Sales/Cart/index.js +0 -1
  102. package/lib/components/Sales/Cart/utils.d.ts +23 -0
  103. package/lib/components/Sales/Cart/utils.js +0 -117
  104. package/lib/components/Sales/Checkout/index.d.ts +33 -0
  105. package/lib/components/Sales/Checkout/index.js +7 -39
  106. package/lib/components/Sales/Checkout/serve.d.ts +2 -0
  107. package/lib/components/Sales/Checkout/serve.js +2 -7
  108. package/lib/components/Sales/Checkout/utils.d.ts +35 -0
  109. package/lib/components/Sales/Checkout/utils.js +0 -2
  110. package/lib/components/Sales/Summary/index.d.ts +25 -0
  111. package/lib/components/Sales/Summary/index.js +1 -7
  112. package/lib/components/Sales/Summary/serve.d.ts +0 -0
  113. package/lib/components/Sales/Summary/serve.js +0 -32
  114. package/lib/components/Sales/Summary/utils.d.ts +36 -0
  115. package/lib/components/Sales/Summary/utils.js +1 -30
  116. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  117. package/lib/components/appointmentBooking/components/Content/index.d.ts +3 -0
  118. package/lib/components/appointmentBooking/components/Content/index.js +1 -6
  119. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  120. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
  121. package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
  122. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  123. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  124. package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
  125. package/lib/components/appointmentBooking/components/Services/index.js +11 -6
  126. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  127. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
  128. package/lib/components/appointmentBooking/deposit/index.d.ts +3 -0
  129. package/lib/components/appointmentBooking/deposit/index.js +2 -4
  130. package/lib/components/appointmentBooking/index.d.ts +3 -0
  131. package/lib/components/appointmentBooking/index.js +0 -11
  132. package/lib/components/appointmentBooking/index.less +1 -1
  133. package/lib/components/booking/components/voucher/index.d.ts +3 -0
  134. package/lib/components/booking/components/voucher/index.js +2 -2
  135. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  136. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  137. package/lib/components/booking/info/index.d.ts +1 -0
  138. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  139. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  140. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  141. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  142. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  143. package/lib/components/booking/utils.d.ts +2 -2
  144. package/lib/components/eftposPay/amount.d.ts +1 -1
  145. package/lib/components/eftposPay/app.d.ts +0 -1
  146. package/lib/components/eftposPay/const.d.ts +181 -0
  147. package/lib/components/eftposPay/const.js +0 -2
  148. package/lib/components/eftposPay/device.d.ts +1 -1
  149. package/lib/components/eftposPay/hooks.d.ts +35 -0
  150. package/lib/components/eftposPay/hooks.js +4 -11
  151. package/lib/components/eftposPay/index.d.ts +4 -0
  152. package/lib/components/eftposPay/index.js +1 -1
  153. package/lib/components/eftposPay/manufacturer.d.ts +6 -0
  154. package/lib/components/eftposPay/manufacturer.js +0 -6
  155. package/lib/components/eftposPay/pay.d.ts +20 -0
  156. package/lib/components/eftposPay/pay.js +2 -13
  157. package/lib/components/eftposPay/store/index.d.ts +355 -0
  158. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  159. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +3 -0
  160. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +3 -16
  161. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +3 -0
  162. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
  163. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
  164. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
  165. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  166. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  167. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  168. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  169. package/lib/components/eventBooking/components/bookingDetailModal/index.d.ts +7 -0
  170. package/lib/components/eventBooking/components/bookingDetailModal/index.js +1 -1
  171. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  172. package/lib/components/eventBooking/locales.d.ts +222 -0
  173. package/lib/components/eventBooking/locales.js +3 -27
  174. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  175. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  176. package/lib/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  177. package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
  178. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  179. package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  180. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  181. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  182. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +4 -0
  183. package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -120
  184. package/lib/components/ticketBooking/locales.d.ts +153 -0
  185. package/lib/components/ticketBooking/locales.js +4 -22
  186. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  187. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  188. package/lib/utils/index.d.ts +23 -0
  189. package/package.json +4 -4
  190. package/es/components/eftposPay/linkly/const.js +0 -82
  191. package/es/components/eftposPay/linkly/hooks/index.js +0 -2
  192. package/es/components/eftposPay/linkly/hooks/normal.js +0 -321
  193. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
  194. package/es/components/eftposPay/linkly/index.js +0 -197
  195. package/es/components/eftposPay/linkly/service.js +0 -81
  196. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
  197. package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
  198. package/es/components/ticketBooking/utils/formatTime.js +0 -144
  199. package/lib/components/eftposPay/linkly/const.js +0 -102
  200. package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
  201. package/lib/components/eftposPay/linkly/hooks/normal.js +0 -242
  202. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
  203. package/lib/components/eftposPay/linkly/index.js +0 -208
  204. package/lib/components/eftposPay/linkly/service.js +0 -55
  205. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
  206. package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
  207. package/lib/components/ticketBooking/utils/formatTime.js +0 -139
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Footer: ({ onNext, isOpen }: any) => JSX.Element;
3
4
  export default Footer;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const GuestOptionsModal: (props: any) => JSX.Element;
3
4
  export default GuestOptionsModal;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const Services: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
4
+ export default Services;
@@ -74,7 +74,9 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
74
74
  let type = "";
75
75
  if (!isRetailTemplate) {
76
76
  type = await checkProductType(item == null ? void 0 : item.id);
77
- appointmentBooking.openProductDetail(item.id);
77
+ if (type === "session") {
78
+ appointmentBooking.openProductDetail(item.id);
79
+ }
78
80
  }
79
81
  utils == null ? void 0 : utils.action({
80
82
  type: "pisell1.productDetail",
@@ -84,10 +86,6 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
84
86
  },
85
87
  callback: async (data) => {
86
88
  var _a, _b;
87
- if (data.isCancel) {
88
- appointmentBooking.closeProductDetail();
89
- return;
90
- }
91
89
  const product = {
92
90
  ...data,
93
91
  options: (data == null ? void 0 : data.option) || []
@@ -98,6 +96,13 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
98
96
  appointmentBooking.storeProduct(product);
99
97
  return;
100
98
  }
99
+ if (data == null ? void 0 : data.isCancel) {
100
+ if (type === "session") {
101
+ appointmentBooking.closeProductDetail();
102
+ appointmentBooking.getAvailableDate();
103
+ }
104
+ return;
105
+ }
101
106
  const session = data == null ? void 0 : data.session;
102
107
  if (session) {
103
108
  const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
@@ -109,6 +114,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
109
114
  endTime: `${endDate} ${session == null ? void 0 : session.end_time}`
110
115
  }
111
116
  });
117
+ appointmentBooking.closeProductDetail();
112
118
  await appointmentBooking.getAvailableDate({
113
119
  startDate,
114
120
  endDate
@@ -126,7 +132,6 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
126
132
  await appointmentBooking.getAvailableDate();
127
133
  }
128
134
  }
129
- appointmentBooking.closeProductDetail();
130
135
  if (isDateSelectedFirst) {
131
136
  const index = (currentStep == null ? void 0 : currentStep.index) + 2;
132
137
  if (type === "duration" || appointmentBooking.isCartHasDurationProduct()) {
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const DepositModal: (props: any) => JSX.Element;
3
+ export default DepositModal;
@@ -36,6 +36,7 @@ var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_materials = require("@pisell/materials");
38
38
  var import_utils = require("@pisell/utils");
39
+ var import_context = require("../../../context");
39
40
  var import_index = require("./index.less");
40
41
  var DepositModal = (props) => {
41
42
  const {
@@ -44,10 +45,9 @@ var DepositModal = (props) => {
44
45
  item,
45
46
  onChange,
46
47
  onConfirm,
47
- isHideCheckout = true,
48
- depositProtocolRequest
49
- // 定金协议请求
48
+ isHideCheckout = true
50
49
  } = props;
50
+ const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
51
51
  const [policy, setPolicy] = (0, import_react.useState)(null);
52
52
  const [loading, setLoading] = (0, import_react.useState)(false);
53
53
  const [disabled, setDisabled] = (0, import_react.useState)(false);
@@ -55,13 +55,9 @@ var DepositModal = (props) => {
55
55
  setDisabled(!isHideCheckout);
56
56
  }, [isHideCheckout]);
57
57
  const getPolicy = async (id) => {
58
- if (!depositProtocolRequest) {
59
- console.error("depositProtocolRequest is not defined");
60
- return;
61
- }
62
58
  setLoading(true);
63
59
  try {
64
- const { data } = await (depositProtocolRequest == null ? void 0 : depositProtocolRequest(id));
60
+ const { data } = await appointmentBooking.getProtocol(id);
65
61
  setPolicy(data);
66
62
  onChange && onChange(data);
67
63
  } catch (error) {
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Deposit: (props: any) => JSX.Element;
3
+ export default Deposit;
@@ -48,8 +48,7 @@ var Deposit = (props) => {
48
48
  title,
49
49
  isAgreePolicy = true,
50
50
  isShowTitle = true,
51
- onChange,
52
- depositProtocolRequest
51
+ onChange
53
52
  } = props;
54
53
  const context = (0, import_useEngineContext.default)();
55
54
  const [visible, setVisible] = (0, import_react.useState)(false);
@@ -103,8 +102,7 @@ var Deposit = (props) => {
103
102
  {
104
103
  open: visible,
105
104
  onCancel: () => setVisible(false),
106
- item: policyItem,
107
- depositProtocolRequest
105
+ item: policyItem
108
106
  }
109
107
  ));
110
108
  };
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const AppointmentBooking: () => JSX.Element;
3
+ export default AppointmentBooking;
@@ -58,17 +58,6 @@ var AppointmentBooking = () => {
58
58
  }
59
59
  });
60
60
  }, []);
61
- (0, import_react.useEffect)(() => {
62
- const setRealVH = () => {
63
- const vh = window.innerHeight * 0.01;
64
- document.documentElement.style.setProperty("--vh", `${vh}px`);
65
- };
66
- setRealVH();
67
- window.addEventListener("resize", setRealVH);
68
- return () => {
69
- window.removeEventListener("resize", setRealVH);
70
- };
71
- }, []);
72
61
  return /* @__PURE__ */ import_react.default.createElement(
73
62
  "div",
74
63
  {
@@ -3,7 +3,7 @@
3
3
  flex-direction: column;
4
4
  align-items: center;
5
5
  background: #ffffff;
6
- height: calc(var(--vh, 1vh) * 100);
6
+ height: 100vh;
7
7
  overflow-y: auto;
8
8
 
9
9
  .pisell-section-headers {
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const VoucherCard: (props: any) => JSX.Element | null;
3
+ export default VoucherCard;
@@ -41,8 +41,8 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
41
41
  var import_materials = require("@pisell/materials");
42
42
  var import_useIsBooking4Shop = require("../../hooks/useIsBooking4Shop");
43
43
  var import_index = require("./index.less");
44
- var import_ahooks = require("ahooks");
45
44
  var import_utils2 = require("./utils");
45
+ var import_ahooks = require("ahooks");
46
46
  var ShopDiscountHooks = {
47
47
  onInited: "shopDiscount:onInited",
48
48
  onDestroy: "shopDiscount:onDestroy",
@@ -274,8 +274,8 @@ var VoucherCard = (props) => {
274
274
  import_materials.PisellGoodPassCard,
275
275
  {
276
276
  style: { width: "100%" },
277
- dataSource: ((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length) ? availableData : [],
278
277
  mixedSort,
278
+ dataSource: ((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length) ? availableData : [],
279
279
  onChange: (val) => {
280
280
  const shopDiscount2 = pisellos.getModule("shopDiscount");
281
281
  const detail = shopDiscount2.setDiscountSelected({
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  export declare const disabledDate: (current: any, position: any, currentDate: any) => any;
3
4
  declare const DateRange: ({ state, dispatch, key }: any) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { EditServiceRef } from "../service/editService";
3
2
  declare const useInfoHolder: (state: any, dispatch: any) => {
4
3
  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,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
3
2
  export default Lists;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const BookingList: ({ items }: {
2
3
  items: any[];
3
4
  }) => JSX.Element;
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SelectProps } from "antd";
3
2
  interface StartTimeProps extends SelectProps {
4
3
  locale?: string;
@@ -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 | {
168
+ }) => number | "flexible" | {
169
169
  type: string;
170
170
  value: number;
171
- } | "flexible";
171
+ };
172
172
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
173
173
  export declare const getIsEdit: (state: any) => boolean;
174
174
  export {};
@@ -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: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
11
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
12
  [keys: string]: unknown;
13
13
  } | undefined, other?: any) => void) | undefined;
14
14
  onClose: () => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PosProps, RouteType } from './const';
3
2
  declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
4
3
  action: RouteType;
@@ -0,0 +1,181 @@
1
+ export declare enum EftposEnum {
2
+ /** 后端支付 - 仅支付 */
3
+ Payo = "payo",
4
+ /** 前端支付 */
5
+ Tyro = "tyro",
6
+ /** 后端支付 - 支付 + 退款 */
7
+ Windcave = "windcave",
8
+ Stripe = "stripe"
9
+ }
10
+ export declare enum StatusEnum {
11
+ Loading = "loading",
12
+ Warn = "warn",
13
+ Fail = "fail",
14
+ Success = "success",
15
+ Pedding = "pedding",
16
+ Resove = "resove",
17
+ Reject = "reject",
18
+ Question = "question"
19
+ }
20
+ export declare enum ModeEnum {
21
+ /** 支付 */
22
+ Pay = "pay",
23
+ /** 完整支付 */
24
+ FullPay = "fullPay",
25
+ /** 退款 */
26
+ Refund = "refund",
27
+ /** 查询 */
28
+ Query = "query"
29
+ }
30
+ /**
31
+ * 崩溃恢复
32
+ */
33
+ export declare enum RestoreEumn {
34
+ /** 常规 */
35
+ Normal = "normal",
36
+ /** 恢复 */
37
+ Restore = "restore"
38
+ }
39
+ /**
40
+ * 订单状态
41
+ */
42
+ export declare enum OrderEumn {
43
+ /** 恢复 */
44
+ Restore = "restore",
45
+ /** 常规 */
46
+ Normal = "normal",
47
+ /** 成功 */
48
+ Succeed = "succeed",
49
+ /** 失败 */
50
+ Failed = "failed",
51
+ /** 等待 */
52
+ Pending = "pending",
53
+ /** 没有订单状态 */
54
+ Null = "null"
55
+ }
56
+ export declare enum ClientEnum {
57
+ /** 用户端 */
58
+ User = "user",
59
+ /** 商家端 */
60
+ Merchant = "merchant"
61
+ }
62
+ export declare enum RouteEnum {
63
+ /** 改价页 */
64
+ Amount = "amount",
65
+ /** 门店列表页 */
66
+ DeviceList = "deviceList",
67
+ /**支付页 */
68
+ Pay = "pay"
69
+ }
70
+ export declare enum PayRouteEnum {
71
+ Step = "step",
72
+ Unset = "unset"
73
+ }
74
+ export declare type RouteType = `${RouteEnum}`;
75
+ export declare type PayRouteType = `${PayRouteEnum}`;
76
+ export declare type DeviceStatusType = `${EftposEnum}`;
77
+ export declare type StatusType = `${StatusEnum}`;
78
+ export declare type ModeType = `${ModeEnum}`;
79
+ export interface PosProps {
80
+ /** 厂商类型 */
81
+ type: DeviceStatusType;
82
+ getApi: () => {
83
+ [key: string]: (...agrn: unknown[]) => Promise<unknown>;
84
+ };
85
+ params: {
86
+ [key: string]: unknown;
87
+ };
88
+ /** 回调 */
89
+ onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page' | 'print' | 'mark_tx_processed', params?: {
90
+ [keys: string]: unknown;
91
+ } | string, other?: any) => void;
92
+ onChangeParams(...agrn: unknown[]): void;
93
+ terminal: {
94
+ network: boolean;
95
+ };
96
+ device?: {
97
+ [key: string]: unknown;
98
+ };
99
+ mode: ModeEnum;
100
+ tyroUrl?: string;
101
+ tyroVersion?: string;
102
+ source: 'normal' | 'restore';
103
+ }
104
+ export interface PayProps {
105
+ api: ReturnType<PosProps['getApi']>;
106
+ onChange: PosProps['onChangeStatus'];
107
+ className?: string;
108
+ }
109
+ export declare type Amount = {
110
+ name: string;
111
+ /** 订单金额 */
112
+ money: number;
113
+ /** 上一轮操作订单金额 */
114
+ amount: number;
115
+ /** 金额单位 */
116
+ symbol: string;
117
+ /** 手续费-百分率 */
118
+ surRate: number;
119
+ /** 手续费-是否开启 */
120
+ surMoney: number;
121
+ /** 手续费-是否存在 */
122
+ surcharge: boolean;
123
+ /** 是否使用原始手续费 */
124
+ useOriginSurcharge: boolean;
125
+ };
126
+ export declare type PayAmount = {
127
+ /** 手续费-百分比-带百分号 例: 1% =》 数据为 0.01 */
128
+ surPercentRate: string;
129
+ /** 手续费-百分比-不带百分号 例:1% =》 数据为 1 */
130
+ surRate: string;
131
+ /** 手续费-比例金额 amount * surPercentRate */
132
+ surRateMoney: string;
133
+ /** 手续费-固定金额 */
134
+ surMoney: string;
135
+ /** 手续费 = surPercentRate + surMoney */
136
+ surcharge: string;
137
+ /** 支付金额 (不包含手续费) */
138
+ amount: string;
139
+ /** 支付总金额 = amount + surcharge */
140
+ total: string;
141
+ /** 订单金额 */
142
+ sourceAmount: string;
143
+ /** 支付总金额带单位 + 单位 */
144
+ totalUnit: string;
145
+ };
146
+ export declare enum PayStatus {
147
+ 'Success' = "200",
148
+ /** 未生成交易记录 */
149
+ 'NoPay' = "4004",
150
+ /** 支付失败 */
151
+ 'Unknown' = "701000",
152
+ /** 交易请求超时 */
153
+ 'Timeout' = "701001",
154
+ /** 繁忙 EFTPOS终端暂时不可用,因为EFTPOS正在处理另一个请求。 */
155
+ 'PayOtherEftposFailed' = "701003",
156
+ /** 购物者没有出示卡片/卡片金额不足/在线拒绝/卡已过期/卡被锁定 */
157
+ 'PayCardErrorFailed' = "701004",
158
+ /** 断网 向EFTPOS发送消息失败。可能有网络问题,也可能没有连接websocket。 */
159
+ 'NoNetWork' = "701005",
160
+ /** 交易等待超时 */
161
+ 'PayTimeout' = "701006",
162
+ /** 连接失败 */
163
+ 'SocketError' = "701007",
164
+ /** 银行拒绝 */
165
+ 'PayBankRefuses' = "701008",
166
+ /** 签名拒绝 */
167
+ 'SignatureDeclined' = "701009",
168
+ /** 配置参数错误 */
169
+ 'UserConfigError' = "701010"
170
+ }
171
+ export interface ActionProps {
172
+ onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
173
+ [key: string]: unknown;
174
+ } | string) => void;
175
+ api: {
176
+ [key: string]: (...agrn: unknown[]) => Promise<unknown>;
177
+ };
178
+ className?: string;
179
+ isMobile?: boolean;
180
+ formatAmount: (amount: number | string, precision: number, symbol: string) => string;
181
+ }
@@ -35,7 +35,6 @@ var EftposEnum = /* @__PURE__ */ ((EftposEnum2) => {
35
35
  EftposEnum2["Tyro"] = "tyro";
36
36
  EftposEnum2["Windcave"] = "windcave";
37
37
  EftposEnum2["Stripe"] = "stripe";
38
- EftposEnum2["Linkly"] = "linkly";
39
38
  return EftposEnum2;
40
39
  })(EftposEnum || {});
41
40
  var StatusEnum = /* @__PURE__ */ ((StatusEnum2) => {
@@ -89,7 +88,6 @@ var PayRouteEnum = /* @__PURE__ */ ((PayRouteEnum2) => {
89
88
  var PayStatus = /* @__PURE__ */ ((PayStatus2) => {
90
89
  PayStatus2["Success"] = "200";
91
90
  PayStatus2["NoPay"] = "4004";
92
- PayStatus2["PairingFailure"] = "606020";
93
91
  PayStatus2["Unknown"] = "701000";
94
92
  PayStatus2["Timeout"] = "701001";
95
93
  PayStatus2["PayOtherEftposFailed"] = "701003";
@@ -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: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
14
  [keys: string]: unknown;
15
15
  } | undefined, other?: any) => void) | undefined;
16
16
  onClose: () => void;
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { PayStatus } from './const';
3
+ import { ModeEnum, ClientEnum } from './const';
4
+ export declare const useStoreRef: <T extends {
5
+ [key: string]: unknown;
6
+ } = {
7
+ [key: string]: unknown;
8
+ }, U extends {
9
+ [key: string]: unknown;
10
+ } = {
11
+ [key: string]: unknown;
12
+ }>() => {
13
+ readonly deviceRef: React.MutableRefObject<T>;
14
+ readonly payRef: React.MutableRefObject<U>;
15
+ readonly numRef: React.MutableRefObject<string | number | undefined>;
16
+ readonly orderIdRef: React.MutableRefObject<string | number>;
17
+ readonly modeRef: React.MutableRefObject<ModeEnum>;
18
+ readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
19
+ readonly netRef: React.MutableRefObject<boolean | undefined>;
20
+ readonly symbolRef: React.MutableRefObject<string>;
21
+ readonly amountRef: React.MutableRefObject<string | number>;
22
+ readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo">;
23
+ readonly clientRef: React.MutableRefObject<ClientEnum>;
24
+ readonly dataRef: React.MutableRefObject<import("./store").State>;
25
+ };
26
+ /**
27
+ * @title: 通用失败处理
28
+ * @description: 固定步骤 错误处理逻辑
29
+ * @return null
30
+ * @Author: hongbing.wang
31
+ * @Date: 2024-08-12 11:54
32
+ */
33
+ export declare const useFail: (index: number) => (res: {
34
+ code?: `${PayStatus}`;
35
+ }, isMark?: boolean) => void;
@@ -128,7 +128,6 @@ var useFail = (index) => {
128
128
  return;
129
129
  }
130
130
  const [code] = [`${res.code}`];
131
- console.log("code---->>>>>>>", code);
132
131
  if (code === import_const.PayStatus.Unknown) {
133
132
  steps[index].title = import_utils.locales.getText("page.eftpos-pay.text.failed")(
134
133
  modeRef.current
@@ -169,12 +168,8 @@ var useFail = (index) => {
169
168
  if (isMark) {
170
169
  if (clientRef.current === import_const2.ClientEnum.User) {
171
170
  steps[index].status = "fail";
172
- steps[index].title = import_utils.locales.getText(
173
- "page.eftpos-pay.text.timedout.title"
174
- );
175
- steps[index].fail = import_utils.locales.getText(
176
- "page.eftpos-pay.text.transaction.eftpos.fail.other"
177
- );
171
+ steps[index].title = import_utils.locales.getText("page.eftpos-pay.text.timedout.title");
172
+ steps[index].fail = import_utils.locales.getText("page.eftpos-pay.text.transaction.eftpos.fail.other");
178
173
  steps[index].custom = steps[index].custom ? { ...steps[index].custom, isPosNetworkError: true } : { isPosNetworkError: true };
179
174
  dispatch((0, import_store.updateSteps)(steps));
180
175
  dispatch((0, import_store.updateComponent)("Fail"));
@@ -315,9 +310,7 @@ ${import_utils.locales.getText(
315
310
  )}
316
311
  ${import_utils.locales.getText(
317
312
  "page.eftpos-pay.text.transaction.eftpos.fail.if"
318
- )(modeRef.current)}` : import_utils.locales.getText(
319
- "page.eftpos-pay.text.transaction.eftpos.fail.other"
320
- );
313
+ )(modeRef.current)}` : import_utils.locales.getText("page.eftpos-pay.text.transaction.eftpos.fail.other");
321
314
  steps[index].status = "warn";
322
315
  steps[index].custom = steps[index].custom ? { ...steps[index].custom, isPosNetworkError: true } : { isPosNetworkError: true };
323
316
  dispatch((0, import_store.updateSteps)(steps));
@@ -366,7 +359,7 @@ ${import_utils.locales.getText(
366
359
  );
367
360
  return;
368
361
  }
369
- if (code === import_const.PayStatus.UserConfigError || code === import_const.PayStatus.PairingFailure) {
362
+ if (code === import_const.PayStatus.UserConfigError) {
370
363
  steps[index].title = import_utils.locales.getText(
371
364
  "page.eftpos-pay.text.transaction.user.config.title"
372
365
  );
@@ -0,0 +1,4 @@
1
+ import { PosProps } from './const';
2
+ import './index.less';
3
+ declare const _default: (props: PosProps) => JSX.Element | null;
4
+ export default _default;
@@ -139,7 +139,7 @@ var eftposPay_default = (props) => {
139
139
  }, [mode, state]);
140
140
  (0, import_react.useEffect)(() => {
141
141
  document.body.id = "body";
142
- console.log("初始化 ........112218017777");
142
+ console.log("初始化 ........11221801");
143
143
  }, []);
144
144
  console.log("props?.params?.device_number = ", (_e = props == null ? void 0 : props.params) == null ? void 0 : _e.device_number);
145
145
  const api = (0, import_react.useMemo)(() => {
@@ -0,0 +1,6 @@
1
+ import { State } from './store';
2
+ export { getAmonunt } from './helper';
3
+ export { default as Payo } from './payo';
4
+ export { default as Windcave } from './windcave/windcave';
5
+ export { default as Tyro } from './tyro';
6
+ export declare const getInitState: (type: string, params?: any) => State;
@@ -29,7 +29,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/components/eftposPay/manufacturer.tsx
30
30
  var manufacturer_exports = {};
31
31
  __export(manufacturer_exports, {
32
- Linkly: () => import_linkly.default,
33
32
  Payo: () => import_payo.default,
34
33
  Tyro: () => import_tyro.default,
35
34
  Windcave: () => import_windcave.default,
@@ -41,12 +40,10 @@ var import_const = require("./const");
41
40
  var import_const2 = __toESM(require("./payo/const"));
42
41
  var import_const3 = __toESM(require("./tyro/const"));
43
42
  var import_const4 = __toESM(require("./windcave/const"));
44
- var import_const5 = __toESM(require("./linkly/const"));
45
43
  var import_helper = require("./helper");
46
44
  var import_payo = __toESM(require("./payo"));
47
45
  var import_windcave = __toESM(require("./windcave/windcave"));
48
46
  var import_tyro = __toESM(require("./tyro"));
49
- var import_linkly = __toESM(require("./linkly"));
50
47
  var getInitState = (type, params) => {
51
48
  switch (type) {
52
49
  case import_const.EftposEnum.Payo:
@@ -55,15 +52,12 @@ var getInitState = (type, params) => {
55
52
  return (0, import_const4.default)(params);
56
53
  case import_const.EftposEnum.Tyro:
57
54
  return (0, import_const3.default)(params);
58
- case import_const.EftposEnum.Linkly:
59
- return (0, import_const5.default)(params);
60
55
  default:
61
56
  throw new Error("未知的厂商类型");
62
57
  }
63
58
  };
64
59
  // Annotate the CommonJS export names for ESM import in node:
65
60
  0 && (module.exports = {
66
- Linkly,
67
61
  Payo,
68
62
  Tyro,
69
63
  Windcave,
@@ -0,0 +1,20 @@
1
+ import { PayProps } from './const';
2
+ import './index.less';
3
+ /**
4
+ * @title: 支付组件
5
+ * @description:
6
+ * @Author: hongbing.wang
7
+ * @Date: 2024-08-20 14:59
8
+ */
9
+ declare const Pay: ({ api, onChange: onChangeStatus, className, terminal, net, isMobile, tyroUrl, tyroVersion, formatAmount, client }: PayProps & {
10
+ terminal: {
11
+ network: boolean;
12
+ };
13
+ net: boolean;
14
+ isMobile: boolean;
15
+ tyroUrl?: string | undefined;
16
+ tyroVersion?: string | undefined;
17
+ formatAmount(amount: number | string, precision: number, symbol: string): string;
18
+ client: string;
19
+ }) => JSX.Element;
20
+ export default Pay;