@pisell/pisellos 2.3.204 → 2.3.205
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.
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -366,7 +366,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
366
366
|
* 获取当前的客户搜索条件
|
|
367
367
|
* @returns 当前搜索条件
|
|
368
368
|
*/
|
|
369
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
369
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
370
370
|
/**
|
|
371
371
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
372
372
|
* @returns 客户状态
|
|
@@ -629,35 +629,40 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
629
629
|
key: "configureIdGeneratorFromOpenData",
|
|
630
630
|
value: function () {
|
|
631
631
|
var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
632
|
-
var _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5, _openDataConfig6;
|
|
632
|
+
var _this$otherParams5, _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5, _openDataConfig6;
|
|
633
633
|
var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode, _openDataConfig7, _openDataConfig8, _openDataConfig9;
|
|
634
634
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
635
635
|
while (1) switch (_context10.prev = _context10.next) {
|
|
636
636
|
case 0:
|
|
637
|
+
if (!isCustomerUserPlatform((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.platform)) {
|
|
638
|
+
_context10.next = 2;
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
return _context10.abrupt("return");
|
|
642
|
+
case 2:
|
|
637
643
|
// 业务码切换或配置失败时不能复用上一次初始化的短号。
|
|
638
644
|
this.setPaymentNumberDevicePrefix(null);
|
|
639
|
-
idGenerator = this.getIdGeneratorPlugin();
|
|
640
|
-
if (idGenerator
|
|
641
|
-
_context10.next =
|
|
645
|
+
idGenerator = this.getIdGeneratorPlugin(); // Optional host capability. Do not warn or cache absence: POS may register it later.
|
|
646
|
+
if (!(typeof (idGenerator === null || idGenerator === void 0 ? void 0 : idGenerator.configure) !== 'function')) {
|
|
647
|
+
_context10.next = 6;
|
|
642
648
|
break;
|
|
643
649
|
}
|
|
644
|
-
console.warn('[BookingTicket] idGenerator 插件不可用,跳过配置');
|
|
645
650
|
return _context10.abrupt("return");
|
|
646
|
-
case
|
|
651
|
+
case 6:
|
|
647
652
|
openDataConfig = null;
|
|
648
|
-
_context10.prev =
|
|
649
|
-
_context10.next =
|
|
653
|
+
_context10.prev = 7;
|
|
654
|
+
_context10.next = 10;
|
|
650
655
|
return this.loadOpenDataConfig();
|
|
651
|
-
case
|
|
656
|
+
case 10:
|
|
652
657
|
openDataConfig = _context10.sent;
|
|
653
|
-
_context10.next =
|
|
658
|
+
_context10.next = 17;
|
|
654
659
|
break;
|
|
655
|
-
case
|
|
656
|
-
_context10.prev =
|
|
657
|
-
_context10.t0 = _context10["catch"](
|
|
660
|
+
case 13:
|
|
661
|
+
_context10.prev = 13;
|
|
662
|
+
_context10.t0 = _context10["catch"](7);
|
|
658
663
|
console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context10.t0);
|
|
659
664
|
return _context10.abrupt("return");
|
|
660
|
-
case
|
|
665
|
+
case 17:
|
|
661
666
|
// if (!openDataConfig) return;
|
|
662
667
|
receiptSequenceLength = this.normalizePositiveInteger((_openDataConfig = openDataConfig) === null || _openDataConfig === void 0 ? void 0 : _openDataConfig['sale.short_number_digits'], 5);
|
|
663
668
|
receiptSequenceStart = this.normalizePositiveInteger((_openDataConfig2 = openDataConfig) === null || _openDataConfig2 === void 0 ? void 0 : _openDataConfig2['sale.short_number_start_number'], 1);
|
|
@@ -668,21 +673,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
668
673
|
"type": "start_time",
|
|
669
674
|
"time": "00:00"
|
|
670
675
|
};
|
|
671
|
-
_context10.next =
|
|
676
|
+
_context10.next = 25;
|
|
672
677
|
return this.getShortNumberOrDeviceId();
|
|
673
|
-
case
|
|
678
|
+
case 25:
|
|
674
679
|
deviceId = _context10.sent;
|
|
675
680
|
this.setPaymentNumberDevicePrefix(deviceId);
|
|
676
681
|
businessCode = this.getBookingTicketBusinessCode();
|
|
677
682
|
if (businessCode) {
|
|
678
|
-
_context10.next =
|
|
683
|
+
_context10.next = 31;
|
|
679
684
|
break;
|
|
680
685
|
}
|
|
681
686
|
console.warn('[BookingTicket] businessCode 缺失,跳过 idGenerator 配置');
|
|
682
687
|
return _context10.abrupt("return");
|
|
683
|
-
case
|
|
684
|
-
_context10.prev =
|
|
685
|
-
_context10.next =
|
|
688
|
+
case 31:
|
|
689
|
+
_context10.prev = 31;
|
|
690
|
+
_context10.next = 34;
|
|
686
691
|
return idGenerator.configure({
|
|
687
692
|
biz: businessCode,
|
|
688
693
|
config: {
|
|
@@ -698,18 +703,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
698
703
|
shopOrderPrefix: shopOrderPrefix
|
|
699
704
|
}
|
|
700
705
|
});
|
|
701
|
-
case
|
|
702
|
-
_context10.next =
|
|
706
|
+
case 34:
|
|
707
|
+
_context10.next = 39;
|
|
703
708
|
break;
|
|
704
|
-
case
|
|
705
|
-
_context10.prev =
|
|
706
|
-
_context10.t1 = _context10["catch"](
|
|
709
|
+
case 36:
|
|
710
|
+
_context10.prev = 36;
|
|
711
|
+
_context10.t1 = _context10["catch"](31);
|
|
707
712
|
console.warn('[BookingTicket] idGenerator 配置失败', _context10.t1);
|
|
708
|
-
case
|
|
713
|
+
case 39:
|
|
709
714
|
case "end":
|
|
710
715
|
return _context10.stop();
|
|
711
716
|
}
|
|
712
|
-
}, _callee10, this, [[
|
|
717
|
+
}, _callee10, this, [[7, 13], [31, 36]]);
|
|
713
718
|
}));
|
|
714
719
|
function configureIdGeneratorFromOpenData() {
|
|
715
720
|
return _configureIdGeneratorFromOpenData.apply(this, arguments);
|
|
@@ -1887,8 +1892,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1887
1892
|
}, {
|
|
1888
1893
|
key: "getCustomerContactScope",
|
|
1889
1894
|
value: function getCustomerContactScope() {
|
|
1890
|
-
var _this$
|
|
1891
|
-
return JSON.stringify([this.getPickupTimingScope(), (_this$
|
|
1895
|
+
var _this$otherParams6, _this$otherParams7, _this$otherParams8;
|
|
1896
|
+
return JSON.stringify([this.getPickupTimingScope(), (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.channel, (_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.shop_id, (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.tenantId]);
|
|
1892
1897
|
}
|
|
1893
1898
|
}, {
|
|
1894
1899
|
key: "getCustomerContactOrderKey",
|
|
@@ -1955,7 +1960,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1955
1960
|
key: "prefillOrderCustomerContactInfo",
|
|
1956
1961
|
value: function prefillOrderCustomerContactInfo(customer, customerChanged) {
|
|
1957
1962
|
var _order$_extend2,
|
|
1958
|
-
_this$
|
|
1963
|
+
_this$otherParams9,
|
|
1959
1964
|
_this4 = this;
|
|
1960
1965
|
var order = this.getTempOrder();
|
|
1961
1966
|
var customerId = Number(order === null || order === void 0 ? void 0 : order.customer_id);
|
|
@@ -1971,7 +1976,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1971
1976
|
}
|
|
1972
1977
|
// A relation explicitly returned as null is authoritative. Only a missing relation needs fetching.
|
|
1973
1978
|
if (customer.contacts_info !== undefined) return;
|
|
1974
|
-
var userPlatform = isCustomerUserPlatform((_this$
|
|
1979
|
+
var userPlatform = isCustomerUserPlatform((_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.platform);
|
|
1975
1980
|
var getAuthenticatedCustomerId = function getAuthenticatedCustomerId() {
|
|
1976
1981
|
var _this4$core, _this4$core$getPlugin, _this4$core$getPlugin2;
|
|
1977
1982
|
return Number((_this4$core = _this4.core) === null || _this4$core === void 0 || (_this4$core$getPlugin = _this4$core.getPlugin) === null || _this4$core$getPlugin === void 0 || (_this4$core$getPlugin = _this4$core$getPlugin.call(_this4$core, 'user')) === null || _this4$core$getPlugin === void 0 || (_this4$core$getPlugin2 = _this4$core$getPlugin.get) === null || _this4$core$getPlugin2 === void 0 || (_this4$core$getPlugin2 = _this4$core$getPlugin2.call(_this4$core$getPlugin)) === null || _this4$core$getPlugin2 === void 0 ? void 0 : _this4$core$getPlugin2.id);
|
|
@@ -2741,7 +2746,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2741
2746
|
_extra$presetStartTim,
|
|
2742
2747
|
_this$getOrderSession,
|
|
2743
2748
|
_this8 = this,
|
|
2744
|
-
_this$
|
|
2749
|
+
_this$otherParams10;
|
|
2745
2750
|
var state = this.store.bookingContext.getState();
|
|
2746
2751
|
var date = (_extra$date = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date !== void 0 ? _extra$date : state.date;
|
|
2747
2752
|
return _objectSpread(_objectSpread({
|
|
@@ -2755,7 +2760,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2755
2760
|
isOrderSessionCurrent: function isOrderSessionCurrent(sessionId) {
|
|
2756
2761
|
return _this8.isOrderSessionCurrent(sessionId);
|
|
2757
2762
|
},
|
|
2758
|
-
platform: String(((_this$
|
|
2763
|
+
platform: String(((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.platform) || '').trim().toLowerCase()
|
|
2759
2764
|
});
|
|
2760
2765
|
}
|
|
2761
2766
|
|
|
@@ -2858,7 +2863,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2858
2863
|
_extra$presetStartTim2,
|
|
2859
2864
|
_this$getOrderSession2,
|
|
2860
2865
|
_this9 = this,
|
|
2861
|
-
_this$
|
|
2866
|
+
_this$otherParams11;
|
|
2862
2867
|
var bookingContextState = this.store.bookingContext.getState();
|
|
2863
2868
|
var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
|
|
2864
2869
|
var orderCustomerId = (_ref14 = (_this$getOrderCustome4 = (_this$getOrderCustome5 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome5 === void 0 ? void 0 : _this$getOrderCustome5.id) !== null && _this$getOrderCustome4 !== void 0 ? _this$getOrderCustome4 : (_this$store$order$get5 = this.store.order.getTempOrder()) === null || _this$store$order$get5 === void 0 ? void 0 : _this$store$order$get5.customer_id) !== null && _ref14 !== void 0 ? _ref14 : undefined;
|
|
@@ -2875,7 +2880,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2875
2880
|
isOrderSessionCurrent: function isOrderSessionCurrent(sessionId) {
|
|
2876
2881
|
return _this9.isOrderSessionCurrent(sessionId);
|
|
2877
2882
|
},
|
|
2878
|
-
platform: String(((_this$
|
|
2883
|
+
platform: String(((_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.platform) || '').trim().toLowerCase()
|
|
2879
2884
|
});
|
|
2880
2885
|
}
|
|
2881
2886
|
|
|
@@ -366,7 +366,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
366
366
|
* 获取当前的客户搜索条件
|
|
367
367
|
* @returns 当前搜索条件
|
|
368
368
|
*/
|
|
369
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
369
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
370
370
|
/**
|
|
371
371
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
372
372
|
* @returns 客户状态
|
|
@@ -347,13 +347,14 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
|
|
|
347
347
|
return String(this.getAppData('device_id') || 0).slice(-2);
|
|
348
348
|
}
|
|
349
349
|
async configureIdGeneratorFromOpenData() {
|
|
350
|
+
// Customer storefronts use server-issued order numbers, never local sequences.
|
|
351
|
+
if ((0, _platform.isCustomerUserPlatform)(this.otherParams?.platform)) return;
|
|
352
|
+
|
|
350
353
|
// 业务码切换或配置失败时不能复用上一次初始化的短号。
|
|
351
354
|
this.setPaymentNumberDevicePrefix(null);
|
|
352
355
|
const idGenerator = this.getIdGeneratorPlugin();
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
356
|
+
// Optional host capability. Do not warn or cache absence: POS may register it later.
|
|
357
|
+
if (typeof idGenerator?.configure !== 'function') return;
|
|
357
358
|
let openDataConfig = null;
|
|
358
359
|
try {
|
|
359
360
|
openDataConfig = await this.loadOpenDataConfig();
|