@pisell/pisellos 3.0.76 → 3.0.78
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 -5
- package/dist/effects/index.js +8 -40
- package/dist/modules/Account/index.js +3 -2
- 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/BaseModule.d.ts +0 -3
- package/dist/modules/BaseModule.js +0 -15
- package/dist/modules/Cart/index.d.ts +0 -1
- package/dist/modules/Cart/index.js +1 -2
- package/dist/modules/Date/types.d.ts +3 -1
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +1 -1
- package/dist/modules/Guests/index.js +9 -9
- package/dist/modules/Order/index.d.ts +1 -25
- package/dist/modules/Order/index.js +3 -224
- package/dist/modules/Order/types.d.ts +0 -45
- package/dist/modules/Order/types.js +0 -8
- package/dist/modules/Order/utils.js +1 -1
- package/dist/modules/Payment/index.d.ts +9 -184
- package/dist/modules/Payment/index.js +109 -2084
- package/dist/modules/Payment/types.d.ts +30 -772
- package/dist/modules/Payment/types.js +12 -236
- package/dist/modules/ProductList/index.d.ts +1 -12
- package/dist/modules/ProductList/index.js +6 -29
- package/dist/modules/Resource/index.js +1 -1
- package/dist/modules/Rules/index.d.ts +4 -3
- package/dist/modules/Rules/index.js +121 -78
- package/dist/modules/Rules/types.d.ts +6 -1
- package/dist/modules/Rules/types.js +8 -0
- package/dist/modules/Schedule/index.d.ts +0 -9
- package/dist/modules/Schedule/index.js +0 -77
- 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.d.ts +17 -0
- package/dist/solution/BookingByStep/index.js +525 -190
- package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
- package/dist/solution/BookingByStep/utils/products.js +0 -10
- package/dist/solution/BookingByStep/utils/resources.js +4 -0
- package/dist/solution/BuyTickets/index.js +8 -7
- package/dist/solution/ShopDiscount/index.d.ts +12 -10
- package/dist/solution/ShopDiscount/index.js +64 -110
- package/dist/solution/ShopDiscount/types.d.ts +0 -8
- package/dist/solution/ShopDiscount/utils.js +1 -0
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/dist/types/index.d.ts +1 -4
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +3 -5
- package/lib/effects/index.js +1 -17
- package/lib/modules/Account/index.js +3 -2
- 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/BaseModule.d.ts +0 -3
- package/lib/modules/BaseModule.js +0 -9
- package/lib/modules/Cart/index.d.ts +0 -1
- package/lib/modules/Cart/index.js +2 -5
- package/lib/modules/Date/types.d.ts +3 -1
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +1 -1
- package/lib/modules/Guests/index.js +9 -9
- package/lib/modules/Order/index.d.ts +1 -25
- package/lib/modules/Order/index.js +1 -186
- package/lib/modules/Order/types.d.ts +0 -45
- package/lib/modules/Order/utils.js +1 -1
- package/lib/modules/Payment/index.d.ts +9 -184
- package/lib/modules/Payment/index.js +51 -1084
- package/lib/modules/Payment/types.d.ts +30 -772
- package/lib/modules/Payment/types.js +6 -79
- package/lib/modules/ProductList/index.d.ts +1 -12
- package/lib/modules/ProductList/index.js +5 -31
- package/lib/modules/Resource/index.js +1 -1
- package/lib/modules/Rules/index.d.ts +4 -3
- package/lib/modules/Rules/index.js +64 -43
- package/lib/modules/Rules/types.d.ts +6 -1
- package/lib/modules/Rules/types.js +11 -2
- package/lib/modules/Schedule/index.d.ts +0 -9
- package/lib/modules/Schedule/index.js +0 -60
- 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.d.ts +17 -0
- package/lib/solution/BookingByStep/index.js +325 -60
- package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
- package/lib/solution/BookingByStep/utils/products.js +2 -8
- package/lib/solution/BookingByStep/utils/resources.js +4 -1
- package/lib/solution/BuyTickets/index.js +8 -7
- package/lib/solution/ShopDiscount/index.d.ts +12 -10
- package/lib/solution/ShopDiscount/index.js +30 -51
- package/lib/solution/ShopDiscount/types.d.ts +0 -8
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/lib/types/index.d.ts +1 -4
- package/package.json +1 -3
- 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 -696
- 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 -19
- package/dist/modules/Payment/cash.js +0 -97
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
- package/dist/modules/Payment/eftpos.d.ts +0 -11
- package/dist/modules/Payment/eftpos.js +0 -80
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/mx51.js +0 -0
- package/dist/modules/Payment/utils.d.ts +0 -17
- package/dist/modules/Payment/utils.js +0 -62
- package/dist/modules/Payment/walletpass.d.ts +0 -99
- package/dist/modules/Payment/walletpass.js +0 -711
- 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 -184
- package/dist/solution/BookingTicket/index.js +0 -698
- 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 -22
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
- package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
- 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 -432
- package/dist/solution/Checkout/index.js +0 -4452
- package/dist/solution/Checkout/types.d.ts +0 -727
- package/dist/solution/Checkout/types.js +0 -104
- package/dist/solution/Checkout/utils/index.d.ts +0 -121
- package/dist/solution/Checkout/utils/index.js +0 -511
- 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 -439
- 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 -19
- package/lib/modules/Payment/cash.js +0 -64
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
- package/lib/modules/Payment/eftpos.d.ts +0 -11
- package/lib/modules/Payment/eftpos.js +0 -51
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/mx51.js +0 -0
- package/lib/modules/Payment/utils.d.ts +0 -17
- package/lib/modules/Payment/utils.js +0 -67
- package/lib/modules/Payment/walletpass.d.ts +0 -99
- package/lib/modules/Payment/walletpass.js +0 -484
- 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 -184
- package/lib/solution/BookingTicket/index.js +0 -426
- 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 -22
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
- package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
- 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 -432
- package/lib/solution/Checkout/index.js +0 -2776
- package/lib/solution/Checkout/types.d.ts +0 -727
- package/lib/solution/Checkout/types.js +0 -63
- package/lib/solution/Checkout/utils/index.d.ts +0 -121
- package/lib/solution/Checkout/utils/index.js +0 -362
- 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
|
@@ -26,45 +26,30 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
26
26
|
import { BaseModule } from "../BaseModule";
|
|
27
27
|
import { generateDuration, getAllDiscountList, mergeRelationForms } from "./utils";
|
|
28
28
|
import { isNormalProduct } from "../Product/utils";
|
|
29
|
-
import dayjs from 'dayjs';
|
|
30
29
|
export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
31
30
|
_inherits(OrderModule, _BaseModule);
|
|
32
31
|
var _super = _createSuper(OrderModule);
|
|
33
|
-
// LoggerManager 实例
|
|
34
|
-
|
|
35
32
|
function OrderModule(name, version) {
|
|
36
33
|
var _this;
|
|
37
34
|
_classCallCheck(this, OrderModule);
|
|
38
|
-
_this = _super.call(this, name
|
|
35
|
+
_this = _super.call(this, name, version);
|
|
39
36
|
_defineProperty(_assertThisInitialized(_this), "defaultName", 'order');
|
|
40
37
|
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
41
38
|
_defineProperty(_assertThisInitialized(_this), "store", void 0);
|
|
42
39
|
_defineProperty(_assertThisInitialized(_this), "request", void 0);
|
|
43
|
-
_defineProperty(_assertThisInitialized(_this), "logger", void 0);
|
|
44
40
|
return _this;
|
|
45
41
|
}
|
|
46
42
|
_createClass(OrderModule, [{
|
|
47
43
|
key: "initialize",
|
|
48
44
|
value: function () {
|
|
49
45
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
50
|
-
var appPlugin, app;
|
|
51
46
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
52
47
|
while (1) switch (_context.prev = _context.next) {
|
|
53
48
|
case 0:
|
|
54
49
|
this.core = core;
|
|
55
50
|
this.store = options.store;
|
|
56
51
|
this.request = this.core.getPlugin('request');
|
|
57
|
-
|
|
58
|
-
if (appPlugin) {
|
|
59
|
-
_context.next = 6;
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
throw new Error('Order 模块需要 app 插件支持');
|
|
63
|
-
case 6:
|
|
64
|
-
app = appPlugin.getApp();
|
|
65
|
-
this.logger = app.logger;
|
|
66
|
-
this.logInfo('OrderModule initialized successfully');
|
|
67
|
-
case 9:
|
|
52
|
+
case 3:
|
|
68
53
|
case "end":
|
|
69
54
|
return _context.stop();
|
|
70
55
|
}
|
|
@@ -75,50 +60,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
75
60
|
}
|
|
76
61
|
return initialize;
|
|
77
62
|
}()
|
|
78
|
-
/**
|
|
79
|
-
* 记录信息日志
|
|
80
|
-
*/
|
|
81
|
-
}, {
|
|
82
|
-
key: "logInfo",
|
|
83
|
-
value: function logInfo(title, metadata) {
|
|
84
|
-
if (this.logger) {
|
|
85
|
-
this.logger.addLog({
|
|
86
|
-
type: 'info',
|
|
87
|
-
title: "[OrderModule] ".concat(title),
|
|
88
|
-
metadata: metadata || {}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* 记录警告日志
|
|
95
|
-
*/
|
|
96
|
-
}, {
|
|
97
|
-
key: "logWarning",
|
|
98
|
-
value: function logWarning(title, metadata) {
|
|
99
|
-
if (this.logger) {
|
|
100
|
-
this.logger.addLog({
|
|
101
|
-
type: 'warning',
|
|
102
|
-
title: "[OrderModule] ".concat(title),
|
|
103
|
-
metadata: metadata || {}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 记录错误日志
|
|
110
|
-
*/
|
|
111
|
-
}, {
|
|
112
|
-
key: "logError",
|
|
113
|
-
value: function logError(title, metadata) {
|
|
114
|
-
if (this.logger) {
|
|
115
|
-
this.logger.addLog({
|
|
116
|
-
type: 'error',
|
|
117
|
-
title: "[OrderModule] ".concat(title),
|
|
118
|
-
metadata: metadata || {}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
63
|
}, {
|
|
123
64
|
key: "createOrder",
|
|
124
65
|
value: function createOrder(params) {
|
|
@@ -181,11 +122,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
181
122
|
}, {
|
|
182
123
|
key: "checkBeforeSubmitOrder",
|
|
183
124
|
value: function checkBeforeSubmitOrder(params) {
|
|
184
|
-
var _params$cartItems;
|
|
185
|
-
this.logInfo('checkBeforeSubmitOrder called', {
|
|
186
|
-
cartItemsCount: ((_params$cartItems = params.cartItems) === null || _params$cartItems === void 0 ? void 0 : _params$cartItems.length) || 0,
|
|
187
|
-
type: params.type
|
|
188
|
-
});
|
|
189
125
|
var cartItems = params.cartItems,
|
|
190
126
|
type = params.type;
|
|
191
127
|
if (type === 'holder') {
|
|
@@ -203,31 +139,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
203
139
|
key: "submitOrder",
|
|
204
140
|
value: function () {
|
|
205
141
|
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(order) {
|
|
206
|
-
var _order$query$cartItem, _params$bookings, _params$relation_prod;
|
|
207
142
|
var url, query, fetchUrl, params;
|
|
208
143
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
209
144
|
while (1) switch (_context2.prev = _context2.next) {
|
|
210
145
|
case 0:
|
|
211
|
-
this.logInfo('submitOrder called', {
|
|
212
|
-
url: order.url,
|
|
213
|
-
orderType: order.query.type,
|
|
214
|
-
platform: order.query.platform,
|
|
215
|
-
cartItemsCount: ((_order$query$cartItem = order.query.cartItems) === null || _order$query$cartItem === void 0 ? void 0 : _order$query$cartItem.length) || 0
|
|
216
|
-
});
|
|
217
146
|
url = order.url, query = order.query;
|
|
218
147
|
fetchUrl = url || '/order/appointment';
|
|
219
148
|
params = this.createOrder(query);
|
|
220
|
-
this.logInfo('Calling backend order API', {
|
|
221
|
-
url: fetchUrl,
|
|
222
|
-
orderType: params.type,
|
|
223
|
-
platform: params.platform,
|
|
224
|
-
isDeposit: params.is_deposit,
|
|
225
|
-
bookingsCount: ((_params$bookings = params.bookings) === null || _params$bookings === void 0 ? void 0 : _params$bookings.length) || 0,
|
|
226
|
-
relationProductsCount: ((_params$relation_prod = params.relation_products) === null || _params$relation_prod === void 0 ? void 0 : _params$relation_prod.length) || 0,
|
|
227
|
-
scheduleDate: params.schedule_date
|
|
228
|
-
});
|
|
229
149
|
return _context2.abrupt("return", this.request.post(fetchUrl, params));
|
|
230
|
-
case
|
|
150
|
+
case 4:
|
|
231
151
|
case "end":
|
|
232
152
|
return _context2.stop();
|
|
233
153
|
}
|
|
@@ -238,147 +158,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
238
158
|
}
|
|
239
159
|
return submitOrder;
|
|
240
160
|
}()
|
|
241
|
-
/**
|
|
242
|
-
* Checkout 专用:创建订单到后端
|
|
243
|
-
*
|
|
244
|
-
* 专门为 Checkout 模块设计的订单创建方法,
|
|
245
|
-
* 直接调用 /order/checkout 接口创建订单
|
|
246
|
-
* 接收已经处理好的订单数据,无需再处理购物车
|
|
247
|
-
*
|
|
248
|
-
* @param params Checkout 订单参数(已处理的订单数据)
|
|
249
|
-
* @returns 后端返回的订单数据(包含订单ID等)
|
|
250
|
-
*/
|
|
251
|
-
}, {
|
|
252
|
-
key: "createOrderByCheckout",
|
|
253
|
-
value: (function () {
|
|
254
|
-
var _createOrderByCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
255
|
-
var _params$bookings2, _params$relation_prod2, _params$payments, _params$payments2, _params$bookings3, _params$relation_prod3, _params$payments3;
|
|
256
|
-
var _orderData$payments, _orderData$bookings, _orderData$relation_p, _orderData$payments2, _orderData$payments3, _orderData$bookings2, _orderData$relation_p2, _orderData$payments4, _orderData$payments5, _response$data, orderData, response;
|
|
257
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
258
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
259
|
-
case 0:
|
|
260
|
-
this.logInfo('createOrderByCheckout called', {
|
|
261
|
-
type: params.type,
|
|
262
|
-
platform: params.platform,
|
|
263
|
-
is_deposit: params.is_deposit,
|
|
264
|
-
customer_id: params.customer_id,
|
|
265
|
-
bookingsCount: ((_params$bookings2 = params.bookings) === null || _params$bookings2 === void 0 ? void 0 : _params$bookings2.length) || 0,
|
|
266
|
-
relationProductsCount: ((_params$relation_prod2 = params.relation_products) === null || _params$relation_prod2 === void 0 ? void 0 : _params$relation_prod2.length) || 0,
|
|
267
|
-
paymentsCount: ((_params$payments = params.payments) === null || _params$payments === void 0 ? void 0 : _params$payments.length) || 0,
|
|
268
|
-
depositAmount: params.deposit_amount,
|
|
269
|
-
productTaxFee: params.product_tax_fee,
|
|
270
|
-
note: params.note,
|
|
271
|
-
scheduleDate: params.schedule_date,
|
|
272
|
-
hasOrderId: !!params.order_id,
|
|
273
|
-
orderIdIncluded: params.order_id,
|
|
274
|
-
paymentMethods: ((_params$payments2 = params.payments) === null || _params$payments2 === void 0 ? void 0 : _params$payments2.map(function (p) {
|
|
275
|
-
return p.code;
|
|
276
|
-
})) || []
|
|
277
|
-
});
|
|
278
|
-
console.log('[Order] createOrderByCheckout 开始创建订单:', {
|
|
279
|
-
type: params.type,
|
|
280
|
-
platform: params.platform,
|
|
281
|
-
is_deposit: params.is_deposit,
|
|
282
|
-
customer_id: params.customer_id,
|
|
283
|
-
bookingsCount: ((_params$bookings3 = params.bookings) === null || _params$bookings3 === void 0 ? void 0 : _params$bookings3.length) || 0,
|
|
284
|
-
relationProductsCount: ((_params$relation_prod3 = params.relation_products) === null || _params$relation_prod3 === void 0 ? void 0 : _params$relation_prod3.length) || 0,
|
|
285
|
-
paymentsCount: ((_params$payments3 = params.payments) === null || _params$payments3 === void 0 ? void 0 : _params$payments3.length) || 0
|
|
286
|
-
});
|
|
287
|
-
_context3.prev = 2;
|
|
288
|
-
// 构建订单数据,设置默认值并允许 params 覆盖
|
|
289
|
-
orderData = _objectSpread({
|
|
290
|
-
sales_channel: 'my_pisel',
|
|
291
|
-
order_sales_channel: 'online_store',
|
|
292
|
-
shop_note: '',
|
|
293
|
-
schedule_date: '',
|
|
294
|
-
is_deposit: 0,
|
|
295
|
-
bookings: [],
|
|
296
|
-
relation_products: [],
|
|
297
|
-
relation_forms: [],
|
|
298
|
-
payments: [],
|
|
299
|
-
is_full_overwrite_flag: 1
|
|
300
|
-
}, params);
|
|
301
|
-
if ((_orderData$payments = orderData.payments) !== null && _orderData$payments !== void 0 && _orderData$payments.length) {
|
|
302
|
-
orderData.small_ticket_data_flag = 1;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// 兜底策略,如果是第一次下单,没有 order_id,且没有 schedule_date,则设置为当前时间
|
|
306
|
-
if (!params.order_id && !orderData.schedule_date) {
|
|
307
|
-
orderData.schedule_date = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
308
|
-
}
|
|
309
|
-
console.log('[Order] 调用后端接口创建订单:', {
|
|
310
|
-
url: '/order/checkout',
|
|
311
|
-
orderType: orderData.type,
|
|
312
|
-
platform: orderData.platform,
|
|
313
|
-
isDeposit: orderData.is_deposit,
|
|
314
|
-
customerId: orderData.customer_id,
|
|
315
|
-
bookingsCount: ((_orderData$bookings = orderData.bookings) === null || _orderData$bookings === void 0 ? void 0 : _orderData$bookings.length) || 0,
|
|
316
|
-
relationProductsCount: ((_orderData$relation_p = orderData.relation_products) === null || _orderData$relation_p === void 0 ? void 0 : _orderData$relation_p.length) || 0,
|
|
317
|
-
paymentsCount: ((_orderData$payments2 = orderData.payments) === null || _orderData$payments2 === void 0 ? void 0 : _orderData$payments2.length) || 0,
|
|
318
|
-
paymentsMethods: ((_orderData$payments3 = orderData.payments) === null || _orderData$payments3 === void 0 ? void 0 : _orderData$payments3.map(function (p) {
|
|
319
|
-
return p.code;
|
|
320
|
-
})) || []
|
|
321
|
-
});
|
|
322
|
-
|
|
323
|
-
// 记录接口调用详情
|
|
324
|
-
this.logInfo('Calling backend checkout API', {
|
|
325
|
-
url: '/order/checkout',
|
|
326
|
-
orderType: orderData.type,
|
|
327
|
-
platform: orderData.platform,
|
|
328
|
-
isDeposit: orderData.is_deposit,
|
|
329
|
-
customerId: orderData.customer_id,
|
|
330
|
-
depositAmount: orderData.deposit_amount,
|
|
331
|
-
bookingsCount: ((_orderData$bookings2 = orderData.bookings) === null || _orderData$bookings2 === void 0 ? void 0 : _orderData$bookings2.length) || 0,
|
|
332
|
-
relationProductsCount: ((_orderData$relation_p2 = orderData.relation_products) === null || _orderData$relation_p2 === void 0 ? void 0 : _orderData$relation_p2.length) || 0,
|
|
333
|
-
paymentsCount: ((_orderData$payments4 = orderData.payments) === null || _orderData$payments4 === void 0 ? void 0 : _orderData$payments4.length) || 0,
|
|
334
|
-
paymentMethods: ((_orderData$payments5 = orderData.payments) === null || _orderData$payments5 === void 0 ? void 0 : _orderData$payments5.map(function (p) {
|
|
335
|
-
return {
|
|
336
|
-
code: p.code,
|
|
337
|
-
amount: p.amount,
|
|
338
|
-
type: p.type,
|
|
339
|
-
hasVoucherId: !!p.voucher_id,
|
|
340
|
-
orderPaymentType: p.order_payment_type
|
|
341
|
-
};
|
|
342
|
-
})) || [],
|
|
343
|
-
productTaxFee: orderData.product_tax_fee,
|
|
344
|
-
note: orderData.note,
|
|
345
|
-
scheduleDate: orderData.schedule_date,
|
|
346
|
-
hasOrderId: !!orderData.order_id,
|
|
347
|
-
smallTicketDataFlag: orderData.small_ticket_data_flag
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
// 调用后端接口
|
|
351
|
-
_context3.next = 10;
|
|
352
|
-
return this.request.post('/order/checkout', orderData);
|
|
353
|
-
case 10:
|
|
354
|
-
response = _context3.sent;
|
|
355
|
-
this.logInfo('Order API called successfully', {
|
|
356
|
-
response: response
|
|
357
|
-
});
|
|
358
|
-
console.log('[Order] 订单创建成功,后端响应:', {
|
|
359
|
-
success: !!response,
|
|
360
|
-
hasOrderId: !!(response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.order_id || response !== null && response !== void 0 && response.order_id)
|
|
361
|
-
});
|
|
362
|
-
return _context3.abrupt("return", response);
|
|
363
|
-
case 16:
|
|
364
|
-
_context3.prev = 16;
|
|
365
|
-
_context3.t0 = _context3["catch"](2);
|
|
366
|
-
console.error('[Order] createOrderByCheckout 创建订单失败:', _context3.t0);
|
|
367
|
-
this.logInfo('Order API called failed', {
|
|
368
|
-
error: _context3.t0 instanceof Error ? _context3.t0.message : String(_context3.t0)
|
|
369
|
-
});
|
|
370
|
-
throw _context3.t0;
|
|
371
|
-
case 21:
|
|
372
|
-
case "end":
|
|
373
|
-
return _context3.stop();
|
|
374
|
-
}
|
|
375
|
-
}, _callee3, this, [[2, 16]]);
|
|
376
|
-
}));
|
|
377
|
-
function createOrderByCheckout(_x4) {
|
|
378
|
-
return _createOrderByCheckout.apply(this, arguments);
|
|
379
|
-
}
|
|
380
|
-
return createOrderByCheckout;
|
|
381
|
-
}())
|
|
382
161
|
}]);
|
|
383
162
|
return OrderModule;
|
|
384
163
|
}(BaseModule);
|
|
@@ -19,45 +19,6 @@ export interface CommitOrderParams {
|
|
|
19
19
|
extraData?: Record<string, any>;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* 支付项数据
|
|
24
|
-
*/
|
|
25
|
-
export interface PaymentItemData {
|
|
26
|
-
/** 当前支付项的唯一 ID */
|
|
27
|
-
uuid: string;
|
|
28
|
-
/** 当前支付方式付出去多少钱 */
|
|
29
|
-
amount: string;
|
|
30
|
-
/** 支付类型代码 */
|
|
31
|
-
code: string;
|
|
32
|
-
/** 支付类型id */
|
|
33
|
-
id: number;
|
|
34
|
-
/** 支付类型名称 */
|
|
35
|
-
name: string;
|
|
36
|
-
/** 支付类型 */
|
|
37
|
-
type: string;
|
|
38
|
-
/** 是否已同步到后端 */
|
|
39
|
-
isSynced?: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Checkout 专用订单创建参数
|
|
43
|
-
*/
|
|
44
|
-
export interface CheckoutOrderParams {
|
|
45
|
-
type: 'virtual' | 'appointment_booking';
|
|
46
|
-
platform: 'PC' | 'H5';
|
|
47
|
-
sales_channel?: string;
|
|
48
|
-
order_sales_channel?: string;
|
|
49
|
-
bookings?: any[];
|
|
50
|
-
shop_note?: string;
|
|
51
|
-
schedule_date?: string;
|
|
52
|
-
is_deposit?: number;
|
|
53
|
-
relation_products?: any[];
|
|
54
|
-
relation_forms?: any[];
|
|
55
|
-
payments?: PaymentItemData[];
|
|
56
|
-
customer_id?: string;
|
|
57
|
-
/** 小票数据标记,当有支付项时设置为1 */
|
|
58
|
-
small_ticket_data_flag?: number;
|
|
59
|
-
[key: string]: any;
|
|
60
|
-
}
|
|
61
22
|
/**
|
|
62
23
|
* 订单模块 API
|
|
63
24
|
*/
|
|
@@ -80,10 +41,4 @@ export interface OrderModuleAPI {
|
|
|
80
41
|
* @param params 订单信息
|
|
81
42
|
*/
|
|
82
43
|
submitOrder: (params: CommitOrderParams) => Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* Checkout 专用:创建订单到后端
|
|
85
|
-
* @param params 订单参数
|
|
86
|
-
* @returns 后端返回的订单数据
|
|
87
|
-
*/
|
|
88
|
-
createOrderByCheckout: (params: CheckoutOrderParams) => Promise<any>;
|
|
89
44
|
}
|
|
@@ -56,7 +56,7 @@ export var getAllDiscountList = function getAllDiscountList(cartItem) {
|
|
|
56
56
|
var _cartItem$_origin, _cartItem$_origin2;
|
|
57
57
|
var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$_origin = cartItem._origin) === null || _cartItem$_origin === void 0 || (_cartItem$_origin = _cartItem$_origin.product) === null || _cartItem$_origin === void 0 ? void 0 : _cartItem$_origin.discount_list) || [];
|
|
58
58
|
((cartItem === null || cartItem === void 0 || (_cartItem$_origin2 = cartItem._origin) === null || _cartItem$_origin2 === void 0 || (_cartItem$_origin2 = _cartItem$_origin2.product) === null || _cartItem$_origin2 === void 0 ? void 0 : _cartItem$_origin2.product_bundle) || []).forEach(function (item) {
|
|
59
|
-
discountList = [].concat(_toConsumableArray(discountList), _toConsumableArray(
|
|
59
|
+
discountList = [].concat(_toConsumableArray(discountList), _toConsumableArray(item.discount_list || []));
|
|
60
60
|
item.discount_list = undefined;
|
|
61
61
|
});
|
|
62
62
|
return discountList;
|
|
@@ -1,191 +1,16 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
|
-
import { RequestPlugin } from '../../plugins';
|
|
3
2
|
import { BaseModule } from '../BaseModule';
|
|
4
|
-
import { PaymentModuleAPI, PaymentMethod,
|
|
5
|
-
export * from './types';
|
|
6
|
-
export { generateRequestUniqueId };
|
|
7
|
-
/**
|
|
8
|
-
* 生成请求唯一ID
|
|
9
|
-
* 格式: 年月日时分秒毫秒+4位随机数
|
|
10
|
-
* 示例: 20241201143025123456
|
|
11
|
-
*/
|
|
12
|
-
declare function generateRequestUniqueId(): string;
|
|
13
|
-
/**
|
|
14
|
-
* 支付模块实现
|
|
15
|
-
*
|
|
16
|
-
* 负责处理支付相关的数据管理和本地存储
|
|
17
|
-
*/
|
|
3
|
+
import { Payment, PaymentModuleAPI, PaymentMethod, PaymentStatus } from './types';
|
|
18
4
|
export declare class PaymentModule extends BaseModule implements Module, PaymentModuleAPI {
|
|
19
5
|
protected defaultName: string;
|
|
20
6
|
protected defaultVersion: string;
|
|
21
|
-
|
|
22
|
-
private app;
|
|
23
|
-
private store;
|
|
24
|
-
private dbManager;
|
|
25
|
-
private logger;
|
|
26
|
-
protected otherParams: any;
|
|
27
|
-
cash: CashPayment;
|
|
28
|
-
eftpos: EftposPayment;
|
|
29
|
-
wallet: WalletPassPayment;
|
|
7
|
+
private state;
|
|
30
8
|
constructor(name?: string, version?: string);
|
|
31
|
-
initialize(core: PisellCore, options
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*/
|
|
39
|
-
logWarning(title: string, metadata?: any): void;
|
|
40
|
-
/**
|
|
41
|
-
* 记录错误日志
|
|
42
|
-
*/
|
|
43
|
-
logError(title: string, error?: any, metadata?: any): void;
|
|
44
|
-
/**
|
|
45
|
-
* 记录调试日志
|
|
46
|
-
*/
|
|
47
|
-
logDebug(title: string, metadata?: any): void;
|
|
48
|
-
/**
|
|
49
|
-
* 网络恢复以后,尝试执行队列
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
private registerNetworkHandlers;
|
|
53
|
-
/**
|
|
54
|
-
* 获取支付方式列表
|
|
55
|
-
*/
|
|
56
|
-
getPayMethodListAsync(): Promise<PaymentMethod[]>;
|
|
57
|
-
/**
|
|
58
|
-
* 后台刷新支付方式列表
|
|
59
|
-
*/
|
|
60
|
-
private refreshPaymentMethodsInBackground;
|
|
61
|
-
/**
|
|
62
|
-
* 检查支付方式列表是否有变化
|
|
63
|
-
*/
|
|
64
|
-
private hasPaymentMethodsChanged;
|
|
65
|
-
/**
|
|
66
|
-
* 获取订单列表
|
|
67
|
-
*/
|
|
68
|
-
getOrderListAsync(): Promise<PaymentOrder[]>;
|
|
69
|
-
/**
|
|
70
|
-
* 根据订单UUID获取支付订单(新方法)
|
|
71
|
-
*/
|
|
72
|
-
getPaymentOrderByUuidAsync(orderUuid: string): Promise<PaymentOrder | null>;
|
|
73
|
-
/**
|
|
74
|
-
* 创建支付订单(新方法,专注支付数据)
|
|
75
|
-
*/
|
|
76
|
-
createPaymentOrderAsync(params: PushOrderParams): Promise<PaymentOrder>;
|
|
77
|
-
/**
|
|
78
|
-
* 删除支付订单(新方法)
|
|
79
|
-
*/
|
|
80
|
-
deletePaymentOrderAsync(orderUuid: string): Promise<void>;
|
|
81
|
-
/**
|
|
82
|
-
* 更新订单
|
|
83
|
-
*/
|
|
84
|
-
updateOrderAsync(orderUuid: string, params: Partial<PaymentOrder>): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* 基于UUID替换订单ID
|
|
87
|
-
*
|
|
88
|
-
* 此方法用于将本地虚拟订单ID替换为真实的订单ID。
|
|
89
|
-
* 当前端模拟下单流程完成后,后端返回真实订单ID时调用此方法。
|
|
90
|
-
*
|
|
91
|
-
* @param orderUuid 订单的UUID
|
|
92
|
-
* @param newOrderId 新的订单ID (来自后端)
|
|
93
|
-
* @returns 更新后的订单对象,如果订单不存在则返回null
|
|
94
|
-
*/
|
|
95
|
-
replaceOrderIdByUuidAsync(orderUuid: string, newOrderId: string): Promise<PaymentOrder | null>;
|
|
96
|
-
/**
|
|
97
|
-
* 获取支付项(新方法)
|
|
98
|
-
*
|
|
99
|
-
* @param orderUuid 订单UUID
|
|
100
|
-
* @param includeVoided 是否包含已撤销的支付项,默认为false
|
|
101
|
-
* @returns 支付项数组
|
|
102
|
-
*/
|
|
103
|
-
getPaymentItemsAsync(orderUuid: string, includeVoided?: boolean): Promise<PaymentItem[]>;
|
|
104
|
-
/**
|
|
105
|
-
* 获取所有支付项(包括已撤销的)
|
|
106
|
-
*
|
|
107
|
-
* @param orderUuid 订单UUID
|
|
108
|
-
* @returns 所有支付项数组(包括撤销的)
|
|
109
|
-
*/
|
|
110
|
-
getAllPaymentItemsAsync(orderUuid: string): Promise<PaymentItem[]>;
|
|
111
|
-
/**
|
|
112
|
-
* 为某个订单添加支付项(新方法)
|
|
113
|
-
*/
|
|
114
|
-
addPaymentItemAsync(orderUuid: string, paymentItem: PaymentItemInput): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* 删除一个支付项 - 标记删除而非物理删除
|
|
117
|
-
*/
|
|
118
|
-
deletePaymentAsync(orderUuid: string, paymentUuid: string): Promise<void>;
|
|
119
|
-
/**
|
|
120
|
-
* 批量更新代金券类支付项(覆盖更新)
|
|
121
|
-
*
|
|
122
|
-
* 删除所有现有的带 voucher_id 的支付项,然后添加新的代金券支付项
|
|
123
|
-
* 这是一个覆盖式更新,确保代金券支付项的一致性
|
|
124
|
-
*/
|
|
125
|
-
updateVoucherPaymentItemsAsync(orderUuid: string, voucherPaymentItems: PaymentItemInput[]): Promise<void>;
|
|
126
|
-
/**
|
|
127
|
-
* 更新一个支付项
|
|
128
|
-
*/
|
|
129
|
-
updatePaymentAsync(orderUuid: string, paymentUuid: string, params: PaymentUpdateFields): Promise<void>;
|
|
130
|
-
/**
|
|
131
|
-
* 提交支付
|
|
132
|
-
*/
|
|
133
|
-
submitPayAsync(orderUuid?: string): Promise<{
|
|
134
|
-
status: 'success' | 'failed';
|
|
135
|
-
}>;
|
|
136
|
-
/**
|
|
137
|
-
* 提交单个订单的支付(推送到任务队列)
|
|
138
|
-
*/
|
|
139
|
-
private submitSingleOrderPayment;
|
|
140
|
-
/**
|
|
141
|
-
* 获取订单剩余待付金额
|
|
142
|
-
*/
|
|
143
|
-
getRemainingOrderAmountAsync(orderUuid: string): Promise<number>;
|
|
144
|
-
/**
|
|
145
|
-
* 在比如现金支付界面的地方,用户输入了一个金额,在下方显示剩余多少金额,通过此方法获取
|
|
146
|
-
*/
|
|
147
|
-
getRemainingOrderAmountWithInputAsync(inputAmount: string | number, orderUuid: string): Promise<number>;
|
|
148
|
-
/**
|
|
149
|
-
* 重新计算订单金额
|
|
150
|
-
*/
|
|
151
|
-
private recalculateOrderAmount;
|
|
152
|
-
/**
|
|
153
|
-
* 获取现金支付方式
|
|
154
|
-
*/
|
|
155
|
-
getCashPaymentMethod(): Promise<PaymentMethod | null>;
|
|
156
|
-
/**
|
|
157
|
-
* 获取Eftpos支付方式
|
|
158
|
-
*/
|
|
159
|
-
getEftposPaymentMethod(): Promise<PaymentMethod | null>;
|
|
160
|
-
/**
|
|
161
|
-
* 获取钱包支付方式
|
|
162
|
-
*/
|
|
163
|
-
getWalletPaymentMethod(): Promise<PaymentMethod | null>;
|
|
164
|
-
/**
|
|
165
|
-
* 确保支付模块所需的数据库表已创建
|
|
166
|
-
*/
|
|
167
|
-
private ensurePaymentTables;
|
|
168
|
-
/**
|
|
169
|
-
* 获取部分支付的订单
|
|
170
|
-
*/
|
|
171
|
-
getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
|
|
172
|
-
/**
|
|
173
|
-
* 智能金额舍入
|
|
174
|
-
*
|
|
175
|
-
* 根据指定的舍入间隔和规则对金额进行舍入处理
|
|
176
|
-
*
|
|
177
|
-
* @param originalAmount 原始金额
|
|
178
|
-
* @param interval 舍入间隔 (0.05, 0.1, 0.5, 1)
|
|
179
|
-
* @param rule 舍入规则 (standard, standard_down, always_up, always_down)
|
|
180
|
-
* @returns 舍入结果详情(包含原始金额、舍入后金额和舍入差额)
|
|
181
|
-
*/
|
|
182
|
-
roundAmountAsync(originalAmount: number | string, interval: RoundingInterval | number, rule: RoundingRule | string): Promise<RoundingResult>;
|
|
183
|
-
/**
|
|
184
|
-
* 标准舍入处理(处理中点情况)
|
|
185
|
-
*
|
|
186
|
-
* @param value 要舍入的值
|
|
187
|
-
* @param midpointUp 中点是否向上舍入
|
|
188
|
-
* @returns 舍入后的值
|
|
189
|
-
*/
|
|
190
|
-
private standardRound;
|
|
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>;
|
|
191
16
|
}
|