@pisell/pisellos 0.0.280 → 0.0.282
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/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/Checkout/index.js +24 -22
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/Checkout/index.js +3 -1
- package/package.json +1 -1
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
};
|
|
327
327
|
setOtherData(key: string, value: any): void;
|
|
328
328
|
getOtherData(key: string): any;
|
|
329
|
-
getProductTypeById(id: number): Promise<"
|
|
329
|
+
getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
|
|
330
330
|
/**
|
|
331
331
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
332
332
|
*
|
|
@@ -111,7 +111,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
111
111
|
* 获取当前的客户搜索条件
|
|
112
112
|
* @returns 当前搜索条件
|
|
113
113
|
*/
|
|
114
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
114
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
115
115
|
/**
|
|
116
116
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
117
117
|
* @returns 客户状态
|
|
@@ -1049,7 +1049,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1049
1049
|
key: "addPaymentItemAsync",
|
|
1050
1050
|
value: (function () {
|
|
1051
1051
|
var _addPaymentItemAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(paymentItem) {
|
|
1052
|
-
var orderPaymentType, processedPaymentItem, metadata, paymentItemWithType, remainingAmount, _paymentItem$type, _paymentItem$code, isEftposPayment, syncResult;
|
|
1052
|
+
var orderPaymentType, processedPaymentItem, metadata, paymentItemWithType, remainingAmount, _paymentItem$type, _paymentItem$code, isEftposPayment, _isCashPayment, isCustomePayment, syncResult;
|
|
1053
1053
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1054
1054
|
while (1) switch (_context15.prev = _context15.next) {
|
|
1055
1055
|
case 0:
|
|
@@ -1090,44 +1090,46 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1090
1090
|
case 17:
|
|
1091
1091
|
remainingAmount = _context15.sent;
|
|
1092
1092
|
if (!(Number(remainingAmount) > 0)) {
|
|
1093
|
-
_context15.next =
|
|
1093
|
+
_context15.next = 38;
|
|
1094
1094
|
break;
|
|
1095
1095
|
}
|
|
1096
1096
|
this.logInfo('订单金额还有待付的,同步 EFTPOS 支付');
|
|
1097
1097
|
// 检查是否是 EFTPOS 支付,如果是则立即同步订单
|
|
1098
1098
|
isEftposPayment = ((_paymentItem$type = paymentItem.type) === null || _paymentItem$type === void 0 ? void 0 : _paymentItem$type.toLowerCase()) === 'eftpos' || ((_paymentItem$code = paymentItem.code) === null || _paymentItem$code === void 0 ? void 0 : _paymentItem$code.toUpperCase().includes('EFTPOS'));
|
|
1099
|
+
_isCashPayment = paymentItem.code === 'CASHMANUAL';
|
|
1100
|
+
isCustomePayment = paymentItem.type === 'custom';
|
|
1099
1101
|
this.logInfo('EFTPOS 支付检查:', {
|
|
1100
1102
|
paymentCode: paymentItem.code,
|
|
1101
1103
|
paymentType: paymentItem.type,
|
|
1102
1104
|
isEftposPayment: isEftposPayment,
|
|
1103
1105
|
currentOrderSynced: this.store.isOrderSynced
|
|
1104
1106
|
});
|
|
1105
|
-
if (!isEftposPayment) {
|
|
1106
|
-
_context15.next =
|
|
1107
|
+
if (!(isEftposPayment || _isCashPayment || isCustomePayment)) {
|
|
1108
|
+
_context15.next = 38;
|
|
1107
1109
|
break;
|
|
1108
1110
|
}
|
|
1109
1111
|
this.logInfo('检测到 EFTPOS 支付,立即同步订单到后端...');
|
|
1110
|
-
_context15.prev =
|
|
1111
|
-
_context15.next =
|
|
1112
|
+
_context15.prev = 26;
|
|
1113
|
+
_context15.next = 29;
|
|
1112
1114
|
return this.syncOrderToBackendWithReturn(true);
|
|
1113
|
-
case
|
|
1115
|
+
case 29:
|
|
1114
1116
|
syncResult = _context15.sent;
|
|
1115
1117
|
this.logInfo('EFTPOS 支付后订单同步完成 (已标记为手动同步):', {
|
|
1116
1118
|
orderId: syncResult.orderId,
|
|
1117
1119
|
isOrderSynced: this.store.isOrderSynced,
|
|
1118
1120
|
backendResponse: syncResult.response
|
|
1119
1121
|
});
|
|
1120
|
-
_context15.next =
|
|
1122
|
+
_context15.next = 38;
|
|
1121
1123
|
break;
|
|
1122
|
-
case
|
|
1123
|
-
_context15.prev =
|
|
1124
|
-
_context15.t0 = _context15["catch"](
|
|
1124
|
+
case 33:
|
|
1125
|
+
_context15.prev = 33;
|
|
1126
|
+
_context15.t0 = _context15["catch"](26);
|
|
1125
1127
|
this.logError('EFTPOS 支付后订单同步失败:', _context15.t0);
|
|
1126
1128
|
// 不抛出错误,避免影响支付流程,但记录错误
|
|
1127
|
-
_context15.next = 36;
|
|
1128
|
-
return this.handleError(new Error("EFTPOS \u652F\u4ED8\u540E\u8BA2\u5355\u540C\u6B65\u5931\u8D25: ".concat(_context15.t0 instanceof Error ? _context15.t0.message : String(_context15.t0))), CheckoutErrorType.OrderCreationFailed);
|
|
1129
|
-
case 36:
|
|
1130
1129
|
_context15.next = 38;
|
|
1130
|
+
return this.handleError(new Error("EFTPOS \u652F\u4ED8\u540E\u8BA2\u5355\u540C\u6B65\u5931\u8D25: ".concat(_context15.t0 instanceof Error ? _context15.t0.message : String(_context15.t0))), CheckoutErrorType.OrderCreationFailed);
|
|
1131
|
+
case 38:
|
|
1132
|
+
_context15.next = 40;
|
|
1131
1133
|
return this.core.effects.emit(CheckoutHooks.OnPaymentItemAdded, {
|
|
1132
1134
|
orderUuid: this.store.currentOrder.uuid,
|
|
1133
1135
|
paymentMethodCode: paymentItem.code,
|
|
@@ -1135,22 +1137,22 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1135
1137
|
amount: String(paymentItem.amount),
|
|
1136
1138
|
timestamp: Date.now()
|
|
1137
1139
|
});
|
|
1138
|
-
case 38:
|
|
1139
|
-
_context15.next = 46;
|
|
1140
|
-
break;
|
|
1141
1140
|
case 40:
|
|
1142
|
-
_context15.
|
|
1141
|
+
_context15.next = 48;
|
|
1142
|
+
break;
|
|
1143
|
+
case 42:
|
|
1144
|
+
_context15.prev = 42;
|
|
1143
1145
|
_context15.t1 = _context15["catch"](1);
|
|
1144
1146
|
this.logError('添加支付项失败:', _context15.t1);
|
|
1145
|
-
_context15.next =
|
|
1147
|
+
_context15.next = 47;
|
|
1146
1148
|
return this.handleError(_context15.t1, CheckoutErrorType.PaymentFailed);
|
|
1147
|
-
case
|
|
1149
|
+
case 47:
|
|
1148
1150
|
throw _context15.t1;
|
|
1149
|
-
case
|
|
1151
|
+
case 48:
|
|
1150
1152
|
case "end":
|
|
1151
1153
|
return _context15.stop();
|
|
1152
1154
|
}
|
|
1153
|
-
}, _callee15, this, [[1,
|
|
1155
|
+
}, _callee15, this, [[1, 42], [26, 33]]);
|
|
1154
1156
|
}));
|
|
1155
1157
|
function addPaymentItemAsync(_x14) {
|
|
1156
1158
|
return _addPaymentItemAsync.apply(this, arguments);
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
};
|
|
327
327
|
setOtherData(key: string, value: any): void;
|
|
328
328
|
getOtherData(key: string): any;
|
|
329
|
-
getProductTypeById(id: number): Promise<"
|
|
329
|
+
getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
|
|
330
330
|
/**
|
|
331
331
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
332
332
|
*
|
|
@@ -111,7 +111,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
111
111
|
* 获取当前的客户搜索条件
|
|
112
112
|
* @returns 当前搜索条件
|
|
113
113
|
*/
|
|
114
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
114
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
115
115
|
/**
|
|
116
116
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
117
117
|
* @returns 客户状态
|
|
@@ -659,13 +659,15 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
659
659
|
if (Number(remainingAmount) > 0) {
|
|
660
660
|
this.logInfo("订单金额还有待付的,同步 EFTPOS 支付");
|
|
661
661
|
const isEftposPayment = ((_a = paymentItem.type) == null ? void 0 : _a.toLowerCase()) === "eftpos" || ((_b = paymentItem.code) == null ? void 0 : _b.toUpperCase().includes("EFTPOS"));
|
|
662
|
+
const isCashPayment2 = paymentItem.code === "CASHMANUAL";
|
|
663
|
+
const isCustomePayment = paymentItem.type === "custom";
|
|
662
664
|
this.logInfo("EFTPOS 支付检查:", {
|
|
663
665
|
paymentCode: paymentItem.code,
|
|
664
666
|
paymentType: paymentItem.type,
|
|
665
667
|
isEftposPayment,
|
|
666
668
|
currentOrderSynced: this.store.isOrderSynced
|
|
667
669
|
});
|
|
668
|
-
if (isEftposPayment) {
|
|
670
|
+
if (isEftposPayment || isCashPayment2 || isCustomePayment) {
|
|
669
671
|
this.logInfo("检测到 EFTPOS 支付,立即同步订单到后端...");
|
|
670
672
|
try {
|
|
671
673
|
const syncResult = await this.syncOrderToBackendWithReturn(true);
|