@pisell/private-materials 3.3.99 → 3.3.100

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 (273) 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/businessModel/SalesModel/index.d.ts +0 -1
  12. package/es/components/Sales/Cart/index.js +5 -1
  13. package/es/components/Sales/Cart/utils.d.ts +40 -0
  14. package/es/components/Sales/Cart/utils.js +167 -0
  15. package/es/components/Sales/Checkout/index.d.ts +4 -0
  16. package/es/components/Sales/Checkout/index.js +52 -8
  17. package/es/components/Sales/Checkout/serve.d.ts +13 -0
  18. package/es/components/Sales/Checkout/serve.js +16 -2
  19. package/es/components/Sales/Checkout/utils.js +7 -1
  20. package/es/components/Sales/Summary/index.d.ts +10 -0
  21. package/es/components/Sales/Summary/index.js +17 -2
  22. package/es/components/Sales/Summary/serve.d.ts +1 -0
  23. package/es/components/Sales/Summary/serve.js +6 -0
  24. package/es/components/Sales/Summary/utils.d.ts +15 -0
  25. package/es/components/Sales/Summary/utils.js +43 -1
  26. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  27. package/es/components/appointmentBooking/components/Content/index.js +15 -1
  28. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  29. package/es/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  30. package/es/components/appointmentBooking/components/Deposit/index.js +27 -7
  31. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  32. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  33. package/es/components/appointmentBooking/components/Services/index.js +23 -27
  34. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +25 -20
  35. package/es/components/appointmentBooking/deposit/index.js +4 -2
  36. package/es/components/appointmentBooking/index.js +14 -0
  37. package/es/components/appointmentBooking/index.less +1 -1
  38. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  39. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  40. package/es/components/booking/components/voucher/index.js +2 -2
  41. package/es/components/booking/forms/table/index.d.ts +0 -1
  42. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  43. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  44. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  45. package/es/components/booking/info/hooks/useInfoHolder.js +8 -1
  46. package/es/components/booking/info/index.d.ts +0 -1
  47. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  48. package/es/components/booking/info/service/like/index.d.ts +0 -1
  49. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  50. package/es/components/booking/info/service2/utils.d.ts +1 -1
  51. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  52. package/es/components/booking/utils.d.ts +2 -2
  53. package/es/components/eftpos/deviceList/index.d.ts +0 -1
  54. package/es/components/eftpos/form/index.d.ts +0 -1
  55. package/es/components/eftpos/group/index.d.ts +0 -1
  56. package/es/components/eftpos/hooks.d.ts +0 -1
  57. package/es/components/eftpos/icon/apiKey.d.ts +0 -1
  58. package/es/components/eftpos/icon/device.d.ts +0 -1
  59. package/es/components/eftpos/receipt/index.d.ts +0 -1
  60. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  61. package/es/components/eftposPay/amount.d.ts +1 -1
  62. package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
  63. package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
  64. package/es/components/eftposPay/component/step/index.d.ts +0 -1
  65. package/es/components/eftposPay/component/step/step.d.ts +0 -1
  66. package/es/components/eftposPay/const.d.ts +4 -1
  67. package/es/components/eftposPay/const.js +3 -1
  68. package/es/components/eftposPay/device.d.ts +1 -1
  69. package/es/components/eftposPay/hooks.d.ts +2 -2
  70. package/es/components/eftposPay/hooks.js +3 -1
  71. package/es/components/eftposPay/index.js +1 -1
  72. package/es/components/eftposPay/linkly/const.d.ts +23 -0
  73. package/es/components/eftposPay/linkly/const.js +82 -0
  74. package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  75. package/es/components/eftposPay/linkly/hooks/index.js +2 -0
  76. package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  77. package/es/components/eftposPay/linkly/hooks/normal.js +321 -0
  78. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  79. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +273 -0
  80. package/es/components/eftposPay/linkly/index.d.ts +2 -0
  81. package/es/components/eftposPay/linkly/index.js +197 -0
  82. package/es/components/eftposPay/linkly/service.d.ts +32 -0
  83. package/es/components/eftposPay/linkly/service.js +81 -0
  84. package/es/components/eftposPay/manufacturer.d.ts +1 -0
  85. package/es/components/eftposPay/manufacturer.js +4 -0
  86. package/es/components/eftposPay/pay.d.ts +1 -1
  87. package/es/components/eftposPay/pay.js +6 -2
  88. package/es/components/eftposPay/store/index.d.ts +4 -4
  89. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  90. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  91. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +29 -17
  92. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  93. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +17 -0
  94. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +10 -6
  95. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  96. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  97. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  98. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  99. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  100. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  101. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  102. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  103. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  104. package/es/components/eventBooking/components/bookingDetailModal/index.js +3 -1
  105. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  106. package/es/components/eventBooking/locales.d.ts +24 -0
  107. package/es/components/eventBooking/locales.js +27 -3
  108. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  109. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  110. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  111. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  112. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  113. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  114. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  115. package/es/components/pay/toC/PaymentMethods/index.js +5 -4
  116. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  117. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  118. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  119. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  120. package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
  121. package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
  122. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  123. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  124. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  125. package/es/components/schedules/products/index.d.ts +0 -1
  126. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  127. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  128. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  129. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  130. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  131. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  132. package/es/components/ticketBooking/components/menuBar/index.d.ts +0 -1
  133. package/es/components/ticketBooking/components/ticketBooking/index.js +120 -1
  134. package/es/components/ticketBooking/locales.d.ts +164 -146
  135. package/es/components/ticketBooking/locales.js +195 -147
  136. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  137. package/es/components/ticketBooking/utils/formatProductMessage.js +62 -0
  138. package/es/components/ticketBooking/utils/formatTime.d.ts +31 -0
  139. package/es/components/ticketBooking/utils/formatTime.js +144 -0
  140. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  141. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  142. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  143. package/lib/components/Sales/Cart/index.js +1 -0
  144. package/lib/components/Sales/Cart/utils.d.ts +40 -0
  145. package/lib/components/Sales/Cart/utils.js +117 -0
  146. package/lib/components/Sales/Checkout/index.d.ts +4 -0
  147. package/lib/components/Sales/Checkout/index.js +39 -7
  148. package/lib/components/Sales/Checkout/serve.d.ts +13 -0
  149. package/lib/components/Sales/Checkout/serve.js +7 -2
  150. package/lib/components/Sales/Checkout/utils.js +2 -0
  151. package/lib/components/Sales/Summary/index.d.ts +10 -0
  152. package/lib/components/Sales/Summary/index.js +7 -1
  153. package/lib/components/Sales/Summary/serve.d.ts +1 -0
  154. package/lib/components/Sales/Summary/serve.js +32 -0
  155. package/lib/components/Sales/Summary/utils.d.ts +15 -0
  156. package/lib/components/Sales/Summary/utils.js +30 -1
  157. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  158. package/lib/components/appointmentBooking/components/Content/index.js +6 -1
  159. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  160. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
  161. package/lib/components/appointmentBooking/components/Deposit/index.js +36 -4
  162. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  163. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  164. package/lib/components/appointmentBooking/components/Services/index.js +6 -11
  165. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +8 -4
  166. package/lib/components/appointmentBooking/deposit/index.js +4 -2
  167. package/lib/components/appointmentBooking/index.js +11 -0
  168. package/lib/components/appointmentBooking/index.less +1 -1
  169. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  170. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  171. package/lib/components/booking/components/voucher/index.js +2 -2
  172. package/lib/components/booking/forms/table/index.d.ts +0 -1
  173. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  174. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  175. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  176. package/lib/components/booking/info/hooks/useInfoHolder.js +6 -1
  177. package/lib/components/booking/info/index.d.ts +0 -1
  178. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  179. package/lib/components/booking/info/service/like/index.d.ts +0 -1
  180. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  181. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  182. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  183. package/lib/components/booking/utils.d.ts +2 -2
  184. package/lib/components/eftpos/deviceList/index.d.ts +0 -1
  185. package/lib/components/eftpos/form/index.d.ts +0 -1
  186. package/lib/components/eftpos/group/index.d.ts +0 -1
  187. package/lib/components/eftpos/hooks.d.ts +0 -1
  188. package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
  189. package/lib/components/eftpos/icon/device.d.ts +0 -1
  190. package/lib/components/eftpos/receipt/index.d.ts +0 -1
  191. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  192. package/lib/components/eftposPay/amount.d.ts +1 -1
  193. package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
  194. package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
  195. package/lib/components/eftposPay/component/step/index.d.ts +0 -1
  196. package/lib/components/eftposPay/component/step/step.d.ts +0 -1
  197. package/lib/components/eftposPay/const.d.ts +4 -1
  198. package/lib/components/eftposPay/const.js +2 -0
  199. package/lib/components/eftposPay/device.d.ts +1 -1
  200. package/lib/components/eftposPay/hooks.d.ts +2 -2
  201. package/lib/components/eftposPay/hooks.js +11 -4
  202. package/lib/components/eftposPay/index.js +1 -1
  203. package/lib/components/eftposPay/linkly/const.d.ts +23 -0
  204. package/lib/components/eftposPay/linkly/const.js +102 -0
  205. package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  206. package/lib/components/eftposPay/linkly/hooks/index.js +25 -0
  207. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  208. package/lib/components/eftposPay/linkly/hooks/normal.js +242 -0
  209. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  210. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +222 -0
  211. package/lib/components/eftposPay/linkly/index.d.ts +2 -0
  212. package/lib/components/eftposPay/linkly/index.js +208 -0
  213. package/lib/components/eftposPay/linkly/service.d.ts +32 -0
  214. package/lib/components/eftposPay/linkly/service.js +55 -0
  215. package/lib/components/eftposPay/manufacturer.d.ts +1 -0
  216. package/lib/components/eftposPay/manufacturer.js +6 -0
  217. package/lib/components/eftposPay/pay.d.ts +1 -1
  218. package/lib/components/eftposPay/pay.js +13 -2
  219. package/lib/components/eftposPay/store/index.d.ts +4 -4
  220. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  221. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  222. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +16 -3
  223. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
  224. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +55 -0
  225. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +8 -5
  226. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
  227. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  228. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  229. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  230. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  231. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  232. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  233. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  234. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  235. package/lib/components/eventBooking/components/bookingDetailModal/index.js +1 -1
  236. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  237. package/lib/components/eventBooking/locales.d.ts +24 -0
  238. package/lib/components/eventBooking/locales.js +27 -3
  239. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  240. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  241. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  242. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  243. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  244. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  245. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  246. package/lib/components/pay/toC/PaymentMethods/index.js +10 -9
  247. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  248. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  249. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  250. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  251. package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
  252. package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
  253. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  254. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  255. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  256. package/lib/components/schedules/products/index.d.ts +0 -1
  257. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  258. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  259. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  260. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  261. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  262. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  263. package/lib/components/ticketBooking/components/menuBar/index.d.ts +0 -1
  264. package/lib/components/ticketBooking/components/ticketBooking/index.js +120 -1
  265. package/lib/components/ticketBooking/locales.d.ts +164 -146
  266. package/lib/components/ticketBooking/locales.js +22 -4
  267. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  268. package/lib/components/ticketBooking/utils/formatProductMessage.js +84 -0
  269. package/lib/components/ticketBooking/utils/formatTime.d.ts +31 -0
  270. package/lib/components/ticketBooking/utils/formatTime.js +139 -0
  271. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  272. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  273. package/package.json +4 -4
