@pisell/private-materials 3.4.78 → 3.4.80

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 (513) 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 +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +10 -10
  11. package/es/components/appointmentBooking/components/Date/state.js +3 -1
  12. package/es/components/appointmentBooking/locales.d.ts +240 -0
  13. package/es/components/appointmentBooking/locales.js +276 -0
  14. package/es/components/authentication/admin/AuthMethods/locales.d.ts +164 -0
  15. package/es/components/authentication/admin/AuthMethods/locales.js +164 -0
  16. package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/index.js +27 -9
  17. package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.d.ts +54 -0
  18. package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.js +54 -0
  19. package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/types.d.ts +2 -0
  20. package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/index.js +2 -0
  21. package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.d.ts +46 -0
  22. package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.js +46 -0
  23. package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/types.d.ts +2 -0
  24. package/es/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.js +17 -9
  25. package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.d.ts +16 -0
  26. package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.js +16 -0
  27. package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/index.js +10 -2
  28. package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.d.ts +42 -0
  29. package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.js +42 -0
  30. package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/types.d.ts +2 -0
  31. package/es/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.js +17 -9
  32. package/es/components/authentication/admin/ChannelAuthSetting/locales.d.ts +24 -0
  33. package/es/components/authentication/admin/ChannelAuthSetting/locales.js +24 -0
  34. package/es/components/authentication/admin/CustomerAuth/locales.d.ts +42 -0
  35. package/es/components/authentication/admin/CustomerAuth/locales.js +42 -0
  36. package/es/components/authentication/admin/CustomerOAuthConfig/locales.d.ts +70 -0
  37. package/es/components/authentication/admin/CustomerOAuthConfig/locales.js +70 -0
  38. package/es/components/authentication/admin/DeviceAuth/locales.d.ts +36 -0
  39. package/es/components/authentication/admin/DeviceAuth/locales.js +36 -0
  40. package/es/components/authentication/admin/OAuthConfig/locales.d.ts +58 -0
  41. package/es/components/authentication/admin/OAuthConfig/locales.js +58 -0
  42. package/es/components/authentication/admin/OrgAdminAuth/locales.d.ts +34 -0
  43. package/es/components/authentication/admin/OrgAdminAuth/locales.js +34 -0
  44. package/es/components/authentication/admin/POSOperatorAuth/locales.d.ts +30 -0
  45. package/es/components/authentication/admin/POSOperatorAuth/locales.js +30 -0
  46. package/es/components/authentication/admin/SaaSAdminAuth/locales.d.ts +34 -0
  47. package/es/components/authentication/admin/SaaSAdminAuth/locales.js +34 -0
  48. package/es/components/booking/addons/model.d.ts +10 -1
  49. package/es/components/booking/editBookingModal/locales.d.ts +12 -0
  50. package/es/components/booking/editBookingModal/locales.js +12 -0
  51. package/es/components/booking/editBookingModal/mock.d.ts +186 -2
  52. package/es/components/booking/editBookingModal/mock.js +22 -0
  53. package/es/components/booking/forms/model.d.ts +10 -1
  54. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  55. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  56. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  57. package/es/components/booking/info/model.d.ts +10 -1
  58. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  59. package/es/components/booking/info2/service/addService/mock.d.ts +2 -0
  60. package/es/components/booking/info2/service/addService/mock.js +4 -0
  61. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  62. package/es/components/booking/locales.d.ts +628 -0
  63. package/es/components/booking/locales.js +722 -0
  64. package/es/components/booking/model.d.ts +9 -1
  65. package/es/components/booking/notes/model.d.ts +10 -1
  66. package/es/components/booking/payments/model.d.ts +10 -1
  67. package/es/components/booking/utils.d.ts +2 -2
  68. package/es/components/ecocup/components/AddCustomerModal/index.js +3 -3
  69. package/es/components/ecocup/components/CupInfoCard/index.d.ts +3 -1
  70. package/es/components/ecocup/components/CupInfoCard/index.js +4 -2
  71. package/es/components/ecocup/components/CupStatusModal/hooks.d.ts +32 -1
  72. package/es/components/ecocup/components/CupStatusModal/hooks.js +109 -1
  73. package/es/components/ecocup/components/CupStatusModal/index.js +164 -30
  74. package/es/components/ecocup/components/CupStatusModal/index.less +48 -10
  75. package/es/components/ecocup/components/CustomerAndCupModal/index.js +1 -1
  76. package/es/components/ecocup/components/CustomerCard/index.d.ts +3 -1
  77. package/es/components/ecocup/components/CustomerCard/index.js +9 -6
  78. package/es/components/ecocup/components/PageHeader/index.d.ts +2 -0
  79. package/es/components/ecocup/components/PageHeader/index.js +15 -5
  80. package/es/components/ecocup/components/PageHeader/index.less +16 -4
  81. package/es/components/ecocup/components/SearchBar/index.d.ts +1 -0
  82. package/es/components/ecocup/components/SearchBar/index.js +33 -3
  83. package/es/components/ecocup/components/SettingModal/const.d.ts +6 -0
  84. package/es/components/ecocup/components/SettingModal/const.js +17 -0
  85. package/es/components/ecocup/components/SettingModal/index.d.ts +9 -0
  86. package/es/components/ecocup/components/SettingModal/index.js +253 -0
  87. package/es/components/ecocup/components/SettingModal/index.less +9 -0
  88. package/es/components/ecocup/cupList/const.d.ts +8 -1
  89. package/es/components/ecocup/cupList/const.js +14 -1
  90. package/es/components/ecocup/cupList/hooks/index.d.ts +2 -2
  91. package/es/components/ecocup/cupList/hooks/index.js +2 -2
  92. package/es/components/ecocup/cupList/hooks/useColumns.d.ts +2 -1
  93. package/es/components/ecocup/cupList/hooks/useColumns.js +4 -6
  94. package/es/components/ecocup/cupList/hooks/useCupApi.d.ts +12 -3
  95. package/es/components/ecocup/cupList/hooks/useCupApi.js +148 -8
  96. package/es/components/ecocup/cupList/hooks/useSummary.js +9 -7
  97. package/es/components/ecocup/cupList/index.js +60 -12
  98. package/es/components/ecocup/cupList/index.less +62 -16
  99. package/es/components/ecocup/cupProject/const.js +8 -2
  100. package/es/components/ecocup/cupProject/index.js +10 -1
  101. package/es/components/ecocup/hooks.d.ts +8 -0
  102. package/es/components/ecocup/hooks.js +18 -1
  103. package/es/components/ecocup/locales.d.ts +316 -2
  104. package/es/components/ecocup/locales.js +352 -25
  105. package/es/components/ecocup/utils/download.d.ts +7 -0
  106. package/es/components/ecocup/utils/download.js +34 -0
  107. package/es/components/ecocup/utils/index.d.ts +2 -0
  108. package/es/components/ecocup/utils/index.js +2 -0
  109. package/es/components/eftpos/hooks.d.ts +1 -0
  110. package/es/components/eftpos/locales.d.ts +64 -0
  111. package/es/components/eftpos/locales.js +80 -0
  112. package/es/components/eftposPay/amount.d.ts +1 -1
  113. package/es/components/eftposPay/device.d.ts +1 -1
  114. package/es/components/eftposPay/hooks.d.ts +1 -1
  115. package/es/components/eftposPay/locales.d.ts +242 -0
  116. package/es/components/eftposPay/locales.js +326 -0
  117. package/es/components/eftposPay/store/index.d.ts +2 -2
  118. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  119. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  120. package/es/components/eventBooking/components/Voucher/components/locales.d.ts +22 -0
  121. package/es/components/eventBooking/components/Voucher/components/locales.js +22 -0
  122. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  123. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  124. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  125. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  126. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  127. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  128. package/es/components/eventBooking/locales.d.ts +162 -0
  129. package/es/components/eventBooking/locales.js +186 -0
  130. package/es/components/kioskSkuDetail/locales.d.ts +16 -0
  131. package/es/components/kioskSkuDetail/locales.js +16 -0
  132. package/es/components/login/locales.d.ts +14 -0
  133. package/es/components/login/locales.js +14 -0
  134. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  135. package/es/components/pay/toC/locales.d.ts +204 -0
  136. package/es/components/pay/toC/locales.js +244 -0
  137. package/es/components/pay/toC/model.d.ts +9 -1
  138. package/es/components/pay/toC/serve.d.ts +2 -0
  139. package/es/components/pinModal/locales.d.ts +16 -0
  140. package/es/components/pinModal/locales.js +16 -0
  141. package/es/components/pinVerifyModal/locales.d.ts +14 -0
  142. package/es/components/pinVerifyModal/locales.js +14 -0
  143. package/es/components/pisellSelectCustomerModal/locales.d.ts +52 -0
  144. package/es/components/pisellSelectCustomerModal/locales.js +52 -0
  145. package/es/components/productExtension/locales.d.ts +30 -0
  146. package/es/components/productExtension/locales.js +30 -0
  147. package/es/components/productSelect/components/pisellPriceText/index.js +8 -4
  148. package/es/components/productSelect/locales.d.ts +20 -0
  149. package/es/components/productSelect/locales.js +23 -3
  150. package/es/components/ruleSetting/locales.d.ts +30 -0
  151. package/es/components/ruleSetting/locales.js +30 -0
  152. package/es/components/schedules/locales.d.ts +56 -0
  153. package/es/components/schedules/locales.js +56 -0
  154. package/es/components/schedules/model.d.ts +9 -1
  155. package/es/components/shoppingCart/locales.d.ts +20 -0
  156. package/es/components/shoppingCart/locales.js +24 -0
  157. package/es/components/stepController/locales.d.ts +16 -0
  158. package/es/components/stepController/locales.js +20 -0
  159. package/es/components/subTotal/locales.d.ts +26 -0
  160. package/es/components/subTotal/locales.js +26 -0
  161. package/es/components/systemSettings/registry/components/DataSourceTreeSelect/index.d.ts +59 -0
  162. package/es/components/systemSettings/registry/components/DataSourceTreeSelect/index.js +390 -0
  163. package/es/components/systemSettings/registry/components/DataSourceTreeSelect/serve.d.ts +70 -0
  164. package/es/components/systemSettings/registry/components/DataSourceTreeSelect/serve.js +367 -0
  165. package/es/components/systemSettings/registry/components/ItemModal.js +169 -35
  166. package/es/components/systemSettings/registry/components/OptionDataSource/OptionTable.d.ts +8 -0
  167. package/es/components/systemSettings/registry/components/OptionDataSource/OptionTable.js +163 -0
  168. package/es/components/systemSettings/registry/components/OptionDataSource/index.d.ts +10 -0
  169. package/es/components/systemSettings/registry/components/OptionDataSource/index.js +127 -0
  170. package/es/components/systemSettings/registry/components/OptionDataSource/index.less +37 -0
  171. package/es/components/systemSettings/registry/index.js +20 -16
  172. package/es/components/systemSettings/registry/index.less +6 -7
  173. package/es/components/systemSettings/registry/locales.d.ts +253 -0
  174. package/es/components/systemSettings/registry/locales.js +262 -3
  175. package/es/components/systemSettings/registry/services.d.ts +20 -0
  176. package/es/components/systemSettings/registry/types.d.ts +15 -2
  177. package/es/components/taxSelect/locales.d.ts +14 -0
  178. package/es/components/taxSelect/locales.js +14 -0
  179. package/es/components/ticketBooking/locales.d.ts +130 -0
  180. package/es/components/ticketBooking/locales.js +156 -0
  181. package/es/components/ticketBooking/utils/formatTime.d.ts +2 -0
  182. package/es/components/ticketBooking/utils/formatTime.js +8 -2
  183. package/es/components/wallet/utils.d.ts +1 -1
  184. package/es/components/walletList/index.js +10 -0
  185. package/es/components/walletList/locales.d.ts +16 -0
  186. package/es/components/walletList/locales.js +16 -0
  187. package/es/components/walletList/types/index.d.ts +2 -0
  188. package/es/hooks/usePaymentLogger.d.ts +1 -0
  189. package/es/plus/clientCard/locales.d.ts +10 -0
  190. package/es/plus/clientCard/locales.js +10 -0
  191. package/es/plus/clinetSearch/locales.d.ts +70 -0
  192. package/es/plus/clinetSearch/locales.js +70 -0
  193. package/es/plus/contactInfo/locales.d.ts +8 -0
  194. package/es/plus/contactInfo/locales.js +8 -0
  195. package/es/plus/contactInfoModal/locales.d.ts +42 -0
  196. package/es/plus/contactInfoModal/locales.js +42 -0
  197. package/es/plus/orderList/locales.d.ts +246 -0
  198. package/es/plus/orderList/locales.js +274 -0
  199. package/es/plus/productSelect/components/pisellPriceText/index.js +8 -4
  200. package/es/plus/productSelect/locales.d.ts +20 -0
  201. package/es/plus/productSelect/locales.js +23 -3
  202. package/es/plus/saasAttendance/locales.d.ts +210 -0
  203. package/es/plus/saasAttendance/locales.js +234 -0
  204. package/es/plus/saasAttendance/settings/components/MapField.js +4 -2
  205. package/es/plus/saasAttendance/settings/types.d.ts +2 -0
  206. package/es/plus/saasCreateOrganization/locales.d.ts +8 -0
  207. package/es/plus/saasCreateOrganization/locales.js +8 -0
  208. package/es/plus/saasLogin/locales.d.ts +32 -0
  209. package/es/plus/saasLogin/locales.js +32 -0
  210. package/es/plus/saasRegister/locales.d.ts +76 -0
  211. package/es/plus/saasRegister/locales.js +76 -0
  212. package/es/plus/saasRole/locales.d.ts +126 -0
  213. package/es/plus/saasRole/locales.js +126 -0
  214. package/es/plus/saasRole/types.d.ts +2 -0
  215. package/es/plus/saasTeamMembers/locales.d.ts +216 -0
  216. package/es/plus/saasTeamMembers/locales.js +216 -0
  217. package/es/plus/saasTeamMembers/type.d.ts +2 -0
  218. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
  219. package/es/plus/selectHolder/locales.d.ts +9 -1
  220. package/es/plus/selectHolder/locales.js +17 -5
  221. package/es/plus/skuOptionsSelection/components/NormalCard/index.js +3 -1
  222. package/es/plus/skuOptionsSelection/components/OptionsCard/index.js +3 -2
  223. package/es/plus/skuOptionsSelection/locales.d.ts +20 -0
  224. package/es/plus/skuOptionsSelection/locales.js +20 -0
  225. package/es/plus/skuOptionsSelection/store/store.js +2 -1
  226. package/es/plus/skuOptionsSelection/types.d.ts +14 -0
  227. package/es/plus/skuOptionsSelection/types.js +4 -0
  228. package/es/plus/skuOptionsSelection/utils/transformBundleGroup.js +10 -1
  229. package/es/plus/skuOptionsSelection/utils/transformOptionGroup.js +10 -1
  230. package/es/plus/skuOptionsSelection/utils/transformVariantGroup.js +8 -2
  231. package/es/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +2 -0
  232. package/es/plus/walletEditor/components/sortableWalletPassTypes/index.js +12 -4
  233. package/es/plus/walletEditor/locales.d.ts +88 -0
  234. package/es/plus/walletEditor/locales.js +100 -0
  235. package/es/plus/walletEditor/types.d.ts +2 -0
  236. package/es/plus/walletPassGallery/locales.d.ts +188 -0
  237. package/es/plus/walletPassGallery/locales.js +192 -0
  238. package/es/plus/walletPassGallery/utils.d.ts +1 -1
  239. package/es/pro/Cards/components/SKUCard/index.d.ts +1 -56
  240. package/es/pro/Cards/components/SKUCard/index.js +39 -18
  241. package/es/pro/Cards/components/SKUCard/index.less +21 -0
  242. package/es/pro/Cards/components/SKUCard/locales.d.ts +12 -0
  243. package/es/pro/Cards/components/SKUCard/locales.js +11 -0
  244. package/es/pro/Cards/components/SKUCard/types.d.ts +68 -0
  245. package/es/pro/Cards/components/SKUCard/types.js +1 -0
  246. package/es/pro/Login2.0/locales.d.ts +360 -0
  247. package/es/pro/Login2.0/locales.js +360 -0
  248. package/es/pro/Login2.0/shared/types.d.ts +2 -0
  249. package/es/pro/Selector/locales.d.ts +22 -0
  250. package/es/pro/Selector/locales.js +58 -0
  251. package/es/pro/comprehensiveSearch/components/searchSection/locales.d.ts +8 -0
  252. package/es/pro/comprehensiveSearch/components/searchSection/locales.js +8 -0
  253. package/es/pro/comprehensiveSearch/locales.d.ts +8 -0
  254. package/es/pro/comprehensiveSearch/locales.js +8 -0
  255. package/es/pro/keyboards/locales.d.ts +14 -0
  256. package/es/pro/keyboards/locales.js +22 -0
  257. package/es/pro/numberKeyboard/locales.d.ts +6 -0
  258. package/es/pro/numberKeyboard/locales.js +6 -0
  259. package/es/pro/pisellPhoneKeyboard/locales.d.ts +6 -0
  260. package/es/pro/pisellPhoneKeyboard/locales.js +6 -0
  261. package/lib/components/appointmentBooking/components/Date/state.js +3 -1
  262. package/lib/components/appointmentBooking/locales.d.ts +240 -0
  263. package/lib/components/appointmentBooking/locales.js +240 -0
  264. package/lib/components/authentication/admin/AuthMethods/locales.d.ts +164 -0
  265. package/lib/components/authentication/admin/AuthMethods/locales.js +164 -0
  266. package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/index.js +17 -9
  267. package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.d.ts +54 -0
  268. package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.js +54 -0
  269. package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/types.d.ts +2 -0
  270. package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/index.js +2 -0
  271. package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.d.ts +46 -0
  272. package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.js +46 -0
  273. package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/types.d.ts +2 -0
  274. package/lib/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.js +14 -6
  275. package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.d.ts +16 -0
  276. package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.js +16 -0
  277. package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/index.js +10 -2
  278. package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.d.ts +42 -0
  279. package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.js +42 -0
  280. package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/types.d.ts +2 -0
  281. package/lib/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.js +14 -6
  282. package/lib/components/authentication/admin/ChannelAuthSetting/locales.d.ts +24 -0
  283. package/lib/components/authentication/admin/ChannelAuthSetting/locales.js +24 -0
  284. package/lib/components/authentication/admin/CustomerAuth/locales.d.ts +42 -0
  285. package/lib/components/authentication/admin/CustomerAuth/locales.js +42 -0
  286. package/lib/components/authentication/admin/CustomerOAuthConfig/locales.d.ts +70 -0
  287. package/lib/components/authentication/admin/CustomerOAuthConfig/locales.js +70 -0
  288. package/lib/components/authentication/admin/DeviceAuth/locales.d.ts +36 -0
  289. package/lib/components/authentication/admin/DeviceAuth/locales.js +36 -0
  290. package/lib/components/authentication/admin/OAuthConfig/locales.d.ts +58 -0
  291. package/lib/components/authentication/admin/OAuthConfig/locales.js +58 -0
  292. package/lib/components/authentication/admin/OrgAdminAuth/locales.d.ts +34 -0
  293. package/lib/components/authentication/admin/OrgAdminAuth/locales.js +34 -0
  294. package/lib/components/authentication/admin/POSOperatorAuth/locales.d.ts +30 -0
  295. package/lib/components/authentication/admin/POSOperatorAuth/locales.js +30 -0
  296. package/lib/components/authentication/admin/SaaSAdminAuth/locales.d.ts +34 -0
  297. package/lib/components/authentication/admin/SaaSAdminAuth/locales.js +34 -0
  298. package/lib/components/booking/addons/model.d.ts +10 -1
  299. package/lib/components/booking/editBookingModal/locales.d.ts +12 -0
  300. package/lib/components/booking/editBookingModal/locales.js +12 -0
  301. package/lib/components/booking/editBookingModal/mock.d.ts +186 -2
  302. package/lib/components/booking/editBookingModal/mock.js +22 -0
  303. package/lib/components/booking/forms/model.d.ts +10 -1
  304. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  305. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  306. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  307. package/lib/components/booking/info/model.d.ts +10 -1
  308. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  309. package/lib/components/booking/info2/service/addService/mock.d.ts +2 -0
  310. package/lib/components/booking/info2/service/addService/mock.js +4 -0
  311. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  312. package/lib/components/booking/locales.d.ts +628 -0
  313. package/lib/components/booking/locales.js +680 -0
  314. package/lib/components/booking/model.d.ts +9 -1
  315. package/lib/components/booking/notes/model.d.ts +10 -1
  316. package/lib/components/booking/payments/model.d.ts +10 -1
  317. package/lib/components/booking/utils.d.ts +2 -2
  318. package/lib/components/ecocup/components/AddCustomerModal/index.js +2 -2
  319. package/lib/components/ecocup/components/CupInfoCard/index.d.ts +3 -1
  320. package/lib/components/ecocup/components/CupInfoCard/index.js +2 -2
  321. package/lib/components/ecocup/components/CupStatusModal/hooks.d.ts +32 -1
  322. package/lib/components/ecocup/components/CupStatusModal/hooks.js +62 -2
  323. package/lib/components/ecocup/components/CupStatusModal/index.js +103 -22
  324. package/lib/components/ecocup/components/CupStatusModal/index.less +48 -10
  325. package/lib/components/ecocup/components/CustomerAndCupModal/index.js +1 -1
  326. package/lib/components/ecocup/components/CustomerCard/index.d.ts +3 -1
  327. package/lib/components/ecocup/components/CustomerCard/index.js +13 -3
  328. package/lib/components/ecocup/components/PageHeader/index.d.ts +2 -0
  329. package/lib/components/ecocup/components/PageHeader/index.js +10 -3
  330. package/lib/components/ecocup/components/PageHeader/index.less +16 -4
  331. package/lib/components/ecocup/components/SearchBar/index.d.ts +1 -0
  332. package/lib/components/ecocup/components/SearchBar/index.js +15 -2
  333. package/lib/components/ecocup/components/SettingModal/const.d.ts +6 -0
  334. package/lib/components/ecocup/components/SettingModal/const.js +48 -0
  335. package/lib/components/ecocup/components/SettingModal/index.d.ts +9 -0
  336. package/lib/components/ecocup/components/SettingModal/index.js +199 -0
  337. package/lib/components/ecocup/components/SettingModal/index.less +9 -0
  338. package/lib/components/ecocup/cupList/const.d.ts +8 -1
  339. package/lib/components/ecocup/cupList/const.js +18 -0
  340. package/lib/components/ecocup/cupList/hooks/index.d.ts +2 -2
  341. package/lib/components/ecocup/cupList/hooks/index.js +4 -0
  342. package/lib/components/ecocup/cupList/hooks/useColumns.d.ts +2 -1
  343. package/lib/components/ecocup/cupList/hooks/useColumns.js +2 -4
  344. package/lib/components/ecocup/cupList/hooks/useCupApi.d.ts +12 -3
  345. package/lib/components/ecocup/cupList/hooks/useCupApi.js +123 -8
  346. package/lib/components/ecocup/cupList/hooks/useSummary.js +22 -14
  347. package/lib/components/ecocup/cupList/index.js +70 -16
  348. package/lib/components/ecocup/cupList/index.less +62 -16
  349. package/lib/components/ecocup/cupProject/const.js +8 -1
  350. package/lib/components/ecocup/cupProject/index.js +10 -1
  351. package/lib/components/ecocup/hooks.d.ts +8 -0
  352. package/lib/components/ecocup/hooks.js +15 -1
  353. package/lib/components/ecocup/locales.d.ts +316 -2
  354. package/lib/components/ecocup/locales.js +342 -25
  355. package/lib/components/ecocup/utils/download.d.ts +7 -0
  356. package/lib/components/ecocup/utils/download.js +47 -0
  357. package/lib/components/ecocup/utils/index.d.ts +2 -0
  358. package/lib/components/ecocup/utils/index.js +42 -0
  359. package/lib/components/eftpos/hooks.d.ts +1 -0
  360. package/lib/components/eftpos/locales.d.ts +64 -0
  361. package/lib/components/eftpos/locales.js +76 -0
  362. package/lib/components/eftposPay/amount.d.ts +1 -1
  363. package/lib/components/eftposPay/device.d.ts +1 -1
  364. package/lib/components/eftposPay/hooks.d.ts +1 -1
  365. package/lib/components/eftposPay/locales.d.ts +242 -0
  366. package/lib/components/eftposPay/locales.js +250 -0
  367. package/lib/components/eftposPay/store/index.d.ts +2 -2
  368. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  369. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  370. package/lib/components/eventBooking/components/Voucher/components/locales.d.ts +22 -0
  371. package/lib/components/eventBooking/components/Voucher/components/locales.js +22 -0
  372. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  373. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  374. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  375. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  376. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  377. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  378. package/lib/components/eventBooking/locales.d.ts +162 -0
  379. package/lib/components/eventBooking/locales.js +162 -0
  380. package/lib/components/kioskSkuDetail/locales.d.ts +16 -0
  381. package/lib/components/kioskSkuDetail/locales.js +16 -0
  382. package/lib/components/login/locales.d.ts +14 -0
  383. package/lib/components/login/locales.js +14 -0
  384. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  385. package/lib/components/pay/toC/locales.d.ts +204 -0
  386. package/lib/components/pay/toC/locales.js +204 -0
  387. package/lib/components/pay/toC/model.d.ts +9 -1
  388. package/lib/components/pay/toC/serve.d.ts +2 -0
  389. package/lib/components/pinModal/locales.d.ts +16 -0
  390. package/lib/components/pinModal/locales.js +16 -0
  391. package/lib/components/pinVerifyModal/locales.d.ts +14 -0
  392. package/lib/components/pinVerifyModal/locales.js +14 -0
  393. package/lib/components/pisellSelectCustomerModal/locales.d.ts +52 -0
  394. package/lib/components/pisellSelectCustomerModal/locales.js +52 -0
  395. package/lib/components/productExtension/locales.d.ts +30 -0
  396. package/lib/components/productExtension/locales.js +30 -0
  397. package/lib/components/productSelect/components/pisellPriceText/index.js +6 -4
  398. package/lib/components/productSelect/locales.d.ts +20 -0
  399. package/lib/components/productSelect/locales.js +23 -3
  400. package/lib/components/ruleSetting/locales.d.ts +30 -0
  401. package/lib/components/ruleSetting/locales.js +30 -0
  402. package/lib/components/schedules/locales.d.ts +56 -0
  403. package/lib/components/schedules/locales.js +56 -0
  404. package/lib/components/schedules/model.d.ts +9 -1
  405. package/lib/components/shoppingCart/locales.d.ts +20 -0
  406. package/lib/components/shoppingCart/locales.js +20 -0
  407. package/lib/components/stepController/locales.d.ts +16 -0
  408. package/lib/components/stepController/locales.js +16 -0
  409. package/lib/components/subTotal/locales.d.ts +26 -0
  410. package/lib/components/subTotal/locales.js +26 -0
  411. package/lib/components/systemSettings/registry/components/DataSourceTreeSelect/index.d.ts +59 -0
  412. package/lib/components/systemSettings/registry/components/DataSourceTreeSelect/index.js +228 -0
  413. package/lib/components/systemSettings/registry/components/DataSourceTreeSelect/serve.d.ts +70 -0
  414. package/lib/components/systemSettings/registry/components/DataSourceTreeSelect/serve.js +195 -0
  415. package/lib/components/systemSettings/registry/components/ItemModal.js +294 -225
  416. package/lib/components/systemSettings/registry/components/OptionDataSource/OptionTable.d.ts +8 -0
  417. package/lib/components/systemSettings/registry/components/OptionDataSource/OptionTable.js +166 -0
  418. package/lib/components/systemSettings/registry/components/OptionDataSource/index.d.ts +10 -0
  419. package/lib/components/systemSettings/registry/components/OptionDataSource/index.js +210 -0
  420. package/lib/components/systemSettings/registry/components/OptionDataSource/index.less +37 -0
  421. package/lib/components/systemSettings/registry/index.js +20 -16
  422. package/lib/components/systemSettings/registry/index.less +6 -7
  423. package/lib/components/systemSettings/registry/locales.d.ts +253 -0
  424. package/lib/components/systemSettings/registry/locales.js +262 -3
  425. package/lib/components/systemSettings/registry/services.d.ts +20 -0
  426. package/lib/components/systemSettings/registry/types.d.ts +15 -2
  427. package/lib/components/taxSelect/locales.d.ts +14 -0
  428. package/lib/components/taxSelect/locales.js +14 -0
  429. package/lib/components/ticketBooking/locales.d.ts +130 -0
  430. package/lib/components/ticketBooking/locales.js +136 -0
  431. package/lib/components/ticketBooking/utils/formatTime.d.ts +2 -0
  432. package/lib/components/ticketBooking/utils/formatTime.js +8 -2
  433. package/lib/components/wallet/utils.d.ts +1 -1
  434. package/lib/components/walletList/index.js +10 -0
  435. package/lib/components/walletList/locales.d.ts +16 -0
  436. package/lib/components/walletList/locales.js +16 -0
  437. package/lib/components/walletList/types/index.d.ts +2 -0
  438. package/lib/hooks/usePaymentLogger.d.ts +1 -0
  439. package/lib/plus/clientCard/locales.d.ts +10 -0
  440. package/lib/plus/clientCard/locales.js +10 -0
  441. package/lib/plus/clinetSearch/locales.d.ts +70 -0
  442. package/lib/plus/clinetSearch/locales.js +70 -0
  443. package/lib/plus/contactInfo/locales.d.ts +8 -0
  444. package/lib/plus/contactInfo/locales.js +8 -0
  445. package/lib/plus/contactInfoModal/locales.d.ts +42 -0
  446. package/lib/plus/contactInfoModal/locales.js +42 -0
  447. package/lib/plus/orderList/locales.d.ts +246 -0
  448. package/lib/plus/orderList/locales.js +266 -0
  449. package/lib/plus/productSelect/components/pisellPriceText/index.js +6 -4
  450. package/lib/plus/productSelect/locales.d.ts +20 -0
  451. package/lib/plus/productSelect/locales.js +23 -3
  452. package/lib/plus/saasAttendance/locales.d.ts +210 -0
  453. package/lib/plus/saasAttendance/locales.js +210 -0
  454. package/lib/plus/saasAttendance/settings/components/MapField.js +2 -2
  455. package/lib/plus/saasAttendance/settings/types.d.ts +2 -0
  456. package/lib/plus/saasCreateOrganization/locales.d.ts +8 -0
  457. package/lib/plus/saasCreateOrganization/locales.js +8 -0
  458. package/lib/plus/saasLogin/locales.d.ts +32 -0
  459. package/lib/plus/saasLogin/locales.js +32 -0
  460. package/lib/plus/saasRegister/locales.d.ts +76 -0
  461. package/lib/plus/saasRegister/locales.js +76 -0
  462. package/lib/plus/saasRole/locales.d.ts +126 -0
  463. package/lib/plus/saasRole/locales.js +126 -0
  464. package/lib/plus/saasRole/types.d.ts +2 -0
  465. package/lib/plus/saasTeamMembers/locales.d.ts +216 -0
  466. package/lib/plus/saasTeamMembers/locales.js +216 -0
  467. package/lib/plus/saasTeamMembers/type.d.ts +2 -0
  468. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
  469. package/lib/plus/selectHolder/locales.d.ts +9 -1
  470. package/lib/plus/selectHolder/locales.js +13 -5
  471. package/lib/plus/skuOptionsSelection/components/NormalCard/index.js +8 -6
  472. package/lib/plus/skuOptionsSelection/components/OptionsCard/index.js +3 -2
  473. package/lib/plus/skuOptionsSelection/locales.d.ts +20 -0
  474. package/lib/plus/skuOptionsSelection/locales.js +20 -0
  475. package/lib/plus/skuOptionsSelection/store/store.js +2 -1
  476. package/lib/plus/skuOptionsSelection/types.d.ts +14 -0
  477. package/lib/plus/skuOptionsSelection/utils/transformBundleGroup.js +15 -9
  478. package/lib/plus/skuOptionsSelection/utils/transformOptionGroup.js +9 -6
  479. package/lib/plus/skuOptionsSelection/utils/transformVariantGroup.js +8 -7
  480. package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +2 -0
  481. package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.js +12 -4
  482. package/lib/plus/walletEditor/locales.d.ts +88 -0
  483. package/lib/plus/walletEditor/locales.js +100 -0
  484. package/lib/plus/walletEditor/types.d.ts +2 -0
  485. package/lib/plus/walletPassGallery/locales.d.ts +188 -0
  486. package/lib/plus/walletPassGallery/locales.js +192 -0
  487. package/lib/plus/walletPassGallery/utils.d.ts +1 -1
  488. package/lib/pro/Cards/components/SKUCard/index.d.ts +1 -56
  489. package/lib/pro/Cards/components/SKUCard/index.js +53 -14
  490. package/lib/pro/Cards/components/SKUCard/index.less +21 -0
  491. package/lib/pro/Cards/components/SKUCard/locales.d.ts +12 -0
  492. package/lib/pro/Cards/components/SKUCard/locales.js +35 -0
  493. package/lib/pro/Cards/components/SKUCard/types.d.ts +68 -0
  494. package/lib/pro/Cards/components/SKUCard/types.js +17 -0
  495. package/lib/pro/Login2.0/locales.d.ts +360 -0
  496. package/lib/pro/Login2.0/locales.js +360 -0
  497. package/lib/pro/Login2.0/shared/types.d.ts +2 -0
  498. package/lib/pro/Selector/locales.d.ts +22 -0
  499. package/lib/pro/Selector/locales.js +50 -0
  500. package/lib/pro/comprehensiveSearch/components/searchSection/locales.d.ts +8 -0
  501. package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +8 -0
  502. package/lib/pro/comprehensiveSearch/locales.d.ts +8 -0
  503. package/lib/pro/comprehensiveSearch/locales.js +8 -0
  504. package/lib/pro/keyboards/locales.d.ts +14 -0
  505. package/lib/pro/keyboards/locales.js +14 -0
  506. package/lib/pro/numberKeyboard/locales.d.ts +6 -0
  507. package/lib/pro/numberKeyboard/locales.js +6 -0
  508. package/lib/pro/pisellPhoneKeyboard/locales.d.ts +6 -0
  509. package/lib/pro/pisellPhoneKeyboard/locales.js +6 -0
  510. package/lowcode/eco-cup-list/meta.ts +1 -1
  511. package/lowcode/eco-customer-list/meta.ts +1 -1
  512. package/lowcode/sku-options-selection/meta.ts +106 -2
  513. package/package.json +4 -4
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  amountSymbol: string;
3
4
  apis: {
@@ -108,4 +109,11 @@ export declare const walkInData: {
108
109
  id: number;
109
110
  nickname: string;
110
111
  };
111
- export declare const Provider: any, Context: any;
112
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
113
+ state: FormState;
114
+ } & {
115
+ dispatch: (params: {
116
+ type: string;
117
+ payload: any;
118
+ }) => void;
119
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -166,10 +166,10 @@ export declare const getProductTotalPrice: (item: any) => number;
166
166
  export declare const getDuration: (duration: number | {
167
167
  type: string;
168
168
  value: number;
169
- }) => number | {
169
+ }) => number | "flexible" | {
170
170
  type: string;
171
171
  value: number;
172
- } | "flexible";
172
+ };
173
173
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
174
174
  export declare const getIsEdit: (state: any) => boolean;
