@pisell/private-materials 3.0.79 → 3.0.81

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.
@@ -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 Info: () => React.JSX.Element;
4
4
  export default Info;
@@ -17,25 +17,25 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
17
17
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
18
18
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
19
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
- import React, { useContext, useEffect, useMemo, useState, useRef } from "react";
21
- import SearchLg from "@pisell/icon/es/SearchLg";
20
+ import React, { useContext, useEffect, useMemo, useState, useRef } from 'react';
21
+ import SearchLg from '@pisell/icon/es/SearchLg';
22
22
  import Drawer from "../../../components/drawer";
23
23
  import TabProduct from "../../../components/TabProduct";
24
24
  import { Context } from "../../model";
25
25
  import AddButton from "../../../components/addButton";
26
- import { Input, Skeleton } from "antd";
26
+ import { Input, Skeleton } from 'antd';
27
27
  import "./index.less";
28
28
  import useEngineContext from "../../../../../hooks/useEngineContext";
29
29
  import { getProductDetail } from "../serve";
30
30
  import { getIsBundleOrCombination } from "../../utils";
31
31
  import { getProductExtend } from "./utils";
32
32
  import { formatProductListByCategory, getProductTotalPrice, request } from "../../../utils";
33
- import { locales, getUniqueId } from "@pisell/utils";
34
- import { useUpdateEffect } from "ahooks";
35
- var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978];
33
+ import { locales, getUniqueId } from '@pisell/utils';
34
+ import { useUpdateEffect } from 'ahooks';
35
+ var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386];
36
36
  var Info = function Info() {
37
37
  var _state$service3, _state$service5, _state$service6, _state$service6$cache;
38
- var _useState = useState(""),
38
+ var _useState = useState(''),
39
39
  _useState2 = _slicedToArray(_useState, 2),
40
40
  search = _useState2[0],
41
41
  setSearch = _useState2[1];
@@ -64,7 +64,7 @@ var Info = function Info() {
64
64
  return _regeneratorRuntime().wrap(function _callee$(_context) {
65
65
  while (1) switch (_context.prev = _context.next) {
66
66
  case 0:
67
- if (!(state.renderType !== "eventBooking")) {
67
+ if (!(state.renderType !== 'eventBooking')) {
68
68
  _context.next = 2;
69
69
  break;
70
70
  }
@@ -93,7 +93,7 @@ var Info = function Info() {
93
93
  product = list[0];
94
94
  _context.next = 13;
95
95
  return getProductDetail(product.id, {
96
- schedule_date: state.date.value.format("YYYY-MM-DD")
96
+ schedule_date: state.date.value.format('YYYY-MM-DD')
97
97
  });
98
98
  case 13:
99
99
  detail = _context.sent;
@@ -115,7 +115,7 @@ var Info = function Info() {
115
115
  start_date: state.date.value,
116
116
  startDate: state.date.value,
117
117
  endDate: state.date.value,
118
- start_time: "00:00:00",
118
+ start_time: '00:00:00',
119
119
  duration: 10,
120
120
  quantity: 1,
121
121
  price: product.price,
@@ -126,7 +126,7 @@ var Info = function Info() {
126
126
  });
127
127
  _list.push(_item);
128
128
  dispatch({
129
- type: "setService",
129
+ type: 'setService',
130
130
  payload: {
131
131
  value: _list,
132
132
  edit: true
@@ -154,12 +154,12 @@ var Info = function Info() {
154
154
  return state.apis.getServices({
155
155
  skip: 1,
156
156
  num: 500,
157
- extension_type: state.renderType === "eventBooking" ? undefined : ["product_appointment", "appointment_ticket"],
158
- with: ["category"],
159
- ids: state.renderType === "eventBooking" ? (_state$eventOtherPara = state.eventOtherParams) === null || _state$eventOtherPara === void 0 ? void 0 : _state$eventOtherPara.productIds : undefined,
157
+ extension_type: state.renderType === 'eventBooking' ? undefined : ['product_appointment', 'appointment_ticket'],
158
+ with: ['category'],
159
+ ids: state.renderType === 'eventBooking' ? (_state$eventOtherPara = state.eventOtherParams) === null || _state$eventOtherPara === void 0 ? void 0 : _state$eventOtherPara.productIds : undefined,
160
160
  open_quotation: 1,
161
161
  with_schedule: 1,
162
- with_count: ["bundleGroup", "optionGroup"],
162
+ with_count: ['bundleGroup', 'optionGroup'],
163
163
  _config: {
164
164
  useCache: true
165
165
  }
@@ -173,7 +173,7 @@ var Info = function Info() {
173
173
  setDefaultService(data === null || data === void 0 ? void 0 : data.list);
174
174
  }
175
175
  dispatch({
176
- type: "setService",
176
+ type: 'setService',
177
177
  payload: {
178
178
  services: (data === null || data === void 0 ? void 0 : data.list) || []
179
179
  }
@@ -190,7 +190,7 @@ var Info = function Info() {
190
190
  }();
191
191
  var handleSelectService = function handleSelectService() {
192
192
  dispatch({
193
- type: "setService",
193
+ type: 'setService',
194
194
  payload: {
195
195
  addModal: true
196
196
  }
@@ -204,12 +204,12 @@ var Info = function Info() {
204
204
  };
205
205
  var handleSelectProduct = function handleSelectProduct(item, type) {
206
206
  // 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
207
- var isEject = type === "detail" || item.bundle_group_count > 0;
207
+ var isEject = type === 'detail' || item.bundle_group_count > 0;
208
208
  state.action({
209
- type: "pisell1.handleOpenProductModal",
209
+ type: 'pisell1.handleOpenProductModal',
210
210
  data: {
211
211
  id: item.id,
212
- date: state.date.value.format("YYYY-MM-DD"),
212
+ date: state.date.value.format('YYYY-MM-DD'),
213
213
  showConfig: {
214
214
  option: false,
215
215
  session: false,
@@ -247,14 +247,14 @@ var Info = function Info() {
247
247
  cacheItem: cacheItem,
248
248
  state: state
249
249
  });
250
- if (state.renderType === "eventBooking") {
250
+ if (state.renderType === 'eventBooking') {
251
251
  cacheItem.autoClose = false;
252
252
  } else {
253
253
  var _state$service;
254
254
  cacheItem.autoClose = !_isEdit && (cacheItem._extend.resource || cacheItem._extend.resource === 0 || (((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.resourcesOrigin) || []).length === 1);
255
255
  }
256
256
  dispatch({
257
- type: "setService",
257
+ type: 'setService',
258
258
  payload: {
259
259
  editModal: true,
260
260
  cacheItem: cacheItem,
@@ -264,7 +264,7 @@ var Info = function Info() {
264
264
  }
265
265
  });
266
266
  };
267
- console.log("state.service.cacheItem", state.service.cacheItem);
267
+ console.log('state.service.cacheItem', state.service.cacheItem);
268
268
  var renderList = useMemo(function () {
269
269
  var _state$service2;
270
270
  var _list = ((_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.services) || [];
@@ -287,7 +287,7 @@ var Info = function Info() {
287
287
  }
288
288
 
289
289
  // 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
290
- if (state.modalOpen && !state.bookingId && state.renderType !== "eventBooking" && ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$value = _state$service4.value) === null || _state$service4$value === void 0 ? void 0 : _state$service4$value.length) === 0) {
290
+ if (state.modalOpen && !state.bookingId && state.renderType !== 'eventBooking' && ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$value = _state$service4.value) === null || _state$service4$value === void 0 ? void 0 : _state$service4$value.length) === 0) {
291
291
  handleSelectService();
292
292
  }
293
293
  }, [state.modalOpen, state.bookingId, (_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value]);
@@ -297,16 +297,16 @@ var Info = function Info() {
297
297
  useUpdateEffect(function () {
298
298
  if (state.service.addModal) {
299
299
  getServices();
300
- setSearch("");
300
+ setSearch('');
301
301
  }
302
302
  }, [state.service.addModal]);
303
303
  useEffect(function () {
304
- if (state.renderType === "eventBooking" && state.modalOpen) {
304
+ if (state.renderType === 'eventBooking' && state.modalOpen) {
305
305
  getServices();
306
306
  }
307
307
  }, [state.renderType, state.modalOpen]);
308
308
  var addButton = useMemo(function () {
309
- if (state.renderType === "eventBooking") {
309
+ if (state.renderType === 'eventBooking') {
310
310
  return isService ? /*#__PURE__*/React.createElement("div", {
311
311
  style: {
312
312
  height: 20
@@ -314,15 +314,15 @@ var Info = function Info() {
314
314
  }) : /*#__PURE__*/React.createElement(AddButton, {
315
315
  loading: loading,
316
316
  showSub: false,
317
- title: locales.getText("pisell2.text.add-a-service"),
318
- subTitle: locales.getText("pisell2.text.add-another-service"),
317
+ title: locales.getText('pisell2.text.add-a-service'),
318
+ subTitle: locales.getText('pisell2.text.add-another-service'),
319
319
  onClick: handleSelectService
320
320
  });
321
321
  }
322
322
  return showAddButton ? /*#__PURE__*/React.createElement(AddButton, {
323
323
  showSub: isService,
324
- title: locales.getText("pisell2.text.add-a-service"),
325
- subTitle: locales.getText("pisell2.text.add-another-service"),
324
+ title: locales.getText('pisell2.text.add-a-service'),
325
+ subTitle: locales.getText('pisell2.text.add-another-service'),
326
326
  onClick: handleSelectService
327
327
  }) : /*#__PURE__*/React.createElement("div", {
328
328
  style: {
@@ -336,11 +336,11 @@ var Info = function Info() {
336
336
  round: true
337
337
  }), addButton, /*#__PURE__*/React.createElement(Drawer, {
338
338
  open: state.service.addModal,
339
- title: locales.getText("pisell2.text.select-service"),
339
+ title: locales.getText('pisell2.text.select-service'),
340
340
  rootClassName: "booking-server-wrap",
341
341
  onClose: function onClose() {
342
342
  dispatch({
343
- type: "setService",
343
+ type: 'setService',
344
344
  payload: {
345
345
  addModal: false
346
346
  }
@@ -355,7 +355,7 @@ var Info = function Info() {
355
355
  marginTop: 16,
356
356
  height: 44
357
357
  },
358
- placeholder: locales.getText("pisell2.text.search"),
358
+ placeholder: locales.getText('pisell2.text.search'),
359
359
  allowClear: true,
360
360
  value: search,
361
361
  onChange: function onChange(e) {
@@ -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 Info: () => React.JSX.Element;
4
4
  export default Info;
@@ -58,7 +58,8 @@ var shopList = [
58
58
  6087,
59
59
  6303,
60
60
  6080,
61
- 6978
61
+ 6978,
62
+ 7386
62
63
  ];
63
64
  var Info = () => {
64
65
  var _a, _b, _c, _d;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.79",
3
+ "version": "3.0.81",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,7 +59,7 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "@pisell/utils": "1.0.25",
62
- "@pisell/icon": "0.0.8",
62
+ "@pisell/icon": "0.0.11",
63
63
  "@pisell/date-picker": "1.0.74"
64
64
  },
65
65
  "peerDependencies": {