@pisell/private-materials 6.2.16 → 6.2.18

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 (167) 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.js +2 -2
  8. package/build/lowcode/view.js +8 -8
  9. package/es/components/Sales/Checkout/utils.d.ts +40 -0
  10. package/es/components/appointmentBooking/components/Cart/utils.d.ts +56 -0
  11. package/es/components/appointmentBooking/components/Content/index.d.ts +3 -0
  12. package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
  13. package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  14. package/es/components/appointmentBooking/hooks.d.ts +106 -0
  15. package/es/components/appointmentBooking/index.d.ts +3 -0
  16. package/es/components/booking/addons/model.d.ts +10 -1
  17. package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
  18. package/es/components/booking/components/browserSelect/index.js +1 -1
  19. package/es/components/booking/components/reloadResourceModal/index.d.ts +8 -0
  20. package/es/components/booking/components/voucher/index.d.ts +3 -0
  21. package/es/components/booking/editBookingModal/index.js +58 -29
  22. package/es/components/booking/editBookingModal/serve.d.ts +1 -0
  23. package/es/components/booking/editBookingModal/serve.js +19 -11
  24. package/es/components/booking/forms/model.d.ts +10 -1
  25. package/es/components/booking/forms/model.js +5 -5
  26. package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  27. package/es/components/booking/info/addServiceVariant/index.d.ts +6 -0
  28. package/es/components/booking/info/index.d.ts +3 -0
  29. package/es/components/booking/info/model.d.ts +10 -1
  30. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  31. package/es/components/booking/info/service/like/index.js +1 -1
  32. package/es/components/booking/info/utils.d.ts +50 -0
  33. package/es/components/booking/info2/index.d.ts +12 -0
  34. package/es/components/booking/info2/service/addService/index.d.ts +11 -0
  35. package/es/components/booking/info2/service/addService/utils.d.ts +98 -0
  36. package/es/components/booking/info2/service/addService/utils.js +1 -1
  37. package/es/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
  38. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +1 -1
  39. package/es/components/booking/locales.d.ts +828 -0
  40. package/es/components/booking/materiels/startTime/index.js +1 -1
  41. package/es/components/booking/model.d.ts +116 -0
  42. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  43. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  44. package/es/components/booking/notes/model.d.ts +10 -1
  45. package/es/components/booking/notes/model.js +5 -5
  46. package/es/components/booking/payments/model.d.ts +10 -1
  47. package/es/components/booking/payments/model.js +5 -5
  48. package/es/components/eftposPay/const.d.ts +184 -0
  49. package/es/components/eftposPay/hooks.d.ts +35 -0
  50. package/es/components/eftposPay/index.d.ts +4 -0
  51. package/es/components/eftposPay/linkly/const.d.ts +23 -0
  52. package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  53. package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  54. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  55. package/es/components/eftposPay/linkly/index.d.ts +2 -0
  56. package/es/components/eftposPay/linkly/service.d.ts +32 -0
  57. package/es/components/eftposPay/manufacturer.d.ts +7 -0
  58. package/es/components/eftposPay/pay.d.ts +20 -0
  59. package/es/components/eftposPay/store/index.d.ts +355 -0
  60. package/es/components/listComponent/index.js +5 -5
  61. package/es/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  62. package/es/components/pay/toC/model.d.ts +9 -1
  63. package/es/components/productExtension/card/index.js +3 -3
  64. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  65. package/es/components/productExtension/fields/Forms/index.js +12 -12
  66. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  67. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  68. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  69. package/es/components/productExtension/server.js +2 -2
  70. package/es/components/productSelect/components/TabProduct/index.d.ts +2 -0
  71. package/es/components/productSelect/index.d.ts +26 -0
  72. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  73. package/es/components/schedules/calendar/index.js +4 -4
  74. package/es/components/schedules/calendar/serve.js +2 -2
  75. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  76. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  77. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  78. package/es/components/schedules/components/ResourceList/index.js +1 -1
  79. package/es/components/schedules/components/Search/index.js +5 -5
  80. package/es/components/schedules/model.d.ts +9 -1
  81. package/es/components/schedules/model.js +5 -5
  82. package/es/components/schedules/openHours/index.js +1 -1
  83. package/es/components/schedules/openHours/serve.js +2 -2
  84. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  85. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  86. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  87. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  88. package/es/components/schedules/products/serve.js +2 -2
  89. package/es/components/schedules/products/utils.js +5 -5
  90. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  91. package/es/components/schedules/resources/detail/index.js +10 -10
  92. package/es/components/schedules/resources/list/index.js +2 -2
  93. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  94. package/es/components/schedules/resources/serve.js +2 -2
  95. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  96. package/es/components/schedules/utils.js +4 -4
  97. package/es/components/selectModal/index.js +2 -2
  98. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  99. package/es/components/ticketBooking/index.d.ts +7 -0
  100. package/es/components/wallet/Detail/model.d.ts +13 -1
  101. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  102. package/es/components/wallet/PointCard/model.d.ts +13 -1
  103. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  104. package/es/components/wallet/Voucher/model.d.ts +13 -1
  105. package/es/components/wallet/model.d.ts +9 -1
  106. package/es/components/walletList/index.d.ts +28 -0
  107. package/es/hooks/useComponents.js +1 -1
  108. package/es/utils/index.d.ts +23 -0
  109. package/lib/components/Sales/Checkout/utils.d.ts +40 -0
  110. package/lib/components/appointmentBooking/components/Cart/utils.d.ts +56 -0
  111. package/lib/components/appointmentBooking/components/Content/index.d.ts +3 -0
  112. package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
  113. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
  114. package/lib/components/appointmentBooking/hooks.d.ts +106 -0
  115. package/lib/components/appointmentBooking/index.d.ts +3 -0
  116. package/lib/components/booking/addons/model.d.ts +10 -1
  117. package/lib/components/booking/components/reloadResourceModal/index.d.ts +8 -0
  118. package/lib/components/booking/components/voucher/index.d.ts +3 -0
  119. package/lib/components/booking/editBookingModal/index.js +56 -21
  120. package/lib/components/booking/editBookingModal/serve.d.ts +1 -0
  121. package/lib/components/booking/editBookingModal/serve.js +12 -6
  122. package/lib/components/booking/forms/model.d.ts +10 -1
  123. package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  124. package/lib/components/booking/info/addServiceVariant/index.d.ts +6 -0
  125. package/lib/components/booking/info/index.d.ts +3 -0
  126. package/lib/components/booking/info/model.d.ts +10 -1
  127. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  128. package/lib/components/booking/info/utils.d.ts +50 -0
  129. package/lib/components/booking/info2/index.d.ts +12 -0
  130. package/lib/components/booking/info2/service/addService/index.d.ts +11 -0
  131. package/lib/components/booking/info2/service/addService/utils.d.ts +98 -0
  132. package/lib/components/booking/info2/service/addService/utils.js +1 -1
  133. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
  134. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +1 -1
  135. package/lib/components/booking/locales.d.ts +828 -0
  136. package/lib/components/booking/model.d.ts +116 -0
  137. package/lib/components/booking/notes/model.d.ts +10 -1
  138. package/lib/components/booking/payments/model.d.ts +10 -1
  139. package/lib/components/eftposPay/const.d.ts +184 -0
  140. package/lib/components/eftposPay/hooks.d.ts +35 -0
  141. package/lib/components/eftposPay/index.d.ts +4 -0
  142. package/lib/components/eftposPay/linkly/const.d.ts +23 -0
  143. package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  144. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  145. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  146. package/lib/components/eftposPay/linkly/index.d.ts +2 -0
  147. package/lib/components/eftposPay/linkly/service.d.ts +32 -0
  148. package/lib/components/eftposPay/manufacturer.d.ts +7 -0
  149. package/lib/components/eftposPay/pay.d.ts +20 -0
  150. package/lib/components/eftposPay/store/index.d.ts +355 -0
  151. package/lib/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  152. package/lib/components/pay/toC/model.d.ts +9 -1
  153. package/lib/components/productSelect/components/TabProduct/index.d.ts +2 -0
  154. package/lib/components/productSelect/index.d.ts +26 -0
  155. package/lib/components/schedules/model.d.ts +9 -1
  156. package/lib/components/schedules/utils.js +1 -1
  157. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  158. package/lib/components/ticketBooking/index.d.ts +7 -0
  159. package/lib/components/wallet/Detail/model.d.ts +13 -1
  160. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  161. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  162. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  163. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  164. package/lib/components/wallet/model.d.ts +9 -1
  165. package/lib/components/walletList/index.d.ts +28 -0
  166. package/lib/utils/index.d.ts +23 -0
  167. package/package.json +4 -4
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @title: 套餐单规格信息
3
+ * @description:
4
+ * @param {any} option
5
+ * @return {*}
6
+ * @Author: zhiwei.Wang
7
+ * @Date: 2024-02-19 09:26
8
+ */
9
+ export declare const formatProductOption: (option: any) => any;
10
+ /**
11
+ * @title: 套餐信息
12
+ * @description:
13
+ * @param {any} bundle
14
+ * @return {*}
15
+ * @Author: zhiwei.Wang
16
+ * @Date: 2024-02-19 09:26
17
+ */
18
+ export declare const formatProductBundle: (bundle: any) => any;
19
+ /**
20
+ * @title: 格式化下单接口数据
21
+ * @description:
22
+ * @param {any} state saledModel数据源
23
+ * @param {boolean} excludeDisabled 是否需要排除购物车中失效商品
24
+ * @Author: xiangfeng.xue
25
+ * @Date: 2025-01-21 17:57
26
+ */
27
+ export declare const formatValues: (params: {
28
+ state: any;
29
+ platform: 'h5' | 'pc';
30
+ excludeDisabled?: boolean;
31
+ extra?: Record<string, any>;
32
+ }) => any;
33
+ /**
34
+ * @title: 获取拉开表单弹窗参数
35
+ * @param state
36
+ */
37
+ export declare const getFormParams: (state: any) => {
38
+ product_id: any;
39
+ appointment_type: string;
40
+ };
@@ -0,0 +1,56 @@
1
+ interface CheckLoginParams {
2
+ isLogin: boolean;
3
+ openLoginModal: (params: {
4
+ callback: (status: string) => void;
5
+ }) => void;
6
+ isFormSubject: boolean;
7
+ utils: any;
8
+ accountLists: any[];
9
+ appointmentBooking: any;
10
+ getHolders: () => void;
11
+ }
12
+ export declare const checkLogin: ({ isLogin, openLoginModal, isFormSubject, utils, accountLists, appointmentBooking, getHolders, }: CheckLoginParams) => Promise<boolean>;
13
+ interface CheckHolderParams {
14
+ isFormSubject: boolean;
15
+ checkAccount: (type: string) => boolean;
16
+ carts: any[];
17
+ }
18
+ export declare const checkHolder: ({ isFormSubject, checkAccount, carts }: CheckHolderParams) => false | any[];
19
+ interface CheckResourceParams {
20
+ carts: any[];
21
+ resources: any[];
22
+ }
23
+ /**
24
+ * @title: 检测资源数据
25
+ * @description:
26
+ * @param {CheckResourceParams} param1
27
+ * @return {*}
28
+ * @Author: WangHan
29
+ * @Date: 2025-04-29 18:02
30
+ */
31
+ export declare const checkResource: ({ carts, resources }: CheckResourceParams) => false | any[];
32
+ interface CheckResourceParams {
33
+ carts: any[];
34
+ }
35
+ export declare type StepKey = 'select-resource' | 'fill-form' | 'select-time' | 'confirm-information' | 'select-service' | 'select-date' | 'select-guest';
36
+ interface AddHolderParams {
37
+ res: any;
38
+ bookingSubject: any;
39
+ accountLists: any[];
40
+ cartItem: any;
41
+ getHolders: () => void;
42
+ appointmentBooking: any;
43
+ }
44
+ /**
45
+ * @title: 添加holder
46
+ * @description:
47
+ * @param {any} res
48
+ * @param {any} bookingSubject
49
+ * @param {any} accountLists
50
+ * @param {any} e
51
+ * @return {*}
52
+ * @Author: WangHan
53
+ * @Date: 2025-05-10 18:25
54
+ */
55
+ export declare const handleAddHolder: ({ res, bookingSubject, accountLists, cartItem, getHolders, appointmentBooking }: AddHolderParams) => Promise<any>;
56
+ export {};
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Layout: () => JSX.Element;
3
+ export default Layout;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const Services: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
4
+ export default Services;
@@ -0,0 +1,4 @@
1
+ import '../../../booking/components/voucher/index.less';
2
+ import './index.less';
3
+ declare const VoucherCard: (props: any) => JSX.Element;
4
+ export default VoucherCard;
@@ -0,0 +1,106 @@
1
+ export declare const useAppointmentBooking: () => any;
2
+ export declare const useShopDiscount: () => any;
3
+ export declare const contextUtils: () => any;
4
+ /**
5
+ * @title: 监听步骤发生变化
6
+ * @description:
7
+ * @return {*}
8
+ * @Author: WangHan
9
+ * @Date: 2025-04-15 11:11
10
+ */
11
+ export declare const useAppointmentBookingStep: () => {
12
+ getStepIndex: (type: string, skipNumber?: number) => any;
13
+ stepList: any;
14
+ removeStep: (key: string) => any;
15
+ addStep: (props: any, stepKey?: string) => any;
16
+ updateStep: (key: string, step: any) => void;
17
+ nextStep: () => any;
18
+ };
19
+ /**
20
+ * @title: 获取商品数据
21
+ * @description:
22
+ * @return {*}
23
+ * @Author: WangHan
24
+ * @Date: 2025-04-15 11:12
25
+ */
26
+ export declare const useAppointmentBookingProduct: () => {
27
+ checkProductType: (productId: number) => Promise<any>;
28
+ getProducts: () => Promise<any>;
29
+ };
30
+ /**
31
+ * @title: 更新购物车数据
32
+ * @description:
33
+ * @return {*}
34
+ * @Author: WangHan
35
+ * @Date: 2025-04-15 11:12
36
+ */
37
+ export declare const useAppointmentBookingCart: () => void;
38
+ /**
39
+ * @title: 获取登录状态
40
+ * @description:
41
+ * @return {*}
42
+ * @Author: WangHan
43
+ * @Date: 2025-04-15 11:14
44
+ */
45
+ export declare const useAppointmentBookingLogin: () => {
46
+ isLogin: boolean;
47
+ openLoginModal: (params: {
48
+ callback: any;
49
+ }) => void;
50
+ };
51
+ /**
52
+ * @title: 获取账户
53
+ * @description:
54
+ * @return {*}
55
+ * @Author: WangHan
56
+ * @Date: 2025-04-15 11:15
57
+ */
58
+ export declare const useAppointmentBookingAccount: () => {
59
+ accountLists: any;
60
+ getHolders: () => Promise<any>;
61
+ form_id: any;
62
+ addAccount: (val: any, type?: string) => Promise<any>;
63
+ checkAccount: (type: any) => any;
64
+ };
65
+ /**
66
+ * @title: 获取资源数据
67
+ * @description:
68
+ * @return {*}
69
+ * @Author: WangHan
70
+ * @Date: 2025-04-15 11:29
71
+ */
72
+ export declare const useAppointmentBookingResource: () => {
73
+ getResourceTimeSlot: (index?: number) => Promise<void>;
74
+ getResourceList: () => {
75
+ resources: any;
76
+ resourceCodes: any;
77
+ };
78
+ };
79
+ /**
80
+ * @title: 是否跳过资源选择步骤
81
+ * @description:
82
+ * @return {*}
83
+ * @Author: WangHan
84
+ * @Date: 2025-04-21 11:47
85
+ */
86
+ export declare const useIsSkipResourceStep: () => {
87
+ checkSkipResourceStep: () => Promise<boolean>;
88
+ };
89
+ /**
90
+ * @title: 获取预约配置
91
+ * @description:
92
+ * @return {*}
93
+ * @Author: WangHan
94
+ * @Date: 2025-04-24 18:15
95
+ */
96
+ export declare const useAppointmentBookingSetting: () => {
97
+ isDateSelectedFirst: boolean;
98
+ isFormSubject: boolean;
99
+ isRetailTemplate: any;
100
+ customPageId: any;
101
+ channel: any;
102
+ bookingSubject: any;
103
+ setOtherData: (key: string, val: any) => any;
104
+ getOtherData: (key: string) => any;
105
+ formName: any;
106
+ };
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const AppointmentBooking: () => JSX.Element;
3
+ export default AppointmentBooking;
@@ -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
+ }>;
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  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."); }
3
3
  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); }
