@pisell/private-materials 3.3.16 → 3.3.17

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 (242) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +7 -7
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +3 -3
  9. package/es/components/Sales/Summary/utils.d.ts +1 -1
  10. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -16
  11. package/es/components/appointmentBooking/components/Cart/Item/Total.js +0 -1
  12. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Cart/Item/index.js +40 -13
  14. package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Cart/utils.d.ts +20 -0
  16. package/es/components/appointmentBooking/components/Cart/utils.js +67 -1
  17. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +2 -3
  18. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
  19. package/es/components/appointmentBooking/components/Content/index.js +50 -7
  20. package/es/components/appointmentBooking/components/Date/index.js +10 -2
  21. package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  22. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  23. package/es/components/appointmentBooking/components/Form/index.js +61 -49
  24. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  25. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  26. package/es/components/appointmentBooking/components/Header/index.js +5 -4
  27. package/es/components/appointmentBooking/components/Services/index.js +2 -4
  28. package/es/components/appointmentBooking/components/Voucher/index.js +1 -1
  29. package/es/components/appointmentBooking/context.d.ts +5 -1
  30. package/es/components/appointmentBooking/context.js +37 -14
  31. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
  32. package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
  33. package/es/components/appointmentBooking/hooks.js +7 -19
  34. package/es/components/appointmentBooking/locales.d.ts +3 -0
  35. package/es/components/appointmentBooking/locales.js +196 -193
  36. package/es/components/appointmentBooking/utils.js +21 -13
  37. package/es/components/booking/components/customSelect/index.js +2 -0
  38. package/es/components/booking/components/footer/index.d.ts +0 -1
  39. package/es/components/booking/components/footer/index.js +27 -22
  40. package/es/components/booking/components/footer/utils.d.ts +1 -0
  41. package/es/components/booking/components/footer/utils.js +17 -2
  42. package/es/components/booking/components/voucher/index.d.ts +1 -0
  43. package/es/components/booking/forms/footer.d.ts +1 -0
  44. package/es/components/booking/forms/forms.d.ts +4 -0
  45. package/es/components/booking/forms/forms.js +14 -3
  46. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  47. package/es/components/booking/forms/single/index.d.ts +1 -2
  48. package/es/components/booking/forms/single/index.js +33 -26
  49. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  50. package/es/components/booking/info/client/index.js +24 -3
  51. package/es/components/booking/info/client/index.less +39 -0
  52. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  53. package/es/components/booking/info/clientVariant/hooks/useClientFn.js +10 -1
  54. package/es/components/booking/info/clientVariant/utils.d.ts +1 -0
  55. package/es/components/booking/info/clientVariant/utils.js +6 -0
  56. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +17 -2
  57. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.less +17 -0
  58. package/es/components/booking/info/clientVariant/vertical/index.js +29 -4
  59. package/es/components/booking/info/clientVariant/vertical/index.less +18 -0
  60. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  61. package/es/components/booking/info/hooks/useAddHolder.d.ts +8 -1
  62. package/es/components/booking/info/hooks/useAddHolder.js +131 -31
  63. package/es/components/booking/info/hooks/useGetHolderList.d.ts +2 -0
  64. package/es/components/booking/info/hooks/useGetHolderList.js +48 -0
  65. package/es/components/booking/info/hooks/useHolderConfig.js +2 -2
  66. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  67. package/es/components/booking/info/hooks/useInfoHolder.js +4 -41
  68. package/es/components/booking/info/pet/index.js +83 -8
  69. package/es/components/booking/info/pet/serve.d.ts +1 -0
  70. package/es/components/booking/info/pet/serve.js +27 -0
  71. package/es/components/booking/info/service/Lists.d.ts +0 -1
  72. package/es/components/booking/info/service/Lists.js +2 -1
  73. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  74. package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
  75. package/es/components/booking/info/service2/utils.d.ts +2 -0
  76. package/es/components/booking/info/service2/utils.js +20 -10
  77. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  78. package/es/components/booking/info2/utilsByBooking.d.ts +1 -0
  79. package/es/components/booking/info2/utilsByBooking.js +9 -1
  80. package/es/components/booking/locales.d.ts +21 -0
  81. package/es/components/booking/locales.js +42 -3
  82. package/es/components/booking/utils.js +3 -1
  83. package/es/components/eftposPay/amount.d.ts +1 -1
  84. package/es/components/eftposPay/device.d.ts +1 -1
  85. package/es/components/eftposPay/hooks.d.ts +1 -1
  86. package/es/components/eftposPay/store/index.d.ts +3 -3
  87. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  88. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
  89. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
  90. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
  91. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  92. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  93. package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  94. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  95. package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
  96. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  97. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  98. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  99. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  100. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  101. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  102. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  103. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  104. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  105. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  106. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  107. package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
  108. package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
  109. package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
  110. package/es/components/shoppingCart/Provider.js +0 -1
  111. package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  112. package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
  113. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  114. package/es/components/shoppingCart/components/Render/index.js +0 -1
  115. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  116. package/es/components/shoppingCart/hooks/useClearCart.js +0 -2
  117. package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -3
  118. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  119. package/es/components/ticketBooking/components/ticketBooking/index.js +5 -6
  120. package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
  121. package/es/components/ticketBooking/index.d.ts +5 -2
  122. package/es/components/ticketBooking/index.js +20 -5
  123. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  124. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  125. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  126. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -8
  127. package/lib/components/appointmentBooking/components/Cart/Item/Total.js +0 -1
  128. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
  129. package/lib/components/appointmentBooking/components/Cart/Item/index.js +27 -11
  130. package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  131. package/lib/components/appointmentBooking/components/Cart/utils.d.ts +20 -0
  132. package/lib/components/appointmentBooking/components/Cart/utils.js +32 -2
  133. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +3 -3
  134. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
  135. package/lib/components/appointmentBooking/components/Content/index.js +26 -1
  136. package/lib/components/appointmentBooking/components/Date/index.js +4 -0
  137. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  138. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  139. package/lib/components/appointmentBooking/components/Form/index.js +48 -36
  140. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  141. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  142. package/lib/components/appointmentBooking/components/Header/index.js +5 -4
  143. package/lib/components/appointmentBooking/components/Services/index.js +4 -6
  144. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -4
  145. package/lib/components/appointmentBooking/context.d.ts +5 -1
  146. package/lib/components/appointmentBooking/context.js +17 -5
  147. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
  148. package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
  149. package/lib/components/appointmentBooking/hooks.js +1 -12
  150. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  151. package/lib/components/appointmentBooking/locales.js +4 -1
  152. package/lib/components/appointmentBooking/utils.js +19 -13
  153. package/lib/components/booking/components/customSelect/index.js +2 -0
  154. package/lib/components/booking/components/footer/index.d.ts +0 -1
  155. package/lib/components/booking/components/footer/index.js +3 -1
  156. package/lib/components/booking/components/footer/utils.d.ts +1 -0
  157. package/lib/components/booking/components/footer/utils.js +16 -1
  158. package/lib/components/booking/components/voucher/index.d.ts +1 -0
  159. package/lib/components/booking/forms/footer.d.ts +1 -0
  160. package/lib/components/booking/forms/forms.d.ts +4 -0
  161. package/lib/components/booking/forms/forms.js +13 -3
  162. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  163. package/lib/components/booking/forms/single/index.d.ts +1 -2
  164. package/lib/components/booking/forms/single/index.js +13 -1
  165. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  166. package/lib/components/booking/info/client/index.js +20 -3
  167. package/lib/components/booking/info/client/index.less +39 -0
  168. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  169. package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +8 -1
  170. package/lib/components/booking/info/clientVariant/utils.d.ts +1 -0
  171. package/lib/components/booking/info/clientVariant/utils.js +34 -0
  172. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -3
  173. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.less +17 -0
  174. package/lib/components/booking/info/clientVariant/vertical/index.js +31 -6
  175. package/lib/components/booking/info/clientVariant/vertical/index.less +18 -0
  176. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  177. package/lib/components/booking/info/hooks/useAddHolder.d.ts +8 -1
  178. package/lib/components/booking/info/hooks/useAddHolder.js +88 -16
  179. package/lib/components/booking/info/hooks/useGetHolderList.d.ts +2 -0
  180. package/lib/components/booking/info/hooks/useGetHolderList.js +61 -0
  181. package/lib/components/booking/info/hooks/useHolderConfig.js +2 -2
  182. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  183. package/lib/components/booking/info/hooks/useInfoHolder.js +2 -21
  184. package/lib/components/booking/info/pet/index.js +57 -10
  185. package/lib/components/booking/info/pet/serve.d.ts +1 -0
  186. package/lib/components/booking/info/pet/serve.js +33 -0
  187. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  188. package/lib/components/booking/info/service/Lists.js +1 -1
  189. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  190. package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
  191. package/lib/components/booking/info/service2/utils.d.ts +2 -0
  192. package/lib/components/booking/info/service2/utils.js +17 -7
  193. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  194. package/lib/components/booking/info2/utilsByBooking.d.ts +1 -0
  195. package/lib/components/booking/info2/utilsByBooking.js +8 -1
  196. package/lib/components/booking/locales.d.ts +21 -0
  197. package/lib/components/booking/locales.js +42 -3
  198. package/lib/components/booking/utils.js +3 -1
  199. package/lib/components/eftposPay/amount.d.ts +1 -1
  200. package/lib/components/eftposPay/device.d.ts +1 -1
  201. package/lib/components/eftposPay/hooks.d.ts +1 -1
  202. package/lib/components/eftposPay/store/index.d.ts +3 -3
  203. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  204. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
  205. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
  206. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
  207. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  208. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  209. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  210. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  211. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
  212. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  213. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  214. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  215. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  216. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  217. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  218. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  219. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  220. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
  221. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  222. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  223. package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
  224. package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
  225. package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
  226. package/lib/components/shoppingCart/Provider.js +0 -1
  227. package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  228. package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
  229. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  230. package/lib/components/shoppingCart/components/Render/index.js +0 -1
  231. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  232. package/lib/components/shoppingCart/hooks/useClearCart.js +1 -2
  233. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +2 -3
  234. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  235. package/lib/components/ticketBooking/components/ticketBooking/index.js +4 -3
  236. package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
  237. package/lib/components/ticketBooking/index.d.ts +5 -2
  238. package/lib/components/ticketBooking/index.js +13 -4
  239. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  240. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  241. package/lowcode/ticket-booking/meta.ts +26 -0
  242. package/package.json +2 -2
