@pisell/private-materials 3.0.73 → 3.0.74

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 (87) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +15 -15
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/booking/addons/index.d.ts +1 -1
  12. package/es/components/booking/addons/model.d.ts +1 -2
  13. package/es/components/booking/components/footer/amount.js +47 -24
  14. package/es/components/booking/components/footer/index.js +5 -0
  15. package/es/components/booking/components/footer/utils.js +12 -0
  16. package/es/components/booking/forms/forms.d.ts +1 -1
  17. package/es/components/booking/forms/index.d.ts +1 -1
  18. package/es/components/booking/forms/model.d.ts +1 -2
  19. package/es/components/booking/index.d.ts +1 -1
  20. package/es/components/booking/info/index.d.ts +1 -1
  21. package/es/components/booking/info/model.d.ts +1 -2
  22. package/es/components/booking/info/service/actions/index.d.ts +6 -0
  23. package/es/components/booking/info/service/actions/index.js +73 -0
  24. package/es/components/booking/info/service/actions/index.less +9 -0
  25. package/es/components/booking/info/service/addTimeModal/index.d.ts +4 -0
  26. package/es/components/booking/info/service/addTimeModal/index.js +658 -0
  27. package/es/components/booking/info/service/addTimeModal/index.less +133 -0
  28. package/es/components/booking/info/service/addTimeModal/serve.d.ts +5 -0
  29. package/es/components/booking/info/service/addTimeModal/serve.js +50 -0
  30. package/es/components/booking/info/service/addTimeModal/utils.d.ts +12 -0
  31. package/es/components/booking/info/service/addTimeModal/utils.js +96 -0
  32. package/es/components/booking/info/service/index.js +2 -1
  33. package/es/components/booking/info/service/serviceItem/Sales/index.d.ts +0 -0
  34. package/es/components/booking/info/service/serviceItem/Sales/index.js +0 -0
  35. package/es/components/booking/info/service/serviceItem/Sales/index.less +0 -0
  36. package/es/components/booking/info/service/serviceItem/index.js +24 -2
  37. package/es/components/booking/info/service/serviceItem/index.less +28 -0
  38. package/es/components/booking/locales.d.ts +24 -0
  39. package/es/components/booking/locales.js +26 -2
  40. package/es/components/booking/model.d.ts +3 -2
  41. package/es/components/booking/notes/index.d.ts +1 -1
  42. package/es/components/booking/notes/model.d.ts +1 -2
  43. package/es/components/booking/payments/index.d.ts +1 -1
  44. package/es/components/booking/payments/model.d.ts +1 -2
  45. package/es/components/booking/utils.d.ts +12 -0
  46. package/es/components/booking/utils.js +91 -48
  47. package/es/components/schedules/index.d.ts +1 -1
  48. package/es/components/schedules/model.d.ts +1 -2
  49. package/lib/components/booking/addons/index.d.ts +1 -1
  50. package/lib/components/booking/addons/model.d.ts +1 -2
  51. package/lib/components/booking/components/footer/amount.js +10 -0
  52. package/lib/components/booking/components/footer/index.js +5 -0
  53. package/lib/components/booking/components/footer/utils.js +12 -0
  54. package/lib/components/booking/forms/forms.d.ts +1 -1
  55. package/lib/components/booking/forms/index.d.ts +1 -1
  56. package/lib/components/booking/forms/model.d.ts +1 -2
  57. package/lib/components/booking/index.d.ts +1 -1
  58. package/lib/components/booking/info/index.d.ts +1 -1
  59. package/lib/components/booking/info/model.d.ts +1 -2
  60. package/lib/components/booking/info/service/actions/index.d.ts +6 -0
  61. package/lib/components/booking/info/service/actions/index.js +97 -0
  62. package/lib/components/booking/info/service/actions/index.less +9 -0
  63. package/lib/components/booking/info/service/addTimeModal/index.d.ts +4 -0
  64. package/lib/components/booking/info/service/addTimeModal/index.js +566 -0
  65. package/lib/components/booking/info/service/addTimeModal/index.less +133 -0
  66. package/lib/components/booking/info/service/addTimeModal/serve.d.ts +5 -0
  67. package/lib/components/booking/info/service/addTimeModal/serve.js +39 -0
  68. package/lib/components/booking/info/service/addTimeModal/utils.d.ts +12 -0
  69. package/lib/components/booking/info/service/addTimeModal/utils.js +129 -0
  70. package/lib/components/booking/info/service/index.js +2 -1
  71. package/lib/components/booking/info/service/serviceItem/Sales/index.d.ts +0 -0
  72. package/lib/components/booking/info/service/serviceItem/Sales/index.js +0 -0
  73. package/lib/components/booking/info/service/serviceItem/Sales/index.less +0 -0
  74. package/lib/components/booking/info/service/serviceItem/index.js +14 -1
  75. package/lib/components/booking/info/service/serviceItem/index.less +28 -0
  76. package/lib/components/booking/locales.d.ts +24 -0
  77. package/lib/components/booking/locales.js +26 -2
  78. package/lib/components/booking/model.d.ts +3 -2
  79. package/lib/components/booking/notes/index.d.ts +1 -1
  80. package/lib/components/booking/notes/model.d.ts +1 -2
  81. package/lib/components/booking/payments/index.d.ts +1 -1
  82. package/lib/components/booking/payments/model.d.ts +1 -2
  83. package/lib/components/booking/utils.d.ts +12 -0
  84. package/lib/components/booking/utils.js +82 -33
  85. package/lib/components/schedules/index.d.ts +1 -1
  86. package/lib/components/schedules/model.d.ts +1 -2
  87. package/package.json +3 -3
