@pisell/private-materials 3.0.15 → 3.0.16

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 (33) 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 +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/booking/components/TabProduct/tabs/index.less +4 -1
  12. package/es/components/booking/components/footer/index.js +4 -1
  13. package/es/components/booking/info/service/addService/index.js +96 -49
  14. package/es/components/booking/info/service/serve.d.ts +1 -0
  15. package/es/components/booking/info/service/serve.js +21 -0
  16. package/es/components/booking/info/utils.d.ts +1 -0
  17. package/es/components/booking/info/utils.js +8 -0
  18. package/es/components/booking/utils.d.ts +15 -0
  19. package/es/components/booking/utils.js +22 -0
  20. package/es/components/productExtension/fields/SelectResourcesTable/index.js +2 -1
  21. package/es/components/productExtension/locales.js +5 -5
  22. package/lib/components/booking/components/TabProduct/tabs/index.less +4 -1
  23. package/lib/components/booking/components/footer/index.js +3 -0
  24. package/lib/components/booking/info/service/addService/index.js +14 -1
  25. package/lib/components/booking/info/service/serve.d.ts +1 -0
  26. package/lib/components/booking/info/service/serve.js +30 -0
  27. package/lib/components/booking/info/utils.d.ts +1 -0
  28. package/lib/components/booking/info/utils.js +35 -0
  29. package/lib/components/booking/utils.d.ts +15 -0
  30. package/lib/components/booking/utils.js +14 -0
  31. package/lib/components/productExtension/fields/SelectResourcesTable/index.js +1 -1
  32. package/lib/components/productExtension/locales.js +5 -5
  33. package/package.json +3 -3
@@ -43,7 +43,10 @@
43
43
  }
44
44
 
45
45
  .booking-pisell-tabs-btn-left {
46
- transform: rotate(180deg);
46
+ .booking-pisell-tabs-btn-icon {
47
+ transform: rotate(180deg);
48
+
49
+ }
47
50
  }
48
51
 