@@ -21,7 +21,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
21
  import User01 from '@pisell/icon/es/User01';
22
22
  import { locales } from '@pisell/utils';
23
23
  import { useMemoizedFn } from 'ahooks';
24
- import { Avatar, Button, Skeleton } from 'antd';
24
+ import { Avatar, Button, Skeleton, Tag } from 'antd';
25
25
  import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
26
26
  import useEngineContext from "../../../../hooks/useEngineContext";
27
27
  import { changeFormValues, sortFormValues } from "../../forms/format";
@@ -31,6 +31,9 @@ import { isWalkIn } from "../../utils";
31
31
  import { Context } from "../model";
32
32
  import ChangePetModal from "./ChangePetModal";
33
33
  import "./index.less";
34
+ import useAddHolder, { useFormDataConfig } from "../hooks/useAddHolder";
35
+ import useGetHolderList from "../hooks/useGetHolderList";
36
+ import dayjs from 'dayjs';
34
37
  var defaultParams = {
35
38
  skip: 1,
36
39
  num: 20,
@@ -69,6 +72,12 @@ var Pet = function Pet(props) {
69
72
  var changePetRef = useRef(null);
70
73
  state = state || (props === null || props === void 0 ? void 0 : props.state);
71
74
  dispatch = dispatch || (props === null || props === void 0 ? void 0 : props.dispatch);
75
+ var _useAddHolder = useAddHolder(state, dispatch),
76
+ waiverForm = _useAddHolder.waiverForm;
77
+ var _useFormDataConfig = useFormDataConfig(state),
78
+ isMinorAndWaiver = _useFormDataConfig.isMinorAndWaiver;
79
+ var getHolders = useGetHolderList(state, dispatch);
80
+ console.log('waiver', props, state);
72
81
  // board设置, 获取预约主体
73
82
  var boardParams = useMemo(function () {
74
83
  var _state;
@@ -145,7 +154,16 @@ var Pet = function Pet(props) {
145
154
  if (_params.skip === 1) {
146
155
  _list = (data === null || data === void 0 ? void 0 : data.list) || [];
147
156
  } else {
148
- _list = _list.concat((data === null || data === void 0 ? void 0 : data.list) || []);
157
+ ((data === null || data === void 0 ? void 0 : data.list) || []).forEach(function (item) {
158
+ var index = _list.findIndex(function (old) {
159
+ return old.id === item.id;
160
+ });
161
+ if (index > -1) {
162
+ _list[index] = item;
163
+ } else {
164
+ _list.push(item);
165
+ }
166
+ });
149
167
  }
150
168
  setParams(_objectSpread(_objectSpread(_objectSpread({}, params), _params), {}, {
151
169
  total: (data === null || data === void 0 ? void 0 : data.count) || 0
@@ -465,7 +483,7 @@ var Pet = function Pet(props) {
465
483
  // if (_formData?.type === "multiple" || _formData?.type === "single") {
466
484
  getFormData({
467
485
  formData: _formData
468
- }, _params);
486
+ }, _params || params);
469
487
  // }
470
488
  });
471
489
  var searchChange = useMemoizedFn(function (keyword) {
@@ -529,8 +547,60 @@ var Pet = function Pet(props) {
529
547
  }
530
548
  return {};
531
549
  }, [state.renderType, state.service.value]);
550
+ var ignoreValidity = useMemo(function () {
551
+ var _petForm$setting;
552
+ return !(petForm !== null && petForm !== void 0 && (_petForm$setting = petForm.setting) !== null && _petForm$setting !== void 0 && _petForm$setting.validity) || petForm.setting.validity.type === 'no_expiry';
553
+ }, [petForm]);
554
+ var getExpireStatus = function getExpireStatus(expiredAt) {
555
+ if (ignoreValidity || !expiredAt) return null;
556
+ var now = dayjs();
557
+ // 将过期时间设置为当天的最后一秒
558
+ var expireDate = dayjs(expiredAt).endOf('day');
559
+ var diffDays = expireDate.diff(now, 'day');
560
+ // 格式化显示日期(不显示时间)
561
+ var formattedDate = expireDate.format('YYYY-MM-DD');
562
+ if (now.isAfter(expireDate)) {
563
+ return /*#__PURE__*/React.createElement("div", {
564
+ style: {
565
+ color: '#999999',
566
+ fontSize: '14px',
567
+ lineHeight: '20px'
568
+ }
569
+ }, /*#__PURE__*/React.createElement(Tag, {
570
+ color: "red",
571
+ style: {
572
+ borderRadius: 16,
573
+ marginRight: 8
574
+ }
575
+ }, locales.getText('pisell2.text.status.expired')), locales.getText('pisell2.text.validity.expired')(formattedDate));
576
+ }
577
+ if (diffDays <= 7) {
578
+ return /*#__PURE__*/React.createElement("div", {
579
+ style: {
580
+ color: '#FFA940',
581
+ fontSize: '14px',
582
+ lineHeight: '20px'
583
+ }
584
+ }, locales.getText('pisell2.text.validity.expiring_soon')(formattedDate));
585
+ }
586
+ return /*#__PURE__*/React.createElement("div", {
587
+ style: {
588
+ color: '#999999',
589
+ fontSize: '14px',
590
+ lineHeight: '20px'
591
+ }
592
+ }, locales.getText('pisell2.text.validity.valid_through')(formattedDate));
593
+ };
532
594
  return useMemo(function () {
533
- var _state$client11;
595
+ var _petForm$setting2, _state$client11;
596
+ var canEdit = true;
597
+ if (petForm !== null && petForm !== void 0 && (_petForm$setting2 = petForm.setting) !== null && _petForm$setting2 !== void 0 && _petForm$setting2.permissions) {
598
+ var _petForm$setting3;
599
+ var _ref6 = (petForm === null || petForm === void 0 || (_petForm$setting3 = petForm.setting) === null || _petForm$setting3 === void 0 ? void 0 : _petForm$setting3.permissions) || {},
600
+ _ref6$staff = _ref6.staff,
601
+ staff = _ref6$staff === void 0 ? [] : _ref6$staff;
602
+ canEdit = staff.includes('edit');
603
+ }
534
604
  return /*#__PURE__*/React.createElement("div", {
535
605
  className: "pisell-lowcode__booking-pet-wraps"
536
606
  }, /*#__PURE__*/React.createElement(Skeleton, {
@@ -538,6 +608,8 @@ var Pet = function Pet(props) {
538
608
  active: true,
539
609
  round: true
540
610
  }, /*#__PURE__*/React.createElement(FormsCom, {
611
+ isMinorAndWaiver: isMinorAndWaiver,
612
+ waiverForm: waiverForm,
541
613
  hideTitle: hideTitle,
542
614
  watch: {
543
615
  value: state.pet.value
@@ -548,6 +620,8 @@ var Pet = function Pet(props) {
548
620
  form_id: formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.form_id
549
621
  })].concat(_toConsumableArray(((_state$pet11 = state.pet) === null || _state$pet11 === void 0 || (_state$pet11 = _state$pet11.formData) === null || _state$pet11 === void 0 || (_state$pet11 = _state$pet11[0]) === null || _state$pet11 === void 0 ? void 0 : _state$pet11.options) || [])));
550
622
  },
623
+ getHolders: getHolders,
624
+ addCallbackService: _addCallback,
551
625
  loading: valueLoading,
552
626
  forms: state.pet.formData,
553
627
  action: state.action,
@@ -575,6 +649,7 @@ var Pet = function Pet(props) {
575
649
  previewItemTitleRender: previewItemTitleRender
576
650
  }, dayCustomSelect),
577
651
  optionRender: function optionRender(item) {
652
+ console.log('waiver', petForm, item);
578
653
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Avatar, {
579
654
  className: "pisell-lowcode__booking-pet-list-item-avatar",
580
655
  src: item.cover,
@@ -589,7 +664,7 @@ var Pet = function Pet(props) {
589
664
  className: "pisell-lowcode__booking-pet-list-item-info-desc"
590
665
  }, /*#__PURE__*/React.createElement("div", {
591
666
  className: ""
592
- }, item.key_age))), /*#__PURE__*/React.createElement("div", {
667
+ }, item.key_age)), /*#__PURE__*/React.createElement("div", null, getExpireStatus(item.expired_at))), /*#__PURE__*/React.createElement("div", {
593
668
  className: "pisell-lowcode__booking-pet-list-item-actions"
594
669
  }, /*#__PURE__*/React.createElement("div", {
595
670
  className: "pisell-lowcode__booking-pet-list-item-actions-view",
@@ -598,14 +673,14 @@ var Pet = function Pet(props) {
598
673
  e.stopPropagation();
599
674
  handleViewItem(item);
600
675
  }
601
- }, locales.getText('pisell2.text.view')), /*#__PURE__*/React.createElement("div", {
676
+ }, locales.getText('pisell2.text.view')), canEdit ? /*#__PURE__*/React.createElement("div", {
602
677
  className: "pisell-lowcode__booking-pet-list-item-actions-edit",
603
678
  onClick: function onClick(e) {
604
679
  e.preventDefault();
605
680
  e.stopPropagation();
606
681
  handleEditItem(item);
607
682
  }
608
- }, locales.getText('pisell2.text.edit'))));
683
+ }, locales.getText('pisell2.text.edit')) : null));
609
684
  },