@@ -0,0 +1,133 @@
1
+ .pisell-lowcode__booking-add-time-header {
2
+ margin-top: 10px;
3
+ margin-bottom: 10px;
4
+ }
5
+
6
+ .pisell-lowcode__booking-add-time-body {
7
+ padding: 10px 32px 30px;
8
+ display: flex;
9
+ flex-direction: column;
10
+ width: 100%;
11
+ height: 100%;
12
+
13
+ .pisell-lowcode__booking-add-time-child-card-list {
14
+ width: 100%;
15
+ display: flex;
16
+ flex-wrap: wrap;
17
+ gap: 10px;
18
+
19
+ .pisell-lowcode__booking-add-time-hours {
20
+ padding: 6px;
21
+ color: var(--Gray-900, #101828);
22
+ font-size: 14px;
23
+ font-style: normal;
24
+ font-weight: 500;
25
+ background: var(--Gray-50, #F9FAFB);
26
+ margin: 10px 0;
27
+ flex: 0 0 100%;
28
+ }
29
+
30
+ .pisell-lowcode__booking-add-time-child-card {
31
+ flex: 0 0 calc(50% - 5px);
32
+ border-radius: 10px;
33
+
34
+ background: #FFF;
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: space-between;
38
+ padding: 10px 20px;
39
+ cursor: pointer;
40
+ position: relative;
41
+
42
+ &::before {
43
+ content: '';
44
+ position: absolute;
45
+ top: 0;
46
+ left: 0;
47
+ bottom: 0;
48
+ right: 0;
49
+ cursor: pointer;
50
+ border-radius: 10px;
51
+ border: 1px solid var(--Gray-true-300, #D6D6D6);
52
+ }
53
+
54
+ &.pisell-lowcode__booking-add-time-child-card-active {
55
+ &::before {
56
+ border-color: #7f56d9;
57
+ border-width: 2px;
58
+ }
59
+ }
60
+
61
+ .pisell-lowcode__booking-add-time-child-card-left {
62
+
63
+ .pisell-lowcode__booking-add-time-child-card-left-time {
64
+ color: var(--Gray-900, #101828);
65
+ font-size: 20px;
66
+ font-style: normal;
67
+ font-weight: 500;
68
+ }
69
+
70
+ .pisell-lowcode__booking-add-time-child-card-left-price {
71
+ color: var(--Gray-500, #667085);
72
+ font-size: 16px;
73
+ font-style: normal;
74
+ font-weight: 400;
75
+ }
76
+ }
77
+
78
+ .pisell-lowcode__booking-add-time-child-card-right {}
79
+ }
80
+ }
81
+
82
+ .pisell-lowcode__booking-add-time-footer {
83
+ width: 100%;
84
+ }
85
+ }
86
+
87
+ .pisell-lowcode__booking-add-time-total-wrap {
88
+ border-bottom: 1px solid var(--Gray-true-300, #f9fafb);
89
+ margin: -10px -32px 10px;
90
+ padding: 10px 32px 0;
91
+ background-color: #f3f4f6;
92
+
93
+ .pisell-lowcode__booking-add-time-summary-wrap {
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: space-between;
97
+ border: none;
98
+ margin: 0;
99
+ padding: 0 0 10px 0;
100
+
101
+ .pisell-lowcode__booking-add-time-summary {
102
+ padding-right: 20px;
103
+
104
+ .pisell-lowcode__booking-add-time-summary-time {}
105
+
106
+ .pisell-lowcode__booking-add-time-summary-total {}
107
+ }
108
+
109
+ .pisell-lowcode__booking-add-time-quantity-wrap {
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+
114
+
115
+ .pisell-lowcode__booking-add-time-quantity {
116
+ margin-right: 14px;
117
+ color: var(--Gray-500, #667085);
118
+ font-size: 14px;
119
+ font-style: normal;
120
+ font-weight: 500;
121
+ white-space: nowrap;
122
+ }
123
+
124
+ .pisell-lowcode__booking-add-time-quantity-select {
125
+ min-width: 75px;
126
+ border-radius: 30px;
127
+ height: 44px;
128
+ padding: 0 16px;
129
+ background-color: var(--Gray-true-200, #E5E5E5);
130
+ }
131
+ }
132
+ }
133
+ }
@@ -0,0 +1,5 @@
1
+ export declare const getAddTimeProducts: (params: any, config: any) => Promise<any>;
2
+ export declare const saveAddTimeProduct: ({ orderId, params }: {
3
+ orderId: number | string;
4
+ params: any;
5
+ }) => Promise<any>;
@@ -0,0 +1,50 @@
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 getAddTimeProducts = /*#__PURE__*/function () {
7
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params, config) {
8
+ var _yield$request$getReq, data;
9
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10
+ while (1) switch (_context.prev = _context.next) {
11
+ case 0:
12
+ _context.next = 2;
13
+ return request.getRequest().post("/shop/product/query", params, config);
14
+ case 2:
15
+ _yield$request$getReq = _context.sent;
16
+ data = _yield$request$getReq.data;
17
+ return _context.abrupt("return", data);
18
+ case 5:
19
+ case "end":
20
+ return _context.stop();
21
+ }
22
+ }, _callee);
23
+ }));
24
+ return function getAddTimeProducts(_x, _x2) {
25
+ return _ref.apply(this, arguments);
26
+ };
27
+ }();
28
+ export var saveAddTimeProduct = /*#__PURE__*/function () {
29
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
30
+ var orderId, params, _yield$request$getReq2, data;
31
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
32
+ while (1) switch (_context2.prev = _context2.next) {
33
+ case 0:
34
+ orderId = _ref2.orderId, params = _ref2.params;
35
+ _context2.next = 3;
36
+ return request.getRequest().put("/shop/order/appointment/child-booking/".concat(orderId), params);
37
+ case 3:
38
+ _yield$request$getReq2 = _context2.sent;
39
+ data = _yield$request$getReq2.data;
40
+ return _context2.abrupt("return", data);
41
+ case 6:
42
+ case "end":
43
+ return _context2.stop();
44
+ }
45
+ }, _callee2);
46
+ }));
47
+ return function saveAddTimeProduct(_x3) {
48
+ return _ref3.apply(this, arguments);
49
+ };
50
+ }();
@@ -0,0 +1,12 @@
1
+ export declare const getAddTimeSplits: (config: any, price: number) => ({
2
+ label: string;
3
+ value: number;
4
+ readonly: boolean;
5
+ price?: undefined;
6
+ } | {
7
+ label: string;
8
+ value: number;
9
+ price: number;
10
+ readonly?: undefined;
11
+ })[];
12
+ export declare const isUsableProduct: (relationProduct: any, currentItem: any) => any;
@@ -0,0 +1,96 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
+ import dayjs from "dayjs";
8
+ import { getDiscountTime } from "../../../utils";
9
+ import { locales } from '@pisell/utils';
10
+ import { intersectionBy } from 'lodash';
11
+ var getIsAddH = function getIsAddH(pre, current) {
12
+ if (current < 60) {
13
+ return '';
14
+ }
15
+ var preH = Math.floor(pre / 60);
16
+ var currentH = Math.floor(current / 60);
17
+ if (current % 60 !== 0) {
18
+ return '';
19
+ }
20
+ return getDiscountTime(currentH * 60);
21
+ };
22
+ export var getAddTimeSplits = function getAddTimeSplits(config, price) {
23
+ var startTime = dayjs().startOf("day");
24
+ var endTime = startTime.add(config.max_add_time, "minute");
25
+ var timeSlice = (config === null || config === void 0 ? void 0 : config.unit_duration) || 5; // 切片时间间隔(分钟)
26
+
27
+ var arr = [];
28
+ var currentTime = startTime;
29
+ var lastDuration = 0;
30
+ while (currentTime.isBefore(endTime)) {
31
+ var nextTime = currentTime;
32
+ if (lastDuration === 0) {
33
+ nextTime = nextTime.add(config.min_add_time, "minute");
34
+ } else {
35
+ nextTime = currentTime.add(timeSlice, "minute");
36
+ }
37
+ var durationValue = nextTime.diff(startTime, "minute");
38
+
39
+ // 添加小时标记
40
+ var isAddH = getIsAddH(lastDuration, durationValue);
41
+ console.log('isAddH', isAddH);
42
+ if (isAddH) {
43
+ arr.push({
44
+ label: isAddH,
45
+ value: 0,
46
+ readonly: true
47
+ });
48
+ }
49
+ if (durationValue >= 60) {
50
+ var durationLabel = getDiscountTime(durationValue);
51
+ arr.push({
52
+ label: durationLabel,
53
+ value: durationValue,
54
+ price: durationValue / timeSlice * price
55
+ });
56
+ } else {
57
+ var _durationLabel = "".concat(durationValue, " ").concat(locales.getText('pisell2.text.min'));
58
+ arr.push({
59
+ label: _durationLabel,
60
+ value: durationValue,
61
+ price: durationValue / timeSlice * price
62
+ });
63
+ }
64
+ lastDuration = durationValue;
65
+ currentTime = nextTime;
66
+ }
67
+ return arr;
68
+ };
69
+ export var isUsableProduct = function isUsableProduct(relationProduct, currentItem) {
70
+ // 商品类型
71
+ var type = relationProduct.type;
72
+ if (!currentItem) {
73
+ return false;
74
+ }
75
+ // 全部商品
76
+ if (type === "product_all") {
77
+ return true;
78
+ } else {
79
+ if (type === "product_collection") {
80
+ return !!intersectionBy(relationProduct.products.map(function (item) {
81
+ return _objectSpread(_objectSpread({}, item), {}, {
82
+ id: item.product_collection_id
83
+ });
84
+ }) || [], currentItem.collection || [], "id").length;
85
+ } else {
86
+ return relationProduct.products.some(function (item) {
87
+ // 判断商品
88
+ if (type === "products") {
89
+ if (item.product_id == currentItem.product_id) {
90
+ return true;
91
+ }
92
+ }
93
+ });
94
+ }
95
+ }
96
+ };
@@ -3,12 +3,13 @@ import AddService from "./addService";
3
3
  import EditService from "./editService";
