@pisell/private-materials 6.3.18 → 6.3.19

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 (123) 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 +150 -150
  7. package/build/lowcode/render/default/view.js +1 -1
  8. package/build/lowcode/view.js +8 -8
  9. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  10. package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
  11. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  12. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  13. package/es/components/appointmentBooking/hooks.js +6 -0
  14. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  15. package/es/components/booking/components/reloadResourceModal/index.d.ts +8 -0
  16. package/es/components/booking/components/voucher/index.d.ts +3 -0
  17. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  18. package/es/components/booking/info/service/editService/constants.d.ts +1 -0
  19. package/es/components/booking/info/service/editService/index.d.ts +7 -0
  20. package/es/components/booking/info/service/like/index.d.ts +0 -1
  21. package/es/components/booking/info2/index.d.ts +12 -0
  22. package/es/components/booking/info2/service/addService/index.d.ts +11 -0
  23. package/es/components/booking/locales.d.ts +837 -0
  24. package/es/components/booking/locales.js +12 -0
  25. package/es/components/booking/model.d.ts +116 -0
  26. package/es/components/eftpos/deviceList/index.d.ts +0 -1
  27. package/es/components/eftpos/group/index.d.ts +0 -1
  28. package/es/components/eftpos/icon/apiKey.d.ts +0 -1
  29. package/es/components/eftpos/icon/device.d.ts +0 -1
  30. package/es/components/eftpos/receipt/index.d.ts +0 -1
  31. package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
  32. package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
  33. package/es/components/eftposPay/component/step/index.d.ts +0 -1
  34. package/es/components/eftposPay/component/step/step.d.ts +0 -1
  35. package/es/components/eftposPay/hooks.d.ts +1 -1
  36. package/es/components/eftposPay/store/index.d.ts +1 -1
  37. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  38. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  39. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  40. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  41. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  42. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  43. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  44. package/es/components/pay/toC/PaymentMethods/ApplePay/index.d.ts +10 -0
  45. package/es/components/pay/toC/PaymentMethods/BankDeposit/index.d.ts +10 -0
  46. package/es/components/pay/toC/PaymentMethods/CashManual/index.d.ts +10 -0
  47. package/es/components/pay/toC/PaymentMethods/CustomPayment/index.d.ts +10 -0
  48. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +10 -0
  49. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +10 -0
  50. package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.d.ts +10 -0
  51. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +10 -0
  52. package/es/components/pay/toC/PaymentMethods/GooglePay/index.d.ts +9 -0
  53. package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.d.ts +10 -0
  54. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  55. package/es/components/pay/toC/PaymentMethods/StripePay/index.d.ts +10 -0
  56. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +10 -0
  57. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +10 -0
  58. package/es/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  59. package/es/components/pay/toC/index.d.ts +3 -0
  60. package/es/components/schedules/utils.d.ts +1 -1
  61. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  62. package/es/components/ticketBooking/index.d.ts +7 -0
  63. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  64. package/es/hooks/usePaymentLogger.d.ts +22 -0
  65. package/es/utils/index.d.ts +1 -1
  66. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  67. package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
  68. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  69. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  70. package/lib/components/appointmentBooking/hooks.js +6 -0
  71. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  72. package/lib/components/booking/components/reloadResourceModal/index.d.ts +8 -0
  73. package/lib/components/booking/components/voucher/index.d.ts +3 -0
  74. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  75. package/lib/components/booking/info/service/editService/constants.d.ts +1 -0
  76. package/lib/components/booking/info/service/editService/index.d.ts +7 -0
  77. package/lib/components/booking/info/service/like/index.d.ts +0 -1
  78. package/lib/components/booking/info2/index.d.ts +12 -0
  79. package/lib/components/booking/info2/service/addService/index.d.ts +11 -0
  80. package/lib/components/booking/locales.d.ts +837 -0
  81. package/lib/components/booking/locales.js +6 -0
  82. package/lib/components/booking/model.d.ts +116 -0
  83. package/lib/components/eftpos/deviceList/index.d.ts +0 -1
  84. package/lib/components/eftpos/group/index.d.ts +0 -1
  85. package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
  86. package/lib/components/eftpos/icon/device.d.ts +0 -1
  87. package/lib/components/eftpos/receipt/index.d.ts +0 -1
  88. package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
  89. package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
  90. package/lib/components/eftposPay/component/step/index.d.ts +0 -1
  91. package/lib/components/eftposPay/component/step/step.d.ts +0 -1
  92. package/lib/components/eftposPay/hooks.d.ts +1 -1
  93. package/lib/components/eftposPay/store/index.d.ts +1 -1
  94. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  95. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  96. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  97. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  98. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  99. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  100. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  101. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.d.ts +10 -0
  102. package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.d.ts +10 -0
  103. package/lib/components/pay/toC/PaymentMethods/CashManual/index.d.ts +10 -0
  104. package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.d.ts +10 -0
  105. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +10 -0
  106. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +10 -0
  107. package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.d.ts +10 -0
  108. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +10 -0
  109. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.d.ts +9 -0
  110. package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.d.ts +10 -0
  111. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  112. package/lib/components/pay/toC/PaymentMethods/StripePay/index.d.ts +10 -0
  113. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +10 -0
  114. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +10 -0
  115. package/lib/components/pay/toC/PaymentMethods/index.d.ts +9 -0
  116. package/lib/components/pay/toC/index.d.ts +3 -0
  117. package/lib/components/schedules/utils.d.ts +1 -1
  118. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  119. package/lib/components/ticketBooking/index.d.ts +7 -0
  120. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  121. package/lib/hooks/usePaymentLogger.d.ts +22 -0
  122. package/lib/utils/index.d.ts +1 -1
  123. package/package.json +3 -3
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const GuestOptionsModal: (props: any) => JSX.Element;
4
3
  export default GuestOptionsModal;