610
685
  addButtonProps: _objectSpread({
611
686
  style: {
@@ -634,6 +709,6 @@ var Pet = function Pet(props) {
634
709
  })), /*#__PURE__*/React.createElement(ChangePetModal, {
635
710
  ref: changePetRef
636
711
  }));
637
- }, [valueLoading, hideTitle, state.pet.value, state.pet.formData, state.action, state.modalOpen, state.pet.value, (_state$client12 = state.client) === null || _state$client12 === void 0 ? void 0 : _state$client12.value, loading, state.disabledEdit, state.isTerminal, state.disableEventBookingEdit, params.search, loadMore, addButtonProps, state.isBookingCreatePage]);
712
+ }, [valueLoading, hideTitle, state.pet.value, state.pet.formData, state.action, state.modalOpen, state.pet.value, (_state$client12 = state.client) === null || _state$client12 === void 0 ? void 0 : _state$client12.value, loading, state.disabledEdit, state.isTerminal, state.disableEventBookingEdit, params.search, loadMore, addButtonProps, state.isBookingCreatePage, isMinorAndWaiver, waiverForm, petForm]);
638
713
  };
639
714
  export default Pet;
@@ -0,0 +1 @@
1
+ export declare const getFormDetail: (id: number) => Promise<any>;
@@ -0,0 +1,27 @@
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 _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; }
3
+ 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); } }
4
+ 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); }); }; }
5
+ import { request } from "../../utils";
6
+ export var getFormDetail = /*#__PURE__*/function () {
7
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
8
+ var _yield$request$getReq, data;
9
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10
+ while (1) switch (_context.prev = _context.next) {
11
+ case 0:
12
+ _context.next = 2;
13
+ return request.getRequest().get("/shop/form/".concat(id));
14
+ case 2:
15
+ _yield$request$getReq = _context.sent;
16
+ data = _yield$request$getReq.data;
17
+ return _context.abrupt("return", data);
18
+ case 5:
19
+ case "end":
20
+ return _context.stop();
21
+ }
22
+ }, _callee);
23
+ }));
24
+ return function getFormDetail(_x) {
25
+ return _ref.apply(this, arguments);
26
+ };
27
+ }();
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
3
2
  export default Lists;