49
52
  .booking-pisell-tabs-btn-right {
@@ -317,8 +317,11 @@ var Footer = function Footer(props) {
317
317
  _context4.prev = 30;
318
318
  _context4.t1 = _context4["catch"](13);
319
319
  console.log(_context4.t1);
320
+ if ((_context4.t1 === null || _context4.t1 === void 0 ? void 0 : _context4.t1.code) === 70101) {
321
+ message.error(_context4.t1 === null || _context4.t1 === void 0 ? void 0 : _context4.t1.message);
322
+ }
320
323
  _setLoading(false);
321
- case 34:
324
+ case 35:
322
325
  case "end":
323
326
  return _context4.stop();
324
327
  }
@@ -1,7 +1,5 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -11,6 +9,8 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
11
9
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
10
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
13
11
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
13
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
14
14
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
15
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
16
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -25,8 +25,11 @@ import { Context } from "../../model";
25
25
  import AddButton from "../../../components/addButton";
26
26
  import { Input } from "antd";
27
27
  import "./index.less";
28
- import { formatProductListByCategory } from "../../../utils";
28
+ import { formatProductListByCategory, request } from "../../../utils";
29
29
  import { locales, getUniqueId } from "@pisell/utils";
30
+ import useEngineContext from "../../../../../hooks/useEngineContext";
31
+ import { getProductDetail } from "../serve";
32
+ import { getIsBundleOrCombination } from "../../utils";
30
33
  var Info = function Info() {
31
34
  var _state$service2;
32
35
  var _useState = useState(""),
@@ -36,52 +39,96 @@ var Info = function Info() {
36
39
  var _useContext = useContext(Context),
37
40
  state = _useContext.state,
38
41
  dispatch = _useContext.dispatch;
39
- var setDefaultService = function setDefaultService(list) {
40
- if (state.renderType !== "eventBooking") {
41
- return;
42
- }
43
- if (state.bookingId) {
44
- return;
45
- }
46
- if (list.length !== 1) {
47
- return;
48
- }
49
- var _list = _toConsumableArray(state.service.value);
50
- if (_list.length !== 0) {
51
- return;
52
- }
53
- var product = list[0];
54
- var _item = _objectSpread(_objectSpread({}, product), {}, {
55
- product_id: product.id,
56
- _id: getUniqueId(),
57
- _extend: {
58
- start_date: state.date.value,
59
- startDate: state.date.value,
60
- endDate: state.date.value,
61
- start_time: "00:00:00",
62
- duration: 10,
63
- quantity: 1,
64
- price: product.price,
65
- product_name: product.title
66
- }
67
- });
68
- _list.push(_item);
69
- dispatch({
70
- type: "setService",
71
- payload: {
72
- value: _list,
73
- edit: true
74
- }
75
- });
76
- };
42
+ var context = useEngineContext();
43
+ request.setRequest(context.appHelper.utils.request);
44
+ var setDefaultService = /*#__PURE__*/function () {
45
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(list) {
46
+ var _list, product, detail, isBundleOrCombination, _item;
47
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
48
+ while (1) switch (_context.prev = _context.next) {
49
+ case 0:
50
+ if (!(state.renderType !== "eventBooking")) {
51
+ _context.next = 2;
52
+ break;
53
+ }
54
+ return _context.abrupt("return");
55
+ case 2:
56
+ if (!state.bookingId) {
57
+ _context.next = 4;
58
+ break;
59
+ }
60
+ return _context.abrupt("return");
61
+ case 4:
62
+ if (!(list.length !== 1)) {
63
+ _context.next = 6;
64
+ break;
65
+ }
66
+ return _context.abrupt("return");
67
+ case 6:
68
+ _list = _toConsumableArray(state.service.value);
69
+ if (!(_list.length !== 0)) {
70
+ _context.next = 9;
71
+ break;
72
+ }
73
+ return _context.abrupt("return");
74
+ case 9:
75
+ product = list[0];
76
+ _context.next = 12;
77
+ return getProductDetail(product.id, {
78
+ schedule_date: state.date.value.format("YYYY-MM-DD")
79
+ });
80
+ case 12:
81
+ detail = _context.sent;
82
+ // 商品是套餐或单规格多规格
83
+ isBundleOrCombination = getIsBundleOrCombination(detail.data); // 套餐商品单规格多规格不设置默认
84
+ if (!isBundleOrCombination) {
85
+ _context.next = 16;
86
+ break;
87
+ }
88
+ return _context.abrupt("return");
89
+ case 16:
90
+ _item = _objectSpread(_objectSpread({}, product), {}, {
91
+ product_id: product.id,
92
+ _id: getUniqueId(),
93
+ _extend: {
94
+ start_date: state.date.value,
95
+ startDate: state.date.value,
96
+ endDate: state.date.value,
97
+ start_time: "00:00:00",
98
+ duration: 10,
99
+ quantity: 1,
100
+ price: product.price,
101
+ total: product.price,
102
+ origin_total: product.price,
103
+ product_name: product.title
104
+ }
105
+ });
106
+ _list.push(_item);
107
+ dispatch({
108
+ type: "setService",
109
+ payload: {
110
+ value: _list,
111
+ edit: true
112
+ }
113
+ });
114
+ case 19:
115
+ case "end":
116
+ return _context.stop();
117
+ }
118
+ }, _callee);
119
+ }));
120
+ return function setDefaultService(_x2) {
121
+ return _ref.apply(this, arguments);
122
+ };
123
+ }();
77
124
  var getServices = /*#__PURE__*/function () {
78
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
125
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
79
126
  var _state$eventOtherPara;
80
127
  var data;
81
- return _regeneratorRuntime().wrap(function _callee$(_context) {
82
- while (1) switch (_context.prev = _context.next) {
128
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
129
+ while (1) switch (_context2.prev = _context2.next) {
83
130
  case 0:
84
- _context.next = 2;
131
+ _context2.next = 2;
85
132
  return state.apis.getServices({
86
133
  skip: 1,
87
134
  num: 500,
@@ -96,7 +143,7 @@ var Info = function Info() {
96
143
  with_schedule: 0
97
144
  });
98
145
  case 2:
99
- data = _context.sent;
146
+ data = _context2.sent;
100
147
  setDefaultService(data === null || data === void 0 ? void 0 : data.list);
101
148
  dispatch({
102
149
  type: "setService",
@@ -106,12 +153,12 @@ var Info = function Info() {
106
153
  });
107
154
  case 5:
108
155
  case "end":
109
- return _context.stop();
156
+ return _context2.stop();
110
157
  }
111
- }, _callee);
158
+ }, _callee2);
112
159
  }));
