@pisell/pisellos 3.0.57 → 3.0.59
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 +1 -2
- package/dist/effects/index.d.ts +3 -4
- package/dist/effects/index.js +6 -15
- package/dist/modules/AccountList/index.d.ts +1 -7
- package/dist/modules/AccountList/index.js +14 -81
- package/dist/modules/AccountList/types.d.ts +0 -28
- package/dist/modules/AccountList/types.js +0 -8
- package/dist/modules/Cart/index.js +1 -1
- package/dist/modules/Payment/index.d.ts +9 -273
- package/dist/modules/Payment/index.js +109 -2525
- package/dist/modules/Payment/types.d.ts +30 -382
- package/dist/modules/Payment/types.js +14 -116
- package/dist/modules/ProductList/index.d.ts +1 -12
- package/dist/modules/ProductList/index.js +3 -27
- package/dist/modules/Rules/index.js +14 -27
- package/dist/modules/Rules/types.d.ts +0 -1
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.js +0 -1
- package/dist/plugins/window.d.ts +0 -1
- package/dist/solution/BookingByStep/index.js +1 -9
- package/dist/solution/ShopDiscount/index.js +2 -4
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/dist/types/index.d.ts +1 -3
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +3 -4
- package/lib/effects/index.js +1 -4
- package/lib/modules/AccountList/index.d.ts +1 -7
- package/lib/modules/AccountList/index.js +0 -27
- package/lib/modules/AccountList/types.d.ts +0 -28
- package/lib/modules/Cart/index.js +1 -1
- package/lib/modules/Payment/index.d.ts +9 -273
- package/lib/modules/Payment/index.js +50 -1285
- package/lib/modules/Payment/types.d.ts +30 -382
- package/lib/modules/Payment/types.js +6 -41
- package/lib/modules/ProductList/index.d.ts +1 -12
- package/lib/modules/ProductList/index.js +2 -29
- package/lib/modules/Rules/index.js +12 -20
- package/lib/modules/Rules/types.d.ts +0 -1
- package/lib/modules/index.d.ts +0 -1
- package/lib/modules/index.js +0 -2
- package/lib/plugins/window.d.ts +0 -1
- package/lib/solution/BookingByStep/index.js +2 -1
- package/lib/solution/ShopDiscount/index.js +1 -2
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/lib/types/index.d.ts +1 -3
- package/package.json +2 -4
- package/dist/modules/Customer/constants.d.ts +0 -7
- package/dist/modules/Customer/constants.js +0 -12
- package/dist/modules/Customer/index.d.ts +0 -122
- package/dist/modules/Customer/index.js +0 -697
- package/dist/modules/Customer/types.d.ts +0 -146
- package/dist/modules/Customer/types.js +0 -41
- package/dist/modules/Payment/cash.d.ts +0 -11
- package/dist/modules/Payment/cash.js +0 -78
- package/dist/modules/Payment/eftpos.d.ts +0 -11
- package/dist/modules/Payment/eftpos.js +0 -80
- package/dist/modules/Payment/wallet.d.ts +0 -11
- package/dist/modules/Payment/wallet.js +0 -78
- package/dist/modules/Payment/walletpass.d.ts +0 -0
- package/dist/modules/Payment/walletpass.js +0 -0
- package/dist/plugins/app-types/app/app.d.ts +0 -83
- package/dist/plugins/app-types/app/const.d.ts +0 -4
- package/dist/plugins/app-types/app/index.d.ts +0 -14
- package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
- package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
- package/dist/plugins/app-types/config.d.ts +0 -3
- package/dist/plugins/app-types/cookie/index.d.ts +0 -13
- package/dist/plugins/app-types/data/index.d.ts +0 -8
- package/dist/plugins/app-types/history/config.d.ts +0 -24
- package/dist/plugins/app-types/history/index.d.ts +0 -20
- package/dist/plugins/app-types/history/type.d.ts +0 -2
- package/dist/plugins/app-types/hooks/index.d.ts +0 -12
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
- package/dist/plugins/app-types/index.d.ts +0 -6
- package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
- package/dist/plugins/app-types/locales/en.d.ts +0 -3
- package/dist/plugins/app-types/locales/index.d.ts +0 -37
- package/dist/plugins/app-types/locales/original.d.ts +0 -3
- package/dist/plugins/app-types/locales/type.d.ts +0 -19
- package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
- package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
- package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
- package/dist/plugins/app-types/logger/index.d.ts +0 -122
- package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
- package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
- package/dist/plugins/app-types/models/global.d.ts +0 -32
- package/dist/plugins/app-types/models/index.d.ts +0 -45
- package/dist/plugins/app-types/models/type.d.ts +0 -2
- package/dist/plugins/app-types/package.json +0 -15
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
- package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
- package/dist/plugins/app-types/request/cache.d.ts +0 -46
- package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
- package/dist/plugins/app-types/request/config.d.ts +0 -3
- package/dist/plugins/app-types/request/constants.d.ts +0 -2
- package/dist/plugins/app-types/request/index.d.ts +0 -24
- package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
- package/dist/plugins/app-types/request/type.d.ts +0 -41
- package/dist/plugins/app-types/request/utils.d.ts +0 -46
- package/dist/plugins/app-types/routes/config.d.ts +0 -7
- package/dist/plugins/app-types/routes/index.d.ts +0 -28
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
- package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
- package/dist/plugins/app-types/socket/constants.d.ts +0 -33
- package/dist/plugins/app-types/socket/events.d.ts +0 -31
- package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
- package/dist/plugins/app-types/socket/index.d.ts +0 -61
- package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
- package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
- package/dist/plugins/app-types/socket/socket.d.ts +0 -129
- package/dist/plugins/app-types/socket/types.d.ts +0 -85
- package/dist/plugins/app-types/storage/index.d.ts +0 -17
- package/dist/plugins/app-types/tasks/index.d.ts +0 -77
- package/dist/plugins/app-types/tasks/type.d.ts +0 -62
- package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
- package/dist/plugins/app-types/type.d.ts +0 -2
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
- package/dist/plugins/app-types/variables/config.d.ts +0 -3
- package/dist/plugins/app-types/variables/index.d.ts +0 -6
- package/dist/plugins/app-types/variables/type.d.ts +0 -2
- package/dist/plugins/app-types/website/index.d.ts +0 -6
- package/dist/plugins/app.d.ts +0 -8
- package/dist/plugins/app.js +0 -1
- package/dist/solution/BookingTicket/index.d.ts +0 -172
- package/dist/solution/BookingTicket/index.js +0 -665
- package/dist/solution/BookingTicket/types.d.ts +0 -68
- package/dist/solution/BookingTicket/types.js +0 -43
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -174
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -81
- package/dist/solution/BookingTicket/utils/scan/index.js +0 -285
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/dist/solution/Checkout/index.d.ts +0 -181
- package/dist/solution/Checkout/index.js +0 -1596
- package/dist/solution/Checkout/types.d.ts +0 -550
- package/dist/solution/Checkout/types.js +0 -132
- package/dist/solution/Checkout/utils/index.d.ts +0 -73
- package/dist/solution/Checkout/utils/index.js +0 -371
- package/dist/utils/task.d.ts +0 -40
- package/dist/utils/task.js +0 -171
- package/dist/utils/watch.d.ts +0 -102
- package/dist/utils/watch.js +0 -294
- package/lib/modules/Customer/constants.d.ts +0 -7
- package/lib/modules/Customer/constants.js +0 -39
- package/lib/modules/Customer/index.d.ts +0 -122
- package/lib/modules/Customer/index.js +0 -440
- package/lib/modules/Customer/types.d.ts +0 -146
- package/lib/modules/Customer/types.js +0 -37
- package/lib/modules/Payment/cash.d.ts +0 -11
- package/lib/modules/Payment/cash.js +0 -51
- package/lib/modules/Payment/eftpos.d.ts +0 -11
- package/lib/modules/Payment/eftpos.js +0 -51
- package/lib/modules/Payment/wallet.d.ts +0 -11
- package/lib/modules/Payment/wallet.js +0 -51
- package/lib/modules/Payment/walletpass.d.ts +0 -0
- package/lib/modules/Payment/walletpass.js +0 -0
- package/lib/plugins/app-types/app/app.d.ts +0 -83
- package/lib/plugins/app-types/app/const.d.ts +0 -4
- package/lib/plugins/app-types/app/index.d.ts +0 -14
- package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
- package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
- package/lib/plugins/app-types/config.d.ts +0 -3
- package/lib/plugins/app-types/cookie/index.d.ts +0 -13
- package/lib/plugins/app-types/data/index.d.ts +0 -8
- package/lib/plugins/app-types/history/config.d.ts +0 -24
- package/lib/plugins/app-types/history/index.d.ts +0 -20
- package/lib/plugins/app-types/history/type.d.ts +0 -2
- package/lib/plugins/app-types/hooks/index.d.ts +0 -12
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
- package/lib/plugins/app-types/index.d.ts +0 -6
- package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
- package/lib/plugins/app-types/locales/en.d.ts +0 -3
- package/lib/plugins/app-types/locales/index.d.ts +0 -37
- package/lib/plugins/app-types/locales/original.d.ts +0 -3
- package/lib/plugins/app-types/locales/type.d.ts +0 -19
- package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
- package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
- package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
- package/lib/plugins/app-types/logger/index.d.ts +0 -122
- package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
- package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
- package/lib/plugins/app-types/models/global.d.ts +0 -32
- package/lib/plugins/app-types/models/index.d.ts +0 -45
- package/lib/plugins/app-types/models/type.d.ts +0 -2
- package/lib/plugins/app-types/package.json +0 -15
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
- package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
- package/lib/plugins/app-types/request/cache.d.ts +0 -46
- package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
- package/lib/plugins/app-types/request/config.d.ts +0 -3
- package/lib/plugins/app-types/request/constants.d.ts +0 -2
- package/lib/plugins/app-types/request/index.d.ts +0 -24
- package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
- package/lib/plugins/app-types/request/type.d.ts +0 -41
- package/lib/plugins/app-types/request/utils.d.ts +0 -46
- package/lib/plugins/app-types/routes/config.d.ts +0 -7
- package/lib/plugins/app-types/routes/index.d.ts +0 -28
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
- package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
- package/lib/plugins/app-types/socket/constants.d.ts +0 -33
- package/lib/plugins/app-types/socket/events.d.ts +0 -31
- package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
- package/lib/plugins/app-types/socket/index.d.ts +0 -61
- package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
- package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
- package/lib/plugins/app-types/socket/socket.d.ts +0 -129
- package/lib/plugins/app-types/socket/types.d.ts +0 -85
- package/lib/plugins/app-types/storage/index.d.ts +0 -17
- package/lib/plugins/app-types/tasks/index.d.ts +0 -77
- package/lib/plugins/app-types/tasks/type.d.ts +0 -62
- package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
- package/lib/plugins/app-types/type.d.ts +0 -2
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
- package/lib/plugins/app-types/variables/config.d.ts +0 -3
- package/lib/plugins/app-types/variables/index.d.ts +0 -6
- package/lib/plugins/app-types/variables/type.d.ts +0 -2
- package/lib/plugins/app-types/website/index.d.ts +0 -6
- package/lib/plugins/app.d.ts +0 -8
- package/lib/plugins/app.js +0 -17
- package/lib/solution/BookingTicket/index.d.ts +0 -172
- package/lib/solution/BookingTicket/index.js +0 -399
- package/lib/solution/BookingTicket/types.d.ts +0 -68
- package/lib/solution/BookingTicket/types.js +0 -72
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -125
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -81
- package/lib/solution/BookingTicket/utils/scan/index.js +0 -210
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/index.d.ts +0 -181
- package/lib/solution/Checkout/index.js +0 -864
- package/lib/solution/Checkout/types.d.ts +0 -550
- package/lib/solution/Checkout/types.js +0 -75
- package/lib/solution/Checkout/utils/index.d.ts +0 -73
- package/lib/solution/Checkout/utils/index.js +0 -266
- package/lib/utils/task.d.ts +0 -40
- package/lib/utils/task.js +0 -109
- package/lib/utils/watch.d.ts +0 -102
- package/lib/utils/watch.js +0 -217
package/dist/core/index.js
CHANGED
|
@@ -67,8 +67,7 @@ var PisellOSCore = /*#__PURE__*/function () {
|
|
|
67
67
|
console.log("".concat(prefix, " ").concat(message));
|
|
68
68
|
break;
|
|
69
69
|
case 'warn':
|
|
70
|
-
|
|
71
|
-
console.log("%c".concat(prefix, "%c ").concat(message), 'color: #f59e0b; font-weight: bold;', 'color: #f59e0b;');
|
|
70
|
+
console.warn("".concat(prefix, " ").concat(message));
|
|
72
71
|
break;
|
|
73
72
|
case 'error':
|
|
74
73
|
console.error("".concat(prefix, " ").concat(message));
|
package/dist/effects/index.d.ts
CHANGED
|
@@ -2,17 +2,16 @@ type EffectCallback = (payload: any) => void | Promise<void | {
|
|
|
2
2
|
status: boolean;
|
|
3
3
|
message?: string;
|
|
4
4
|
}>;
|
|
5
|
-
type UnsubscribeFunction = () => void;
|
|
6
5
|
declare class EffectsManager {
|
|
7
6
|
private listeners;
|
|
8
|
-
on(event: string, callback: EffectCallback):
|
|
7
|
+
on(event: string, callback: EffectCallback): void;
|
|
9
8
|
off(event: string, callback: EffectCallback): void;
|
|
10
9
|
offByModuleDestroy(module: string): void;
|
|
11
|
-
once(event: string, callback: EffectCallback):
|
|
10
|
+
once(event: string, callback: EffectCallback): void;
|
|
12
11
|
emit(event: string, payload: any): Promise<{
|
|
13
12
|
status: boolean;
|
|
14
13
|
data: any;
|
|
15
14
|
}>;
|
|
16
15
|
clear(): void;
|
|
17
16
|
}
|
|
18
|
-
export { EffectsManager
|
|
17
|
+
export { EffectsManager };
|
package/dist/effects/index.js
CHANGED
|
@@ -11,7 +11,6 @@ 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
|
-
// 取消监听函数类型
|
|
15
14
|
var EffectsManager = /*#__PURE__*/function () {
|
|
16
15
|
function EffectsManager() {
|
|
17
16
|
_classCallCheck(this, EffectsManager);
|
|
@@ -20,15 +19,9 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
20
19
|
_createClass(EffectsManager, [{
|
|
21
20
|
key: "on",
|
|
22
21
|
value: function on(event, callback) {
|
|
23
|
-
var _this$listeners$get
|
|
24
|
-
_this = this;
|
|
22
|
+
var _this$listeners$get;
|
|
25
23
|
if (!this.listeners.has(event)) this.listeners.set(event, new Set());
|
|
26
24
|
(_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
|
-
};
|
|
32
25
|
}
|
|
33
26
|
}, {
|
|
34
27
|
key: "off",
|
|
@@ -41,17 +34,17 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
41
34
|
}, {
|
|
42
35
|
key: "offByModuleDestroy",
|
|
43
36
|
value: function offByModuleDestroy(module) {
|
|
44
|
-
var
|
|
37
|
+
var _this = this;
|
|
45
38
|
Array.from(this.listeners.keys()).forEach(function (item) {
|
|
46
39
|
if (item.startsWith(module)) {
|
|
47
|
-
|
|
40
|
+
_this.listeners.delete(item);
|
|
48
41
|
}
|
|
49
42
|
});
|
|
50
43
|
}
|
|
51
44
|
}, {
|
|
52
45
|
key: "once",
|
|
53
46
|
value: function once(event, callback) {
|
|
54
|
-
var
|
|
47
|
+
var _this2 = this;
|
|
55
48
|
var wrapper = /*#__PURE__*/function () {
|
|
56
49
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(payload) {
|
|
57
50
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -60,7 +53,7 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
60
53
|
_context.next = 2;
|
|
61
54
|
return callback(payload);
|
|
62
55
|
case 2:
|
|
63
|
-
|
|
56
|
+
_this2.off(event, wrapper);
|
|
64
57
|
case 3:
|
|
65
58
|
case "end":
|
|
66
59
|
return _context.stop();
|
|
@@ -71,9 +64,7 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
71
64
|
return _ref.apply(this, arguments);
|
|
72
65
|
};
|
|
73
66
|
}();
|
|
74
|
-
|
|
75
|
-
// 调用修改后的on方法,它会返回取消函数
|
|
76
|
-
return this.on(event, wrapper);
|
|
67
|
+
this.on(event, wrapper);
|
|
77
68
|
}
|
|
78
69
|
}, {
|
|
79
70
|
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
|
|
4
|
+
import { IFetchHolderAccountsParams, IHolder } from './types';
|
|
5
5
|
export declare class AccountListModule extends BaseModule implements Module {
|
|
6
6
|
protected defaultName: string;
|
|
7
7
|
protected defaultVersion: string;
|
|
@@ -37,12 +37,6 @@ 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>;
|
|
46
40
|
/**
|
|
47
41
|
* 获取holder类型账户列表
|
|
48
42
|
* @param params
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
var _excluded = ["page", "pageSize", "keyword"];
|
|
2
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); }
|
|
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; }
|
|
7
2
|
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; } } }; }
|
|
8
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
4
|
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."); }
|
|
@@ -509,68 +504,6 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
509
504
|
}
|
|
510
505
|
return addHolderAccounts;
|
|
511
506
|
}()
|
|
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
|
-
}()
|
|
574
507
|
/**
|
|
575
508
|
* 获取holder类型账户列表
|
|
576
509
|
* @param params
|
|
@@ -579,15 +512,15 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
579
512
|
}, {
|
|
580
513
|
key: "fetchHolderAccounts",
|
|
581
514
|
value: (function () {
|
|
582
|
-
var _fetchHolderAccounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
515
|
+
var _fetchHolderAccounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
|
|
583
516
|
var url, _ref, form_id, shop_id, num, skip, customer_id, _res$data, res;
|
|
584
|
-
return _regeneratorRuntime().wrap(function
|
|
585
|
-
while (1) switch (
|
|
517
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
518
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
586
519
|
case 0:
|
|
587
520
|
url = params.url || '/account/holder';
|
|
588
521
|
_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;
|
|
589
|
-
|
|
590
|
-
|
|
522
|
+
_context9.prev = 2;
|
|
523
|
+
_context9.next = 5;
|
|
591
524
|
return this.request.get(url, {
|
|
592
525
|
customer_id: customer_id,
|
|
593
526
|
form_id: form_id,
|
|
@@ -596,30 +529,30 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
596
529
|
skip: skip || 1
|
|
597
530
|
});
|
|
598
531
|
case 5:
|
|
599
|
-
res =
|
|
532
|
+
res = _context9.sent;
|
|
600
533
|
this.store.accountList = [];
|
|
601
534
|
this.store.accounts = [];
|
|
602
535
|
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)) {
|
|
603
|
-
|
|
536
|
+
_context9.next = 11;
|
|
604
537
|
break;
|
|
605
538
|
}
|
|
606
|
-
|
|
539
|
+
_context9.next = 11;
|
|
607
540
|
return this.addHolderAccounts({
|
|
608
541
|
holders: res.data.list,
|
|
609
542
|
customerId: customer_id
|
|
610
543
|
});
|
|
611
544
|
case 11:
|
|
612
|
-
|
|
545
|
+
_context9.next = 16;
|
|
613
546
|
break;
|
|
614
547
|
case 13:
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
console.error(
|
|
548
|
+
_context9.prev = 13;
|
|
549
|
+
_context9.t0 = _context9["catch"](2);
|
|
550
|
+
console.error(_context9.t0);
|
|
618
551
|
case 16:
|
|
619
552
|
case "end":
|
|
620
|
-
return
|
|
553
|
+
return _context9.stop();
|
|
621
554
|
}
|
|
622
|
-
},
|
|
555
|
+
}, _callee9, this, [[2, 13]]);
|
|
623
556
|
}));
|
|
624
557
|
function fetchHolderAccounts(_x11) {
|
|
625
558
|
return _fetchHolderAccounts.apply(this, arguments);
|
|
@@ -67,31 +67,3 @@ 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
|
|
42
|
+
_this = _super.call(this, name, version);
|
|
43
43
|
// 提供给 baseModule 用的默认名称 和 默认版本
|
|
44
44
|
_defineProperty(_assertThisInitialized(_this), "defaultName", 'cart');
|
|
45
45
|
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
@@ -1,280 +1,16 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { PaymentModuleAPI, PaymentMethod,
|
|
4
|
-
export * from './types';
|
|
5
|
-
export { generateRequestUniqueId };
|
|
6
|
-
/**
|
|
7
|
-
* 生成请求唯一ID
|
|
8
|
-
* 格式: 年月日时分秒毫秒+4位随机数
|
|
9
|
-
* 示例: 20241201143025123456
|
|
10
|
-
*/
|
|
11
|
-
declare function generateRequestUniqueId(): string;
|
|
12
|
-
/**
|
|
13
|
-
* 支付模块实现
|
|
14
|
-
*
|
|
15
|
-
* 支付流程说明:
|
|
16
|
-
* 1. 用户操作 → 调用支付API (pushPaymentAsync, submitPayAsync等)
|
|
17
|
-
* 2. 数据处理 → 更新本地IndexDB中的订单和支付项数据
|
|
18
|
-
* 3. 立即完成 → 本地订单状态立即更新为PaymentStatus.Finished(isSynced保持false)
|
|
19
|
-
* 4. 后台同步 → 网络请求推送到TasksManager异步同步到服务器
|
|
20
|
-
* 5. 同步成功 → 网络请求成功后,isSynced设为true
|
|
21
|
-
* 6. 自动重试 → TasksManager自动重试失败的网络请求,直到isSynced为true
|
|
22
|
-
*
|
|
23
|
-
* 数据状态说明:
|
|
24
|
-
* - PaymentStatus.Processing: 订单正在进行支付操作
|
|
25
|
-
* - PaymentStatus.PartiallyPaid + isSynced=false: 部分支付完成,等待服务器同步
|
|
26
|
-
* - PaymentStatus.PartiallyPaid + isSynced=true: 部分支付且已同步到服务器
|
|
27
|
-
* - PaymentStatus.Finished + isSynced=false: 本地支付完成,等待服务器同步
|
|
28
|
-
* - PaymentStatus.Finished + isSynced=true: 支付完成且已同步到服务器
|
|
29
|
-
*
|
|
30
|
-
* 这种设计的优势:
|
|
31
|
-
* - 即时反馈:支付操作后立即显示完成状态,用户体验更佳
|
|
32
|
-
* - 离线支持:即使网络断开也能正常操作,数据保存在本地
|
|
33
|
-
* - 同步追踪:通过isSynced清楚知道哪些数据还未同步到服务器
|
|
34
|
-
* - 自动重试:TasksManager会自动重试失败的网络请求
|
|
35
|
-
* - 异步处理:不阻塞用户界面,网络同步在后台进行
|
|
36
|
-
* - 数据一致性:通过事件系统确保数据状态同步
|
|
37
|
-
*/
|
|
3
|
+
import { Payment, PaymentModuleAPI, PaymentMethod, PaymentStatus } from './types';
|
|
38
4
|
export declare class PaymentModule extends BaseModule implements Module, PaymentModuleAPI {
|
|
39
5
|
protected defaultName: string;
|
|
40
6
|
protected defaultVersion: string;
|
|
41
|
-
private
|
|
42
|
-
private app;
|
|
43
|
-
private store;
|
|
44
|
-
private dbManager;
|
|
45
|
-
private logger;
|
|
46
|
-
cash: CashPayment;
|
|
47
|
-
eftpos: EftposPayment;
|
|
48
|
-
wallet: WalletPayment;
|
|
7
|
+
private state;
|
|
49
8
|
constructor(name?: string, version?: string);
|
|
50
|
-
initialize(core: PisellCore, options
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
private logWarning;
|
|
59
|
-
/**
|
|
60
|
-
* 记录错误日志
|
|
61
|
-
*/
|
|
62
|
-
private logError;
|
|
63
|
-
/**
|
|
64
|
-
* 记录调试日志
|
|
65
|
-
*/
|
|
66
|
-
private logDebug;
|
|
67
|
-
/**
|
|
68
|
-
* 网络恢复以后,尝试执行队列
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
private registerNetworkHandlers;
|
|
72
|
-
/**
|
|
73
|
-
* 获取支付方式列表
|
|
74
|
-
*/
|
|
75
|
-
getPayMethodListAsync(): Promise<PaymentMethod[]>;
|
|
76
|
-
/**
|
|
77
|
-
* 后台刷新支付方式列表
|
|
78
|
-
*/
|
|
79
|
-
private refreshPaymentMethodsInBackground;
|
|
80
|
-
/**
|
|
81
|
-
* 检查支付方式列表是否有变化
|
|
82
|
-
*/
|
|
83
|
-
private hasPaymentMethodsChanged;
|
|
84
|
-
/**
|
|
85
|
-
* 获取订单列表
|
|
86
|
-
*/
|
|
87
|
-
getOrderListAsync(): Promise<PaymentOrder[]>;
|
|
88
|
-
/**
|
|
89
|
-
* 根据订单UUID获取支付订单(新方法)
|
|
90
|
-
*/
|
|
91
|
-
getPaymentOrderByUuidAsync(orderUuid: string): Promise<PaymentOrder | null>;
|
|
92
|
-
/**
|
|
93
|
-
* 创建支付订单(新方法,专注支付数据)
|
|
94
|
-
*/
|
|
95
|
-
createPaymentOrderAsync(params: PushOrderParams): Promise<PaymentOrder>;
|
|
96
|
-
/**
|
|
97
|
-
* 往交易组中添加订单(兼容性方法)
|
|
98
|
-
* @deprecated 使用 createPaymentOrderAsync 替代
|
|
99
|
-
*/
|
|
100
|
-
pushOrderAsync(params: PushOrderParams): Promise<PaymentOrder>;
|
|
101
|
-
/**
|
|
102
|
-
* 删除支付订单(新方法)
|
|
103
|
-
*/
|
|
104
|
-
deletePaymentOrderAsync(orderUuid: string): Promise<void>;
|
|
105
|
-
/**
|
|
106
|
-
* 删除订单(兼容性方法)
|
|
107
|
-
* @deprecated 使用 deletePaymentOrderAsync 替代
|
|
108
|
-
*/
|
|
109
|
-
deleteOrderAsync(orderUuid: string): Promise<void>;
|
|
110
|
-
/**
|
|
111
|
-
* 更新订单
|
|
112
|
-
*/
|
|
113
|
-
updateOrderAsync(orderUuid: string, params: Partial<PaymentOrder>): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* 基于UUID替换订单ID
|
|
116
|
-
*
|
|
117
|
-
* 此方法用于将本地虚拟订单ID替换为真实的订单ID。
|
|
118
|
-
* 当前端模拟下单流程完成后,后端返回真实订单ID时调用此方法。
|
|
119
|
-
*
|
|
120
|
-
* @param orderUuid 订单的UUID
|
|
121
|
-
* @param newOrderId 新的订单ID (来自后端)
|
|
122
|
-
* @returns 更新后的订单对象,如果订单不存在则返回null
|
|
123
|
-
*/
|
|
124
|
-
replaceOrderIdByUuidAsync(orderUuid: string, newOrderId: string): Promise<PaymentOrder | null>;
|
|
125
|
-
/**
|
|
126
|
-
* 获取支付项(新方法)
|
|
127
|
-
*/
|
|
128
|
-
getPaymentItemsAsync(orderUuid: string): Promise<PaymentItem[]>;
|
|
129
|
-
/**
|
|
130
|
-
* 获取支付项(兼容性方法)
|
|
131
|
-
* @deprecated 使用 getPaymentItemsAsync 替代
|
|
132
|
-
*/
|
|
133
|
-
getPaymentAsync(orderUuid: string): Promise<PaymentItem[]>;
|
|
134
|
-
/**
|
|
135
|
-
* 为某个订单添加支付项(新方法)
|
|
136
|
-
*/
|
|
137
|
-
addPaymentItemAsync(orderUuid: string, paymentItem: PaymentItemInput): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* 为某个订单设置一个支付项(兼容性方法)
|
|
140
|
-
* @deprecated 使用 addPaymentItemAsync 替代
|
|
141
|
-
*/
|
|
142
|
-
pushPaymentAsync(orderUuid: string, paymentItem: PaymentItemInput): Promise<void>;
|
|
143
|
-
/**
|
|
144
|
-
* 删除一个支付项
|
|
145
|
-
*/
|
|
146
|
-
deletePaymentAsync(orderUuid: string, paymentUuid: string): Promise<void>;
|
|
147
|
-
/**
|
|
148
|
-
* 更新一个支付项
|
|
149
|
-
*/
|
|
150
|
-
updatePaymentAsync(orderUuid: string, paymentUuid: string, params: PaymentUpdateFields): Promise<void>;
|
|
151
|
-
/**
|
|
152
|
-
* 提交支付
|
|
153
|
-
*/
|
|
154
|
-
submitPayAsync(orderUuid?: string): Promise<{
|
|
155
|
-
status: 'success' | 'failed';
|
|
156
|
-
}>;
|
|
157
|
-
/**
|
|
158
|
-
* 提交单个订单的支付(推送到任务队列)
|
|
159
|
-
*/
|
|
160
|
-
private submitSingleOrderPayment;
|
|
161
|
-
/**
|
|
162
|
-
* 添加到同步任务队列
|
|
163
|
-
*/
|
|
164
|
-
private addToSyncQueue;
|
|
165
|
-
/**
|
|
166
|
-
* 获取订单剩余待付金额
|
|
167
|
-
*/
|
|
168
|
-
getRemainingOrderAmountAsync(orderUuid: string): Promise<number>;
|
|
169
|
-
/**
|
|
170
|
-
* 在比如现金支付界面的地方,用户输入了一个金额,在下方显示剩余多少金额,通过此方法获取
|
|
171
|
-
*/
|
|
172
|
-
getRemainingOrderAmountWithInputAsync(inputAmount: string | number, orderUuid: string): Promise<number>;
|
|
173
|
-
/**
|
|
174
|
-
* 重新计算订单金额
|
|
175
|
-
*/
|
|
176
|
-
private recalculateOrderAmount;
|
|
177
|
-
/**
|
|
178
|
-
* 获取现金支付方式
|
|
179
|
-
*/
|
|
180
|
-
getCashPaymentMethod(): Promise<PaymentMethod | null>;
|
|
181
|
-
/**
|
|
182
|
-
* 获取Eftpos支付方式
|
|
183
|
-
*/
|
|
184
|
-
getEftposPaymentMethod(): Promise<PaymentMethod | null>;
|
|
185
|
-
/**
|
|
186
|
-
* 获取钱包支付方式
|
|
187
|
-
*/
|
|
188
|
-
getWalletPaymentMethod(): Promise<PaymentMethod | null>;
|
|
189
|
-
/**
|
|
190
|
-
* 注册任务处理函数
|
|
191
|
-
*/
|
|
192
|
-
private registerTaskHandlers;
|
|
193
|
-
/**
|
|
194
|
-
* 静态方法:处理支付同步任务(后台网络同步)
|
|
195
|
-
* 这个方法里不允许用 this,因为需要作为静态方法注入到任务队列里
|
|
196
|
-
*/
|
|
197
|
-
static syncPaymentTask(payload: any): Promise<any>;
|
|
198
|
-
/**
|
|
199
|
-
* 确保支付模块所需的数据库表已创建
|
|
200
|
-
*/
|
|
201
|
-
private ensurePaymentTables;
|
|
202
|
-
/**
|
|
203
|
-
* 获取部分支付的订单
|
|
204
|
-
*/
|
|
205
|
-
getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
|
|
206
|
-
/**
|
|
207
|
-
* 获取未同步到服务器的订单
|
|
208
|
-
*/
|
|
209
|
-
getUnsyncedOrdersAsync(): Promise<PaymentOrder[]>;
|
|
210
|
-
/**
|
|
211
|
-
* 清理已完成且已同步的订单
|
|
212
|
-
* 注意:只清理完全支付的订单,部分支付的订单保留以便继续支付
|
|
213
|
-
*/
|
|
214
|
-
cleanupFinishedOrders(): Promise<void>;
|
|
215
|
-
/**
|
|
216
|
-
* 检测未同步的订单并重新加入任务队列
|
|
217
|
-
*
|
|
218
|
-
* 此方法专门用于处理因网络问题导致任务队列执行失败但队列被清空的情况。
|
|
219
|
-
* 它会检查本地 IndexDB 中所有未同步的订单(isSynced: false),
|
|
220
|
-
* 并将这些订单重新添加到任务队列中。
|
|
221
|
-
*
|
|
222
|
-
* 使用场景:
|
|
223
|
-
* - 网络恢复后重新检查未同步的订单
|
|
224
|
-
* - 应用启动时检查并重新排队未完成的支付
|
|
225
|
-
* - 用户手动重试前的预检查
|
|
226
|
-
*
|
|
227
|
-
* @returns Promise<number> 返回重新加入队列的订单数量
|
|
228
|
-
*/
|
|
229
|
-
recheckAndRequeueUnsyncedOrders(): Promise<number>;
|
|
230
|
-
/**
|
|
231
|
-
* 手动执行支付同步队列
|
|
232
|
-
* 外部可以调用此方法来触发支付同步任务的执行
|
|
233
|
-
*
|
|
234
|
-
* 注意:此方法只执行现有队列中的任务,不会检查未同步的订单。
|
|
235
|
-
* 如果需要检查未同步订单,请先调用 recheckAndRequeueUnsyncedOrders()
|
|
236
|
-
*
|
|
237
|
-
* 使用示例:
|
|
238
|
-
* ```typescript
|
|
239
|
-
* // 1. 先检查并重新排队未同步订单,然后执行队列
|
|
240
|
-
* const requeuedCount = await paymentModule.recheckAndRequeueUnsyncedOrders();
|
|
241
|
-
* if (requeuedCount > 0) {
|
|
242
|
-
* await paymentModule.runPaymentSyncQueue();
|
|
243
|
-
* }
|
|
244
|
-
*
|
|
245
|
-
* // 2. 或者直接执行现有队列(不检查未同步订单)
|
|
246
|
-
* await paymentModule.runPaymentSyncQueue();
|
|
247
|
-
* ```
|
|
248
|
-
*/
|
|
249
|
-
runPaymentSyncQueue(): Promise<void>;
|
|
250
|
-
/**
|
|
251
|
-
* 重新将订单添加到同步队列
|
|
252
|
-
* 用于处理因网络问题导致任务队列清空但订单未同步的情况
|
|
253
|
-
*
|
|
254
|
-
* @param order 要重新添加的订单
|
|
255
|
-
* @returns Promise<boolean> 是否成功添加到队列
|
|
256
|
-
*/
|
|
257
|
-
private reAddOrderToSyncQueue;
|
|
258
|
-
/**
|
|
259
|
-
* 删除支付项(新方法)
|
|
260
|
-
*/
|
|
261
|
-
deletePaymentItemAsync(orderUuid: string, paymentUuid: string): Promise<void>;
|
|
262
|
-
/**
|
|
263
|
-
* 更新支付项(新方法)
|
|
264
|
-
*/
|
|
265
|
-
updatePaymentItemAsync(orderUuid: string, paymentUuid: string, params: PaymentUpdateFields): Promise<void>;
|
|
266
|
-
/**
|
|
267
|
-
* 获取订单剩余待付金额(新方法)
|
|
268
|
-
*/
|
|
269
|
-
getRemainingAmountAsync(orderUuid: string): Promise<number>;
|
|
270
|
-
/**
|
|
271
|
-
* 获取订单剩余待付金额(基于用户输入的金额)(新方法)
|
|
272
|
-
*/
|
|
273
|
-
getRemainingAmountWithInputAsync(inputAmount: string | number, orderUuid: string): Promise<number>;
|
|
274
|
-
/**
|
|
275
|
-
* 提交支付(新方法)
|
|
276
|
-
*/
|
|
277
|
-
submitPaymentAsync(orderUuid: string): Promise<{
|
|
278
|
-
status: 'success' | 'failed';
|
|
279
|
-
}>;
|
|
9
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
10
|
+
processPayment(paymentId: string): Promise<void>;
|
|
11
|
+
getPayment(paymentId: string): Promise<Payment>;
|
|
12
|
+
getPaymentHistory(): Promise<Payment[]>;
|
|
13
|
+
refund(paymentId: string): Promise<void>;
|
|
14
|
+
getAvailablePaymentMethods(): PaymentMethod[];
|
|
15
|
+
checkPaymentStatus(paymentId: string): Promise<PaymentStatus>;
|
|
280
16
|
}
|