@pisell/private-materials 3.0.102 → 3.0.104

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.
@@ -226,10 +226,10 @@ var Info = function Info() {
226
226
  }
227
227
  lock = true;
228
228
 
229
- // 1秒后解除
229
+ // 2秒后解除
230
230
  setTimeout(function () {
231
231
  lock = false;
232
- }, 1000);
232
+ }, 2000);
233
233
  var cacheItem = _objectSpread(_objectSpread({}, item), {}, {
234
234
  product_id: item.id,
235
235
  _id: getUniqueId(),
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import "./index.less";
1
+ import React from 'react';
2
+ import './index.less';
3
3
  declare const Service: () => React.JSX.Element;
4
4
  export default Service;
@@ -1,15 +1,42 @@
1
- import React, { useEffect } from "react";
1
+ import React, { useEffect, useContext, useMemo } from 'react';
2
2
  import AddService from "./addService";
3
+ import { Context } from "../../model";
3
4
  import EditService from "./editService";
4
5
  import "./index.less";
5
6
  import ServiceList from "./serviceList";
6
7
  import AddTimeModal from "./addTimeModal";
7
8
  var Service = function Service() {
9
+ var _state$bookingConfig2, _state$bookingConfig3;
10
+ var _useContext = useContext(Context),
11
+ state = _useContext.state;
8
12
  useEffect(function () {
9
- document.body.id = "body";
13
+ document.body.id = 'body';
10
14
  }, []);
15
+ var appointment_card = useMemo(function () {
16
+ var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2;
17
+ return (state === null || state === void 0 ? void 0 : (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : (_state$bookingConfig$ = _state$bookingConfig.config) === null || _state$bookingConfig$ === void 0 ? void 0 : (_state$bookingConfig$2 = _state$bookingConfig$.information_tab) === null || _state$bookingConfig$2 === void 0 ? void 0 : _state$bookingConfig$2.appointment_card) || {
18
+ quick_time: 1
19
+ };
20
+ }, [state === null || state === void 0 ? void 0 : (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 ? void 0 : (_state$bookingConfig3 = _state$bookingConfig2.config) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.information_tab]);
21
+ var showAddTimeModal = useMemo(function () {
22
+ // event预约不需要
23
+ if (state.renderType === 'eventBooking') {
24
+ return false;
25
+ }
26
+
27
+ // 禁止编辑
28
+ if (state.disabledEdit) {
29
+ return false;
30
+ }
31
+
32
+ // 未开启加时
33
+ if (appointment_card.quick_time !== 1) {
34
+ return false;
35
+ }
36
+ return true;
37
+ }, [state, appointment_card.quick_time]);
11
38
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
12
39
  className: "pisell-lowcode__booking-service-wrap"
13
- }, /*#__PURE__*/React.createElement(ServiceList, null), /*#__PURE__*/React.createElement(AddService, null)), /*#__PURE__*/React.createElement(EditService, null), /*#__PURE__*/React.createElement(AddTimeModal, null));
40
+ }, /*#__PURE__*/React.createElement(ServiceList, null), /*#__PURE__*/React.createElement(AddService, null)), /*#__PURE__*/React.createElement(EditService, null), showAddTimeModal && /*#__PURE__*/React.createElement(AddTimeModal, null));
14
41
  };
15
42
  export default Service;
@@ -184,7 +184,7 @@ var Info = () => {
184
184
  lock = true;
185
185
  setTimeout(() => {
186
186
  lock = false;
187
- }, 1e3);
187
+ }, 2e3);
188
188
  let cacheItem = {
189
189
  ...item,
190
190
  product_id: item.id,
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import "./index.less";
1
+ import React from 'react';
2
+ import './index.less';
3
3
  declare const Service: () => React.JSX.Element;
4
4
  export default Service;
@@ -34,14 +34,35 @@ __export(service_exports, {
34
34
  module.exports = __toCommonJS(service_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_addService = __toESM(require("./addService"));
37
+ var import_model = require("../../model");
37
38
  var import_editService = __toESM(require("./editService"));
38
39
  var import_index = require("./index.less");
39
40
  var import_serviceList = __toESM(require("./serviceList"));
40
41
  var import_addTimeModal = __toESM(require("./addTimeModal"));
41
42
  var Service = () => {
43
+ var _a, _b;
44
+ const { state } = (0, import_react.useContext)(import_model.Context);
42
45
  (0, import_react.useEffect)(() => {
43
46
  document.body.id = "body";
44
47
  }, []);
45
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, /* @__PURE__ */ import_react.default.createElement(import_serviceList.default, null), /* @__PURE__ */ import_react.default.createElement(import_addService.default, null)), /* @__PURE__ */ import_react.default.createElement(import_editService.default, null), /* @__PURE__ */ import_react.default.createElement(import_addTimeModal.default, null));
48
+ const appointment_card = (0, import_react.useMemo)(() => {
49
+ var _a2, _b2, _c;
50
+ return ((_c = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.information_tab) == null ? void 0 : _c.appointment_card) || {
51
+ quick_time: 1
52
+ };
53
+ }, [(_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.information_tab]);
54
+ const showAddTimeModal = (0, import_react.useMemo)(() => {
55
+ if (state.renderType === "eventBooking") {
56
+ return false;
57
+ }
58
+ if (state.disabledEdit) {
59
+ return false;
60
+ }
61
+ if (appointment_card.quick_time !== 1) {
62
+ return false;
63
+ }
64
+ return true;
65
+ }, [state, appointment_card.quick_time]);
66
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, /* @__PURE__ */ import_react.default.createElement(import_serviceList.default, null), /* @__PURE__ */ import_react.default.createElement(import_addService.default, null)), /* @__PURE__ */ import_react.default.createElement(import_editService.default, null), showAddTimeModal && /* @__PURE__ */ import_react.default.createElement(import_addTimeModal.default, null));
46
67
  };
47
68
  var service_default = Service;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.102",
3
+ "version": "3.0.104",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",