113
160
  return function getServices() {
114
- return _ref.apply(this, arguments);
161
+ return _ref2.apply(this, arguments);
115
162
  };
116
163
  }();
117
164
  var handleSelectService = function handleSelectService() {
@@ -0,0 +1 @@
1
+ export declare const getProductDetail: (id: string, params: any) => Promise<any>;
@@ -0,0 +1,21 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ import { request } from "../../utils";
6
+ export var getProductDetail = /*#__PURE__*/function () {
7
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id, params) {
8
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9
+ while (1) switch (_context.prev = _context.next) {
10
+ case 0:
11
+ return _context.abrupt("return", request.getRequest().get("/shop/product/query/".concat(id), params));
12
+ case 1:
13
+ case "end":
14
+ return _context.stop();
15
+ }
16
+ }, _callee);
17
+ }));
18
+ return function getProductDetail(_x, _x2) {
19
+ return _ref.apply(this, arguments);
20
+ };
21
+ }();
@@ -0,0 +1 @@
1
+ export declare const getIsBundleOrCombination: (productDetail: any) => boolean;
@@ -0,0 +1,8 @@
1
+ // 商品是套餐或单规格多规格
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) {
5
+ return true;
6
+ }
7
+ return false;
8
+ };
@@ -1,4 +1,18 @@
1
1
  import dayjs from 'dayjs';
2
+ declare type RType = (url: string, data?: {} | undefined, config?: {} | undefined) => Promise<any>;
3
+ declare class Request {
4
+ private request;
5
+ constructor();
6
+ setRequest(val: any): void;
7
+ getRequest(): {
8
+ get: RType;
9
+ post: RType;
10
+ put: RType;
11
+ remove: RType;
12
+ custom: RType;
13
+ };
14
+ }
15
+ export declare const request: Request;
2
16
  export declare const getDiscountTime: (service_times: number) => string;
