@pisell/private-materials 3.3.107 → 3.4.2

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 (283) 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 +13 -13
  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/businessModel/SalesModel/index.d.ts +0 -1
  12. package/es/components/Sales/Cart/index.js +9 -8
  13. package/es/components/Sales/Cart/utils.d.ts +0 -40
  14. package/es/components/Sales/Cart/utils.js +0 -167
  15. package/es/components/Sales/Checkout/index.d.ts +0 -4
  16. package/es/components/Sales/Checkout/index.js +8 -52
  17. package/es/components/Sales/Checkout/serve.d.ts +0 -13
  18. package/es/components/Sales/Checkout/serve.js +2 -16
  19. package/es/components/Sales/Checkout/utils.d.ts +6 -1
  20. package/es/components/Sales/Checkout/utils.js +8 -9
  21. package/es/components/Sales/Customer/index.d.ts +1 -0
  22. package/es/components/Sales/Customer/index.js +1 -0
  23. package/es/components/Sales/Summary/index.d.ts +0 -10
  24. package/es/components/Sales/Summary/index.js +2 -17
  25. package/es/components/Sales/Summary/serve.d.ts +0 -1
  26. package/es/components/Sales/Summary/serve.js +0 -6
  27. package/es/components/Sales/Summary/utils.d.ts +0 -15
  28. package/es/components/Sales/Summary/utils.js +1 -43
  29. package/es/components/appointmentBooking/components/Cart/Item/index.js +0 -1
  30. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  31. package/es/components/appointmentBooking/components/Content/index.js +1 -15
  32. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  33. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
  34. package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
  35. package/es/components/appointmentBooking/components/Form/index.js +1 -1
  36. package/es/components/appointmentBooking/components/Form/utils.d.ts +1 -1
  37. package/es/components/appointmentBooking/components/Form/utils.js +17 -15
  38. package/es/components/appointmentBooking/components/Header/index.js +2 -1
  39. package/es/components/appointmentBooking/components/Resource/index.js +0 -1
  40. package/es/components/appointmentBooking/components/Services/index.js +27 -23
  41. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
  42. package/es/components/appointmentBooking/deposit/index.js +2 -4
  43. package/es/components/appointmentBooking/index.js +0 -14
  44. package/es/components/appointmentBooking/index.less +1 -1
  45. package/es/components/booking/addons/model.d.ts +1 -10
  46. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  47. package/es/components/booking/components/browserSelect/index.js +1 -1
  48. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  49. package/es/components/booking/components/voucher/index.js +2 -2
  50. package/es/components/booking/forms/model.d.ts +1 -10
  51. package/es/components/booking/forms/model.js +5 -5
  52. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  53. package/es/components/booking/info/model.d.ts +1 -10
  54. package/es/components/booking/info/service/like/index.d.ts +0 -1
  55. package/es/components/booking/info/service/like/index.js +1 -1
  56. package/es/components/booking/info/service/serviceManager/index.js +4 -4
  57. package/es/components/booking/info2/index.js +6 -4
  58. package/es/components/booking/info2/utils.d.ts +4 -0
  59. package/es/components/booking/materiels/startTime/index.js +1 -1
  60. package/es/components/booking/model.d.ts +1 -9
  61. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  62. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  63. package/es/components/booking/notes/model.d.ts +1 -10
  64. package/es/components/booking/notes/model.js +5 -5
  65. package/es/components/booking/payments/model.d.ts +1 -10
  66. package/es/components/booking/payments/model.js +5 -5
  67. package/es/components/eftpos/deviceList/index.d.ts +0 -1
  68. package/es/components/eftpos/form/index.d.ts +0 -1
  69. package/es/components/eftpos/group/index.d.ts +0 -1
  70. package/es/components/eftpos/hooks.d.ts +0 -1
  71. package/es/components/eftpos/icon/apiKey.d.ts +0 -1
  72. package/es/components/eftpos/icon/device.d.ts +0 -1
  73. package/es/components/eftpos/receipt/index.d.ts +0 -1
  74. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  75. package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
  76. package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
  77. package/es/components/eftposPay/component/step/step.d.ts +0 -1
  78. package/es/components/eftposPay/const.d.ts +1 -4
  79. package/es/components/eftposPay/const.js +1 -3
  80. package/es/components/eftposPay/hooks.d.ts +1 -1
  81. package/es/components/eftposPay/hooks.js +1 -3
  82. package/es/components/eftposPay/index.js +1 -1
  83. package/es/components/eftposPay/manufacturer.d.ts +0 -1
  84. package/es/components/eftposPay/manufacturer.js +0 -4
  85. package/es/components/eftposPay/pay.d.ts +1 -1
  86. package/es/components/eftposPay/pay.js +2 -6
  87. package/es/components/eftposPay/store/index.d.ts +1 -1
  88. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  89. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +28 -31
  90. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
  91. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
  92. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  93. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  94. package/es/components/eventBooking/components/bookingDetailModal/index.js +1 -3
  95. package/es/components/eventBooking/locales.d.ts +0 -24
  96. package/es/components/eventBooking/locales.js +3 -27
  97. package/es/components/listComponent/index.js +5 -5
  98. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  99. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  100. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  101. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  102. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  103. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  104. package/es/components/pay/toC/PaymentMethods/index.js +74 -26
  105. package/es/components/pay/toC/index.js +46 -14
  106. package/es/components/pay/toC/model.d.ts +1 -9
  107. package/es/components/productExtension/card/index.js +3 -3
  108. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  109. package/es/components/productExtension/fields/Forms/index.js +12 -12
  110. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  111. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  112. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  113. package/es/components/productExtension/server.js +2 -2
  114. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  115. package/es/components/schedules/calendar/index.js +4 -4
  116. package/es/components/schedules/calendar/serve.js +2 -2
  117. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  118. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  119. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  120. package/es/components/schedules/components/ResourceList/index.js +1 -1
  121. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  122. package/es/components/schedules/components/Search/index.js +5 -5
  123. package/es/components/schedules/model.d.ts +1 -9
  124. package/es/components/schedules/model.js +5 -5
  125. package/es/components/schedules/openHours/index.js +1 -1
  126. package/es/components/schedules/openHours/serve.js +2 -2
  127. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  128. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  129. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  130. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  131. package/es/components/schedules/products/serve.js +2 -2
  132. package/es/components/schedules/products/utils.js +5 -5
  133. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  134. package/es/components/schedules/resources/detail/index.js +10 -10
  135. package/es/components/schedules/resources/list/index.js +2 -2
  136. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  137. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  138. package/es/components/schedules/resources/serve.js +2 -2
  139. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  140. package/es/components/schedules/utils.d.ts +1 -1
  141. package/es/components/schedules/utils.js +4 -4
  142. package/es/components/selectModal/index.js +2 -2
  143. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  144. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  145. package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
  146. package/es/components/wallet/Detail/model.d.ts +1 -13
  147. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  148. package/es/components/wallet/PointCard/model.d.ts +1 -13
  149. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  150. package/es/components/wallet/Voucher/model.d.ts +1 -13
  151. package/es/components/wallet/model.d.ts +1 -9
  152. package/es/hooks/useComponents.js +1 -1
  153. package/es/utils/index.d.ts +1 -1
  154. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  155. package/lib/components/Sales/Cart/index.js +8 -5
  156. package/lib/components/Sales/Cart/utils.d.ts +0 -40
  157. package/lib/components/Sales/Cart/utils.js +0 -117
  158. package/lib/components/Sales/Checkout/index.d.ts +0 -4
  159. package/lib/components/Sales/Checkout/index.js +7 -39
  160. package/lib/components/Sales/Checkout/serve.d.ts +0 -13
  161. package/lib/components/Sales/Checkout/serve.js +2 -7
  162. package/lib/components/Sales/Checkout/utils.d.ts +6 -1
  163. package/lib/components/Sales/Checkout/utils.js +5 -5
  164. package/lib/components/Sales/Customer/index.d.ts +1 -0
  165. package/lib/components/Sales/Customer/index.js +1 -0
  166. package/lib/components/Sales/Summary/index.d.ts +0 -10
  167. package/lib/components/Sales/Summary/index.js +1 -7
  168. package/lib/components/Sales/Summary/serve.d.ts +0 -1
  169. package/lib/components/Sales/Summary/serve.js +0 -32
  170. package/lib/components/Sales/Summary/utils.d.ts +0 -15
  171. package/lib/components/Sales/Summary/utils.js +1 -30
  172. package/lib/components/appointmentBooking/components/Cart/Item/index.js +0 -1
  173. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  174. package/lib/components/appointmentBooking/components/Content/index.js +1 -6
  175. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  176. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
  177. package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
  178. package/lib/components/appointmentBooking/components/Form/index.js +6 -1
  179. package/lib/components/appointmentBooking/components/Form/utils.d.ts +1 -1
  180. package/lib/components/appointmentBooking/components/Form/utils.js +9 -12
  181. package/lib/components/appointmentBooking/components/Header/index.js +1 -0
  182. package/lib/components/appointmentBooking/components/Resource/index.js +0 -1
  183. package/lib/components/appointmentBooking/components/Services/index.js +11 -6
  184. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
  185. package/lib/components/appointmentBooking/deposit/index.js +2 -4
  186. package/lib/components/appointmentBooking/index.js +0 -11
  187. package/lib/components/appointmentBooking/index.less +1 -1
  188. package/lib/components/booking/addons/model.d.ts +1 -10
  189. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  190. package/lib/components/booking/components/voucher/index.js +2 -2
  191. package/lib/components/booking/forms/model.d.ts +1 -10
  192. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  193. package/lib/components/booking/info/model.d.ts +1 -10
  194. package/lib/components/booking/info/service/like/index.d.ts +0 -1
  195. package/lib/components/booking/info/service/serviceManager/index.js +3 -3
  196. package/lib/components/booking/info2/index.js +21 -11
  197. package/lib/components/booking/info2/utils.d.ts +4 -0
  198. package/lib/components/booking/model.d.ts +1 -9
  199. package/lib/components/booking/notes/model.d.ts +1 -10
  200. package/lib/components/booking/payments/model.d.ts +1 -10
  201. package/lib/components/eftpos/deviceList/index.d.ts +0 -1
  202. package/lib/components/eftpos/form/index.d.ts +0 -1
  203. package/lib/components/eftpos/group/index.d.ts +0 -1
  204. package/lib/components/eftpos/hooks.d.ts +0 -1
  205. package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
  206. package/lib/components/eftpos/icon/device.d.ts +0 -1
  207. package/lib/components/eftpos/receipt/index.d.ts +0 -1
  208. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  209. package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
  210. package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
  211. package/lib/components/eftposPay/component/step/step.d.ts +0 -1
  212. package/lib/components/eftposPay/const.d.ts +1 -4
  213. package/lib/components/eftposPay/const.js +0 -2
  214. package/lib/components/eftposPay/hooks.d.ts +1 -1
  215. package/lib/components/eftposPay/hooks.js +4 -11
  216. package/lib/components/eftposPay/index.js +1 -1
  217. package/lib/components/eftposPay/manufacturer.d.ts +0 -1
  218. package/lib/components/eftposPay/manufacturer.js +0 -6
  219. package/lib/components/eftposPay/pay.d.ts +1 -1
  220. package/lib/components/eftposPay/pay.js +2 -13
  221. package/lib/components/eftposPay/store/index.d.ts +1 -1
  222. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  223. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -21
  224. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
  225. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
  226. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  227. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  228. package/lib/components/eventBooking/components/bookingDetailModal/index.js +1 -1
  229. package/lib/components/eventBooking/locales.d.ts +0 -24
  230. package/lib/components/eventBooking/locales.js +3 -27
  231. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  232. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  233. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  234. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  235. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  236. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  237. package/lib/components/pay/toC/PaymentMethods/index.js +39 -12
  238. package/lib/components/pay/toC/index.js +29 -9
  239. package/lib/components/pay/toC/model.d.ts +1 -9
  240. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  241. package/lib/components/schedules/model.d.ts +1 -9
  242. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  243. package/lib/components/schedules/utils.d.ts +1 -1
  244. package/lib/components/schedules/utils.js +1 -1
  245. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  246. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  247. package/lib/components/ticketBooking/components/ticketBooking/index.js +25 -25
  248. package/lib/components/wallet/Detail/model.d.ts +1 -13
  249. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  250. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  251. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  252. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  253. package/lib/components/wallet/model.d.ts +1 -9
  254. package/lib/utils/index.d.ts +1 -1
  255. package/package.json +4 -4
  256. package/es/components/eftposPay/linkly/const.d.ts +0 -23
  257. package/es/components/eftposPay/linkly/const.js +0 -82
  258. package/es/components/eftposPay/linkly/hooks/index.d.ts +0 -2
  259. package/es/components/eftposPay/linkly/hooks/index.js +0 -2
  260. package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
  261. package/es/components/eftposPay/linkly/hooks/normal.js +0 -321
  262. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
  263. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
  264. package/es/components/eftposPay/linkly/index.d.ts +0 -2
  265. package/es/components/eftposPay/linkly/index.js +0 -197
  266. package/es/components/eftposPay/linkly/service.d.ts +0 -32
  267. package/es/components/eftposPay/linkly/service.js +0 -81
  268. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
  269. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
  270. package/lib/components/eftposPay/linkly/const.d.ts +0 -23
  271. package/lib/components/eftposPay/linkly/const.js +0 -102
  272. package/lib/components/eftposPay/linkly/hooks/index.d.ts +0 -2
  273. package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
  274. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
  275. package/lib/components/eftposPay/linkly/hooks/normal.js +0 -242
  276. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
  277. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
  278. package/lib/components/eftposPay/linkly/index.d.ts +0 -2
  279. package/lib/components/eftposPay/linkly/index.js +0 -208
  280. package/lib/components/eftposPay/linkly/service.d.ts +0 -32
  281. package/lib/components/eftposPay/linkly/service.js +0 -55
  282. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
  283. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
