@pisell/pisellos 2.2.284 → 2.2.286
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/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/Order/index.js +17 -16
- package/dist/modules/Order/types.d.ts +3 -0
- package/dist/modules/Order/types.js +1 -0
- package/dist/modules/ProductList/index.js +91 -65
- package/dist/modules/Summary/utils.d.ts +1 -1
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +154 -64
- package/dist/server/modules/order/index.d.ts +8 -0
- package/dist/server/modules/order/index.js +251 -215
- package/dist/solution/BaseSales/index.d.ts +3 -0
- package/dist/solution/BaseSales/index.js +142 -86
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +17 -3
- package/dist/solution/BookingTicket/index.js +13 -4
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/Order/index.js +8 -7
- package/lib/modules/Order/types.d.ts +3 -0
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/ProductList/index.js +7 -1
- package/lib/modules/Summary/utils.d.ts +1 -1
- package/lib/server/index.d.ts +4 -0
- package/lib/server/index.js +83 -2
- package/lib/server/modules/order/index.d.ts +8 -0
- package/lib/server/modules/order/index.js +23 -0
- package/lib/solution/BaseSales/index.d.ts +3 -0
- package/lib/solution/BaseSales/index.js +49 -7
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +17 -3
- package/lib/solution/BookingTicket/index.js +15 -4
- package/package.json +1 -1
|
@@ -136,6 +136,9 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
136
136
|
private getAuthoritativeBundleUnitPrice;
|
|
137
137
|
private mergeProductForPriceQuery;
|
|
138
138
|
protected getSubmitOrderSalesChannel(): string | undefined;
|
|
139
|
+
private getFulfillmentRefModeConfigs;
|
|
140
|
+
private getFulfillmentRefMode;
|
|
141
|
+
private buildSubmitPayloadEnhancerWithFulfillmentRefMode;
|
|
139
142
|
/**
|
|
140
143
|
* 工厂入口:根据子模块名实例化对应模块。
|
|
141
144
|
* 默认使用 BookingByStep 公共 `createModule`。子类若需引入额外类型(如 customer),
|
|
@@ -46,6 +46,7 @@ import { QuotationModule } from "../../modules/Quotation";
|
|
|
46
46
|
import { transformBaseProductToOrderProduct as _transformBaseProductToOrderProduct } from "./utils/transformBaseProductToOrderProduct";
|
|
47
47
|
import { calculateBaseSalesProductBookingPrice } from "./utils/quotationPrice";
|
|
48
48
|
var SERVER_ORDER_CHANGED_EVENT = 'order:onOrdersChanged';
|
|
49
|
+
var OS_FULFILLMENT_REF_MODE_FIELD = '_os_fulfillment_ref_mode';
|
|
49
50
|
var WALLET_PAYMENT_CODE_BY_TAG = {
|
|
50
51
|
product_voucher: 'PRODUCTVOUCHER',
|
|
51
52
|
gift_card: 'GIFTCARD',
|
|
@@ -1200,6 +1201,45 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1200
1201
|
var _this$otherParams8;
|
|
1201
1202
|
return (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.channel;
|
|
1202
1203
|
}
|
|
1204
|
+
}, {
|
|
1205
|
+
key: "getFulfillmentRefModeConfigs",
|
|
1206
|
+
value: function getFulfillmentRefModeConfigs() {
|
|
1207
|
+
var _this$otherParams9, _this$otherParams10, _this$store, _this$store$getOpenDa;
|
|
1208
|
+
var candidates = [(_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.openData, (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.dineInConfig, (_this$store = this.store) === null || _this$store === void 0 || (_this$store = _this$store.openData) === null || _this$store === void 0 || (_this$store$getOpenDa = _this$store.getOpenData) === null || _this$store$getOpenDa === void 0 ? void 0 : _this$store$getOpenDa.call(_this$store)];
|
|
1209
|
+
return candidates.filter(function (candidate) {
|
|
1210
|
+
return candidate && _typeof(candidate) === 'object' && !Array.isArray(candidate);
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
}, {
|
|
1214
|
+
key: "getFulfillmentRefMode",
|
|
1215
|
+
value: function getFulfillmentRefMode() {
|
|
1216
|
+
var _iterator2 = _createForOfIteratorHelper(this.getFulfillmentRefModeConfigs()),
|
|
1217
|
+
_step2;
|
|
1218
|
+
try {
|
|
1219
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1220
|
+
var config = _step2.value;
|
|
1221
|
+
var mode = config['fulfillment.fulfillment_ref_mode'];
|
|
1222
|
+
if (mode === undefined || mode === null) continue;
|
|
1223
|
+
var normalized = String(mode).trim();
|
|
1224
|
+
if (normalized) return normalized;
|
|
1225
|
+
}
|
|
1226
|
+
} catch (err) {
|
|
1227
|
+
_iterator2.e(err);
|
|
1228
|
+
} finally {
|
|
1229
|
+
_iterator2.f();
|
|
1230
|
+
}
|
|
1231
|
+
return undefined;
|
|
1232
|
+
}
|
|
1233
|
+
}, {
|
|
1234
|
+
key: "buildSubmitPayloadEnhancerWithFulfillmentRefMode",
|
|
1235
|
+
value: function buildSubmitPayloadEnhancerWithFulfillmentRefMode(enhancePayload) {
|
|
1236
|
+
var fulfillmentRefMode = this.getFulfillmentRefMode();
|
|
1237
|
+
if (!fulfillmentRefMode) return enhancePayload;
|
|
1238
|
+
return function (payload, ctx) {
|
|
1239
|
+
var enhancedPayload = enhancePayload ? enhancePayload(payload, ctx) : payload;
|
|
1240
|
+
return _objectSpread(_objectSpread({}, enhancedPayload), {}, _defineProperty({}, OS_FULFILLMENT_REF_MODE_FIELD, fulfillmentRefMode));
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1203
1243
|
|
|
1204
1244
|
/**
|
|
1205
1245
|
* 工厂入口:根据子模块名实例化对应模块。
|
|
@@ -1428,11 +1468,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1428
1468
|
key: "initialize",
|
|
1429
1469
|
value: function () {
|
|
1430
1470
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(core) {
|
|
1431
|
-
var _this$
|
|
1471
|
+
var _this$otherParams11,
|
|
1432
1472
|
_this$appPlugin2,
|
|
1433
1473
|
_this$appPlugin2$getA,
|
|
1434
1474
|
_this9 = this,
|
|
1435
|
-
_this$
|
|
1475
|
+
_this$otherParams12;
|
|
1436
1476
|
var options,
|
|
1437
1477
|
app,
|
|
1438
1478
|
targetCacheData,
|
|
@@ -1447,7 +1487,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1447
1487
|
this.paymentNumberDevicePrefix = null;
|
|
1448
1488
|
// this.store = { ...this.store, ...(options.store as Partial<BaseSalesState>) };
|
|
1449
1489
|
this.otherParams = options.otherParams || {};
|
|
1450
|
-
this.cacheId = (_this$
|
|
1490
|
+
this.cacheId = (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.cacheId;
|
|
1451
1491
|
this.reusedSharedSubModuleNames.clear();
|
|
1452
1492
|
this.window = core.getPlugin('window');
|
|
1453
1493
|
this.request = core.getPlugin('request');
|
|
@@ -1489,7 +1529,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1489
1529
|
_context12.next = 19;
|
|
1490
1530
|
return this.store.schedule.loadAllSchedule();
|
|
1491
1531
|
case 19:
|
|
1492
|
-
if (this.store.order && typeof ((_this$
|
|
1532
|
+
if (this.store.order && typeof ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.enableTempOrderPersist) === 'boolean') {
|
|
1493
1533
|
this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
|
|
1494
1534
|
}
|
|
1495
1535
|
_context12.next = 22;
|
|
@@ -2157,12 +2197,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2157
2197
|
return !_this12.isPersistedOrderProduct(product);
|
|
2158
2198
|
});
|
|
2159
2199
|
if (hasDraftProduct) return false;
|
|
2160
|
-
|
|
2161
|
-
|
|
2200
|
+
|
|
2201
|
+
// 编辑详情 hydrate 时,商品行上的历史券卡会被还原为 isEditMode=true、
|
|
2202
|
+
// isSelected=true 的只读记录。它们表示“该折扣已在原订单结算”,不是用户在
|
|
2203
|
+
// 当前编辑会话中新做的选择,不能据此放行刚从 prepare/config 拉回来的折扣。
|
|
2204
|
+
// 否则后续 Rules.calcDiscount 会把没有 isManualSelect 标记的可用 runtime 卡
|
|
2205
|
+
// 当作自动候选,再次写入 tempOrder。这里只识别非 isEditMode 的 runtime 状态;
|
|
2206
|
+
// 新建单、编辑态新增商品以及用户本次明确选择/取消折扣的原有流程保持不变。
|
|
2207
|
+
var hasRuntimeDiscountSelection = params.currentDiscountList.some(function (discount) {
|
|
2208
|
+
return !discount.isEditMode && (discount.isSelected || discount.isManualSelect);
|
|
2162
2209
|
});
|
|
2163
|
-
if (
|
|
2210
|
+
if (hasRuntimeDiscountSelection) return false;
|
|
2211
|
+
|
|
2212
|
+
// nextDiscountList 已经合并了历史只读折扣与本次获取的 runtime 折扣,
|
|
2213
|
+
// 因此这里同样必须排除 isEditMode;只有 runtime 条目已有明确选择状态时,
|
|
2214
|
+
// 才允许继续进入折扣重算。
|
|
2164
2215
|
return !params.nextDiscountList.some(function (discount) {
|
|
2165
|
-
return discount.
|
|
2216
|
+
return !discount.isEditMode && (discount.isSelected || discount.isManualSelect);
|
|
2166
2217
|
});
|
|
2167
2218
|
}
|
|
2168
2219
|
}, {
|
|
@@ -2196,7 +2247,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2196
2247
|
value: function () {
|
|
2197
2248
|
var _loadDiscountConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
|
|
2198
2249
|
var _this$getOrderIdentit, _tempOrder$customer, _tempOrder$_extend, _tempOrder$_extend2, _discountModule$getDi, _discountModule$getOr, _discountModule$getDi2;
|
|
2199
|
-
var tempOrder, orderStore, discountModule, rulesModule, orderId, customerId, currentDiscountList, originalDiscountList, hasManualDiscountSelection, discountAction, discountConfigCacheKey, preparedDiscountList, _discountModule$setOr, nextDiscountList, shouldSkipAutoApplyFetchedDiscounts, _summary, _orderStore$summary, orderTotalAmount, result,
|
|
2250
|
+
var tempOrder, orderStore, discountModule, rulesModule, orderId, customerId, currentDiscountList, originalDiscountList, hasManualDiscountSelection, discountAction, discountConfigCacheKey, preparedDiscountList, _discountModule$setOr, nextDiscountList, shouldSkipAutoApplyFetchedDiscounts, _summary, _orderStore$summary, orderTotalAmount, result, _iterator3, _step3, _product$metadata5, _tempOrder$_extend3, _product$metadata$sou, _product$metadata6, _product$metadata7, _product$original_pri, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, summary;
|
|
2200
2251
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2201
2252
|
while (1) switch (_context21.prev = _context21.next) {
|
|
2202
2253
|
case 0:
|
|
@@ -2311,15 +2362,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2311
2362
|
if (result.productList) {
|
|
2312
2363
|
tempOrder.products = preserveManualProductDiscountProducts(tempOrder.products, result.productList);
|
|
2313
2364
|
}
|
|
2314
|
-
|
|
2365
|
+
_iterator3 = _createForOfIteratorHelper(tempOrder.products || []);
|
|
2315
2366
|
_context21.prev = 45;
|
|
2316
|
-
|
|
2367
|
+
_iterator3.s();
|
|
2317
2368
|
case 47:
|
|
2318
|
-
if ((
|
|
2369
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
2319
2370
|
_context21.next = 62;
|
|
2320
2371
|
break;
|
|
2321
2372
|
}
|
|
2322
|
-
product =
|
|
2373
|
+
product = _step3.value;
|
|
2323
2374
|
productUid = (_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.unique_identification_number;
|
|
2324
2375
|
runtimeOrigin = productUid ? (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[productUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin : undefined;
|
|
2325
2376
|
if (!(runtimeOrigin !== null && runtimeOrigin !== void 0 && runtimeOrigin.isManualDiscount || isBaseSalesManualProductDiscountProduct(product))) {
|
|
@@ -2352,10 +2403,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2352
2403
|
case 64:
|
|
2353
2404
|
_context21.prev = 64;
|
|
2354
2405
|
_context21.t0 = _context21["catch"](45);
|
|
2355
|
-
|
|
2406
|
+
_iterator3.e(_context21.t0);
|
|
2356
2407
|
case 67:
|
|
2357
2408
|
_context21.prev = 67;
|
|
2358
|
-
|
|
2409
|
+
_iterator3.f();
|
|
2359
2410
|
return _context21.finish(67);
|
|
2360
2411
|
case 70:
|
|
2361
2412
|
if (!result.discountList) {
|
|
@@ -2628,7 +2679,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2628
2679
|
key: "setDiscountSelected",
|
|
2629
2680
|
value: function () {
|
|
2630
2681
|
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(params) {
|
|
2631
|
-
var list, updated, tempOrder, orderStore, discountModule, rulesModule, nextDiscountList, _orderStore$summary3, orderTotalAmount, result, beforeSelectedIds,
|
|
2682
|
+
var list, updated, tempOrder, orderStore, discountModule, rulesModule, nextDiscountList, _orderStore$summary3, orderTotalAmount, result, beforeSelectedIds, _iterator4, _step4, d, selectedResourceIds, filterSelectedDiscountDetails, _iterator5, _step5, _product$metadata8, _tempOrder$_extend4, _product$metadata$sou2, _product$metadata9, _product$metadata10, _product$original_pri2, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice;
|
|
2632
2683
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
2633
2684
|
while (1) switch (_context25.prev = _context25.next) {
|
|
2634
2685
|
case 0:
|
|
@@ -2683,10 +2734,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2683
2734
|
}).map(function (d) {
|
|
2684
2735
|
return d.id;
|
|
2685
2736
|
}));
|
|
2686
|
-
|
|
2737
|
+
_iterator4 = _createForOfIteratorHelper(nextDiscountList);
|
|
2687
2738
|
try {
|
|
2688
|
-
for (
|
|
2689
|
-
d =
|
|
2739
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
2740
|
+
d = _step4.value;
|
|
2690
2741
|
if (d.isSelected && !beforeSelectedIds.has(d.id)) {
|
|
2691
2742
|
d.isSelected = false;
|
|
2692
2743
|
d.isManualSelect = true;
|
|
@@ -2694,9 +2745,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2694
2745
|
}
|
|
2695
2746
|
}
|
|
2696
2747
|
} catch (err) {
|
|
2697
|
-
|
|
2748
|
+
_iterator4.e(err);
|
|
2698
2749
|
} finally {
|
|
2699
|
-
|
|
2750
|
+
_iterator4.f();
|
|
2700
2751
|
}
|
|
2701
2752
|
}
|
|
2702
2753
|
}
|
|
@@ -2713,15 +2764,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2713
2764
|
return rid != null && selectedResourceIds.has(rid);
|
|
2714
2765
|
});
|
|
2715
2766
|
};
|
|
2716
|
-
|
|
2767
|
+
_iterator5 = _createForOfIteratorHelper(tempOrder.products);
|
|
2717
2768
|
_context25.prev = 17;
|
|
2718
|
-
|
|
2769
|
+
_iterator5.s();
|
|
2719
2770
|
case 19:
|
|
2720
|
-
if ((
|
|
2771
|
+
if ((_step5 = _iterator5.n()).done) {
|
|
2721
2772
|
_context25.next = 36;
|
|
2722
2773
|
break;
|
|
2723
2774
|
}
|
|
2724
|
-
product =
|
|
2775
|
+
product = _step5.value;
|
|
2725
2776
|
productUid = (_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.unique_identification_number;
|
|
2726
2777
|
runtimeOrigin = productUid ? (_tempOrder$_extend4 = tempOrder._extend) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4.productsByUid) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4[productUid]) === null || _tempOrder$_extend4 === void 0 ? void 0 : _tempOrder$_extend4.origin : undefined;
|
|
2727
2778
|
if (!(runtimeOrigin !== null && runtimeOrigin !== void 0 && runtimeOrigin.isManualDiscount || isBaseSalesManualProductDiscountProduct(product))) {
|
|
@@ -2772,10 +2823,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2772
2823
|
case 38:
|
|
2773
2824
|
_context25.prev = 38;
|
|
2774
2825
|
_context25.t0 = _context25["catch"](17);
|
|
2775
|
-
|
|
2826
|
+
_iterator5.e(_context25.t0);
|
|
2776
2827
|
case 41:
|
|
2777
2828
|
_context25.prev = 41;
|
|
2778
|
-
|
|
2829
|
+
_iterator5.f();
|
|
2779
2830
|
return _context25.finish(41);
|
|
2780
2831
|
case 44:
|
|
2781
2832
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
@@ -2913,8 +2964,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2913
2964
|
key: "submitSalesOrder",
|
|
2914
2965
|
value: (function () {
|
|
2915
2966
|
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
|
|
2916
|
-
var _params$smallTicketDa, _this$
|
|
2917
|
-
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2967
|
+
var _params$smallTicketDa, _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams16;
|
|
2968
|
+
var inferredPaymentStatus, smallTicketDataFlag, enhancePayload, submitParams;
|
|
2918
2969
|
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2919
2970
|
while (1) switch (_context28.prev = _context28.next) {
|
|
2920
2971
|
case 0:
|
|
@@ -2927,12 +2978,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2927
2978
|
// this.store.order.persistTempOrder();
|
|
2928
2979
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
2929
2980
|
smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2981
|
+
enhancePayload = this.buildSubmitPayloadEnhancerWithFulfillmentRefMode(params === null || params === void 0 ? void 0 : params.enhancePayload);
|
|
2930
2982
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2931
2983
|
cacheId: this.cacheId,
|
|
2932
|
-
platform: (_this$
|
|
2933
|
-
businessCode: ((_this$
|
|
2984
|
+
platform: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.platform,
|
|
2985
|
+
businessCode: ((_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode) || ((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.business_code),
|
|
2934
2986
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2935
|
-
type: (_this$
|
|
2987
|
+
type: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.type,
|
|
2936
2988
|
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
2937
2989
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
2938
2990
|
payments: params.payments
|
|
@@ -2942,11 +2994,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2942
2994
|
smallTicketDataFlag: smallTicketDataFlag
|
|
2943
2995
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
2944
2996
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
2945
|
-
} : {}),
|
|
2946
|
-
enhancePayload:
|
|
2997
|
+
} : {}), enhancePayload !== undefined ? {
|
|
2998
|
+
enhancePayload: enhancePayload
|
|
2947
2999
|
} : {});
|
|
2948
3000
|
return _context28.abrupt("return", this.shouldUseCheckoutSyncTask() ? this.store.order.submitTempOrder(submitParams) : this.store.order.submitTempOrderAsync(submitParams));
|
|
2949
|
-
case
|
|
3001
|
+
case 7:
|
|
2950
3002
|
case "end":
|
|
2951
3003
|
return _context28.stop();
|
|
2952
3004
|
}
|
|
@@ -2961,7 +3013,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2961
3013
|
key: "saveSalesOrderDraft",
|
|
2962
3014
|
value: function () {
|
|
2963
3015
|
var _saveSalesOrderDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
|
|
2964
|
-
var _params$platform, _this$
|
|
3016
|
+
var _params$platform, _this$otherParams17, _this$otherParams18, _this$otherParams19, _params$channel, _params$type, _this$otherParams20;
|
|
2965
3017
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2966
3018
|
while (1) switch (_context29.prev = _context29.next) {
|
|
2967
3019
|
case 0:
|
|
@@ -2973,10 +3025,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2973
3025
|
case 2:
|
|
2974
3026
|
return _context29.abrupt("return", this.store.order.saveTempOrderAsDraft(_objectSpread({
|
|
2975
3027
|
cacheId: this.cacheId,
|
|
2976
|
-
platform: (_params$platform = params === null || params === void 0 ? void 0 : params.platform) !== null && _params$platform !== void 0 ? _params$platform : (_this$
|
|
2977
|
-
businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$
|
|
3028
|
+
platform: (_params$platform = params === null || params === void 0 ? void 0 : params.platform) !== null && _params$platform !== void 0 ? _params$platform : (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.platform,
|
|
3029
|
+
businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.businessCode) || ((_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.business_code),
|
|
2978
3030
|
channel: (_params$channel = params === null || params === void 0 ? void 0 : params.channel) !== null && _params$channel !== void 0 ? _params$channel : this.getSubmitOrderSalesChannel(),
|
|
2979
|
-
type: (_params$type = params === null || params === void 0 ? void 0 : params.type) !== null && _params$type !== void 0 ? _params$type : (_this$
|
|
3031
|
+
type: (_params$type = params === null || params === void 0 ? void 0 : params.type) !== null && _params$type !== void 0 ? _params$type : (_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.type
|
|
2980
3032
|
}, (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2981
3033
|
enhancePayload: params.enhancePayload
|
|
2982
3034
|
} : {})));
|
|
@@ -2995,8 +3047,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2995
3047
|
key: "submitTempOrderAsync",
|
|
2996
3048
|
value: function () {
|
|
2997
3049
|
var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(params) {
|
|
2998
|
-
var _params$smallTicketDa2, _this$
|
|
2999
|
-
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
3050
|
+
var _params$smallTicketDa2, _this$otherParams21, _this$otherParams22, _this$otherParams23, _this$otherParams24;
|
|
3051
|
+
var inferredPaymentStatus, smallTicketDataFlag, enhancePayload, submitParams;
|
|
3000
3052
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
3001
3053
|
while (1) switch (_context30.prev = _context30.next) {
|
|
3002
3054
|
case 0:
|
|
@@ -3008,12 +3060,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3008
3060
|
case 2:
|
|
3009
3061
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
3010
3062
|
smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
3063
|
+
enhancePayload = this.buildSubmitPayloadEnhancerWithFulfillmentRefMode(params === null || params === void 0 ? void 0 : params.enhancePayload);
|
|
3011
3064
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
3012
3065
|
cacheId: this.cacheId,
|
|
3013
|
-
platform: (_this$
|
|
3014
|
-
businessCode: ((_this$
|
|
3066
|
+
platform: (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.platform,
|
|
3067
|
+
businessCode: ((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.businessCode) || ((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.business_code),
|
|
3015
3068
|
channel: this.getSubmitOrderSalesChannel(),
|
|
3016
|
-
type: (_this$
|
|
3069
|
+
type: (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.type,
|
|
3017
3070
|
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
3018
3071
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
3019
3072
|
payments: params.payments
|
|
@@ -3023,11 +3076,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3023
3076
|
smallTicketDataFlag: smallTicketDataFlag
|
|
3024
3077
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
3025
3078
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
3026
|
-
} : {}),
|
|
3027
|
-
enhancePayload:
|
|
3079
|
+
} : {}), enhancePayload !== undefined ? {
|
|
3080
|
+
enhancePayload: enhancePayload
|
|
3028
3081
|
} : {});
|
|
3029
3082
|
return _context30.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
|
|
3030
|
-
case
|
|
3083
|
+
case 7:
|
|
3031
3084
|
case "end":
|
|
3032
3085
|
return _context30.stop();
|
|
3033
3086
|
}
|
|
@@ -3045,8 +3098,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3045
3098
|
}, {
|
|
3046
3099
|
key: "shouldUseCheckoutSyncTask",
|
|
3047
3100
|
value: function shouldUseCheckoutSyncTask() {
|
|
3048
|
-
var _this$
|
|
3049
|
-
var configured = (_this$
|
|
3101
|
+
var _this$otherParams25;
|
|
3102
|
+
var configured = (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.checkoutSyncTaskEnabled;
|
|
3050
3103
|
return typeof configured === 'boolean' ? configured : true;
|
|
3051
3104
|
}
|
|
3052
3105
|
|
|
@@ -3060,7 +3113,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3060
3113
|
key: "printLocalOrderReceipt",
|
|
3061
3114
|
value: function () {
|
|
3062
3115
|
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(lookup) {
|
|
3063
|
-
var _this$
|
|
3116
|
+
var _this$otherParams26, _this$otherParams27, _this$otherParams28, _this$otherParams29;
|
|
3064
3117
|
var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
|
|
3065
3118
|
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
3066
3119
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -3078,10 +3131,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3078
3131
|
external_sale_number: lookup
|
|
3079
3132
|
};
|
|
3080
3133
|
context = {
|
|
3081
|
-
platform: (_this$
|
|
3082
|
-
businessCode: ((_this$
|
|
3134
|
+
platform: (_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.platform,
|
|
3135
|
+
businessCode: ((_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.businessCode) || ((_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.business_code),
|
|
3083
3136
|
channel: this.getSubmitOrderSalesChannel(),
|
|
3084
|
-
type: (_this$
|
|
3137
|
+
type: (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.type
|
|
3085
3138
|
};
|
|
3086
3139
|
payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
3087
3140
|
lookup_order_from_db: 1,
|
|
@@ -3140,8 +3193,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3140
3193
|
key: "syncPaymentsToOrder",
|
|
3141
3194
|
value: function () {
|
|
3142
3195
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
|
|
3143
|
-
var _ref32, _params$businessCode, _this$
|
|
3144
|
-
var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
3196
|
+
var _ref32, _params$businessCode, _this$otherParams30, _this$otherParams31, _params$channel2;
|
|
3197
|
+
var businessCode, channel, enhancePayload, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
3145
3198
|
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
3146
3199
|
while (1) switch (_context32.prev = _context32.next) {
|
|
3147
3200
|
case 0:
|
|
@@ -3151,36 +3204,39 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3151
3204
|
}
|
|
3152
3205
|
throw new Error('order 模块未初始化');
|
|
3153
3206
|
case 2:
|
|
3154
|
-
businessCode = (_ref32 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$
|
|
3207
|
+
businessCode = (_ref32 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.businessCode) !== null && _ref32 !== void 0 ? _ref32 : (_this$otherParams31 = this.otherParams) === null || _this$otherParams31 === void 0 ? void 0 : _this$otherParams31.business_code;
|
|
3155
3208
|
channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
|
|
3156
|
-
|
|
3209
|
+
enhancePayload = this.buildSubmitPayloadEnhancerWithFulfillmentRefMode(params.enhancePayload);
|
|
3210
|
+
syncParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, params), {}, {
|
|
3157
3211
|
checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
|
|
3158
3212
|
}, businessCode !== undefined ? {
|
|
3159
3213
|
businessCode: businessCode
|
|
3160
3214
|
} : {}), channel !== undefined ? {
|
|
3161
3215
|
channel: channel
|
|
3216
|
+
} : {}), enhancePayload !== undefined ? {
|
|
3217
|
+
enhancePayload: enhancePayload
|
|
3162
3218
|
} : {});
|
|
3163
3219
|
syncState = this.store.order.getOrderSyncState();
|
|
3164
3220
|
if (!(params.submitWhenPaid && syncState === 'submitting')) {
|
|
3165
|
-
_context32.next =
|
|
3221
|
+
_context32.next = 10;
|
|
3166
3222
|
break;
|
|
3167
3223
|
}
|
|
3168
3224
|
this.queueLatestAutoPaymentSync();
|
|
3169
3225
|
return _context32.abrupt("return", this.store.order.syncPaymentsToOrder(syncParams));
|
|
3170
|
-
case
|
|
3226
|
+
case 10:
|
|
3171
3227
|
payments = params.payments || [];
|
|
3172
|
-
_context32.next =
|
|
3228
|
+
_context32.next = 13;
|
|
3173
3229
|
return this.effectsEmit(BaseSalesHookNames.onPaymentSyncStart, {
|
|
3174
3230
|
payments: payments,
|
|
3175
3231
|
params: syncParams,
|
|
3176
3232
|
amountSnapshot: this.store.order.getOrderAmountSnapshot(),
|
|
3177
3233
|
orderSnapshot: this.store.order.getOrderSnapshot()
|
|
3178
3234
|
});
|
|
3179
|
-
case
|
|
3180
|
-
_context32.prev =
|
|
3181
|
-
_context32.next =
|
|
3235
|
+
case 13:
|
|
3236
|
+
_context32.prev = 13;
|
|
3237
|
+
_context32.next = 16;
|
|
3182
3238
|
return this.store.order.syncPaymentsToOrder(syncParams);
|
|
3183
|
-
case
|
|
3239
|
+
case 16:
|
|
3184
3240
|
syncResult = _context32.sent;
|
|
3185
3241
|
latestPayments = this.store.order.getOrderPayments();
|
|
3186
3242
|
amountSnapshot = this.store.order.getOrderAmountSnapshot();
|
|
@@ -3199,22 +3255,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3199
3255
|
depositAmount: syncResult.depositAmount,
|
|
3200
3256
|
orderExpectedAmount: syncResult.orderExpectedAmount
|
|
3201
3257
|
};
|
|
3202
|
-
_context32.next =
|
|
3258
|
+
_context32.next = 23;
|
|
3203
3259
|
return this.effectsEmit(BaseSalesHookNames.onPaymentSyncEnd, syncPayload);
|
|
3204
|
-
case
|
|
3260
|
+
case 23:
|
|
3205
3261
|
if (!(syncResult.isDepositFullyPaid && !syncResult.isOrderFullyPaid)) {
|
|
3206
|
-
_context32.next =
|
|
3262
|
+
_context32.next = 26;
|
|
3207
3263
|
break;
|
|
3208
3264
|
}
|
|
3209
|
-
_context32.next =
|
|
3265
|
+
_context32.next = 26;
|
|
3210
3266
|
return this.effectsEmit(BaseSalesHookNames.onDepositPaymentSyncEnd, syncPayload);
|
|
3211
|
-
case
|
|
3267
|
+
case 26:
|
|
3212
3268
|
this.scheduleQueuedAutoPaymentSyncFlush(0);
|
|
3213
3269
|
return _context32.abrupt("return", syncResult);
|
|
3214
|
-
case
|
|
3215
|
-
_context32.prev =
|
|
3216
|
-
_context32.t0 = _context32["catch"](
|
|
3217
|
-
_context32.next =
|
|
3270
|
+
case 30:
|
|
3271
|
+
_context32.prev = 30;
|
|
3272
|
+
_context32.t0 = _context32["catch"](13);
|
|
3273
|
+
_context32.next = 34;
|
|
3218
3274
|
return this.effectsEmit(BaseSalesHookNames.onPaymentSyncEnd, {
|
|
3219
3275
|
ok: false,
|
|
3220
3276
|
error: _context32.t0,
|
|
@@ -3223,14 +3279,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3223
3279
|
amountSnapshot: this.store.order.getOrderAmountSnapshot(),
|
|
3224
3280
|
orderSnapshot: this.store.order.getOrderSnapshot()
|
|
3225
3281
|
});
|
|
3226
|
-
case
|
|
3282
|
+
case 34:
|
|
3227
3283
|
this.scheduleQueuedAutoPaymentSyncFlush(0);
|
|
3228
3284
|
throw _context32.t0;
|
|
3229
|
-
case
|
|
3285
|
+
case 36:
|
|
3230
3286
|
case "end":
|
|
3231
3287
|
return _context32.stop();
|
|
3232
3288
|
}
|
|
3233
|
-
}, _callee32, this, [[
|
|
3289
|
+
}, _callee32, this, [[13, 30]]);
|
|
3234
3290
|
}));
|
|
3235
3291
|
function syncPaymentsToOrder(_x28) {
|
|
3236
3292
|
return _syncPaymentsToOrder.apply(this, arguments);
|
|
@@ -3410,7 +3466,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3410
3466
|
}, {
|
|
3411
3467
|
key: "addOrderPaymentWithDevicePrefix",
|
|
3412
3468
|
value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
|
|
3413
|
-
var _this$
|
|
3469
|
+
var _this$otherParams32,
|
|
3414
3470
|
_paymentRecord$paymen,
|
|
3415
3471
|
_paymentRecord$create,
|
|
3416
3472
|
_ref33,
|
|
@@ -3426,7 +3482,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3426
3482
|
return this.store.order.getOrderPayments();
|
|
3427
3483
|
}
|
|
3428
3484
|
var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
|
|
3429
|
-
var shopWalletPassId = (_this$
|
|
3485
|
+
var shopWalletPassId = (_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32.shop_wallet_pass_id;
|
|
3430
3486
|
if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
|
|
3431
3487
|
metadata.shop_wallet_pass_id = shopWalletPassId;
|
|
3432
3488
|
}
|
|
@@ -4325,7 +4381,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4325
4381
|
key: "getCashPaymentConfig",
|
|
4326
4382
|
value: (function () {
|
|
4327
4383
|
var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
|
|
4328
|
-
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$
|
|
4384
|
+
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams33;
|
|
4329
4385
|
var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
|
|
4330
4386
|
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
4331
4387
|
while (1) switch (_context47.prev = _context47.next) {
|
|
@@ -4351,7 +4407,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4351
4407
|
amountSnapshot = (_this$store$order11 = this.store.order) === null || _this$store$order11 === void 0 || (_this$store$order11$g = _this$store$order11.getOrderAmountSnapshot) === null || _this$store$order11$g === void 0 ? void 0 : _this$store$order11$g.call(_this$store$order11);
|
|
4352
4408
|
pendingWalletAmount = this.getPendingWalletPaymentAmount();
|
|
4353
4409
|
amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
|
|
4354
|
-
currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$
|
|
4410
|
+
currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$otherParams33 = this.otherParams) === null || _this$otherParams33 === void 0 ? void 0 : _this$otherParams33.currency) || 'USD';
|
|
4355
4411
|
recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
|
|
4356
4412
|
return _context47.abrupt("return", {
|
|
4357
4413
|
available: Boolean(paymentMethod && amountDue > 0),
|
|
@@ -4486,7 +4542,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4486
4542
|
key: "payCash",
|
|
4487
4543
|
value: (function () {
|
|
4488
4544
|
var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(params) {
|
|
4489
|
-
var _this$store$order$get6, _params$actualPaidAmo, _this$
|
|
4545
|
+
var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams34, _this$window, _this$window$postMess;
|
|
4490
4546
|
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
|
|
4491
4547
|
return _regeneratorRuntime().wrap(function _callee49$(_context49) {
|
|
4492
4548
|
while (1) switch (_context49.prev = _context49.next) {
|
|
@@ -4535,7 +4591,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4535
4591
|
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4536
4592
|
actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
|
|
4537
4593
|
changeAmount = Number(params.changeAmount || 0);
|
|
4538
|
-
shopWalletPassId = (_this$
|
|
4594
|
+
shopWalletPassId = (_this$otherParams34 = this.otherParams) === null || _this$otherParams34 === void 0 ? void 0 : _this$otherParams34.shop_wallet_pass_id;
|
|
4539
4595
|
if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
|
|
4540
4596
|
_context49.next = 26;
|
|
4541
4597
|
break;
|
|
@@ -5470,13 +5526,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5470
5526
|
key: "getProductList",
|
|
5471
5527
|
value: function () {
|
|
5472
5528
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64() {
|
|
5473
|
-
var _this$
|
|
5529
|
+
var _this$otherParams35;
|
|
5474
5530
|
var menu_list_ids, _this$store$products, res;
|
|
5475
5531
|
return _regeneratorRuntime().wrap(function _callee64$(_context64) {
|
|
5476
5532
|
while (1) switch (_context64.prev = _context64.next) {
|
|
5477
5533
|
case 0:
|
|
5478
5534
|
// 可以直接通过配置里的 menu 读取
|
|
5479
|
-
menu_list_ids = ((_this$
|
|
5535
|
+
menu_list_ids = ((_this$otherParams35 = this.otherParams) === null || _this$otherParams35 === void 0 || (_this$otherParams35 = _this$otherParams35.dineInConfig) === null || _this$otherParams35 === void 0 ? void 0 : _this$otherParams35['menu.associated_menus'].map(function (n) {
|
|
5480
5536
|
return Number(n.value);
|
|
5481
5537
|
})) || [];
|
|
5482
5538
|
_context64.prev = 1;
|
|
@@ -5514,7 +5570,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5514
5570
|
key: "setOtherParams",
|
|
5515
5571
|
value: function () {
|
|
5516
5572
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(params) {
|
|
5517
|
-
var _this$
|
|
5573
|
+
var _this$otherParams36;
|
|
5518
5574
|
var _ref42,
|
|
5519
5575
|
_ref42$cover,
|
|
5520
5576
|
cover,
|
|
@@ -5528,7 +5584,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5528
5584
|
} else {
|
|
5529
5585
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
5530
5586
|
}
|
|
5531
|
-
this.cacheId = (_this$
|
|
5587
|
+
this.cacheId = (_this$otherParams36 = this.otherParams) === null || _this$otherParams36 === void 0 ? void 0 : _this$otherParams36.cacheId;
|
|
5532
5588
|
_context65.next = 5;
|
|
5533
5589
|
return this.syncOtherParamsToSubModules(params, {
|
|
5534
5590
|
cover: cover
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 | 1 |
|
|
329
|
+
weekNum: 0 | 1 | 5 | 2 | 4 | 3 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
345
345
|
count: number;
|
|
346
346
|
left: number;
|
|
347
347
|
summaryCount: number;
|
|
348
|
-
status: "
|
|
348
|
+
status: "sold_out" | "lots_of_space" | "filling_up_fast";
|
|
349
349
|
}[];
|
|
350
350
|
/**
|
|
351
351
|
* 找到多个资源的公共可用时间段
|