@pisell/private-materials 3.0.201 → 3.0.202

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 (129) 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 +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -27
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +18 -33
  11. package/es/components/booking/addons/model.d.ts +1 -1
  12. package/es/components/booking/components/footer/amount.js +5 -4
  13. package/es/components/booking/components/footer/utils.js +49 -29
  14. package/es/components/booking/forms/model.d.ts +1 -1
  15. package/es/components/booking/info/Provider.d.ts +0 -0
  16. package/es/components/booking/info/Provider.js +54 -0
  17. package/es/components/booking/info/clientVariant/vertical/index.js +93 -7
  18. package/es/components/booking/info/main.js +10 -9
  19. package/es/components/booking/info/pet/ChangePetModal/index.js +38 -23
  20. package/es/components/booking/info/service/addService/index.js +70 -99
  21. package/es/components/booking/info/service/addService/utils.d.ts +1 -0
  22. package/es/components/booking/info/service/addService/utils.js +55 -3
  23. package/es/components/booking/info/service/editService/BookingList/index.d.ts +5 -0
  24. package/es/components/booking/info/service/editService/BookingList/index.js +39 -0
  25. package/es/components/booking/info/service/editService/EditTabs/index.d.ts +3 -0
  26. package/es/components/booking/info/service/editService/EditTabs/index.js +35 -0
  27. package/es/components/booking/info/service/editService/index.js +234 -142
  28. package/es/components/booking/info/service/serve.d.ts +10 -0
  29. package/es/components/booking/info/service/serve.js +28 -0
  30. package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +11 -0
  31. package/es/components/booking/info/service/serviceManager/distributeDiscount.js +55 -0
  32. package/es/components/booking/info/service/serviceManager/index.d.ts +20 -0
  33. package/es/components/booking/info/service/serviceManager/index.js +277 -0
  34. package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
  35. package/es/components/booking/info/service/serviceManager/utils.js +0 -0
  36. package/es/components/booking/info/service2/Group/utils.d.ts +14 -0
  37. package/es/components/booking/info/service2/Group/utils.js +146 -0
  38. package/es/components/booking/info/service2/Lists.js +27 -33
  39. package/es/components/booking/info/service2/index.d.ts +4 -1
  40. package/es/components/booking/info/service2/index.js +5 -6
  41. package/es/components/booking/info/service2/status.js +1 -1
  42. package/es/components/booking/info/service2/utils.d.ts +95 -3
  43. package/es/components/booking/info/service2/utils.js +676 -52
  44. package/es/components/booking/info/utils.d.ts +11 -0
  45. package/es/components/booking/info/utils.js +24 -0
  46. package/es/components/booking/locales.d.ts +6 -0
  47. package/es/components/booking/locales.js +9 -3
  48. package/es/components/booking/model.d.ts +1 -0
  49. package/es/components/booking/notes/index.d.ts +1 -1
  50. package/es/components/booking/notes/model.d.ts +1 -1
  51. package/es/components/booking/payments/index.d.ts +1 -1
  52. package/es/components/booking/payments/model.d.ts +1 -1
  53. package/es/components/booking/utils.js +5 -4
  54. package/es/components/eftpos/hooks.d.ts +4 -4
  55. package/es/components/eftposPay/amount.d.ts +1 -1
  56. package/es/components/eftposPay/component/step/index.d.ts +6 -6
  57. package/es/components/eftposPay/component/step/step.d.ts +4 -4
  58. package/es/components/eftposPay/hooks.d.ts +1 -1
  59. package/es/components/eftposPay/store/index.d.ts +1 -1
  60. package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
  61. package/es/components/eftposPay/windcave/helper.d.ts +1 -1
  62. package/es/components/schedules/index.d.ts +1 -1
  63. package/es/components/schedules/model.d.ts +1 -1
  64. package/es/components/shoppingCart/components/Cart/Product.js +11 -39
  65. package/es/components/shoppingCart/components/Render/index.js +8 -7
  66. package/es/components/shoppingCart/components/SelectHolderModal/index.js +12 -4
  67. package/es/components/shoppingCart/hooks/useClearCart.js +10 -5
  68. package/es/components/shoppingCart/type.d.ts +1 -1
  69. package/es/components/shoppingCart/utils.js +2 -5
  70. package/lib/components/booking/addons/model.d.ts +1 -1
  71. package/lib/components/booking/components/footer/amount.js +4 -3
  72. package/lib/components/booking/components/footer/utils.js +28 -28
  73. package/lib/components/booking/forms/model.d.ts +1 -1
  74. package/lib/components/booking/info/Provider.d.ts +0 -0
  75. package/lib/components/booking/info/Provider.js +0 -0
  76. package/lib/components/booking/info/clientVariant/vertical/index.js +51 -1
  77. package/lib/components/booking/info/main.js +6 -5
  78. package/lib/components/booking/info/pet/ChangePetModal/index.js +33 -23
  79. package/lib/components/booking/info/service/addService/index.js +50 -92
  80. package/lib/components/booking/info/service/addService/utils.d.ts +1 -0
  81. package/lib/components/booking/info/service/addService/utils.js +27 -0
  82. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +5 -0
  83. package/lib/components/booking/info/service/editService/BookingList/index.js +55 -0
  84. package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +3 -0
  85. package/lib/components/booking/info/service/editService/EditTabs/index.js +75 -0
  86. package/lib/components/booking/info/service/editService/index.js +309 -234
  87. package/lib/components/booking/info/service/serve.d.ts +10 -0
  88. package/lib/components/booking/info/service/serve.js +7 -2
  89. package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +11 -0
  90. package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +70 -0
  91. package/lib/components/booking/info/service/serviceManager/index.d.ts +20 -0
  92. package/lib/components/booking/info/service/serviceManager/index.js +207 -0
  93. package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
  94. package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
  95. package/lib/components/booking/info/service2/Group/utils.d.ts +14 -0
  96. package/lib/components/booking/info/service2/Group/utils.js +142 -0
  97. package/lib/components/booking/info/service2/Lists.js +14 -12
  98. package/lib/components/booking/info/service2/index.d.ts +4 -1
  99. package/lib/components/booking/info/service2/index.js +5 -5
  100. package/lib/components/booking/info/service2/status.js +1 -1
  101. package/lib/components/booking/info/service2/utils.d.ts +95 -3
  102. package/lib/components/booking/info/service2/utils.js +401 -48
  103. package/lib/components/booking/info/utils.d.ts +11 -0
  104. package/lib/components/booking/info/utils.js +35 -0
  105. package/lib/components/booking/locales.d.ts +6 -0
  106. package/lib/components/booking/locales.js +9 -3
  107. package/lib/components/booking/model.d.ts +1 -0
  108. package/lib/components/booking/notes/index.d.ts +1 -1
  109. package/lib/components/booking/notes/model.d.ts +1 -1
  110. package/lib/components/booking/payments/index.d.ts +1 -1
  111. package/lib/components/booking/payments/model.d.ts +1 -1
  112. package/lib/components/booking/utils.js +3 -4
  113. package/lib/components/eftpos/hooks.d.ts +4 -4
  114. package/lib/components/eftposPay/amount.d.ts +1 -1
  115. package/lib/components/eftposPay/component/step/index.d.ts +6 -6
  116. package/lib/components/eftposPay/component/step/step.d.ts +4 -4
  117. package/lib/components/eftposPay/hooks.d.ts +1 -1
  118. package/lib/components/eftposPay/store/index.d.ts +1 -1
  119. package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
  120. package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
  121. package/lib/components/schedules/index.d.ts +1 -1
  122. package/lib/components/schedules/model.d.ts +1 -1
  123. package/lib/components/shoppingCart/components/Cart/Product.js +6 -22
  124. package/lib/components/shoppingCart/components/Render/index.js +6 -10
  125. package/lib/components/shoppingCart/components/SelectHolderModal/index.js +12 -4
  126. package/lib/components/shoppingCart/hooks/useClearCart.js +4 -9
  127. package/lib/components/shoppingCart/type.d.ts +1 -1
  128. package/lib/components/shoppingCart/utils.js +2 -8
  129. package/package.json +3 -3