3
17
  export declare const sliceDayIntoFiveMinutes: (config: any, locale: string) => {
4
18
  timeSlices: {
@@ -95,3 +109,4 @@ export declare const getDuration: (duration: number | {
95
109
  value: number;
96
110
  } | "flexible";
97
111
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
112
+ export {};
@@ -7,12 +7,34 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
7
7
  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; }
8
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
13
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
14
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
15
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
16
  import dayjs from 'dayjs';
14
17
  import { locales } from "@pisell/utils";
15
18
  import { intersectionBy } from 'lodash';
19
+ var Request = /*#__PURE__*/function () {
20
+ function Request() {
21
+ _classCallCheck(this, Request);
22
+ _defineProperty(this, "request", {});
23
+ }
24
+ _createClass(Request, [{
25
+ key: "setRequest",
26
+ value: function setRequest(val) {
27
+ this.request = val;
28
+ }
29
+ }, {
30
+ key: "getRequest",
31
+ value: function getRequest() {
32
+ return this.request;
33
+ }
34
+ }]);
35
+ return Request;
36
+ }();
37
+ export var request = new Request();
16
38
  export var getDiscountTime = function getDiscountTime(service_times) {
17
39
  if (!service_times) {
18
40
  return "";
@@ -47,7 +47,8 @@ var SelectResourcesTable = function SelectResourcesTable(_ref) {
47
47
  _getFormTypes = getFormTypes({
48
48
  type: "manual",
49
49
  num: 500,
50
- skip: 1
50
+ skip: 1,
51
+ status: "published"
51
52
  }, {
52
53
  useCache: true
53
54
  });
@@ -1,8 +1,8 @@
1
1
  export default {
2
2
  "en": {
3
3
  'pisell2.text.product-extension.please-select': "Please select",
4
- 'pisell2.text.product-extension.cut-off-time': 'Cut-off time',
5
- 'pisell2.text.product-extension.cut-off-time.desc': 'How long can I make an appointment before the event.Must be less than 168 hours',
4
+ 'pisell2.text.product-extension.cut-off-time': 'Cut-off Time',
5
+ 'pisell2.text.product-extension.cut-off-time.desc': 'Use this setting to prevent last minute events. For example: you can prevent same day booking (set 1 day) or prevent events less than 6 hours away.',
6
6
  'pisell2.text.product-extension.future-day': 'Future Day',
7
7
  'pisell2.text.product-extension.future-day.hint': 'The maximum number of days in the future that customers can book',
8
8
  'pisell2.text.product-extension.days': 'Days',
@@ -12,12 +12,12 @@ export default {
12
12
  'pisell2.text.product-extension.add-other-product': 'Add Other Product',
13
13
  'pisell2.text.product-extension.resource-type': 'Resource Type',
14
14
  'pisell2.text.product-extension.open': 'Open',
15
- 'pisell2.text.product-extension.options': 'Options'
15
+ 'pisell2.text.product-extension.options': 'Items'
16
16
  },
17
17
  'zh-CN': {
18
18
  'pisell2.text.product-extension.please-select': "请选择",
19
19
  'pisell2.text.product-extension.cut-off-time': '截止时间',
20
- 'pisell2.text.product-extension.cut-off-time.desc': '用于配置活动开始前多久停止预约(最大设置168小时)',
20
+ 'pisell2.text.product-extension.cut-off-time.desc': '使用此设置可防止最后一分钟的事件。 例如:您可以阻止当天预订(设置为 1 天)或阻止距离不到 6 小时的活动。',
21
21
  'pisell2.text.product-extension.future-day': '预定天数',
22
22
  'pisell2.text.product-extension.future-day.hint': '客户未来最多可预订天数',
23
23
  'pisell2.text.product-extension.days': '天',
@@ -32,7 +32,7 @@ export default {
32
32
  'zh-HK': {
33
33
  'pisell2.text.product-extension.please-select': "請選擇",
34
34
  'pisell2.text.product-extension.cut-off-time': '截止时间',
35
- 'pisell2.text.product-extension.cut-off-time.desc': '用於配置活動開始前多久停止預約(最大設置168小時)',
35
+ 'pisell2.text.product-extension.cut-off-time.desc': '使用此設置可防止最後一分鐘的事件。例如:您可以阻止當天預訂(設置為 1 天)或阻止距離不到 6 小時的活動。',
36
36
  'pisell2.text.product-extension.future-day': '預定天數',
37
37
  'pisell2.text.product-extension.future-day.hint': '客戶未來最多可預訂天數',
38
38
  'pisell2.text.product-extension.days': '天',
@@ -43,7 +43,10 @@
43
43
  }
44
44
 
45
45
  .booking-pisell-tabs-btn-left {
46
- transform: rotate(180deg);
46
+ .booking-pisell-tabs-btn-icon {
47
+ transform: rotate(180deg);
48
+
49
+ }
47
50
  }
48
51
 
49
52
  .booking-pisell-tabs-btn-right {
@@ -171,6 +171,9 @@ var Footer = (props) => {
171
171
  return callbackData;
172
172
  } catch (err) {
173
173
  console.log(err);
174
+ if ((err == null ? void 0 : err.code) === 70101) {
175
+ import_antd.message.error(err == null ? void 0 : err.message);
176
+ }
174
177
  _setLoading(false);
175
178
  }
176
179
  };
@@ -42,11 +42,16 @@ var import_antd = require("antd");
42
42
  var import_index = require("./index.less");
43
43
  var import_utils = require("../../../utils");
44
44
  var import_utils2 = require("@pisell/utils");
45
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
46
+ var import_serve = require("../serve");
47
+ var import_utils3 = require("../../utils");
45
48
  var Info = () => {
46
49
  var _a;
47
50
  const [search, setSearch] = (0, import_react.useState)("");
48
51
  const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
49
- const setDefaultService = (list) => {
52
+ const context = (0, import_useEngineContext.default)();
53
+ import_utils.request.setRequest(context.appHelper.utils.request);
54
+ const setDefaultService = async (list) => {
50
55
  if (state.renderType !== "eventBooking") {
51
56
  return;
52
57
  }
@@ -61,6 +66,12 @@ var Info = () => {
61
66
  return;
62
67
  }
63
68
  let product = list[0];
69
+ const detail = await (0, import_serve.getProductDetail)(product.id, {
70
+ schedule_date: state.date.value.format("YYYY-MM-DD")
71
+ });
72
+ const isBundleOrCombination = (0, import_utils3.getIsBundleOrCombination)(detail.data);
73
+ if (isBundleOrCombination)
74
+ return;
64
75
  let _item = {
65
76
  ...product,
66
77
  product_id: product.id,
@@ -73,6 +84,8 @@ var Info = () => {
73
84
  duration: 10,
74
85
  quantity: 1,
75
86
  price: product.price,
87
+ total: product.price,
88
+ origin_total: product.price,
76
89
  product_name: product.title
77
90
  }
78
91
  };
@@ -0,0 +1 @@
1
+ export declare const getProductDetail: (id: string, params: any) => Promise<any>;
@@ -0,0 +1,30 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/booking/info/service/serve.ts
20
+ var serve_exports = {};
21
+ __export(serve_exports, {
22
+ getProductDetail: () => getProductDetail
23
+ });
24
+ module.exports = __toCommonJS(serve_exports);
25
+ var import_utils = require("../../utils");
26
+ var getProductDetail = async (id, params) => import_utils.request.getRequest().get(`/shop/product/query/${id}`, params);
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ getProductDetail
30
+ });
@@ -0,0 +1 @@
1
+ export declare const getIsBundleOrCombination: (productDetail: any) => boolean;
@@ -0,0 +1,35 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/booking/info/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ getIsBundleOrCombination: () => getIsBundleOrCombination
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
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)) {
28
+ return true;
29
+ }
30
+ return false;
31
+ };
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ getIsBundleOrCombination
35
+ });
@@ -1,4 +1,18 @@
1
1
  import dayjs from 'dayjs';
2
+ declare type RType = (url: string, data?: {} | undefined, config?: {} | undefined) => Promise<any>;
3
+ declare class Request {
4
+ private request;
5
+ constructor();
6
+ setRequest(val: any): void;
7
+ getRequest(): {
8
+ get: RType;
9
+ post: RType;
10
+ put: RType;
11
+ remove: RType;
12
+ custom: RType;
13
+ };
14
+ }
15
+ export declare const request: Request;
2
16
  export declare const getDiscountTime: (service_times: number) => string;
3
17
  export declare const sliceDayIntoFiveMinutes: (config: any, locale: string) => {
4
18
  timeSlices: {
@@ -95,3 +109,4 @@ export declare const getDuration: (duration: number | {
95
109
  value: number;
96
110
  } | "flexible";
97
111
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
112
+ export {};
@@ -46,12 +46,25 @@ __export(utils_exports, {
46
46
  getServiceTimes: () => getServiceTimes,
47
47
  getShopOpeningHours: () => getShopOpeningHours,
48
48
  isWalkIn: () => isWalkIn,
49
+ request: () => request,
49
50
  sliceDayIntoFiveMinutes: () => sliceDayIntoFiveMinutes
50
51
  });
51
52
  module.exports = __toCommonJS(utils_exports);
52
53
  var import_dayjs = __toESM(require("dayjs"));
53
54
  var import_utils = require("@pisell/utils");
54
55
  var import_lodash = require("lodash");
56
+ var Request = class {
57
+ constructor() {
58
+ this.request = {};
59
+ }
60
+ setRequest(val) {
61
+ this.request = val;
62
+ }
63
+ getRequest() {
64
+ return this.request;
65
+ }
66
+ };
67
+ var request = new Request();
55
68
  var getDiscountTime = (service_times) => {
56
69
  if (!service_times) {
57
70
  return "";
@@ -457,5 +470,6 @@ var isWalkIn = (customer_id) => {
457
470
  getServiceTimes,
458
471
  getShopOpeningHours,
459
472
  isWalkIn,
473
+ request,
460
474
  sliceDayIntoFiveMinutes
461
475
  });
@@ -49,7 +49,7 @@ var SelectResourcesTable = ({ value, onChange }) => {
49
49
  const [data, setData] = (0, import_react.useState)([]);
50
50
  const _getData = async () => {
51
51
  let _getFormTypes = (0, import_server.getFormTypes)(
52
- { type: "manual", num: 500, skip: 1 },
52
+ { type: "manual", num: 500, skip: 1, status: "published" },
53
53
  { useCache: true }
54
54
  );
55
55
  let _getAllResource = (0, import_server.getAllResource)(