@@ -24,7 +24,8 @@ var Lists = function Lists(_ref) {
24
24
  dispatch = _useContext.dispatch;
25
25
  var _useHolderConfig = useHolderConfig(state),
26
26
  isShowChangeHolder = _useHolderConfig.isShowChangeHolder;
27
- var handleAddHolder = useAddHolder(state, dispatch);
27
+ var _useAddHolder = useAddHolder(state, dispatch),
28
+ handleAddHolder = _useAddHolder.handleAddHolder;
28
29
 
29
30
  /**
30
31
  * @title: 更新商品数据
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const BookingList: ({ items }: {
2
3
  items: any[];
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, resourceItem, errorMessage, handleDeleteService, }: any) => JSX.Element;
3
4
  export default ServiceItem;
@@ -39,6 +39,7 @@ export declare const isBookingProduct: (extension_type: any, bol?: boolean) => b
39
39
  * @Date: 2024-12-06 11:24
40
40
  */
41
41
  export declare const isDayBookingProduct: (item: any, state: any) => boolean | undefined;
42
+ export declare const handleChangeHolder: (products: any[], currentItem: any, other: any) => any[];
42
43
  /**
43
44
  * @title: 更新商品数据
44
45
  * @description:
@@ -53,6 +54,7 @@ export declare const isDayBookingProduct: (item: any, state: any) => boolean | u
53
54
  */
54
55
  export declare const updateServices: (state: any, currentItem: any, type?: string, other?: any, actions?: any) => any;
55
56
  export declare const formItems: (items: any[]) => any[];
57
+ export declare const getIsSubjectRequire: (state: any) => boolean;
56
58
  /**
57
59
  * @title: 格式化商品数据
58
60
  * @description:
@@ -193,7 +193,7 @@ var currentResource = function currentResource(state, useResource, cacheItem) {
193
193
  };
194
194
 
195
195
  // 更新holder
196
- var handleChangeHolder = function handleChangeHolder(products, currentItem, other) {
196
+ export var handleChangeHolder = function handleChangeHolder(products, currentItem, other) {
197
197
  return products.map(function (item) {
198
198
  if (item._id === currentItem._id) {
199
199
  return _objectSpread(_objectSpread({}, item), {}, {
@@ -350,7 +350,8 @@ export var updateServices = function updateServices(state, currentItem, type, ot
350
350
  products = handleChangeHolder(products, currentItem, other);
351
351
  }
352
352
  if (type === 'add_holder') {
353
- actions === null || actions === void 0 || actions.handleAddHolder();
353
+ var _actions$handleAddHol;
354
+ actions === null || actions === void 0 || (_actions$handleAddHol = actions.handleAddHolder) === null || _actions$handleAddHol === void 0 || _actions$handleAddHol.call(actions, products, currentItem);
354
355
  return products;
355
356
  }
356
357
  if (type === 'like') {
@@ -514,13 +515,20 @@ var mapListItems = function mapListItems(items) {
514
515
  };
515
516
  });
516
517
  };
518
+
519
+ // 获取主体表单是否必填
520
+ export var getIsSubjectRequire = function getIsSubjectRequire(state) {
521
+ var _state$bookingConfig2, _state$bookingConfig3;
522
+ return (state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.appointment_subject) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.type) === 'form' && (state === null || state === void 0 || (_state$bookingConfig3 = state.bookingConfig) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.config) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.basic) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.subject_require) === 'require';
523
+ };
517
524
  var getGeneralParams = function getGeneralParams(item, state, isParallelResource) {
518
- var _item$_extend5, _item$_extend6, _item$_extend7, _item$_extend8;
525
+ var _formData$, _item$_extend5, _item$_extend6, _item$_extend7, _item$_extend8;
519
526
  var pet = state.pet,
520
527
  service = state.service;
521
528
  var _ref8 = pet || {},
522
529
  _ref8$holders = _ref8.holders,
523
- holders = _ref8$holders === void 0 ? [] : _ref8$holders;
530
+ holders = _ref8$holders === void 0 ? [] : _ref8$holders,
531
+ formData = _ref8.formData;
524
532
  var parallelResourceOtherParams = {};
525
533
  var multiResources;
526
534
  if (isParallelResource) {
@@ -582,6 +590,8 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
582
590
  actionText: locales.getText('page.booking.text.add-time'),
583
591
  isMultipleResource: true,
584
592
  multiResources: multiResources,
593
+ isErrorHolder: getIsSubjectRequire(state),
594
+ addHolderButtonText: (formData === null || formData === void 0 || (_formData$ = formData[0]) === null || _formData$ === void 0 || (_formData$ = _formData$.form) === null || _formData$ === void 0 ? void 0 : _formData$.title) || "",
585
595
  holder_id: item === null || item === void 0 || (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.holder_id,
586
596
  start_date: item === null || item === void 0 || (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.startDate,
587
597
  end_date: (item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.endDate) || (item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.end_date)
@@ -808,8 +818,8 @@ export var initDate = function initDate() {
808
818
  * @Date: 2024-12-12 15:47
809
819
  */
810
820
  export var isHasDayAppointmentProduct = function isHasDayAppointmentProduct(state) {
811
- var _state$bookingConfig2, _state$service3, _state$pet2;
812
- var form_id = (state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.appointment_subject) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.form_id) || 0;
821
+ var _state$bookingConfig4, _state$service3, _state$pet2;
822
+ var form_id = (state === null || state === void 0 || (_state$bookingConfig4 = state.bookingConfig) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.config) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.basic) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.appointment_subject) === null || _state$bookingConfig4 === void 0 ? void 0 : _state$bookingConfig4.form_id) || 0;
813
823
  var services = ((_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.value) || [];
814
824
  var pets = ((_state$pet2 = state.pet) === null || _state$pet2 === void 0 || (_state$pet2 = _state$pet2.value) === null || _state$pet2 === void 0 ? void 0 : _state$pet2[form_id]) || [];
815
825
 
@@ -880,8 +890,8 @@ export var getDayProducts = function getDayProducts(holderId, lists, isTerminal)
880
890
  * @Date: 2024-12-30 22:19
881
891
  */
882
892
  export var getPets = function getPets(state) {
883
- var _state$bookingConfig3, _state$pet3;
884
- var form_id = (state === null || state === void 0 || (_state$bookingConfig3 = state.bookingConfig) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.config) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.basic) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.appointment_subject) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.form_id) || 0;
893
+ var _state$bookingConfig5, _state$pet3;
894
+ var form_id = (state === null || state === void 0 || (_state$bookingConfig5 = state.bookingConfig) === null || _state$bookingConfig5 === void 0 || (_state$bookingConfig5 = _state$bookingConfig5.config) === null || _state$bookingConfig5 === void 0 || (_state$bookingConfig5 = _state$bookingConfig5.basic) === null || _state$bookingConfig5 === void 0 || (_state$bookingConfig5 = _state$bookingConfig5.appointment_subject) === null || _state$bookingConfig5 === void 0 ? void 0 : _state$bookingConfig5.form_id) || 0;
885
895
  var pets = (state === null || state === void 0 || (_state$pet3 = state.pet) === null || _state$pet3 === void 0 || (_state$pet3 = _state$pet3.value) === null || _state$pet3 === void 0 ? void 0 : _state$pet3[form_id]) || [];
