@pisell/pisellos 2.3.214 → 2.3.216
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/Order/index.d.ts +2 -0
- package/dist/modules/Order/index.js +12 -0
- package/dist/modules/Order/types.d.ts +2 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +5 -2
- package/dist/modules/SalesSummary/index.d.ts +3 -0
- package/dist/modules/SalesSummary/index.js +104 -56
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +823 -739
- package/dist/solution/BaseSales/index.d.ts +2 -0
- package/dist/solution/BaseSales/index.js +47 -37
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/UnifiedBookingSales/index.d.ts +3 -0
- package/dist/solution/UnifiedBookingSales/index.js +84 -69
- package/dist/solution/UnifiedBookingSales/types.d.ts +4 -2
- package/lib/modules/Order/index.d.ts +2 -0
- package/lib/modules/Order/index.js +10 -0
- package/lib/modules/Order/types.d.ts +2 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +4 -1
- package/lib/modules/SalesSummary/index.d.ts +3 -0
- package/lib/modules/SalesSummary/index.js +36 -15
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +39 -0
- package/lib/solution/BaseSales/index.d.ts +2 -0
- package/lib/solution/BaseSales/index.js +9 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/UnifiedBookingSales/index.d.ts +3 -0
- package/lib/solution/UnifiedBookingSales/index.js +19 -7
- package/lib/solution/UnifiedBookingSales/types.d.ts +4 -2
- package/package.json +1 -1
|
@@ -276,6 +276,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
276
276
|
/** 获取附加费用(运费/服务费/税费等)。 */
|
|
277
277
|
getSurcharges(): ISalesSurcharge[];
|
|
278
278
|
getTempOrder(): OrderTempOrder | null;
|
|
279
|
+
/** 在真实支付前固定创建时间;只更新本地订单,已有时间不覆盖。 */
|
|
280
|
+
ensureOrderCreatedAt(): string;
|
|
279
281
|
getOrderSessionId(): string | null;
|
|
280
282
|
isOrderSessionCurrent(sessionId: string): boolean;
|
|
281
283
|
replaceTempOrder(tempOrder: OrderTempOrder, options?: ReplaceTempOrderOptions): Promise<OrderTempOrder>;
|
|
@@ -2838,6 +2838,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2838
2838
|
var result = ((_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 ? void 0 : _this$store$order7.getTempOrder()) || null;
|
|
2839
2839
|
return result;
|
|
2840
2840
|
}
|
|
2841
|
+
|
|
2842
|
+
/** 在真实支付前固定创建时间;只更新本地订单,已有时间不覆盖。 */
|
|
2843
|
+
}, {
|
|
2844
|
+
key: "ensureOrderCreatedAt",
|
|
2845
|
+
value: function ensureOrderCreatedAt() {
|
|
2846
|
+
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
2847
|
+
return this.store.order.ensureOrderCreatedAt();
|
|
2848
|
+
}
|
|
2841
2849
|
}, {
|
|
2842
2850
|
key: "getOrderSessionId",
|
|
2843
2851
|
value: function getOrderSessionId() {
|
|
@@ -6761,7 +6769,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6761
6769
|
value: (function () {
|
|
6762
6770
|
var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(params) {
|
|
6763
6771
|
var _this$store$order$get13, _params$actualPaidAmo, _this$otherParams42, _this$window, _this$window$postMess;
|
|
6764
|
-
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber,
|
|
6772
|
+
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, actualPaidAmount, changeAmount, shopWalletPassId, paymentTimestamp, payments, payment, syncResult, committed, walletState, restoredTempOrder;
|
|
6765
6773
|
return _regeneratorRuntime().wrap(function _callee67$(_context67) {
|
|
6766
6774
|
while (1) switch (_context67.prev = _context67.next) {
|
|
6767
6775
|
case 0:
|
|
@@ -6824,25 +6832,26 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6824
6832
|
beforePayments = cloneDeep(this.store.order.getOrderPayments());
|
|
6825
6833
|
beforePaymentStatus = (_this$store$order$get13 = this.store.order.getTempOrder()) === null || _this$store$order$get13 === void 0 ? void 0 : _this$store$order$get13.payment_status;
|
|
6826
6834
|
uniquePaymentNumber = createUuidV4();
|
|
6827
|
-
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
6828
6835
|
actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
|
|
6829
6836
|
changeAmount = Number(params.changeAmount || 0);
|
|
6830
6837
|
shopWalletPassId = (_this$otherParams42 = this.otherParams) === null || _this$otherParams42 === void 0 ? void 0 : _this$otherParams42.shop_wallet_pass_id;
|
|
6831
6838
|
if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
|
|
6832
|
-
_context67.next =
|
|
6839
|
+
_context67.next = 34;
|
|
6833
6840
|
break;
|
|
6834
6841
|
}
|
|
6835
6842
|
throw new Error('顾客实收现金不能小于支付金额');
|
|
6836
|
-
case
|
|
6843
|
+
case 34:
|
|
6837
6844
|
if (!this.isPickupTimingEnabled()) {
|
|
6838
|
-
_context67.next =
|
|
6845
|
+
_context67.next = 37;
|
|
6839
6846
|
break;
|
|
6840
6847
|
}
|
|
6841
|
-
_context67.next =
|
|
6848
|
+
_context67.next = 37;
|
|
6842
6849
|
return this.preparePickupTimingForCheckout({
|
|
6843
6850
|
freeze: true
|
|
6844
6851
|
});
|
|
6845
|
-
case
|
|
6852
|
+
case 37:
|
|
6853
|
+
this.ensureOrderCreatedAt();
|
|
6854
|
+
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
6846
6855
|
(_this$window = this.window) === null || _this$window === void 0 || (_this$window = _this$window.interaction) === null || _this$window === void 0 || (_this$window = _this$window.utils) === null || _this$window === void 0 || (_this$window$postMess = _this$window.postMessageToApp) === null || _this$window$postMess === void 0 || _this$window$postMess.call(_this$window, {
|
|
6847
6856
|
module: 'till',
|
|
6848
6857
|
key: 'open_till',
|
|
@@ -6873,57 +6882,57 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
6873
6882
|
var _item$metadata2;
|
|
6874
6883
|
return (item === null || item === void 0 || (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.unique_payment_number) === uniquePaymentNumber;
|
|
6875
6884
|
});
|
|
6876
|
-
_context67.prev =
|
|
6877
|
-
_context67.next =
|
|
6885
|
+
_context67.prev = 42;
|
|
6886
|
+
_context67.next = 45;
|
|
6878
6887
|
return this.syncPaymentsToOrder({
|
|
6879
6888
|
payments: payments,
|
|
6880
6889
|
submitWhenPaid: true,
|
|
6881
6890
|
smallTicketDataFlag: 1,
|
|
6882
6891
|
confirmPendingVoucherPayments: true
|
|
6883
6892
|
});
|
|
6884
|
-
case
|
|
6893
|
+
case 45:
|
|
6885
6894
|
syncResult = _context67.sent;
|
|
6886
6895
|
if (!isRejectedSalesSubmitResult(syncResult.submitResult)) {
|
|
6887
|
-
_context67.next =
|
|
6896
|
+
_context67.next = 48;
|
|
6888
6897
|
break;
|
|
6889
6898
|
}
|
|
6890
6899
|
throw new Error(getSalesSubmitErrorMessage(syncResult.submitResult, '订单提交失败'));
|
|
6891
|
-
case
|
|
6900
|
+
case 48:
|
|
6892
6901
|
if (!this.store.payment) {
|
|
6893
|
-
_context67.next =
|
|
6902
|
+
_context67.next = 53;
|
|
6894
6903
|
break;
|
|
6895
6904
|
}
|
|
6896
6905
|
committed = this.getCommittedWalletAssets();
|
|
6897
6906
|
walletState = this.store.payment.wallet.setCommittedWalletAssets(committed.ids, committed.assets);
|
|
6898
|
-
_context67.next =
|
|
6907
|
+
_context67.next = 53;
|
|
6899
6908
|
return this.publishWalletAssetsState(walletState, 'local');
|
|
6900
|
-
case
|
|
6909
|
+
case 53:
|
|
6901
6910
|
return _context67.abrupt("return", {
|
|
6902
6911
|
payment: payment || {},
|
|
6903
6912
|
payments: this.store.order.getOrderPayments(),
|
|
6904
6913
|
syncResult: syncResult,
|
|
6905
6914
|
isOrderFullyPaid: syncResult.isOrderFullyPaid
|
|
6906
6915
|
});
|
|
6907
|
-
case
|
|
6908
|
-
_context67.prev =
|
|
6909
|
-
_context67.t1 = _context67["catch"](
|
|
6916
|
+
case 56:
|
|
6917
|
+
_context67.prev = 56;
|
|
6918
|
+
_context67.t1 = _context67["catch"](42);
|
|
6910
6919
|
this.store.order.setOrderPayments(beforePayments);
|
|
6911
6920
|
restoredTempOrder = this.store.order.getTempOrder();
|
|
6912
6921
|
if (restoredTempOrder && beforePaymentStatus !== undefined) {
|
|
6913
6922
|
restoredTempOrder.payment_status = beforePaymentStatus;
|
|
6914
6923
|
this.store.order.persistTempOrder();
|
|
6915
6924
|
}
|
|
6916
|
-
_context67.next =
|
|
6925
|
+
_context67.next = 63;
|
|
6917
6926
|
return this.store.order.recalculateSummary({
|
|
6918
6927
|
createIfMissing: true
|
|
6919
6928
|
});
|
|
6920
|
-
case 62:
|
|
6921
|
-
throw _context67.t1;
|
|
6922
6929
|
case 63:
|
|
6930
|
+
throw _context67.t1;
|
|
6931
|
+
case 64:
|
|
6923
6932
|
case "end":
|
|
6924
6933
|
return _context67.stop();
|
|
6925
6934
|
}
|
|
6926
|
-
}, _callee67, this, [[
|
|
6935
|
+
}, _callee67, this, [[42, 56]]);
|
|
6927
6936
|
}));
|
|
6928
6937
|
function payCash(_x52) {
|
|
6929
6938
|
return _payCash.apply(this, arguments);
|
|
@@ -7003,6 +7012,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7003
7012
|
case 22:
|
|
7004
7013
|
beforePayments = cloneDeep(this.store.order.getOrderPayments());
|
|
7005
7014
|
beforePaymentStatus = (_this$store$order$get15 = this.store.order.getTempOrder()) === null || _this$store$order$get15 === void 0 ? void 0 : _this$store$order$get15.payment_status;
|
|
7015
|
+
this.ensureOrderCreatedAt();
|
|
7006
7016
|
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
7007
7017
|
metadata = _objectSpread(_objectSpread({}, params.metadata || {}), {}, {
|
|
7008
7018
|
unique_payment_number: ((_params$metadata = params.metadata) === null || _params$metadata === void 0 ? void 0 : _params$metadata.unique_payment_number) || createUuidV4()
|
|
@@ -7035,57 +7045,57 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
7035
7045
|
var _item$metadata3;
|
|
7036
7046
|
return (item === null || item === void 0 || (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.unique_payment_number) === metadata.unique_payment_number;
|
|
7037
7047
|
});
|
|
7038
|
-
_context68.prev =
|
|
7039
|
-
_context68.next =
|
|
7048
|
+
_context68.prev = 31;
|
|
7049
|
+
_context68.next = 34;
|
|
7040
7050
|
return this.syncPaymentsToOrder({
|
|
7041
7051
|
payments: payments,
|
|
7042
7052
|
submitWhenPaid: true,
|
|
7043
7053
|
smallTicketDataFlag: 1,
|
|
7044
7054
|
confirmPendingVoucherPayments: true
|
|
7045
7055
|
});
|
|
7046
|
-
case
|
|
7056
|
+
case 34:
|
|
7047
7057
|
syncResult = _context68.sent;
|
|
7048
7058
|
if (!isRejectedSalesSubmitResult(syncResult.submitResult)) {
|
|
7049
|
-
_context68.next =
|
|
7059
|
+
_context68.next = 37;
|
|
7050
7060
|
break;
|
|
7051
7061
|
}
|
|
7052
7062
|
throw new Error(getSalesSubmitErrorMessage(syncResult.submitResult, '订单提交失败'));
|
|
7053
|
-
case
|
|
7063
|
+
case 37:
|
|
7054
7064
|
if (!this.store.payment) {
|
|
7055
|
-
_context68.next =
|
|
7065
|
+
_context68.next = 42;
|
|
7056
7066
|
break;
|
|
7057
7067
|
}
|
|
7058
7068
|
committed = this.getCommittedWalletAssets();
|
|
7059
7069
|
walletState = this.store.payment.wallet.setCommittedWalletAssets(committed.ids, committed.assets);
|
|
7060
|
-
_context68.next =
|
|
7070
|
+
_context68.next = 42;
|
|
7061
7071
|
return this.publishWalletAssetsState(walletState, 'local');
|
|
7062
|
-
case
|
|
7072
|
+
case 42:
|
|
7063
7073
|
return _context68.abrupt("return", {
|
|
7064
7074
|
payment: payment || {},
|
|
7065
7075
|
payments: this.store.order.getOrderPayments(),
|
|
7066
7076
|
syncResult: syncResult,
|
|
7067
7077
|
isOrderFullyPaid: syncResult.isOrderFullyPaid
|
|
7068
7078
|
});
|
|
7069
|
-
case
|
|
7070
|
-
_context68.prev =
|
|
7071
|
-
_context68.t0 = _context68["catch"](
|
|
7079
|
+
case 45:
|
|
7080
|
+
_context68.prev = 45;
|
|
7081
|
+
_context68.t0 = _context68["catch"](31);
|
|
7072
7082
|
this.store.order.setOrderPayments(beforePayments);
|
|
7073
7083
|
restoredTempOrder = this.store.order.getTempOrder();
|
|
7074
7084
|
if (restoredTempOrder && beforePaymentStatus !== undefined) {
|
|
7075
7085
|
restoredTempOrder.payment_status = beforePaymentStatus;
|
|
7076
7086
|
this.store.order.persistTempOrder();
|
|
7077
7087
|
}
|
|
7078
|
-
_context68.next =
|
|
7088
|
+
_context68.next = 52;
|
|
7079
7089
|
return this.store.order.recalculateSummary({
|
|
7080
7090
|
createIfMissing: true
|
|
7081
7091
|
});
|
|
7082
|
-
case 51:
|
|
7083
|
-
throw _context68.t0;
|
|
7084
7092
|
case 52:
|
|
7093
|
+
throw _context68.t0;
|
|
7094
|
+
case 53:
|
|
7085
7095
|
case "end":
|
|
7086
7096
|
return _context68.stop();
|
|
7087
7097
|
}
|
|
7088
|
-
}, _callee68, this, [[
|
|
7098
|
+
}, _callee68, this, [[31, 45]]);
|
|
7089
7099
|
}));
|
|
7090
7100
|
function commitPaymentMethodPayment(_x53) {
|
|
7091
7101
|
return _commitPaymentMethodPayment.apply(this, arguments);
|
|
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
342
342
|
date: string;
|
|
343
343
|
status: string;
|
|
344
344
|
week: string;
|
|
345
|
-
weekNum: 0 | 2 | 1 | 3 |
|
|
345
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
346
346
|
}[]>;
|
|
347
347
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
348
348
|
private getScheduleDataByIds;
|
|
@@ -389,7 +389,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
389
389
|
};
|
|
390
390
|
setOtherData(key: string, value: any): void;
|
|
391
391
|
getOtherData(key: string): any;
|
|
392
|
-
getProductTypeById(id: number): Promise<"normal" | "
|
|
392
|
+
getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
|
|
393
393
|
/**
|
|
394
394
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
395
395
|
*
|
|
@@ -110,6 +110,9 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
110
110
|
protected getSubModuleHooks(moduleName: string): any;
|
|
111
111
|
private createAvailabilityFacadeError;
|
|
112
112
|
private getAvailabilityScopeDescriptor;
|
|
113
|
+
/** Kiosk keeps its device/channel semantics; only explicit Venue templates opt in. */
|
|
114
|
+
private isVenueKioskPlatform;
|
|
115
|
+
private supportsVenueSelectionSnapshot;
|
|
113
116
|
private usesDurationTimeGrid;
|
|
114
117
|
private getCurrentAvailabilityBusinessDate;
|
|
115
118
|
private getAvailabilityBusinessDateRange;
|