175
175
  export {};
@@ -200,10 +200,10 @@ var AddCustomerModal = function AddCustomerModal(props) {
200
200
  renderMode: "edit",
201
201
  name: "membership",
202
202
  label: locales.getText('pisell2.text.ecocup.add-customer-modal.membership'),
203
- defaultValue: "normal",
203
+ defaultValue: "regular",
204
204
  options: [{
205
- label: 'Normal',
206
- value: 'normal'
205
+ label: 'Regular',
206
+ value: 'regular'
207
207
  }, {
208
208
  label: 'Business',
209
209
  value: 'business'
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
3
  interface IProps {
4
- type: 'rentInfo' | 'markInfo' | 'belongInfo';
4
+ type: 'rentInfo' | 'markInfo' | 'belongInfo' | 'otherBelongInfo';
5
5
  data: Record<string, any>;
6
+ isMultipleShop?: boolean;
7
+ isMultipleTime?: boolean;
6
8
  }
7
9
  declare const CupInfoCard: (props: IProps) => React.JSX.Element;
8
10
  export default CupInfoCard;
@@ -4,9 +4,11 @@ import dayjs from 'dayjs';
4
4
  import "./index.less";
5
5
  var CupInfoCard = function CupInfoCard(props) {
6
6
  var type = props.type,
7
- data = props.data;
7
+ data = props.data,
8
+ isMultipleShop = props.isMultipleShop,
9
+ isMultipleTime = props.isMultipleTime;
8
10
  return /*#__PURE__*/React.createElement("div", {
9
11
  className: "pisell2-ecocup-cup-info-card"
10
- }, /*#__PURE__*/React.createElement("div", null, locales.getText("pisell2.text.ecocup.cup-info-card.title.".concat(type))), /*#__PURE__*/React.createElement("div", null, (data === null || data === void 0 ? void 0 : data.shop) || '-'), /*#__PURE__*/React.createElement("div", null, data !== null && data !== void 0 && data.time ? dayjs(data === null || data === void 0 ? void 0 : data.time).format('HH:mm DD/MM/YYYY') : '-'));
12
+ }, /*#__PURE__*/React.createElement("div", null, locales.getText("pisell2.text.ecocup.cup-info-card.title.".concat(type))), isMultipleShop ? locales.getText('pisell2.text.ecocup.cup-info-card.title.multiple-shop') : /*#__PURE__*/React.createElement("div", null, (data === null || data === void 0 ? void 0 : data.shop) || '-'), isMultipleTime ? locales.getText('pisell2.text.ecocup.cup-info-card.title.multiple-time') : /*#__PURE__*/React.createElement("div", null, data !== null && data !== void 0 && data.time ? dayjs(data === null || data === void 0 ? void 0 : data.time).format('HH:mm DD/MM/YYYY') : '-'));
11
13
  };
12
14
  export default CupInfoCard;
@@ -1,5 +1,36 @@
1
- import { ECupActionType } from '../../types';
1
+ import { ECupActionType, ICup } from '../../types';
2
2
  export declare const useCupAction: () => {
3
3
  run: (this: unknown, cupId: string, action: ECupActionType) => Promise<boolean>;
4
4
  loading: boolean;
5
5
  };
6
+ /**
7
+ * @description: 批量归还杯子
8
+ * @return {*}
9
+ */
10
+ export declare const useBatchCupAction: () => {
11
+ run: (this: unknown, eco_cup_ids: number[] | string[]) => Promise<boolean>;
12
+ loading: boolean;
13
+ };
14
+ /**
15
+ * @description: 统计杯子列表中的客户、店铺、时间数量
16
+ * @param {ICup[]} cupList - 杯子列表
17
+ * @return {object} 返回统计信息和是否为多个的标识
18
+ */
19
+ export declare const useCupListStatistics: (cupList: ICup[]) => {
20
+ hasMultipleCustomers: boolean;
21
+ hasMultipleShops: boolean;
22
+ hasMultipleTimes: boolean;
23
+ uniqueCustomer: import("../../types").ICustomer | undefined;
24
+ uniqueShop: {
25
+ id: string;
26
+ name: string;
27
+ } | undefined;
28
+ uniqueTime: string | undefined;
29
+ } | {
30
+ hasMultipleCustomers: boolean;
31
+ hasMultipleShops: boolean;
32
+ hasMultipleTimes: boolean;
33
+ uniqueCustomer: null;
34
+ uniqueShop: null;
35
+ uniqueTime: null;
36
+ };
@@ -8,7 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import { useState } from 'react';
11
+ import { useState, useMemo } from 'react';
12
12
  import { useMemoizedFn } from 'ahooks';
13
13
  import { useGetGoalShopInfo, useRequest } from "../../hooks";
14
14
  export var useCupAction = function useCupAction() {
@@ -65,4 +65,112 @@ export var useCupAction = function useCupAction() {
65
65
  run: run,
66
66
  loading: loading
67
67
  };
68
+ };
69
+
70
+ /**
71
+ * @description: 批量归还杯子
72
+ * @return {*}
73
+ */
74
+ export var useBatchCupAction = function useBatchCupAction() {
75
+ var _useRequest2 = useRequest(),
76
+ post = _useRequest2.post;
77
+ var _useState3 = useState(false),
78
+ _useState4 = _slicedToArray(_useState3, 2),
79
+ loading = _useState4[0],
80
+ setLoading = _useState4[1];
81
+ var run = useMemoizedFn( /*#__PURE__*/function () {
82
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(eco_cup_ids) {
83
+ var res;
84
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
85
+ while (1) switch (_context2.prev = _context2.next) {
86
+ case 0:
87
+ _context2.prev = 0;
88
+ setLoading(true);
89
+ _context2.next = 4;
90
+ return post('/shop/wallet/eco/cups-return', {
91
+ eco_cup_ids: eco_cup_ids
92
+ });
93
+ case 4:
94
+ res = _context2.sent;
95
+ if (!((res === null || res === void 0 ? void 0 : res.code) == 200)) {
96
+ _context2.next = 7;
97
+ break;
98
+ }
99
+ return _context2.abrupt("return", true);
100
+ case 7:
101
+ return _context2.abrupt("return", false);
102
+ case 10:
103
+ _context2.prev = 10;
104
+ _context2.t0 = _context2["catch"](0);
105
+ console.error(_context2.t0);
106
+ return _context2.abrupt("return", false);
107
+ case 14:
108
+ _context2.prev = 14;
109
+ setLoading(false);
110
+ return _context2.finish(14);
111
+ case 17:
112
+ case "end":
113
+ return _context2.stop();
114
+ }
115
+ }, _callee2, null, [[0, 10, 14, 17]]);
116
+ }));
117
+ return function (_x3) {
118
+ return _ref2.apply(this, arguments);
119
+ };
120
+ }());
121
+ return {
122
+ run: run,
123
+ loading: loading
124
+ };
125
+ };
126
+
127
+ /**
128
+ * @description: 统计杯子列表中的客户、店铺、时间数量
129
+ * @param {ICup[]} cupList - 杯子列表
130
+ * @return {object} 返回统计信息和是否为多个的标识
131
+ */
132
+ export var useCupListStatistics = function useCupListStatistics(cupList) {
133
+ return useMemo(function () {
134
+ var _cupList$, _cupList$2, _cupList$3;
135
+ if (cupList.length === 0) {
136
+ return {
137
+ hasMultipleCustomers: false,
138
+ hasMultipleShops: false,
139
+ hasMultipleTimes: false,
140
+ uniqueCustomer: null,
141
+ uniqueShop: null,
142
+ uniqueTime: null
143
+ };
144
+ }
145
+
146
+ // 收集所有唯一的客户ID
147
+ var customerIds = new Set(cupList.map(function (cup) {
148
+ return cup === null || cup === void 0 ? void 0 : cup.customer_id;
149
+ }).filter(function (id) {
150
+ return id;
151
+ }));
152
+
153
+ // 收集所有唯一的店铺ID(current_shop)
154
+ var shopIds = new Set(cupList.map(function (cup) {
155
+ return cup === null || cup === void 0 ? void 0 : cup.current_shop_id;
156
+ }).filter(function (id) {
157
+ return id;
158
+ }));
159
+
160
+ // 收集所有唯一的时间(operated_at)
161
+ var times = new Set(cupList.map(function (cup) {
162
+ return cup === null || cup === void 0 ? void 0 : cup.operated_at;
163
+ }).filter(function (time) {
164
+ return time;
165
+ }));
166
+ var result = {
167
+ hasMultipleCustomers: customerIds.size > 1,
168
+ hasMultipleShops: shopIds.size > 1,
169
+ hasMultipleTimes: times.size > 1,
170
+ uniqueCustomer: (_cupList$ = cupList[0]) === null || _cupList$ === void 0 ? void 0 : _cupList$.customer,
171
+ uniqueShop: (_cupList$2 = cupList[0]) === null || _cupList$2 === void 0 ? void 0 : _cupList$2.current_shop,
172
+ uniqueTime: (_cupList$3 = cupList[0]) === null || _cupList$3 === void 0 ? void 0 : _cupList$3.operated_at
173
+ };
174
+ return result;
175
+ }, [cupList]);
68
176
  };
