@pisell/pisellos 0.0.213 → 0.0.215
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/dist/core/index.js +2 -1
- package/dist/effects/index.d.ts +4 -3
- package/dist/effects/index.js +15 -6
- package/dist/modules/AccountList/index.d.ts +7 -1
- package/dist/modules/AccountList/index.js +81 -14
- package/dist/modules/AccountList/types.d.ts +28 -0
- package/dist/modules/AccountList/types.js +8 -0
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Customer/constants.js +12 -0
- package/dist/modules/Customer/index.d.ts +89 -0
- package/dist/modules/Customer/index.js +439 -0
- package/dist/modules/Customer/types.d.ts +130 -0
- package/dist/modules/Customer/types.js +39 -0
- package/dist/modules/ProductList/index.d.ts +6 -1
- package/dist/modules/ProductList/index.js +8 -4
- package/dist/modules/Rules/index.js +7 -5
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/Schedule/utils.js +7 -1
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingByStep/index.js +8 -15
- package/dist/solution/BookingTicket/index.d.ts +127 -0
- package/dist/solution/BookingTicket/index.js +494 -0
- package/dist/solution/BookingTicket/types.d.ts +66 -0
- package/dist/solution/BookingTicket/types.js +41 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +147 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +19 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +138 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +51 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +189 -0
- package/dist/solution/ShopDiscount/index.js +4 -2
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/utils/task.d.ts +31 -0
- package/dist/utils/task.js +150 -0
- package/dist/utils/watch.d.ts +102 -0
- package/dist/utils/watch.js +294 -0
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +4 -3
- package/lib/effects/index.js +4 -1
- package/lib/modules/AccountList/index.d.ts +7 -1
- package/lib/modules/AccountList/index.js +27 -0
- package/lib/modules/AccountList/types.d.ts +28 -0
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Customer/constants.js +39 -0
- package/lib/modules/Customer/index.d.ts +89 -0
- package/lib/modules/Customer/index.js +304 -0
- package/lib/modules/Customer/types.d.ts +130 -0
- package/lib/modules/Customer/types.js +35 -0
- package/lib/modules/ProductList/index.d.ts +6 -1
- package/lib/modules/ProductList/index.js +12 -3
- package/lib/modules/Rules/index.js +4 -3
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/Schedule/utils.js +8 -3
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -0
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingByStep/index.js +0 -7
- package/lib/solution/BookingTicket/index.d.ts +127 -0
- package/lib/solution/BookingTicket/index.js +291 -0
- package/lib/solution/BookingTicket/types.d.ts +66 -0
- package/lib/solution/BookingTicket/types.js +70 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +97 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +19 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +95 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +51 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +153 -0
- package/lib/solution/ShopDiscount/index.js +2 -1
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +2 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/utils/task.d.ts +31 -0
- package/lib/utils/task.js +84 -0
- package/lib/utils/watch.d.ts +102 -0
- package/lib/utils/watch.js +217 -0
- package/package.json +1 -1
|
@@ -0,0 +1,494 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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); } }
|
|
6
|
+
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); }); }; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
14
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
15
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
17
|
+
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; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
|
+
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); }
|
|
20
|
+
import { BaseModule } from "../../modules/BaseModule";
|
|
21
|
+
import { BookingTicketHooks, createModule } from "./types";
|
|
22
|
+
import { Scan } from "./utils/scan/index";
|
|
23
|
+
import { handleGlobalScan, handleCustomerScan } from "./utils/scan/handleScan";
|
|
24
|
+
export var BookingTicketImpl = /*#__PURE__*/function (_BaseModule) {
|
|
25
|
+
_inherits(BookingTicketImpl, _BaseModule);
|
|
26
|
+
var _super = _createSuper(BookingTicketImpl);
|
|
27
|
+
function BookingTicketImpl() {
|
|
28
|
+
var _this;
|
|
29
|
+
_classCallCheck(this, BookingTicketImpl);
|
|
30
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
|
+
args[_key] = arguments[_key];
|
|
32
|
+
}
|
|
33
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "defaultName", 'bookingTicket');
|
|
35
|
+
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "isSolution", true);
|
|
37
|
+
_defineProperty(_assertThisInitialized(_this), "request", void 0);
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "window", void 0);
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "shopStore", void 0);
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "store", void 0);
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "otherParams", {});
|
|
42
|
+
_defineProperty(_assertThisInitialized(_this), "cacheId", void 0);
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "platform", void 0);
|
|
44
|
+
// 平台类型,用于判断是 PC / H5
|
|
45
|
+
_defineProperty(_assertThisInitialized(_this), "scan", void 0);
|
|
46
|
+
return _this;
|
|
47
|
+
}
|
|
48
|
+
_createClass(BookingTicketImpl, [{
|
|
49
|
+
key: "initialize",
|
|
50
|
+
value: function () {
|
|
51
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
52
|
+
var _this$otherParams,
|
|
53
|
+
_this$otherParams2,
|
|
54
|
+
_this$otherParams3,
|
|
55
|
+
_this2 = this;
|
|
56
|
+
var targetCacheData, sessionData, _data, moduleArr;
|
|
57
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
58
|
+
while (1) switch (_context.prev = _context.next) {
|
|
59
|
+
case 0:
|
|
60
|
+
this.core = core;
|
|
61
|
+
this.store = options.store || {};
|
|
62
|
+
this.otherParams = options.otherParams || {};
|
|
63
|
+
console.log('[BookingTicket] 初始化完成');
|
|
64
|
+
|
|
65
|
+
// 获取依赖的插件
|
|
66
|
+
this.request = core.getPlugin('request');
|
|
67
|
+
this.window = core.getPlugin('window');
|
|
68
|
+
this.shopStore = core.getPlugin('shopStore');
|
|
69
|
+
if (this.request) {
|
|
70
|
+
_context.next = 9;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
throw new Error('bookingTicket解决方案需要 request 插件支持');
|
|
74
|
+
case 9:
|
|
75
|
+
if (this.shopStore) {
|
|
76
|
+
_context.next = 11;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
throw new Error('bookingTicket解决方案需要 shopStore 插件支持');
|
|
80
|
+
case 11:
|
|
81
|
+
// 如果有传 cacheid,默认需要收集上面这些模块里用户操作选中的数据
|
|
82
|
+
targetCacheData = {};
|
|
83
|
+
this.cacheId = (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.cacheId;
|
|
84
|
+
this.platform = (_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.platform;
|
|
85
|
+
this.scan = new Scan(this, 'BOOKING_TICKET_SCAN');
|
|
86
|
+
if ((_this$otherParams3 = this.otherParams) !== null && _this$otherParams3 !== void 0 && _this$otherParams3.cacheId) {
|
|
87
|
+
sessionData = this.window.sessionStorage.getItem(this.name);
|
|
88
|
+
if (sessionData) {
|
|
89
|
+
_data = JSON.parse(sessionData);
|
|
90
|
+
targetCacheData = _data[this.otherParams.cacheId];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
moduleArr = ['cart', 'products', 'accountList', 'customer', 'order'];
|
|
94
|
+
moduleArr.forEach(function (step) {
|
|
95
|
+
var targetModule = createModule(step, _this2.name);
|
|
96
|
+
if (targetModule) {
|
|
97
|
+
var _targetCacheData, _this2$otherParams, _this2$otherParams2;
|
|
98
|
+
_this2.store[step] = targetModule;
|
|
99
|
+
_this2.core.registerModule(targetModule, {
|
|
100
|
+
initialState: (_targetCacheData = targetCacheData) === null || _targetCacheData === void 0 ? void 0 : _targetCacheData[targetModule.name],
|
|
101
|
+
otherParams: _objectSpread(_objectSpread({}, _this2.otherParams), {}, {
|
|
102
|
+
fatherModule: _this2.name,
|
|
103
|
+
openCache: (_this2$otherParams = _this2.otherParams) !== null && _this2$otherParams !== void 0 && _this2$otherParams.cacheId ? true : false,
|
|
104
|
+
cacheId: (_this2$otherParams2 = _this2.otherParams) === null || _this2$otherParams2 === void 0 ? void 0 : _this2$otherParams2.cacheId
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
} else {
|
|
108
|
+
throw new Error("\u6A21\u5757 ".concat(step, " \u4E0D\u5B58\u5728"));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
this.core.effects.emit(BookingTicketHooks.onInited, {});
|
|
112
|
+
case 19:
|
|
113
|
+
case "end":
|
|
114
|
+
return _context.stop();
|
|
115
|
+
}
|
|
116
|
+
}, _callee, this);
|
|
117
|
+
}));
|
|
118
|
+
function initialize(_x, _x2) {
|
|
119
|
+
return _initialize.apply(this, arguments);
|
|
120
|
+
}
|
|
121
|
+
return initialize;
|
|
122
|
+
}()
|
|
123
|
+
/**
|
|
124
|
+
* 获取商品列表
|
|
125
|
+
* @param params 包含 schedule_date 的参数
|
|
126
|
+
* @returns 商品列表
|
|
127
|
+
*/
|
|
128
|
+
}, {
|
|
129
|
+
key: "loadProducts",
|
|
130
|
+
value: (function () {
|
|
131
|
+
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
132
|
+
var params,
|
|
133
|
+
schedule_date,
|
|
134
|
+
customer_id,
|
|
135
|
+
menu_list_ids,
|
|
136
|
+
schedule_datetime,
|
|
137
|
+
result,
|
|
138
|
+
_args2 = arguments;
|
|
139
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
140
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
141
|
+
case 0:
|
|
142
|
+
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
143
|
+
schedule_date = params.schedule_date, customer_id = params.customer_id, menu_list_ids = params.menu_list_ids, schedule_datetime = params.schedule_datetime;
|
|
144
|
+
_context2.prev = 2;
|
|
145
|
+
_context2.next = 5;
|
|
146
|
+
return this.store.products.loadProducts(_objectSpread(_objectSpread({
|
|
147
|
+
with_count: ['bundleGroup', 'optionGroup'],
|
|
148
|
+
with_schedule: 1
|
|
149
|
+
}, params), {}, {
|
|
150
|
+
cacheId: this.cacheId
|
|
151
|
+
}));
|
|
152
|
+
case 5:
|
|
153
|
+
result = _context2.sent;
|
|
154
|
+
this.core.effects.emit(BookingTicketHooks.onProductsLoaded, result);
|
|
155
|
+
return _context2.abrupt("return", result);
|
|
156
|
+
case 10:
|
|
157
|
+
_context2.prev = 10;
|
|
158
|
+
_context2.t0 = _context2["catch"](2);
|
|
159
|
+
console.error('Failed to load products:', _context2.t0);
|
|
160
|
+
throw _context2.t0;
|
|
161
|
+
case 14:
|
|
162
|
+
case "end":
|
|
163
|
+
return _context2.stop();
|
|
164
|
+
}
|
|
165
|
+
}, _callee2, this, [[2, 10]]);
|
|
166
|
+
}));
|
|
167
|
+
function loadProducts() {
|
|
168
|
+
return _loadProducts.apply(this, arguments);
|
|
169
|
+
}
|
|
170
|
+
return loadProducts;
|
|
171
|
+
}()
|
|
172
|
+
/**
|
|
173
|
+
* 获取商品列表(不加载到模块中)
|
|
174
|
+
* @returns 商品列表
|
|
175
|
+
*/
|
|
176
|
+
)
|
|
177
|
+
}, {
|
|
178
|
+
key: "getProducts",
|
|
179
|
+
value: (function () {
|
|
180
|
+
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
181
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
182
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
183
|
+
case 0:
|
|
184
|
+
return _context3.abrupt("return", this.store.products.getProducts());
|
|
185
|
+
case 1:
|
|
186
|
+
case "end":
|
|
187
|
+
return _context3.stop();
|
|
188
|
+
}
|
|
189
|
+
}, _callee3, this);
|
|
190
|
+
}));
|
|
191
|
+
function getProducts() {
|
|
192
|
+
return _getProducts.apply(this, arguments);
|
|
193
|
+
}
|
|
194
|
+
return getProducts;
|
|
195
|
+
}()
|
|
196
|
+
/**
|
|
197
|
+
* 获取客户列表
|
|
198
|
+
* @param params 查询参数
|
|
199
|
+
* @returns 客户列表响应
|
|
200
|
+
*/
|
|
201
|
+
)
|
|
202
|
+
}, {
|
|
203
|
+
key: "getCustomerList",
|
|
204
|
+
value: (function () {
|
|
205
|
+
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
206
|
+
var params,
|
|
207
|
+
result,
|
|
208
|
+
_args4 = arguments;
|
|
209
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
210
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
211
|
+
case 0:
|
|
212
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
213
|
+
_context4.prev = 1;
|
|
214
|
+
_context4.next = 4;
|
|
215
|
+
return this.store.customer.getCustomerList(params);
|
|
216
|
+
case 4:
|
|
217
|
+
result = _context4.sent;
|
|
218
|
+
return _context4.abrupt("return", result);
|
|
219
|
+
case 8:
|
|
220
|
+
_context4.prev = 8;
|
|
221
|
+
_context4.t0 = _context4["catch"](1);
|
|
222
|
+
console.error('Failed to get customer list:', _context4.t0);
|
|
223
|
+
throw _context4.t0;
|
|
224
|
+
case 12:
|
|
225
|
+
case "end":
|
|
226
|
+
return _context4.stop();
|
|
227
|
+
}
|
|
228
|
+
}, _callee4, this, [[1, 8]]);
|
|
229
|
+
}));
|
|
230
|
+
function getCustomerList() {
|
|
231
|
+
return _getCustomerList.apply(this, arguments);
|
|
232
|
+
}
|
|
233
|
+
return getCustomerList;
|
|
234
|
+
}()
|
|
235
|
+
/**
|
|
236
|
+
* 设置活跃客户
|
|
237
|
+
* @param customer 客户信息
|
|
238
|
+
*/
|
|
239
|
+
)
|
|
240
|
+
}, {
|
|
241
|
+
key: "setActiveCustomer",
|
|
242
|
+
value: function setActiveCustomer(customer) {
|
|
243
|
+
this.store.customer.setSelectedCustomer(customer);
|
|
244
|
+
this.core.effects.emit(BookingTicketHooks.onCustomerSelected, {
|
|
245
|
+
customer: customer
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* 获取当前活跃客户
|
|
251
|
+
* @returns 当前活跃客户
|
|
252
|
+
*/
|
|
253
|
+
}, {
|
|
254
|
+
key: "getActiveCustomer",
|
|
255
|
+
value: function getActiveCustomer() {
|
|
256
|
+
return this.store.customer.getSelectedCustomer();
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* 根据ID设置选中的客户
|
|
261
|
+
* @param customerId 客户ID
|
|
262
|
+
*/
|
|
263
|
+
}, {
|
|
264
|
+
key: "setSelectedCustomerById",
|
|
265
|
+
value: function setSelectedCustomerById(customerId) {
|
|
266
|
+
var customer = this.store.customer.getCustomerById(customerId);
|
|
267
|
+
if (customer) {
|
|
268
|
+
this.store.customer.setSelectedCustomer(customer);
|
|
269
|
+
this.core.effects.emit(BookingTicketHooks.onCustomerSelected, {
|
|
270
|
+
customer: customer
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* 获取所有客户
|
|
277
|
+
* @returns 客户列表
|
|
278
|
+
*/
|
|
279
|
+
}, {
|
|
280
|
+
key: "getCustomers",
|
|
281
|
+
value: function getCustomers() {
|
|
282
|
+
return this.store.customer.getCustomers();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* 根据ID获取客户
|
|
287
|
+
* @param customerId 客户ID
|
|
288
|
+
* @returns 客户信息
|
|
289
|
+
*/
|
|
290
|
+
}, {
|
|
291
|
+
key: "getCustomerById",
|
|
292
|
+
value: function getCustomerById(customerId) {
|
|
293
|
+
return this.store.customer.getCustomerById(customerId);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* 清空客户列表
|
|
298
|
+
*/
|
|
299
|
+
}, {
|
|
300
|
+
key: "clearCustomers",
|
|
301
|
+
value: function clearCustomers() {
|
|
302
|
+
this.store.customer.clearCustomers();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* 添加客户到列表第一位
|
|
307
|
+
* @param customer 要添加的客户信息
|
|
308
|
+
*/
|
|
309
|
+
}, {
|
|
310
|
+
key: "addCustomerToFirst",
|
|
311
|
+
value: function addCustomerToFirst(customer) {
|
|
312
|
+
this.store.customer.addCustomerToFirst(customer);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* 获取客户分页信息
|
|
317
|
+
* @returns 分页信息
|
|
318
|
+
*/
|
|
319
|
+
}, {
|
|
320
|
+
key: "getCustomerPaginationInfo",
|
|
321
|
+
value: function getCustomerPaginationInfo() {
|
|
322
|
+
return this.store.customer.getPaginationInfo();
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* 获取客户列表总数
|
|
327
|
+
* @returns 总数
|
|
328
|
+
*/
|
|
329
|
+
}, {
|
|
330
|
+
key: "getCustomerTotal",
|
|
331
|
+
value: function getCustomerTotal() {
|
|
332
|
+
return this.store.customer.getState().total;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* 设置客户分页信息
|
|
337
|
+
* @param page 页码
|
|
338
|
+
* @param pageSize 每页数量
|
|
339
|
+
*/
|
|
340
|
+
}, {
|
|
341
|
+
key: "setCustomerPaginationInfo",
|
|
342
|
+
value: function setCustomerPaginationInfo(page, pageSize) {
|
|
343
|
+
this.store.customer.setPaginationInfo(page, pageSize);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* 便捷方法:切换客户分页并自动获取数据
|
|
348
|
+
* @param page 页码
|
|
349
|
+
* @param pageSize 每页数量(可选)
|
|
350
|
+
* @returns 客户列表响应
|
|
351
|
+
*/
|
|
352
|
+
}, {
|
|
353
|
+
key: "changeCustomerPage",
|
|
354
|
+
value: (function () {
|
|
355
|
+
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(page, pageSize) {
|
|
356
|
+
var result;
|
|
357
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
358
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
359
|
+
case 0:
|
|
360
|
+
_context5.prev = 0;
|
|
361
|
+
_context5.next = 3;
|
|
362
|
+
return this.store.customer.changeCustomerPage(page, pageSize);
|
|
363
|
+
case 3:
|
|
364
|
+
result = _context5.sent;
|
|
365
|
+
return _context5.abrupt("return", result);
|
|
366
|
+
case 7:
|
|
367
|
+
_context5.prev = 7;
|
|
368
|
+
_context5.t0 = _context5["catch"](0);
|
|
369
|
+
console.error('Failed to change customer page:', _context5.t0);
|
|
370
|
+
throw _context5.t0;
|
|
371
|
+
case 11:
|
|
372
|
+
case "end":
|
|
373
|
+
return _context5.stop();
|
|
374
|
+
}
|
|
375
|
+
}, _callee5, this, [[0, 7]]);
|
|
376
|
+
}));
|
|
377
|
+
function changeCustomerPage(_x3, _x4) {
|
|
378
|
+
return _changeCustomerPage.apply(this, arguments);
|
|
379
|
+
}
|
|
380
|
+
return changeCustomerPage;
|
|
381
|
+
}()
|
|
382
|
+
/**
|
|
383
|
+
* 全局扫描监听
|
|
384
|
+
* @param callback 回调
|
|
385
|
+
*/
|
|
386
|
+
)
|
|
387
|
+
}, {
|
|
388
|
+
key: "scanGlobalListener",
|
|
389
|
+
value: function scanGlobalListener(callback) {
|
|
390
|
+
var listenerCallback = handleGlobalScan(this.request);
|
|
391
|
+
var listener = {
|
|
392
|
+
key: 'global',
|
|
393
|
+
callback: callback
|
|
394
|
+
};
|
|
395
|
+
var removeListener = this.scan.addListener(listener, listenerCallback);
|
|
396
|
+
return removeListener;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* 客户扫描监听
|
|
401
|
+
* @param callback 回调
|
|
402
|
+
*/
|
|
403
|
+
}, {
|
|
404
|
+
key: "scanCustomerListener",
|
|
405
|
+
value: function scanCustomerListener(callback) {
|
|
406
|
+
var listenerCallback = handleCustomerScan(this.request);
|
|
407
|
+
var listener = {
|
|
408
|
+
key: 'customer',
|
|
409
|
+
callback: callback
|
|
410
|
+
};
|
|
411
|
+
var removeListener = this.scan.addListener(listener, listenerCallback);
|
|
412
|
+
return removeListener;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* 设置其他参数
|
|
417
|
+
* @param params 参数
|
|
418
|
+
* @param options 选项
|
|
419
|
+
*/
|
|
420
|
+
}, {
|
|
421
|
+
key: "setOtherParams",
|
|
422
|
+
value: (function () {
|
|
423
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
|
|
424
|
+
var _ref,
|
|
425
|
+
_ref$cover,
|
|
426
|
+
cover,
|
|
427
|
+
_args6 = arguments;
|
|
428
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
429
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
430
|
+
case 0:
|
|
431
|
+
_ref = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {}, _ref$cover = _ref.cover, cover = _ref$cover === void 0 ? false : _ref$cover;
|
|
432
|
+
if (cover) {
|
|
433
|
+
this.otherParams = params;
|
|
434
|
+
} else {
|
|
435
|
+
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
436
|
+
}
|
|
437
|
+
case 2:
|
|
438
|
+
case "end":
|
|
439
|
+
return _context6.stop();
|
|
440
|
+
}
|
|
441
|
+
}, _callee6, this);
|
|
442
|
+
}));
|
|
443
|
+
function setOtherParams(_x5) {
|
|
444
|
+
return _setOtherParams.apply(this, arguments);
|
|
445
|
+
}
|
|
446
|
+
return setOtherParams;
|
|
447
|
+
}()
|
|
448
|
+
/**
|
|
449
|
+
* 获取其他参数
|
|
450
|
+
* @returns 其他参数
|
|
451
|
+
*/
|
|
452
|
+
)
|
|
453
|
+
}, {
|
|
454
|
+
key: "getOtherParams",
|
|
455
|
+
value: (function () {
|
|
456
|
+
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
457
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
458
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
459
|
+
case 0:
|
|
460
|
+
return _context7.abrupt("return", this.otherParams);
|
|
461
|
+
case 1:
|
|
462
|
+
case "end":
|
|
463
|
+
return _context7.stop();
|
|
464
|
+
}
|
|
465
|
+
}, _callee7, this);
|
|
466
|
+
}));
|
|
467
|
+
function getOtherParams() {
|
|
468
|
+
return _getOtherParams.apply(this, arguments);
|
|
469
|
+
}
|
|
470
|
+
return getOtherParams;
|
|
471
|
+
}()
|
|
472
|
+
/**
|
|
473
|
+
* 销毁模块
|
|
474
|
+
*/
|
|
475
|
+
)
|
|
476
|
+
}, {
|
|
477
|
+
key: "destroy",
|
|
478
|
+
value: function destroy() {
|
|
479
|
+
var _this$store$cart, _this$store$products, _this$store$accountLi, _this$store$customer, _this$store$order;
|
|
480
|
+
(_this$store$cart = this.store.cart) === null || _this$store$cart === void 0 || _this$store$cart.destroy();
|
|
481
|
+
(_this$store$products = this.store.products) === null || _this$store$products === void 0 || _this$store$products.destroy();
|
|
482
|
+
(_this$store$accountLi = this.store.accountList) === null || _this$store$accountLi === void 0 || _this$store$accountLi.destroy();
|
|
483
|
+
(_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 || _this$store$customer.destroy();
|
|
484
|
+
(_this$store$order = this.store.order) === null || _this$store$order === void 0 || _this$store$order.destroy();
|
|
485
|
+
this.core.effects.offByModuleDestroy(this.name);
|
|
486
|
+
this.core.unregisterModule(this);
|
|
487
|
+
}
|
|
488
|
+
}]);
|
|
489
|
+
return BookingTicketImpl;
|
|
490
|
+
}(BaseModule);
|
|
491
|
+
|
|
492
|
+
// 导出相关类型和实现
|
|
493
|
+
export * from "./types";
|
|
494
|
+
export { BookingTicketImpl as BookingTicket };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ProductList, CartModule, AccountListModule, OrderModule } from '../../modules';
|
|
2
|
+
import { CustomerModule } from '../../modules/Customer';
|
|
3
|
+
export interface BookingTicketState {
|
|
4
|
+
cart: CartModule;
|
|
5
|
+
products: ProductList;
|
|
6
|
+
accountList: AccountListModule;
|
|
7
|
+
customer: CustomerModule;
|
|
8
|
+
order: OrderModule;
|
|
9
|
+
}
|
|
10
|
+
export declare function createModule<T extends keyof BookingTicketState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingTicketState[T];
|
|
11
|
+
export declare enum BookingTicketHooks {
|
|
12
|
+
onInited = "bookingTicket:onInited",
|
|
13
|
+
onDestroy = "bookingTicket:onDestroy",
|
|
14
|
+
onProductsLoaded = "bookingTicket:onProductsLoaded",
|
|
15
|
+
onCustomerSelected = "bookingTicket:onCustomerSelected"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 获取客户列表的参数
|
|
19
|
+
*/
|
|
20
|
+
export interface IGetCustomerListParams {
|
|
21
|
+
/** 页码 */
|
|
22
|
+
skip?: number;
|
|
23
|
+
/** 每页数量 */
|
|
24
|
+
num?: number;
|
|
25
|
+
/** 搜索关键词 */
|
|
26
|
+
search?: string;
|
|
27
|
+
/** 其他筛选参数 */
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 客户信息
|
|
32
|
+
*/
|
|
33
|
+
export interface ICustomer {
|
|
34
|
+
/** 客户ID */
|
|
35
|
+
id: string | number;
|
|
36
|
+
/** 客户姓名 */
|
|
37
|
+
name: string;
|
|
38
|
+
/** 客户电话 */
|
|
39
|
+
phone?: string;
|
|
40
|
+
/** 客户邮箱 */
|
|
41
|
+
email?: string;
|
|
42
|
+
/** 其他客户信息 */
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 加载商品列表的参数
|
|
47
|
+
*/
|
|
48
|
+
export interface ILoadProductsParams {
|
|
49
|
+
/** 日期 格式:YYYY-MM-DD */
|
|
50
|
+
schedule_date?: string;
|
|
51
|
+
/** 客户ID */
|
|
52
|
+
customer_id?: number;
|
|
53
|
+
/** 餐牌列表ID */
|
|
54
|
+
menu_list_ids?: number[];
|
|
55
|
+
/** 时间 格式:YYYY-MM-DD HH:mm:ss*/
|
|
56
|
+
schedule_datetime?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 扫描结果
|
|
60
|
+
*/
|
|
61
|
+
export interface IScanResult {
|
|
62
|
+
status: 'success' | 'fail';
|
|
63
|
+
scanType: string;
|
|
64
|
+
scanCode: string;
|
|
65
|
+
result: any;
|
|
66
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ProductList, CartModule, AccountListModule, OrderModule } from "../../modules";
|
|
2
|
+
import { CustomerModule } from "../../modules/Customer";
|
|
3
|
+
export function createModule(moduleName, solutionName, name, version) {
|
|
4
|
+
switch (moduleName) {
|
|
5
|
+
case 'cart':
|
|
6
|
+
return new CartModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
7
|
+
case 'products':
|
|
8
|
+
return new ProductList("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
9
|
+
case 'accountList':
|
|
10
|
+
return new AccountListModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
11
|
+
case 'customer':
|
|
12
|
+
return new CustomerModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
13
|
+
case 'order':
|
|
14
|
+
return new OrderModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
15
|
+
default:
|
|
16
|
+
throw new Error("Unknown module type: ".concat(moduleName));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export var BookingTicketHooks = /*#__PURE__*/function (BookingTicketHooks) {
|
|
20
|
+
BookingTicketHooks["onInited"] = "bookingTicket:onInited";
|
|
21
|
+
BookingTicketHooks["onDestroy"] = "bookingTicket:onDestroy";
|
|
22
|
+
BookingTicketHooks["onProductsLoaded"] = "bookingTicket:onProductsLoaded";
|
|
23
|
+
BookingTicketHooks["onCustomerSelected"] = "bookingTicket:onCustomerSelected";
|
|
24
|
+
return BookingTicketHooks;
|
|
25
|
+
}({});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 获取客户列表的参数
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 客户信息
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 加载商品列表的参数
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 扫描结果
|
|
41
|
+
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RequestPlugin } from '../../../../plugins';
|
|
2
|
+
/**
|
|
3
|
+
* 搜索通用识别码
|
|
4
|
+
*/
|
|
5
|
+
export declare const searchWalletPass: (request: RequestPlugin, code: string) => Promise<{
|
|
6
|
+
searchType: string;
|
|
7
|
+
response: any;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* 搜索钱包
|
|
11
|
+
*/
|
|
12
|
+
export declare const searchWallet: (request: RequestPlugin, code: string) => Promise<{
|
|
13
|
+
searchType: string;
|
|
14
|
+
response: any;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* 搜索商品
|
|
18
|
+
*/
|
|
19
|
+
export declare const searchProduct: (request: RequestPlugin, code: string) => Promise<{
|
|
20
|
+
searchType: string;
|
|
21
|
+
response: any;
|
|
22
|
+
}>;
|