@pisell/private-materials 3.2.18 → 3.2.20

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 (105) 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.js +3 -3
  6. package/build/lowcode/view.js +3 -3
  7. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +40 -70
  8. package/es/components/appointmentBooking/components/Cart/Item/Total.js +3 -5
  9. package/es/components/appointmentBooking/components/Cart/Item/index.js +10 -6
  10. package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  11. package/es/components/appointmentBooking/components/Footer/index.js +4 -11
  12. package/es/components/appointmentBooking/components/Resource/index.js +13 -3
  13. package/es/components/appointmentBooking/components/Services/index.js +13 -1
  14. package/es/components/appointmentBooking/components/TimeSlicing/index.js +19 -6
  15. package/es/components/appointmentBooking/context.d.ts +4 -0
  16. package/es/components/appointmentBooking/context.js +14 -1
  17. package/es/components/appointmentBooking/hooks.d.ts +2 -1
  18. package/es/components/appointmentBooking/hooks.js +32 -3
  19. package/es/components/appointmentBooking/locales.d.ts +3 -0
  20. package/es/components/appointmentBooking/locales.js +6 -3
  21. package/es/components/appointmentBooking/utils.d.ts +1 -0
  22. package/es/components/appointmentBooking/utils.js +28 -0
  23. package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  24. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  25. package/es/components/booking/info/date/index.d.ts +0 -1
  26. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  27. package/es/components/booking/info/notes/index.d.ts +0 -1
  28. package/es/components/booking/info/service/actions/index.d.ts +0 -1
  29. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  30. package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
  31. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  32. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  33. package/es/components/booking/info/service2/utils.d.ts +240 -0
  34. package/es/components/booking/info/utils.js +1 -1
  35. package/es/components/booking/info2/service/actions/index.d.ts +0 -1
  36. package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  37. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  38. package/es/components/booking/materiels/duration/index.d.ts +0 -1
  39. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  40. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  41. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
  42. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  43. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  44. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  45. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  46. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  47. package/es/components/shoppingCart/components/Cart/Product.js +7 -3
  48. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
  49. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  50. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  51. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  52. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  53. package/es/components/shoppingCart/index.d.ts +0 -1
  54. package/es/components/shoppingCart/status.js +2 -1
  55. package/es/components/shoppingCart/type.d.ts +2 -0
  56. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +22 -15
  57. package/lib/components/appointmentBooking/components/Cart/Item/Total.js +2 -5
  58. package/lib/components/appointmentBooking/components/Cart/Item/index.js +7 -4
  59. package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  60. package/lib/components/appointmentBooking/components/Footer/index.js +3 -8
  61. package/lib/components/appointmentBooking/components/Resource/index.js +15 -3
  62. package/lib/components/appointmentBooking/components/Services/index.js +5 -1
  63. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +15 -4
  64. package/lib/components/appointmentBooking/context.d.ts +4 -0
  65. package/lib/components/appointmentBooking/context.js +10 -1
  66. package/lib/components/appointmentBooking/hooks.d.ts +2 -1
  67. package/lib/components/appointmentBooking/hooks.js +12 -2
  68. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  69. package/lib/components/appointmentBooking/locales.js +6 -3
  70. package/lib/components/appointmentBooking/utils.d.ts +1 -0
  71. package/lib/components/appointmentBooking/utils.js +30 -0
  72. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  73. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  74. package/lib/components/booking/info/date/index.d.ts +0 -1
  75. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  76. package/lib/components/booking/info/notes/index.d.ts +0 -1
  77. package/lib/components/booking/info/service/actions/index.d.ts +0 -1
  78. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  79. package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
  80. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  81. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  82. package/lib/components/booking/info/service2/utils.d.ts +240 -0
  83. package/lib/components/booking/info/utils.js +1 -1
  84. package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
  85. package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  86. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  87. package/lib/components/booking/materiels/duration/index.d.ts +0 -1
  88. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  89. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  90. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
  91. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  92. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  93. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  94. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  95. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  96. package/lib/components/shoppingCart/components/Cart/Product.js +19 -3
  97. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
  98. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  99. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  100. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  101. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  102. package/lib/components/shoppingCart/index.d.ts +0 -1
  103. package/lib/components/shoppingCart/status.js +2 -1
  104. package/lib/components/shoppingCart/type.d.ts +2 -0
  105. package/package.json +4 -4
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Actions: ({ currentService }: {
4
3
  currentService: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const BookingList: ({ items }: {
3
2
  items: any[];
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, resourceItem, errorMessage, handleDeleteService, }: any) => JSX.Element;
4
3
  export default ServiceItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ServiceList: ({ onEdit }: {
4
3
  onEdit: any;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
3
2
  export default Lists;
@@ -0,0 +1,240 @@
1
+ import dayjs from 'dayjs';
2
+ export declare const formatActiveKey: (lists: any[], platform: string, isEdit: boolean) => any[];
3
+ /**
4
+ * @title: 获取资源名称
5
+ * @description:
6
+ * @param {any} id
7
+ * @param {any} state
8
+ * @return {*}
9
+ * @Author: WangHan
10
+ * @Date: 2024-11-29 18:02
11
+ */
12
+ export declare const getResourceItem: (id: any, state: any) => any;
13
+ /**
14
+ * @title: 错误提示
15
+ * @description:
16
+ * @param {any} service
17
+ * @param {any} resourceItem
18
+ * @return {*}
19
+ * @Author: WangHan
20
+ * @Date: 2024-11-29 18:41
21
+ */
22
+ export declare const getErrorMessage: (service: any, resourceItem: any, isDay?: boolean) => any;
23
+ /**
24
+ * @title: 格式化主体列表
25
+ * @description:
26
+ * @param {any} lists
27
+ * @param {boolean} isOpenGroup
28
+ * @return {*}
29
+ * @Author: WangHan
30
+ * @Date: 2024-12-04 11:27
31
+ */
32
+ export declare const formatHolderLists: (lists: any) => any;
33
+ export declare const isBookingProduct: (extension_type: any, bol?: boolean) => boolean | undefined;
34
+ /**
35
+ * @title: 是否是预约商品
36
+ * @description:
37
+ * @return {*}
38
+ * @Author: WangHan
39
+ * @Date: 2024-12-06 11:24
40
+ */
41
+ export declare const isDayBookingProduct: (item: any, state: any) => boolean | undefined;
42
+ /**
43
+ * @title: 更新商品数据
44
+ * @description:
45
+ * @param {any} state
46
+ * @param {string} type
47
+ * @param {any} _id // 商品id
48
+ * @param {any} other
49
+ * @return {*}
50
+ * @Author: WangHan
51
+ * @Date: 2025-01-03 15:00
52
+ */
53
+ export declare const updateServices: (state: any, currentItem: any, type?: string, other?: any) => any;
54
+ export declare const formItems: (items: any[]) => any[];
55
+ /**
56
+ * @title: 格式化商品数据
57
+ * @description:
58
+ * @param {any} lists
59
+ * @return {*}
60
+ * @Author: WangHan
61
+ * @Date: 2024-11-29 17:36
62
+ */
63
+ export declare const formatProducts: (lists: any[], state: any, isRenderGroup?: boolean) => {
64
+ id: any;
65
+ _id: any;
66
+ name: any;
67
+ price: any;
68
+ total: any;
69
+ origin_total: any;
70
+ num: any;
71
+ image: any;
72
+ isShowNote: boolean;
73
+ note: any;
74
+ like_status: any;
75
+ bundle: any;
76
+ options: any;
77
+ errorMessage: string;
78
+ product_option_string: any;
79
+ discount_reason: any;
80
+ resource_id: any;
81
+ relation_form_name: any;
82
+ holder_title: any;
83
+ start_date: any;
84
+ end_date: any;
85
+ holder_id: any;
86
+ isNormalProduct: boolean;
87
+ locale: any;
88
+ symbol: any;
89
+ items: any[];
90
+ _origin: any;
91
+ }[];
92
+ /**
93
+ * @title: 禁用日期
94
+ * @description:
95
+ * @param {any} current
96
+ * @param {string} position
97
+ * @param {any} startDate
98
+ * @return {*}
99
+ * @Author: WangHan
100
+ * @Date: 2024-12-03 17:51
101
+ */
102
+ export declare const disabledDate: (current: any, position: string, currentDate: any) => any;
103
+ /**
104
+ * @title: 是否是跨日预约
105
+ * @description:
106
+ * @param {any} state
107
+ * @return {*}
108
+ * @Author: WangHan
109
+ * @Date: 2024-12-04 09:49
110
+ */
111
+ export declare const isDayBooking: (state: any) => boolean;
112
+ export declare const isDaysBooking: (state: any) => boolean;
113
+ export declare const isEventBooking: (state: any) => boolean;
114
+ export declare const isAppointmentProduct: (item: any) => boolean;
115
+ /**
116
+ * @title: 是否是terminal上的跨日预约
117
+ * @description:
118
+ * @param {any} state
119
+ * @return {*}
120
+ * @Author: WangHan
121
+ * @Date: 2024-12-04 15:31
122
+ */
123
+ export declare const isTerminalDayBooking: (state: any) => any;
124
+ export declare const formatDayDate: (_extend: any) => any;
125
+ /**
126
+ * @title: 根据营业日时间格式化时间
127
+ * @description:
128
+ * @param {any} state
129
+ * @return {*}
130
+ * @Author: WangHan
131
+ * @Date: 2024-12-04 12:07
132
+ */
133
+ export declare const formatDayTime: ({ startDate, endDate }: any) => {
134
+ startDateTime: dayjs.Dayjs;
135
+ endDateTime: dayjs.Dayjs;
136
+ };
137
+ export declare const formatDateTime: (start_date: any, end_date: any) => {
138
+ value: dayjs.Dayjs;
139
+ end_date: dayjs.Dayjs;
140
+ };
141
+ /**
142
+ * @title: 初始化日期
143
+ * @description:
144
+ * @return {*}
145
+ * @Author: WangHan
146
+ * @Date: 2024-12-06 17:24
147
+ */
148
+ export declare const initDate: () => {
149
+ value: dayjs.Dayjs;
150
+ end_date: dayjs.Dayjs;
151
+ };
152
+ /**
153
+ * @title: 是否有预约商品
154
+ * @description:
155
+ * @return {*}
156
+ * @Author: WangHan
157
+ * @Date: 2024-12-12 15:47
158
+ */
159
+ export declare const isHasDayAppointmentProduct: (state: any) => boolean;
160
+ /**
161
+ * @title: 过滤出如果是预约商品,则只获取跨日的预约商品
162
+ * @description:
163
+ * @param {any} lists
164
+ * @return {*}
165
+ * @Author: WangHan
166
+ * @Date: 2024-12-13 16:44
167
+ */
168
+ export declare const getDayProducts: (holderId: number, lists: any, isTerminal?: boolean) => any;
169
+ /**
170
+ * @title: 格式化表单数据
171
+ * @description:
172
+ * @param {any} state
173
+ * @return {*}
174
+ * @Author: WangHan
175
+ * @Date: 2024-12-30 22:19
176
+ */
177
+ export declare const getPets: (state: any) => any;
178
+ /**
179
+ * @title: 得出预约商品
180
+ * @description:
181
+ * @param {any} state
182
+ * @return {*}
183
+ * @Author: WangHan
184
+ * @Date: 2024-12-30 22:26
185
+ */
186
+ export declare const getAppointmentService: (state: any) => any;
187
+ /**
188
+ * @title: 判断是否打开删除宠物弹窗
189
+ * @description:
190
+ * @param {any} state
191
+ * @param {any} newVal
192
+ * @return {*}
193
+ * @Author: WangHan
194
+ * @Date: 2024-12-16 16:12
195
+ */
196
+ export declare const isOpenDeletePet: (state: any, newVal: any) => {
197
+ ids: any;
198
+ lists: any;
199
+ };
200
+ /**
201
+ * @title: 当前选中的表单id
202
+ * @description:
203
+ * @param {any} state
204
+ * @return {*}
205
+ * @Author: WangHan
206
+ * @Date: 2024-12-17 14:40
207
+ */
208
+ export declare const holderId: (state: any) => number;
209
+ /**
210
+ * @title: 更新套餐的价格
211
+ * @description:
212
+ * @param {any} currentValue
213
+ * @param {any} newBundleData
214
+ * @return {*}
215
+ * @Author: WangHan
216
+ * @Date: 2024-12-31 15:16
217
+ */
218
+ export declare function updateNormalBundlePrice(currentValue: any, newBundleData: any): any[];
219
+ /**
220
+ * @title: 更新预约商品报价单
221
+ * @description:
222
+ * @param {any} state
223
+ * @param {any} cacheItem
224
+ * @return {*}
225
+ * @Author: WangHan
226
+ * @Date: 2024-12-25 16:41
227
+ */
228
+ export declare const updateAppointmentServicePrice: (state: any, { start_date, end_date, product_id }: any) => Promise<{
229
+ multiDayPrices: any;
230
+ price: number;
231
+ }>;
232
+ /**
233
+ * @title: 更新普通商品报价单价格
234
+ * @description:
235
+ * @param {any} state
236
+ * @return {*}
237
+ * @Author: WangHan
238
+ * @Date: 2024-12-24 11:32
239
+ */
240
+ export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
@@ -93,7 +93,7 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType) {
93
93
  if (renderType === 'eventBooking') {
94
94
  return false;
95
95
  }
96
- var booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586];
96
+ var booking4Shops = [9, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586];
97
97
  return booking4Shops.includes(shopId);
98
98
  };
99
99
  function generateDateRange(start, end) {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import '../../../info/service/actions/index.less';
3
2
  declare const Actions: ({ currentService }: {
4
3
  currentService: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, errorMessage, handleDeleteService, }: any) => JSX.Element;
4
3
  export default ServiceItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ServiceList: ({ onEdit }: {
4
3
  onEdit: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SelectProps } from 'antd';
3
2
  interface DurationProps extends SelectProps {
4
3
  locale?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SelectProps } from 'antd';
3
2
  interface HolderProps extends SelectProps {
4
3
  selectProps?: SelectProps;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SelectProps } from "antd";
3
2
  interface StartTimeProps extends SelectProps {
4
3
  locale?: string;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const CartItem: () => JSX.Element;
3
+ export default CartItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Cart: ({ open, onCancel }: any) => JSX.Element;
3
4
  export default Cart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Layout: () => JSX.Element;
3
4
  export default Layout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const Actor: ({ name }: {
3
2
  name: string;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  interface valueType {
4
3
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ProductProps } from '../../type';
3
2
  declare const Product: (props: ProductProps) => JSX.Element;
4
3
  export default Product;
@@ -18,7 +18,9 @@ var Product = function Product(props) {
18
18
  isShowPackageNote = state.isShowPackageNote,
19
19
  isShowNote = state.isShowNote,
20
20
  hideAddBtn = state.hideAddBtn,
21
- platform = state.platform;
21
+ platform = state.platform,
22
+ isShowChangeResource = state.isShowChangeResource,
23
+ isShowDelete = state.isShowDelete;
22
24
  var clearCart = useClearCart(id);
23
25
 
24
26
  /**
@@ -37,9 +39,11 @@ var Product = function Product(props) {
37
39
  return {
38
40
  isShowNote: isShowNote,
39
41
  isShowPackageNote: isShowPackageNote,
40
- disabledEdit: disabledEdit
42
+ disabledEdit: disabledEdit,
43
+ isShowChangeResource: isShowChangeResource,
44
+ isShowDelete: isShowDelete
41
45
  };
42
- }, [isShowNote, isShowPackageNote, disabledEdit]);
46
+ }, [isShowNote, isShowPackageNote, disabledEdit, isShowChangeResource, isShowDelete]);
43
47
  return /*#__PURE__*/React.createElement("div", {
44
48
  className: "pisell-lowcode__shopping-cart-content"
45
49
  }, clearCart, lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Cart: () => JSX.Element;
4
3
  export default Cart;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Empty: (props: any) => JSX.Element;
4
3
  export default Empty;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Content: () => JSX.Element;
4
3
  export default Content;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useAddService: (id?: number, type?: string) => JSX.Element | null;
3
2
  export default useAddService;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useClearCart: (key?: number | undefined) => JSX.Element | null;
3
2
  export default useClearCart;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { shoppingCartProps } from './type';
3
2
  declare const shoppingCart: ({ onCard, onChange, onAddProduct, onActiveKey, ...props }: shoppingCartProps) => JSX.Element;
4
3
  export default shoppingCart;
@@ -8,7 +8,8 @@ var productDefault = {
8
8
  holders: [],
9
9
  products: [],
10
10
  isEdit: false,
11
- disabledEdit: false
11
+ disabledEdit: false,
12
+ isShowChangeResource: false
12
13
  };
13
14
  export var defaultData = {
14
15
  isOpenGroup: true,
@@ -7,6 +7,8 @@ export interface productProps {
7
7
  holders?: any[];
8
8
  isEdit?: boolean;
9
9
  disabledEdit?: boolean;
10
+ isShowChangeResource?: boolean;
11
+ isShowDelete?: boolean;
10
12
  }
11
13
  export interface shoppingCartProps {
12
14
  isOpenGroup?: boolean;
@@ -43,23 +43,16 @@ var import_index = require("./index.less");
43
43
  var ContinueButton = () => {
44
44
  const context = (0, import_useEngineContext.default)();
45
45
  const utils = context.appHelper.utils || {};
46
- const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
46
+ const [loading, setLoading] = (0, import_react.useState)(false);
47
47
  const { isLogin, openLoginModal } = (0, import_hooks.useAppointmentBookingLogin)();
48
- const { currentStep, isLastStep, products } = (0, import_context.useAppointmentBookingContext)();
49
- const [openCheckout, setOpenCheckout] = (0, import_react.useState)(false);
50
- const [checkedNumber, setCheckedNumber] = (0, import_react.useState)(0);
51
- const [openEmptyHolder, setOpenEmptyHolder] = (0, import_react.useState)(false);
48
+ const { currentStep, isLastStep, carts, appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
52
49
  const data = {};
53
- const currentStepData = {
54
- key: "select-event"
55
- };
56
50
  const createBooking = {
57
51
  loading: false
58
52
  };
59
53
  const checkBeforeBooking = {
60
54
  loading: false
61
55
  };
62
- const cartData = {};
63
56
  const handleCheckout = async () => {
64
57
  var _a;
65
58
  const value = (0, import_utils2.formatValues)(data);
@@ -73,12 +66,26 @@ var ContinueButton = () => {
73
66
  };
74
67
  const handleNextStep = async () => {
75
68
  if (isLastStep) {
76
- return handleCheckout();
69
+ setLoading(true);
70
+ try {
71
+ const res = await appointmentBooking.submitOrder();
72
+ console.log(isLastStep, isLogin, res, "wh9896788");
73
+ utils.action({
74
+ type: "pisell1.payment",
75
+ data: res == null ? void 0 : res.data,
76
+ callback: (e) => {
77
+ console.log(e, "wh9896788");
78
+ }
79
+ });
80
+ setLoading(false);
81
+ } catch (error) {
82
+ console.log(isLastStep, isLogin, error, "wh9896788");
83
+ setLoading(false);
84
+ }
85
+ return;
77
86
  }
78
87
  return appointmentBooking.next();
79
88
  };
80
- const handleHolder = () => {
81
- };
82
89
  const handleContinue = async () => {
83
90
  if (isLastStep) {
84
91
  if (!isLogin) {
@@ -99,7 +106,7 @@ var ContinueButton = () => {
99
106
  } else {
100
107
  return import_utils.locales.getText("pisell2.event.close.continue");
101
108
  }
102
- }, [currentStepData == null ? void 0 : currentStepData.key]);
109
+ }, [isLastStep]);
103
110
  const confirmLoading = (0, import_react.useMemo)(() => {
104
111
  if (!isLastStep) return false;
105
112
  return (createBooking == null ? void 0 : createBooking.loading) || (checkBeforeBooking == null ? void 0 : checkBeforeBooking.loading);
@@ -107,11 +114,11 @@ var ContinueButton = () => {
107
114
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
108
115
  import_materials.Button,
109
116
  {
110
- disabled: !(products == null ? void 0 : products.length),
117
+ disabled: !(carts == null ? void 0 : carts.length),
111
118
  size: "large",
112
119
  type: "primary",
113
120
  onClick: () => handleContinue(),
114
- loading: confirmLoading
121
+ loading
115
122
  },
116
123
  continueText
117
124
  ));
@@ -35,14 +35,11 @@ module.exports = __toCommonJS(Total_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_utils = require("@pisell/utils");
37
37
  var import_materials = require("@pisell/materials");
38
- var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
39
38
  var import_index = require("./index.less");
40
39
  var import_classnames = __toESM(require("classnames"));
41
40
  var import_context = require("../../../context");
42
41
  var Total = ({ className, isFooter }) => {
43
- var _a, _b, _c;
44
- const context = (0, import_useEngineContext.default)();
45
- const { summary } = (0, import_context.useAppointmentBookingContext)();
42
+ const { summary, symbolic } = (0, import_context.useAppointmentBookingContext)();
46
43
  const { taxTitle, totalTaxFee, isPriceIncludeTax, total } = summary;
47
44
  return /* @__PURE__ */ import_react.default.createElement("div", { className: `event-total-wrap ${className}` }, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "gst-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", null, taxTitle, isFooter ? ": " : ""), /* @__PURE__ */ import_react.default.createElement(import_materials.PisellText.Amount, { value: totalTaxFee, showCurrencySymbol: true })) : null, /* @__PURE__ */ import_react.default.createElement(
48
45
  "div",
@@ -60,7 +57,7 @@ var Total = ({ className, isFooter }) => {
60
57
  }
61
58
  ) : null), isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ import_react.default.createElement("span", { className: "gst" }, import_utils.locales.getText("pisell2.event.total.gst")(
62
59
  `${isFooter ? `${taxTitle}: ` : taxTitle}`,
63
- `${(_c = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.getSymbolic) == null ? void 0 : _c.call(_b)}${totalTaxFee}`
60
+ `${symbolic}${totalTaxFee}`
64
61
  )) : null),
65
62
  !isFooter ? /* @__PURE__ */ import_react.default.createElement(
66
63
  import_materials.PisellText.Amount,
@@ -42,11 +42,12 @@ var import_Total = __toESM(require("./Total"));
42
42
  var import_utils2 = require("../../../utils");
43
43
  var import_index = require("./index.less");
44
44
  var CartItem = () => {
45
+ var _a, _b;
45
46
  const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
46
47
  const appointmentBookingAccount = (0, import_hooks.useAppointmentBookingAccount)();
47
- const { carts, summary, isLastStep } = (0, import_context.useAppointmentBookingContext)();
48
+ const { carts, summary, isLastStep, currentStep, resources } = (0, import_context.useAppointmentBookingContext)();
48
49
  const { accountLists } = appointmentBookingAccount;
49
- console.log(summary, carts, "accountLists");
50
+ console.log(summary, carts, (0, import_utils2.formatCarts)(carts, resources), "accountLists");
50
51
  const holderIds = (0, import_react.useMemo)(() => {
51
52
  return accountLists.map((item) => item.id);
52
53
  }, [accountLists]);
@@ -73,10 +74,12 @@ var CartItem = () => {
73
74
  import_shoppingCart.default,
74
75
  {
75
76
  productParams: {
76
- products: carts,
77
+ products: (0, import_utils2.formatCarts)(carts, resources),
77
78
  hideAddBtn: false,
78
79
  holders,
79
- disabledEdit: isLastStep
80
+ disabledEdit: isLastStep,
81
+ isShowChangeResource: ((_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key) === "select-resource",
82
+ isShowDelete: ((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.index) < 2
80
83
  },
81
84
  collapseParams: {
82
85
  activeKey: holderIds,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Cart: ({ open, onCancel }: any) => JSX.Element;
3
4
  export default Cart;
@@ -37,24 +37,19 @@ var import_materials = require("@pisell/materials");
37
37
  var import_react2 = require("react");
38
38
  var import_ContinueButton = __toESM(require("../Cart/ContinueButton"));
39
39
  var import_shopping_cart = __toESM(require("../../assets/shopping-cart.svg"));
40
- var import_hooks = require("../../hooks");
40
+ var import_context = require("../../context");
41
41
  var import_Cart = __toESM(require("../Cart"));
42
42
  var import_Total = __toESM(require("../Cart/Item/Total"));
43
43
  var import_index = require("./index.less");
44
44
  var Footer = () => {
45
- var _a;
46
- const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
47
- const appointmentBookingCart = (0, import_hooks.useAppointmentBookingCart)();
45
+ const { carts } = (0, import_context.useAppointmentBookingContext)();
48
46
  const [open, setOpen] = (0, import_react2.useState)(false);
49
- const cartData = {
50
- cartItems: [1, 2]
51
- };
52
47
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
53
48
  import_materials.SectionFooters,
54
49
  {
55
50
  className: "section-footer-wrap",
56
51
  left: /* @__PURE__ */ import_react.default.createElement(import_Total.default, { className: "section-footer-left", isFooter: true }),
57
- right: /* @__PURE__ */ import_react.default.createElement("div", { className: "section-footer-right" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Badge, { count: ((_a = cartData.cartItems) == null ? void 0 : _a.length) || 0 }, /* @__PURE__ */ import_react.default.createElement(
52
+ right: /* @__PURE__ */ import_react.default.createElement("div", { className: "section-footer-right" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Badge, { count: (carts == null ? void 0 : carts.length) || 0 }, /* @__PURE__ */ import_react.default.createElement(
58
53
  import_materials.Button,
59
54
  {
60
55
  size: "large",
@@ -42,12 +42,24 @@ var import_utils = require("@pisell/utils");
42
42
  var import_index = require("./index.less");
43
43
  var Resource = ({ onChange }) => {
44
44
  const [selectedResource, setSelectedResource] = (0, import_react.useState)(0);
45
- const { appointmentBooking, resources, carts } = (0, import_context.useAppointmentBookingContext)();
46
- const { getResourceList, getResourceTimeSlot } = (0, import_hooks.useAppointmentBookingResource)();
45
+ const { appointmentBooking, resources, carts, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
46
+ const {
47
+ getResourceList,
48
+ getResourceTimeSlot,
49
+ autoSelectAllProductResources
50
+ } = (0, import_hooks.useAppointmentBookingResource)();
47
51
  console.log(resources, carts, appointmentBooking, "lists, products");
48
52
  (0, import_react.useEffect)(() => {
49
- getResourceList();
53
+ const _resources = getResourceList();
54
+ autoSelectAllProductResources("resources");
50
55
  }, []);
56
+ (0, import_react.useEffect)(() => {
57
+ var _a;
58
+ console.log(resourceOtherParams == null ? void 0 : resourceOtherParams.errorList, "errorListerrorListerrorList");
59
+ if (((_a = resourceOtherParams == null ? void 0 : resourceOtherParams.errorList) == null ? void 0 : _a.length) > 0) {
60
+ return;
61
+ }
62
+ }, [resourceOtherParams == null ? void 0 : resourceOtherParams.errorList]);
51
63
  const anyResource = [
52
64
  {
53
65
  id: 0,
@@ -61,12 +61,16 @@ var Services = () => {
61
61
  detail: item
62
62
  },
63
63
  callback: (data) => {
64
+ var _a, _b;
65
+ const resources = ((_b = (_a = data == null ? void 0 : data.origin) == null ? void 0 : _a.product_resource) == null ? void 0 : _b.resources) || [];
66
+ const activeStatus = resources.find((item2) => item2.status === 1);
67
+ if (!activeStatus) {
68
+ }
64
69
  const product = {
65
70
  ...data,
66
71
  options: (data == null ? void 0 : data.option) || []
67
72
  };
68
73
  delete product.option;
69
- console.log(product, data, appointmentBooking.storeProduct, "wh978796");
70
74
  appointmentBooking.storeProduct(product);
71
75
  }
72
76
  });