@@ -139,6 +139,7 @@ export var useFail = function useFail(index) {
139
139
  return;
140
140
  }
141
141
  var code = "".concat(res.code);
142
+ console.log('code---->>>>>>>', code);
142
143
  if (code === PayStatus.Unknown) {
143
144
  // 前往报错页 不可标记
144
145
  steps[index].title = locales.getText('page.eftpos-pay.text.failed')(modeRef.current);
@@ -224,6 +225,7 @@ export var useFail = function useFail(index) {
224
225
  dispatch(updateComponent('Fail'));
225
226
  return;
226
227
  }
228
+
227
229
  // 重新支付 最多到重新发起2次
228
230
  ref.current += 1;
229
231
  dispatch(updateState({
@@ -300,7 +302,7 @@ export var useFail = function useFail(index) {
300
302
  }));
301
303
  return;
302
304
  }
303
- if (code === PayStatus.UserConfigError) {
305
+ if (code === PayStatus.UserConfigError || code === PayStatus.PairingFailure) {
304
306
  // 前往错误页 不可标记状态
305
307
  steps[index].title = locales.getText('page.eftpos-pay.text.transaction.user.config.title');
306
308
  steps[index].fail = locales.getText('page.eftpos-pay.text.transaction.user.config.text');
@@ -163,7 +163,7 @@ export default (function (props) {
163
163
  }, [mode, state]);
164
164
  useEffect(function () {
165
165
  document.body.id = 'body';
166
- console.log('初始化 ........11221801');
166
+ console.log('初始化 ........112218017777');
167
167
  }, []);
168
168
 
169
169
  // console.log('action = ', action);
@@ -0,0 +1,23 @@
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
+ }
@@ -0,0 +1,82 @@
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
+ var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net", "client"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+ import { locales } from '@pisell/utils';
11
+ import { ClientEnum, EftposEnum, ModeEnum, PayRouteEnum, StatusEnum } from "../const";
12
+ export var getStep = function getStep() {
13
+ var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ModeEnum.Pay;
14
+ return [{
15
+ key: Date.now(),
16
+ title: locales.getText('page.eftpos-pay.text.loading')(mode),
17
+ // 'Payment in process...',
18
+ text: locales.getText('page.eftpos-pay.text.waiting.processing'),
19
+ // 'Waiting for the processing...',
20
+ warn: '',
21
+ tip: locales.getText('page.eftpos-pay.text.processing'),
22
+ // 'processing...',
23
+ status: StatusEnum.Loading
24
+ }];
25
+ };
26
+ export default (function (params) {
27
+ var _ref = params || {
28
+ mode: ModeEnum.Pay
29
+ },
30
+ order_id = _ref.order_id,
31
+ name = _ref.name,
32
+ symbol = _ref.symbol,
33
+ amount = _ref.amount,
34
+ mode = _ref.mode,
35
+ number = _ref.number,
36
+ pay = _ref.pay,
37
+ device = _ref.device,
38
+ net = _ref.net,
39
+ client = _ref.client,
40
+ other = _objectWithoutProperties(_ref, _excluded);
41
+ console.log('params =>>>>>> ', params);
42
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
43
+ order_id: order_id,
44
+ name: name,
45
+ symbol: symbol,
46
+ amount: amount,
47
+ mode: mode,
48
+ eftpos: EftposEnum.Linkly,
49
+ key: Date.now(),
50
+ step: 0,
51
+ type: PayRouteEnum.Step,
52
+ title: locales.getText('page.eftpos-pay.text.loading')(mode),
53
+ component: '',
54
+ status: StatusEnum.Loading,
55
+ steps: getStep(mode),
56
+ render: true,
57
+ client: client !== 'undefined' ? client : ClientEnum.Merchant,
58
+ warn: '',
59
+ custom: other || {}
60
+ }, typeof net !== 'undefined' ? {
61
+ net: net
62
+ } : {}), typeof number !== 'undefined' ? {
63
+ number: number
64
+ } : {}), typeof pay !== 'undefined' ? {
65
+ pay: pay
66
+ } : {}), typeof device !== 'undefined' ? {
67
+ device: device
68
+ } : {});
69
+ });
70
+ export var EVisibleButtonType = /*#__PURE__*/function (EVisibleButtonType) {
71
+ EVisibleButtonType["CancelButton"] = "CancelButton";
72
+ EVisibleButtonType["WaitButton"] = "WaitButton";
73
+ return EVisibleButtonType;
74
+ }({});
75
+ export var LinklyActionStatus = /*#__PURE__*/function (LinklyActionStatus) {
76
+ LinklyActionStatus["Empty"] = "Empty";
77
+ LinklyActionStatus["Cancel"] = "Cancel";
78
+ LinklyActionStatus["CancelWaiting"] = "CancelWaiting";
79
+ LinklyActionStatus["Signature"] = "Signature";
80
+ LinklyActionStatus["SignatureWaiting"] = "SignatureWaiting";
81
+ return LinklyActionStatus;
82
+ }({});
@@ -0,0 +1,2 @@
1
+ export * from './normal';
2
+ export * from './useTimeQuery';
@@ -0,0 +1,2 @@
1
+ export * from "./normal";
2
+ export * from "./useTimeQuery";
@@ -0,0 +1,30 @@
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
+ };
@@ -0,0 +1,321 @@
1
+ import { useRequest } from 'ahooks';
2
+ import { useEffect, useRef } from 'react';
3
+ import { locales, sendWarningLog } from '@pisell/utils';
4
+ import { linklyPayCancelApi, linklyPayApi, linklyRefundCancelApi, linklyRefundApi, linklyPaySignatureApi, linklyRefundSignatureApi } from "../service";
5
+ import { useFail, useStoreRef } from "../../hooks";
6
+ import { ModeEnum, PayStatus, StatusEnum } from "../../const";
7
+ import { useDispatch, updateState, updateCustom, updateStatus } from "../../store";
8
+ import { LinklyActionStatus } from "../const";
9
+
10
+ /**
11
+ * 支付或退款
12
+ * @param failAction 失败回调
13
+ */
14
+ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
15
+ var dispatch = useDispatch();
16
+ var _useStoreRef = useStoreRef(),
17
+ numRef = _useStoreRef.numRef,
18
+ modeRef = _useStoreRef.modeRef,
19
+ orderIdRef = _useStoreRef.orderIdRef,
20
+ deviceRef = _useStoreRef.deviceRef,
21
+ payRef = _useStoreRef.payRef,
22
+ amountRef = _useStoreRef.amountRef;
23
+ var fail = useFail(0);
24
+ var failRef = useRef(fail);
25
+ var resultQueryRef = useRef(null);
26
+ var handleLinklySuccessRef = useRef(null);
27
+ useEffect(function () {
28
+ failRef.current = fail;
29
+ }, [fail]);
30
+ var isPay = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay;
31
+ var _pay = useRequest(isPay ? linklyPayApi : linklyRefundApi, {
32
+ manual: true,
33
+ onSuccess: function onSuccess(res) {
34
+ _onSuccess(res);
35
+ },
36
+ onError: function onError(error) {
37
+ _onError(error);
38
+
39
+ // TODO: mock数据
40
+ // console.log('mock>>>>>>');
41
+ // const res = {
42
+ // status: true,
43
+ // code: 200,
44
+ // message: '',
45
+ // data: {
46
+ // pinpad_id: 3,
47
+ // is_auto_print: 0,
48
+ // session_id: '923d4abe-6521-43c8-915b-decde8b406bd',
49
+ // status: 0,
50
+ // response_code: '00',
51
+ // response_text: 'APPROVED',
52
+ // signature_flag: 0,
53
+ // },
54
+ // };
55
+ // onSuccess(res, isPay ? 'pay' : 'refund');
56
+ }
57
+ });
58
+ var _onSuccess = function _onSuccess(res) {
59
+ var _res$data;
60
+ console.log("linkly".concat(isPay ? 'Pay' : 'Refund', "Success---->>>>>>>"), res);
61
+ if (!handleCheck()) {
62
+ return;
63
+ }
64
+ sendWarningLog({
65
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u63A5\u53E3\u6210\u529F"),
66
+ content: [{
67
+ key: 'response',
68
+ value: JSON.stringify(res)
69
+ }]
70
+ });
71
+
72
+ // status 交易状态 0:未知,继续查询 1:成功 -1:失败 -2:交易错误
73
+ // signature_flag 是否弹框确认签名 0:不用签名 1:等待签名确认 2:签名取消 3:签名确认
74
+ var status = res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.status;
75
+
76
+ // 继续查询交易状态
77
+ if (status === 0) {
78
+ var _res$data2;
79
+ // 交易流水号
80
+ numRef.current = res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.session_id;
81
+ dispatch(updateState({
82
+ number: numRef.current
83
+ }));
84
+ // 需要展示取消按钮
85
+ dispatch(updateCustom({
86
+ actionStatus: LinklyActionStatus.Cancel
87
+ }));
88
+ // 调用支付查询接口
89
+ setTimeout(function () {
90
+ var _resultQueryRef$curre;
91
+ (_resultQueryRef$curre = resultQueryRef.current) === null || _resultQueryRef$curre === void 0 || _resultQueryRef$curre.call(resultQueryRef);
92
+ });
93
+ return;
94
+ }
95
+
96
+ // 无需展示取消按钮
97
+ dispatch(updateCustom({
98
+ actionStatus: LinklyActionStatus.Empty
99
+ }));
100
+
101
+ // 交易成功
102
+ if (status === 1) {
103
+ var _handleLinklySuccessR;
104
+ (_handleLinklySuccessR = handleLinklySuccessRef.current) === null || _handleLinklySuccessR === void 0 || _handleLinklySuccessR.call(handleLinklySuccessRef, res);
105
+ return;
106
+ }
107
+
108
+ // 交易失败
109
+ if (status < 0) {
110
+ var _failRef$current;
111
+ // 需要特殊处理,将code码转换为支付失败code码
112
+ res.code = PayStatus.Unknown;
113
+ (_failRef$current = failRef.current) === null || _failRef$current === void 0 || _failRef$current.call(failRef, res, false);
114
+ }
115
+ };
116
+ var _onError = function _onError(error) {
117
+ var _failRef$current2;
118
+ console.log("linkly".concat(isPay ? 'Pay' : 'Refund', "Error---->>>>>>>"), error);
119
+ // 无网 或 已卸载 则不进行处理
120
+ if (!handleCheck()) {
121
+ return;
122
+ }
123
+ sendWarningLog({
124
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u63A5\u53E3\u5931\u8D25"),
125
+ content: [{
126
+ key: 'error',
127
+ value: JSON.stringify(error)
128
+ }]
129
+ });
130
+ (_failRef$current2 = failRef.current) === null || _failRef$current2 === void 0 || _failRef$current2.call(failRef, error, false);
131
+ };
132
+ var payOrRefund = function payOrRefund(resultQuery, handleLinklySuccess) {
133
+ var _deviceRef$current, _payRef$current;
134
+ handleLinklySuccessRef.current = handleLinklySuccess;
135
+ resultQueryRef.current = resultQuery;
136
+ var param = {
137
+ // 订单id
138
+ order_id: orderIdRef.current,
139
+ // 设备id
140
+ pinpad_id: deviceRef === null || deviceRef === void 0 || (_deviceRef$current = deviceRef.current) === null || _deviceRef$current === void 0 || (_deviceRef$current = _deviceRef$current.metadata) === null || _deviceRef$current === void 0 ? void 0 : _deviceRef$current.linkly_pinpad_id,
141
+ // 交易金额, 包含选择的订单金额+手续费,订单金额+手续费=交易金额
142
+ amount: isPay ? (_payRef$current = payRef.current) === null || _payRef$current === void 0 ? void 0 : _payRef$current.total : amountRef.current
143
+ };
144
+ sendWarningLog({
145
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund'),
146
+ content: [{
147
+ key: 'params',
148
+ value: JSON.stringify(param)
149
+ }]
150
+ });
151
+ _pay.run(param);
152
+ };
153
+ return {
154
+ action: {
155
+ pay: _pay
156
+ },
157
+ payOrRefund: payOrRefund
158
+ };
159
+ };
160
+
161
+ /**
162
+ * @title: 取消支付或退款
163
+ * @description: 取消支付或退款调用接口后不管成功还是失败都需要调用支付查询接口
164
+ */
165
+ export var useLinklyCancel = function useLinklyCancel(handleCheck) {
166
+ var dispatch = useDispatch();
167
+ var _useStoreRef2 = useStoreRef(),
168
+ numRef = _useStoreRef2.numRef,
169
+ modeRef = _useStoreRef2.modeRef,
170
+ deviceRef = _useStoreRef2.deviceRef;
171
+ var resultQueryRef = useRef(null);
172
+ var isPay = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay;
173
+ var cancelAction = function cancelAction(res, type) {
174
+ var _resultQueryRef$curre2;
175
+ // 需要将按钮状态释放
176
+ dispatch(updateCustom({
177
+ buttonDisabled: false
178
+ }));
179
+ if (!handleCheck()) {
180
+ return;
181
+ }
182
+ if (type === 'success') {
183
+ sendWarningLog({
184
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u53D6\u6D88\u6210\u529F"),
185
+ content: [{
186
+ key: 'response',
187
+ value: JSON.stringify(res)
188
+ }]
189
+ });
190
+ } else {
191
+ sendWarningLog({
192
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u53D6\u6D88\u5931\u8D25"),
193
+ content: [{
194
+ key: 'error',
195
+ value: JSON.stringify(res)
196
+ }]
197
+ });
198
+ }
199
+ (_resultQueryRef$curre2 = resultQueryRef.current) === null || _resultQueryRef$curre2 === void 0 || _resultQueryRef$curre2.call(resultQueryRef);
200
+ };
201
+ var _cancel = useRequest(isPay ? linklyPayCancelApi : linklyRefundCancelApi, {
202
+ manual: true,
203
+ onSuccess: function onSuccess(res) {
204
+ return cancelAction(res, 'success');
205
+ },
206
+ onError: function onError(error) {
207
+ return cancelAction(error, 'error');
208
+ }
209
+ });
210
+ var linklyCancel = function linklyCancel(resultQuery) {
211
+ var _deviceRef$current2;
212
+ resultQueryRef.current = resultQuery;
213
+ // 需要将按钮状态锁定,防止重复点击
214
+ dispatch(updateCustom({
215
+ buttonDisabled: true
216
+ }));
217
+ var param = {
218
+ // 设备id
219
+ pinpad_id: deviceRef === null || deviceRef === void 0 || (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 || (_deviceRef$current2 = _deviceRef$current2.metadata) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.linkly_pinpad_id,
220
+ // 交易流水号
221
+ session_id: numRef.current
222
+ };
223
+ sendWarningLog({
224
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u53D6\u6D88"),
225
+ content: [{
226
+ key: 'params',
227
+ value: JSON.stringify(param)
228
+ }]
229
+ });
230
+ _cancel.run(param);
231
+ dispatch(updateCustom({
232
+ actionStatus: LinklyActionStatus.CancelWaiting
233
+ }));
234
+ };
235
+ return {
236
+ action: {
237
+ cancel: _cancel
238
+ },
239
+ linklyCancel: linklyCancel
240
+ };
241
+ };
242
+
243
+ /**
244
+ * @title: 支付或退款签名
245
+ * @description: 支付或退款签名调用接口后不管成功还是失败都需要调用支付查询接口
246
+ */
247
+ export var useLinklySignature = function useLinklySignature(handleCheck) {
248
+ var dispatch = useDispatch();
249
+ var _useStoreRef3 = useStoreRef(),
250
+ numRef = _useStoreRef3.numRef,
251
+ modeRef = _useStoreRef3.modeRef,
252
+ deviceRef = _useStoreRef3.deviceRef;
253
+ var resultQueryRef = useRef(null);
254
+ var isPay = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay;
255
+ var signatureAction = function signatureAction(res, type) {
256
+ var _resultQueryRef$curre3;
257
+ console.log('signatureAction---->>>>>>>', res);
258
+ if (!handleCheck()) {
259
+ return;
260
+ }
261
+ if (type === 'success') {
262
+ sendWarningLog({
263
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u7B7E\u540D\u6210\u529F"),
264
+ content: [{
265
+ key: 'response',
266
+ value: JSON.stringify(res)
267
+ }]
268
+ });
269
+ } else {
270
+ sendWarningLog({
271
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u7B7E\u540D\u5931\u8D25"),
272
+ content: [{
273
+ key: 'error',
274
+ value: JSON.stringify(res)
275
+ }]
276
+ });
277
+ }
278
+ (_resultQueryRef$curre3 = resultQueryRef.current) === null || _resultQueryRef$curre3 === void 0 || _resultQueryRef$curre3.call(resultQueryRef);
279
+ };
280
+ var _signature = useRequest(isPay ? linklyPaySignatureApi : linklyRefundSignatureApi, {
281
+ manual: true,
282
+ onSuccess: function onSuccess(res) {
283
+ return signatureAction(res, 'success');
284
+ },
285
+ onError: function onError(error) {
286
+ return signatureAction(error, 'error');
287
+ }
288
+ });
289
+ var linklySignature = function linklySignature(status, resultQuery) {
290
+ var _deviceRef$current3;
291
+ resultQueryRef.current = resultQuery;
292
+ var param = {
293
+ // 设备id
294
+ pinpad_id: deviceRef === null || deviceRef === void 0 || (_deviceRef$current3 = deviceRef.current) === null || _deviceRef$current3 === void 0 || (_deviceRef$current3 = _deviceRef$current3.metadata) === null || _deviceRef$current3 === void 0 ? void 0 : _deviceRef$current3.linkly_pinpad_id,
295
+ // 交易流水号
296
+ session_id: numRef.current,
297
+ signature_flag: status
298
+ };
299
+ dispatch(updateStatus(StatusEnum.Loading));
300
+ dispatch(updateState({
301
+ title: locales.getText('page.eftpos-pay.text.loading')(modeRef.current)
302
+ }));
303
+ dispatch(updateCustom({
304
+ actionStatus: LinklyActionStatus.SignatureWaiting
305
+ }));
306
+ sendWarningLog({
307
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u7B7E\u540D"),
308
+ content: [{
309
+ key: 'params',
310
+ value: JSON.stringify(param)
311
+ }]
312
+ });
313
+ _signature.run(param);
314
+ };
315
+ return {
316
+ action: {
317
+ signature: _signature
318
+ },
319
+ linklySignature: linklySignature
320
+ };
321
+ };
@@ -0,0 +1,4 @@
1
+ export declare const useTimeResultQuery: (api: any, resultCheck: () => boolean, handleLinklySuccess: (res: any) => void) => {
2
+ run: () => Promise<void>;
3
+ stop: () => void;
4
+ };