@pisell/pisellos 0.0.281 → 0.0.283
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 +30 -31
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/Checkout/index.js +7 -7
- 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 客户状态
|
|
@@ -1080,17 +1080,25 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1080
1080
|
return this.payment.addPaymentItemAsync(this.store.currentOrder.uuid, paymentItemWithType);
|
|
1081
1081
|
case 12:
|
|
1082
1082
|
this.logInfo('支付项添加成功');
|
|
1083
|
+
// 触发支付项添加事件(可以复用支付开始事件)
|
|
1084
|
+
this.core.effects.emit(CheckoutHooks.OnPaymentItemAdded, {
|
|
1085
|
+
orderUuid: this.store.currentOrder.uuid,
|
|
1086
|
+
paymentMethodCode: paymentItem.code,
|
|
1087
|
+
paymentMethodName: paymentItem.name,
|
|
1088
|
+
amount: String(paymentItem.amount),
|
|
1089
|
+
timestamp: Date.now()
|
|
1090
|
+
});
|
|
1083
1091
|
|
|
1084
1092
|
// 支付项添加后,更新 stateAmount 为剩余未支付金额
|
|
1085
|
-
_context15.next =
|
|
1093
|
+
_context15.next = 16;
|
|
1086
1094
|
return this.updateStateAmountToRemaining();
|
|
1087
|
-
case
|
|
1088
|
-
_context15.next =
|
|
1095
|
+
case 16:
|
|
1096
|
+
_context15.next = 18;
|
|
1089
1097
|
return this.calculateRemainingAmountAsync();
|
|
1090
|
-
case
|
|
1098
|
+
case 18:
|
|
1091
1099
|
remainingAmount = _context15.sent;
|
|
1092
1100
|
if (!(Number(remainingAmount) > 0)) {
|
|
1093
|
-
_context15.next =
|
|
1101
|
+
_context15.next = 39;
|
|
1094
1102
|
break;
|
|
1095
1103
|
}
|
|
1096
1104
|
this.logInfo('订单金额还有待付的,同步 EFTPOS 支付');
|
|
@@ -1105,54 +1113,45 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1105
1113
|
currentOrderSynced: this.store.isOrderSynced
|
|
1106
1114
|
});
|
|
1107
1115
|
if (!(isEftposPayment || _isCashPayment || isCustomePayment)) {
|
|
1108
|
-
_context15.next =
|
|
1116
|
+
_context15.next = 39;
|
|
1109
1117
|
break;
|
|
1110
1118
|
}
|
|
1111
1119
|
this.logInfo('检测到 EFTPOS 支付,立即同步订单到后端...');
|
|
1112
|
-
_context15.prev =
|
|
1113
|
-
_context15.next =
|
|
1120
|
+
_context15.prev = 27;
|
|
1121
|
+
_context15.next = 30;
|
|
1114
1122
|
return this.syncOrderToBackendWithReturn(true);
|
|
1115
|
-
case
|
|
1123
|
+
case 30:
|
|
1116
1124
|
syncResult = _context15.sent;
|
|
1117
1125
|
this.logInfo('EFTPOS 支付后订单同步完成 (已标记为手动同步):', {
|
|
1118
1126
|
orderId: syncResult.orderId,
|
|
1119
1127
|
isOrderSynced: this.store.isOrderSynced,
|
|
1120
1128
|
backendResponse: syncResult.response
|
|
1121
1129
|
});
|
|
1122
|
-
_context15.next =
|
|
1130
|
+
_context15.next = 39;
|
|
1123
1131
|
break;
|
|
1124
|
-
case
|
|
1125
|
-
_context15.prev =
|
|
1126
|
-
_context15.t0 = _context15["catch"](
|
|
1132
|
+
case 34:
|
|
1133
|
+
_context15.prev = 34;
|
|
1134
|
+
_context15.t0 = _context15["catch"](27);
|
|
1127
1135
|
this.logError('EFTPOS 支付后订单同步失败:', _context15.t0);
|
|
1128
1136
|
// 不抛出错误,避免影响支付流程,但记录错误
|
|
1129
|
-
_context15.next =
|
|
1137
|
+
_context15.next = 39;
|
|
1130
1138
|
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
|
|
1132
|
-
_context15.next =
|
|
1133
|
-
return this.core.effects.emit(CheckoutHooks.OnPaymentItemAdded, {
|
|
1134
|
-
orderUuid: this.store.currentOrder.uuid,
|
|
1135
|
-
paymentMethodCode: paymentItem.code,
|
|
1136
|
-
paymentMethodName: paymentItem.name,
|
|
1137
|
-
amount: String(paymentItem.amount),
|
|
1138
|
-
timestamp: Date.now()
|
|
1139
|
-
});
|
|
1140
|
-
case 40:
|
|
1141
|
-
_context15.next = 48;
|
|
1139
|
+
case 39:
|
|
1140
|
+
_context15.next = 47;
|
|
1142
1141
|
break;
|
|
1143
|
-
case
|
|
1144
|
-
_context15.prev =
|
|
1142
|
+
case 41:
|
|
1143
|
+
_context15.prev = 41;
|
|
1145
1144
|
_context15.t1 = _context15["catch"](1);
|
|
1146
1145
|
this.logError('添加支付项失败:', _context15.t1);
|
|
1147
|
-
_context15.next =
|
|
1146
|
+
_context15.next = 46;
|
|
1148
1147
|
return this.handleError(_context15.t1, CheckoutErrorType.PaymentFailed);
|
|
1149
|
-
case
|
|
1148
|
+
case 46:
|
|
1150
1149
|
throw _context15.t1;
|
|
1151
|
-
case
|
|
1150
|
+
case 47:
|
|
1152
1151
|
case "end":
|
|
1153
1152
|
return _context15.stop();
|
|
1154
1153
|
}
|
|
1155
|
-
}, _callee15, this, [[1,
|
|
1154
|
+
}, _callee15, this, [[1, 41], [27, 34]]);
|
|
1156
1155
|
}));
|
|
1157
1156
|
function addPaymentItemAsync(_x14) {
|
|
1158
1157
|
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 客户状态
|
|
@@ -654,6 +654,13 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
654
654
|
paymentItemWithType
|
|
655
655
|
);
|
|
656
656
|
this.logInfo("支付项添加成功");
|
|
657
|
+
this.core.effects.emit(import_types.CheckoutHooks.OnPaymentItemAdded, {
|
|
658
|
+
orderUuid: this.store.currentOrder.uuid,
|
|
659
|
+
paymentMethodCode: paymentItem.code,
|
|
660
|
+
paymentMethodName: paymentItem.name,
|
|
661
|
+
amount: String(paymentItem.amount),
|
|
662
|
+
timestamp: Date.now()
|
|
663
|
+
});
|
|
657
664
|
await this.updateStateAmountToRemaining();
|
|
658
665
|
const remainingAmount = await this.calculateRemainingAmountAsync();
|
|
659
666
|
if (Number(remainingAmount) > 0) {
|
|
@@ -687,13 +694,6 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
687
694
|
}
|
|
688
695
|
}
|
|
689
696
|
}
|
|
690
|
-
await this.core.effects.emit(import_types.CheckoutHooks.OnPaymentItemAdded, {
|
|
691
|
-
orderUuid: this.store.currentOrder.uuid,
|
|
692
|
-
paymentMethodCode: paymentItem.code,
|
|
693
|
-
paymentMethodName: paymentItem.name,
|
|
694
|
-
amount: String(paymentItem.amount),
|
|
695
|
-
timestamp: Date.now()
|
|
696
|
-
});
|
|
697
697
|
} catch (error) {
|
|
698
698
|
this.logError("添加支付项失败:", error);
|
|
699
699
|
await this.handleError(error, import_types.CheckoutErrorType.PaymentFailed);
|