@pisell/private-materials 3.3.4 → 3.3.6

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 (47) 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 +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
  8. package/es/components/appointmentBooking/hooks.js +11 -14
  9. package/es/components/appointmentBooking/index.js +3 -0
  10. package/es/components/booking/components/voucher/index.js +3 -2
  11. package/es/components/booking/info/utils.js +1 -1
  12. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
  13. package/lib/components/appointmentBooking/hooks.js +0 -1
  14. package/lib/components/appointmentBooking/index.js +1 -0
  15. package/lib/components/booking/components/voucher/index.js +3 -2
  16. package/lib/components/booking/info/utils.js +1 -1
  17. package/package.json +4 -4
  18. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.d.ts +0 -8
  19. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -3
  20. package/es/components/appointmentBooking/components/Cart/utils.d.ts +0 -77
  21. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -3
  22. package/es/components/appointmentBooking/components/Date/index.d.ts +0 -3
  23. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -3
  24. package/es/components/appointmentBooking/components/TimeSlicing/index.d.ts +0 -3
  25. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  26. package/es/components/appointmentBooking/deposit/index.d.ts +0 -3
  27. package/es/components/appointmentBooking/hooks.d.ts +0 -104
  28. package/es/components/appointmentBooking/index.d.ts +0 -3
  29. package/es/components/appointmentBooking/locales.d.ts +0 -345
  30. package/es/components/booking/info/service/serviceList/index.d.ts +0 -5
  31. package/es/components/booking/utils.d.ts +0 -172
  32. package/es/components/wallet/components/WalletCard.d.ts +0 -11
  33. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.d.ts +0 -8
  34. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -3
  35. package/lib/components/appointmentBooking/components/Cart/utils.d.ts +0 -77
  36. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -3
  37. package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -3
  38. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -3
  39. package/lib/components/appointmentBooking/components/TimeSlicing/index.d.ts +0 -3
  40. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  41. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -3
  42. package/lib/components/appointmentBooking/hooks.d.ts +0 -104
  43. package/lib/components/appointmentBooking/index.d.ts +0 -3
  44. package/lib/components/appointmentBooking/locales.d.ts +0 -345
  45. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -5
  46. package/lib/components/booking/utils.d.ts +0 -172
  47. package/lib/components/wallet/components/WalletCard.d.ts +0 -11
