@pisell/pisellos 3.0.56 → 3.0.57
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/Cart/index.js +1 -1
- package/dist/modules/Cart/utils/changePrice.d.ts +2 -2
- package/dist/modules/Cart/utils/changePrice.js +1 -1
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Customer/constants.js +12 -0
- package/dist/modules/Customer/index.d.ts +122 -0
- package/dist/modules/Customer/index.js +697 -0
- package/dist/modules/Customer/types.d.ts +146 -0
- package/dist/modules/Customer/types.js +41 -0
- package/dist/modules/Payment/cash.d.ts +11 -0
- package/dist/modules/Payment/cash.js +78 -0
- package/dist/modules/Payment/eftpos.d.ts +11 -0
- package/dist/modules/Payment/eftpos.js +80 -0
- package/dist/modules/Payment/index.d.ts +273 -9
- package/dist/modules/Payment/index.js +2525 -109
- package/dist/modules/Payment/types.d.ts +382 -30
- package/dist/modules/Payment/types.js +116 -14
- package/dist/modules/Payment/wallet.d.ts +11 -0
- package/dist/modules/Payment/wallet.js +78 -0
- package/dist/modules/Payment/walletpass.d.ts +0 -0
- package/dist/modules/Payment/walletpass.js +0 -0
- package/dist/modules/ProductList/index.d.ts +13 -3
- package/dist/modules/ProductList/index.js +52 -42
- package/dist/modules/ProductList/types.d.ts +0 -1
- package/dist/modules/Rules/index.js +27 -14
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/app-types/app/app.d.ts +83 -0
- package/dist/plugins/app-types/app/const.d.ts +4 -0
- package/dist/plugins/app-types/app/index.d.ts +14 -0
- package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/dist/plugins/app-types/config.d.ts +3 -0
- package/dist/plugins/app-types/cookie/index.d.ts +13 -0
- package/dist/plugins/app-types/data/index.d.ts +8 -0
- package/dist/plugins/app-types/history/config.d.ts +24 -0
- package/dist/plugins/app-types/history/index.d.ts +20 -0
- package/dist/plugins/app-types/history/type.d.ts +2 -0
- package/dist/plugins/app-types/hooks/index.d.ts +12 -0
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/dist/plugins/app-types/index.d.ts +6 -0
- package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
- package/dist/plugins/app-types/locales/en.d.ts +3 -0
- package/dist/plugins/app-types/locales/index.d.ts +37 -0
- package/dist/plugins/app-types/locales/original.d.ts +3 -0
- package/dist/plugins/app-types/locales/type.d.ts +19 -0
- package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
- package/dist/plugins/app-types/logger/index.d.ts +122 -0
- package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
- package/dist/plugins/app-types/models/global.d.ts +32 -0
- package/dist/plugins/app-types/models/index.d.ts +45 -0
- package/dist/plugins/app-types/models/type.d.ts +2 -0
- package/dist/plugins/app-types/package.json +15 -0
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
- package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
- package/dist/plugins/app-types/request/cache.d.ts +46 -0
- package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/dist/plugins/app-types/request/config.d.ts +3 -0
- package/dist/plugins/app-types/request/constants.d.ts +2 -0
- package/dist/plugins/app-types/request/index.d.ts +24 -0
- package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/dist/plugins/app-types/request/type.d.ts +41 -0
- package/dist/plugins/app-types/request/utils.d.ts +46 -0
- package/dist/plugins/app-types/routes/config.d.ts +7 -0
- package/dist/plugins/app-types/routes/index.d.ts +28 -0
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
- package/dist/plugins/app-types/socket/constants.d.ts +33 -0
- package/dist/plugins/app-types/socket/events.d.ts +31 -0
- package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/dist/plugins/app-types/socket/index.d.ts +61 -0
- package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
- package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/dist/plugins/app-types/socket/socket.d.ts +129 -0
- package/dist/plugins/app-types/socket/types.d.ts +85 -0
- package/dist/plugins/app-types/storage/index.d.ts +17 -0
- package/dist/plugins/app-types/tasks/index.d.ts +77 -0
- package/dist/plugins/app-types/tasks/type.d.ts +62 -0
- package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/dist/plugins/app-types/type.d.ts +2 -0
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/dist/plugins/app-types/variables/config.d.ts +3 -0
- package/dist/plugins/app-types/variables/index.d.ts +6 -0
- package/dist/plugins/app-types/variables/type.d.ts +2 -0
- package/dist/plugins/app-types/website/index.d.ts +6 -0
- package/dist/plugins/app.d.ts +8 -0
- package/dist/plugins/app.js +1 -0
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingByStep/index.js +59 -35
- package/dist/solution/BookingByStep/types.d.ts +3 -2
- package/dist/solution/BookingTicket/index.d.ts +172 -0
- package/dist/solution/BookingTicket/index.js +665 -0
- package/dist/solution/BookingTicket/types.d.ts +68 -0
- package/dist/solution/BookingTicket/types.js +43 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +16 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +174 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +285 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
- package/dist/solution/BuyTickets/index.d.ts +2 -2
- package/dist/solution/BuyTickets/index.js +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +181 -0
- package/dist/solution/Checkout/index.js +1596 -0
- package/dist/solution/Checkout/types.d.ts +550 -0
- package/dist/solution/Checkout/types.js +132 -0
- package/dist/solution/Checkout/utils/index.d.ts +73 -0
- package/dist/solution/Checkout/utils/index.js +371 -0
- package/dist/solution/ShopDiscount/index.js +4 -2
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/utils/task.d.ts +40 -0
- package/dist/utils/task.js +171 -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/Cart/index.js +1 -1
- package/lib/modules/Cart/utils/changePrice.d.ts +2 -2
- package/lib/modules/Cart/utils/changePrice.js +1 -1
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Customer/constants.js +39 -0
- package/lib/modules/Customer/index.d.ts +122 -0
- package/lib/modules/Customer/index.js +440 -0
- package/lib/modules/Customer/types.d.ts +146 -0
- package/lib/modules/Customer/types.js +37 -0
- package/lib/modules/Payment/cash.d.ts +11 -0
- package/lib/modules/Payment/cash.js +51 -0
- package/lib/modules/Payment/eftpos.d.ts +11 -0
- package/lib/modules/Payment/eftpos.js +51 -0
- package/lib/modules/Payment/index.d.ts +273 -9
- package/lib/modules/Payment/index.js +1285 -50
- package/lib/modules/Payment/types.d.ts +382 -30
- package/lib/modules/Payment/types.js +41 -6
- package/lib/modules/Payment/wallet.d.ts +11 -0
- package/lib/modules/Payment/wallet.js +51 -0
- package/lib/modules/Payment/walletpass.d.ts +0 -0
- package/lib/modules/Payment/walletpass.js +0 -0
- package/lib/modules/ProductList/index.d.ts +13 -3
- package/lib/modules/ProductList/index.js +37 -26
- package/lib/modules/ProductList/types.d.ts +0 -1
- package/lib/modules/Rules/index.js +20 -12
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -0
- package/lib/plugins/app-types/app/app.d.ts +83 -0
- package/lib/plugins/app-types/app/const.d.ts +4 -0
- package/lib/plugins/app-types/app/index.d.ts +14 -0
- package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/lib/plugins/app-types/config.d.ts +3 -0
- package/lib/plugins/app-types/cookie/index.d.ts +13 -0
- package/lib/plugins/app-types/data/index.d.ts +8 -0
- package/lib/plugins/app-types/history/config.d.ts +24 -0
- package/lib/plugins/app-types/history/index.d.ts +20 -0
- package/lib/plugins/app-types/history/type.d.ts +2 -0
- package/lib/plugins/app-types/hooks/index.d.ts +12 -0
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/lib/plugins/app-types/index.d.ts +6 -0
- package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
- package/lib/plugins/app-types/locales/en.d.ts +3 -0
- package/lib/plugins/app-types/locales/index.d.ts +37 -0
- package/lib/plugins/app-types/locales/original.d.ts +3 -0
- package/lib/plugins/app-types/locales/type.d.ts +19 -0
- package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
- package/lib/plugins/app-types/logger/index.d.ts +122 -0
- package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
- package/lib/plugins/app-types/models/global.d.ts +32 -0
- package/lib/plugins/app-types/models/index.d.ts +45 -0
- package/lib/plugins/app-types/models/type.d.ts +2 -0
- package/lib/plugins/app-types/package.json +15 -0
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
- package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
- package/lib/plugins/app-types/request/cache.d.ts +46 -0
- package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/lib/plugins/app-types/request/config.d.ts +3 -0
- package/lib/plugins/app-types/request/constants.d.ts +2 -0
- package/lib/plugins/app-types/request/index.d.ts +24 -0
- package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/lib/plugins/app-types/request/type.d.ts +41 -0
- package/lib/plugins/app-types/request/utils.d.ts +46 -0
- package/lib/plugins/app-types/routes/config.d.ts +7 -0
- package/lib/plugins/app-types/routes/index.d.ts +28 -0
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
- package/lib/plugins/app-types/socket/constants.d.ts +33 -0
- package/lib/plugins/app-types/socket/events.d.ts +31 -0
- package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/lib/plugins/app-types/socket/index.d.ts +61 -0
- package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
- package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/lib/plugins/app-types/socket/socket.d.ts +129 -0
- package/lib/plugins/app-types/socket/types.d.ts +85 -0
- package/lib/plugins/app-types/storage/index.d.ts +17 -0
- package/lib/plugins/app-types/tasks/index.d.ts +77 -0
- package/lib/plugins/app-types/tasks/type.d.ts +62 -0
- package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/lib/plugins/app-types/type.d.ts +2 -0
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/lib/plugins/app-types/variables/config.d.ts +3 -0
- package/lib/plugins/app-types/variables/index.d.ts +6 -0
- package/lib/plugins/app-types/variables/type.d.ts +2 -0
- package/lib/plugins/app-types/website/index.d.ts +6 -0
- package/lib/plugins/app.d.ts +8 -0
- package/lib/plugins/app.js +17 -0
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingByStep/index.js +40 -29
- package/lib/solution/BookingByStep/types.d.ts +3 -2
- package/lib/solution/BookingTicket/index.d.ts +172 -0
- package/lib/solution/BookingTicket/index.js +399 -0
- package/lib/solution/BookingTicket/types.d.ts +68 -0
- package/lib/solution/BookingTicket/types.js +72 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +16 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +125 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +210 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
- package/lib/solution/BuyTickets/index.d.ts +2 -2
- package/lib/solution/BuyTickets/index.js +1 -1
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +181 -0
- package/lib/solution/Checkout/index.js +864 -0
- package/lib/solution/Checkout/types.d.ts +550 -0
- package/lib/solution/Checkout/types.js +75 -0
- package/lib/solution/Checkout/utils/index.d.ts +73 -0
- package/lib/solution/Checkout/utils/index.js +266 -0
- package/lib/solution/ShopDiscount/index.js +2 -1
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/utils/task.d.ts +40 -0
- package/lib/utils/task.js +109 -0
- package/lib/utils/watch.d.ts +102 -0
- package/lib/utils/watch.js +217 -0
- package/package.json +4 -2
package/dist/core/index.js
CHANGED
|
@@ -67,7 +67,8 @@ var PisellOSCore = /*#__PURE__*/function () {
|
|
|
67
67
|
console.log("".concat(prefix, " ").concat(message));
|
|
68
68
|
break;
|
|
69
69
|
case 'warn':
|
|
70
|
-
console.
|
|
70
|
+
// 使用 console.log 避免显示堆栈跟踪,提升性能
|
|
71
|
+
console.log("%c".concat(prefix, "%c ").concat(message), 'color: #f59e0b; font-weight: bold;', 'color: #f59e0b;');
|
|
71
72
|
break;
|
|
72
73
|
case 'error':
|
|
73
74
|
console.error("".concat(prefix, " ").concat(message));
|
package/dist/effects/index.d.ts
CHANGED
|
@@ -2,16 +2,17 @@ type EffectCallback = (payload: any) => void | Promise<void | {
|
|
|
2
2
|
status: boolean;
|
|
3
3
|
message?: string;
|
|
4
4
|
}>;
|
|
5
|
+
type UnsubscribeFunction = () => void;
|
|
5
6
|
declare class EffectsManager {
|
|
6
7
|
private listeners;
|
|
7
|
-
on(event: string, callback: EffectCallback):
|
|
8
|
+
on(event: string, callback: EffectCallback): UnsubscribeFunction;
|
|
8
9
|
off(event: string, callback: EffectCallback): void;
|
|
9
10
|
offByModuleDestroy(module: string): void;
|
|
10
|
-
once(event: string, callback: EffectCallback):
|
|
11
|
+
once(event: string, callback: EffectCallback): UnsubscribeFunction;
|
|
11
12
|
emit(event: string, payload: any): Promise<{
|
|
12
13
|
status: boolean;
|
|
13
14
|
data: any;
|
|
14
15
|
}>;
|
|
15
16
|
clear(): void;
|
|
16
17
|
}
|
|
17
|
-
export { EffectsManager };
|
|
18
|
+
export { EffectsManager, UnsubscribeFunction };
|
package/dist/effects/index.js
CHANGED
|
@@ -11,6 +11,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
11
11
|
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; }
|
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
13
|
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); }
|
|
14
|
+
// 取消监听函数类型
|
|
14
15
|
var EffectsManager = /*#__PURE__*/function () {
|
|
15
16
|
function EffectsManager() {
|
|
16
17
|
_classCallCheck(this, EffectsManager);
|
|
@@ -19,9 +20,15 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
19
20
|
_createClass(EffectsManager, [{
|
|
20
21
|
key: "on",
|
|
21
22
|
value: function on(event, callback) {
|
|
22
|
-
var _this$listeners$get
|
|
23
|
+
var _this$listeners$get,
|
|
24
|
+
_this = this;
|
|
23
25
|
if (!this.listeners.has(event)) this.listeners.set(event, new Set());
|
|
24
26
|
(_this$listeners$get = this.listeners.get(event)) === null || _this$listeners$get === void 0 || _this$listeners$get.add(callback);
|
|
27
|
+
|
|
28
|
+
// 返回取消函数
|
|
29
|
+
return function () {
|
|
30
|
+
_this.off(event, callback);
|
|
31
|
+
};
|
|
25
32
|
}
|
|
26
33
|
}, {
|
|
27
34
|
key: "off",
|
|
@@ -34,17 +41,17 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
34
41
|
}, {
|
|
35
42
|
key: "offByModuleDestroy",
|
|
36
43
|
value: function offByModuleDestroy(module) {
|
|
37
|
-
var
|
|
44
|
+
var _this2 = this;
|
|
38
45
|
Array.from(this.listeners.keys()).forEach(function (item) {
|
|
39
46
|
if (item.startsWith(module)) {
|
|
40
|
-
|
|
47
|
+
_this2.listeners.delete(item);
|
|
41
48
|
}
|
|
42
49
|
});
|
|
43
50
|
}
|
|
44
51
|
}, {
|
|
45
52
|
key: "once",
|
|
46
53
|
value: function once(event, callback) {
|
|
47
|
-
var
|
|
54
|
+
var _this3 = this;
|
|
48
55
|
var wrapper = /*#__PURE__*/function () {
|
|
49
56
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(payload) {
|
|
50
57
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -53,7 +60,7 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
53
60
|
_context.next = 2;
|
|
54
61
|
return callback(payload);
|
|
55
62
|
case 2:
|
|
56
|
-
|
|
63
|
+
_this3.off(event, wrapper);
|
|
57
64
|
case 3:
|
|
58
65
|
case "end":
|
|
59
66
|
return _context.stop();
|
|
@@ -64,7 +71,9 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
64
71
|
return _ref.apply(this, arguments);
|
|
65
72
|
};
|
|
66
73
|
}();
|
|
67
|
-
|
|
74
|
+
|
|
75
|
+
// 调用修改后的on方法,它会返回取消函数
|
|
76
|
+
return this.on(event, wrapper);
|
|
68
77
|
}
|
|
69
78
|
}, {
|
|
70
79
|
key: "emit",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { AccountModule, Account } from '../Account';
|
|
3
3
|
import { BaseModule } from '../BaseModule';
|
|
4
|
-
import { IFetchHolderAccountsParams, IHolder } from './types';
|
|
4
|
+
import { IFetchHolderAccountsParams, IHolder, IGetCustomerListParams } from './types';
|
|
5
5
|
export declare class AccountListModule extends BaseModule implements Module {
|
|
6
6
|
protected defaultName: string;
|
|
7
7
|
protected defaultVersion: string;
|
|
@@ -37,6 +37,12 @@ export declare class AccountListModule extends BaseModule implements Module {
|
|
|
37
37
|
customerId: number;
|
|
38
38
|
type?: 'unshift' | 'push';
|
|
39
39
|
}): Promise<AccountModule[]>;
|
|
40
|
+
/**
|
|
41
|
+
* 获取客户列表
|
|
42
|
+
* @param params 查询参数
|
|
43
|
+
* @returns 客户列表
|
|
44
|
+
*/
|
|
45
|
+
getCustomerList(params?: IGetCustomerListParams): Promise<any>;
|
|
40
46
|
/**
|
|
41
47
|
* 获取holder类型账户列表
|
|
42
48
|
* @param params
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
var _excluded = ["page", "pageSize", "keyword"];
|
|
1
2
|
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); }
|
|
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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
9
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -504,6 +509,68 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
504
509
|
}
|
|
505
510
|
return addHolderAccounts;
|
|
506
511
|
}()
|
|
512
|
+
/**
|
|
513
|
+
* 获取客户列表
|
|
514
|
+
* @param params 查询参数
|
|
515
|
+
* @returns 客户列表
|
|
516
|
+
*/
|
|
517
|
+
)
|
|
518
|
+
}, {
|
|
519
|
+
key: "getCustomerList",
|
|
520
|
+
value: (function () {
|
|
521
|
+
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
522
|
+
var params,
|
|
523
|
+
url,
|
|
524
|
+
_params$page,
|
|
525
|
+
page,
|
|
526
|
+
_params$pageSize,
|
|
527
|
+
pageSize,
|
|
528
|
+
keyword,
|
|
529
|
+
otherParams,
|
|
530
|
+
queryParams,
|
|
531
|
+
res,
|
|
532
|
+
_args9 = arguments;
|
|
533
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
534
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
535
|
+
case 0:
|
|
536
|
+
params = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
|
|
537
|
+
url = '/customer/es/data';
|
|
538
|
+
_params$page = params.page, page = _params$page === void 0 ? 1 : _params$page, _params$pageSize = params.pageSize, pageSize = _params$pageSize === void 0 ? 20 : _params$pageSize, keyword = params.keyword, otherParams = _objectWithoutProperties(params, _excluded);
|
|
539
|
+
_context9.prev = 3;
|
|
540
|
+
this.store.isLoading = true;
|
|
541
|
+
this.store.error = null;
|
|
542
|
+
queryParams = _objectSpread(_objectSpread({
|
|
543
|
+
page: page,
|
|
544
|
+
pageSize: pageSize
|
|
545
|
+
}, keyword && {
|
|
546
|
+
keyword: keyword
|
|
547
|
+
}), otherParams);
|
|
548
|
+
_context9.next = 9;
|
|
549
|
+
return this.request.get(url, queryParams);
|
|
550
|
+
case 9:
|
|
551
|
+
res = _context9.sent;
|
|
552
|
+
return _context9.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || []);
|
|
553
|
+
case 13:
|
|
554
|
+
_context9.prev = 13;
|
|
555
|
+
_context9.t0 = _context9["catch"](3);
|
|
556
|
+
console.error('Failed to fetch customer list:', _context9.t0);
|
|
557
|
+
this.store.error = _context9.t0 instanceof Error ? _context9.t0.message : 'Failed to fetch customer list';
|
|
558
|
+
throw _context9.t0;
|
|
559
|
+
case 18:
|
|
560
|
+
_context9.prev = 18;
|
|
561
|
+
this.store.isLoading = false;
|
|
562
|
+
return _context9.finish(18);
|
|
563
|
+
case 21:
|
|
564
|
+
case "end":
|
|
565
|
+
return _context9.stop();
|
|
566
|
+
}
|
|
567
|
+
}, _callee9, this, [[3, 13, 18, 21]]);
|
|
568
|
+
}));
|
|
569
|
+
function getCustomerList() {
|
|
570
|
+
return _getCustomerList.apply(this, arguments);
|
|
571
|
+
}
|
|
572
|
+
return getCustomerList;
|
|
573
|
+
}()
|
|
507
574
|
/**
|
|
508
575
|
* 获取holder类型账户列表
|
|
509
576
|
* @param params
|
|
@@ -512,15 +579,15 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
512
579
|
}, {
|
|
513
580
|
key: "fetchHolderAccounts",
|
|
514
581
|
value: (function () {
|
|
515
|
-
var _fetchHolderAccounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
582
|
+
var _fetchHolderAccounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
|
|
516
583
|
var url, _ref, form_id, shop_id, num, skip, customer_id, _res$data, res;
|
|
517
|
-
return _regeneratorRuntime().wrap(function
|
|
518
|
-
while (1) switch (
|
|
584
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
585
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
519
586
|
case 0:
|
|
520
587
|
url = params.url || '/account/holder';
|
|
521
588
|
_ref = (params === null || params === void 0 ? void 0 : params.query) || {}, form_id = _ref.form_id, shop_id = _ref.shop_id, num = _ref.num, skip = _ref.skip, customer_id = _ref.customer_id;
|
|
522
|
-
|
|
523
|
-
|
|
589
|
+
_context10.prev = 2;
|
|
590
|
+
_context10.next = 5;
|
|
524
591
|
return this.request.get(url, {
|
|
525
592
|
customer_id: customer_id,
|
|
526
593
|
form_id: form_id,
|
|
@@ -529,30 +596,30 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
529
596
|
skip: skip || 1
|
|
530
597
|
});
|
|
531
598
|
case 5:
|
|
532
|
-
res =
|
|
599
|
+
res = _context10.sent;
|
|
533
600
|
this.store.accountList = [];
|
|
534
601
|
this.store.accounts = [];
|
|
535
602
|
if (!(res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && (_res$data = _res$data.list) !== null && _res$data !== void 0 && _res$data.length)) {
|
|
536
|
-
|
|
603
|
+
_context10.next = 11;
|
|
537
604
|
break;
|
|
538
605
|
}
|
|
539
|
-
|
|
606
|
+
_context10.next = 11;
|
|
540
607
|
return this.addHolderAccounts({
|
|
541
608
|
holders: res.data.list,
|
|
542
609
|
customerId: customer_id
|
|
543
610
|
});
|
|
544
611
|
case 11:
|
|
545
|
-
|
|
612
|
+
_context10.next = 16;
|
|
546
613
|
break;
|
|
547
614
|
case 13:
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
console.error(
|
|
615
|
+
_context10.prev = 13;
|
|
616
|
+
_context10.t0 = _context10["catch"](2);
|
|
617
|
+
console.error(_context10.t0);
|
|
551
618
|
case 16:
|
|
552
619
|
case "end":
|
|
553
|
-
return
|
|
620
|
+
return _context10.stop();
|
|
554
621
|
}
|
|
555
|
-
},
|
|
622
|
+
}, _callee10, this, [[2, 13]]);
|
|
556
623
|
}));
|
|
557
624
|
function fetchHolderAccounts(_x11) {
|
|
558
625
|
return _fetchHolderAccounts.apply(this, arguments);
|
|
@@ -67,3 +67,31 @@ export interface IHolder {
|
|
|
67
67
|
main_field: string;
|
|
68
68
|
customer_cover?: string;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* 获取客户列表参数
|
|
72
|
+
*/
|
|
73
|
+
export interface IGetCustomerListParams {
|
|
74
|
+
/** 页码 */
|
|
75
|
+
page?: number;
|
|
76
|
+
/** 每页数量 */
|
|
77
|
+
pageSize?: number;
|
|
78
|
+
/** 搜索关键词 */
|
|
79
|
+
keyword?: string;
|
|
80
|
+
/** 其他筛选参数 */
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 客户数据
|
|
85
|
+
*/
|
|
86
|
+
export interface ICustomer {
|
|
87
|
+
/** 客户ID */
|
|
88
|
+
id: string | number;
|
|
89
|
+
/** 客户姓名 */
|
|
90
|
+
name: string;
|
|
91
|
+
/** 客户电话 */
|
|
92
|
+
phone?: string;
|
|
93
|
+
/** 客户邮箱 */
|
|
94
|
+
email?: string;
|
|
95
|
+
/** 其他客户信息 */
|
|
96
|
+
[key: string]: any;
|
|
97
|
+
}
|
|
@@ -39,7 +39,7 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
39
39
|
function CartModule(name, version) {
|
|
40
40
|
var _this;
|
|
41
41
|
_classCallCheck(this, CartModule);
|
|
42
|
-
_this = _super.call(this, name, version);
|
|
42
|
+
_this = _super.call(this, name || 'cart', version || '1.0.0');
|
|
43
43
|
// 提供给 baseModule 用的默认名称 和 默认版本
|
|
44
44
|
_defineProperty(_assertThisInitialized(_this), "defaultName", 'cart');
|
|
45
45
|
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProductData } from "../../Product";
|
|
2
2
|
import { CartItem, IUpdateItemParams } from "../types";
|
|
3
|
-
export declare function updateAllCartItemPrice(cartItems: CartItem[], priceData: any, getProduct: (id: number) => Promise<
|
|
3
|
+
export declare function updateAllCartItemPrice(cartItems: CartItem[], priceData: any, getProduct: (id: number) => Promise<ProductData | undefined>, updateCart: (item: IUpdateItemParams) => void, updateItemInitInfo: (item: IUpdateItemParams) => void): Promise<void>;
|
|
@@ -36,7 +36,7 @@ function _updateAllCartItemPrice() {
|
|
|
36
36
|
return getProduct(item.id);
|
|
37
37
|
case 4:
|
|
38
38
|
cartProduct = _context.sent;
|
|
39
|
-
productInfo = cartProduct
|
|
39
|
+
productInfo = cartProduct;
|
|
40
40
|
if (!productInfo) {
|
|
41
41
|
productInfo = item._productOrigin;
|
|
42
42
|
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
|
+
import { BaseModule } from '../BaseModule';
|
|
3
|
+
import { CustomerState, ShopCustomer, ShopGetCustomerListParams, CustomerModuleAPI, IPaginationInfo, ICustomerListResponse } from './types';
|
|
4
|
+
export declare class CustomerModule extends BaseModule implements Module, CustomerModuleAPI {
|
|
5
|
+
protected defaultName: string;
|
|
6
|
+
protected defaultVersion: string;
|
|
7
|
+
private store;
|
|
8
|
+
private request;
|
|
9
|
+
private cacheId;
|
|
10
|
+
private openCache;
|
|
11
|
+
private fatherModule;
|
|
12
|
+
constructor(name?: string, version?: string);
|
|
13
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* 获取客户列表数据(内部方法)
|
|
16
|
+
* @param params 查询参数
|
|
17
|
+
* @returns API响应数据
|
|
18
|
+
*/
|
|
19
|
+
private fetchCustomerListData;
|
|
20
|
+
/**
|
|
21
|
+
* 处理客户列表操作的错误(内部方法)
|
|
22
|
+
* @param error 错误对象
|
|
23
|
+
* @param operation 操作名称
|
|
24
|
+
*/
|
|
25
|
+
private handleCustomerListError;
|
|
26
|
+
/**
|
|
27
|
+
* 获取客户列表
|
|
28
|
+
* @param params 查询参数
|
|
29
|
+
* @returns 客户列表响应
|
|
30
|
+
*/
|
|
31
|
+
getCustomerList(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* 设置客户列表
|
|
34
|
+
* @param customers 客户列表
|
|
35
|
+
* @param total 总数
|
|
36
|
+
*/
|
|
37
|
+
setCustomerList(customers: ShopCustomer[], total?: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* 设置当前选择的客户
|
|
40
|
+
* @param customer 选择的客户
|
|
41
|
+
*/
|
|
42
|
+
setSelectedCustomer(customer: ShopCustomer | null): void;
|
|
43
|
+
/**
|
|
44
|
+
* 获取当前选择的客户
|
|
45
|
+
* @returns 当前选择的客户
|
|
46
|
+
*/
|
|
47
|
+
getSelectedCustomer(): ShopCustomer | null;
|
|
48
|
+
/**
|
|
49
|
+
* 获取客户列表
|
|
50
|
+
* @returns 客户列表
|
|
51
|
+
*/
|
|
52
|
+
getCustomers(): ShopCustomer[];
|
|
53
|
+
/**
|
|
54
|
+
* 根据ID查找客户
|
|
55
|
+
* @param id 客户ID
|
|
56
|
+
* @returns 客户信息
|
|
57
|
+
*/
|
|
58
|
+
getCustomerById(id: string | number): ShopCustomer | null;
|
|
59
|
+
/**
|
|
60
|
+
* 清空客户列表
|
|
61
|
+
*/
|
|
62
|
+
clearCustomers(): void;
|
|
63
|
+
/**
|
|
64
|
+
* 添加客户到列表第一位
|
|
65
|
+
* @param customer 要添加的客户信息
|
|
66
|
+
*/
|
|
67
|
+
addCustomerToFirst(customer: ShopCustomer): void;
|
|
68
|
+
/**
|
|
69
|
+
* 获取当前状态
|
|
70
|
+
* @returns 当前状态
|
|
71
|
+
*/
|
|
72
|
+
getState(): CustomerState;
|
|
73
|
+
/**
|
|
74
|
+
* 获取分页信息
|
|
75
|
+
* @returns 分页信息
|
|
76
|
+
*/
|
|
77
|
+
getPaginationInfo(): IPaginationInfo;
|
|
78
|
+
/**
|
|
79
|
+
* 触发分页变化事件
|
|
80
|
+
* @param pagination 分页信息
|
|
81
|
+
*/
|
|
82
|
+
triggerPaginationChange(pagination: IPaginationInfo): void;
|
|
83
|
+
/**
|
|
84
|
+
* 设置分页信息
|
|
85
|
+
* @param page 页码
|
|
86
|
+
* @param pageSize 每页数量
|
|
87
|
+
*/
|
|
88
|
+
setPaginationInfo(page: number, pageSize: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* 便捷方法:切换分页并自动获取数据
|
|
91
|
+
* @param page 页码
|
|
92
|
+
* @param pageSize 每页数量(可选,不传则使用当前pageSize)
|
|
93
|
+
* @returns 客户列表响应
|
|
94
|
+
*/
|
|
95
|
+
changeCustomerPage(page: number, pageSize?: number): Promise<ICustomerListResponse>;
|
|
96
|
+
/**
|
|
97
|
+
* 滚动加载更多客户数据 - 数据会追加到现有列表中
|
|
98
|
+
* @returns 客户列表响应
|
|
99
|
+
*/
|
|
100
|
+
loadMoreCustomers(): Promise<ICustomerListResponse>;
|
|
101
|
+
/**
|
|
102
|
+
* 重置并重新开始滚动加载
|
|
103
|
+
* @param params 查询参数
|
|
104
|
+
* @returns 客户列表响应
|
|
105
|
+
*/
|
|
106
|
+
resetAndLoadCustomers(params?: ShopGetCustomerListParams): Promise<ICustomerListResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* 检查是否还有更多数据可以加载
|
|
109
|
+
* @returns 是否还有更多数据
|
|
110
|
+
*/
|
|
111
|
+
hasMoreCustomers(): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* 获取当前的搜索条件
|
|
114
|
+
* @returns 当前搜索条件
|
|
115
|
+
*/
|
|
116
|
+
getCurrentSearchParams(): Omit<ShopGetCustomerListParams, 'skip' | 'num'>;
|
|
117
|
+
/**
|
|
118
|
+
* 缓存状态变化
|
|
119
|
+
*/
|
|
120
|
+
private storeChange;
|
|
121
|
+
}
|
|
122
|
+
export * from './types';
|