@pisell/pisellos 1.0.57 → 1.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/modules/Cart/index.js +1 -1
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +12 -1
- package/dist/modules/Order/index.js +98 -0
- package/dist/modules/Order/types.d.ts +45 -0
- package/dist/modules/Order/types.js +8 -0
- package/dist/modules/Payment/cash.d.ts +19 -0
- package/dist/modules/Payment/cash.js +97 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -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 +183 -9
- package/dist/modules/Payment/index.js +1993 -108
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/mx51.js +0 -0
- package/dist/modules/Payment/types.d.ts +742 -30
- package/dist/modules/Payment/types.js +236 -12
- package/dist/modules/Payment/utils.d.ts +17 -0
- package/dist/modules/Payment/utils.js +62 -0
- package/dist/modules/Payment/walletpass.d.ts +99 -0
- package/dist/modules/Payment/walletpass.js +586 -0
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +32 -12
- package/dist/modules/Schedule/index.d.ts +9 -0
- package/dist/modules/Schedule/index.js +68 -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/solution/BookingByStep/index.js +9 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +114 -72
- package/dist/solution/BookingTicket/index.d.ts +9 -1
- package/dist/solution/BookingTicket/index.js +27 -3
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +6 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +43 -28
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +475 -0
- package/dist/solution/Checkout/index.js +4333 -0
- package/dist/solution/Checkout/types.d.ts +923 -0
- package/dist/solution/Checkout/types.js +148 -0
- package/dist/solution/Checkout/utils/index.d.ts +117 -0
- package/dist/solution/Checkout/utils/index.js +549 -0
- package/dist/solution/ShopDiscount/index.d.ts +4 -9
- package/dist/solution/ShopDiscount/index.js +102 -52
- package/dist/solution/ShopDiscount/types.d.ts +10 -1
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/lib/modules/Cart/index.js +1 -1
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +12 -1
- package/lib/modules/Order/index.js +78 -0
- package/lib/modules/Order/types.d.ts +45 -0
- package/lib/modules/Payment/cash.d.ts +19 -0
- package/lib/modules/Payment/cash.js +64 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -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 +183 -9
- package/lib/modules/Payment/index.js +1024 -50
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/mx51.js +0 -0
- package/lib/modules/Payment/types.d.ts +742 -30
- package/lib/modules/Payment/types.js +79 -6
- package/lib/modules/Payment/utils.d.ts +17 -0
- package/lib/modules/Payment/utils.js +67 -0
- package/lib/modules/Payment/walletpass.d.ts +99 -0
- package/lib/modules/Payment/walletpass.js +368 -0
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +28 -12
- package/lib/modules/Schedule/index.d.ts +9 -0
- package/lib/modules/Schedule/index.js +51 -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/solution/BookingByStep/index.js +1 -2
- package/lib/solution/BookingByStep/utils/timeslots.js +72 -53
- package/lib/solution/BookingTicket/index.d.ts +9 -1
- package/lib/solution/BookingTicket/index.js +23 -2
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +6 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +21 -14
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +475 -0
- package/lib/solution/Checkout/index.js +2641 -0
- package/lib/solution/Checkout/types.d.ts +923 -0
- package/lib/solution/Checkout/types.js +87 -0
- package/lib/solution/Checkout/utils/index.d.ts +117 -0
- package/lib/solution/Checkout/utils/index.js +403 -0
- package/lib/solution/ShopDiscount/index.d.ts +4 -9
- package/lib/solution/ShopDiscount/index.js +39 -12
- package/lib/solution/ShopDiscount/types.d.ts +10 -1
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/package.json +3 -1
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { OrderModuleAPI, CommitOrderParams } from './types';
|
|
3
|
+
import { OrderModuleAPI, CommitOrderParams, CheckoutOrderParams } from './types';
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
5
|
export declare class OrderModule extends BaseModule implements Module, OrderModuleAPI {
|
|
6
6
|
protected defaultName: string;
|
|
@@ -26,4 +26,15 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
26
26
|
type: 'holder' | 'account';
|
|
27
27
|
}): boolean;
|
|
28
28
|
submitOrder(order: CommitOrderParams): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Checkout 专用:创建订单到后端
|
|
31
|
+
*
|
|
32
|
+
* 专门为 Checkout 模块设计的订单创建方法,
|
|
33
|
+
* 直接调用 /order/checkout 接口创建订单
|
|
34
|
+
* 接收已经处理好的订单数据,无需再处理购物车
|
|
35
|
+
*
|
|
36
|
+
* @param params Checkout 订单参数(已处理的订单数据)
|
|
37
|
+
* @returns 后端返回的订单数据(包含订单ID等)
|
|
38
|
+
*/
|
|
39
|
+
createOrderByCheckout(params: CheckoutOrderParams): Promise<any>;
|
|
29
40
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
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; }
|
|
2
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
5
|
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."); }
|
|
4
6
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -24,6 +26,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
24
26
|
import { BaseModule } from "../BaseModule";
|
|
25
27
|
import { generateDuration, mergeRelationForms } from "./utils";
|
|
26
28
|
import { isNormalProduct } from "../Product/utils";
|
|
29
|
+
import dayjs from 'dayjs';
|
|
27
30
|
export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
28
31
|
_inherits(OrderModule, _BaseModule);
|
|
29
32
|
var _super = _createSuper(OrderModule);
|
|
@@ -153,6 +156,101 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
153
156
|
}
|
|
154
157
|
return submitOrder;
|
|
155
158
|
}()
|
|
159
|
+
/**
|
|
160
|
+
* Checkout 专用:创建订单到后端
|
|
161
|
+
*
|
|
162
|
+
* 专门为 Checkout 模块设计的订单创建方法,
|
|
163
|
+
* 直接调用 /order/checkout 接口创建订单
|
|
164
|
+
* 接收已经处理好的订单数据,无需再处理购物车
|
|
165
|
+
*
|
|
166
|
+
* @param params Checkout 订单参数(已处理的订单数据)
|
|
167
|
+
* @returns 后端返回的订单数据(包含订单ID等)
|
|
168
|
+
*/
|
|
169
|
+
}, {
|
|
170
|
+
key: "createOrderByCheckout",
|
|
171
|
+
value: (function () {
|
|
172
|
+
var _createOrderByCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
173
|
+
var _params$bookings, _params$relation_prod, _params$payments;
|
|
174
|
+
var _orderData$payments, _orderData$bookings, _orderData$relation_p, _orderData$payments2, _orderData$payments3, _response$data, orderData, response;
|
|
175
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
176
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
177
|
+
case 0:
|
|
178
|
+
console.log('[Order] createOrderByCheckout 开始创建订单:', {
|
|
179
|
+
type: params.type,
|
|
180
|
+
platform: params.platform,
|
|
181
|
+
is_deposit: params.is_deposit,
|
|
182
|
+
customer_id: params.customer_id,
|
|
183
|
+
bookingsCount: ((_params$bookings = params.bookings) === null || _params$bookings === void 0 ? void 0 : _params$bookings.length) || 0,
|
|
184
|
+
relationProductsCount: ((_params$relation_prod = params.relation_products) === null || _params$relation_prod === void 0 ? void 0 : _params$relation_prod.length) || 0,
|
|
185
|
+
paymentsCount: ((_params$payments = params.payments) === null || _params$payments === void 0 ? void 0 : _params$payments.length) || 0
|
|
186
|
+
});
|
|
187
|
+
_context3.prev = 1;
|
|
188
|
+
// 构建订单数据,设置默认值并允许 params 覆盖
|
|
189
|
+
orderData = _objectSpread({
|
|
190
|
+
sales_channel: 'my_pisel',
|
|
191
|
+
order_sales_channel: 'online_store',
|
|
192
|
+
shop_note: '',
|
|
193
|
+
schedule_date: '',
|
|
194
|
+
is_deposit: 0,
|
|
195
|
+
bookings: [],
|
|
196
|
+
relation_products: [],
|
|
197
|
+
relation_forms: [],
|
|
198
|
+
payments: []
|
|
199
|
+
}, params);
|
|
200
|
+
if ((_orderData$payments = orderData.payments) !== null && _orderData$payments !== void 0 && _orderData$payments.length) {
|
|
201
|
+
orderData.small_ticket_data_flag = 1;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// 如果进来的order_id 是真实的,则不需要再传递 bookings 和 relation_products
|
|
205
|
+
if (params.order_id) {
|
|
206
|
+
orderData.bookings = [];
|
|
207
|
+
orderData.relation_products = [];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// 兜底策略,如果是第一次下单,没有 order_id,且没有 schedule_date,则设置为当前时间
|
|
211
|
+
if (!params.order_id && !orderData.schedule_date) {
|
|
212
|
+
orderData.schedule_date = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
213
|
+
}
|
|
214
|
+
console.log('[Order] 调用后端接口创建订单:', {
|
|
215
|
+
url: '/order/checkout',
|
|
216
|
+
orderType: orderData.type,
|
|
217
|
+
platform: orderData.platform,
|
|
218
|
+
isDeposit: orderData.is_deposit,
|
|
219
|
+
customerId: orderData.customer_id,
|
|
220
|
+
bookingsCount: ((_orderData$bookings = orderData.bookings) === null || _orderData$bookings === void 0 ? void 0 : _orderData$bookings.length) || 0,
|
|
221
|
+
relationProductsCount: ((_orderData$relation_p = orderData.relation_products) === null || _orderData$relation_p === void 0 ? void 0 : _orderData$relation_p.length) || 0,
|
|
222
|
+
paymentsCount: ((_orderData$payments2 = orderData.payments) === null || _orderData$payments2 === void 0 ? void 0 : _orderData$payments2.length) || 0,
|
|
223
|
+
paymentsMethods: ((_orderData$payments3 = orderData.payments) === null || _orderData$payments3 === void 0 ? void 0 : _orderData$payments3.map(function (p) {
|
|
224
|
+
return p.code;
|
|
225
|
+
})) || []
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// 调用后端接口
|
|
229
|
+
_context3.next = 9;
|
|
230
|
+
return this.request.post('/order/checkout', orderData);
|
|
231
|
+
case 9:
|
|
232
|
+
response = _context3.sent;
|
|
233
|
+
console.log('[Order] 订单创建成功,后端响应:', {
|
|
234
|
+
success: !!response,
|
|
235
|
+
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)
|
|
236
|
+
});
|
|
237
|
+
return _context3.abrupt("return", response);
|
|
238
|
+
case 14:
|
|
239
|
+
_context3.prev = 14;
|
|
240
|
+
_context3.t0 = _context3["catch"](1);
|
|
241
|
+
console.error('[Order] createOrderByCheckout 创建订单失败:', _context3.t0);
|
|
242
|
+
throw _context3.t0;
|
|
243
|
+
case 18:
|
|
244
|
+
case "end":
|
|
245
|
+
return _context3.stop();
|
|
246
|
+
}
|
|
247
|
+
}, _callee3, this, [[1, 14]]);
|
|
248
|
+
}));
|
|
249
|
+
function createOrderByCheckout(_x4) {
|
|
250
|
+
return _createOrderByCheckout.apply(this, arguments);
|
|
251
|
+
}
|
|
252
|
+
return createOrderByCheckout;
|
|
253
|
+
}())
|
|
156
254
|
}]);
|
|
157
255
|
return OrderModule;
|
|
158
256
|
}(BaseModule);
|
|
@@ -18,6 +18,45 @@ export interface CommitOrderParams {
|
|
|
18
18
|
platform?: 'pc' | 'h5';
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* 支付项数据
|
|
23
|
+
*/
|
|
24
|
+
export interface PaymentItemData {
|
|
25
|
+
/** 当前支付项的唯一 ID */
|
|
26
|
+
uuid: string;
|
|
27
|
+
/** 当前支付方式付出去多少钱 */
|
|
28
|
+
amount: string;
|
|
29
|
+
/** 支付类型代码 */
|
|
30
|
+
code: string;
|
|
31
|
+
/** 支付类型id */
|
|
32
|
+
id: number;
|
|
33
|
+
/** 支付类型名称 */
|
|
34
|
+
name: string;
|
|
35
|
+
/** 支付类型 */
|
|
36
|
+
type: string;
|
|
37
|
+
/** 是否已同步到后端 */
|
|
38
|
+
isSynced?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Checkout 专用订单创建参数
|
|
42
|
+
*/
|
|
43
|
+
export interface CheckoutOrderParams {
|
|
44
|
+
type: 'virtual' | 'appointment_booking';
|
|
45
|
+
platform: 'PC' | 'H5';
|
|
46
|
+
sales_channel?: string;
|
|
47
|
+
order_sales_channel?: string;
|
|
48
|
+
bookings?: any[];
|
|
49
|
+
shop_note?: string;
|
|
50
|
+
schedule_date?: string;
|
|
51
|
+
is_deposit?: number;
|
|
52
|
+
relation_products?: any[];
|
|
53
|
+
relation_forms?: any[];
|
|
54
|
+
payments?: PaymentItemData[];
|
|
55
|
+
customer_id?: string;
|
|
56
|
+
/** 小票数据标记,当有支付项时设置为1 */
|
|
57
|
+
small_ticket_data_flag?: number;
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
}
|
|
21
60
|
/**
|
|
22
61
|
* 订单模块 API
|
|
23
62
|
*/
|
|
@@ -40,4 +79,10 @@ export interface OrderModuleAPI {
|
|
|
40
79
|
* @param params 订单信息
|
|
41
80
|
*/
|
|
42
81
|
submitOrder: (params: CommitOrderParams) => Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Checkout 专用:创建订单到后端
|
|
84
|
+
* @param params 订单参数
|
|
85
|
+
* @returns 后端返回的订单数据
|
|
86
|
+
*/
|
|
87
|
+
createOrderByCheckout: (params: CheckoutOrderParams) => Promise<any>;
|
|
43
88
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CashPayment } from './types';
|
|
2
|
+
import type { PaymentModule } from './index';
|
|
3
|
+
/**
|
|
4
|
+
* 现金支付实现
|
|
5
|
+
*/
|
|
6
|
+
export declare class CashPaymentImpl implements CashPayment {
|
|
7
|
+
private paymentModule;
|
|
8
|
+
constructor(paymentModule: PaymentModule);
|
|
9
|
+
processCashPayment(amount: number, orderUuid: string): Promise<void>;
|
|
10
|
+
getCashBalance(): Promise<number>;
|
|
11
|
+
/**
|
|
12
|
+
* 获取推荐支付金额
|
|
13
|
+
* 基于目标金额和货币类型,返回最优支付金额建议
|
|
14
|
+
* @param money 目标支付金额
|
|
15
|
+
* @param currency 货币代码 (如: 'CNY', 'USD', 'EUR' 等)
|
|
16
|
+
* @returns 推荐支付金额数组
|
|
17
|
+
*/
|
|
18
|
+
getRecommendedAmount(money: number, currency: string): number[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
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); }
|
|
10
|
+
import { CURRENCY_DENOMINATIONS, recommendOptimalPayments } from "./cashRecommendationAlgorithm";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 现金支付实现
|
|
14
|
+
*/
|
|
15
|
+
export var CashPaymentImpl = /*#__PURE__*/function () {
|
|
16
|
+
function CashPaymentImpl(paymentModule) {
|
|
17
|
+
_classCallCheck(this, CashPaymentImpl);
|
|
18
|
+
this.paymentModule = paymentModule;
|
|
19
|
+
}
|
|
20
|
+
_createClass(CashPaymentImpl, [{
|
|
21
|
+
key: "processCashPayment",
|
|
22
|
+
value: function () {
|
|
23
|
+
var _processCashPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(amount, orderUuid) {
|
|
24
|
+
var cashMethod, paymentItem;
|
|
25
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
26
|
+
while (1) switch (_context.prev = _context.next) {
|
|
27
|
+
case 0:
|
|
28
|
+
_context.next = 2;
|
|
29
|
+
return this.paymentModule.getCashPaymentMethod();
|
|
30
|
+
case 2:
|
|
31
|
+
cashMethod = _context.sent;
|
|
32
|
+
if (cashMethod) {
|
|
33
|
+
_context.next = 5;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
throw new Error('现金支付方式未找到');
|
|
37
|
+
case 5:
|
|
38
|
+
paymentItem = {
|
|
39
|
+
amount: amount.toString(),
|
|
40
|
+
code: cashMethod.code,
|
|
41
|
+
id: cashMethod.id,
|
|
42
|
+
name: cashMethod.name,
|
|
43
|
+
type: cashMethod.type,
|
|
44
|
+
voucher_id: ''
|
|
45
|
+
};
|
|
46
|
+
_context.next = 8;
|
|
47
|
+
return this.paymentModule.addPaymentItemAsync(orderUuid, paymentItem);
|
|
48
|
+
case 8:
|
|
49
|
+
case "end":
|
|
50
|
+
return _context.stop();
|
|
51
|
+
}
|
|
52
|
+
}, _callee, this);
|
|
53
|
+
}));
|
|
54
|
+
function processCashPayment(_x, _x2) {
|
|
55
|
+
return _processCashPayment.apply(this, arguments);
|
|
56
|
+
}
|
|
57
|
+
return processCashPayment;
|
|
58
|
+
}()
|
|
59
|
+
}, {
|
|
60
|
+
key: "getCashBalance",
|
|
61
|
+
value: function () {
|
|
62
|
+
var _getCashBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
63
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
64
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
65
|
+
case 0:
|
|
66
|
+
return _context2.abrupt("return", 0);
|
|
67
|
+
case 1:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context2.stop();
|
|
70
|
+
}
|
|
71
|
+
}, _callee2);
|
|
72
|
+
}));
|
|
73
|
+
function getCashBalance() {
|
|
74
|
+
return _getCashBalance.apply(this, arguments);
|
|
75
|
+
}
|
|
76
|
+
return getCashBalance;
|
|
77
|
+
}()
|
|
78
|
+
/**
|
|
79
|
+
* 获取推荐支付金额
|
|
80
|
+
* 基于目标金额和货币类型,返回最优支付金额建议
|
|
81
|
+
* @param money 目标支付金额
|
|
82
|
+
* @param currency 货币代码 (如: 'CNY', 'USD', 'EUR' 等)
|
|
83
|
+
* @returns 推荐支付金额数组
|
|
84
|
+
*/
|
|
85
|
+
}, {
|
|
86
|
+
key: "getRecommendedAmount",
|
|
87
|
+
value: function getRecommendedAmount(money, currency) {
|
|
88
|
+
// 获取对应货币的面额配置
|
|
89
|
+
var upperCurrency = currency.toUpperCase();
|
|
90
|
+
var denominations = CURRENCY_DENOMINATIONS[upperCurrency] || CURRENCY_DENOMINATIONS['DEFAULT'];
|
|
91
|
+
|
|
92
|
+
// 直接调用算法,所有验证和容错处理都在算法内部
|
|
93
|
+
return recommendOptimalPayments(money, denominations);
|
|
94
|
+
}
|
|
95
|
+
}]);
|
|
96
|
+
return CashPaymentImpl;
|
|
97
|
+
}();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 现金支付推荐算法
|
|
3
|
+
*
|
|
4
|
+
* 核心原理:
|
|
5
|
+
* 1. 每个推荐金额都应该是独立的最优组合
|
|
6
|
+
* 2. 不推荐在已有最优解基础上添加额外面额的组合
|
|
7
|
+
* 3. 优先推荐使用不同数量币种的组合
|
|
8
|
+
* 4. 根据组合判断去重,避免扩展组合
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* 常见国家货币面额配置
|
|
12
|
+
*/
|
|
13
|
+
export declare const CURRENCY_DENOMINATIONS: Record<string, number[]>;
|
|
14
|
+
/**
|
|
15
|
+
* 最优支付金额推荐算法
|
|
16
|
+
* 推荐通过不同数量面额组合刚好足够支付的最小金额
|
|
17
|
+
*
|
|
18
|
+
* @param targetAmount 目标金额
|
|
19
|
+
* @param denominations 币种面值数组
|
|
20
|
+
* @returns 推荐支付金额数组
|
|
21
|
+
*/
|
|
22
|
+
export declare function recommendOptimalPayments(targetAmount: number, denominations: number[]): number[];
|