@@ -1,22 +1,35 @@
1
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
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; }
3
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; }
4
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; }
5
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
12
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
8
13
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
14
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
10
- import React, { useMemo } from 'react';
11
- import { PisellModal, Icon, PisellToast } from '@pisell/materials';
15
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+ import React, { useEffect, useMemo, useState } from 'react';
22
+ import { PisellModal, Icon, PisellToast, Button } from '@pisell/materials';
12
23
  import { locales } from '@pisell/utils';
13
24
  import { ECupActionType, ECupScanStatus, ECupStatus } from "../../types";
14
25
  import "./index.less";
15
26
  import CupInfoCard from "../CupInfoCard";
16
27
  import CustomerCard from "../CustomerCard";
17
- import { useCupAction } from "./hooks";
28
+ import { useCupAction, useCupListStatistics, useBatchCupAction } from "./hooks";
29
+ import SearchBar from "../SearchBar";
30
+ var SCAN_LISTENER_KEY = 'eco-cup-status-modal-scan-listener';
18
31
  var CupStatusModal = function CupStatusModal(props) {
19
- var _cupData$current_shop;
32
+ var _cupStatistics$unique, _cupList$, _cupList$2;
20
33
  var visible = props.visible,
21
34
  onCancel = props.onCancel,
22
35
  onOk = props.onOk,
@@ -25,7 +38,33 @@ var CupStatusModal = function CupStatusModal(props) {
25
38
  scanStatus = _ref.scanStatus,
26
39
  cupData = _ref.cupData;
27
40
  var cupAction = useCupAction();
28
- var isRed = scanStatus !== ECupScanStatus.OTHER_IN_STOCK && scanStatus !== ECupScanStatus.OTHER_RENT;
41
+ // 杯子列表
42
+ var _useState = useState([]),
43
+ _useState2 = _slicedToArray(_useState, 2),
44
+ cupList = _useState2[0],
45
+ setCupList = _useState2[1];
46
+ var batchCupAction = useBatchCupAction();
47
+ useEffect(function () {
48
+ if (!cupData) {
49
+ setCupList([]);
50
+ return;
51
+ }
52
+ var initialCups = Array.isArray(cupData) ? cupData : [cupData];
53
+ setCupList(initialCups);
54
+ }, [cupData]);
55
+
56
+ /**
57
+ * @description: OTHER_RENT 状态
58
+ * @param {*} useMemo
59
+ * @return {*}
60
+ */
61
+ var otherRentStatus = useMemo(function () {
62
+ return scanStatus === ECupScanStatus.OTHER_RENT;
63
+ }, [scanStatus]);
64
+ var isRed = !otherRentStatus;
65
+
66
+ // 使用自定义 hook 统计杯子列表信息
67
+ var cupStatistics = useCupListStatistics(cupList);
29
68
  var lineStyle = useMemo(function () {
30
69
  if (isRed) {
31
70
  return {
@@ -41,11 +80,15 @@ var CupStatusModal = function CupStatusModal(props) {
41
80
 
42
81
  // 杯子信息卡片类型
43
82
  var cupInfoCardType = useMemo(function () {
44
- if (scanStatus === ECupScanStatus.OTHER_IN_STOCK || scanStatus === ECupScanStatus.IN_STOCK) {
83
+ if (scanStatus === ECupScanStatus.OTHER_IN_STOCK) {
84
+ // 杯子归属信息
85
+ return 'otherBelongInfo';
86
+ }
87
+ if (scanStatus === ECupScanStatus.IN_STOCK) {
45
88
  // 展示归属信息
46
89
  return 'belongInfo';
47
90
  }
48
- if (scanStatus === ECupScanStatus.OTHER_RENT || scanStatus === ECupScanStatus.RENT) {
91
+ if (otherRentStatus || scanStatus === ECupScanStatus.RENT) {
49
92
  // 展示借出信息
50
93
  return 'rentInfo';
51
94
  }
@@ -61,7 +104,7 @@ var CupStatusModal = function CupStatusModal(props) {
61
104
  };
62
105
  var _onOk = /*#__PURE__*/function () {
63
106
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
64
- var type, result;
107
+ var type, result, ids;
65
108
  return _regeneratorRuntime().wrap(function _callee$(_context) {
66
109
  while (1) switch (_context.prev = _context.next) {
67
110
  case 0:
@@ -71,7 +114,7 @@ var CupStatusModal = function CupStatusModal(props) {
71
114
  }
72
115
  return _context.abrupt("return");
73
116
  case 2:
74
- type = scanStatus === ECupScanStatus.OTHER_IN_STOCK ? ECupActionType.TRANSFER : scanStatus === ECupScanStatus.OTHER_RENT ? ECupActionType.RETURN : '';
117
+ type = otherRentStatus ? ECupActionType.RETURN : '';
75
118
  if (type) {
76
119
  _context.next = 6;
77
120
  break;
@@ -79,17 +122,32 @@ var CupStatusModal = function CupStatusModal(props) {
79
122
  onOk === null || onOk === void 0 || onOk();
80
123
  return _context.abrupt("return");
81
124
  case 6:
82
- _context.next = 8;
125
+ if (!otherRentStatus) {
126
+ _context.next = 13;
127
+ break;
128
+ }
129
+ ids = cupList.map(function (cup) {
130
+ return (cup === null || cup === void 0 ? void 0 : cup.eco_cup_id) || (cup === null || cup === void 0 ? void 0 : cup.id);
131
+ });
132
+ _context.next = 10;
133
+ return batchCupAction.run(ids);
134
+ case 10:
135
+ result = _context.sent;
136
+ _context.next = 16;
137
+ break;
138
+ case 13:
139
+ _context.next = 15;
83
140
  return cupAction.run((cupData === null || cupData === void 0 ? void 0 : cupData.eco_cup_id) || (cupData === null || cupData === void 0 ? void 0 : cupData.id), type);
84
- case 8:
141
+ case 15:
85
142
  result = _context.sent;
143
+ case 16:
86
144
  if (result) {
87
145
  PisellToast({
88
146
  content: locales.getText("pisell2.text.ecocup.toast.success-".concat(type))
89
147
  });
90
148
  onOk === null || onOk === void 0 || onOk();
91
149
  }
92
- case 10:
150
+ case 17:
93
151
  case "end":
94
152
  return _context.stop();
95
153
  }
@@ -99,49 +157,125 @@ var CupStatusModal = function CupStatusModal(props) {
99
157
  return _ref2.apply(this, arguments);
100
158
  };
101
159
  }();
160
+
161
+ /**
162
+ * @description: 搜索结果回调,将新杯子添加到列表
163
+ */
164
+ var onSearchResult = function onSearchResult(result) {
165
+ var _result$data2;
166
+ // 判断杯子是否已经在列表中
167
+ if (cupList.find(function (c) {
168
+ var _result$data;
169
+ return (c === null || c === void 0 ? void 0 : c.id) === (result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.id);
170
+ })) {
171
+ return;
172
+ }
173
+
174
+ // 判断杯子是否已经租出
175
+ if ((result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.status) !== ECupStatus.RENT) {
176
+ return;
177
+ }
178
+
179
+ // 将新杯子添加到列表
180
+ setCupList([].concat(_toConsumableArray(cupList), [result === null || result === void 0 ? void 0 : result.data]));
181
+ };
182
+
183
+ /**
184
+ * @description: 从列表中移除杯子
185
+ */
186
+ var removeCupFromList = function removeCupFromList(cupId) {
187
+ setCupList(cupList.filter(function (cup) {
188
+ return (cup === null || cup === void 0 ? void 0 : cup.id) !== cupId;
189
+ }));
190
+ };
191
+ var renderSearchBar = function renderSearchBar() {
192
+ return /*#__PURE__*/React.createElement("div", {
193
+ className: "pisell2-ecocup-customer-first-modal-search-bar"
194
+ }, /*#__PURE__*/React.createElement(SearchBar, {
195
+ scanListenerKey: SCAN_LISTENER_KEY,
196
+ searchType: "cup",
197
+ placeholder: locales.getText('pisell2.text.ecocup.customer-first-modal.search-bar.placeholder'),
198
+ onSearchResult: onSearchResult,
199
+ onCupStatusValidate: onSearchResult
200
+ }));
201
+ };
202
+ var showRemove = useMemo(function () {
203
+ return (cupList === null || cupList === void 0 ? void 0 : cupList.length) > 1 && otherRentStatus;
204
+ }, [cupList.length, otherRentStatus]);
102
205
  return /*#__PURE__*/React.createElement(PisellModal, {
103
206
  headerDivider: false,
104
207
  open: visible,
105
208
  onCancel: _onCancel,
106
209
  onOk: _onOk,
107
- title: locales.getText("pisell2.text.ecocup.cup-status-modal.title-".concat(scanStatus)),
108
- cancelText: locales.getText('pisell2.text.ecocup.button.dismiss'),
109
- okText: isRed ? locales.getText('pisell2.text.ecocup.button.confirm') : scanStatus === ECupScanStatus.OTHER_IN_STOCK ? locales.getText('pisell2.text.ecocup.button.transfer') : locales.getText('pisell2.text.ecocup.button.mark-as-return'),
210
+ title: otherRentStatus ? locales.getText("pisell2.text.ecocup.cup-status-modal.title-".concat(scanStatus))(cupList.length) : locales.getText("pisell2.text.ecocup.cup-status-modal.title-".concat(scanStatus)),
211
+ cancelText: otherRentStatus ? locales.getText('pisell2.text.ecocup.button.cancel') : locales.getText('pisell2.text.ecocup.button.dismiss'),
212
+ okText: isRed ? locales.getText('pisell2.text.ecocup.button.confirm') : locales.getText('pisell2.text.ecocup.button.return'),
110
213
  okButtonProps: {
111
214
  loading: cupAction === null || cupAction === void 0 ? void 0 : cupAction.loading
112
215
  },
113
216
  cancelVisible: !isRed,
114
217
  width: 580
115
218
  }, /*#__PURE__*/React.createElement("div", {
116
- className: "pisell2-ecocup-cup-status-modal-content"
117
- }, /*#__PURE__*/React.createElement("div", {
118
- className: "pisell2-ecocup-cup-status-modal-content-cup",
119
- style: _objectSpread({}, lineStyle)
120
- }, /*#__PURE__*/React.createElement(Icon, {
121
- type: "RestOutlined",
122
- size: 24
123
- }), /*#__PURE__*/React.createElement("span", {
219
+ className: "pisell2-ecocup-cup-status-modal-content",
124
220
  style: {
125
- color: !isRed ? '#667085' : '#F04438'
221
+ gap: otherRentStatus ? '20px' : '32px'
126
222
  }
127
- }, locales.getText('pisell2.text.ecocup.cup-id')), /*#__PURE__*/React.createElement("span", null, (cupData === null || cupData === void 0 ? void 0 : cupData.eco_cup_code) || (cupData === null || cupData === void 0 ? void 0 : cupData.code) || '')), /*#__PURE__*/React.createElement("div", {
223
+ }, otherRentStatus ? /*#__PURE__*/React.createElement("div", {
224
+ className: "pisell2-ecocup-cup-status-modal-content-search"
225
+ }, /*#__PURE__*/React.createElement("span", {
226
+ className: "tip-text"
227
+ }, locales.getText('pisell2.text.ecocup.cup-status-modal.search-bar.title')), renderSearchBar()) : null, /*#__PURE__*/React.createElement("div", {
228
+ className: "pisell2-ecocup-cup-status-modal-content-cup-lists"
229
+ }, cupList.map(function (cup, index) {
230
+ return /*#__PURE__*/React.createElement("div", {
231
+ key: (cup === null || cup === void 0 ? void 0 : cup.id) || index,
232
+ className: "pisell2-ecocup-cup-status-modal-content-cup",
233
+ style: _objectSpread(_objectSpread({}, lineStyle), {}, {
234
+ justifyContent: showRemove ? 'space-between' : 'center'
235
+ })
236
+ }, /*#__PURE__*/React.createElement("div", {
237
+ className: "pisell2-ecocup-cup-status-modal-content-cup-info"
238
+ }, /*#__PURE__*/React.createElement(Icon, {
239
+ type: "RestOutlined",
240
+ size: 24
241
+ }), /*#__PURE__*/React.createElement("span", {
242
+ style: {
243
+ color: !isRed ? '#667085' : '#F04438'
244
+ }
245
+ }, locales.getText('pisell2.text.ecocup.cup-id')), /*#__PURE__*/React.createElement("span", null, (cup === null || cup === void 0 ? void 0 : cup.eco_cup_code) || (cup === null || cup === void 0 ? void 0 : cup.code) || '')), showRemove && /*#__PURE__*/React.createElement(Button, {
246
+ type: "primary",
247
+ icon: /*#__PURE__*/React.createElement(Icon, {
248
+ type: "pisell2-trash-01",
249
+ size: 24,
250
+ color: "#7F56DA"
251
+ }),
252
+ onClick: function onClick() {
253
+ return removeCupFromList(cup === null || cup === void 0 ? void 0 : cup.id);
254
+ },
255
+ className: "info-remove"
256
+ }, locales.getText('pisell2.text.ecocup.button.remove')));
257
+ })), /*#__PURE__*/React.createElement("div", {
128
258
  className: "pisell2-ecocup-cup-status-modal-content-info"
129
259
  }, /*#__PURE__*/React.createElement("div", {
130
260
  style: {
131
261
  flex: 1
132
262
  }
133
- }, cupData !== null && cupData !== void 0 && cupData.current_shop && cupInfoCardType ? /*#__PURE__*/React.createElement(CupInfoCard, {
263
+ }, (cupStatistics !== null && cupStatistics !== void 0 && cupStatistics.uniqueShop || cupStatistics !== null && cupStatistics !== void 0 && cupStatistics.hasMultipleShops) && cupInfoCardType ? /*#__PURE__*/React.createElement(CupInfoCard, {
134
264
  type: cupInfoCardType,
135
265
  data: {
136
- shop: cupData === null || cupData === void 0 || (_cupData$current_shop = cupData.current_shop) === null || _cupData$current_shop === void 0 ? void 0 : _cupData$current_shop.name,
137
- time: cupData === null || cupData === void 0 ? void 0 : cupData.operated_at
266
+ shop: cupStatistics === null || cupStatistics === void 0 || (_cupStatistics$unique = cupStatistics.uniqueShop) === null || _cupStatistics$unique === void 0 ? void 0 : _cupStatistics$unique.name,
267
+ time: cupStatistics === null || cupStatistics === void 0 ? void 0 : cupStatistics.uniqueTime,
268
+ isMultipleTime: cupStatistics === null || cupStatistics === void 0 ? void 0 : cupStatistics.hasMultipleTimes,
269
+ isMultipleShop: cupStatistics === null || cupStatistics === void 0 ? void 0 : cupStatistics.hasMultipleShops
138
270
  }
139
271
  }) : null), /*#__PURE__*/React.createElement("div", {
140
272
  style: {
141
273
  flex: 1
142
274
  }
143
- }, (cupData === null || cupData === void 0 ? void 0 : cupData.status) === ECupStatus.RENT ? cupData !== null && cupData !== void 0 && cupData.customer ? /*#__PURE__*/React.createElement(CustomerCard, (cupData === null || cupData === void 0 ? void 0 : cupData.customer) || {}) : null : (cupData === null || cupData === void 0 ? void 0 : cupData.status) === ECupStatus.IN_STOCK ? null : /*#__PURE__*/React.createElement("div", {
275
+ }, (cupList === null || cupList === void 0 || (_cupList$ = cupList[0]) === null || _cupList$ === void 0 ? void 0 : _cupList$.status) === ECupStatus.RENT ? cupStatistics !== null && cupStatistics !== void 0 && cupStatistics.uniqueCustomer || cupStatistics !== null && cupStatistics !== void 0 && cupStatistics.hasMultipleCustomers ? /*#__PURE__*/React.createElement(CustomerCard, _extends({}, (cupStatistics === null || cupStatistics === void 0 ? void 0 : cupStatistics.uniqueCustomer) || {}, {
276
+ isMultiple: cupStatistics === null || cupStatistics === void 0 ? void 0 : cupStatistics.hasMultipleCustomers
277
+ })) : null : /*#__PURE__*/React.createElement("div", {
144
278
  className: "pisell2-ecocup-cup-status-modal-content-info-tip"
145
- }, locales.getText('pisell2.text.ecocup.cup-status-modal.tip'))))));
279
+ }, (cupList === null || cupList === void 0 || (_cupList$2 = cupList[0]) === null || _cupList$2 === void 0 ? void 0 : _cupList$2.status) === ECupStatus.IN_STOCK ? locales.getText('pisell2.text.ecocup.cup-status-modal.tip-in-stock') : locales.getText('pisell2.text.ecocup.cup-status-modal.tip'))))));
146
280
  };
147
281
  export default CupStatusModal;
@@ -4,32 +4,70 @@
4
4
  flex-direction: column;
5
5
  gap: 32px;
6
6
 
7
+ &-cup-lists {
8
+ display: flex;
9
+ align-items: center;
10
+ flex-direction: column;
11
+ gap: 4px;
12
+ }
13
+
7
14
  &-cup {
8
15
  height: 60px;
9
16
  padding: 0 16px;
10
17
  display: flex;
11
18
  flex-direction: row;
12
19
  align-items: center;
13
- justify-content: center;
20
+ justify-content: space-between;
14
21
  border-radius: 8px;
15
22
  gap: 8px;
23
+ width: 100%;
24
+
25
+ .info-remove {
26
+ display: flex;
27
+ flex-direction: row;
28
+ align-items: center;
29
+ justify-content: center;
30
+ border-radius: 8px;
31
+ border: 1px solid #7f56da;
32
+ background: #f6f2ff;
33
+ color: #7F56DA;
34
+ }
35
+ }
36
+
37
+ &-cup-info {
38
+ display: flex;
39
+ align-items: center;
40
+ gap: 8px;
16
41
 
17
- & > span {
42
+ &>span {
18
43
  font-size: 20px;
19
44
  font-weight: 300;
20
45
  }
21
46
  }
22
47
 
48
+ &-search {
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: 8px;
52
+ .tip-text {
53
+ font-size: 14px;
54
+ font-weight: 500;
55
+ color: rgb(127, 86, 218);
56
+ text-align: center;
57
+ }
58
+ }
59
+
23
60
  &-info {
24
61
  display: flex;
25
62
  align-items: center;
26
- justify-content: space-between;
27
-
28
- &-tip {
29
- flex: 1;
30
- color: #d92d20;
31
- font-size: 16px;
32
- font-weight: 400;
63
+ gap: 8px;
64
+ &>div:nth-child(2) {
65
+ display: flex;
66
+ justify-content: flex-end;
33
67
  }
34
68
  }
35
- }
69
+
70
+ .comprehensive-search__search-section .comprehensive-search__search-button {
71
+ min-width: 60px !important;
72
+ }
73
+ }