@pisell/pisellos 2.3.153 → 2.3.154
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/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +2 -0
- package/dist/solution/UnifiedBookingSales/index.js +739 -644
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +2 -0
- package/lib/solution/UnifiedBookingSales/index.js +36 -0
- package/package.json +1 -1
|
@@ -347,7 +347,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
347
347
|
* 获取当前的客户搜索条件
|
|
348
348
|
* @returns 当前搜索条件
|
|
349
349
|
*/
|
|
350
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
350
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
351
351
|
/**
|
|
352
352
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
353
353
|
* @returns 客户状态
|
|
@@ -147,6 +147,8 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
147
147
|
* 用于支付跳转等终态场景,避免浏览器返回时恢复已提交订单。
|
|
148
148
|
*/
|
|
149
149
|
clearSessionStorageOrderSnapshot(): void;
|
|
150
|
+
/** 在 Kiosk 拉起支付设备前补齐订单号,同一订单重试复用已分配的号码。 */
|
|
151
|
+
ensureLocalOrderNumbersForCheckout(): Promise<void>;
|
|
150
152
|
/**
|
|
151
153
|
* PC/H5/Kiosk 结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
|
|
152
154
|
* 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
|
|
@@ -1691,6 +1691,42 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
|
|
|
1691
1691
|
this.store.order?.clearSessionStoragePersistedTempOrder?.();
|
|
1692
1692
|
}
|
|
1693
1693
|
|
|
1694
|
+
/** 在 Kiosk 拉起支付设备前补齐订单号,同一订单重试复用已分配的号码。 */
|
|
1695
|
+
async ensureLocalOrderNumbersForCheckout() {
|
|
1696
|
+
if ((0, _platform.normalizeRuntimePlatform)(this.otherParams?.platform) !== 'kiosk') return;
|
|
1697
|
+
const order = this.store.order;
|
|
1698
|
+
const tempOrder = order?.getTempOrder();
|
|
1699
|
+
if (!tempOrder) throw new Error('当前订单不存在,无法生成订单编号');
|
|
1700
|
+
if (tempOrder.shop_order_number && tempOrder.shop_full_order_number) return;
|
|
1701
|
+
const biz = this.getBookingTicketBusinessCode();
|
|
1702
|
+
if (!biz) throw new Error('当前订单缺少业务类型,无法生成订单编号');
|
|
1703
|
+
const idGenerator = this.appPlugin?.getApp?.()?.getPlugin?.('idGenerator');
|
|
1704
|
+
if (!tempOrder.shop_order_number && typeof idGenerator?.generateShopOrderNumber !== 'function' || !tempOrder.shop_full_order_number && typeof idGenerator?.generateReceiptId !== 'function') {
|
|
1705
|
+
throw new Error('订单编号生成器不可用,请重启应用后重试');
|
|
1706
|
+
}
|
|
1707
|
+
try {
|
|
1708
|
+
if (!tempOrder.shop_order_number) {
|
|
1709
|
+
tempOrder.shop_order_number = await idGenerator.generateShopOrderNumber({
|
|
1710
|
+
biz
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
if (!tempOrder.shop_full_order_number) {
|
|
1714
|
+
tempOrder.shop_full_order_number = await idGenerator.generateReceiptId({
|
|
1715
|
+
biz
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
if (order.getTempOrder() !== tempOrder) {
|
|
1719
|
+
throw new Error('当前订单已切换,请重新发起支付');
|
|
1720
|
+
}
|
|
1721
|
+
if (!tempOrder.shop_order_number || !tempOrder.shop_full_order_number) {
|
|
1722
|
+
throw new Error('订单编号生成失败,请重试');
|
|
1723
|
+
}
|
|
1724
|
+
} finally {
|
|
1725
|
+
// 部分生成成功时也保留号码,后续只补仍然缺失的字段。
|
|
1726
|
+
if (order.getTempOrder() === tempOrder) order.persistTempOrder();
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1694
1730
|
/**
|
|
1695
1731
|
* PC/H5/Kiosk 结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
|
|
1696
1732
|
* 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
|