@@ -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;
@@ -99,7 +99,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
99
99
  },
100
100
  callback: function () {
101
101
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
102
- var product, session, startDate, endDate, _data$origin, resources, activeStatus, index, stepList, hasResourceStep, description;
102
+ var product, res, session, startDate, endDate, _res, _data$origin, resources, activeStatus, _res2, index, stepList, hasResourceStep, description;
103
103
  return _regeneratorRuntime().wrap(function _callee$(_context) {
104
104
  while (1) switch (_context.prev = _context.next) {
105
105
  case 0:
@@ -117,7 +117,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
117
117
 
118
118
  // 零售模版,直接加入购物车
119
119
  if (!isRetailTemplate) {
120
- _context.next = 10;
120
+ _context.next = 12;
121
121
  break;
122
122
  }
123
123
  if (!(data !== null && data !== void 0 && data.isCancel)) {
@@ -126,51 +126,69 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
126
126
  }
127
127
  return _context.abrupt("return");
128
128
  case 8:
129
- appointmentBooking.storeProduct(product);
129
+ res = appointmentBooking.storeProduct(product);
130
+ if (!(!res.success && res.errorCode === 'not_enough_stock')) {
131
+ _context.next = 11;
132
+ break;
133
+ }
134
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
135
+ case 11:
130
136
  return _context.abrupt("return");
131
- case 10:
137
+ case 12:
132
138
  session = data === null || data === void 0 ? void 0 : data.session;
133
139
  if (!session) {
134
- _context.next = 19;
140
+ _context.next = 24;
135
141
  break;
136
142
  }
137
143
  startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
138
144
  endDate = dayjs(session === null || session === void 0 ? void 0 : session.end_at).format('YYYY-MM-DD');
139
- appointmentBooking.addProductToCart({
145
+ _res = appointmentBooking.addProductToCart({
140
146
  product: _objectSpread({}, product),
141
147
  date: {
142
148
  startTime: "".concat(startDate, " ").concat(session === null || session === void 0 ? void 0 : session.start_time),
143
149
  endTime: "".concat(endDate, " ").concat(session === null || session === void 0 ? void 0 : session.end_time)
144
150
  }
145
151
  });
146
- _context.next = 17;
152
+ if (!(!_res.success && _res.errorCode === 'not_enough_stock')) {
153
+ _context.next = 19;
154
+ break;
155
+ }
156
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
157
+ case 19:
158
+ appointmentBooking.closeProductDetail();
159
+ _context.next = 22;
147
160
  return appointmentBooking.getAvailableDate({
148
161
  startDate: startDate,
149
162
  endDate: endDate
150
163
  });
151
- case 17:
152
- _context.next = 27;
164
+ case 22:
165
+ _context.next = 34;
153
166
  break;
154
- case 19:
167
+ case 24:
155
168
  resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
156
169
  activeStatus = resources.find(function (item) {
157
170
  return item.status === 1;
158
171
  });
159
172
  if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
160
- _context.next = 23;
173
+ _context.next = 28;
161
174
  break;
162
175
  }
163
176
  return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
164
- case 23:
165
- appointmentBooking.storeProduct(product);
166
- // duration 类型的商品,要获取一下资源,在先选日期的 duration 步骤里目前只能通过这个动作拉取
177
+ case 28:
178
+ _res2 = appointmentBooking.storeProduct(product);
179
+ if (!(!_res2.success && _res2.errorCode === 'not_enough_stock')) {
180
+ _context.next = 31;
181
+ break;
182
+ }
183
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
184
+ case 31:
167
185
  if (!(type === 'duration')) {
168
- _context.next = 27;
186
+ _context.next = 34;
169
187
  break;
170
188
  }
171
- _context.next = 27;
189
+ _context.next = 34;
172
190
  return appointmentBooking.getAvailableDate();
173
- case 27:
191
+ case 34:
174
192
  appointmentBooking.closeProductDetail();
175
193
 
176
194
  // 先选择日期流程
@@ -199,7 +217,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
199
217
  removeStep('select-time');
200
218
  }
201
219
  }
202
- case 29:
220
+ case 36:
203
221
  case "end":
204
222
  return _context.stop();
205
223
  }
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const DepositModal: (props: any) => JSX.Element;
3
+ export default DepositModal;
@@ -206,6 +206,12 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
206
206
  if (!result) {
207
207
  return Toast(locales.getText('pisell2.appointment.unuse.date'));
208
208
  }
209
+ var capacityResult = appointmentBooking.checkMaxDurationCapacity();
210
+ if (!capacityResult.success) {
211
+ var getMessage = locales.getText('pisell2.appointment.unuse.capacity');
212
+ var message = typeof getMessage === 'function' ? getMessage(capacityResult.minAvailableCount) : getMessage;
213
+ return Toast(message);
214
+ }
209
215
  }
210
216
  if (!isRetailTemplate && currentKey !== null && currentKey !== void 0 && currentKey.startsWith('select-resource')) {
211
217
  var _currentSelectedResou;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const FormItemChildrenWrap: (props: any) => JSX.Element;
3
2
  export default FormItemChildrenWrap;
@@ -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;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
3
2
  export default useIsLowSpeedNetwork;
@@ -0,0 +1 @@
1
+ export declare const getIsPartyRoomResourceShop: (id: number) => boolean;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface EditServiceRef {
4
+ init: (cacheItem?: any, open?: boolean, openEditProduct?: boolean) => void;
5
+ }
6
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
7
+ export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Like: ({ status, onChange, className, style, }: {
4
3
  style?: any;
@@ -0,0 +1,12 @@
1
+ import '../info/index.less';
2
+ export interface InfoProps {
3
+ style: any;
4
+ globalState: any;
5
+ callback: any;
6
+ setGlobalState: any;
7
+ modules: any;
8
+ slot: any;
9
+ setState: any;
10
+ }
11
+ declare const Info: any;
12
+ export default Info;
@@ -0,0 +1,11 @@
1
+ import { PisellDrawerProps } from '../../../components/drawer';
2
+ import '../../../info/service/addService/index.less';
3
+ interface AddServiceProps {
4
+ onEdit: any;
5
+ dispatch?: any;
6
+ state?: any;
7
+ drawerProps?: PisellDrawerProps;
8
+ renderMode?: 'current' | 'drawer';
9
+ }
10
+ declare const Info: (props: AddServiceProps) => JSX.Element;
11
+ export default Info;