4
4
  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; }
5
- 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; } }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useMemo, useState, useEffect, forwardRef, useImperativeHandle } from "react";
8
8
  import classNames from "classnames";
@@ -13,10 +13,6 @@ import "./index.less";
13
13
 
14
14
  // tabs 子组件定义
15
15
 
16
- // 定义主键类型
17
-
18
- // Tabs 可传递的参数
19
-
20
16
  var Tabs = function Tabs(_ref, ref) {
21
17
  var renderTab = _ref.renderTab,
22
18
  rowKey = _ref.rowKey,
@@ -29,7 +29,7 @@ var BrowserSelect = function BrowserSelect(props) {
29
29
  onChange: function onChange(e) {
30
30
  var _resetProps$onChange;
31
31
  e.persist();
32
- (_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0 || _resetProps$onChange.call(resetProps, e);
32
+ (_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0 ? void 0 : _resetProps$onChange.call(resetProps, e);
33
33
  }
34
34
  }), _options);
35
35
  };
@@ -0,0 +1,8 @@
1
+ import './index.less';
2
+ interface IProps {
3
+ modal: any;
4
+ onReload: () => Promise<any>;
5
+ onCancel: () => void;
6
+ }
7
+ declare const ReloadResourceModal: ({ modal, onReload, onCancel }: IProps) => JSX.Element;
8
+ export default ReloadResourceModal;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const VoucherCard: (props: any) => JSX.Element | null;
3
+ export default VoucherCard;
@@ -69,8 +69,8 @@ var EditBookingModal = function EditBookingModal(props, ref) {
69
69
  });