@@ -14,7 +14,7 @@ import React, { useContext, useEffect, useMemo, useState } from 'react';
14
14
  import { CartContext } from "../../../shoppingCart/Provider";
15
15
  import ShoppingCart from "../../../shoppingCart";
16
16
  import { Context } from "../model";
17
- import { formatProducts, formatActiveKey } from "./utils";
17
+ import { formatProducts, formatActiveKey, updateServices } from "./utils";
18
18
  import useSelectPet from "./hooks/useSelectPet";
19
19
  import { defaultData } from "./status";
20
20
  var Lists = function Lists(_ref) {
@@ -30,7 +30,7 @@ var Lists = function Lists(_ref) {
30
30
  var _useSelectPet = useSelectPet(state),
31
31
  holderLists = _useSelectPet.holderLists;
32
32
  useEffect(function () {
33
- var keys = formatActiveKey(holderLists, params === null || params === void 0 ? void 0 : params.platform);
33
+ var keys = formatActiveKey(holderLists, params === null || params === void 0 ? void 0 : params.platform, !!state.bookingId);
34
34
  onChange({
35
35
  activeCartId: keys
36
36
  }, 'setActiveCartId');
@@ -39,29 +39,6 @@ var Lists = function Lists(_ref) {
39
39
  }));
40
40
  }, [holderLists, params === null || params === void 0 ? void 0 : params.platform]);
