@pisell/pisellos 2.2.13 → 2.2.15
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/Customer/index.js +1 -1
- package/dist/modules/Order/index.js +18 -13
- package/dist/modules/Payment/index.d.ts +1 -0
- package/dist/modules/Payment/index.js +537 -500
- package/dist/modules/Payment/types.d.ts +0 -1
- package/dist/modules/Payment/walletpass.js +1 -3
- package/dist/modules/ProductList/index.js +9 -8
- package/dist/modules/Rules/index.js +34 -66
- package/dist/solution/BookingByStep/index.js +8 -29
- package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
- package/dist/solution/BookingByStep/utils/products.js +0 -10
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/Checkout/index.js +21 -65
- package/dist/solution/Checkout/utils/index.d.ts +2 -1
- package/dist/solution/Checkout/utils/index.js +6 -4
- package/lib/modules/Customer/index.js +1 -1
- package/lib/modules/Order/index.js +20 -18
- package/lib/modules/Payment/index.d.ts +1 -0
- package/lib/modules/Payment/index.js +19 -3
- package/lib/modules/Payment/types.d.ts +0 -1
- package/lib/modules/Payment/walletpass.js +1 -10
- package/lib/modules/ProductList/index.js +7 -0
- package/lib/modules/Rules/index.js +36 -46
- package/lib/solution/BookingByStep/index.js +2 -15
- package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
- package/lib/solution/BookingByStep/utils/products.js +2 -8
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/Checkout/index.js +20 -69
- package/lib/solution/Checkout/utils/index.d.ts +2 -1
- package/lib/solution/Checkout/utils/index.js +6 -4
- package/package.json +2 -2
|
@@ -154,7 +154,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
154
154
|
skip: skip,
|
|
155
155
|
num: num,
|
|
156
156
|
sort_by: SORT_BY,
|
|
157
|
-
with: ['latestWalletDetail.wallet'
|
|
157
|
+
with: ['latestWalletDetail.wallet'],
|
|
158
158
|
search_wallet_flag: 1,
|
|
159
159
|
search_wallet_pass_flag: 1
|
|
160
160
|
}, search && {
|
|
@@ -252,11 +252,16 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
252
252
|
key: "createOrderByCheckout",
|
|
253
253
|
value: (function () {
|
|
254
254
|
var _createOrderByCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
255
|
-
var _params$bookings2, _params$relation_prod2, _params$
|
|
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;
|
|
255
|
+
var _params$payments, _params$bookings2, _params$relation_prod2, _params$payments2, _params$payments3, _params$bookings3, _params$relation_prod3, _params$payments4;
|
|
256
|
+
var onlineStorePaymentCodeList, _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
257
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
258
258
|
while (1) switch (_context3.prev = _context3.next) {
|
|
259
259
|
case 0:
|
|
260
|
+
// 过滤掉由在线店铺下单的 payment 支付数据
|
|
261
|
+
onlineStorePaymentCodeList = ['WXPAY', 'WECHAT', 'ALIPAY', 'APPLE_PAY', 'CREDIT_CARD_3DS', 'CREDIT_CARD_TOKEN', 'GOOGLE_PAY', 'GOOGLE_PAY_3DS', 'CREDIT_CARD'];
|
|
262
|
+
params.payments = (_params$payments = params.payments) === null || _params$payments === void 0 ? void 0 : _params$payments.filter(function (p) {
|
|
263
|
+
return !onlineStorePaymentCodeList.includes(p.code);
|
|
264
|
+
});
|
|
260
265
|
this.logInfo('createOrderByCheckout called', {
|
|
261
266
|
type: params.type,
|
|
262
267
|
platform: params.platform,
|
|
@@ -264,14 +269,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
264
269
|
customer_id: params.customer_id,
|
|
265
270
|
bookingsCount: ((_params$bookings2 = params.bookings) === null || _params$bookings2 === void 0 ? void 0 : _params$bookings2.length) || 0,
|
|
266
271
|
relationProductsCount: ((_params$relation_prod2 = params.relation_products) === null || _params$relation_prod2 === void 0 ? void 0 : _params$relation_prod2.length) || 0,
|
|
267
|
-
paymentsCount: ((_params$
|
|
272
|
+
paymentsCount: ((_params$payments2 = params.payments) === null || _params$payments2 === void 0 ? void 0 : _params$payments2.length) || 0,
|
|
268
273
|
depositAmount: params.deposit_amount,
|
|
269
274
|
productTaxFee: params.product_tax_fee,
|
|
270
275
|
note: params.note,
|
|
271
276
|
scheduleDate: params.schedule_date,
|
|
272
277
|
hasOrderId: !!params.order_id,
|
|
273
278
|
orderIdIncluded: params.order_id,
|
|
274
|
-
paymentMethods: ((_params$
|
|
279
|
+
paymentMethods: ((_params$payments3 = params.payments) === null || _params$payments3 === void 0 ? void 0 : _params$payments3.map(function (p) {
|
|
275
280
|
return p.code;
|
|
276
281
|
})) || []
|
|
277
282
|
});
|
|
@@ -282,9 +287,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
282
287
|
customer_id: params.customer_id,
|
|
283
288
|
bookingsCount: ((_params$bookings3 = params.bookings) === null || _params$bookings3 === void 0 ? void 0 : _params$bookings3.length) || 0,
|
|
284
289
|
relationProductsCount: ((_params$relation_prod3 = params.relation_products) === null || _params$relation_prod3 === void 0 ? void 0 : _params$relation_prod3.length) || 0,
|
|
285
|
-
paymentsCount: ((_params$
|
|
290
|
+
paymentsCount: ((_params$payments4 = params.payments) === null || _params$payments4 === void 0 ? void 0 : _params$payments4.length) || 0
|
|
286
291
|
});
|
|
287
|
-
_context3.prev =
|
|
292
|
+
_context3.prev = 4;
|
|
288
293
|
// 构建订单数据,设置默认值并允许 params 覆盖
|
|
289
294
|
orderData = _objectSpread({
|
|
290
295
|
sales_channel: 'my_pisel',
|
|
@@ -348,9 +353,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
348
353
|
});
|
|
349
354
|
|
|
350
355
|
// 调用后端接口
|
|
351
|
-
_context3.next =
|
|
356
|
+
_context3.next = 12;
|
|
352
357
|
return this.request.post('/order/checkout', orderData);
|
|
353
|
-
case
|
|
358
|
+
case 12:
|
|
354
359
|
response = _context3.sent;
|
|
355
360
|
this.logInfo('Order API called successfully', {
|
|
356
361
|
response: response
|
|
@@ -360,19 +365,19 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
360
365
|
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
366
|
});
|
|
362
367
|
return _context3.abrupt("return", response);
|
|
363
|
-
case
|
|
364
|
-
_context3.prev =
|
|
365
|
-
_context3.t0 = _context3["catch"](
|
|
368
|
+
case 18:
|
|
369
|
+
_context3.prev = 18;
|
|
370
|
+
_context3.t0 = _context3["catch"](4);
|
|
366
371
|
console.error('[Order] createOrderByCheckout 创建订单失败:', _context3.t0);
|
|
367
372
|
this.logInfo('Order API called failed', {
|
|
368
373
|
error: _context3.t0 instanceof Error ? _context3.t0.message : String(_context3.t0)
|
|
369
374
|
});
|
|
370
375
|
throw _context3.t0;
|
|
371
|
-
case
|
|
376
|
+
case 23:
|
|
372
377
|
case "end":
|
|
373
378
|
return _context3.stop();
|
|
374
379
|
}
|
|
375
|
-
}, _callee3, this, [[
|
|
380
|
+
}, _callee3, this, [[4, 18]]);
|
|
376
381
|
}));
|
|
377
382
|
function createOrderByCheckout(_x4) {
|
|
378
383
|
return _createOrderByCheckout.apply(this, arguments);
|