70
70
  var getInitData = /*#__PURE__*/function () {
71
71
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
72
- var _data$toResource;
73
- var mockProps, _data, _initResourceVal, toResourceFormId, _data$toResource2, _formatResources, list, maps, currentForm, relation_id, _currentForm$renderLi, _currentForm$renderLi2, _currentForm$renderLi3, _currentForm$renderLi4, _targetResource, _cloned, _idx;
72
+ var _data$fromResource, _data$toResource;
73
+ var mockProps, _data, _initResourceVal, fromResourceFormId, toResourceFormId, _form_id, _data$toResource2, _formatResources, list, maps, currentForm, relation_id, _currentForm$renderLi, _currentForm$renderLi2, _currentForm$renderLi3, _currentForm$renderLi4, _targetResource, _cloned, _idx, _sameResource;
74
74
  return _regeneratorRuntime().wrap(function _callee$(_context) {
75
75
  while (1) switch (_context.prev = _context.next) {
76
76
  case 0:
@@ -82,20 +82,25 @@ var EditBookingModal = function EditBookingModal(props, ref) {
82
82
  setData(_data);
83
83
 
84
84
  // 初始预期资源(日历放置点对应的资源)
85
- _initResourceVal = _data.childrenBooking._extend.resource; // 目标资源所在 form_id
86
- toResourceFormId = (_data$toResource = _data.toResource) === null || _data$toResource === void 0 ? void 0 : _data$toResource.form_id; // 1. 起止资源不同 且2. 能通过目标资源id找到所在资源组
85
+ _initResourceVal = _data.childrenBooking._extend.resource; // 源资源所在 from_id
86
+ fromResourceFormId = (_data$fromResource = _data.fromResource) === null || _data$fromResource === void 0 ? void 0 : _data$fromResource.form_id; // 目标资源所在 form_id
87
+ toResourceFormId = (_data$toResource = _data.toResource) === null || _data$toResource === void 0 ? void 0 : _data$toResource.form_id; // 若 1. 无资源移入具体资源
88
+ // 或 2. 具体资源移入无资源
89
+ // 则其中有一个 form_id 为 0,那么选择不为 0 的那个
90
+ _form_id = toResourceFormId || fromResourceFormId; // 若 1. 起止资源不同(必有一个不为 ‘no resource’)
91
+ // 且 2. 能通过目标资源id找到所在资源组
87
92
  // 则查找放置点所对应资源信息
88
- if (params.fromResourceId !== params.toResourceId && toResourceFormId) {
93
+ if (params.fromResourceId !== params.toResourceId && !!_form_id) {
89
94
  _formatResources = formatResources({
90
95
  cacheItem: _data.childrenBooking,
91
96
  resourcesOrigin: _data.resourcesOrigin
92
97
  }), list = _formatResources.list, maps = _formatResources.maps;
93
- currentForm = maps[toResourceFormId];
98
+ currentForm = maps[_form_id];
94
99
  relation_id = (_data$toResource2 = _data.toResource) === null || _data$toResource2 === void 0 ? void 0 : _data$toResource2.id;
95
- if (currentForm && relation_id) {
100
+ if (currentForm && (relation_id || relation_id === 0)) {
96
101
  _targetResource = {
97
102
  relation_type: ((_currentForm$renderLi = currentForm.renderListMaps[relation_id]) === null || _currentForm$renderLi === void 0 || (_currentForm$renderLi = _currentForm$renderLi.usable) === null || _currentForm$renderLi === void 0 ? void 0 : _currentForm$renderLi.relation_type) || 'form',
98
- form_id: toResourceFormId,
103
+ form_id: _form_id,
99
104
  relation_id: relation_id,
100
105
  like_status: 'common',
101
106
  children: (_currentForm$renderLi2 = currentForm.renderListMaps) === null || _currentForm$renderLi2 === void 0 || (_currentForm$renderLi2 = _currentForm$renderLi2[relation_id]) === null || _currentForm$renderLi2 === void 0 ? void 0 : _currentForm$renderLi2.children,
@@ -104,20 +109,31 @@ var EditBookingModal = function EditBookingModal(props, ref) {
104
109
  resource_name: (_currentForm$renderLi4 = currentForm.renderListMaps[relation_id]) === null || _currentForm$renderLi4 === void 0 ? void 0 : _currentForm$renderLi4.main_field
105
110
  })
106
111
  }; // 同一类型关联多个资源
107
- if (Array.isArray(_initResourceVal[toResourceFormId])) {
108
- _cloned = _toConsumableArray(_initResourceVal[toResourceFormId]);
112
+ if (Array.isArray(_initResourceVal[_form_id])) {
113
+ _cloned = _toConsumableArray(_initResourceVal[_form_id]);
109
114
  _idx = _cloned.findIndex(function (rs) {
110
- return rs.relation_id == params.fromResourceId;
115
+ var _rs$children;
116
+ return rs.relation_id == params.fromResourceId || ((_rs$children = rs.children) === null || _rs$children === void 0 ? void 0 : _rs$children.find(function (child) {
117
+ return child.relation_id == params.fromResourceId;
118
+ }));
111
119
  });
112
120
  if (_idx !== -1) {
113
- _cloned[_idx] = _targetResource; // 替换现有对象
121
+ // 去重: 同一资源类型下,设置了该类型的某个资源 A,以及无资源,当从无资源拖放至 A 上时需要去重
122
+ _sameResource = _cloned.find(function (_clonedItem) {
123
+ return _clonedItem.relation_id === (_targetResource === null || _targetResource === void 0 ? void 0 : _targetResource.relation_id);
124
+ });
125
+ if (_sameResource) {
126
+ _cloned.splice(_idx, 1);
127
+ } else {
128
+ _cloned[_idx] = _targetResource; // 替换现有对象
129
+ }
114
130
  } else {
115
131
  _cloned.push(_targetResource); // 添加新对象
116
132
  }
117
- _initResourceVal = _objectSpread(_objectSpread({}, _initResourceVal), {}, _defineProperty({}, toResourceFormId, _cloned));
133
+ _initResourceVal = _objectSpread(_objectSpread({}, _initResourceVal), {}, _defineProperty({}, _form_id, _cloned));
118
134
  } else {
119
135
  // 单选
120
- _initResourceVal = _objectSpread(_objectSpread({}, _initResourceVal), {}, _defineProperty({}, toResourceFormId, [_targetResource]));
136
+ _initResourceVal = _objectSpread(_objectSpread({}, _initResourceVal), {}, _defineProperty({}, _form_id, [_targetResource]));
121
137
  }
122
138
  }
123
139
  }
@@ -128,7 +144,7 @@ var EditBookingModal = function EditBookingModal(props, ref) {
128
144
  toDate: [dayjs(mockProps.toStartDate), dayjs(mockProps.toEndDate)]
129
145
  });
130
146
  }, 100);
131
- case 9:
147
+ case 11:
132
148
  case "end":
133
149
  return _context.stop();
134
150
  }
@@ -218,12 +234,11 @@ var EditBookingModal = function EditBookingModal(props, ref) {
218
234
  };
219
235
  var onOk = /*#__PURE__*/function () {
220
236
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
221
- var values, _data$childrenBooking, _extend, order_id, start_date, start_time, end_date, end_time;
237
+ var values, _data$childrenBooking, _extend, order_id, start_date, start_time, end_date, end_time, id, relation_id, like_status, relation_type, is_all, schedule_id, sub_type, select_date, number, metadata;
222
238
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
223
239
  while (1) switch (_context2.prev = _context2.next) {
224
240
  case 0:
225
- values = form.getFieldsValue(); // console.log('values', values, data, cacheItem);
226
- // return;
241
+ values = form.getFieldsValue();
227
242
  setUpdating(true);
228
243
  _context2.prev = 2;
229
244
  _data$childrenBooking = data.childrenBooking, _extend = _data$childrenBooking._extend, order_id = _data$childrenBooking.order_id;
@@ -231,8 +246,20 @@ var EditBookingModal = function EditBookingModal(props, ref) {
231
246
  start_time = values.toDate[0].format('HH:mm');
232
247
  end_date = values.toDate[1].format('YYYY-MM-DD');
233
248
  end_time = values.toDate[1].format('HH:mm');
234
- _context2.next = 10;
235
- return updateChildBooking(order_id, _objectSpread(_objectSpread({}, _extend), {}, {
249
+ console.log('extend data', _extend);
250
+ id = _extend.id, relation_id = _extend.relation_id, like_status = _extend.like_status, relation_type = _extend.relation_type, is_all = _extend.is_all, schedule_id = _extend.schedule_id, sub_type = _extend.sub_type, select_date = _extend.select_date, number = _extend.number, metadata = _extend.metadata;
251
+ _context2.next = 12;
252
+ return updateChildBooking(order_id, {
253
+ id: id,
254
+ relation_id: relation_id,
255
+ like_status: like_status,
256
+ relation_type: relation_type,
257
+ is_all: is_all,
258
+ schedule_id: schedule_id,
259
+ sub_type: sub_type,
260
+ select_date: select_date,
261
+ number: number,
262
+ metadata: metadata,
236
263
  resources: Object.values(values.resource).reduce(function (pre, cur) {
237
264
  var newList = checkResourcesFormat(cur, cacheItem);
238
265
  pre = pre.concat(newList);
@@ -243,23 +270,24 @@ var EditBookingModal = function EditBookingModal(props, ref) {
243
270
  end_date: end_date,
244
271
  end_time: end_time,
245
272
  duration: values.toDate[1].diff(values.toDate[0], 'minutes')
246
- }));
247
- case 10:
248
- setOpen(false);
273
+ });
274
+ case 12:
275
+ // 清空,防止下次打开时看到残留数据
276
+ initState();
249
277
  props === null || props === void 0 || props.onOk();
250
- _context2.next = 17;
278
+ _context2.next = 19;
251
279
  break;
252
- case 14:
253
- _context2.prev = 14;
280
+ case 16:
281
+ _context2.prev = 16;
254
282
  _context2.t0 = _context2["catch"](2);
255
283
  console.error(_context2.t0);
256
- case 17:
284
+ case 19:
257
285
  setUpdating(false);
258
- case 18:
286
+ case 20:
259
287
  case "end":
260
288
  return _context2.stop();
261
289
  }
262
- }, _callee2, null, [[2, 14]]);
290
+ }, _callee2, null, [[2, 16]]);
263
291
  }));
264
292
  return function onOk() {
265
293
  return _ref2.apply(this, arguments);
@@ -377,6 +405,7 @@ var EditBookingModal = function EditBookingModal(props, ref) {
377
405
  onClick: onOk,
378
406
  block: true,
379
407
  size: "large",
408
+ disabled: !data,
380
409
  loading: updating,
381
410
  style: {
382
411
  borderRadius: 20
@@ -46,6 +46,7 @@ export declare const init: (params: EditBookingModalParams) => Promise<{
46
46
  start_date: any;
47
47
  };
48
48
  resourcesOrigin: any[];
49
+ fromResource: any;
49
50
  toResource: any;
50
51
  }>;
51
52
  export declare const createCacheItem: (cacheItem: any, values?: any) => any;
@@ -197,7 +197,8 @@ export var updateResourceErrors = function updateResourceErrors(resourceMaps, ca
197
197
  };
198
198
  export var init = /*#__PURE__*/function () {
199
199
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(params) {
200
- var toStartDate, toEndDate, event, fromResourceId, toResourceId, bookingOrigin, booking, resources, childrenBooking, extraParams, fromResource, toResource, resourcesOrigin;
200
+ var _childrenBooking$_ext;
201
+ var toStartDate, toEndDate, event, fromResourceId, toResourceId, bookingOrigin, booking, resources, childrenBooking, fromResource, toResource, extraParams, _eventResources, resourcesOrigin;
201
202
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
202
203
  while (1) switch (_context7.prev = _context7.next) {
203
204
  case 0:
@@ -216,19 +217,24 @@ export var init = /*#__PURE__*/function () {
216
217
  // 筛选出当前的子预约
217
218
  childrenBooking = getChildrenBookingById(booking.service.value, event.id);
218
219
  console.log('childrenBooking', childrenBooking);
219
-
220
- // 假如移入未绑定的资源中,需要特殊处理
220
+ fromResource = resources.listMap[fromResourceId];
221
+ toResource = resources.listMap[toResourceId]; // 默认的资源渲染列表的获取,只会从 product_resource 获取后台配置的资源
222
+ // 对于没有配置但是有需要被展示的,则需要额外传入
221
223
  extraParams = {
222
224
  extraResources: []
223
- };
224
- fromResource = resources.listMap[fromResourceId];
225
- toResource = resources.listMap[toResourceId];
226
- if (fromResource) {
227
- extraParams.extraResources.push({
228
- form_id: fromResource.form_id,
229
- id: fromResource.id
225
+ }; // 1. 当某个预约同时设置了A B C 三个资源, 但预约商品本身并未关联B C
226
+ _eventResources = (_childrenBooking$_ext = childrenBooking._extend) === null || _childrenBooking$_ext === void 0 ? void 0 : _childrenBooking$_ext.event_resources;
227
+ if (Array.isArray(_eventResources)) {
228
+ // 简化操作,所有资源全部加入到额外资源中,由接下来的方法内部进行去重
229
+ _eventResources.forEach(function (item) {
230
+ extraParams.extraResources.push({
231
+ id: item.relation_id,
232
+ form_id: item.form_id
233
+ });
230
234
  });
231
235
  }
236
+
237
+ // 2. 移入未绑定的资源中
232
238
  if (toResource) {
233
239
  extraParams.extraResources.push({
234
240
  form_id: toResource.form_id,
@@ -252,10 +258,12 @@ export var init = /*#__PURE__*/function () {
252
258
  },
253
259
  // 总资源列表
254
260
  resourcesOrigin: resourcesOrigin,
261
+ // 源资源
262
+ fromResource: fromResource,
255
263
  // 目标资源
256
264
  toResource: toResource
257
265
  });
258
- case 17:
266
+ case 18:
259
267
  case "end":
260
268
  return _context7.stop();
261
269
  }
@@ -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,9 +1,9 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
7
  import { miniRedux } from "@pisell/utils";
8
8
  var defaultState = {};
9
9
  var _miniRedux = miniRedux({
@@ -0,0 +1 @@
1
+ export declare const useIsBooking4Shop: (state: any) => any;
@@ -0,0 +1,6 @@
1
+ interface AddServiceVariantProps {
2
+ globalState: any;
3
+ setGlobalState: any;
4
+ }
5
+ declare const AddServiceVariant: (props: AddServiceVariantProps) => JSX.Element;
6
+ export default AddServiceVariant;
@@ -0,0 +1,3 @@
1
+ import { InfoProps } from './main';
2
+ declare const APP: (props: InfoProps) => JSX.Element;
3
+ export default APP;
@@ -1,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -19,7 +19,7 @@ var Like = function Like(_ref) {
19
19
  }
20
20
  e.preventDefault();
21
21
  e.stopPropagation();
22
- onChange === null || onChange === void 0 || onChange(status === "like" ? "common" : "like");
22
+ onChange === null || onChange === void 0 ? void 0 : onChange(status === "like" ? "common" : "like");
23
23
  }
24
24
  });
25
25
  };