41
41
 
42
- /**
43
- * @title: 点击商品卡片
44
- * @description:
45
- * @param {any} item
46
- * @return {*}
47
- * @Author: WangHan
48
- * @Date: 2024-12-09 16:06
49
- */
50
- var handleCard = function handleCard(item) {
51
- if (state.disabledEdit || state.disableEventBookingEdit) {
52
- return;
53
- }
54
- onChange({
55
- editModal: true,
56
- cacheItem: _objectSpread(_objectSpread({}, item), {}, {
57
- new: 0
58
- })
59
- });
60
- onEdit === null || onEdit === void 0 ? void 0 : onEdit(_objectSpread(_objectSpread({}, item), {}, {
61
- new: 0
62
- }));
63
- };
64
-
65
42
  /**
66
43
  * @title: 更新商品数据
67
44
  * @description:
@@ -70,13 +47,33 @@ var Lists = function Lists(_ref) {
70
47
  * @Author: WangHan
71
48
  * @Date: 2024-11-29 16:35
72
49
  */
73
- var handleChange = function handleChange(newState) {
74
- if (state.disabledEdit || state.disableEventBookingEdit || state.channelDisabledEdit) {
50
+ var handleChange = function handleChange(currentItem, type, other) {
51
+ if (state.disabledEdit || state.disableEventBookingEdit) {
75
52
  return;
76
53
  }
54
+ var products = updateServices(state, currentItem, type, other);
55
+
56
+ // 查看
57
+ if (type === 'view') {
58
+ var product = currentItem._origin;
59
+ // if (isGroupBooking(currentItem._id)) {
60
+ // product = currentItem._origin;
61
+ // } else {
62
+ // product = products?.find((item: any) => item._id === currentItem._id);
63
+ // }
64
+ onChange({
65
+ editModal: true,
66
+ cacheItem: _objectSpread(_objectSpread({}, product), {}, {
67
+ new: 0
68
+ })
69
+ });
70
+ return onEdit === null || onEdit === void 0 ? void 0 : onEdit(_objectSpread(_objectSpread({}, product), {}, {
71
+ new: 0
72
+ }));
73
+ }
77
74
  var params = {
78
75
  editModal: false,
79
- value: newState,
76
+ value: products,
80
77
  edit: true,
81
78
  cacheItem: null
82
79
  };
@@ -127,7 +124,7 @@ var Lists = function Lists(_ref) {
127
124
  var productParams = useMemo(function () {
128
125
  return {
129
126
  hideAddBtn: state.isTerminalDayBookingPage,
130
- isShowNote: true,
127
+ isShowNote: false,
131
128
  isShowPackageNote: false,
132
129
  holders: holderLists,
133
130
  isEdit: !!(state !== null && state !== void 0 && state.bookingId),
@@ -139,10 +136,7 @@ var Lists = function Lists(_ref) {
139
136
  state: state
140
137
  }
141
138
  }, /*#__PURE__*/React.createElement(ShoppingCart, {
142
- onCard: handleCard,
143
- onChange: function onChange(e) {
144
- return handleChange(e);
145
- },
139
+ onChange: handleChange,
146
140
  onAddProduct: function onAddProduct() {
147
141
  return onChange({
148
142
  addModal: true
@@ -1,3 +1,6 @@
1
1
  import React from 'react';
2
2
  export declare const Service2Context: React.Context<any>;
3
- export declare const Service2Cart: () => React.JSX.Element;
3
+ export declare const Service2Cart: ({ hideAdd, hideEdit, }: {
4
+ hideAdd?: boolean | undefined;
5
+ hideEdit?: boolean | undefined;
6
+ }) => React.JSX.Element;
@@ -10,7 +10,9 @@ import EditService from "../service/editService";
10
10
  import { Context } from "../model";
11
11
  import Lists from "./Lists";
12
12
  export var Service2Context = /*#__PURE__*/createContext({});
13
- export var Service2Cart = function Service2Cart() {
13
+ export var Service2Cart = function Service2Cart(_ref) {
14
+ var hideAdd = _ref.hideAdd,
15
+ hideEdit = _ref.hideEdit;
14
16
  var detailRef = useRef();
15
17
  var _useContext = useContext(Context),
16
18
  state = _useContext.state,
@@ -18,9 +20,6 @@ export var Service2Cart = function Service2Cart() {
18
20
  useEffect(function () {
19
21
  document.body.id = 'body';
20
22
  }, []);
21
- useEffect(function () {
22
- console.log(state, 'wh_state33');
23
- }, [state]);
24
23
 
25
24
  /**
26
25
  * @title: 更新服务
@@ -50,9 +49,9 @@ export var Service2Cart = function Service2Cart() {
50
49
  onChange: function onChange(e, type) {
51
50
  return dispatchService(type || 'setService', e);
52
51
  }
53
- }), /*#__PURE__*/React.createElement(AddService, {
52
+ }), !hideAdd && /*#__PURE__*/React.createElement(AddService, {
54
53
  onEdit: handleEdit
55
- })), /*#__PURE__*/React.createElement(EditService, {
54
+ })), !hideEdit && /*#__PURE__*/React.createElement(EditService, {
56
55
  ref: detailRef
57
56
  }));
58
57
  };
@@ -62,7 +62,7 @@ export var inputDateCol = function inputDateCol(isDayBooking, isTerminal) {
62
62
  * @Author: WangHan
63
63
  * @Date: 2024-12-06 14:59
64
64
  */
65
- export var appointmentTypes = ['product_appointment', 'product_add_time'];
65
+ export var appointmentTypes = ['product_appointment'];
66
66
 
67
67
  /**
68
68
  * @title: 营业日时间
@@ -1,5 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
- export declare const formatActiveKey: (lists: any[], platform: string) => any[];
2
+ export declare const formatActiveKey: (lists: any[], platform: string, isEdit: boolean) => any[];
3
3
  /**
4
4
  * @title: 获取资源名称
5
5
  * @description:
@@ -30,6 +30,7 @@ export declare const getErrorMessage: (service: any, resourceItem: any, isDay?:
30
30
  * @Date: 2024-12-04 11:27
31
31
  */
32
32
  export declare const formatHolderLists: (lists: any) => any;
33
+ export declare const isBookingProduct: (extension_type: any) => boolean;
33
34
  /**
34
35
  * @title: 是否是预约商品
35
36
  * @description:
@@ -37,7 +38,20 @@ export declare const formatHolderLists: (lists: any) => any;
37
38
  * @Author: WangHan
38
39
  * @Date: 2024-12-06 11:24
39
40
  */
40
- export declare const isAppointment: (item: any, state: any) => boolean;
41
+ export declare const isDayBookingProduct: (item: any, state: any) => boolean;
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[];
41
55
  /**
42
56
  * @title: 格式化商品数据
43
57
  * @description:
@@ -46,7 +60,35 @@ export declare const isAppointment: (item: any, state: any) => boolean;
46
60
  * @Author: WangHan
47
61
  * @Date: 2024-11-29 17:36
48
62
  */
49
- export declare const formatProducts: (lists: any[], state: any) => any[] | undefined;
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
+ }[];
50
92
  /**
51
93
  * @title: 禁用日期
52
94
  * @description:
@@ -121,6 +163,24 @@ export declare const isHasDayAppointmentProduct: (state: any) => boolean;
121
163
  * @Date: 2024-12-13 16:44
122
164
  */
123
165
  export declare const getDayProducts: (holderId: number, lists: any, isTerminal?: boolean) => any;
166
+ /**
167
+ * @title: 格式化表单数据
168
+ * @description:
169
+ * @param {any} state
170
+ * @return {*}
171
+ * @Author: WangHan
172
+ * @Date: 2024-12-30 22:19
173
+ */
174
+ export declare const getPets: (state: any) => any;
175
+ /**
176
+ * @title: 得出预约商品
177
+ * @description:
178
+ * @param {any} state
179
+ * @return {*}
180
+ * @Author: WangHan
181
+ * @Date: 2024-12-30 22:26
182
+ */
183
+ export declare const getAppointmentService: (state: any) => any;
124
184
  /**
125
185
  * @title: 判断是否打开删除宠物弹窗
126
186
  * @description:
@@ -143,3 +203,35 @@ export declare const isOpenDeletePet: (state: any, newVal: any) => {
143
203
  * @Date: 2024-12-17 14:40
144
204
  */
145
205
  export declare const holderId: (state: any) => number;
206
+ /**
207
+ * @title: 更新套餐的价格
208
+ * @description:
209
+ * @param {any} currentValue
210
+ * @param {any} newBundleData
211
+ * @return {*}
212
+ * @Author: WangHan
213
+ * @Date: 2024-12-31 15:16
214
+ */
215
+ export declare function updateNormalBundlePrice(currentValue: any, newBundleData: any): any[];
216
+ /**
217
+ * @title: 更新预约商品报价单
218
+ * @description:
219
+ * @param {any} state
220
+ * @param {any} cacheItem
221
+ * @return {*}
222
+ * @Author: WangHan
223
+ * @Date: 2024-12-25 16:41
224
+ */
225
+ export declare const updateAppointmentServicePrice: (state: any, { start_date, end_date, product_id }: any) => Promise<{
226
+ multiDayPrices: any;
227
+ price: number;
228
+ }>;
229
+ /**
230
+ * @title: 更新普通商品报价单价格
231
+ * @description:
232
+ * @param {any} state
233
+ * @return {*}
234
+ * @Author: WangHan
235
+ * @Date: 2024-12-24 11:32
236
+ */
237
+ export declare const updateServicePrice: (state: any) => never[] | Promise<any>;