@pisell/pisellos 1.0.108 → 1.0.109
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.
|
@@ -431,8 +431,10 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
431
431
|
|
|
432
432
|
// 对扁平化后的列表按价格降序排序(用于应用优惠券时优先选择高价商品)
|
|
433
433
|
var sortedFlattenedList = flattenedList.sort(function (a, b) {
|
|
434
|
-
var
|
|
435
|
-
|
|
434
|
+
var _ref3, _a$original_price, _ref4, _b$original_price;
|
|
435
|
+
// 子商品优先使用 original_price,主商品使用 price
|
|
436
|
+
var priceA = new Decimal(a.type === 'bundle' ? (_ref3 = (_a$original_price = a.original_price) !== null && _a$original_price !== void 0 ? _a$original_price : a.price) !== null && _ref3 !== void 0 ? _ref3 : '0' : a.price || '0');
|
|
437
|
+
var priceB = new Decimal(b.type === 'bundle' ? (_ref4 = (_b$original_price = b.original_price) !== null && _b$original_price !== void 0 ? _b$original_price : b.price) !== null && _ref4 !== void 0 ? _ref4 : '0' : b.price || '0');
|
|
436
438
|
if (priceA.equals(priceB)) {
|
|
437
439
|
// 价格相同时,主商品优先
|
|
438
440
|
if (a.type !== b.type) {
|
|
@@ -943,8 +945,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
943
945
|
var _product$discount_lis5, _product11, _product11$every;
|
|
944
946
|
// 主商品:判断自身是否手动折扣
|
|
945
947
|
isManualDiscount = typeof product.isManualDiscount === 'boolean' ? product.isManualDiscount : product.total != product.origin_total && (product.bundle || []).every(function (item) {
|
|
946
|
-
var
|
|
947
|
-
return !((
|
|
948
|
+
var _ref5;
|
|
949
|
+
return !((_ref5 = item.discount_list || []) !== null && _ref5 !== void 0 && _ref5.length);
|
|
948
950
|
}) && (!((_product$discount_lis5 = product.discount_list) !== null && _product$discount_lis5 !== void 0 && _product$discount_lis5.length) || ((_product11 = product) === null || _product11 === void 0 || (_product11 = _product11.discount_list) === null || _product11 === void 0 || (_product11$every = _product11.every) === null || _product11$every === void 0 ? void 0 : _product11$every.call(_product11, function (item) {
|
|
949
951
|
return item.type === 'product';
|
|
950
952
|
})));
|
|
@@ -954,8 +956,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
954
956
|
if (parentProduct) {
|
|
955
957
|
var _parentProduct$discou, _parentProduct$discou2, _parentProduct$discou3;
|
|
956
958
|
isManualDiscount = typeof parentProduct.isManualDiscount === 'boolean' ? parentProduct.isManualDiscount : parentProduct.total != parentProduct.origin_total && (parentProduct.bundle || []).every(function (item) {
|
|
957
|
-
var
|
|
958
|
-
return !((
|
|
959
|
+
var _ref6;
|
|
960
|
+
return !((_ref6 = item.discount_list || []) !== null && _ref6 !== void 0 && _ref6.length);
|
|
959
961
|
}) && (!((_parentProduct$discou = parentProduct.discount_list) !== null && _parentProduct$discou !== void 0 && _parentProduct$discou.length) || (parentProduct === null || parentProduct === void 0 || (_parentProduct$discou2 = parentProduct.discount_list) === null || _parentProduct$discou2 === void 0 || (_parentProduct$discou3 = _parentProduct$discou2.every) === null || _parentProduct$discou3 === void 0 ? void 0 : _parentProduct$discou3.call(_parentProduct$discou2, function (item) {
|
|
960
962
|
return item.type === 'product';
|
|
961
963
|
})));
|
|
@@ -115,7 +115,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
115
115
|
* 获取当前的客户搜索条件
|
|
116
116
|
* @returns 当前搜索条件
|
|
117
117
|
*/
|
|
118
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
118
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
119
119
|
/**
|
|
120
120
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
121
121
|
* @returns 客户状态
|
|
@@ -305,8 +305,12 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
305
305
|
const flattenedList = flattenProductsWithBundle(productList);
|
|
306
306
|
const sortedFlattenedList = flattenedList.sort((a, b) => {
|
|
307
307
|
var _a, _b;
|
|
308
|
-
const priceA = new import_decimal.default(
|
|
309
|
-
|
|
308
|
+
const priceA = new import_decimal.default(
|
|
309
|
+
a.type === "bundle" ? a.original_price ?? a.price ?? "0" : a.price || "0"
|
|
310
|
+
);
|
|
311
|
+
const priceB = new import_decimal.default(
|
|
312
|
+
b.type === "bundle" ? b.original_price ?? b.price ?? "0" : b.price || "0"
|
|
313
|
+
);
|
|
310
314
|
if (priceA.equals(priceB)) {
|
|
311
315
|
if (a.type !== b.type) {
|
|
312
316
|
return a.type === "main" ? -1 : 1;
|
|
@@ -115,7 +115,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
115
115
|
* 获取当前的客户搜索条件
|
|
116
116
|
* @returns 当前搜索条件
|
|
117
117
|
*/
|
|
118
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
118
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
119
119
|
/**
|
|
120
120
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
121
121
|
* @returns 客户状态
|