@pisell/private-materials 3.0.46 → 3.0.47

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.
@@ -313,7 +313,7 @@ var Info = function Info() {
313
313
  return;
314
314
  }
315
315
  // 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
316
- if (state.modalOpen && !state.bookingId) {
316
+ if (state.modalOpen && !state.bookingId && state.renderType !== 'eventBooking') {
317
317
  handleSelectService();
318
318
  }
319
319
  }, [state.modalOpen, state.bookingId]);
@@ -326,6 +326,11 @@ var Info = function Info() {
326
326
  setSearch("");
327
327
  }
328
328
  }, [state.service.addModal]);
329
+ useEffect(function () {
330
+ if (state.renderType === "eventBooking" && state.modalOpen) {
331
+ getServices();
332
+ }
333
+ }, [state.renderType, state.modalOpen]);
329
334
  var addButton = useMemo(function () {
330
335
  if (state.renderType === "eventBooking") {
331
336
  return isService ? /*#__PURE__*/React.createElement("div", {
@@ -351,6 +356,7 @@ var Info = function Info() {
351
356
  }
352
357
  });
353
358
  }, [state.renderType, showAddButton, isService, state.service.value, loading]);
359
+ console.log(state.service.addModal, 'state.service.addModal');
354
360
  return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : (_state$service3$cache = _state$service3.cacheItem) === null || _state$service3$cache === void 0 ? void 0 : _state$service3$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
355
361
  loading: true,
356
362
  active: true,
@@ -1,7 +1,7 @@
1
1
  // 商品是套餐或单规格多规格
2
2
  export var getIsBundleOrCombination = function getIsBundleOrCombination(productDetail) {
3
- var _productDetail$bundle, _productDetail$option, _productDetail$varian;
4
- if (productDetail !== null && productDetail !== void 0 && (_productDetail$bundle = productDetail.bundle_group) !== null && _productDetail$bundle !== void 0 && _productDetail$bundle.length || productDetail !== null && productDetail !== void 0 && (_productDetail$option = productDetail.option_group) !== null && _productDetail$option !== void 0 && _productDetail$option.length || productDetail !== null && productDetail !== void 0 && (_productDetail$varian = productDetail.variant) !== null && _productDetail$varian !== void 0 && _productDetail$varian.length) {
3
+ var _productDetail$bundle;
4
+ if (productDetail !== null && productDetail !== void 0 && (_productDetail$bundle = productDetail.bundle_group) !== null && _productDetail$bundle !== void 0 && _productDetail$bundle.length) {
5
5
  return true;
6
6
  }
7
7
  return false;
@@ -228,7 +228,7 @@ var Info = () => {
228
228
  )) {
229
229
  return;
230
230
  }
231
- if (state.modalOpen && !state.bookingId) {
231
+ if (state.modalOpen && !state.bookingId && state.renderType !== "eventBooking") {
232
232
  handleSelectService();
233
233
  }
234
234
  }, [state.modalOpen, state.bookingId]);
@@ -241,6 +241,11 @@ var Info = () => {
241
241
  setSearch("");
242
242
  }
243
243
  }, [state.service.addModal]);
244
+ (0, import_react.useEffect)(() => {
245
+ if (state.renderType === "eventBooking" && state.modalOpen) {
246
+ getServices();
247
+ }
248
+ }, [state.renderType, state.modalOpen]);
244
249
  const addButton = (0, import_react.useMemo)(() => {
245
250
  if (state.renderType === "eventBooking") {
246
251
  return isService ? /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } }) : /* @__PURE__ */ import_react.default.createElement(
@@ -270,6 +275,7 @@ var Info = () => {
270
275
  state.service.value,
271
276
  loading
272
277
  ]);
278
+ console.log(state.service.addModal, "state.service.addModal");
273
279
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_c = (_b = state.service) == null ? void 0 : _b.cacheItem) == null ? void 0 : _c.autoClose) && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, round: true }), addButton, /* @__PURE__ */ import_react.default.createElement(
274
280
  import_drawer.default,
275
281
  {
@@ -23,8 +23,8 @@ __export(utils_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(utils_exports);
25
25
  var getIsBundleOrCombination = (productDetail) => {
26
- var _a, _b, _c;
27
- if (((_a = productDetail == null ? void 0 : productDetail.bundle_group) == null ? void 0 : _a.length) || ((_b = productDetail == null ? void 0 : productDetail.option_group) == null ? void 0 : _b.length) || ((_c = productDetail == null ? void 0 : productDetail.variant) == null ? void 0 : _c.length)) {
26
+ var _a;
27
+ if ((_a = productDetail == null ? void 0 : productDetail.bundle_group) == null ? void 0 : _a.length) {
28
28
  return true;
29
29
  }
30
30
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.46",
3
+ "version": "3.0.47",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",