886
896
  return pets;
887
897
  };
@@ -913,8 +923,8 @@ export var getAppointmentService = function getAppointmentService(state) {
913
923
  * @Date: 2024-12-16 16:12
914
924
  */
915
925
  export var isOpenDeletePet = function isOpenDeletePet(state, newVal) {
916
- var _state$bookingConfig4, _state$pet4;
917
- var form_id = (state === null || state === void 0 || (_state$bookingConfig4 = state.bookingConfig) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.config) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.basic) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.appointment_subject) === null || _state$bookingConfig4 === void 0 ? void 0 : _state$bookingConfig4.form_id) || 0;
926
+ var _state$bookingConfig6, _state$pet4;
927
+ var form_id = (state === null || state === void 0 || (_state$bookingConfig6 = state.bookingConfig) === null || _state$bookingConfig6 === void 0 || (_state$bookingConfig6 = _state$bookingConfig6.config) === null || _state$bookingConfig6 === void 0 || (_state$bookingConfig6 = _state$bookingConfig6.basic) === null || _state$bookingConfig6 === void 0 || (_state$bookingConfig6 = _state$bookingConfig6.appointment_subject) === null || _state$bookingConfig6 === void 0 ? void 0 : _state$bookingConfig6.form_id) || 0;
918
928
  var oldPets = (state === null || state === void 0 || (_state$pet4 = state.pet) === null || _state$pet4 === void 0 || (_state$pet4 = _state$pet4.value) === null || _state$pet4 === void 0 ? void 0 : _state$pet4[form_id]) || [];