4
4
  import "./index.less";
5
5
  import ServiceList from "./serviceList";
6
+ import AddTimeModal from "./addTimeModal";
6
7
  var Service = function Service() {
7
8
  useEffect(function () {
8
9
  document.body.id = "body";
9
10
  }, []);
10
11
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
11
12
  className: "pisell-lowcode__booking-service-wrap"
12
- }, /*#__PURE__*/React.createElement(ServiceList, null), /*#__PURE__*/React.createElement(AddService, null)), /*#__PURE__*/React.createElement(EditService, null));
13
+ }, /*#__PURE__*/React.createElement(ServiceList, null), /*#__PURE__*/React.createElement(AddService, null)), /*#__PURE__*/React.createElement(EditService, null), /*#__PURE__*/React.createElement(AddTimeModal, null));
13
14
  };
14
15
  export default Service;
@@ -5,9 +5,10 @@ import { formatAmount, locales } from "@pisell/utils";
5
5
  import CollapsibleList from "../../../components/collapsibleList";
6
6
  import { renderBundles } from "../../../components/collapsibleList/utils";
7
7
  import { Alert } from "antd";
8
+ import Actions from "../actions";
8
9
  import "./index.less";
9
10
  var ServiceItem = function ServiceItem(_ref) {
10
- var _d$_extend3, _d$_extend4, _d$_extend5, _d$_extend5$other, _d$_extend6, _d$_extend6$other, _d$_extend7, _d$_extend8, _d$_extend9;
11
+ var _d$_extend3, _d$_extend4, _d$_extend5, _d$_extend5$other, _d$_extend6, _d$_extend6$other, _d$_extend7, _d$_extend8, _d$_extend9, _d$_extend$relation_d;
11
12
  var d = _ref.d,
12
13
  handleEditService = _ref.handleEditService,
13
14
  state = _ref.state,
@@ -53,7 +54,28 @@ var ServiceItem = function ServiceItem(_ref) {
53
54
  className: "pisell-lowcode__booking-service-item-original-price"
54
55
  }, formatAmount(d._extend.origin_total, 2, state.amountSymbol)) : null)) : null, isDiscount && (_d$_extend8 = d._extend) !== null && _d$_extend8 !== void 0 && _d$_extend8.discount_reason ? /*#__PURE__*/React.createElement("div", {
55
56
  className: "pisell-lowcode__booking-service-item-discount-reason"
56
- }, /*#__PURE__*/React.createElement("span", null, locales.getText("pisell2.text.discount-reason"), ":"), " ", (_d$_extend9 = d._extend) === null || _d$_extend9 === void 0 ? void 0 : _d$_extend9.discount_reason) : null, errorMessage ? /*#__PURE__*/React.createElement(Alert, {
57
+ }, /*#__PURE__*/React.createElement("span", null, locales.getText("pisell2.text.discount-reason"), ":"), " ", (_d$_extend9 = d._extend) === null || _d$_extend9 === void 0 ? void 0 : _d$_extend9.discount_reason) : null, (_d$_extend$relation_d = d._extend.relation_details) !== null && _d$_extend$relation_d !== void 0 && _d$_extend$relation_d.length ? /*#__PURE__*/React.createElement("div", {
58
+ className: "pisell-lowcode__booking-service-item-relation-details"
59
+ }, /*#__PURE__*/React.createElement("div", {
60
+ className: "pisell-lowcode__booking-service-item-title"
61
+ }, locales.getText("page.booking.text.sales")), d._extend.relation_details.map(function (item, index) {
62
+ return /*#__PURE__*/React.createElement("div", {
63
+ className: "pisell-lowcode__booking-service-item-relation-detail",
64
+ key: item.id
65
+ }, /*#__PURE__*/React.createElement("div", {
66
+ className: "pisell-lowcode__booking-service-item-relation-detail-title"
67
+ }, item.product_title), /*#__PURE__*/React.createElement("div", {
68
+ className: "pisell-lowcode__booking-service-item-relation-detail-info"
69
+ }, /*#__PURE__*/React.createElement("span", {
70
+ className: "pisell-lowcode__booking-service-item-relation-detail-info-price"
71
+ }, formatAmount(item.payment_price, 2, state.amountSymbol)), /*#__PURE__*/React.createElement("span", {
72
+ className: "pisell-lowcode__booking-service-item-relation-detail-info-unit"
73
+ }, "x"), /*#__PURE__*/React.createElement("span", {
74
+ className: "pisell-lowcode__booking-service-item-relation-detail-info-quantity"
75
+ }, item.product_quantity)));
76
+ })) : null, /*#__PURE__*/React.createElement(Actions, {
77
+ currentService: d
78
+ }), errorMessage ? /*#__PURE__*/React.createElement(Alert, {
57
79
  message: errorMessage,
58
80
  type: "warning",
59
81
  showIcon: true,
@@ -94,4 +94,32 @@
94
94
  margin: 0 -20px -16px;
95
95
  border-radius: 0 0 8px 8px;
96
96
  }
97
+ }
98
+
99
+ .pisell-lowcode__booking-service-item-relation-details {
100
+ padding-top: 6px;
101
+ margin-top: 6px;
102
+ border-top: 1px solid #d5d7da;
103
+ margin-bottom: 6px;
104
+ }
105
+
106
+ .pisell-lowcode__booking-service-item-relation-detail {
107
+ display: flex;
108
+ align-items: flex-start;
109
+ justify-content: space-between;
110
+ margin-top: 4px;
111
+ overflow: hidden;
112
+
113
+ .pisell-lowcode__booking-service-item-relation-detail-title {}
114
+
115
+ .pisell-lowcode__booking-service-item-relation-detail-info {
116
+ .pisell-lowcode__booking-service-item-relation-detail-info-quantity {}
117
+
118
+ .pisell-lowcode__booking-service-item-relation-detail-info-unit {
119
+ padding: 0 4px;
120
+ }
121
+
122
+ .pisell-lowcode__booking-service-item-relation-detail-info-price {}
123
+ }
124
+
97
125
  }