@@ -93,7 +93,7 @@ var DepositModal = function DepositModal(props) {
93
93
  onOk: onCancel
94
94
  }, /*#__PURE__*/React.createElement(Spin, {
95
95
  style: {
96
- minHeight: '100%'
96
+ minHeight: '200px'
97
97
  },
98
98
  spinning: loading
99
99
  }, policy !== null && policy !== void 0 && policy.content ? /*#__PURE__*/React.createElement("div", {
@@ -146,40 +146,37 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
146
146
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
147
147
  while (1) switch (_context2.prev = _context2.next) {
148
148
  case 0:
149
- _context2.next = 2;
150
- return appointmentBooking.loadAllSchedule();
151
- case 2:
152
149
  if (!(bookingProcess === 'date_first')) {
153
- _context2.next = 13;
150
+ _context2.next = 11;
154
151
  break;
155
152
  }
156
- _context2.next = 5;
153
+ _context2.next = 3;
157
154
  return appointmentBooking.getDateRange();
158
- case 5:
155
+ case 3:
159
156
  dates = _context2.sent;
160
157
  if (!(!dates || !dates.length)) {
161
- _context2.next = 8;
158
+ _context2.next = 6;
162
159
  break;
163
160
  }
164
161
  return _context2.abrupt("return");
165
- case 8:
162
+ case 6:
166
163
  _ref5 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, _productModuleParams = _ref5.productModuleParams;
167
- _context2.next = 11;
164
+ _context2.next = 9;
168
165
  return appointmentBooking.loadProductByScheduleDate(_objectSpread({
169
166
  date: (_dates$ = dates[0]) === null || _dates$ === void 0 ? void 0 : _dates$.date
170
167
  }, _productModuleParams));
171
- case 11:
168
+ case 9:
172
169
  _productList = _context2.sent;
173
170
  return _context2.abrupt("return", _productList);
174
- case 13:
171
+ case 11:
175
172
  // 先选商品
176
173
  _ref6 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, productModuleParams = _ref6.productModuleParams;
177
- _context2.next = 16;
174
+ _context2.next = 14;
178
175
  return appointmentBooking.loadProducts(productModuleParams);
179
- case 16:
176
+ case 14:
180
177
  productList = _context2.sent;
181
178
  return _context2.abrupt("return", productList);
182
- case 18:
179
+ case 16:
183
180
  case "end":
184
181
  return _context2.stop();
185
182
  }
@@ -12,6 +12,9 @@ var AppointmentBooking = function AppointmentBooking() {
12
12
  var context = useEngineContext();
13
13
  locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
14
14
  var appointmentBooking = useAppointmentBooking();
15
+
16
+ // 初始化项目的时候,用于预加载 schedule 数据
17
+ appointmentBooking.loadAllSchedule();
15
18
  var currentUser = formatCurrentUser();
16
19
  useEffect(function () {
17
20
  var _appointmentBooking$o;
@@ -112,13 +112,14 @@ var VoucherCard = function VoucherCard(props) {
112
112
  dispatch({
113
113
  type: 'setService',
114
114
  payload: _objectSpread(_objectSpread({}, services), {}, {
115
- value: val.productList
115
+ value: ((val === null || val === void 0 ? void 0 : val.productList) || []).filter(Boolean)
116
116
  })
117
117
  });
118
118
  }
119
119
  }, [JSON.stringify(serviceMemo), isBooking4Shop]);
120
120
  var fn = useMemoizedFn(function (result) {
121
- if (result.productList.some(function (item) {
121
+ var _result$productList;
122
+ if (!(result !== null && result !== void 0 && result.productList) || result !== null && result !== void 0 && (_result$productList = result.productList) !== null && _result$productList !== void 0 && _result$productList.some(function (item) {
122
123
  return !item;
123
124
  })) {
124
125
  return;
@@ -95,7 +95,7 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType) {
95
95
  if (renderType === 'eventBooking') {
96
96
  return false;
97
97
  }
98
- var booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9];
98
+ var booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155];
99
99
  return booking4Shops.includes(shopId);
100
100
  };
101
101
  function generateDateRange(start, end) {
@@ -74,7 +74,7 @@ var DepositModal = (props) => {
74
74
  okText: import_utils.locales.getText("pisell2.appointment.deposit.close"),
75
75
  onOk: onCancel
76
76
  },
77
- /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { style: { minHeight: "100%" }, spinning: loading }, (policy == null ? void 0 : policy.content) ? /* @__PURE__ */ import_react.default.createElement(
77
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { style: { minHeight: "200px" }, spinning: loading }, (policy == null ? void 0 : policy.content) ? /* @__PURE__ */ import_react.default.createElement(
78
78
  "div",
79
79
  {
80
80
  className: "policy-content",
@@ -119,7 +119,6 @@ var useAppointmentBookingProduct = () => {
119
119
  const { bookingProcess, bookingSubject } = productModuleParams || {};
120
120
  const getProducts = async () => {
121
121
  var _a;
122
- await appointmentBooking.loadAllSchedule();
123
122
  if (bookingProcess === "date_first") {
124
123
  const dates = await appointmentBooking.getDateRange();
125
124
  if (!dates || !dates.length) return;
@@ -46,6 +46,7 @@ var AppointmentBooking = () => {
46
46
  const context = (0, import_useEngineContext.default)();
47
47
  import_utils.locales.init(import_locales.default, ((_b = (_a = context == null ? void 0 : context.engine) == null ? void 0 : _a.props) == null ? void 0 : _b.locale) || "en");
48
48
  const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
49
+ appointmentBooking.loadAllSchedule();
49
50
  const currentUser = (0, import_utils2.formatCurrentUser)();
50
51
  (0, import_react.useEffect)(() => {
51
52
  var _a2;
@@ -114,13 +114,14 @@ var VoucherCard = (props) => {
114
114
  type: "setService",
115
115
  payload: {
116
116
  ...services,
117
- value: val.productList
117
+ value: ((val == null ? void 0 : val.productList) || []).filter(Boolean)
118
118
  }
119
119
  });
120
120
  }
121
121
  }, [JSON.stringify(serviceMemo), isBooking4Shop]);
122
122
  const fn = (0, import_ahooks.useMemoizedFn)((result) => {
123
- if (result.productList.some((item) => !item)) {
123
+ var _a2;
124
+ if (!(result == null ? void 0 : result.productList) || ((_a2 = result == null ? void 0 : result.productList) == null ? void 0 : _a2.some((item) => !item))) {
124
125
  return;
125
126
  }
126
127
  dispatch({
@@ -103,7 +103,7 @@ var isBooking4Shop = (shopId, renderType) => {
103
103
  if (renderType === "eventBooking") {
104
104
  return false;
105
105
  }
106
- const booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9];
106
+ const booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155];
107
107
  return booking4Shops.includes(shopId);
108
108
  };
109
109
  function generateDateRange(start, end) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.3.4",
3
+ "version": "3.3.6",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
- "@pisell/materials": "3.3.3",
62
+ "@pisell/utils": "1.0.42",
63
+ "@pisell/materials": "3.3.5",
63
64
  "@pisell/date-picker": "3.0.2",
64
- "@pisell/icon": "0.0.11",
65
- "@pisell/utils": "1.0.42"
65
+ "@pisell/icon": "0.0.11"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface ContinueButtonProps {
4
- onContinue?: () => void;
5
- onIsErrorResource?: (isError: boolean) => void;
6
- }
7
- declare const ContinueButton: React.FC<ContinueButtonProps>;
8
- export default ContinueButton;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Total: ({ className, isFooter }: any) => JSX.Element;
3
- export default Total;
@@ -1,77 +0,0 @@
1
- import { locales } from '@pisell/utils';
2
- interface CheckLoginParams {
3
- isLogin: boolean;
4
- openLoginModal: (params: {
5
- callback: (status: string) => void;
6
- }) => void;
7
- isFormSubject: boolean;
8
- utils: any;
9
- accountLists: any[];
10
- appointmentBooking: any;
11
- getHolders: () => void;
12
- }
13
- export declare const checkLogin: ({ isLogin, openLoginModal, isFormSubject, utils, accountLists, appointmentBooking, getHolders, }: CheckLoginParams) => Promise<boolean>;
14
- interface CheckHolderParams {
15
- isFormSubject: boolean;
16
- checkAccount: (type: string) => boolean;
17
- carts: any[];
18
- }
19
- export declare const checkHolder: ({ isFormSubject, checkAccount, carts }: CheckHolderParams) => false | any[];
20
- interface CheckResourceParams {
21
- carts: any[];
22
- resources: any[];
23
- }
24
- /**
25
- * @title: 检测资源数据
26
- * @description:
27
- * @param {CheckResourceParams} param1
28
- * @return {*}
29
- * @Author: WangHan
30
- * @Date: 2025-04-29 18:02
31
- */
32
- export declare const checkResource: ({ carts, resources }: CheckResourceParams) => false | any[];
33
- interface CheckResourceParams {
34
- carts: any[];
35
- }
36
- interface HandleFormStepParams {
37
- newCarts: any[];
38
- addStep: (params: {
39
- index: number;
40
- key: string;
41
- description: string;
42
- }) => void;
43
- removeStep: (key: string) => void;
44
- setResourceOtherParams: (params: any) => void;
45
- resourceOtherParams: any;
46
- index: number;
47
- locales: typeof locales;
48
- }
49
- export declare const handleFormStep: ({ newCarts, addStep, removeStep, setResourceOtherParams, resourceOtherParams, index, locales, }: HandleFormStepParams) => void;
50
- /**
51
- * 滚动到第一个错误卡片
52
- * @param {string} selector - 错误卡片的 class 选择器
53
- */
54
- export declare const scrollToFirstErrorCard: (selector?: string) => void;
55
- export declare type StepKey = 'select-resource' | 'fill-form' | 'select-time' | 'confirm-information' | 'select-service' | 'select-date' | 'select-guest';
56
- interface HandleResourceParams {
57
- handleCheckResource: () => boolean;
58
- newCarts: any[];
59
- locales: typeof locales;
60
- addStep: (params: {
61
- index: number;
62
- key: string;
63
- description: string;
64
- }, key?: StepKey) => void;
65
- removeStep: (key: string) => void;
66
- setResourceOtherParams: (params: any) => void;
67
- resourceOtherParams: any;
68
- currentStep: any;
69
- getResourceTimeSlot: () => void;
70
- appointmentBooking: any;
71
- onIsErrorResource?: (isError: boolean) => void;
72
- stepList: any[];
73
- }
74
- export declare const handleResource: ({ handleCheckResource, newCarts, addStep, removeStep, setResourceOtherParams, resourceOtherParams, currentStep, getResourceTimeSlot, appointmentBooking, onIsErrorResource, stepList }: HandleResourceParams) => Promise<void>;
75
- export declare const stepHandlers: Record<StepKey, (params: any) => Promise<any>>;
76
- export declare const handleContinueStep: (key: StepKey, params: any) => Promise<any>;
77
- export {};
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Layout: () => JSX.Element;
3
- export default Layout;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const CalendarDate: (props: any) => JSX.Element;
3
- export default CalendarDate;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Footer: ({ onContinue }: any) => JSX.Element;
3
- export default Footer;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Resource: () => JSX.Element;
3
- export default Resource;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const DepositModal: (props: any) => JSX.Element;
3
- export default DepositModal;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Deposit: (props: any) => JSX.Element;
3
- export default Deposit;
@@ -1,104 +0,0 @@
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
- };
17
- /**
18
- * @title: 获取商品数据
19
- * @description:
20
- * @return {*}
21
- * @Author: WangHan
22
- * @Date: 2025-04-15 11:12
23
- */
24
- export declare const useAppointmentBookingProduct: () => {
25
- checkProductType: (productId: number) => Promise<any>;
26
- getProducts: () => Promise<any>;
27
- };
28
- /**
29
- * @title: 更新购物车数据
30
- * @description:
31
- * @return {*}
32
- * @Author: WangHan
33
- * @Date: 2025-04-15 11:12
34
- */
35
- export declare const useAppointmentBookingCart: () => void;
36
- /**
37
- * @title: 获取登录状态
38
- * @description:
39
- * @return {*}
40
- * @Author: WangHan
41
- * @Date: 2025-04-15 11:14
42
- */
43
- export declare const useAppointmentBookingLogin: () => {
44
- isLogin: boolean;
45
- openLoginModal: (params: {
46
- callback: any;
47
- }) => void;
48
- };
49
- /**
50
- * @title: 获取账户
51
- * @description:
52
- * @return {*}
53
- * @Author: WangHan
54
- * @Date: 2025-04-15 11:15
55
- */
56
- export declare const useAppointmentBookingAccount: () => {
57
- accountLists: any;
58
- getHolders: () => Promise<any>;
59
- form_id: any;
60
- addAccount: (val: any, type?: string) => Promise<any>;
61
- checkAccount: (type: any) => any;
62
- };
63
- /**
64
- * @title: 获取资源数据
65
- * @description:
66
- * @return {*}
67
- * @Author: WangHan
68
- * @Date: 2025-04-15 11:29
69
- */
70
- export declare const useAppointmentBookingResource: () => {
71
- getResourceTimeSlot: (index?: number) => Promise<void>;
72
- getResourceList: () => {
73
- resources: any;
74
- resourceCodes: any;
75
- };
76
- autoSelectAllProductResources: (index?: number) => Promise<any>;
77
- };
78
- /**
79
- * @title: 是否跳过资源选择步骤
80
- * @description:
81
- * @return {*}
82
- * @Author: WangHan
83
- * @Date: 2025-04-21 11:47
84
- */
85
- export declare const useIsSkipResourceStep: () => {
86
- checkSkipResourceStep: () => Promise<boolean>;
87
- };
88
- /**
89
- * @title: 获取预约配置
90
- * @description:
91
- * @return {*}
92
- * @Author: WangHan
93
- * @Date: 2025-04-24 18:15
94
- */
95
- export declare const useAppointmentBookingSetting: () => {
96
- isDateSelectedFirst: boolean;
97
- isFormSubject: boolean;
98
- customPageId: any;
99
- getLoadAllSchedule: () => void;
100
- bookingSubject: any;
101
- setOtherData: (key: string, val: any) => any;
102
- getOtherData: (key: string) => any;
103
- formName: any;
104
- };
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const AppointmentBooking: () => JSX.Element;
3
- export default AppointmentBooking;