@pisell/pisellos 2.2.30 → 2.2.31
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/Product/index.d.ts +1 -1
- package/dist/modules/Summary/utils.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/Checkout/index.js +63 -55
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Summary/utils.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/Checkout/index.js +8 -2
- package/package.json +1 -1
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -21,7 +21,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
21
21
|
* @return {*}
|
|
22
22
|
* @Author: xiangfeng.xue
|
|
23
23
|
*/
|
|
24
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) =>
|
|
24
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
|
|
25
25
|
/**
|
|
26
26
|
* @title: 计算定金
|
|
27
27
|
* @param items - 购物车商品数组
|
|
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
123
123
|
* 获取当前的客户搜索条件
|
|
124
124
|
* @returns 当前搜索条件
|
|
125
125
|
*/
|
|
126
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
126
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
127
127
|
/**
|
|
128
128
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
129
129
|
* @returns 客户状态
|
|
@@ -1745,45 +1745,53 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1745
1745
|
value: (function () {
|
|
1746
1746
|
var _updateVoucherPaymentItemsAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(voucherPaymentItems) {
|
|
1747
1747
|
var _this4 = this;
|
|
1748
|
-
var paymentItems,
|
|
1748
|
+
var paymentItems, savedVoucherPaymentItems, allPaymentItemsSynced, remainingAmount, remainingValue, isOrderSynced, orderPaymentType, voucherPaymentItemsWithType, currentOrderId, isCurrentOrderReal, updatedOrder;
|
|
1749
1749
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1750
1750
|
while (1) switch (_context18.prev = _context18.next) {
|
|
1751
1751
|
case 0:
|
|
1752
1752
|
_context18.prev = 0;
|
|
1753
|
+
this.logInfo('updateVoucherPaymentItemsAsync called:', {
|
|
1754
|
+
voucherPaymentItems: voucherPaymentItems
|
|
1755
|
+
});
|
|
1756
|
+
// 检查是否有当前订单
|
|
1753
1757
|
if (this.store.currentOrder) {
|
|
1754
|
-
_context18.next =
|
|
1758
|
+
_context18.next = 4;
|
|
1755
1759
|
break;
|
|
1756
1760
|
}
|
|
1757
1761
|
throw createCheckoutError(CheckoutErrorType.ValidationFailed, '当前没有活跃订单,无法更新代金券支付项');
|
|
1758
|
-
case
|
|
1759
|
-
_context18.next =
|
|
1762
|
+
case 4:
|
|
1763
|
+
_context18.next = 6;
|
|
1760
1764
|
return this.payment.getPaymentItemsAsync(this.store.currentOrder.uuid);
|
|
1761
|
-
case
|
|
1765
|
+
case 6:
|
|
1762
1766
|
paymentItems = _context18.sent;
|
|
1763
1767
|
if (!(!voucherPaymentItems || (voucherPaymentItems === null || voucherPaymentItems === void 0 ? void 0 : voucherPaymentItems.length) === 0)) {
|
|
1764
|
-
_context18.next =
|
|
1768
|
+
_context18.next = 12;
|
|
1765
1769
|
break;
|
|
1766
1770
|
}
|
|
1767
|
-
savedVoucherPaymentItems = (
|
|
1771
|
+
savedVoucherPaymentItems = (paymentItems === null || paymentItems === void 0 ? void 0 : paymentItems.filter(function (item) {
|
|
1768
1772
|
return item.voucher_id && !item.isSynced;
|
|
1769
1773
|
})) || [];
|
|
1774
|
+
this.logInfo('未传入 voucher 且本地订单无 voucher 记录,阻断updateVoucherPaymentItemsAsync', {
|
|
1775
|
+
voucherPaymentItems: voucherPaymentItems,
|
|
1776
|
+
savedVoucherPaymentItems: savedVoucherPaymentItems
|
|
1777
|
+
});
|
|
1770
1778
|
if (!((savedVoucherPaymentItems === null || savedVoucherPaymentItems === void 0 ? void 0 : savedVoucherPaymentItems.length) === 0)) {
|
|
1771
|
-
_context18.next =
|
|
1779
|
+
_context18.next = 12;
|
|
1772
1780
|
break;
|
|
1773
1781
|
}
|
|
1774
1782
|
return _context18.abrupt("return");
|
|
1775
|
-
case
|
|
1783
|
+
case 12:
|
|
1776
1784
|
allPaymentItemsSynced = paymentItems.every(function (item) {
|
|
1777
1785
|
return item.isSynced;
|
|
1778
1786
|
});
|
|
1779
|
-
_context18.next =
|
|
1787
|
+
_context18.next = 15;
|
|
1780
1788
|
return this.calculateRemainingAmountAsync();
|
|
1781
|
-
case
|
|
1789
|
+
case 15:
|
|
1782
1790
|
remainingAmount = _context18.sent;
|
|
1783
1791
|
remainingValue = new Decimal(remainingAmount);
|
|
1784
1792
|
isOrderSynced = this.store.isOrderSynced;
|
|
1785
1793
|
if (!(remainingValue.lte(0) && isOrderSynced && voucherPaymentItems.length === 0 && allPaymentItemsSynced)) {
|
|
1786
|
-
_context18.next =
|
|
1794
|
+
_context18.next = 21;
|
|
1787
1795
|
break;
|
|
1788
1796
|
}
|
|
1789
1797
|
this.logInfo('订单已同步且支付完成,跳过清空代金券操作避免重复同步:', {
|
|
@@ -1795,7 +1803,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1795
1803
|
reason: 'Order synced and payment completed, skip clear vouchers to avoid duplicate sync'
|
|
1796
1804
|
});
|
|
1797
1805
|
return _context18.abrupt("return");
|
|
1798
|
-
case
|
|
1806
|
+
case 21:
|
|
1799
1807
|
this.logInfo('开始批量更新代金券支付项:', {
|
|
1800
1808
|
voucherPaymentItems: voucherPaymentItems
|
|
1801
1809
|
});
|
|
@@ -1817,18 +1825,18 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1817
1825
|
metadata: metadata
|
|
1818
1826
|
});
|
|
1819
1827
|
}); // 调用 Payment 模块的批量更新方法
|
|
1820
|
-
_context18.next =
|
|
1828
|
+
_context18.next = 26;
|
|
1821
1829
|
return this.payment.updateVoucherPaymentItemsAsync(this.store.currentOrder.uuid, voucherPaymentItemsWithType);
|
|
1822
|
-
case
|
|
1830
|
+
case 26:
|
|
1823
1831
|
// 🚀 清除计算缓存,确保获取最新数据
|
|
1824
1832
|
this.clearCalculationCache();
|
|
1825
1833
|
|
|
1826
1834
|
// 重新从Payment模块获取最新的订单数据,确保支付项同步
|
|
1827
1835
|
currentOrderId = this.store.currentOrder.order_id; // 保存当前的订单ID
|
|
1828
1836
|
isCurrentOrderReal = currentOrderId && !isVirtualOrderId(currentOrderId);
|
|
1829
|
-
_context18.next =
|
|
1837
|
+
_context18.next = 31;
|
|
1830
1838
|
return this.payment.getPaymentOrderByUuidAsync(this.store.currentOrder.uuid);
|
|
1831
|
-
case
|
|
1839
|
+
case 31:
|
|
1832
1840
|
updatedOrder = _context18.sent;
|
|
1833
1841
|
if (updatedOrder) {
|
|
1834
1842
|
// 如果当前订单ID是真实ID,但获取到的订单ID是虚拟ID,需要保护真实ID
|
|
@@ -1843,10 +1851,10 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1843
1851
|
}
|
|
1844
1852
|
|
|
1845
1853
|
// 更新 stateAmount 为剩余未支付金额
|
|
1846
|
-
_context18.next = 33;
|
|
1847
|
-
return this.updateStateAmountToRemaining(false);
|
|
1848
|
-
case 33:
|
|
1849
1854
|
_context18.next = 35;
|
|
1855
|
+
return this.updateStateAmountToRemaining(false);
|
|
1856
|
+
case 35:
|
|
1857
|
+
_context18.next = 37;
|
|
1850
1858
|
return this.core.effects.emit("".concat(this.name, ":onPaymentStarted"), {
|
|
1851
1859
|
orderUuid: this.store.currentOrder.uuid,
|
|
1852
1860
|
paymentMethodCode: 'VOUCHER_BATCH',
|
|
@@ -1855,23 +1863,23 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1855
1863
|
}, 0).toFixed(2),
|
|
1856
1864
|
timestamp: Date.now()
|
|
1857
1865
|
});
|
|
1858
|
-
case
|
|
1866
|
+
case 37:
|
|
1859
1867
|
this.logInfo('代金券支付项批量更新成功');
|
|
1860
|
-
_context18.next =
|
|
1868
|
+
_context18.next = 46;
|
|
1861
1869
|
break;
|
|
1862
|
-
case
|
|
1863
|
-
_context18.prev =
|
|
1870
|
+
case 40:
|
|
1871
|
+
_context18.prev = 40;
|
|
1864
1872
|
_context18.t0 = _context18["catch"](0);
|
|
1865
1873
|
this.logError('[Checkout] 批量更新代金券支付项失败:', _context18.t0);
|
|
1866
|
-
_context18.next =
|
|
1874
|
+
_context18.next = 45;
|
|
1867
1875
|
return this.handleError(_context18.t0, CheckoutErrorType.PaymentFailed);
|
|
1868
|
-
case
|
|
1876
|
+
case 45:
|
|
1869
1877
|
throw _context18.t0;
|
|
1870
|
-
case
|
|
1878
|
+
case 46:
|
|
1871
1879
|
case "end":
|
|
1872
1880
|
return _context18.stop();
|
|
1873
1881
|
}
|
|
1874
|
-
}, _callee18, this, [[0,
|
|
1882
|
+
}, _callee18, this, [[0, 40]]);
|
|
1875
1883
|
}));
|
|
1876
1884
|
function updateVoucherPaymentItemsAsync(_x17) {
|
|
1877
1885
|
return _updateVoucherPaymentItemsAsync.apply(this, arguments);
|
|
@@ -1996,7 +2004,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1996
2004
|
key: "setDepositAmountAsync",
|
|
1997
2005
|
value: (function () {
|
|
1998
2006
|
var _setDepositAmountAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(depositAmount) {
|
|
1999
|
-
var _this$store$
|
|
2007
|
+
var _this$store$currentOr12, _this$store$currentOr13;
|
|
2000
2008
|
var depositValue, formattedDepositAmount, oldDepositAmount, updateParams;
|
|
2001
2009
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
2002
2010
|
while (1) switch (_context20.prev = _context20.next) {
|
|
@@ -2004,8 +2012,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2004
2012
|
this.logInfo('setDepositAmountAsync called', {
|
|
2005
2013
|
depositAmount: depositAmount,
|
|
2006
2014
|
hasCurrentOrder: !!this.store.currentOrder,
|
|
2007
|
-
currentOrderId: (_this$store$
|
|
2008
|
-
currentTotalAmount: (_this$store$
|
|
2015
|
+
currentOrderId: (_this$store$currentOr12 = this.store.currentOrder) === null || _this$store$currentOr12 === void 0 ? void 0 : _this$store$currentOr12.order_id,
|
|
2016
|
+
currentTotalAmount: (_this$store$currentOr13 = this.store.currentOrder) === null || _this$store$currentOr13 === void 0 ? void 0 : _this$store$currentOr13.total_amount
|
|
2009
2017
|
});
|
|
2010
2018
|
_context20.prev = 1;
|
|
2011
2019
|
// 验证定金金额格式
|
|
@@ -2125,17 +2133,17 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2125
2133
|
key: "manualSyncOrderAsync",
|
|
2126
2134
|
value: (function () {
|
|
2127
2135
|
var _manualSyncOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
2128
|
-
var _this$store$
|
|
2129
|
-
var _this$store$
|
|
2136
|
+
var _this$store$currentOr14, _this$store$currentOr15, _this$store$currentOr16;
|
|
2137
|
+
var _this$store$currentOr17, orderUuid, oldOrderId, syncResult, finalOrderId, finalIsVirtual, newRes, _this$store$currentOr18, errorMessage;
|
|
2130
2138
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2131
2139
|
while (1) switch (_context21.prev = _context21.next) {
|
|
2132
2140
|
case 0:
|
|
2133
2141
|
console.log('manualSyncOrderAsync called');
|
|
2134
2142
|
this.logInfo('manualSyncOrderAsync called', {
|
|
2135
2143
|
hasCurrentOrder: !!this.store.currentOrder,
|
|
2136
|
-
currentOrderId: (_this$store$
|
|
2137
|
-
orderUuid: (_this$store$
|
|
2138
|
-
totalAmount: (_this$store$
|
|
2144
|
+
currentOrderId: (_this$store$currentOr14 = this.store.currentOrder) === null || _this$store$currentOr14 === void 0 ? void 0 : _this$store$currentOr14.order_id,
|
|
2145
|
+
orderUuid: (_this$store$currentOr15 = this.store.currentOrder) === null || _this$store$currentOr15 === void 0 ? void 0 : _this$store$currentOr15.uuid,
|
|
2146
|
+
totalAmount: (_this$store$currentOr16 = this.store.currentOrder) === null || _this$store$currentOr16 === void 0 ? void 0 : _this$store$currentOr16.total_amount,
|
|
2139
2147
|
isOrderSynced: this.store.isOrderSynced,
|
|
2140
2148
|
isVirtualOrderId: this.store.currentOrder ? isVirtualOrderId(this.store.currentOrder.order_id) : false
|
|
2141
2149
|
});
|
|
@@ -2195,7 +2203,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2195
2203
|
this.logError('[Checkout] 严重警告:返回的订单ID与存储的订单ID不一致!');
|
|
2196
2204
|
}
|
|
2197
2205
|
newRes = _objectSpread(_objectSpread({}, syncResult), {}, {
|
|
2198
|
-
is_deposit: ((_this$store$
|
|
2206
|
+
is_deposit: ((_this$store$currentOr17 = this.store.currentOrder) === null || _this$store$currentOr17 === void 0 ? void 0 : _this$store$currentOr17.is_deposit) || 0
|
|
2199
2207
|
});
|
|
2200
2208
|
_context21.next = 30;
|
|
2201
2209
|
return this.updateStateAmountToRemaining(false);
|
|
@@ -2209,7 +2217,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2209
2217
|
return _context21.abrupt("return", {
|
|
2210
2218
|
success: false,
|
|
2211
2219
|
message: "\u8BA2\u5355\u540C\u6B65\u5931\u8D25: ".concat(errorMessage),
|
|
2212
|
-
orderUuid: (_this$store$
|
|
2220
|
+
orderUuid: (_this$store$currentOr18 = this.store.currentOrder) === null || _this$store$currentOr18 === void 0 ? void 0 : _this$store$currentOr18.uuid
|
|
2213
2221
|
});
|
|
2214
2222
|
case 38:
|
|
2215
2223
|
case "end":
|
|
@@ -2286,15 +2294,15 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2286
2294
|
key: "cancelCurrentOrderAsync",
|
|
2287
2295
|
value: (function () {
|
|
2288
2296
|
var _cancelCurrentOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(cancelReason) {
|
|
2289
|
-
var _this$store$
|
|
2297
|
+
var _this$store$currentOr19, _this$store$currentOr20, currentOrderUuid, currentOrderId, isOrderSynced, errorMessage;
|
|
2290
2298
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2291
2299
|
while (1) switch (_context22.prev = _context22.next) {
|
|
2292
2300
|
case 0:
|
|
2293
2301
|
_context22.prev = 0;
|
|
2294
2302
|
this.logInfo('开始取消当前本地订单:', {
|
|
2295
2303
|
hasCurrentOrder: !!this.store.currentOrder,
|
|
2296
|
-
orderUuid: (_this$store$
|
|
2297
|
-
orderId: (_this$store$
|
|
2304
|
+
orderUuid: (_this$store$currentOr19 = this.store.currentOrder) === null || _this$store$currentOr19 === void 0 ? void 0 : _this$store$currentOr19.uuid,
|
|
2305
|
+
orderId: (_this$store$currentOr20 = this.store.currentOrder) === null || _this$store$currentOr20 === void 0 ? void 0 : _this$store$currentOr20.order_id,
|
|
2298
2306
|
isOrderSynced: this.store.isOrderSynced,
|
|
2299
2307
|
cancelReason: cancelReason
|
|
2300
2308
|
});
|
|
@@ -2405,7 +2413,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2405
2413
|
key: "saveForLaterPaymentAsync",
|
|
2406
2414
|
value: (function () {
|
|
2407
2415
|
var _saveForLaterPaymentAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
2408
|
-
var orderUuid, currentOrderId, allPaymentItems, orderPaymentStatus, syncResult, _this$store$
|
|
2416
|
+
var orderUuid, currentOrderId, allPaymentItems, orderPaymentStatus, syncResult, _this$store$currentOr21, errorMessage;
|
|
2409
2417
|
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2410
2418
|
while (1) switch (_context23.prev = _context23.next) {
|
|
2411
2419
|
case 0:
|
|
@@ -2464,7 +2472,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2464
2472
|
return _context23.abrupt("return", {
|
|
2465
2473
|
success: false,
|
|
2466
2474
|
message: "\u8BA2\u5355\u4FDD\u5B58\u5931\u8D25: ".concat(errorMessage),
|
|
2467
|
-
orderUuid: (_this$store$
|
|
2475
|
+
orderUuid: (_this$store$currentOr21 = this.store.currentOrder) === null || _this$store$currentOr21 === void 0 ? void 0 : _this$store$currentOr21.uuid
|
|
2468
2476
|
});
|
|
2469
2477
|
case 22:
|
|
2470
2478
|
case "end":
|
|
@@ -2487,7 +2495,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2487
2495
|
key: "updateOrderNoteAsync",
|
|
2488
2496
|
value: (function () {
|
|
2489
2497
|
var _updateOrderNoteAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(note) {
|
|
2490
|
-
var _this$store$
|
|
2498
|
+
var _this$store$currentOr22, _this$store$currentOr23, oldNote, orderInPayment;
|
|
2491
2499
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2492
2500
|
while (1) switch (_context24.prev = _context24.next) {
|
|
2493
2501
|
case 0:
|
|
@@ -2499,7 +2507,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2499
2507
|
throw createCheckoutError(CheckoutErrorType.ValidationFailed, '没有本地订单数据,无法更新备注');
|
|
2500
2508
|
case 3:
|
|
2501
2509
|
console.log('[Checkout] 更新订单备注:', {
|
|
2502
|
-
orderUuid: (_this$store$
|
|
2510
|
+
orderUuid: (_this$store$currentOr22 = this.store.currentOrder) === null || _this$store$currentOr22 === void 0 ? void 0 : _this$store$currentOr22.uuid,
|
|
2503
2511
|
oldNote: this.store.localOrderData.shop_note,
|
|
2504
2512
|
newNote: note
|
|
2505
2513
|
});
|
|
@@ -2532,7 +2540,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2532
2540
|
case 17:
|
|
2533
2541
|
_context24.next = 19;
|
|
2534
2542
|
return this.core.effects.emit("".concat(this.name, ":onOrderNoteChanged"), {
|
|
2535
|
-
orderUuid: (_this$store$
|
|
2543
|
+
orderUuid: (_this$store$currentOr23 = this.store.currentOrder) === null || _this$store$currentOr23 === void 0 ? void 0 : _this$store$currentOr23.uuid,
|
|
2536
2544
|
oldNote: oldNote,
|
|
2537
2545
|
newNote: note,
|
|
2538
2546
|
timestamp: Date.now()
|
|
@@ -2604,7 +2612,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2604
2612
|
key: "handlePaymentSuccess",
|
|
2605
2613
|
value: (function () {
|
|
2606
2614
|
var _handlePaymentSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(data) {
|
|
2607
|
-
var _this$store$
|
|
2615
|
+
var _this$store$currentOr24;
|
|
2608
2616
|
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2609
2617
|
while (1) switch (_context26.prev = _context26.next) {
|
|
2610
2618
|
case 0:
|
|
@@ -2615,7 +2623,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2615
2623
|
return this.core.effects.emit("".concat(this.name, ":onPaymentSuccess"), {
|
|
2616
2624
|
orderUuid: data.orderUuid,
|
|
2617
2625
|
paymentMethodCode: '',
|
|
2618
|
-
amount: ((_this$store$
|
|
2626
|
+
amount: ((_this$store$currentOr24 = this.store.currentOrder) === null || _this$store$currentOr24 === void 0 ? void 0 : _this$store$currentOr24.total_amount) || '0',
|
|
2619
2627
|
timestamp: data.timestamp
|
|
2620
2628
|
});
|
|
2621
2629
|
case 4:
|
|
@@ -2640,7 +2648,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2640
2648
|
key: "handlePaymentError",
|
|
2641
2649
|
value: (function () {
|
|
2642
2650
|
var _handlePaymentError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(data) {
|
|
2643
|
-
var _this$store$
|
|
2651
|
+
var _this$store$currentOr25;
|
|
2644
2652
|
var error;
|
|
2645
2653
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2646
2654
|
while (1) switch (_context27.prev = _context27.next) {
|
|
@@ -2653,7 +2661,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2653
2661
|
return this.core.effects.emit("".concat(this.name, ":onPaymentFailed"), {
|
|
2654
2662
|
orderUuid: data.orderUuid,
|
|
2655
2663
|
paymentMethodCode: '',
|
|
2656
|
-
amount: ((_this$store$
|
|
2664
|
+
amount: ((_this$store$currentOr25 = this.store.currentOrder) === null || _this$store$currentOr25 === void 0 ? void 0 : _this$store$currentOr25.total_amount) || '0',
|
|
2657
2665
|
timestamp: data.timestamp
|
|
2658
2666
|
});
|
|
2659
2667
|
case 5:
|
|
@@ -3784,11 +3792,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3784
3792
|
resolveInFlight,
|
|
3785
3793
|
rejectInFlight,
|
|
3786
3794
|
inFlightPromise,
|
|
3795
|
+
_this$store$currentOr26,
|
|
3787
3796
|
_this$store$currentOr27,
|
|
3788
|
-
_this$store$currentOr28,
|
|
3789
3797
|
_this$store$currentCu2,
|
|
3790
3798
|
_this$otherParams,
|
|
3791
|
-
_this$store$
|
|
3799
|
+
_this$store$currentOr28,
|
|
3792
3800
|
_this$store$localOrde,
|
|
3793
3801
|
_this$store$localOrde2,
|
|
3794
3802
|
_checkoutResponse3,
|
|
@@ -3905,7 +3913,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3905
3913
|
})
|
|
3906
3914
|
});
|
|
3907
3915
|
}); // 确定最终的定金金额:优先使用手动设置的值,否则从支付项中计算
|
|
3908
|
-
manualDepositAmount = ((_this$store$
|
|
3916
|
+
manualDepositAmount = ((_this$store$currentOr26 = this.store.currentOrder) === null || _this$store$currentOr26 === void 0 ? void 0 : _this$store$currentOr26.deposit_amount) || '0.00'; // 优先级逻辑:手动设置的定金金额 > 从支付项计算的金额
|
|
3909
3917
|
manualDepositValue = new Decimal(manualDepositAmount);
|
|
3910
3918
|
if (manualDepositValue.gt(0)) {
|
|
3911
3919
|
// 如果手动设置了定金金额且大于0,使用手动设置的值
|
|
@@ -3965,7 +3973,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3965
3973
|
}),
|
|
3966
3974
|
manualDepositAmount: manualDepositAmount,
|
|
3967
3975
|
finalDepositAmount: finalDepositAmount,
|
|
3968
|
-
isDeposit: ((_this$store$
|
|
3976
|
+
isDeposit: ((_this$store$currentOr27 = this.store.currentOrder) === null || _this$store$currentOr27 === void 0 ? void 0 : _this$store$currentOr27.is_deposit) || 0
|
|
3969
3977
|
});
|
|
3970
3978
|
|
|
3971
3979
|
// 计算订单状态,优先读取外面传递的,如果没有则根据订单支付数据来
|
|
@@ -4013,7 +4021,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4013
4021
|
currency_symbol: this.otherParams.currency_symbol,
|
|
4014
4022
|
currency_format: this.otherParams.currency_format,
|
|
4015
4023
|
business_code: ((_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.business_code) || undefined,
|
|
4016
|
-
is_deposit: ((_this$store$
|
|
4024
|
+
is_deposit: ((_this$store$currentOr28 = this.store.currentOrder) !== null && _this$store$currentOr28 !== void 0 && _this$store$currentOr28.is_deposit || Number(finalDepositAmount) > 0 ? 1 : 0) || 0,
|
|
4017
4025
|
deposit_amount: finalDepositAmount,
|
|
4018
4026
|
// 使用最终确定的定金金额(手动设置优先)
|
|
4019
4027
|
product_tax_fee: this.store.localOrderData.tax_fee,
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -21,7 +21,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
21
21
|
* @return {*}
|
|
22
22
|
* @Author: xiangfeng.xue
|
|
23
23
|
*/
|
|
24
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) =>
|
|
24
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
|
|
25
25
|
/**
|
|
26
26
|
* @title: 计算定金
|
|
27
27
|
* @param items - 购物车商品数组
|
|
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
123
123
|
* 获取当前的客户搜索条件
|
|
124
124
|
* @returns 当前搜索条件
|
|
125
125
|
*/
|
|
126
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
126
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
127
127
|
/**
|
|
128
128
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
129
129
|
* @returns 客户状态
|
|
@@ -1171,8 +1171,10 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1171
1171
|
* @throws 支付项缺少 voucher_id 时抛出错误
|
|
1172
1172
|
*/
|
|
1173
1173
|
async updateVoucherPaymentItemsAsync(voucherPaymentItems) {
|
|
1174
|
-
var _a, _b;
|
|
1175
1174
|
try {
|
|
1175
|
+
this.logInfo("updateVoucherPaymentItemsAsync called:", {
|
|
1176
|
+
voucherPaymentItems
|
|
1177
|
+
});
|
|
1176
1178
|
if (!this.store.currentOrder) {
|
|
1177
1179
|
throw (0, import_utils.createCheckoutError)(
|
|
1178
1180
|
import_types.CheckoutErrorType.ValidationFailed,
|
|
@@ -1183,7 +1185,11 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1183
1185
|
this.store.currentOrder.uuid
|
|
1184
1186
|
);
|
|
1185
1187
|
if (!voucherPaymentItems || (voucherPaymentItems == null ? void 0 : voucherPaymentItems.length) === 0) {
|
|
1186
|
-
const savedVoucherPaymentItems = (
|
|
1188
|
+
const savedVoucherPaymentItems = (paymentItems == null ? void 0 : paymentItems.filter((item) => item.voucher_id && !item.isSynced)) || [];
|
|
1189
|
+
this.logInfo("未传入 voucher 且本地订单无 voucher 记录,阻断updateVoucherPaymentItemsAsync", {
|
|
1190
|
+
voucherPaymentItems,
|
|
1191
|
+
savedVoucherPaymentItems
|
|
1192
|
+
});
|
|
1187
1193
|
if ((savedVoucherPaymentItems == null ? void 0 : savedVoucherPaymentItems.length) === 0)
|
|
1188
1194
|
return;
|
|
1189
1195
|
}
|