@@ -146,6 +146,14 @@ declare const _default: {
146
146
  'pisell2.text.send-mail': string;
147
147
  'pisell2.text.copy-to-clipboard': string;
148
148
  'pisell2.text.ok': string;
149
+ 'page.booking.text.add-time': string;
150
+ 'page.booking.text.quantity': string;
151
+ 'page.booking.text.sales': string;
152
+ 'page.booking.text.update-time': string;
153
+ 'page.booking.text.add-time-success': string;
154
+ 'page.booking.text.unavailable': string;
155
+ 'page.booking.text.available': string;
156
+ 'page.booking.text.fully-booked': string;
149
157
  'pisell2.text.terminal-edit-message': string;
150
158
  };
151
159
  'zh-CN': {
@@ -296,6 +304,14 @@ declare const _default: {
296
304
  'pisell2.text.copy-to-clipboard': string;
297
305
  'pisell2.text.ok': string;
298
306
  'pisell2.text.terminal-edit-message': string;
307
+ 'page.booking.text.add-time': string;
308
+ 'page.booking.text.quantity': string;
309
+ 'page.booking.text.sales': string;
310
+ 'page.booking.text.update-time': string;
311
+ 'page.booking.text.add-time-success': string;
312
+ 'page.booking.text.unavailable': string;
313
+ 'page.booking.text.available': string;
314
+ 'page.booking.text.fully-booked': string;
299
315
  };
300
316
  'zh-HK': {
301
317
  'pisell2.text.refunded-amount': string;
@@ -445,6 +461,14 @@ declare const _default: {
445
461
  'pisell2.text.copy-to-clipboard': string;
446
462
  'pisell2.text.ok': string;
447
463
  'pisell2.text.terminal-edit-message': string;
464
+ 'page.booking.text.add-time': string;
465
+ 'page.booking.text.quantity': string;
466
+ 'page.booking.text.sales': string;
467
+ 'page.booking.text.update-time': string;
468
+ 'page.booking.text.add-time-success': string;
469
+ 'page.booking.text.unavailable': string;
470
+ 'page.booking.text.available': string;
471
+ 'page.booking.text.fully-booked': string;
448
472
  };
449
473
  };
450
474
  export default _default;
@@ -161,6 +161,14 @@ export default {
161
161
  'pisell2.text.send-mail': "Send email",
162
162
  'pisell2.text.copy-to-clipboard': "Copy to clipboard",
163
163
  'pisell2.text.ok': "OK",
164
+ 'page.booking.text.add-time': 'Add time',
165
+ 'page.booking.text.quantity': 'Quantity',
166
+ 'page.booking.text.sales': 'Sales',
167
+ 'page.booking.text.update-time': 'Update time',
168
+ 'page.booking.text.add-time-success': 'Add time successfully',
169
+ 'page.booking.text.unavailable': 'Unavailable',
170
+ 'page.booking.text.available': 'Available',
171
+ 'page.booking.text.fully-booked': 'Fully booked',
164
172
  'pisell2.text.terminal-edit-message': "This operation cannot be performed. To proceed, please use the Pisell Terminal."
165
173
  },
166
174
  'zh-CN': {
@@ -330,7 +338,15 @@ export default {
330
338
  'pisell2.text.send-mail': "发送邮件",
331
339
  'pisell2.text.copy-to-clipboard': "复制到剪切板",
332
340
  'pisell2.text.ok': "好的",
333
- 'pisell2.text.terminal-edit-message': "此操作不可使用,如需使用请至Pisell 终端设备操作。"
341
+ 'pisell2.text.terminal-edit-message': "此操作不可使用,如需使用请至Pisell 终端设备操作。",
342
+ 'page.booking.text.add-time': '加时',
343
+ 'page.booking.text.quantity': '数量',
344
+ 'page.booking.text.sales': '销售',
345
+ 'page.booking.text.update-time': '更新后的时间',
346
+ 'page.booking.text.add-time-success': '加时成功',
347
+ 'page.booking.text.unavailable': '不可用',
348
+ 'page.booking.text.available': '可用',
349
+ 'page.booking.text.fully-booked': '已约满'
334
350
  },
335
351
  'zh-HK': {
336
352
  'pisell2.text.refunded-amount': '已退金額',
@@ -499,6 +515,14 @@ export default {
499
515
  'pisell2.text.send-mail': "發送郵件",
500
516
  'pisell2.text.copy-to-clipboard': "複製到剪切板",
501
517
  'pisell2.text.ok': "好的",
502
- 'pisell2.text.terminal-edit-message': "此操作不可使用,如需使用請至Pisell 終端設備操作。"
518
+ 'pisell2.text.terminal-edit-message': "此操作不可使用,如需使用請至Pisell 終端設備操作。",
519
+ 'page.booking.text.add-time': '加時',
520
+ 'page.booking.text.quantity': '數量',
521
+ 'page.booking.text.sales': '銷售',
522
+ 'page.booking.text.update-time': '更新後的時間',
523
+ 'page.booking.text.add-time-success': '加時成功!',
524
+ 'page.booking.text.unavailable': '不可用',
525
+ 'page.booking.text.available': '可用',
526
+ 'page.booking.text.fully-booked': '已約滿'
503
527
  }
504
528
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -39,6 +38,7 @@ export interface FormState {
39
38
  value: any[];
40
39
  cacheItem: any;
41
40
  edit: boolean;
41
+ addTimeModal: boolean;
42
42
  };
43
43
  pet: {
44
44
  showModal: boolean;
@@ -76,6 +76,7 @@ export interface FormState {
76
76
  modalOpen?: boolean;
77
77
  isTerminal?: boolean;
78
78
  isFranchisee?: boolean;
79
+ addTimeProducts: any[];
79
80
  eventOtherParams?: {
80
81
  relation_id: number;
81
82
  number: number;
@@ -92,7 +93,7 @@ export declare const walkInData: {
92
93
  id: number;
93
94
  nickname: string;
94
95
  };
95
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
96
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
96
97
  state: FormState;
97
98
  } & {
98
99
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: (props: any) => any;
7
+ declare const Notes: (props: any) => JSX.Element;
8
8
  export default Notes;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Payments: (props: any) => any;
8
+ declare const Payments: (props: any) => JSX.Element;
9
9
  export default Payments;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -69,6 +69,16 @@ export declare const findNextSlice: ({ timeSlices, index, date }: {
69
69
  }) => any;
70
70
  export declare const findNextDuration: (current: any, array: any, defaultValue?: any) => any;
71
71
  export declare const formatProductListByCategory: (list: any, filterItem: any) => unknown[];
72
+ export declare const getResourceTimeIsUsable: (item: any, cacheItem: any) => any;
73
+ /**
74
+ * @title: 查找是否有可用的time
75
+ * @description:
76
+ * @param {any} resourceItem
77
+ * @return {*}
78
+ * @Author: zhiwei.Wang
79
+ * @Date: 2024-01-09 13:57
80
+ */
81
+ export declare const formatTimes: (resourceItem: any, cacheItem: any) => any;
72
82
  /**
73
83
  * @title: 获取店铺的营业结束时间
74
84
  * @description:
@@ -88,6 +98,7 @@ export declare const flexibleObj: {
88
98
  create: (num: number) => any;
89
99
  getValue: (str: string | number) => number;
90
100
  isFlexible: (str: string | number) => boolean;
101
+ add: (current: number | string, duration: number) => any;
91
102
  };
92
103
  /**
93
104
  * @title: 获取结束时间
@@ -147,4 +158,5 @@ export declare const getDuration: (duration: number | {
147
158
  value: number;
148
159
  } | "flexible";
149
160
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
161
+ export declare const getIsEdit: (state: any) => boolean;
150
162
  export {};