@@ -1,197 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import React, { useEffect, useRef } from 'react';
8
- import { Button } from 'antd';
9
- import { locales } from '@pisell/utils';
10
- import { useContextData, useDispatch, updateCustom, updateState, updateNextStep } from "../store";
11
- import { useFail, useStoreRef } from "../hooks";
12
- import useEngineContext from "../../../hooks/useEngineContext";
13
- import { request } from "../../../utils";
14
- import Step from "../component/step/step";
15
- import { StatusEnum } from "../const";
16
- import { useLinklyCancel, useLinklyPayOrRefund, useTimeResultQuery, useLinklySignature } from "./hooks";
17
- import { LinklyActionStatus } from "./const";
18
- import { getPayParams } from "../helper";
19
- var Linkly = function Linkly(_ref) {
20
- var api = _ref.api,
21
- onChange = _ref.onChange;
22
- // 设置request
23
- var context = useEngineContext();
24
- var utils = context.appHelper.utils || {};
25
- request.setRequest(utils === null || utils === void 0 ? void 0 : utils.request);
26
- var _useContextData = useContextData(),
27
- custom = _useContextData.custom,
28
- status = _useContextData.status;
29
- var _useStoreRef = useStoreRef(),
30
- statusRef = _useStoreRef.statusRef,
31
- netRef = _useStoreRef.netRef,
32
- modeRef = _useStoreRef.modeRef,
33
- amountRef = _useStoreRef.amountRef,
34
- orderIdRef = _useStoreRef.orderIdRef,
35
- numRef = _useStoreRef.numRef,
36
- deviceRef = _useStoreRef.deviceRef,
37
- payRef = _useStoreRef.payRef;
38
- var dispatch = useDispatch();
39
- var stepRef = useRef(custom === null || custom === void 0 ? void 0 : custom.step);
40
- var fail = useFail(0);
41
- var failRef = useRef(fail);
42
- var initRef = useRef(false);
43
- var controllerRef = useRef();
44
- var unloadRef = useRef(false);
45
- var clearRef = useRef();
46
-
47
- // 检查是否可以继续处理接口返回结果,无网 或 已卸载 则不进行处理
48
- var handleCheck = function handleCheck() {
49
- return !(unloadRef.current || !netRef.current);
50
- };
51
- var handleLinklySuccess = function handleLinklySuccess(res) {
52
- var resData = (res === null || res === void 0 ? void 0 : res.data) || {};
53
- var receipt = Array.isArray(resData === null || resData === void 0 ? void 0 : resData.receipt) ? resData.receipt : [resData.receipt];
54
- receipt = receipt.filter(function (item) {
55
- return typeof item === 'string';
56
- }).filter(Boolean);
57
- dispatch(updateNextStep());
58
- // 将所有步骤状态设为完成 resolve
59
- dispatch(updateCustom({
60
- card_reader_surcharge: (resData === null || resData === void 0 ? void 0 : resData.card_reader_surcharge) || 0,
61
- receipt: receipt
62
- }));
63
-
64
- // 更新支付状态与文案
65
- dispatch(updateState({
66
- status: 'success',
67
- title: locales.getText('page.eftpos-pay.text.successful')(modeRef.current)
68
- }));
69
- clearRef.current = setTimeout(function () {
70
- var _deviceRef$current;
71
- var params = getPayParams({
72
- mode: modeRef.current,
73
- amount: amountRef.current,
74
- order_id: orderIdRef.current,
75
- number: numRef.current,
76
- device: deviceRef.current,
77
- pay: payRef.current,
78
- custom: {
79
- card_reader_surcharge: (resData === null || resData === void 0 ? void 0 : resData.card_reader_surcharge) || 0,
80
- receipt: receipt
81
- }
82
- }, 'success');
83
- onChange('success', _objectSpread(_objectSpread({}, params), {}, {
84
- receipt: (_deviceRef$current = deviceRef.current) !== null && _deviceRef$current !== void 0 && (_deviceRef$current = _deviceRef$current.setting) !== null && _deviceRef$current !== void 0 && _deviceRef$current.receipts ? [] : receipt
85
- }));
86
- }, 1000);
87
- };
88
- var _useLinklyPayOrRefund = useLinklyPayOrRefund(handleCheck),
89
- payOrRefund = _useLinklyPayOrRefund.payOrRefund;
90
- var _useLinklyCancel = useLinklyCancel(handleCheck),
91
- linklyCancel = _useLinklyCancel.linklyCancel;
92
- var _useTimeResultQuery = useTimeResultQuery(api, handleCheck, handleLinklySuccess),
93
- resultQuery = _useTimeResultQuery.run,
94
- stopResultQuery = _useTimeResultQuery.stop;
95
- var _useLinklySignature = useLinklySignature(handleCheck),
96
- linklySignature = _useLinklySignature.linklySignature;
97
- useEffect(function () {
98
- stepRef.current = custom === null || custom === void 0 ? void 0 : custom.step;
99
- }, [custom === null || custom === void 0 ? void 0 : custom.step]);
100
- useEffect(function () {
101
- failRef.current = fail;
102
- }, [fail]);
103
- useEffect(function () {
104
- if (statusRef.current === StatusEnum.Success || statusRef.current === StatusEnum.Fail) {
105
- return;
106
- }
107
- if (initRef.current) {
108
- return;
109
- }
110
- initRef.current = true;
111
-
112
- // 存在支付流水号
113
- if (numRef.current) {
114
- resultQuery();
115
- return;
116
- }
117
- payOrRefund(resultQuery, handleLinklySuccess);
118
- }, []);
119
- useEffect(function () {
120
- return function () {
121
- var _controllerRef$curren;
122
- (_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 || _controllerRef$curren.abort();
123
- unloadRef.current = true;
124
- if (clearRef.current) {
125
- clearTimeout(clearRef.current);
126
- }
127
- };
128
- }, []);
129
-
130
- /**
131
- * 取消支付
132
- */
133
- var onCancel = function onCancel() {
134
- stopResultQuery();
135
- linklyCancel(resultQuery);
136
- };
137
-
138
- /**
139
- * 拒绝签名
140
- */
141
- var onDecline = function onDecline() {
142
- stopResultQuery();
143
- linklySignature(2, resultQuery);
144
- };
145
-
146
- /**
147
- * 接受签名
148
- */
149
- var onAccept = function onAccept() {
150
- stopResultQuery();
151
- linklySignature(3, resultQuery);
152
- };
153
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
154
- className: "pisell-lowcode__eft-pay-body"
155
- }, ((custom === null || custom === void 0 ? void 0 : custom.list) || []).map(function (item) {
156
- return /*#__PURE__*/React.createElement(Step, {
157
- key: item.index,
158
- pedding: item.pedding,
159
- resolve: item.resolve,
160
- reject: item.reject,
161
- status: item.status
162
- });
163
- }), status === StatusEnum.Loading ? /*#__PURE__*/React.createElement("div", {
164
- className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
165
- }, locales.getText('page.eftpos-pay.text.processing')) : null, status === StatusEnum.Question ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
166
- className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
167
- }, locales.getText('page.eftpos-pay.text.receipt.again.title')), /*#__PURE__*/React.createElement("div", {
168
- className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
169
- }, locales.getText('page.eftpos-pay.text.receipt.again.text'))) : null, status === StatusEnum.Success ? /*#__PURE__*/React.createElement("div", {
170
- className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
171
- }, locales.getText('page.eftpos-pay.text.transaction.end')) : null), (custom === null || custom === void 0 ? void 0 : custom.actionStatus) === LinklyActionStatus.Cancel ? /*#__PURE__*/React.createElement("div", {
172
- className: "pisell-lowcode__eft-pay-step-item-btns"
173
- }, /*#__PURE__*/React.createElement(Button, {
174
- block: true,
175
- className: "pisell-lowcode__eft-pay-step-item-btn",
176
- onClick: onCancel,
177
- disabled: !!(custom !== null && custom !== void 0 && custom.buttonDisabled)
178
- }, locales.getText('page.eftpos-pay.text.cancel'))) : null, (custom === null || custom === void 0 ? void 0 : custom.actionStatus) === LinklyActionStatus.CancelWaiting || (custom === null || custom === void 0 ? void 0 : custom.actionStatus) === LinklyActionStatus.SignatureWaiting ? /*#__PURE__*/React.createElement("div", {
179
- className: "pisell-lowcode__eft-pay-step-item-btns"
180
- }, /*#__PURE__*/React.createElement(Button, {
181
- block: true,
182
- className: "pisell-lowcode__eft-pay-step-item-btn",
183
- disabled: true
184
- }, locales.getText('page.eftpos-pay.text.leave'))) : null, (custom === null || custom === void 0 ? void 0 : custom.actionStatus) === LinklyActionStatus.Signature ? /*#__PURE__*/React.createElement("div", {
185
- className: "pisell-lowcode__eft-pay-step-item-btns"
186
- }, /*#__PURE__*/React.createElement(Button, {
187
- block: true,
188
- className: "pisell-lowcode__eft-pay-step-item-btn",
189
- onClick: onDecline
190
- }, locales.getText('page.eftpos-pay.text.decline')), /*#__PURE__*/React.createElement(Button, {
191
- block: true,
192
- type: "primary",
193
- className: "pisell-lowcode__eft-pay-step-item-btn",
194
- onClick: onAccept
195
- }, locales.getText('page.eftpos-pay.text.accept'))) : null);
196
- };
197
- export default Linkly;
@@ -1,32 +0,0 @@
1
- /**
2
- * linkly支付接口
3
- */
4
- export declare const linklyPayApi: (data: any) => Promise<any>;
5
- /**
6
- * 查询linkly支付结果
7
- */
8
- export declare const linklyPayQueryApi: (param: any) => Promise<any>;
9
- /**
10
- * 取消linkly支付
11
- */
12
- export declare const linklyPayCancelApi: (param: any) => Promise<any>;
13
- /**
14
- * linkly支付签名结果处理
15
- */
16
- export declare const linklyPaySignatureApi: (param: any) => Promise<any>;
17
- /**
18
- * linkly退款接口
19
- */
20
- export declare const linklyRefundApi: (data: any) => Promise<any>;
21
- /**
22
- * 查询linkly退款结果
23
- */
24
- export declare const linklyRefundQueryApi: (param: any) => Promise<any>;
25
- /**
26
- * 取消linkly退款
27
- */
28
- export declare const linklyRefundCancelApi: (param: any) => Promise<any>;
29
- /**
30
- * linkly退款签名结果处理
31
- */
32
- export declare const linklyRefundSignatureApi: (param: any) => Promise<any>;
@@ -1,81 +0,0 @@
1
- import { request } from "../../../utils";
2
-
3
- /**
4
- * linkly支付接口
5
- */
6
- export var linklyPayApi = function linklyPayApi(data) {
7
- return request.getRequest().post('/shop/linkly/pay/apply', data, {
8
- customMessage: true,
9
- fullResult: true
10
- });
11
- };
12
-
13
- /**
14
- * 查询linkly支付结果
15
- */
16
- export var linklyPayQueryApi = function linklyPayQueryApi(param) {
17
- return request.getRequest().get('/shop/linkly/pay/query', param, {
18
- customMessage: true,
19
- fullResult: true
20
- });
21
- };
22
-
23
- /**
24
- * 取消linkly支付
25
- */
26
- export var linklyPayCancelApi = function linklyPayCancelApi(param) {
27
- return request.getRequest().post('/shop/linkly/pay/cancel', param, {
28
- customMessage: true,
29
- fullResult: true
30
- });
31
- };
32
-
33
- /**
34
- * linkly支付签名结果处理
35
- */
36
- export var linklyPaySignatureApi = function linklyPaySignatureApi(param) {
37
- return request.getRequest().post('/shop/linkly/pay/signature', param, {
38
- customMessage: true,
39
- fullResult: true
40
- });
41
- };
42
-
43
- /**
44
- * linkly退款接口
45
- */
46
- export var linklyRefundApi = function linklyRefundApi(data) {
47
- return request.getRequest().post('/shop/linkly/refund/apply', data, {
48
- customMessage: true,
49
- fullResult: true
50
- });
51
- };
52
-
53
- /**
54
- * 查询linkly退款结果
55
- */
56
- export var linklyRefundQueryApi = function linklyRefundQueryApi(param) {
57
- return request.getRequest().get('/shop/linkly/refund/query', param, {
58
- customMessage: true,
59
- fullResult: true
60
- });
61
- };
62
-
63
- /**
64
- * 取消linkly退款
65
- */
66
- export var linklyRefundCancelApi = function linklyRefundCancelApi(param) {
67
- return request.getRequest().post('/shop/linkly/refund/cancel', param, {
68
- customMessage: true,
69
- fullResult: true
70
- });
71
- };
72
-
73
- /**
74
- * linkly退款签名结果处理
75
- */
76
- export var linklyRefundSignatureApi = function linklyRefundSignatureApi(param) {
77
- return request.getRequest().post('/shop/linkly/refund/signature', param, {
78
- customMessage: true,
79
- fullResult: true
80
- });
81
- };
@@ -1,2 +0,0 @@
1
- declare const Deposit: () => JSX.Element;
2
- export default Deposit;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { useSummary } from "../../../../../Sales";
3
- import { DepositContent } from "../../../../../appointmentBooking/components/Deposit";
4
- var Deposit = function Deposit() {
5
- var _useSummary = useSummary(),
6
- deposit = _useSummary.deposit,
7
- isAgreeDepositPolicy = _useSummary.isAgreeDepositPolicy,
8
- setIsAgreeDepositPolicy = _useSummary.setIsAgreeDepositPolicy,
9
- getDepositProtocol = _useSummary.getDepositProtocol;
10
- return /*#__PURE__*/React.createElement(DepositContent, {
11
- isAgreeDepositPolicy: !!isAgreeDepositPolicy,
12
- setIsAgreeDepositPolicy: setIsAgreeDepositPolicy,
13
- deposit: deposit,
14
- depositProtocolRequest: getDepositProtocol
15
- });
16
- };
17
- export default Deposit;
@@ -1,23 +0,0 @@
1
- import { State } from '../store';
2
- import { ModeEnum } from '../const';
3
- export declare const getStep: (mode?: ModeEnum) => State['steps'];
4
- declare const _default: (params: any) => State;
5
- export default _default;
6
- export declare enum EVisibleButtonType {
7
- /** 取消按钮 */
8
- CancelButton = "CancelButton",
9
- /** 等待按钮 */
10
- WaitButton = "WaitButton"
11
- }
12
- export declare enum LinklyActionStatus {
13
- /** 空 */
14
- Empty = "Empty",
15
- /** 取消 */
16
- Cancel = "Cancel",
17
- /** 取消中 */
18
- CancelWaiting = "CancelWaiting",
19
- /** 签名 */
20
- Signature = "Signature",
21
- /** 签名等待中 */
22
- SignatureWaiting = "SignatureWaiting"
23
- }
@@ -1,102 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/components/eftposPay/linkly/const.ts
20
- var const_exports = {};
21
- __export(const_exports, {
22
- EVisibleButtonType: () => EVisibleButtonType,
23
- LinklyActionStatus: () => LinklyActionStatus,
24
- default: () => const_default,
25
- getStep: () => getStep
26
- });
27
- module.exports = __toCommonJS(const_exports);
28
- var import_utils = require("@pisell/utils");
29
- var import_const = require("../const");
30
- var getStep = (mode = import_const.ModeEnum.Pay) => [
31
- {
32
- key: Date.now(),
33
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
34
- // 'Payment in process...',
35
- text: import_utils.locales.getText("page.eftpos-pay.text.waiting.processing"),
36
- // 'Waiting for the processing...',
37
- warn: "",
38
- tip: import_utils.locales.getText("page.eftpos-pay.text.processing"),
39
- // 'processing...',
40
- status: import_const.StatusEnum.Loading
41
- }
42
- ];
43
- var const_default = (params) => {
44
- const {
45
- order_id,
46
- name,
47
- symbol,
48
- amount,
49
- mode,
50
- number,
51
- pay,
52
- device,
53
- net,
54
- client,
55
- ...other
56
- } = params || {
57
- mode: import_const.ModeEnum.Pay
58
- };
59
- console.log("params =>>>>>> ", params);
60
- return {
61
- order_id,
62
- name,
63
- symbol,
64
- amount,
65
- mode,
66
- eftpos: import_const.EftposEnum.Linkly,
67
- key: Date.now(),
68
- step: 0,
69
- type: import_const.PayRouteEnum.Step,
70
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
71
- component: "",
72
- status: import_const.StatusEnum.Loading,
73
- steps: getStep(mode),
74
- render: true,
75
- client: client !== "undefined" ? client : import_const.ClientEnum.Merchant,
76
- warn: "",
77
- custom: other || {},
78
- ...typeof net !== "undefined" ? { net } : {},
79
- ...typeof number !== "undefined" ? { number } : {},
80
- ...typeof pay !== "undefined" ? { pay } : {},
81
- ...typeof device !== "undefined" ? { device } : {}
82
- };
83
- };
84
- var EVisibleButtonType = /* @__PURE__ */ ((EVisibleButtonType2) => {
85
- EVisibleButtonType2["CancelButton"] = "CancelButton";
86
- EVisibleButtonType2["WaitButton"] = "WaitButton";
87
- return EVisibleButtonType2;
88
- })(EVisibleButtonType || {});
89
- var LinklyActionStatus = /* @__PURE__ */ ((LinklyActionStatus2) => {
90
- LinklyActionStatus2["Empty"] = "Empty";
91
- LinklyActionStatus2["Cancel"] = "Cancel";
92
- LinklyActionStatus2["CancelWaiting"] = "CancelWaiting";
93
- LinklyActionStatus2["Signature"] = "Signature";
94
- LinklyActionStatus2["SignatureWaiting"] = "SignatureWaiting";
95
- return LinklyActionStatus2;
96
- })(LinklyActionStatus || {});
97
- // Annotate the CommonJS export names for ESM import in node:
98
- 0 && (module.exports = {
99
- EVisibleButtonType,
100
- LinklyActionStatus,
101
- getStep
102
- });
@@ -1,2 +0,0 @@
1
- export * from './normal';
2
- export * from './useTimeQuery';
@@ -1,25 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/components/eftposPay/linkly/hooks/index.ts
17
- var hooks_exports = {};
18
- module.exports = __toCommonJS(hooks_exports);
19
- __reExport(hooks_exports, require("./normal"), module.exports);
20
- __reExport(hooks_exports, require("./useTimeQuery"), module.exports);
21
- // Annotate the CommonJS export names for ESM import in node:
22
- 0 && (module.exports = {
23
- ...require("./normal"),
24
- ...require("./useTimeQuery")
25
- });
@@ -1,30 +0,0 @@
1
- /**
2
- * 支付或退款
3
- * @param failAction 失败回调
4
- */
5
- export declare const useLinklyPayOrRefund: (handleCheck: () => boolean) => {
6
- action: {
7
- pay: import("ahooks/lib/useRequest/src/types").Result<any, [data: any]>;
8
- };
9
- payOrRefund: (resultQuery: any, handleLinklySuccess: any) => void;
10
- };
11
- /**
12
- * @title: 取消支付或退款
13
- * @description: 取消支付或退款调用接口后不管成功还是失败都需要调用支付查询接口
14
- */
15
- export declare const useLinklyCancel: (handleCheck: () => boolean) => {
16
- action: {
17
- cancel: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
18
- };
19
- linklyCancel: (resultQuery: any) => void;
20
- };
21
- /**
22
- * @title: 支付或退款签名
23
- * @description: 支付或退款签名调用接口后不管成功还是失败都需要调用支付查询接口
24
- */
25
- export declare const useLinklySignature: (handleCheck: () => boolean) => {
26
- action: {
27
- signature: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
28
- };
29
- linklySignature: (status: number, resultQuery: any) => void;
30
- };