919
929
  var newPets = (newVal === null || newVal === void 0 ? void 0 : newVal[form_id]) || [];
920
930
 
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, errorMessage, handleDeleteService, }: any) => JSX.Element;
3
4
  export default ServiceItem;
@@ -22,6 +22,7 @@ export declare const getErrorList: (resource: any, cacheItem: any) => {
22
22
  * @Date: 2024-01-09 13:40
23
23
  */
24
24
  export declare const formatResource: (resourceItem: any, cacheItem?: any, formatLabel?: any) => any;
25
+ export declare const getAppointmentTimingPreference: (state: any) => any;
25
26
  /**
26
27
  * @title: 创建服务的开始时间和结束时间
27
28
  * @description:
@@ -285,6 +285,12 @@ export var formatResource = function formatResource(resourceItem, cacheItem, for
285
285
  return _resourceItem;
286
286
  };
287
287
 
288
+ // 获取预约时间偏好设置
289
+ export var getAppointmentTimingPreference = function getAppointmentTimingPreference(state) {
290
+ var _state$bookingConfig;
291
+ return (state === null || state === void 0 || (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.config) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.information_tab) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.appointment_timing_preference) || "sequential";
292
+ };
293
+
288
294
  /**
289
295
  * @title: 创建服务的开始时间和结束时间
290
296
  * @description:
@@ -296,6 +302,8 @@ export var formatResource = function formatResource(resourceItem, cacheItem, for
296
302
  */
297
303
  export var getServiceStartTimeAndEndTime = function getServiceStartTimeAndEndTime(state, cacheItem, timeObj) {
298
304
  var _cacheItem$duration, _cacheItem$_extend;
305
+ var appointmentTimingPreference = getAppointmentTimingPreference(state);
306
+
299
307
  // 获取上一个服务商品
300
308
  var lastServer = getLastServer(state.service.value);
301
309
 
@@ -313,7 +321,7 @@ export var getServiceStartTimeAndEndTime = function getServiceStartTimeAndEndTim
313
321
  if (dayjs(lastServerEndDate).isAfter(lastServerStartDate, "day")) {
314
322
  _extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
315
323
  } else {
316
- _extend.start_time = lastServerEndDate.format("HH:mm");
324
+ _extend.start_time = appointmentTimingPreference === 'sequential' ? lastServerEndDate.format("HH:mm") : lastServerStartDate.format('HH:mm');
317
325
  }
318
326
  } else {
319
327
  // 没有上一个商品 资源为 0
@@ -22,6 +22,8 @@ declare const _default: {
22
22
  'pisell2.text.leave-empty-for-walk-in': string;
23
23
  'pisell2.text.select-customer': string;
24
24
  'pisell2.text.create-new-customer': string;
25
+ 'pisell2.text.filled': string;
26
+ 'pisell2.text.not-filled': string;
25
27
  'pisell2.text.create-new': string;
26
28
  'pisell2.text.add-a-service': string;
27
29
  'pisell2.text.add-another-service': string;
@@ -259,6 +261,11 @@ declare const _default: {
259
261
  'pisell2.text.goodpass.code': string;
260
262
  'pisell2.text.goodpass.enter-code': string;
261
263
  'pisell2.text.goodpass.code-invalid': string;
264
+ 'pisell2.text.status.valid': string;
265
+ 'pisell2.text.status.expired': string;
266
+ 'pisell2.text.validity.expired': (str: string) => string;
267
+ 'pisell2.text.validity.expiring_soon': (str: string) => string;
268
+ 'pisell2.text.validity.valid_through': (str: string) => string;
262
269
  };
263
270
  'zh-CN': {
264
271
  'pisell2.text.refunded-amount': string;
@@ -288,6 +295,8 @@ declare const _default: {
288
295
  'pisell2.text.leave-empty-for-walk-in': string;
289
296
  'pisell2.text.select-customer': string;
290
297
  'pisell2.text.create-new-customer': string;
298
+ 'pisell2.text.filled': string;
299
+ 'pisell2.text.not-filled': string;
291
300
  'pisell2.text.create-new': string;
292
301
  'pisell2.text.add-a-service': string;
293
302
  'pisell2.text.add-another-service': string;
@@ -520,6 +529,11 @@ declare const _default: {
520
529
  'pisell2.text.goodpass.code': string;
521
530
  'pisell2.text.goodpass.enter-code': string;
522
531
  'pisell2.text.goodpass.code-invalid': string;
532
+ 'pisell2.text.status.valid': string;
533
+ 'pisell2.text.status.expired': string;
534
+ 'pisell2.text.validity.expired': (str: string) => string;
535
+ 'pisell2.text.validity.expiring_soon': (str: string) => string;
536
+ 'pisell2.text.validity.valid_through': (str: string) => string;
523
537
  };
524
538
  'zh-HK': {
525
539
  'pisell2.text.refunded-amount': string;
@@ -549,6 +563,8 @@ declare const _default: {
549
563
  'pisell2.text.leave-empty-for-walk-in': string;
550
564
  'pisell2.text.select-customer': string;
551
565
  'pisell2.text.create-new-customer': string;
566
+ 'pisell2.text.filled': string;
567
+ 'pisell2.text.not-filled': string;
552
568
  'pisell2.text.create-new': string;
553
569
  'pisell2.text.add-a-service': string;
554
570
  'pisell2.text.add-another-service': string;
@@ -781,6 +797,11 @@ declare const _default: {
781
797
  'pisell2.text.goodpass.code': string;
782
798
  'pisell2.text.goodpass.enter-code': string;
783
799
  'pisell2.text.goodpass.code-invalid': string;
800
+ 'pisell2.text.status.valid': string;
801
+ 'pisell2.text.status.expired': string;
802
+ 'pisell2.text.validity.expired': (str: string) => string;
803
+ 'pisell2.text.validity.expiring_soon': (str: string) => string;
804
+ 'pisell2.text.validity.valid_through': (str: string) => string;
784
805
  };
785
806
  };
786
807
  export default _default;
@@ -23,6 +23,8 @@ export default {
23
23
  'pisell2.text.leave-empty-for-walk-in': 'Leave empty for walk-in',
24
24
  'pisell2.text.select-customer': 'Select customer',
25
25
  'pisell2.text.create-new-customer': 'Create new customer',
26
+ 'pisell2.text.filled': 'Filled',
27
+ 'pisell2.text.not-filled': 'Not filled',
26
28
  'pisell2.text.create-new': 'Create new',
27
29
  'pisell2.text.add-a-service': 'Add a service',
28
30
  'pisell2.text.add-another-service': 'Add another service',
@@ -295,7 +297,18 @@ export default {
295
297
  'pisell2.text.goodpass.view-more': "View More",
296
298
  'pisell2.text.goodpass.code': "Code",
297
299
  'pisell2.text.goodpass.enter-code': "Enter Code",
298
- 'pisell2.text.goodpass.code-invalid': "Current code is invalid"
300
+ 'pisell2.text.goodpass.code-invalid': "Current code is invalid",
301
+ 'pisell2.text.status.valid': 'Valid',
302
+ 'pisell2.text.status.expired': 'Expired',
303
+ 'pisell2.text.validity.expired': function pisell2TextValidityExpired(str) {
304
+ return "Expired on ".concat(str);
305
+ },
306
+ 'pisell2.text.validity.expiring_soon': function pisell2TextValidityExpiring_soon(str) {
307
+ return "Expiring soon: valid through ".concat(str);
308
+ },
309
+ 'pisell2.text.validity.valid_through': function pisell2TextValidityValid_through(str) {
310
+ return "Valid through ".concat(str);
311
+ }
299
312
  },
300
313
  'zh-CN': {
301
314
  'pisell2.text.refunded-amount': '已退金额',
@@ -325,6 +338,8 @@ export default {
325
338
  'pisell2.text.leave-empty-for-walk-in': '未选择表示 Walk-In',
326
339
  'pisell2.text.select-customer': '选择客户',
327
340
  'pisell2.text.create-new-customer': '创建新客户',
341
+ 'pisell2.text.filled': '已填写',
342
+ 'pisell2.text.not-filled': '未填写',
328
343
  'pisell2.text.create-new': '创建新的',
329
344
  'pisell2.text.add-a-service': '添加服务',
330
345
  'pisell2.text.add-another-service': '添加其他服务',
@@ -597,7 +612,18 @@ export default {
597
612
  'pisell2.text.goodpass.view-more': "查看更多",
598
613
  'pisell2.text.goodpass.code': "券码",
599
614
  'pisell2.text.goodpass.enter-code': "请输入券码",
600
- 'pisell2.text.goodpass.code-invalid': "当前券码不可用"
615
+ 'pisell2.text.goodpass.code-invalid': "当前券码不可用",
616
+ 'pisell2.text.status.valid': '有效',
617
+ 'pisell2.text.status.expired': '已过期',
618
+ 'pisell2.text.validity.expired': function pisell2TextValidityExpired(str) {
619
+ return "\u5DF2\u4E8E ".concat(str, " \u8FC7\u671F");
620
+ },
621
+ 'pisell2.text.validity.expiring_soon': function pisell2TextValidityExpiring_soon(str) {
622
+ return "\u5373\u5C06\u8FC7\u671F\uFF1A\u6709\u6548\u671F\u81F3 ".concat(str, " \uFF08\u542B\u5F53\u65E5\uFF09");
623
+ },
624
+ 'pisell2.text.validity.valid_through': function pisell2TextValidityValid_through(str) {
625
+ return "\u6709\u6548\u671F\u81F3 ".concat(str, " \uFF08\u542B\u5F53\u65E5\uFF09");
626
+ }
601
627
  },
602
628
  'zh-HK': {
603
629
  'pisell2.text.refunded-amount': '已退金額',
@@ -627,6 +653,8 @@ export default {
627
653
  'pisell2.text.leave-empty-for-walk-in': '未選擇表示 Walk-In',
628
654
  'pisell2.text.select-customer': '選擇客戶',
629
655
  'pisell2.text.create-new-customer': '創建新客戶',
656
+ 'pisell2.text.filled': '已填寫',
657
+ 'pisell2.text.not-filled': '未填寫',
630
658
  'pisell2.text.create-new': '創建新的',
631
659
  'pisell2.text.add-a-service': '添加服務',
632
660
  'pisell2.text.add-another-service': '添加其他服務',
@@ -899,6 +927,17 @@ export default {
899
927
  'pisell2.text.goodpass.view-more': "查看更多",
900
928
  'pisell2.text.goodpass.code': "券碼",
901
929
  'pisell2.text.goodpass.enter-code': "請輸入券碼",
902
- 'pisell2.text.goodpass.code-invalid': "當前券碼不可用"
930
+ 'pisell2.text.goodpass.code-invalid': "當前券碼不可用",
931
+ 'pisell2.text.status.valid': '有效',
932
+ 'pisell2.text.status.expired': '已過期',
933
+ 'pisell2.text.validity.expired': function pisell2TextValidityExpired(str) {
934
+ return "\u5DF2\u65BC ".concat(str, " \u904E\u671F");
935
+ },
936
+ 'pisell2.text.validity.expiring_soon': function pisell2TextValidityExpiring_soon(str) {
937
+ return "\u5373\u5C07\u904E\u671F\uFF1A\u6709\u6548\u671F\u81F3 ".concat(str, " \uFF08\u542B\u7576\u65E5\uFF09");
938
+ },
939
+ 'pisell2.text.validity.valid_through': function pisell2TextValidityValid_through(str) {
940
+ return "\u6709\u6548\u671F\u81F3 ".concat(str, " \uFF08\u542B\u7576\u65E5\uFF09");
941
+ }
903
942
  }
904
943
  };
@@ -17,6 +17,7 @@ import dayjs from 'dayjs';
17
17
  import { locales } from '@pisell/utils';
18
18
  import { isDayBooking, formatDayDate } from "./info/service2/utils";
19
19
  import { intersectionBy } from 'lodash';
20
+ import { getAppointmentTimingPreference } from "./info2/utilsByBooking";
20
21
  var Request = /*#__PURE__*/function () {
21
22
  function Request() {
22
23
  _classCallCheck(this, Request);
@@ -633,6 +634,7 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
633
634
  if (!cacheItem.new && cacheItem._extend.endDate) {
634
635
  return cacheItem._extend;
635
636
  }
637
+ var appointmentTimingPreference = getAppointmentTimingPreference(state);
636
638
  var isSession = isSessionProduct(cacheItem);
637
639
  var isDay = isDayBooking(state);
638
640
  var setDuration = function setDuration() {
@@ -664,7 +666,7 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
664
666
  if (dayjs(lastServerEndDate).isAfter(lastServerStartDate, 'day')) {
665
667
  _extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
666
668
  } else {
667
- _extend.start_time = lastServerEndDate.format('HH:mm');
669
+ _extend.start_time = appointmentTimingPreference === 'sequential' ? lastServerEndDate.format("HH:mm") : lastServerStartDate.format('HH:mm');
668
670
  }
669
671
  } else {
670
672
  // 没有上一个商品 资源为 0
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -15,7 +15,7 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;