@pisell/private-materials 3.4.4 → 3.4.6
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/appointmentBooking/components/Cart/Item/index.js +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Cart/utils.js +8 -13
- package/es/components/appointmentBooking/components/Content/index.js +105 -19
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +1 -0
- package/es/components/appointmentBooking/components/Services/index.js +7 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -3
- package/es/components/appointmentBooking/components/Voucher/index.js +10 -10
- package/es/components/appointmentBooking/hooks.js +28 -30
- package/es/components/appointmentBooking/index.js +14 -0
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -1
- package/es/components/booking/hooks/useIsBooking4Shop.js +4 -3
- package/es/components/booking/info/addServiceVariant/index.js +2 -2
- package/es/components/booking/info/index.js +4 -4
- package/es/components/booking/info/utils.d.ts +1 -1
- package/es/components/booking/info/utils.js +4 -2
- package/es/components/booking/info2/service/addService/utils.js +38 -9
- package/es/components/booking/info2/service/addTimeModal/index.js +2 -2
- package/es/components/eventBooking/index.js +14 -0
- package/es/components/eventBooking/index.less +1 -1
- package/es/components/productSelect/components/TabProduct/index.js +103 -39
- package/es/components/productSelect/components/TabProduct/tabs/index.less +1 -0
- package/es/components/productSelect/index.d.ts +2 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -4
- package/es/components/walletList/index.js +4 -4
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Cart/utils.js +0 -10
- package/lib/components/appointmentBooking/components/Content/index.js +49 -7
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +1 -0
- package/lib/components/appointmentBooking/components/Services/index.js +6 -1
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +7 -3
- package/lib/components/appointmentBooking/components/Voucher/index.js +0 -11
- package/lib/components/appointmentBooking/hooks.js +5 -16
- package/lib/components/appointmentBooking/index.js +11 -0
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -1
- package/lib/components/booking/hooks/useIsBooking4Shop.js +6 -4
- package/lib/components/booking/info/addServiceVariant/index.js +3 -2
- package/lib/components/booking/info/index.js +4 -3
- package/lib/components/booking/info/utils.d.ts +1 -1
- package/lib/components/booking/info/utils.js +2 -2
- package/lib/components/booking/info2/service/addService/utils.js +31 -10
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -2
- package/lib/components/eventBooking/index.js +11 -0
- package/lib/components/eventBooking/index.less +1 -1
- package/lib/components/productSelect/components/TabProduct/index.js +74 -37
- package/lib/components/productSelect/components/TabProduct/tabs/index.less +1 -0
- package/lib/components/productSelect/index.d.ts +2 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +7 -6
- package/lib/components/walletList/index.js +3 -3
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.appointment-cart-item-wrap {
|
|
2
|
-
height: calc(
|
|
2
|
+
height: calc(var(--vh, 1vh) * 100 - 100px);
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
align-items: start;
|
|
41
41
|
|
|
42
|
-
>div {
|
|
42
|
+
> div {
|
|
43
43
|
display: flex;
|
|
44
44
|
align-items: center;
|
|
45
45
|
justify-content: space-between;
|
|
@@ -105,4 +105,4 @@
|
|
|
105
105
|
flex: none;
|
|
106
106
|
z-index: 10;
|
|
107
107
|
}
|
|
108
|
-
}
|
|
108
|
+
}
|
|
@@ -13,8 +13,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
13
13
|
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
14
14
|
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); } }
|
|
15
15
|
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); }); }; }
|
|
16
|
-
import { formatCustomer } from "../../utils";
|
|
17
|
-
|
|
18
16
|
// 类型声明
|
|
19
17
|
|
|
20
18
|
export var checkLogin = /*#__PURE__*/function () {
|
|
@@ -31,17 +29,14 @@ export var checkLogin = /*#__PURE__*/function () {
|
|
|
31
29
|
openLoginModal({
|
|
32
30
|
callback: function callback(status) {
|
|
33
31
|
if (status === 'success') {
|
|
34
|
-
if (!isFormSubject) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} else {
|
|
43
|
-
getHolders();
|
|
44
|
-
}
|
|
32
|
+
// if (!isFormSubject) {
|
|
33
|
+
// const user = JSON.parse(utils?.storage?.get('customer') || '{}');
|
|
34
|
+
// const currentUser = formatCustomer(user);
|
|
35
|
+
// const meAccount = accountLists?.find((d: any) => !d?.isGuest);
|
|
36
|
+
// appointmentBooking.setLoginAccount(meAccount?.id, currentUser);
|
|
37
|
+
// } else {
|
|
38
|
+
// getHolders();
|
|
39
|
+
// }
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
42
|
});
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
1
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
2
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
3
|
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
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
5
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
7
|
+
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); } }
|
|
8
|
+
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); }); }; }
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
11
|
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."); }
|
|
9
12
|
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); }
|
|
@@ -22,12 +25,21 @@ import TimeSlicing from "../TimeSlicing";
|
|
|
22
25
|
import Guest from "../Guest";
|
|
23
26
|
import Form from "../Form";
|
|
24
27
|
import ConfirmInformation from "../ConfirmInformation";
|
|
28
|
+
|
|
29
|
+
// 创建一个包装组件,将 forwardRef 组件转换为普通组件
|
|
30
|
+
// const Services = (props: any) => {
|
|
31
|
+
// return <ServicesOriginal {...props} />;
|
|
32
|
+
// };
|
|
25
33
|
import { useAppointmentBookingContext } from "../../context";
|
|
26
34
|
import PolicyModal from "../../deposit/components/PolicyModal";
|
|
27
|
-
import {
|
|
35
|
+
import { scrollToFirstErrorCard } from "../Resource/utils";
|
|
36
|
+
import { useAppointmentBookingCart, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingLogin, useAppointmentBookingAccount, useShopDiscount, contextUtils } from "../../hooks";
|
|
28
37
|
import "./index.less";
|
|
38
|
+
import useComponents from "../../../../hooks/useComponents";
|
|
39
|
+
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
40
|
+
import { formatCustomer } from "../../utils";
|
|
29
41
|
var Layout = function Layout() {
|
|
30
|
-
var
|
|
42
|
+
var _useEngineContext$eng2, _currentStep$step2, _currentStep$step4, _currentStep$step5, _currentStep$step7, _currentStep$step9;
|
|
31
43
|
var stepRef = useRef();
|
|
32
44
|
var _ref = useAppointmentBookingContext(),
|
|
33
45
|
currentStep = _ref.currentStep,
|
|
@@ -52,6 +64,16 @@ var Layout = function Layout() {
|
|
|
52
64
|
removeStep = _useAppointmentBookin4.removeStep;
|
|
53
65
|
var _useShopDiscount = useShopDiscount(),
|
|
54
66
|
shopDiscount = _useShopDiscount.shopDiscount;
|
|
67
|
+
var _useEngineContext$eng = (_useEngineContext$eng2 = useEngineContext().engine) === null || _useEngineContext$eng2 === void 0 ? void 0 : _useEngineContext$eng2.props,
|
|
68
|
+
customPageData = _useEngineContext$eng.customPageData;
|
|
69
|
+
var _useComponents = useComponents({
|
|
70
|
+
components: ['CustomComponent']
|
|
71
|
+
}),
|
|
72
|
+
_useComponents2 = _slicedToArray(_useComponents, 1),
|
|
73
|
+
CustomComponent = _useComponents2[0];
|
|
74
|
+
|
|
75
|
+
// 调试:检查 CustomComponent 是什么
|
|
76
|
+
console.log('CustomComponent:', CustomComponent, _typeof(CustomComponent), CustomComponent === null || CustomComponent === void 0 ? void 0 : CustomComponent.$$typeof);
|
|
55
77
|
|
|
56
78
|
// 不要删除
|
|
57
79
|
useAppointmentBookingCart();
|
|
@@ -60,6 +82,51 @@ var Layout = function Layout() {
|
|
|
60
82
|
_useState2 = _slicedToArray(_useState, 2),
|
|
61
83
|
params = _useState2[0],
|
|
62
84
|
setParams = _useState2[1];
|
|
85
|
+
var utils = contextUtils();
|
|
86
|
+
var context = useEngineContext();
|
|
87
|
+
var pubsub = context.appHelper.utils.pubsub;
|
|
88
|
+
useEffect(function () {
|
|
89
|
+
var handleLoginSuccess = /*#__PURE__*/function () {
|
|
90
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
91
|
+
var _utils$storage, user, currentUser, accountLists, meAccount;
|
|
92
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
93
|
+
while (1) switch (_context.prev = _context.next) {
|
|
94
|
+
case 0:
|
|
95
|
+
if (isFormSubject) {
|
|
96
|
+
_context.next = 10;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
user = JSON.parse((utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('customer')) || '{}');
|
|
100
|
+
currentUser = formatCustomer(user);
|
|
101
|
+
_context.next = 5;
|
|
102
|
+
return appointmentBooking.getAccounts();
|
|
103
|
+
case 5:
|
|
104
|
+
accountLists = _context.sent;
|
|
105
|
+
meAccount = accountLists === null || accountLists === void 0 ? void 0 : accountLists.find(function (d) {
|
|
106
|
+
return !(d !== null && d !== void 0 && d.isGuest);
|
|
107
|
+
});
|
|
108
|
+
appointmentBooking.setLoginAccount(meAccount === null || meAccount === void 0 ? void 0 : meAccount.id, currentUser);
|
|
109
|
+
_context.next = 11;
|
|
110
|
+
break;
|
|
111
|
+
case 10:
|
|
112
|
+
if (!isRetailTemplate) {
|
|
113
|
+
getHolders();
|
|
114
|
+
}
|
|
115
|
+
case 11:
|
|
116
|
+
case "end":
|
|
117
|
+
return _context.stop();
|
|
118
|
+
}
|
|
119
|
+
}, _callee);
|
|
120
|
+
}));
|
|
121
|
+
return function handleLoginSuccess() {
|
|
122
|
+
return _ref2.apply(this, arguments);
|
|
123
|
+
};
|
|
124
|
+
}();
|
|
125
|
+
pubsub.subscribe('pisell1.login.success', handleLoginSuccess);
|
|
126
|
+
return function () {
|
|
127
|
+
pubsub.unsubscribe('pisell1.login.success');
|
|
128
|
+
};
|
|
129
|
+
}, []);
|
|
63
130
|
useEffect(function () {
|
|
64
131
|
appointmentBooking.removeStep('fill-form');
|
|
65
132
|
return function () {
|
|
@@ -106,6 +173,7 @@ var Layout = function Layout() {
|
|
|
106
173
|
}
|
|
107
174
|
}, [isFormSubject, isLogin, isRetailTemplate]);
|
|
108
175
|
useEffect(function () {
|
|
176
|
+
var _currentStep$step;
|
|
109
177
|
if (!(currentStep !== null && currentStep !== void 0 && currentStep.step)) return;
|
|
110
178
|
|
|
111
179
|
// 清空底部按钮的loading
|
|
@@ -120,7 +188,12 @@ var Layout = function Layout() {
|
|
|
120
188
|
top: 0,
|
|
121
189
|
behavior: 'smooth'
|
|
122
190
|
});
|
|
123
|
-
|
|
191
|
+
|
|
192
|
+
// 在确认页,滚动到第一个错误卡片的位置
|
|
193
|
+
if ((currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key) === 'confirm-information') {
|
|
194
|
+
scrollToFirstErrorCard('.pisell-lowcode-product-card-error');
|
|
195
|
+
}
|
|
196
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key]);
|
|
124
197
|
var components = {
|
|
125
198
|
// 选择服务
|
|
126
199
|
'select-service': Services,
|
|
@@ -134,8 +207,8 @@ var Layout = function Layout() {
|
|
|
134
207
|
'confirm-information': ConfirmInformation
|
|
135
208
|
};
|
|
136
209
|
var Com = useMemo(function () {
|
|
137
|
-
var _currentStep$
|
|
138
|
-
var key = currentStep === null || currentStep === void 0 || (_currentStep$
|
|
210
|
+
var _currentStep$step3;
|
|
211
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key;
|
|
139
212
|
if (!key) return null;
|
|
140
213
|
var Com;
|
|
141
214
|
if (key.startsWith('select-resource')) {
|
|
@@ -147,12 +220,25 @@ var Layout = function Layout() {
|
|
|
147
220
|
} else {
|
|
148
221
|
Com = components[key];
|
|
149
222
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
223
|
+
if (key === 'select-service') {
|
|
224
|
+
return /*#__PURE__*/React.createElement(CustomComponent, {
|
|
225
|
+
block: customPageData === null || customPageData === void 0 ? void 0 : customPageData.block,
|
|
226
|
+
customComponents: {
|
|
227
|
+
product_list: /*#__PURE__*/React.createElement(Com, {
|
|
228
|
+
onChange: setParams,
|
|
229
|
+
params: params,
|
|
230
|
+
ref: stepRef
|
|
231
|
+
})
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
} else {
|
|
235
|
+
return /*#__PURE__*/React.createElement(Com, {
|
|
236
|
+
onChange: setParams,
|
|
237
|
+
params: params,
|
|
238
|
+
ref: stepRef
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key]);
|
|
156
242
|
|
|
157
243
|
/**
|
|
158
244
|
* @title: 动态计算中间内容区域的高度
|
|
@@ -176,10 +262,10 @@ var Layout = function Layout() {
|
|
|
176
262
|
content.style.overflowY = 'auto';
|
|
177
263
|
}
|
|
178
264
|
}
|
|
179
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$
|
|
265
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step5 = currentStep.step) === null || _currentStep$step5 === void 0 ? void 0 : _currentStep$step5.key]);
|
|
180
266
|
var isShowCartCom = useMemo(function () {
|
|
181
|
-
var _currentStep$
|
|
182
|
-
var key = currentStep === null || currentStep === void 0 || (_currentStep$
|
|
267
|
+
var _currentStep$step6;
|
|
268
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step6 = currentStep.step) === null || _currentStep$step6 === void 0 ? void 0 : _currentStep$step6.key;
|
|
183
269
|
if (isMobile()) return null;
|
|
184
270
|
|
|
185
271
|
// 先选择日期,并且当前步骤是选择日期,则不显示购物车
|
|
@@ -194,7 +280,7 @@ var Layout = function Layout() {
|
|
|
194
280
|
return stepRef === null || stepRef === void 0 || (_stepRef$current = stepRef.current) === null || _stepRef$current === void 0 || (_stepRef$current$next = _stepRef$current.next) === null || _stepRef$current$next === void 0 ? void 0 : _stepRef$current$next.call(_stepRef$current);
|
|
195
281
|
}
|
|
196
282
|
}));
|
|
197
|
-
}, [isDateSelectedFirst, currentStep === null || currentStep === void 0 || (_currentStep$
|
|
283
|
+
}, [isDateSelectedFirst, currentStep === null || currentStep === void 0 || (_currentStep$step7 = currentStep.step) === null || _currentStep$step7 === void 0 ? void 0 : _currentStep$step7.key]);
|
|
198
284
|
|
|
199
285
|
/**
|
|
200
286
|
* @title: 是否显示底部
|
|
@@ -205,14 +291,14 @@ var Layout = function Layout() {
|
|
|
205
291
|
* @Date: 2025-05-10 17:42
|
|
206
292
|
*/
|
|
207
293
|
var isFooter = useMemo(function () {
|
|
208
|
-
var _currentStep$
|
|
294
|
+
var _currentStep$step8;
|
|
209
295
|
if (!isMobile()) return false;
|
|
210
|
-
var key = currentStep === null || currentStep === void 0 || (_currentStep$
|
|
296
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step8 = currentStep.step) === null || _currentStep$step8 === void 0 ? void 0 : _currentStep$step8.key;
|
|
211
297
|
|
|
212
298
|
// 先选日期并且当前步骤是选择日期,则不显示底部
|
|
213
299
|
if (isDateSelectedFirst && key === 'select-date') return false;
|
|
214
300
|
return key !== 'confirm-information';
|
|
215
|
-
}, [isDateSelectedFirst, currentStep === null || currentStep === void 0 || (_currentStep$
|
|
301
|
+
}, [isDateSelectedFirst, currentStep === null || currentStep === void 0 || (_currentStep$step9 = currentStep.step) === null || _currentStep$step9 === void 0 ? void 0 : _currentStep$step9.key]);
|
|
216
302
|
|
|
217
303
|
/**
|
|
218
304
|
* @title: 获取协议方法需要在组件中定义才能传递给子组件,子组件无法获取到context中的方法
|
|
@@ -210,6 +210,7 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
210
210
|
var index = carts.findIndex(function (n) {
|
|
211
211
|
return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
|
|
212
212
|
});
|
|
213
|
+
e.like_status = 'like';
|
|
213
214
|
return appointmentBooking.updateCart({
|
|
214
215
|
_id: carts === null || carts === void 0 || (_carts$index = carts[index]) === null || _carts$index === void 0 ? void 0 : _carts$index._id,
|
|
215
216
|
resources: updateCartResources(carts === null || carts === void 0 ? void 0 : carts[index], e)
|
|
@@ -183,7 +183,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
183
183
|
if (type === 'duration' || appointmentBooking.isCartHasDurationProduct()) {
|
|
184
184
|
stepList = appointmentBooking.getStepList();
|
|
185
185
|
hasResourceStep = stepList === null || stepList === void 0 ? void 0 : stepList.find(function (item) {
|
|
186
|
-
return (item === null || item === void 0 ? void 0 : item.key) ===
|
|
186
|
+
return (item === null || item === void 0 ? void 0 : item.key) === 'select-resource';
|
|
187
187
|
});
|
|
188
188
|
if (hasResourceStep) {
|
|
189
189
|
description = locales.getText('pisell2.appointment.select.time');
|
|
@@ -237,12 +237,17 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
237
237
|
}
|
|
238
238
|
return ((_productListBlock = productListBlock) === null || _productListBlock === void 0 ? void 0 : _productListBlock.setting) || {};
|
|
239
239
|
}, [context]);
|
|
240
|
+
var _isMobile = useMemo(function () {
|
|
241
|
+
if (typeof isMobile === 'function') return isMobile();
|
|
242
|
+
return isMobile;
|
|
243
|
+
}, isMobile);
|
|
240
244
|
return /*#__PURE__*/React.createElement("div", {
|
|
241
245
|
className: "appointment-service-wrap"
|
|
242
246
|
}, /*#__PURE__*/React.createElement(ProductSelect, {
|
|
243
247
|
dataSource: products,
|
|
244
248
|
onChange: handleSelectProduct,
|
|
245
|
-
scrollDom:
|
|
249
|
+
scrollDom: _isMobile ? '.parallel-content-wrap' : '.parallel-booking-wrap',
|
|
250
|
+
offsetDom: _isMobile ? '' : '.pisell-section-headers',
|
|
246
251
|
loading: productLoading,
|
|
247
252
|
emptyDescription: locales.getText('pisell2.appointment.booking.empty.service'),
|
|
248
253
|
token: {
|
|
@@ -12,6 +12,7 @@ import React, { useEffect, useState, forwardRef, useImperativeHandle } from 'rea
|
|
|
12
12
|
import { Iconfont, PisellEmpty } from '@pisell/materials';
|
|
13
13
|
import { locales } from '@pisell/utils';
|
|
14
14
|
import { useAppointmentBookingContext } from "../../context";
|
|
15
|
+
import { scrollToFirstErrorCard } from "../Resource/utils";
|
|
15
16
|
import { useAppointmentBookingResource, useAppointmentBookingStep } from "../../hooks";
|
|
16
17
|
import { Toast } from "../../utils";
|
|
17
18
|
import "./index.less";
|
|
@@ -53,11 +54,14 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
53
54
|
while (1) switch (_context.prev = _context.next) {
|
|
54
55
|
case 0:
|
|
55
56
|
setSelectedTime(val);
|
|
56
|
-
|
|
57
|
+
|
|
58
|
+
// 滚动到第一个错误卡片的位置
|
|
59
|
+
scrollToFirstErrorCard('.pisell-lowcode-product-card-error');
|
|
60
|
+
_context.next = 4;
|
|
57
61
|
return appointmentBooking.submitTimeSlot(val);
|
|
58
|
-
case 3:
|
|
59
|
-
result = _context.sent;
|
|
60
62
|
case 4:
|
|
63
|
+
result = _context.sent;
|
|
64
|
+
case 5:
|
|
61
65
|
case "end":
|
|
62
66
|
return _context.stop();
|
|
63
67
|
}
|
|
@@ -26,7 +26,6 @@ import { locales } from '@pisell/utils';
|
|
|
26
26
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
27
27
|
import { PisellInput, PisellGoodPassCard, PisellText, PisellToast } from '@pisell/materials';
|
|
28
28
|
import { useAppointmentBooking, useShopDiscount, useAppointmentBookingLogin, useAppointmentBookingAccount } from "../../hooks";
|
|
29
|
-
import { formatCustomer } from "../../utils";
|
|
30
29
|
import "../../../booking/components/voucher/index.less";
|
|
31
30
|
import "./index.less";
|
|
32
31
|
var ShopDiscountHooks = {
|
|
@@ -179,15 +178,16 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
179
178
|
if (!action) return;
|
|
180
179
|
openLoginModal({
|
|
181
180
|
callback: function callback(status) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
// const user = utils.store?.getState()?.global?.userInfo;
|
|
182
|
+
// const currentUser = formatCustomer(user);
|
|
183
|
+
// const meAccount = accountLists?.find((d: any) => !d?.isGuest);
|
|
184
|
+
|
|
185
|
+
// if (status === 'success') {
|
|
186
|
+
// // appointmentBooking.setLoginAccount(
|
|
187
|
+
// // meAccount?.id,
|
|
188
|
+
// // currentUser
|
|
189
|
+
// // );
|
|
190
|
+
// }
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
}
|
|
@@ -17,7 +17,7 @@ import { useState, useEffect, useMemo } from 'react';
|
|
|
17
17
|
import { locales } from "@pisell/utils";
|
|
18
18
|
import { usePisellOS } from "../../hooks/useEngineContext";
|
|
19
19
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
20
|
-
import { sortResources, getCustomer, currentAppointmentBoard, currentRenderLists, getFormInsertBeforeKey, checkAndGoNext, checkAndMarkCartRenderError,
|
|
20
|
+
import { sortResources, getCustomer, currentAppointmentBoard, currentRenderLists, getFormInsertBeforeKey, checkAndGoNext, checkAndMarkCartRenderError, formatHolder, Toast } from "./utils";
|
|
21
21
|
import { useAppointmentBookingContext } from "./context";
|
|
22
22
|
import { scrollToFirstErrorCard } from "./components/Resource/utils";
|
|
23
23
|
export var useAppointmentBooking = function useAppointmentBooking() {
|
|
@@ -347,43 +347,41 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
347
347
|
// 检测是否登录
|
|
348
348
|
var checkLogin = /*#__PURE__*/function () {
|
|
349
349
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
350
|
-
var
|
|
350
|
+
var pubsub;
|
|
351
351
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
352
352
|
while (1) switch (_context3.prev = _context3.next) {
|
|
353
353
|
case 0:
|
|
354
354
|
if (isLogin) {
|
|
355
|
-
_context3.next =
|
|
355
|
+
_context3.next = 6;
|
|
356
356
|
break;
|
|
357
357
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
358
|
+
// const accountLists = await appointmentBooking.getAccounts()
|
|
359
|
+
pubsub = utils.pubsub;
|
|
360
|
+
pubsub.once('pisell1.login.success', function () {
|
|
361
|
+
checkHolder();
|
|
362
|
+
});
|
|
362
363
|
return _context3.abrupt("return", openLoginModal({
|
|
363
364
|
callback: function callback(status) {
|
|
364
|
-
if (status === 'success') {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
// 继续后续流程
|
|
380
|
-
checkHolder();
|
|
381
|
-
}
|
|
365
|
+
// if (status === 'success') {
|
|
366
|
+
// // if (!isFormSubject) {
|
|
367
|
+
// // const user = JSON.parse(utils?.storage?.get('customer') || '{}');
|
|
368
|
+
// // const currentUser = formatCustomer(user);
|
|
369
|
+
// // const meAccount = accountLists?.find((d: any) => !d?.isGuest);
|
|
370
|
+
// // appointmentBooking.setLoginAccount(meAccount?.id, currentUser);
|
|
371
|
+
// // } else {
|
|
372
|
+
// // if (!isRetailTemplate) {
|
|
373
|
+
// // getHolders();
|
|
374
|
+
// // }
|
|
375
|
+
// // }
|
|
376
|
+
|
|
377
|
+
// // 继续后续流程
|
|
378
|
+
// checkHolder()
|
|
379
|
+
// }
|
|
382
380
|
}
|
|
383
381
|
}));
|
|
384
|
-
case
|
|
382
|
+
case 6:
|
|
385
383
|
return _context3.abrupt("return", checkHolder());
|
|
386
|
-
case
|
|
384
|
+
case 7:
|
|
387
385
|
case "end":
|
|
388
386
|
return _context3.stop();
|
|
389
387
|
}
|
|
@@ -537,12 +535,12 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
537
535
|
bookingSubject = _ref14.bookingSubject;
|
|
538
536
|
var getCartAndSummary = /*#__PURE__*/function () {
|
|
539
537
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
540
|
-
var _utils$
|
|
538
|
+
var _utils$storage;
|
|
541
539
|
var locale, symbol, carts, accountLists, newCarts, summary;
|
|
542
540
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
543
541
|
while (1) switch (_context6.prev = _context6.next) {
|
|
544
542
|
case 0:
|
|
545
|
-
locale = (utils === null || utils === void 0 || (_utils$
|
|
543
|
+
locale = (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || 'en-US';
|
|
546
544
|
symbol = (utils === null || utils === void 0 ? void 0 : utils.getSymbolic()) || '$';
|
|
547
545
|
_context6.next = 4;
|
|
548
546
|
return appointmentBooking.getCart();
|
|
@@ -621,7 +619,7 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
|
|
|
621
619
|
utils.action({
|
|
622
620
|
type: 'pisell1.login',
|
|
623
621
|
data: {
|
|
624
|
-
type: 'plugin'
|
|
622
|
+
// type: 'plugin'
|
|
625
623
|
},
|
|
626
624
|
callback: callback
|
|
627
625
|
});
|
|
@@ -27,6 +27,20 @@ var AppointmentBooking = function AppointmentBooking() {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
}, []);
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
var setRealVH = function setRealVH() {
|
|
32
|
+
// window.innerHeight 会返回视口真实的高度(不包括工具栏)
|
|
33
|
+
var vh = window.innerHeight * 0.01;
|
|
34
|
+
document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// 页面加载和窗口大小变化时都重新计算
|
|
38
|
+
setRealVH();
|
|
39
|
+
window.addEventListener('resize', setRealVH);
|
|
40
|
+
return function () {
|
|
41
|
+
window.removeEventListener('resize', setRealVH);
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
30
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
45
|
className: "parallel-booking-wrap ".concat(isMobile() ? 'parallel-booking-mobile-wrap' : '')
|
|
32
46
|
}, /*#__PURE__*/React.createElement(AppointmentBookingProvider, null, /*#__PURE__*/React.createElement(Content, null)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useIsBooking4Shop: (state: any) =>
|
|
1
|
+
export declare const useIsBooking4Shop: (state: any) => any;
|
|
@@ -2,9 +2,10 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
3
3
|
import { isBooking4Shop } from "../info/utils";
|
|
4
4
|
export var useIsBooking4Shop = function useIsBooking4Shop(state) {
|
|
5
|
+
var _context$appHelper$ut4;
|
|
5
6
|
var context = useEngineContext();
|
|
6
7
|
return useMemo(function () {
|
|
7
|
-
var _context$appHelper$ut, _context$appHelper$ut2;
|
|
8
|
-
return isBooking4Shop((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.global) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.globalConfig) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.id, state.renderType);
|
|
9
|
-
}, [state.renderType]);
|
|
8
|
+
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3;
|
|
9
|
+
return isBooking4Shop((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.global) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.globalConfig) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.id, state.renderType, (_context$appHelper$ut3 = context.appHelper.utils) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.businessUtils);
|
|
10
|
+
}, [state.renderType, (_context$appHelper$ut4 = context.appHelper.utils) === null || _context$appHelper$ut4 === void 0 ? void 0 : _context$appHelper$ut4.businessUtils]);
|
|
10
11
|
};
|
|
@@ -10,7 +10,7 @@ import AddService2 from "../../info2/service/addService";
|
|
|
10
10
|
import { isBooking4Shop } from "../utils";
|
|
11
11
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
12
12
|
var AddServiceVariant = function AddServiceVariant(props) {
|
|
13
|
-
var _context$appHelper$ut, _context$appHelper$ut2, _props$globalState;
|
|
13
|
+
var _context$appHelper$ut, _context$appHelper$ut2, _props$globalState, _context$appHelper$ut3;
|
|
14
14
|
var globalState = props.globalState,
|
|
15
15
|
setGlobalState = props.setGlobalState;
|
|
16
16
|
var context = useEngineContext();
|
|
@@ -33,7 +33,7 @@ var AddServiceVariant = function AddServiceVariant(props) {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
var Cpt = AddService;
|
|
36
|
-
if (isBooking4Shop((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.global) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.globalConfig) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.id, props === null || props === void 0 || (_props$globalState = props.globalState) === null || _props$globalState === void 0 ? void 0 : _props$globalState.renderType)) {
|
|
36
|
+
if (isBooking4Shop((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.global) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.globalConfig) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.id, props === null || props === void 0 || (_props$globalState = props.globalState) === null || _props$globalState === void 0 ? void 0 : _props$globalState.renderType, (_context$appHelper$ut3 = context.appHelper.utils) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.businessUtils)) {
|
|
37
37
|
Cpt = AddService2;
|
|
38
38
|
}
|
|
39
39
|
return /*#__PURE__*/React.createElement(Cpt, {
|